From 66db1db50720248882209255083a07d74a2513ab Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 9 Aug 2026 06:31:55 -0700 Subject: [PATCH] feat(site-builder): add insert/colour/format toolbar to the Edit HTML modal Co-Authored-By: Claude Opus 5 (1M context) --- .../src/panels/right/styles/HtmlCodeField.tsx | 14 ++- .../panels/right/styles/HtmlToolbar.test.tsx | 65 +++++++++++++ craft/src/panels/right/styles/HtmlToolbar.tsx | 92 +++++++++++++++++++ 3 files changed, 168 insertions(+), 3 deletions(-) create mode 100644 craft/src/panels/right/styles/HtmlToolbar.test.tsx create mode 100644 craft/src/panels/right/styles/HtmlToolbar.tsx diff --git a/craft/src/panels/right/styles/HtmlCodeField.tsx b/craft/src/panels/right/styles/HtmlCodeField.tsx index 2e9d6fc..bb8cfff 100644 --- a/craft/src/panels/right/styles/HtmlCodeField.tsx +++ b/craft/src/panels/right/styles/HtmlCodeField.tsx @@ -1,7 +1,9 @@ -import React, { useState } from 'react'; +import React, { useRef, useState } from 'react'; import { CollapsibleSection, sectionGap } from './shared'; import { Modal } from '../../../ui/Modal'; -import { CodeEditor } from '../../../ui/CodeEditor'; +import { CodeEditor, type CodeEditorHandle } from '../../../ui/CodeEditor'; +import { HtmlToolbar } from './HtmlToolbar'; +import { formatHtml } from '../../../utils/format-html'; /* "Edit HTML" modal for the HtmlBlock `code` prop. `code` is raw HTML (potentially many lines, embedded