@bayonai/rich-text-editor 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +37 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/react/BlockActionTool.d.ts +15 -0
- package/dist/react/BlockActionTool.js +37 -0
- package/dist/react/EditorSessionProvider.d.ts +28 -0
- package/dist/react/EditorSessionProvider.js +74 -0
- package/dist/react/RichTextBody.d.ts +18 -0
- package/dist/react/RichTextBody.js +66 -0
- package/dist/react/RichTextDocumentSurface.d.ts +6 -0
- package/dist/react/RichTextDocumentSurface.js +5 -0
- package/dist/react/RichTextEditor.d.ts +45 -0
- package/dist/react/RichTextEditor.js +1096 -0
- package/dist/react/RichTextIcons.d.ts +21 -0
- package/dist/react/RichTextIcons.js +55 -0
- package/dist/react/RichTextRenderedBlock.d.ts +4 -0
- package/dist/react/RichTextRenderedBlock.js +36 -0
- package/dist/react/RichTextRenderer.d.ts +4 -0
- package/dist/react/RichTextRenderer.js +8 -0
- package/dist/react/RichTextStyles.d.ts +1 -0
- package/dist/react/RichTextStyles.js +719 -0
- package/dist/react/RichTextTitleInput.d.ts +20 -0
- package/dist/react/RichTextTitleInput.js +39 -0
- package/dist/react/SelectionFormatToolbar.d.ts +34 -0
- package/dist/react/SelectionFormatToolbar.js +18 -0
- package/dist/react/SpecialBlockOption.d.ts +7 -0
- package/dist/react/SpecialBlockOption.js +7 -0
- package/dist/react/SpecialBlockTool.d.ts +42 -0
- package/dist/react/SpecialBlockTool.js +50 -0
- package/dist/react/TranscriptionControl.d.ts +19 -0
- package/dist/react/TranscriptionControl.js +129 -0
- package/dist/react/UnsavedChangesDialog.d.ts +9 -0
- package/dist/react/UnsavedChangesDialog.js +13 -0
- package/dist/react/blockActionToolState.d.ts +18 -0
- package/dist/react/blockActionToolState.js +53 -0
- package/dist/react/blockActions.d.ts +8 -0
- package/dist/react/blockActions.js +111 -0
- package/dist/react/editorNavigation.d.ts +19 -0
- package/dist/react/editorNavigation.js +39 -0
- package/dist/react/editorShortcuts.d.ts +20 -0
- package/dist/react/editorShortcuts.js +25 -0
- package/dist/react/index.d.ts +9 -0
- package/dist/react/index.js +6 -0
- package/dist/react/richTextBlockStyles.d.ts +7 -0
- package/dist/react/richTextBlockStyles.js +7 -0
- package/dist/react/specialBlockStyles.d.ts +15 -0
- package/dist/react/specialBlockStyles.js +9 -0
- package/dist/richText.d.ts +15 -0
- package/dist/richText.js +297 -0
- package/dist/saveControl.d.ts +8 -0
- package/dist/saveControl.js +9 -0
- package/dist/session.d.ts +27 -0
- package/dist/session.js +78 -0
- package/dist/sessionRegistry.d.ts +24 -0
- package/dist/sessionRegistry.js +87 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.js +1 -0
- package/dist/writingStats.d.ts +5 -0
- package/dist/writingStats.js +9 -0
- package/dist-cjs/index.js +22 -0
- package/dist-cjs/package.json +3 -0
- package/dist-cjs/react/BlockActionTool.js +40 -0
- package/dist-cjs/react/EditorSessionProvider.js +79 -0
- package/dist-cjs/react/RichTextBody.js +69 -0
- package/dist-cjs/react/RichTextDocumentSurface.js +8 -0
- package/dist-cjs/react/RichTextEditor.js +1108 -0
- package/dist-cjs/react/RichTextIcons.js +74 -0
- package/dist-cjs/react/RichTextRenderedBlock.js +39 -0
- package/dist-cjs/react/RichTextRenderer.js +11 -0
- package/dist-cjs/react/RichTextStyles.js +722 -0
- package/dist-cjs/react/RichTextTitleInput.js +44 -0
- package/dist-cjs/react/SelectionFormatToolbar.js +22 -0
- package/dist-cjs/react/SpecialBlockOption.js +10 -0
- package/dist-cjs/react/SpecialBlockTool.js +54 -0
- package/dist-cjs/react/TranscriptionControl.js +133 -0
- package/dist-cjs/react/UnsavedChangesDialog.js +16 -0
- package/dist-cjs/react/blockActionToolState.js +58 -0
- package/dist-cjs/react/blockActions.js +119 -0
- package/dist-cjs/react/editorNavigation.js +45 -0
- package/dist-cjs/react/editorShortcuts.js +28 -0
- package/dist-cjs/react/index.js +17 -0
- package/dist-cjs/react/richTextBlockStyles.js +10 -0
- package/dist-cjs/react/specialBlockStyles.js +12 -0
- package/dist-cjs/richText.js +307 -0
- package/dist-cjs/saveControl.js +12 -0
- package/dist-cjs/session.js +83 -0
- package/dist-cjs/sessionRegistry.js +90 -0
- package/dist-cjs/types.js +2 -0
- package/dist-cjs/writingStats.js +12 -0
- package/package.json +45 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { richTextBlocksToPlainText } from "./richText.js";
|
|
2
|
+
export function getWritingStats(value) {
|
|
3
|
+
const plainText = richTextBlocksToPlainText(value);
|
|
4
|
+
const wordCount = plainText ? plainText.split(" ").length : 0;
|
|
5
|
+
return {
|
|
6
|
+
readingMinutes: Math.max(1, Math.ceil(wordCount / 225)),
|
|
7
|
+
wordCount,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWritingStats = exports.sanitizeRichTextHtml = exports.sanitizeRichTextBlocks = exports.richTextBlocksToPlainText = exports.markdownToEditorHtml = exports.isRichTextBlocksEmpty = exports.editorHtmlToMarkdown = exports.createRichTextBlockId = exports.createEmptyRichTextBlocks = exports.createEditorSessionRegistry = exports.getEditorSaveControlState = exports.defaultEditorSessionEquals = exports.createEditorSession = exports.canonicalSerialize = void 0;
|
|
4
|
+
var session_1 = require("./session");
|
|
5
|
+
Object.defineProperty(exports, "canonicalSerialize", { enumerable: true, get: function () { return session_1.canonicalSerialize; } });
|
|
6
|
+
Object.defineProperty(exports, "createEditorSession", { enumerable: true, get: function () { return session_1.createEditorSession; } });
|
|
7
|
+
Object.defineProperty(exports, "defaultEditorSessionEquals", { enumerable: true, get: function () { return session_1.defaultEditorSessionEquals; } });
|
|
8
|
+
var saveControl_1 = require("./saveControl");
|
|
9
|
+
Object.defineProperty(exports, "getEditorSaveControlState", { enumerable: true, get: function () { return saveControl_1.getEditorSaveControlState; } });
|
|
10
|
+
var sessionRegistry_1 = require("./sessionRegistry");
|
|
11
|
+
Object.defineProperty(exports, "createEditorSessionRegistry", { enumerable: true, get: function () { return sessionRegistry_1.createEditorSessionRegistry; } });
|
|
12
|
+
var richText_1 = require("./richText");
|
|
13
|
+
Object.defineProperty(exports, "createEmptyRichTextBlocks", { enumerable: true, get: function () { return richText_1.createEmptyRichTextBlocks; } });
|
|
14
|
+
Object.defineProperty(exports, "createRichTextBlockId", { enumerable: true, get: function () { return richText_1.createRichTextBlockId; } });
|
|
15
|
+
Object.defineProperty(exports, "editorHtmlToMarkdown", { enumerable: true, get: function () { return richText_1.editorHtmlToMarkdown; } });
|
|
16
|
+
Object.defineProperty(exports, "isRichTextBlocksEmpty", { enumerable: true, get: function () { return richText_1.isRichTextBlocksEmpty; } });
|
|
17
|
+
Object.defineProperty(exports, "markdownToEditorHtml", { enumerable: true, get: function () { return richText_1.markdownToEditorHtml; } });
|
|
18
|
+
Object.defineProperty(exports, "richTextBlocksToPlainText", { enumerable: true, get: function () { return richText_1.richTextBlocksToPlainText; } });
|
|
19
|
+
Object.defineProperty(exports, "sanitizeRichTextBlocks", { enumerable: true, get: function () { return richText_1.sanitizeRichTextBlocks; } });
|
|
20
|
+
Object.defineProperty(exports, "sanitizeRichTextHtml", { enumerable: true, get: function () { return richText_1.sanitizeRichTextHtml; } });
|
|
21
|
+
var writingStats_1 = require("./writingStats");
|
|
22
|
+
Object.defineProperty(exports, "getWritingStats", { enumerable: true, get: function () { return writingStats_1.getWritingStats; } });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BlockActionTool = BlockActionTool;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const RichTextIcons_1 = require("./RichTextIcons");
|
|
8
|
+
function BlockActionTool({ activeBlockId, draggedBlockId, onAction, onHoverChange, onPointerDragEnd, onPointerDragMove, onPointerDragStart, onToggleMenu, placement, }) {
|
|
9
|
+
const menuOpen = activeBlockId === placement.blockId;
|
|
10
|
+
const dragging = draggedBlockId === placement.blockId;
|
|
11
|
+
const pointerStartRef = (0, react_1.useRef)(null);
|
|
12
|
+
const suppressClickRef = (0, react_1.useRef)(false);
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `bayon-rte-block-tool${menuOpen ? " bayon-rte-block-tool--menu-open" : ""}`, "data-block-action-tool": placement.blockId, onMouseEnter: () => onHoverChange(true), onMouseLeave: () => onHoverChange(false), style: { "--bayon-rte-block-tool-top": `${placement.top}px` }, children: [menuOpen ? ((0, jsx_runtime_1.jsx)("button", { "aria-label": "Close block actions", className: "bayon-rte-icon-button bayon-rte-block-handle bayon-rte-block-handle--menu-open", onClick: () => onToggleMenu(placement.blockId), onMouseDown: (event) => event.preventDefault(), title: "Close block actions", type: "button", children: (0, jsx_runtime_1.jsx)(RichTextIcons_1.CloseIcon, { size: 19 }) })) : ((0, jsx_runtime_1.jsx)("button", { "aria-label": "Block actions", "aria-pressed": dragging, className: `bayon-rte-icon-button bayon-rte-block-handle${dragging ? " bayon-rte-block-handle--dragging" : ""}`, onClick: () => {
|
|
14
|
+
if (suppressClickRef.current) {
|
|
15
|
+
suppressClickRef.current = false;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
onToggleMenu(placement.blockId);
|
|
19
|
+
}, onPointerCancel: (event) => {
|
|
20
|
+
pointerStartRef.current = null;
|
|
21
|
+
onPointerDragEnd(event);
|
|
22
|
+
}, onPointerDown: (event) => {
|
|
23
|
+
pointerStartRef.current = { x: event.clientX, y: event.clientY };
|
|
24
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
25
|
+
onPointerDragStart(placement.blockId, event);
|
|
26
|
+
}, onPointerMove: (event) => {
|
|
27
|
+
const pointerStart = pointerStartRef.current;
|
|
28
|
+
if (pointerStart &&
|
|
29
|
+
Math.hypot(event.clientX - pointerStart.x, event.clientY - pointerStart.y) > 3) {
|
|
30
|
+
suppressClickRef.current = true;
|
|
31
|
+
}
|
|
32
|
+
onPointerDragMove(event);
|
|
33
|
+
}, onPointerUp: (event) => {
|
|
34
|
+
pointerStartRef.current = null;
|
|
35
|
+
onPointerDragEnd(event);
|
|
36
|
+
}, title: "Drag or open block actions", type: "button", children: (0, jsx_runtime_1.jsx)(RichTextIcons_1.DragHandleIcon, { size: 19 }) })), menuOpen ? ((0, jsx_runtime_1.jsxs)("div", { className: "bayon-rte-block-tool__actions", children: [(0, jsx_runtime_1.jsx)(BlockActionButton, { label: "Copy block", onClick: () => onAction("copy", placement.blockId), children: (0, jsx_runtime_1.jsx)(RichTextIcons_1.CopyIcon, { size: 17 }) }), (0, jsx_runtime_1.jsx)(BlockActionButton, { label: "Cut block", onClick: () => onAction("cut", placement.blockId), children: (0, jsx_runtime_1.jsx)(RichTextIcons_1.CutIcon, { size: 17 }) }), (0, jsx_runtime_1.jsx)(BlockActionButton, { label: "Delete block", onClick: () => onAction("delete", placement.blockId), children: (0, jsx_runtime_1.jsx)(RichTextIcons_1.DeleteIcon, { size: 17 }) })] })) : null] }));
|
|
37
|
+
}
|
|
38
|
+
function BlockActionButton({ children, label, onClick, }) {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)("button", { "aria-label": label, className: "bayon-rte-icon-button bayon-rte-special-button", onClick: onClick, onMouseDown: (event) => event.preventDefault(), title: label, type: "button", children: children }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EditorSessionProvider = EditorSessionProvider;
|
|
5
|
+
exports.useEditorSession = useEditorSession;
|
|
6
|
+
exports.useEditorExitGuard = useEditorExitGuard;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const session_1 = require("../session");
|
|
10
|
+
const sessionRegistry_1 = require("../sessionRegistry");
|
|
11
|
+
const session_2 = require("../session");
|
|
12
|
+
const UnsavedChangesDialog_1 = require("./UnsavedChangesDialog");
|
|
13
|
+
const EditorSessionRegistryContext = (0, react_1.createContext)(null);
|
|
14
|
+
function EditorSessionProvider({ children, }) {
|
|
15
|
+
const [registry] = (0, react_1.useState)(sessionRegistry_1.createEditorSessionRegistry);
|
|
16
|
+
const snapshot = (0, react_1.useSyncExternalStore)(registry.subscribe, registry.getSnapshot, registry.getSnapshot);
|
|
17
|
+
(0, react_1.useEffect)(() => {
|
|
18
|
+
if (!snapshot.dirty) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
function handleBeforeUnload(event) {
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
event.returnValue = "";
|
|
24
|
+
}
|
|
25
|
+
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
26
|
+
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
27
|
+
}, [snapshot.dirty]);
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(EditorSessionRegistryContext.Provider, { value: registry, children: [children, (0, jsx_runtime_1.jsx)(UnsavedChangesDialog_1.UnsavedChangesDialog, { error: snapshot.error, onDiscardAndLeave: registry.discardAndExit, onSaveAndLeave: () => {
|
|
29
|
+
void registry.saveAndExit().catch(() => undefined);
|
|
30
|
+
}, onStay: registry.stay, open: snapshot.pendingExit, saving: snapshot.saving })] }));
|
|
31
|
+
}
|
|
32
|
+
function useEditorSession({ dirtyScope, equals, initialBaselineValue, onReset, onSave, value, }) {
|
|
33
|
+
const registry = useEditorSessionRegistry(false);
|
|
34
|
+
const [session] = (0, react_1.useState)(() => (0, session_1.createEditorSession)({
|
|
35
|
+
dirtyScope,
|
|
36
|
+
equals,
|
|
37
|
+
initialBaselineValue,
|
|
38
|
+
initialValue: value,
|
|
39
|
+
onSave,
|
|
40
|
+
}));
|
|
41
|
+
const serializedValue = (0, session_2.canonicalSerialize)(value);
|
|
42
|
+
const isDirty = (0, react_1.useSyncExternalStore)(session.subscribe, session.isDirty, () => false);
|
|
43
|
+
const isSaving = (0, react_1.useSyncExternalStore)(session.subscribe, session.isSaving, () => false);
|
|
44
|
+
(0, react_1.useEffect)(() => registry.register(session), [registry, session]);
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
session.setOnSave(onSave);
|
|
47
|
+
}, [onSave, session]);
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
49
|
+
session.update(JSON.parse(serializedValue));
|
|
50
|
+
}, [serializedValue, session]);
|
|
51
|
+
return {
|
|
52
|
+
isDirty,
|
|
53
|
+
isSaving,
|
|
54
|
+
markClean: session.markClean,
|
|
55
|
+
requestExit: registry.requestExit,
|
|
56
|
+
reset: () => {
|
|
57
|
+
const resetValue = session.reset();
|
|
58
|
+
onReset?.(resetValue);
|
|
59
|
+
return resetValue;
|
|
60
|
+
},
|
|
61
|
+
save: session.save,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function useEditorExitGuard() {
|
|
65
|
+
const registry = useEditorSessionRegistry(true);
|
|
66
|
+
const snapshot = (0, react_1.useSyncExternalStore)(registry.subscribe, registry.getSnapshot, registry.getSnapshot);
|
|
67
|
+
return {
|
|
68
|
+
hasDirtyChanges: snapshot.dirty,
|
|
69
|
+
requestExit: registry.requestExit,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function useEditorSessionRegistry(required) {
|
|
73
|
+
const registry = (0, react_1.useContext)(EditorSessionRegistryContext);
|
|
74
|
+
const [standaloneRegistry] = (0, react_1.useState)(sessionRegistry_1.createEditorSessionRegistry);
|
|
75
|
+
if (!registry && required) {
|
|
76
|
+
throw new Error("Editor session hooks must be used inside EditorSessionProvider.");
|
|
77
|
+
}
|
|
78
|
+
return registry ?? standaloneRegistry;
|
|
79
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RichTextBody = RichTextBody;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const editorNavigation_1 = require("./editorNavigation");
|
|
7
|
+
// Renders the editable rich-text body and reports input and selection changes.
|
|
8
|
+
function RichTextBody({ bodyRef, disabled, label, onArrowUpFromFirstLine, onBackspace, onEnter, onFocus, onInput, onSelectionChange, onShortcutCommand, }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("div", { "aria-label": label, className: "bayon-rte-body", contentEditable: !disabled, "data-placeholder": "Tell your story...", dir: "auto", onBlur: onSelectionChange, onClick: (event) => {
|
|
10
|
+
if (event.target instanceof HTMLInputElement &&
|
|
11
|
+
event.target.type === "checkbox") {
|
|
12
|
+
onInput();
|
|
13
|
+
}
|
|
14
|
+
}, onFocus: onFocus, onInput: onInput, onKeyDown: (event) => {
|
|
15
|
+
if ((0, editorNavigation_1.isSelectAllShortcut)(event)) {
|
|
16
|
+
const code = (0, editorNavigation_1.getCodeBlockSelectionTarget)(event.currentTarget, window.getSelection());
|
|
17
|
+
if (code) {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
selectElementContents(code);
|
|
20
|
+
onSelectionChange();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (event.key === "Enter" && onEnter(event)) {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (event.key === "Backspace" && onBackspace()) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const shortcutCommand = (0, editorNavigation_1.getEditorKeyboardShortcut)(event);
|
|
33
|
+
if (shortcutCommand) {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
onShortcutCommand(shortcutCommand);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (event.key === "ArrowUp" &&
|
|
39
|
+
(0, editorNavigation_1.isCursorOnFirstLine)(event.currentTarget.textContent ?? "", getTextOffsetWithin(event.currentTarget))) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
onArrowUpFromFirstLine();
|
|
42
|
+
}
|
|
43
|
+
}, onKeyUp: onSelectionChange, onMouseUp: onSelectionChange, onPaste: (event) => {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
document.execCommand("insertText", false, event.clipboardData.getData("text/plain"));
|
|
46
|
+
onInput();
|
|
47
|
+
}, ref: bodyRef, role: "textbox", suppressContentEditableWarning: true, tabIndex: disabled ? -1 : 0 }));
|
|
48
|
+
}
|
|
49
|
+
function selectElementContents(element) {
|
|
50
|
+
const range = document.createRange();
|
|
51
|
+
range.selectNodeContents(element);
|
|
52
|
+
const selection = window.getSelection();
|
|
53
|
+
selection?.removeAllRanges();
|
|
54
|
+
selection?.addRange(range);
|
|
55
|
+
}
|
|
56
|
+
function getTextOffsetWithin(root) {
|
|
57
|
+
const selection = window.getSelection();
|
|
58
|
+
if (!selection || selection.rangeCount === 0) {
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
const selectionRange = selection.getRangeAt(0);
|
|
62
|
+
if (!root.contains(selectionRange.startContainer)) {
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
const textRange = document.createRange();
|
|
66
|
+
textRange.selectNodeContents(root);
|
|
67
|
+
textRange.setEnd(selectionRange.startContainer, selectionRange.startOffset);
|
|
68
|
+
return textRange.toString().length;
|
|
69
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RichTextDocumentSurface = RichTextDocumentSurface;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function RichTextDocumentSurface({ background = "transparent", children, }) {
|
|
6
|
+
const hasPanelBackground = background === "panel";
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("section", { className: `bayon-rte-surface${hasPanelBackground ? " bayon-rte-surface--panel" : ""}`, children: (0, jsx_runtime_1.jsx)("div", { className: "bayon-rte-surface__inner", children: children }) }));
|
|
8
|
+
}
|