From ec582ac9f99df10f967739c0437434a09c4791d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Nov 2026 16:04:49 +0800 Subject: [PATCH] fix(submit): repair placeholder, code block, hidden block and settings toggles - placeholder: hide the body ::before hint once the editor body has focus, so clicking an empty document no longer leaves the hint sitting under the caret - code block: edit as a bare
 and convert to pre > code on save. TinyMCE
  treats pre > code as an inline boundary, so typing there leaked into the
  following paragraph; Enlighter also splits lines on newlines, so the 
the editor produced rendered the whole block as one overflowing line - code block: align the iframe rendering with Enlighter (Menlo 13px/1.4, #f8f9fa, 8px radius, 12px 17px padding, nowrap) in both content CSS files - code block: move the caret into the block after insertion - hidden block: hang the block-delete overlay on documentElement instead of body. data-mce-bogus only skips serialization, so the extra body child made mceInsertContent wipe the document and drop the first hidden block - settings: give the toggle a real 44x24 hit area, align it to the top of the row, add aria-labels and show the disabled state - styles: drop the duplicated @use/@import of publish-drawer and block-tools - media insert/embed now serialize through serializeBlocks so code blocks are never stored in editor form --- .../src/components/publish-settings.tsx | 2 + .../src/editor-content-style.ts | 30 +++-- assets/creator-studio/src/editor-runtime.ts | 13 ++- assets/creator-studio/src/index.tsx | 33 +++++- .../creator-studio/src/panels/pay-panel.tsx | 1 + .../src/styles/_publish-drawer.scss | 40 ++++++- assets/creator-studio/src/styles/studio.scss | 12 +- .../creator-studio/src/utils/block-markup.ts | 10 +- assets/creator-studio/src/utils/serialize.ts | 107 +++++++++++++++++- assets/css/frontend/pages/submit-editor.css | 28 +++-- .../creator-studio-contract.test.cjs | 28 +++-- 11 files changed, 248 insertions(+), 56 deletions(-) diff --git a/assets/creator-studio/src/components/publish-settings.tsx b/assets/creator-studio/src/components/publish-settings.tsx index a9813034..c3609bb8 100644 --- a/assets/creator-studio/src/components/publish-settings.tsx +++ b/assets/creator-studio/src/components/publish-settings.tsx @@ -241,6 +241,7 @@ export function PublishSettings({ { const enabled = event.target.checked; onPayEnabledChange(enabled); @@ -269,6 +270,7 @@ export function PublishSettings({ type="checkbox" checked={scheduleEnabled} disabled={!canSchedule} + aria-label={__('开启定时发布', 'jio')} onChange={(event) => onScheduleChange(event.target.checked, scheduleAt || defaultScheduleTime())} />