diff --git a/examples/05-interoperability/01-converting-blocks-to-html/src/App.tsx b/examples/05-interoperability/01-converting-blocks-to-html/src/App.tsx index 70e8f24ca9..f05df619d6 100644 --- a/examples/05-interoperability/01-converting-blocks-to-html/src/App.tsx +++ b/examples/05-interoperability/01-converting-blocks-to-html/src/App.tsx @@ -41,18 +41,22 @@ export default function App() { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - // Renders the editor instance, and its contents as HTML below. + // Renders the editor instance and HTML output. return ( -
-
Input (BlockNote Editor):
-
- +
+
+
Editor Input
+
+ +
-
Output (HTML):
-
-
-          {html}
-        
+
+
HTML Output
+
+
+            {html}
+          
+
); diff --git a/examples/05-interoperability/01-converting-blocks-to-html/src/styles.css b/examples/05-interoperability/01-converting-blocks-to-html/src/styles.css index 6d5eeba7fe..4e38a82106 100644 --- a/examples/05-interoperability/01-converting-blocks-to-html/src/styles.css +++ b/examples/05-interoperability/01-converting-blocks-to-html/src/styles.css @@ -1,25 +1,64 @@ -.wrapper { +.views { + container-name: views; + container-type: inline-size; display: flex; - flex-direction: column; + flex-direction: row; + flex-wrap: wrap; + gap: 8px; height: 100%; + padding: 8px; +} + +.view-wrapper { + display: flex; + flex-direction: column; + height: calc(50% - 4px); + width: 100%; +} + +@container views (width > 1024px) { + .view-wrapper { + height: 100%; + width: calc(50% - 4px); + } +} + +.view-label { + color: #0090ff; + display: flex; + font-size: 12px; + font-weight: bold; + justify-content: space-between; + margin-inline: 16px; } -.item { - border-radius: 0.5rem; +.view { + border: solid #0090ff 1px; + border-radius: 16px; flex: 1; - overflow: hidden; + height: 0; + padding: 8px; } -.item.bordered { - border: 1px solid gray; +.view .bn-container { + height: 100%; + margin: 0; + max-width: none; + padding: 0; } -.item pre { - border-radius: 0.5rem; +.view .bn-editor { height: 100%; overflow: auto; - padding-block: 1rem; - padding-inline: 54px; - width: 100%; +} + +.view pre { + background-color: #0090ff20; + border-radius: 8px; + flex: 1; + height: 100%; + margin: 0; + overflow: auto; + padding: 8px; white-space: pre-wrap; } diff --git a/examples/05-interoperability/02-converting-blocks-from-html/src/App.tsx b/examples/05-interoperability/02-converting-blocks-from-html/src/App.tsx index f4533ee19c..8eea7c7ac1 100644 --- a/examples/05-interoperability/02-converting-blocks-from-html/src/App.tsx +++ b/examples/05-interoperability/02-converting-blocks-from-html/src/App.tsx @@ -31,19 +31,22 @@ export default function App() { loadInitialHTML(); }, [editor]); - // Renders a text area for you to write/paste HTML in, and the editor instance - // below, which displays the current HTML as blocks. + // Renders the HTML input and editor instance. return ( -
-
Input (HTML):
-
- -