feat(static-pages): rich text extensions + HTML-mode validation

Milestone 3 of the Static Pages Module sprint.

- MarketplaceHtmlEditorComponent toolbar: horizontal rule
  (insertHorizontalRule), code block (formatBlock -> PRE), embed (prompt for
  a URL, insert a sandboxed <iframe sandbox="allow-scripts allow-same-origin"
  loading="lazy">, same prompt-based UX as the existing link/image commands -
  no new dependency, consistent with the documented no-external-rich-text-
  library decision).
- toggleCode() now validates raw HTML via schema/validators/primitives'
  validateHtml (added in M1) before committing it back to the visual surface;
  on failure it stays in code mode with an inline error instead of silently
  writing malformed markup into the contenteditable surface. Error clears on
  the next edit.
- i18n: builder.promptEmbedUrl, builder.htmlEditorInvalidHtml in interface +
  en/ru/hy.

Gate: tsc --noEmit, npm test (57/57), arch:check, build all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
sdarbinyan
2026-07-17 10:00:33 +04:00
parent cb3dff819e
commit bfee935798
7 changed files with 66 additions and 7 deletions

View File

@@ -549,6 +549,8 @@ export interface Translations {
confirmLeaveUnsaved: string;
promptLinkUrl: string;
promptImageUrl: string;
promptEmbedUrl: string;
htmlEditorInvalidHtml: string;
htmlEditorCode: string;
htmlEditorPreview: string;
lastSaved: string;