@oyat/editor 1.5.4 → 1.5.5

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js","../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js","../src/components/editor/plugins/align-kit.tsx","../src/components/editor/plugins/autoformat-kit.tsx","../src/components/ui/heading-node.tsx","../src/lib/utils.ts","../src/components/editor/plugins/basic-blocks-kit.tsx","../src/components/ui/paragraph-node.tsx","../src/components/ui/blockquote-node.tsx","../src/components/ui/hr-node.tsx","../src/components/editor/plugins/basic-marks-kit.tsx","../src/components/ui/code-node.tsx","../src/components/ui/highlight-node.tsx","../src/components/ui/kbd-node.tsx","../src/components/ui/context-menu.tsx","../src/components/ui/block-selection.tsx","../src/components/editor/plugins/block-selection-kit.tsx","../src/components/editor/plugins/block-menu-kit.tsx","../src/components/ui/block-context-menu.tsx","../src/hooks/use-is-touch-device.ts","../src/components/editor/plugins/block-placeholder-kit.tsx","../src/components/ui/button.tsx","../src/components/ui/tooltip.tsx","../src/components/ui/dropdown-menu.tsx","../src/components/ui/separator.tsx","../src/components/ui/toolbar.tsx","../src/components/ui/emoji-toolbar-button.tsx","../src/components/editor/plugins/callout-kit.tsx","../src/components/ui/callout-node.tsx","../src/components/ui/command.tsx","../src/components/ui/popover.tsx","../src/components/ui/code-block-node.tsx","../src/components/editor/plugins/code-block-kit.tsx","../src/components/ui/column-node.tsx","../src/components/editor/plugins/column-kit.tsx","../src/components/editor/plugins/comment-kit.tsx","../src/components/ui/comment-node.tsx","../src/components/ui/cursor-overlay.tsx","../src/components/editor/plugins/cursor-overlay-kit.tsx","../src/components/ui/calendar.tsx","../src/components/editor/plugins/date-kit.tsx","../src/components/ui/date-node.tsx","../src/components/ui/block-draggable.tsx","../src/components/editor/plugins/dnd-kit.tsx","../src/components/editor/plugins/docx-kit.tsx","../src/components/editor/plugins/exit-break-kit.tsx","../src/components/ui/fixed-toolbar.tsx","../src/components/ui/align-toolbar-button.tsx","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js","../src/components/ui/font-color-toolbar-button.tsx","../src/components/ui/history-toolbar-button.tsx","../src/components/ui/indent-toolbar-button.tsx","../src/components/editor/transforms.ts","../src/components/ui/insert-toolbar-button.tsx","../src/components/ui/link-toolbar-button.tsx","../src/components/ui/list-toolbar-button.tsx","../src/components/ui/mark-toolbar-button.tsx","../src/components/ui/alert-dialog.tsx","../src/components/ui/input.tsx","../src/components/ui/media-toolbar-button.tsx","../src/components/ui/more-toolbar-button.tsx","../src/components/ui/table-toolbar-button.tsx","../src/components/ui/turn-into-toolbar-button.tsx","../src/components/ui/fixed-toolbar-buttons.tsx","../src/components/editor/plugins/fixed-toolbar-kit.tsx","../src/components/ui/floating-toolbar.tsx","../src/components/ui/floating-toolbar-buttons.tsx","../src/components/editor/plugins/floating-toolbar-kit.tsx","../src/components/editor/plugins/font-kit.tsx","../src/components/editor/plugins/line-height-kit.tsx","../src/components/ui/link-toolbar.tsx","../src/components/editor/plugins/link-kit.tsx","../src/components/ui/link-node.tsx","../src/components/editor/plugins/indent-kit.tsx","../src/components/ui/checkbox.tsx","../src/components/ui/block-list.tsx","../src/components/editor/plugins/list-kit.tsx","../src/components/editor/plugins/markdown-kit.tsx","../src/components/ui/equation-node.tsx","../src/components/editor/plugins/math-kit.tsx","../src/components/ui/caption.tsx","../src/components/ui/media-audio-node.tsx","../src/components/ui/media-toolbar.tsx","../src/components/ui/resize-handle.tsx","../src/components/ui/media-embed-node.tsx","../src/components/ui/media-file-node.tsx","../src/components/ui/media-image-node.tsx","../src/hooks/use-upload-file.ts","../src/components/ui/media-placeholder-node.tsx","../src/components/ui/media-preview-dialog.tsx","../src/components/ui/media-upload-toast.tsx","../src/components/ui/media-video-node.tsx","../src/components/editor/plugins/media-kit.tsx","../src/components/ui/inline-combobox.tsx","../src/components/ui/mention-node.tsx","../src/components/editor/plugins/mention-kit.tsx","../src/hooks/use-mounted.ts","../src/components/ui/slash-node.tsx","../src/components/editor/plugins/slash-kit.tsx","../src/components/ui/suggestion-node.tsx","../src/components/ui/avatar.tsx","../src/components/ui/editor.tsx","../src/components/ui/comment.tsx","../src/components/ui/block-suggestion.tsx","../src/components/ui/block-discussion.tsx","../src/components/editor/plugins/discussion-kit.tsx","../src/components/editor/plugins/suggestion-kit.tsx","../src/components/ui/table-icons.tsx","../src/components/ui/table-node.tsx","../src/components/editor/plugins/table-kit.tsx","../src/components/ui/toc-node.tsx","../src/components/editor/plugins/toc-kit.tsx","../src/components/editor/plugins/toggle-kit.tsx","../src/components/ui/toggle-node.tsx","../src/components/editor/editor-kit.tsx","../src/components/editor/plate-editor.tsx","../src/components/editor/plugins/align-base-kit.tsx","../src/components/ui/heading-node-static.tsx","../src/components/editor/plugins/basic-blocks-base-kit.tsx","../src/components/ui/paragraph-node-static.tsx","../src/components/ui/blockquote-node-static.tsx","../src/components/ui/hr-node-static.tsx","../src/components/editor/plugins/basic-marks-base-kit.tsx","../src/components/ui/code-node-static.tsx","../src/components/ui/highlight-node-static.tsx","../src/components/ui/kbd-node-static.tsx","../src/components/editor/plugins/callout-base-kit.tsx","../src/components/ui/callout-node-static.tsx","../src/components/editor/plugins/code-block-base-kit.tsx","../src/components/ui/code-block-node-static.tsx","../src/components/editor/plugins/column-base-kit.tsx","../src/components/ui/column-node-static.tsx","../src/components/editor/plugins/comment-base-kit.tsx","../src/components/ui/comment-node-static.tsx","../src/components/editor/plugins/date-base-kit.tsx","../src/components/ui/date-node-static.tsx","../src/components/editor/plugins/font-base-kit.tsx","../src/components/editor/plugins/line-height-base-kit.tsx","../src/components/editor/plugins/link-base-kit.tsx","../src/components/ui/link-node-static.tsx","../src/components/editor/plugins/indent-base-kit.tsx","../src/components/ui/block-list-static.tsx","../src/components/editor/plugins/list-base-kit.tsx","../src/components/editor/plugins/math-base-kit.tsx","../src/components/ui/equation-node-static.tsx","../src/components/editor/plugins/media-base-kit.tsx","../src/components/ui/media-image-node-static.tsx","../src/components/ui/media-video-node-static.tsx","../src/components/ui/media-audio-node-static.tsx","../src/components/ui/media-file-node-static.tsx","../src/components/editor/plugins/mention-base-kit.tsx","../src/components/ui/mention-node-static.tsx","../src/components/editor/plugins/suggestion-base-kit.tsx","../src/components/ui/suggestion-node-static.tsx","../src/components/ui/table-node-static.tsx","../src/components/editor/plugins/table-base-kit.tsx","../src/components/ui/toc-node-static.tsx","../src/components/editor/plugins/toc-base-kit.tsx","../src/components/editor/plugins/toggle-base-kit.tsx","../src/components/editor/editor-base-kit.tsx","../src/components/ui/toggle-node-static.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","'use client';\n\nimport { TextAlignPlugin } from '@platejs/basic-styles/react';\nimport { KEYS } from 'platejs';\n\nexport const AlignKit = [\n TextAlignPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 'start',\n nodeKey: 'align',\n styleKey: 'textAlign',\n validNodeValues: ['start', 'left', 'center', 'right', 'end', 'justify'],\n },\n targetPlugins: [...KEYS.heading, KEYS.p, KEYS.img, KEYS.mediaEmbed],\n },\n }),\n];\n","'use client';\n\nimport type { AutoformatRule } from '@platejs/autoformat';\n\nimport {\n autoformatArrow,\n autoformatLegal,\n autoformatLegalHtml,\n autoformatMath,\n AutoformatPlugin,\n autoformatPunctuation,\n autoformatSmartQuotes,\n} from '@platejs/autoformat';\nimport { insertEmptyCodeBlock } from '@platejs/code-block';\nimport { toggleList } from '@platejs/list';\nimport { KEYS } from 'platejs';\n\nconst autoformatMarks: AutoformatRule[] = [\n {\n match: '***',\n mode: 'mark',\n type: [KEYS.bold, KEYS.italic],\n },\n {\n match: '__*',\n mode: 'mark',\n type: [KEYS.underline, KEYS.italic],\n },\n {\n match: '__**',\n mode: 'mark',\n type: [KEYS.underline, KEYS.bold],\n },\n {\n match: '___***',\n mode: 'mark',\n type: [KEYS.underline, KEYS.bold, KEYS.italic],\n },\n {\n match: '**',\n mode: 'mark',\n type: KEYS.bold,\n },\n {\n match: '__',\n mode: 'mark',\n type: KEYS.underline,\n },\n {\n match: '*',\n mode: 'mark',\n type: KEYS.italic,\n },\n {\n match: '_',\n mode: 'mark',\n type: KEYS.italic,\n },\n {\n match: '~~',\n mode: 'mark',\n type: KEYS.strikethrough,\n },\n {\n match: '^',\n mode: 'mark',\n type: KEYS.sup,\n },\n {\n match: '~',\n mode: 'mark',\n type: KEYS.sub,\n },\n {\n match: '==',\n mode: 'mark',\n type: KEYS.highlight,\n },\n {\n match: '≡',\n mode: 'mark',\n type: KEYS.highlight,\n },\n {\n match: '`',\n mode: 'mark',\n type: KEYS.code,\n },\n];\n\nconst autoformatBlocks: AutoformatRule[] = [\n {\n match: '# ',\n mode: 'block',\n type: KEYS.h1,\n },\n {\n match: '## ',\n mode: 'block',\n type: KEYS.h2,\n },\n {\n match: '### ',\n mode: 'block',\n type: KEYS.h3,\n },\n {\n match: '#### ',\n mode: 'block',\n type: KEYS.h4,\n },\n {\n match: '##### ',\n mode: 'block',\n type: KEYS.h5,\n },\n {\n match: '###### ',\n mode: 'block',\n type: KEYS.h6,\n },\n {\n match: '> ',\n mode: 'block',\n type: KEYS.blockquote,\n },\n {\n match: '```',\n mode: 'block',\n type: KEYS.codeBlock,\n format: (editor) => {\n insertEmptyCodeBlock(editor, {\n defaultType: KEYS.p,\n insertNodesOptions: { select: true },\n });\n },\n },\n // {\n // match: '+ ',\n // mode: 'block',\n // preFormat: openNextToggles,\n // type: KEYS.toggle,\n // },\n {\n match: ['---', '—-', '___ '],\n mode: 'block',\n type: KEYS.hr,\n format: (editor) => {\n editor.tf.setNodes({ type: KEYS.hr });\n editor.tf.insertNodes({\n children: [{ text: '' }],\n type: KEYS.p,\n });\n },\n },\n];\n\nconst autoformatLists: AutoformatRule[] = [\n {\n match: ['* ', '- '],\n mode: 'block',\n type: 'list',\n format: (editor) => {\n toggleList(editor, {\n listStyleType: KEYS.ul,\n });\n },\n },\n {\n match: [String.raw`^\\d+\\.$ `, String.raw`^\\d+\\)$ `],\n matchByRegex: true,\n mode: 'block',\n type: 'list',\n format: (editor, { matchString }) => {\n toggleList(editor, {\n listRestartPolite: Number(matchString) || 1,\n listStyleType: KEYS.ol,\n });\n },\n },\n {\n match: ['[] '],\n mode: 'block',\n type: 'list',\n format: (editor) => {\n toggleList(editor, {\n listStyleType: KEYS.listTodo,\n });\n editor.tf.setNodes({\n checked: false,\n listStyleType: KEYS.listTodo,\n });\n },\n },\n {\n match: ['[x] '],\n mode: 'block',\n type: 'list',\n format: (editor) => {\n toggleList(editor, {\n listStyleType: KEYS.listTodo,\n });\n editor.tf.setNodes({\n checked: true,\n listStyleType: KEYS.listTodo,\n });\n },\n },\n];\n\nexport const AutoformatKit = [\n AutoformatPlugin.configure({\n options: {\n enableUndoOnDelete: true,\n rules: [\n ...autoformatBlocks,\n ...autoformatMarks,\n ...autoformatSmartQuotes,\n ...autoformatPunctuation,\n ...autoformatLegal,\n ...autoformatLegalHtml,\n ...autoformatArrow,\n ...autoformatMath,\n ...autoformatLists,\n ].map(\n (rule): AutoformatRule => ({\n ...rule,\n query: (editor) =>\n !editor.api.some({\n match: { type: editor.getType(KEYS.codeBlock) },\n }),\n })\n ),\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport { PlateElement } from 'platejs/react';\n\nconst headingVariants = cva('relative mb-1', {\n variants: {\n variant: {\n h1: 'mt-[1.6em] pb-1 font-bold font-heading text-4xl',\n h2: 'mt-[1.4em] pb-px font-heading font-semibold text-2xl tracking-tight',\n h3: 'mt-[1em] pb-px font-heading font-semibold text-xl tracking-tight',\n h4: 'mt-[0.75em] font-heading font-semibold text-lg tracking-tight',\n h5: 'mt-[0.75em] font-semibold text-lg tracking-tight',\n h6: 'mt-[0.75em] font-semibold text-base tracking-tight',\n },\n },\n});\n\nexport function HeadingElement({\n variant = 'h1',\n ...props\n}: PlateElementProps & VariantProps<typeof headingVariants>) {\n return (\n <PlateElement\n as={variant!}\n className={headingVariants({ variant })}\n {...props}\n >\n {props.children}\n </PlateElement>\n );\n}\n\nexport function H1Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h1\" {...props} />;\n}\n\nexport function H2Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h2\" {...props} />;\n}\n\nexport function H3Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h3\" {...props} />;\n}\n\nexport function H4Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h4\" {...props} />;\n}\n\nexport function H5Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h5\" {...props} />;\n}\n\nexport function H6Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h6\" {...props} />;\n}\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client';\n\nimport {\n BlockquotePlugin,\n H1Plugin,\n H2Plugin,\n H3Plugin,\n H4Plugin,\n H5Plugin,\n H6Plugin,\n HorizontalRulePlugin,\n} from '@platejs/basic-nodes/react';\nimport { ParagraphPlugin } from 'platejs/react';\n\nimport { BlockquoteElement } from '@/components/ui/blockquote-node';\nimport {\n H1Element,\n H2Element,\n H3Element,\n H4Element,\n H5Element,\n H6Element,\n} from '@/components/ui/heading-node';\nimport { HrElement } from '@/components/ui/hr-node';\nimport { ParagraphElement } from '@/components/ui/paragraph-node';\n\nexport const BasicBlocksKit = [\n ParagraphPlugin.withComponent(ParagraphElement),\n H1Plugin.configure({\n node: {\n component: H1Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+1' } },\n }),\n H2Plugin.configure({\n node: {\n component: H2Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+2' } },\n }),\n H3Plugin.configure({\n node: {\n component: H3Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+3' } },\n }),\n H4Plugin.configure({\n node: {\n component: H4Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+4' } },\n }),\n H5Plugin.configure({\n node: {\n component: H5Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+5' } },\n }),\n H6Plugin.configure({\n node: {\n component: H6Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+6' } },\n }),\n BlockquotePlugin.configure({\n node: { component: BlockquoteElement },\n shortcuts: { toggle: { keys: 'mod+shift+period' } },\n }),\n HorizontalRulePlugin.withComponent(HrElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { PlateElement } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function ParagraphElement(props: PlateElementProps) {\n return (\n <PlateElement {...props} className={cn('m-0 px-0 py-1')}>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { type PlateElementProps, PlateElement } from 'platejs/react';\n\nexport function BlockquoteElement(props: PlateElementProps) {\n return (\n <PlateElement\n as=\"blockquote\"\n className=\"my-1 border-l-2 pl-6 italic\"\n {...props}\n />\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport {\n PlateElement,\n useFocused,\n useReadOnly,\n useSelected,\n} from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function HrElement(props: PlateElementProps) {\n const readOnly = useReadOnly();\n const selected = useSelected();\n const focused = useFocused();\n\n return (\n <PlateElement {...props}>\n <div className=\"py-6\" contentEditable={false}>\n <hr\n className={cn(\n 'h-0.5 rounded-sm border-none bg-muted bg-clip-content',\n selected && focused && 'ring-2 ring-ring ring-offset-2',\n !readOnly && 'cursor-pointer'\n )}\n />\n </div>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport {\n BoldPlugin,\n CodePlugin,\n HighlightPlugin,\n ItalicPlugin,\n KbdPlugin,\n StrikethroughPlugin,\n SubscriptPlugin,\n SuperscriptPlugin,\n UnderlinePlugin,\n} from '@platejs/basic-nodes/react';\n\nimport { CodeLeaf } from '@/components/ui/code-node';\nimport { HighlightLeaf } from '@/components/ui/highlight-node';\nimport { KbdLeaf } from '@/components/ui/kbd-node';\n\nexport const BasicMarksKit = [\n BoldPlugin,\n ItalicPlugin,\n UnderlinePlugin,\n CodePlugin.configure({\n node: { component: CodeLeaf },\n shortcuts: { toggle: { keys: 'mod+e' } },\n }),\n StrikethroughPlugin.configure({\n shortcuts: { toggle: { keys: 'mod+shift+x' } },\n }),\n SubscriptPlugin.configure({\n shortcuts: { toggle: { keys: 'mod+comma' } },\n }),\n SuperscriptPlugin.configure({\n shortcuts: { toggle: { keys: 'mod+period' } },\n }),\n HighlightPlugin.configure({\n node: { component: HighlightLeaf },\n shortcuts: { toggle: { keys: 'mod+shift+h' } },\n }),\n KbdPlugin.withComponent(KbdLeaf),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { PlateLeaf } from 'platejs/react';\n\nexport function CodeLeaf(props: PlateLeafProps) {\n return (\n <PlateLeaf\n {...props}\n as=\"code\"\n className=\"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm\"\n >\n {props.children}\n </PlateLeaf>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { PlateLeaf } from 'platejs/react';\n\nexport function HighlightLeaf(props: PlateLeafProps) {\n return (\n <PlateLeaf {...props} as=\"mark\" className=\"bg-highlight/30 text-inherit\">\n {props.children}\n </PlateLeaf>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { PlateLeaf } from 'platejs/react';\n\nexport function KbdLeaf(props: PlateLeafProps) {\n return (\n <PlateLeaf\n {...props}\n as=\"kbd\"\n className=\"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-sm shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(248,_249,_250)_0px_1px_5px_0px_inset,_rgb(193,_200,_205)_0px_0px_0px_0.5px,_rgb(193,_200,_205)_0px_2px_1px_-1px,_rgb(193,_200,_205)_0px_1px_0px_0px] dark:shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(26,_29,_30)_0px_1px_5px_0px_inset,_rgb(76,_81,_85)_0px_0px_0px_0.5px,_rgb(76,_81,_85)_0px_2px_1px_-1px,_rgb(76,_81,_85)_0px_1px_0px_0px]\"\n >\n {props.children}\n </PlateLeaf>\n );\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction ContextMenu({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />\n}\n\nfunction ContextMenuTrigger({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />\n )\n}\n\nfunction ContextMenuGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return (\n <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />\n )\n}\n\nfunction ContextMenuPortal({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return (\n <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />\n )\n}\n\nfunction ContextMenuSub({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />\n}\n\nfunction ContextMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return (\n <ContextMenuPrimitive.RadioGroup\n data-slot=\"context-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n )\n}\n\nfunction ContextMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n )\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n )\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ContextMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { DndPlugin } from '@platejs/dnd';\nimport { useBlockSelected } from '@platejs/selection/react';\nimport { cva } from 'class-variance-authority';\nimport { type PlateElementProps, usePluginOption } from 'platejs/react';\n\nexport const blockSelectionVariants = cva(\n 'pointer-events-none absolute inset-0 z-1 bg-brand/[.13] transition-opacity',\n {\n defaultVariants: {\n active: true,\n },\n variants: {\n active: {\n false: 'opacity-0',\n true: 'opacity-100',\n },\n },\n }\n);\n\nexport function BlockSelection(props: PlateElementProps) {\n const isBlockSelected = useBlockSelected();\n const isDragging = usePluginOption(DndPlugin, 'isDragging');\n\n if (\n !isBlockSelected ||\n props.plugin.key === 'tr' ||\n props.plugin.key === 'table'\n )\n return null;\n\n return (\n <div\n className={blockSelectionVariants({\n active: isBlockSelected && !isDragging,\n })}\n data-slot=\"block-selection\"\n />\n );\n}\n","'use client';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { getPluginTypes, isHotkey, KEYS } from 'platejs';\n\nimport { BlockSelection } from '@/components/ui/block-selection';\n\nexport const BlockSelectionKit = [\n BlockSelectionPlugin.configure(({ editor }) => ({\n options: {\n enableContextMenu: true,\n isSelectable: (element) =>\n !getPluginTypes(editor, [KEYS.column, KEYS.codeLine, KEYS.td]).includes(\n element.type\n ),\n onKeyDownSelecting: (editor, e) => {\n if (isHotkey('mod+j')(e)) {\n editor.getApi(AIChatPlugin).aiChat.show();\n }\n },\n },\n render: {\n belowRootNodes: (props) => {\n if (!props.attributes.className?.includes('slate-selectable'))\n return null;\n\n return <BlockSelection {...(props as any)} />;\n },\n },\n })),\n];\n","'use client';\n\nimport { BlockMenuPlugin } from '@platejs/selection/react';\n\nimport { BlockContextMenu } from '@/components/ui/block-context-menu';\n\nimport { BlockSelectionKit } from './block-selection-kit';\n\nexport const BlockMenuKit = [\n ...BlockSelectionKit,\n BlockMenuPlugin.configure({\n render: { aboveEditable: BlockContextMenu },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport {\n BLOCK_CONTEXT_MENU_ID,\n BlockMenuPlugin,\n BlockSelectionPlugin,\n} from '@platejs/selection/react';\nimport { KEYS } from 'platejs';\nimport { useEditorPlugin, usePlateState, usePluginOption } from 'platejs/react';\n\nimport {\n ContextMenu,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n} from '@/components/ui/context-menu';\nimport { useIsTouchDevice } from '@/hooks/use-is-touch-device';\n\ntype Value = 'askAI' | null;\n\nexport function BlockContextMenu({ children }: { children: React.ReactNode }) {\n const { api, editor } = useEditorPlugin(BlockMenuPlugin);\n const [value, setValue] = React.useState<Value>(null);\n const isTouch = useIsTouchDevice();\n const [readOnly] = usePlateState('readOnly');\n const openId = usePluginOption(BlockMenuPlugin, 'openId');\n const isOpen = openId === BLOCK_CONTEXT_MENU_ID;\n\n const handleTurnInto = React.useCallback(\n (type: string) => {\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.getNodes()\n .forEach(([node, path]) => {\n if (node[KEYS.listType]) {\n editor.tf.unsetNodes([KEYS.listType, 'indent'], {\n at: path,\n });\n }\n\n editor.tf.toggleBlock(type, { at: path });\n });\n },\n [editor]\n );\n\n const handleAlign = React.useCallback(\n (align: 'center' | 'left' | 'right') => {\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.setNodes({ align });\n },\n [editor]\n );\n\n if (isTouch) {\n return children;\n }\n\n return (\n <ContextMenu\n onOpenChange={(open) => {\n if (!open) {\n api.blockMenu.hide();\n }\n }}\n modal={false}\n >\n <ContextMenuTrigger\n asChild\n onContextMenu={(event) => {\n const dataset = (event.target as HTMLElement).dataset;\n const disabled =\n dataset?.slateEditor === 'true' ||\n readOnly ||\n dataset?.plateOpenContextMenu === 'false';\n\n if (disabled) return event.preventDefault();\n\n setTimeout(() => {\n api.blockMenu.show(BLOCK_CONTEXT_MENU_ID, {\n x: event.clientX,\n y: event.clientY,\n });\n }, 0);\n }}\n >\n <div className=\"w-full\">{children}</div>\n </ContextMenuTrigger>\n {isOpen && (\n <ContextMenuContent\n className=\"w-64\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n editor.getApi(BlockSelectionPlugin).blockSelection.focus();\n\n if (value === 'askAI') {\n editor.getApi(AIChatPlugin).aiChat.show();\n }\n\n setValue(null);\n }}\n >\n <ContextMenuGroup>\n <ContextMenuItem\n onClick={() => {\n setValue('askAI');\n }}\n >\n Ask AI\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() => {\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.removeNodes();\n editor.tf.focus();\n }}\n >\n Delete\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() => {\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.duplicate();\n }}\n >\n Duplicate\n {/* <ContextMenuShortcut>⌘ + D</ContextMenuShortcut> */}\n </ContextMenuItem>\n <ContextMenuSub>\n <ContextMenuSubTrigger>Turn into</ContextMenuSubTrigger>\n <ContextMenuSubContent className=\"w-48\">\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.p)}>\n Paragraph\n </ContextMenuItem>\n\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.h1)}>\n Heading 1\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.h2)}>\n Heading 2\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.h3)}>\n Heading 3\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() => handleTurnInto(KEYS.blockquote)}\n >\n Blockquote\n </ContextMenuItem>\n </ContextMenuSubContent>\n </ContextMenuSub>\n </ContextMenuGroup>\n\n <ContextMenuGroup>\n <ContextMenuItem\n onClick={() =>\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.setIndent(1)\n }\n >\n Indent\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() =>\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.setIndent(-1)\n }\n >\n Outdent\n </ContextMenuItem>\n <ContextMenuSub>\n <ContextMenuSubTrigger>Align</ContextMenuSubTrigger>\n <ContextMenuSubContent className=\"w-48\">\n <ContextMenuItem onClick={() => handleAlign('left')}>\n Left\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleAlign('center')}>\n Center\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleAlign('right')}>\n Right\n </ContextMenuItem>\n </ContextMenuSubContent>\n </ContextMenuSub>\n </ContextMenuGroup>\n </ContextMenuContent>\n )}\n </ContextMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nexport function useIsTouchDevice() {\n const [isTouchDevice, setIsTouchDevice] = React.useState(false);\n\n React.useEffect(() => {\n function onResize() {\n setIsTouchDevice(\n 'ontouchstart' in window ||\n navigator.maxTouchPoints > 0 ||\n navigator.maxTouchPoints > 0\n );\n }\n\n window.addEventListener('resize', onResize);\n onResize();\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return isTouchDevice;\n}\n","'use client';\n\nimport { KEYS } from 'platejs';\nimport { BlockPlaceholderPlugin } from 'platejs/react';\n\nexport const BlockPlaceholderKit = [\n BlockPlaceholderPlugin.configure({\n options: {\n className:\n 'before:absolute before:cursor-text before:text-muted-foreground/80 before:content-[attr(placeholder)]',\n placeholders: {\n [KEYS.p]: 'Type something...',\n },\n query: ({ path }) => path.length === 1,\n },\n }),\n];\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-1500 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-foreground fill-foreground z-1500 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n )\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","'use client';\n\nimport * as React from 'react';\n\nimport * as ToolbarPrimitive from '@radix-ui/react-toolbar';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport {\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuSeparator,\n} from '@/components/ui/dropdown-menu';\nimport { Separator } from '@/components/ui/separator';\nimport { Tooltip, TooltipTrigger } from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nexport function Toolbar({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.Root>) {\n return (\n <ToolbarPrimitive.Root\n className={cn('relative flex select-none items-center', className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarToggleGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.ToolbarToggleGroup>) {\n return (\n <ToolbarPrimitive.ToolbarToggleGroup\n className={cn('flex items-center', className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarLink({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.Link>) {\n return (\n <ToolbarPrimitive.Link\n className={cn('font-medium underline underline-offset-4', className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.Separator>) {\n return (\n <ToolbarPrimitive.Separator\n className={cn('mx-2 my-1 w-px shrink-0 bg-border', className)}\n {...props}\n />\n );\n}\n\n// From toggleVariants\nconst toolbarButtonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-checked:bg-accent aria-checked:text-accent-foreground aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n defaultVariants: {\n size: 'default',\n variant: 'default',\n },\n variants: {\n size: {\n default: 'h-9 min-w-9 px-2',\n lg: 'h-10 min-w-10 px-2.5',\n sm: 'h-8 min-w-8 px-1.5',\n },\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',\n },\n },\n }\n);\n\nconst dropdownArrowVariants = cva(\n cn(\n 'inline-flex items-center justify-center rounded-r-md font-medium text-foreground text-sm transition-colors disabled:pointer-events-none disabled:opacity-50'\n ),\n {\n defaultVariants: {\n size: 'sm',\n variant: 'default',\n },\n variants: {\n size: {\n default: 'h-9 w-6',\n lg: 'h-10 w-8',\n sm: 'h-8 w-4',\n },\n variant: {\n default:\n 'bg-transparent hover:bg-muted hover:text-muted-foreground aria-checked:bg-accent aria-checked:text-accent-foreground',\n outline:\n 'border border-input border-l-0 bg-transparent hover:bg-accent hover:text-accent-foreground',\n },\n },\n }\n);\n\ntype ToolbarButtonProps = {\n isDropdown?: boolean;\n pressed?: boolean;\n} & Omit<\n React.ComponentPropsWithoutRef<typeof ToolbarToggleItem>,\n 'asChild' | 'value'\n> &\n VariantProps<typeof toolbarButtonVariants>;\n\nexport const ToolbarButton = withTooltip(function ToolbarButton({\n children,\n className,\n isDropdown,\n pressed,\n size = 'sm',\n variant,\n ...props\n}: ToolbarButtonProps) {\n return typeof pressed === 'boolean' ? (\n <ToolbarToggleGroup disabled={props.disabled} value=\"single\" type=\"single\">\n <ToolbarToggleItem\n className={cn(\n toolbarButtonVariants({\n size,\n variant,\n }),\n isDropdown && 'justify-between gap-1 pr-1',\n className\n )}\n value={pressed ? 'single' : ''}\n {...props}\n >\n {isDropdown ? (\n <>\n <div className=\"flex flex-1 items-center gap-2 whitespace-nowrap\">\n {children}\n </div>\n <div>\n <ChevronDown\n className=\"size-3.5 text-muted-foreground\"\n data-icon\n />\n </div>\n </>\n ) : (\n children\n )}\n </ToolbarToggleItem>\n </ToolbarToggleGroup>\n ) : (\n <ToolbarPrimitive.Button\n className={cn(\n toolbarButtonVariants({\n size,\n variant,\n }),\n isDropdown && 'pr-1',\n className\n )}\n {...props}\n >\n {children}\n </ToolbarPrimitive.Button>\n );\n});\n\nexport function ToolbarSplitButton({\n className,\n ...props\n}: React.ComponentPropsWithoutRef<typeof ToolbarButton>) {\n return (\n <ToolbarButton\n className={cn('group flex gap-0 px-0 hover:bg-transparent', className)}\n {...props}\n />\n );\n}\n\ntype ToolbarSplitButtonPrimaryProps = Omit<\n React.ComponentPropsWithoutRef<typeof ToolbarToggleItem>,\n 'value'\n> &\n VariantProps<typeof toolbarButtonVariants>;\n\nexport function ToolbarSplitButtonPrimary({\n children,\n className,\n size = 'sm',\n variant,\n ...props\n}: ToolbarSplitButtonPrimaryProps) {\n return (\n <span\n className={cn(\n toolbarButtonVariants({\n size,\n variant,\n }),\n 'rounded-r-none',\n 'group-data-[pressed=true]:bg-accent group-data-[pressed=true]:text-accent-foreground',\n className\n )}\n {...props}\n >\n {children}\n </span>\n );\n}\n\nexport function ToolbarSplitButtonSecondary({\n className,\n size,\n variant,\n ...props\n}: React.ComponentPropsWithoutRef<'span'> &\n VariantProps<typeof dropdownArrowVariants>) {\n return (\n <span\n className={cn(\n dropdownArrowVariants({\n size,\n variant,\n }),\n 'group-data-[pressed=true]:bg-accent group-data-[pressed=true]:text-accent-foreground',\n className\n )}\n onClick={(e) => e.stopPropagation()}\n role=\"button\"\n {...props}\n >\n <ChevronDown className=\"size-3.5 text-muted-foreground\" data-icon />\n </span>\n );\n}\n\nexport function ToolbarToggleItem({\n className,\n size = 'sm',\n variant,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.ToggleItem> &\n VariantProps<typeof toolbarButtonVariants>) {\n return (\n <ToolbarPrimitive.ToggleItem\n className={cn(toolbarButtonVariants({ size, variant }), className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarGroup({\n children,\n className,\n}: React.ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'group/toolbar-group',\n 'relative hidden has-[button]:flex',\n className\n )}\n >\n <div className=\"flex items-center\">{children}</div>\n\n <div className=\"group-last/toolbar-group:hidden! mx-1.5 py-0.5\">\n <Separator orientation=\"vertical\" />\n </div>\n </div>\n );\n}\n\ntype TooltipProps<T extends React.ElementType> = {\n tooltip?: React.ReactNode;\n tooltipContentProps?: Omit<\n React.ComponentPropsWithoutRef<typeof TooltipContent>,\n 'children'\n >;\n tooltipProps?: Omit<\n React.ComponentPropsWithoutRef<typeof Tooltip>,\n 'children'\n >;\n tooltipTriggerProps?: React.ComponentPropsWithoutRef<typeof TooltipTrigger>;\n} & React.ComponentProps<T>;\n\nfunction withTooltip<T extends React.ElementType>(Component: T) {\n return function ExtendComponent({\n tooltip,\n tooltipContentProps,\n tooltipProps,\n tooltipTriggerProps,\n ...props\n }: TooltipProps<T>) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n const component = <Component {...(props as React.ComponentProps<T>)} />;\n\n if (tooltip && mounted) {\n return (\n <Tooltip {...tooltipProps}>\n <TooltipTrigger asChild {...tooltipTriggerProps}>\n {component}\n </TooltipTrigger>\n\n <TooltipContent {...tooltipContentProps}>{tooltip}</TooltipContent>\n </Tooltip>\n );\n }\n\n return component;\n };\n}\n\nfunction TooltipContent({\n children,\n className,\n // CHANGE\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n className={cn(\n 'z-1500 w-fit origin-(--radix-tooltip-content-transform-origin) text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs',\n className\n )}\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n {...props}\n >\n {children}\n {/* CHANGE */}\n {/* <TooltipPrimitive.Arrow className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary\" /> */}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport function ToolbarMenuGroup({\n children,\n className,\n label,\n ...props\n}: React.ComponentProps<typeof DropdownMenuRadioGroup> & { label?: string }) {\n return (\n <>\n <DropdownMenuSeparator\n className={cn(\n 'hidden',\n 'mb-0 shrink-0 peer-has-[[role=menuitem]]/menu-group:block peer-has-[[role=menuitemradio]]/menu-group:block peer-has-[[role=option]]/menu-group:block'\n )}\n />\n\n <DropdownMenuRadioGroup\n {...props}\n className={cn(\n 'hidden',\n 'peer/menu-group group/menu-group my-1.5 has-[[role=menuitem]]:block has-[[role=menuitemradio]]:block has-[[role=option]]:block',\n className\n )}\n >\n {label && (\n <DropdownMenuLabel className=\"select-none font-semibold text-muted-foreground text-xs\">\n {label}\n </DropdownMenuLabel>\n )}\n {children}\n </DropdownMenuRadioGroup>\n </>\n );\n}\n","'use client';\n/* eslint-disable react-hooks/refs */\n\nimport * as React from 'react';\n\nimport type { Emoji } from '@emoji-mart/data';\n\nimport {\n type EmojiCategoryList,\n type EmojiIconList,\n type GridRow,\n EmojiSettings,\n} from '@platejs/emoji';\nimport {\n type EmojiDropdownMenuOptions,\n type UseEmojiPickerType,\n useEmojiDropdownMenuState,\n} from '@platejs/emoji/react';\nimport * as Popover from '@radix-ui/react-popover';\nimport {\n AppleIcon,\n ClockIcon,\n CompassIcon,\n FlagIcon,\n LeafIcon,\n LightbulbIcon,\n MusicIcon,\n SearchIcon,\n SmileIcon,\n StarIcon,\n XIcon,\n} from 'lucide-react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\nimport { ToolbarButton } from '@/components/ui/toolbar';\n\nexport function EmojiToolbarButton({\n options,\n ...props\n}: {\n options?: EmojiDropdownMenuOptions;\n} & React.ComponentPropsWithoutRef<typeof ToolbarButton>) {\n const { emojiPickerState, isOpen, setIsOpen } =\n useEmojiDropdownMenuState(options);\n\n return (\n <EmojiPopover\n control={\n <ToolbarButton pressed={isOpen} tooltip=\"Emoji\" isDropdown {...props}>\n <SmileIcon />\n </ToolbarButton>\n }\n isOpen={isOpen}\n setIsOpen={setIsOpen}\n >\n <EmojiPicker\n {...emojiPickerState}\n isOpen={isOpen}\n setIsOpen={setIsOpen}\n settings={options?.settings}\n />\n </EmojiPopover>\n );\n}\n\nexport function EmojiPopover({\n children,\n control,\n isOpen,\n setIsOpen,\n}: {\n children: React.ReactNode;\n control: React.ReactNode;\n isOpen: boolean;\n setIsOpen: (open: boolean) => void;\n}) {\n return (\n <Popover.Root open={isOpen} onOpenChange={setIsOpen}>\n <Popover.Trigger asChild>{control}</Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content className=\"z-100\">{children}</Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\nexport function EmojiPicker({\n clearSearch,\n emoji,\n emojiLibrary,\n focusedCategory,\n hasFound,\n i18n,\n icons = {\n categories: emojiCategoryIcons,\n search: emojiSearchIcons,\n },\n isSearching,\n refs,\n searchResult,\n searchValue,\n setSearch,\n settings = EmojiSettings,\n visibleCategories,\n handleCategoryClick,\n onMouseOver,\n onSelectEmoji,\n}: Omit<UseEmojiPickerType, 'icons'> & {\n icons?: EmojiIconList<React.ReactElement>;\n}) {\n return (\n <div\n className={cn(\n 'flex flex-col rounded-xl bg-popover text-popover-foreground',\n 'h-[23rem] w-80 border shadow-md'\n )}\n >\n <EmojiPickerNavigation\n onClick={handleCategoryClick}\n emojiLibrary={emojiLibrary}\n focusedCategory={focusedCategory}\n i18n={i18n}\n icons={icons}\n />\n <EmojiPickerSearchBar\n i18n={i18n}\n searchValue={searchValue}\n setSearch={setSearch}\n >\n <EmojiPickerSearchAndClear\n clearSearch={clearSearch}\n i18n={i18n}\n searchValue={searchValue}\n />\n </EmojiPickerSearchBar>\n <EmojiPickerContent\n onMouseOver={onMouseOver}\n onSelectEmoji={onSelectEmoji}\n emojiLibrary={emojiLibrary}\n i18n={i18n}\n isSearching={isSearching}\n refs={refs}\n searchResult={searchResult}\n settings={settings}\n visibleCategories={visibleCategories}\n />\n <EmojiPickerPreview\n emoji={emoji}\n hasFound={hasFound}\n i18n={i18n}\n isSearching={isSearching}\n />\n </div>\n );\n}\n\nconst EmojiButton = React.memo(function EmojiButton({\n emoji,\n index,\n onMouseOver,\n onSelect,\n}: {\n emoji: Emoji;\n index: number;\n onMouseOver: (emoji?: Emoji) => void;\n onSelect: (emoji: Emoji) => void;\n}) {\n return (\n <button\n className=\"group relative flex size-9 cursor-pointer items-center justify-center border-none bg-transparent text-2xl leading-none\"\n onClick={() => onSelect(emoji)}\n onMouseEnter={() => onMouseOver(emoji)}\n onMouseLeave={() => onMouseOver()}\n aria-label={emoji.skins[0].native}\n data-index={index}\n tabIndex={-1}\n type=\"button\"\n >\n <div\n className=\"absolute inset-0 rounded-full opacity-0 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <span\n className=\"relative\"\n style={{\n fontFamily:\n '\"Apple Color Emoji\", \"Segoe UI Emoji\", NotoColorEmoji, \"Noto Color Emoji\", \"Segoe UI Symbol\", \"Android Emoji\", EmojiSymbols',\n }}\n data-emoji-set=\"native\"\n >\n {emoji.skins[0].native}\n </span>\n </button>\n );\n});\n\nconst RowOfButtons = React.memo(function RowOfButtons({\n emojiLibrary,\n row,\n onMouseOver,\n onSelectEmoji,\n}: {\n row: GridRow;\n} & Pick<\n UseEmojiPickerType,\n 'emojiLibrary' | 'onMouseOver' | 'onSelectEmoji'\n>) {\n return (\n <div key={row.id} className=\"flex\" data-index={row.id}>\n {row.elements.map((emojiId, index) => (\n <EmojiButton\n key={emojiId}\n onMouseOver={onMouseOver}\n onSelect={onSelectEmoji}\n emoji={emojiLibrary.getEmoji(emojiId)}\n index={index}\n />\n ))}\n </div>\n );\n});\n\nfunction EmojiPickerContent({\n emojiLibrary,\n i18n,\n isSearching = false,\n refs,\n searchResult,\n settings = EmojiSettings,\n visibleCategories,\n onMouseOver,\n onSelectEmoji,\n}: Pick<\n UseEmojiPickerType,\n | 'emojiLibrary'\n | 'i18n'\n | 'isSearching'\n | 'onMouseOver'\n | 'onSelectEmoji'\n | 'refs'\n | 'searchResult'\n | 'settings'\n | 'visibleCategories'\n>) {\n const getRowWidth = settings.perLine.value * settings.buttonSize.value;\n\n const isCategoryVisible = React.useCallback(\n (categoryId: any) =>\n visibleCategories.has(categoryId)\n ? visibleCategories.get(categoryId)\n : false,\n [visibleCategories]\n );\n\n const EmojiList = React.useCallback(\n () =>\n emojiLibrary\n .getGrid()\n .sections()\n .map(({ id: categoryId }) => {\n const section = emojiLibrary.getGrid().section(categoryId);\n const { buttonSize } = settings;\n\n return (\n <div\n key={categoryId}\n ref={section.root}\n style={{ width: getRowWidth }}\n data-id={categoryId}\n >\n <div className=\"-top-px sticky z-1 bg-popover/90 p-1 py-2 font-semibold text-sm backdrop-blur-xs\">\n {i18n.categories[categoryId]}\n </div>\n <div\n className=\"relative flex flex-wrap\"\n style={{ height: section.getRows().length * buttonSize.value }}\n >\n {isCategoryVisible(categoryId) &&\n section\n .getRows()\n .map((row: GridRow) => (\n <RowOfButtons\n key={row.id}\n onMouseOver={onMouseOver}\n onSelectEmoji={onSelectEmoji}\n emojiLibrary={emojiLibrary}\n row={row}\n />\n ))}\n </div>\n </div>\n );\n }),\n [\n emojiLibrary,\n getRowWidth,\n i18n.categories,\n isCategoryVisible,\n onSelectEmoji,\n onMouseOver,\n settings,\n ]\n );\n\n const SearchList = React.useCallback(\n () => (\n <div style={{ width: getRowWidth }} data-id=\"search\">\n <div className=\"-top-px sticky z-1 bg-popover/90 p-1 py-2 font-semibold text-card-foreground text-sm backdrop-blur-xs\">\n {i18n.searchResult}\n </div>\n <div className=\"relative flex flex-wrap\">\n {searchResult.map((emoji: Emoji, index: number) => (\n <EmojiButton\n key={emoji.id}\n onMouseOver={onMouseOver}\n onSelect={onSelectEmoji}\n emoji={emojiLibrary.getEmoji(emoji.id)}\n index={index}\n />\n ))}\n </div>\n </div>\n ),\n [\n emojiLibrary,\n getRowWidth,\n i18n.searchResult,\n searchResult,\n onSelectEmoji,\n onMouseOver,\n ]\n );\n\n return (\n <div\n ref={refs.current.contentRoot}\n className={cn(\n 'h-full min-h-[50%] overflow-y-auto overflow-x-hidden px-2',\n '[&::-webkit-scrollbar]:w-4',\n '[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:size-0',\n '[&::-webkit-scrollbar-thumb]:min-h-11 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted [&::-webkit-scrollbar-thumb]:hover:bg-muted-foreground/25',\n '[&::-webkit-scrollbar-thumb]:border-4 [&::-webkit-scrollbar-thumb]:border-popover [&::-webkit-scrollbar-thumb]:border-solid [&::-webkit-scrollbar-thumb]:bg-clip-padding'\n )}\n data-id=\"scroll\"\n >\n <div ref={refs.current.content} className=\"h-full\">\n {isSearching ? SearchList() : EmojiList()}\n </div>\n </div>\n );\n}\n\nfunction EmojiPickerSearchBar({\n children,\n i18n,\n searchValue,\n setSearch,\n}: {\n children: React.ReactNode;\n} & Pick<UseEmojiPickerType, 'i18n' | 'searchValue' | 'setSearch'>) {\n return (\n <div className=\"flex items-center px-2\">\n <div className=\"relative flex grow items-center\">\n <input\n className=\"block w-full appearance-none rounded-full border-0 bg-muted px-10 py-2 text-sm outline-none placeholder:text-muted-foreground focus-visible:outline-none\"\n value={searchValue}\n onChange={(event) => setSearch(event.target.value)}\n placeholder={i18n.search}\n aria-label=\"Search\"\n autoComplete=\"off\"\n type=\"text\"\n autoFocus\n />\n {children}\n </div>\n </div>\n );\n}\n\nfunction EmojiPickerSearchAndClear({\n clearSearch,\n i18n,\n searchValue,\n}: Pick<UseEmojiPickerType, 'clearSearch' | 'i18n' | 'searchValue'>) {\n return (\n <div className=\"flex items-center text-foreground\">\n <div\n className={cn(\n '-translate-y-1/2 absolute top-1/2 left-2.5 z-10 flex size-5 items-center justify-center text-foreground'\n )}\n >\n {emojiSearchIcons.loupe}\n </div>\n {searchValue && (\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className={cn(\n '-translate-y-1/2 absolute top-1/2 right-0.5 flex size-8 cursor-pointer items-center justify-center rounded-full border-none bg-transparent text-popover-foreground hover:bg-transparent'\n )}\n onClick={clearSearch}\n title={i18n.clear}\n aria-label=\"Clear\"\n type=\"button\"\n >\n {emojiSearchIcons.delete}\n </Button>\n )}\n </div>\n );\n}\n\nfunction EmojiPreview({ emoji }: Pick<UseEmojiPickerType, 'emoji'>) {\n return (\n <div className=\"flex h-14 max-h-14 min-h-14 items-center border-muted border-t p-2\">\n <div className=\"flex items-center justify-center text-2xl\">\n {emoji?.skins[0].native}\n </div>\n <div className=\"overflow-hidden pl-2\">\n <div className=\"truncate font-semibold text-sm\">{emoji?.name}</div>\n <div className=\"truncate text-sm\">{`:${emoji?.id}:`}</div>\n </div>\n </div>\n );\n}\n\nfunction NoEmoji({ i18n }: Pick<UseEmojiPickerType, 'i18n'>) {\n return (\n <div className=\"flex h-14 max-h-14 min-h-14 items-center border-muted border-t p-2\">\n <div className=\"flex items-center justify-center text-2xl\">😢</div>\n <div className=\"overflow-hidden pl-2\">\n <div className=\"truncate font-bold text-sm\">\n {i18n.searchNoResultsTitle}\n </div>\n <div className=\"truncate text-sm\">{i18n.searchNoResultsSubtitle}</div>\n </div>\n </div>\n );\n}\n\nfunction PickAnEmoji({ i18n }: Pick<UseEmojiPickerType, 'i18n'>) {\n return (\n <div className=\"flex h-14 max-h-14 min-h-14 items-center border-muted border-t p-2\">\n <div className=\"flex items-center justify-center text-2xl\">☝️</div>\n <div className=\"overflow-hidden pl-2\">\n <div className=\"truncate font-semibold text-sm\">{i18n.pick}</div>\n </div>\n </div>\n );\n}\n\nfunction EmojiPickerPreview({\n emoji,\n hasFound = true,\n i18n,\n isSearching = false,\n ...props\n}: Pick<UseEmojiPickerType, 'emoji' | 'hasFound' | 'i18n' | 'isSearching'>) {\n const showPickEmoji = !emoji && (!isSearching || hasFound);\n const showNoEmoji = isSearching && !hasFound;\n const showPreview = emoji && !showNoEmoji && !showNoEmoji;\n\n return (\n <>\n {showPreview && <EmojiPreview emoji={emoji} {...props} />}\n {showPickEmoji && <PickAnEmoji i18n={i18n} {...props} />}\n {showNoEmoji && <NoEmoji i18n={i18n} {...props} />}\n </>\n );\n}\n\nfunction EmojiPickerNavigation({\n emojiLibrary,\n focusedCategory,\n i18n,\n icons,\n onClick,\n}: {\n onClick: (id: EmojiCategoryList) => void;\n} & Pick<\n UseEmojiPickerType,\n 'emojiLibrary' | 'focusedCategory' | 'i18n' | 'icons'\n>) {\n return (\n <TooltipProvider delayDuration={500}>\n <nav\n id=\"emoji-nav\"\n className=\"mb-2.5 border-0 border-b border-b-border border-solid p-1.5\"\n >\n <div className=\"relative flex items-center justify-evenly\">\n {emojiLibrary\n .getGrid()\n .sections()\n .map(({ id }) => (\n <Tooltip key={id}>\n <TooltipTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className={cn(\n 'h-fit rounded-full fill-current p-1.5 text-muted-foreground hover:bg-muted hover:text-muted-foreground',\n id === focusedCategory &&\n 'pointer-events-none bg-accent fill-current text-accent-foreground'\n )}\n onClick={() => {\n onClick(id);\n }}\n aria-label={i18n.categories[id]}\n type=\"button\"\n >\n <span className=\"inline-flex size-5 items-center justify-center\">\n {icons.categories[id].outline}\n </span>\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">\n {i18n.categories[id]}\n </TooltipContent>\n </Tooltip>\n ))}\n </div>\n </nav>\n </TooltipProvider>\n );\n}\n\nconst emojiCategoryIcons: Record<\n EmojiCategoryList,\n {\n outline: React.ReactElement;\n solid: React.ReactElement; // Needed to add another solid variant - outline will be used for now\n }\n> = {\n activity: {\n outline: (\n <svg\n className=\"size-full\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M2.1 13.4A10.1 10.1 0 0 0 13.4 2.1\" />\n <path d=\"m5 4.9 14 14.2\" />\n <path d=\"M21.9 10.6a10.1 10.1 0 0 0-11.3 11.3\" />\n </svg>\n ),\n solid: (\n <svg\n className=\"size-full\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M2.1 13.4A10.1 10.1 0 0 0 13.4 2.1\" />\n <path d=\"m5 4.9 14 14.2\" />\n <path d=\"M21.9 10.6a10.1 10.1 0 0 0-11.3 11.3\" />\n </svg>\n ),\n },\n\n custom: {\n outline: <StarIcon className=\"size-full\" />,\n solid: <StarIcon className=\"size-full\" />,\n },\n\n flags: {\n outline: <FlagIcon className=\"size-full\" />,\n solid: <FlagIcon className=\"size-full\" />,\n },\n\n foods: {\n outline: <AppleIcon className=\"size-full\" />,\n solid: <AppleIcon className=\"size-full\" />,\n },\n\n frequent: {\n outline: <ClockIcon className=\"size-full\" />,\n solid: <ClockIcon className=\"size-full\" />,\n },\n\n nature: {\n outline: <LeafIcon className=\"size-full\" />,\n solid: <LeafIcon className=\"size-full\" />,\n },\n\n objects: {\n outline: <LightbulbIcon className=\"size-full\" />,\n solid: <LightbulbIcon className=\"size-full\" />,\n },\n\n people: {\n outline: <SmileIcon className=\"size-full\" />,\n solid: <SmileIcon className=\"size-full\" />,\n },\n\n places: {\n outline: <CompassIcon className=\"size-full\" />,\n solid: <CompassIcon className=\"size-full\" />,\n },\n\n symbols: {\n outline: <MusicIcon className=\"size-full\" />,\n solid: <MusicIcon className=\"size-full\" />,\n },\n};\n\nconst emojiSearchIcons = {\n delete: <XIcon className=\"size-4 text-current\" />,\n loupe: <SearchIcon className=\"size-4 text-current\" />,\n};\n","'use client';\n\nimport { CalloutPlugin } from '@platejs/callout/react';\n\nimport { CalloutElement } from '@/components/ui/callout-node';\n\nexport const CalloutKit = [CalloutPlugin.withComponent(CalloutElement)];\n","'use client';\n\nimport * as React from 'react';\n\nimport { useCalloutEmojiPicker } from '@platejs/callout/react';\nimport { useEmojiDropdownMenuState } from '@platejs/emoji/react';\nimport { PlateElement } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\nimport { EmojiPicker, EmojiPopover } from './emoji-toolbar-button';\n\nexport function CalloutElement({\n attributes,\n children,\n className,\n ...props\n}: React.ComponentProps<typeof PlateElement>) {\n const { emojiPickerState, isOpen, setIsOpen } = useEmojiDropdownMenuState({\n closeOnSelect: true,\n });\n\n const { emojiToolbarDropdownProps, props: calloutProps } =\n useCalloutEmojiPicker({\n isOpen,\n setIsOpen,\n });\n\n return (\n <PlateElement\n className={cn('my-1 flex rounded-sm bg-muted p-4 pl-3', className)}\n style={{\n backgroundColor: props.element.backgroundColor as any,\n }}\n attributes={{\n ...attributes,\n 'data-plate-open-context-menu': true,\n }}\n {...props}\n >\n <div className=\"flex w-full gap-2 rounded-md\">\n <EmojiPopover\n {...emojiToolbarDropdownProps}\n control={\n <Button\n variant=\"ghost\"\n className=\"size-6 select-none p-1 text-[18px] hover:bg-muted-foreground/15\"\n style={{\n fontFamily:\n '\"Apple Color Emoji\", \"Segoe UI Emoji\", NotoColorEmoji, \"Noto Color Emoji\", \"Segoe UI Symbol\", \"Android Emoji\", EmojiSymbols',\n }}\n contentEditable={false}\n >\n {(props.element.icon as any) || '💡'}\n </Button>\n }\n >\n <EmojiPicker {...emojiPickerState} {...calloutProps} />\n </EmojiPopover>\n <div className=\"w-full\">{children}</div>\n </div>\n </PlateElement>\n );\n}\n","import * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { SearchIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\"\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string\n description?: string\n className?: string\n showCloseButton?: boolean\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n )\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"bg-border -mx-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n )\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n","'use client';\n\nimport * as React from 'react';\n\nimport { formatCodeBlock, isLangSupported } from '@platejs/code-block';\nimport { BracesIcon, Check, CheckIcon, CopyIcon } from 'lucide-react';\nimport { type TCodeBlockElement, type TCodeSyntaxLeaf, NodeApi } from 'platejs';\nimport {\n type PlateElementProps,\n type PlateLeafProps,\n PlateElement,\n PlateLeaf,\n} from 'platejs/react';\nimport { useEditorRef, useElement, useReadOnly } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/components/ui/command';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport function CodeBlockElement(props: PlateElementProps<TCodeBlockElement>) {\n const { editor, element } = props;\n\n return (\n <PlateElement\n className=\"py-1 **:[.hljs-addition]:bg-[#f0fff4] **:[.hljs-addition]:text-[#22863a] dark:**:[.hljs-addition]:bg-[#3c5743] dark:**:[.hljs-addition]:text-[#ceead5] **:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#005cc5] dark:**:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#6596cf] **:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#e36209] dark:**:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#c3854e] **:[.hljs-bullet]:text-[#735c0f] **:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] dark:**:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] **:[.hljs-deletion]:bg-[#ffeef0] **:[.hljs-deletion]:text-[#b31d28] dark:**:[.hljs-deletion]:bg-[#473235] dark:**:[.hljs-deletion]:text-[#e7c7cb] **:[.hljs-emphasis]:italic **:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#d73a49] dark:**:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#ee6960] **:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#22863a] dark:**:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#36a84f] **:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#032f62] dark:**:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#3593ff] **:[.hljs-section]:font-bold **:[.hljs-section]:text-[#005cc5] dark:**:[.hljs-section]:text-[#61a5f2] **:[.hljs-strong]:font-bold **:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#6f42c1] dark:**:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#a77bfa]\"\n {...props}\n >\n <div className=\"relative rounded-md bg-muted/50\">\n <pre className=\"overflow-x-auto p-8 pr-4 font-mono text-sm leading-[normal] [tab-size:2] print:break-inside-avoid\">\n <code>{props.children}</code>\n </pre>\n\n <div\n className=\"absolute top-1 right-1 z-10 flex select-none gap-0.5\"\n contentEditable={false}\n >\n {isLangSupported(element.lang) && (\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-6 text-xs\"\n onClick={() => formatCodeBlock(editor, { element })}\n title=\"Format code\"\n >\n <BracesIcon className=\"!size-3.5 text-muted-foreground\" />\n </Button>\n )}\n\n <CodeBlockCombobox />\n\n <CopyButton\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-6 gap-1 text-muted-foreground text-xs\"\n value={() => NodeApi.string(element)}\n />\n </div>\n </div>\n </PlateElement>\n );\n}\n\nfunction CodeBlockCombobox() {\n const [open, setOpen] = React.useState(false);\n const readOnly = useReadOnly();\n const editor = useEditorRef();\n const element = useElement<TCodeBlockElement>();\n const value = element.lang || 'plaintext';\n const [searchValue, setSearchValue] = React.useState('');\n\n const items = React.useMemo(\n () =>\n languages.filter(\n (language) =>\n !searchValue ||\n language.label.toLowerCase().includes(searchValue.toLowerCase())\n ),\n [searchValue]\n );\n\n if (readOnly) return null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 select-none justify-between gap-1 px-2 text-muted-foreground text-xs\"\n aria-expanded={open}\n role=\"combobox\"\n >\n {languages.find((language) => language.value === value)?.label ??\n 'Plain Text'}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[200px] p-0\"\n onCloseAutoFocus={() => setSearchValue('')}\n >\n <Command shouldFilter={false}>\n <CommandInput\n className=\"h-9\"\n value={searchValue}\n onValueChange={(value) => setSearchValue(value)}\n placeholder=\"Search language...\"\n />\n <CommandEmpty>No language found.</CommandEmpty>\n\n <CommandList className=\"h-[344px] overflow-y-auto\">\n <CommandGroup>\n {items.map((language) => (\n <CommandItem\n key={language.label}\n className=\"cursor-pointer\"\n value={language.value}\n onSelect={(value) => {\n editor.tf.setNodes<TCodeBlockElement>(\n { lang: value },\n { at: element }\n );\n setSearchValue(value);\n setOpen(false);\n }}\n >\n <Check\n className={cn(\n value === language.value ? 'opacity-100' : 'opacity-0'\n )}\n />\n {language.label}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction CopyButton({\n value,\n ...props\n}: { value: (() => string) | string } & Omit<\n React.ComponentProps<typeof Button>,\n 'value'\n>) {\n const [hasCopied, setHasCopied] = React.useState(false);\n\n React.useEffect(() => {\n setTimeout(() => {\n setHasCopied(false);\n }, 2000);\n }, [hasCopied]);\n\n return (\n <Button\n onClick={() => {\n void navigator.clipboard.writeText(\n typeof value === 'function' ? value() : value\n );\n setHasCopied(true);\n }}\n {...props}\n >\n <span className=\"sr-only\">Copy</span>\n {hasCopied ? (\n <CheckIcon className=\"!size-3\" />\n ) : (\n <CopyIcon className=\"!size-3\" />\n )}\n </Button>\n );\n}\n\nexport function CodeLineElement(props: PlateElementProps) {\n return <PlateElement {...props} />;\n}\n\nexport function CodeSyntaxLeaf(props: PlateLeafProps<TCodeSyntaxLeaf>) {\n const tokenClassName = props.leaf.className as string;\n\n return <PlateLeaf className={tokenClassName} {...props} />;\n}\n\nconst languages: { label: string; value: string }[] = [\n { label: 'Auto', value: 'auto' },\n { label: 'Plain Text', value: 'plaintext' },\n { label: 'ABAP', value: 'abap' },\n { label: 'Agda', value: 'agda' },\n { label: 'Arduino', value: 'arduino' },\n { label: 'ASCII Art', value: 'ascii' },\n { label: 'Assembly', value: 'x86asm' },\n { label: 'Bash', value: 'bash' },\n { label: 'BASIC', value: 'basic' },\n { label: 'BNF', value: 'bnf' },\n { label: 'C', value: 'c' },\n { label: 'C#', value: 'csharp' },\n { label: 'C++', value: 'cpp' },\n { label: 'Clojure', value: 'clojure' },\n { label: 'CoffeeScript', value: 'coffeescript' },\n { label: 'Coq', value: 'coq' },\n { label: 'CSS', value: 'css' },\n { label: 'Dart', value: 'dart' },\n { label: 'Dhall', value: 'dhall' },\n { label: 'Diff', value: 'diff' },\n { label: 'Docker', value: 'dockerfile' },\n { label: 'EBNF', value: 'ebnf' },\n { label: 'Elixir', value: 'elixir' },\n { label: 'Elm', value: 'elm' },\n { label: 'Erlang', value: 'erlang' },\n { label: 'F#', value: 'fsharp' },\n { label: 'Flow', value: 'flow' },\n { label: 'Fortran', value: 'fortran' },\n { label: 'Gherkin', value: 'gherkin' },\n { label: 'GLSL', value: 'glsl' },\n { label: 'Go', value: 'go' },\n { label: 'GraphQL', value: 'graphql' },\n { label: 'Groovy', value: 'groovy' },\n { label: 'Haskell', value: 'haskell' },\n { label: 'HCL', value: 'hcl' },\n { label: 'HTML', value: 'html' },\n { label: 'Idris', value: 'idris' },\n { label: 'Java', value: 'java' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'JSON', value: 'json' },\n { label: 'Julia', value: 'julia' },\n { label: 'Kotlin', value: 'kotlin' },\n { label: 'LaTeX', value: 'latex' },\n { label: 'Less', value: 'less' },\n { label: 'Lisp', value: 'lisp' },\n { label: 'LiveScript', value: 'livescript' },\n { label: 'LLVM IR', value: 'llvm' },\n { label: 'Lua', value: 'lua' },\n { label: 'Makefile', value: 'makefile' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'Markup', value: 'markup' },\n { label: 'MATLAB', value: 'matlab' },\n { label: 'Mathematica', value: 'mathematica' },\n { label: 'Mermaid', value: 'mermaid' },\n { label: 'Nix', value: 'nix' },\n { label: 'Notion Formula', value: 'notion' },\n { label: 'Objective-C', value: 'objectivec' },\n { label: 'OCaml', value: 'ocaml' },\n { label: 'Pascal', value: 'pascal' },\n { label: 'Perl', value: 'perl' },\n { label: 'PHP', value: 'php' },\n { label: 'PowerShell', value: 'powershell' },\n { label: 'Prolog', value: 'prolog' },\n { label: 'Protocol Buffers', value: 'protobuf' },\n { label: 'PureScript', value: 'purescript' },\n { label: 'Python', value: 'python' },\n { label: 'R', value: 'r' },\n { label: 'Racket', value: 'racket' },\n { label: 'Reason', value: 'reasonml' },\n { label: 'Ruby', value: 'ruby' },\n { label: 'Rust', value: 'rust' },\n { label: 'Sass', value: 'scss' },\n { label: 'Scala', value: 'scala' },\n { label: 'Scheme', value: 'scheme' },\n { label: 'SCSS', value: 'scss' },\n { label: 'Shell', value: 'shell' },\n { label: 'Smalltalk', value: 'smalltalk' },\n { label: 'Solidity', value: 'solidity' },\n { label: 'SQL', value: 'sql' },\n { label: 'Swift', value: 'swift' },\n { label: 'TOML', value: 'toml' },\n { label: 'TypeScript', value: 'typescript' },\n { label: 'VB.Net', value: 'vbnet' },\n { label: 'Verilog', value: 'verilog' },\n { label: 'VHDL', value: 'vhdl' },\n { label: 'Visual Basic', value: 'vbnet' },\n { label: 'WebAssembly', value: 'wasm' },\n { label: 'XML', value: 'xml' },\n { label: 'YAML', value: 'yaml' },\n];\n","'use client';\n\nimport {\n CodeBlockPlugin,\n CodeLinePlugin,\n CodeSyntaxPlugin,\n} from '@platejs/code-block/react';\nimport { all, createLowlight } from 'lowlight';\n\nimport {\n CodeBlockElement,\n CodeLineElement,\n CodeSyntaxLeaf,\n} from '@/components/ui/code-block-node';\n\nconst lowlight = createLowlight(all);\n\nexport const CodeBlockKit = [\n CodeBlockPlugin.configure({\n node: { component: CodeBlockElement },\n options: { lowlight },\n shortcuts: { toggle: { keys: 'mod+alt+8' } },\n }),\n CodeLinePlugin.withComponent(CodeLineElement),\n CodeSyntaxPlugin.withComponent(CodeSyntaxLeaf),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TColumnElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useDraggable, useDropLine } from '@platejs/dnd';\nimport { setColumns } from '@platejs/layout';\nimport { ResizableProvider } from '@platejs/resizable';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { useComposedRef } from '@udecode/cn';\nimport { type LucideProps, Trash2Icon } from 'lucide-react';\nimport { GripHorizontal } from 'lucide-react';\nimport { PathApi } from 'platejs';\nimport {\n PlateElement,\n useEditorRef,\n useEditorSelector,\n useElement,\n useFocusedLast,\n usePluginOption,\n useReadOnly,\n useRemoveNodeButton,\n useSelected,\n withHOC,\n} from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n} from '@/components/ui/popover';\nimport { Separator } from '@/components/ui/separator';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nexport const ColumnElement = withHOC(\n ResizableProvider,\n function ColumnElement(props: PlateElementProps<TColumnElement>) {\n const { width } = props.element;\n const readOnly = useReadOnly();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n\n const { isDragging, previewRef, handleRef } = useDraggable({\n element: props.element,\n orientation: 'horizontal',\n type: 'column',\n canDropNode: ({ dragEntry, dropEntry }) =>\n PathApi.equals(\n PathApi.parent(dragEntry[1]),\n PathApi.parent(dropEntry[1])\n ),\n });\n\n return (\n <div className=\"group/column relative\" style={{ width: width ?? '100%' }}>\n {!readOnly && !isSelectionAreaVisible && (\n <div\n ref={handleRef}\n className={cn(\n '-translate-x-1/2 -translate-y-1/2 absolute top-2 left-1/2 z-50',\n 'pointer-events-auto flex items-center',\n 'opacity-0 transition-opacity group-hover/column:opacity-100'\n )}\n >\n <ColumnDragHandle />\n </div>\n )}\n\n <PlateElement\n {...props}\n ref={useComposedRef(props.ref, previewRef)}\n className=\"h-full px-2 pt-2 group-first/column:pl-0 group-last/column:pr-0\"\n >\n <div\n className={cn(\n 'relative h-full border border-transparent p-1.5',\n !readOnly && 'rounded-lg border-border border-dashed',\n isDragging && 'opacity-50'\n )}\n >\n {props.children}\n\n {!readOnly && !isSelectionAreaVisible && <DropLine />}\n </div>\n </PlateElement>\n </div>\n );\n }\n);\n\nconst ColumnDragHandle = React.memo(function ColumnDragHandle() {\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button variant=\"ghost\" className=\"!px-1 h-5\">\n <GripHorizontal\n className=\"text-muted-foreground\"\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n />\n </Button>\n </TooltipTrigger>\n\n <TooltipContent>Drag to move column</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n});\n\nfunction DropLine() {\n const { dropLine } = useDropLine({ orientation: 'horizontal' });\n\n if (!dropLine) return null;\n\n return (\n <div\n className={cn(\n 'slate-dropLine',\n 'absolute bg-brand/50',\n dropLine === 'left' &&\n 'group-first/column:-left-1 inset-y-0 left-[-10.5px] w-1',\n dropLine === 'right' &&\n 'group-last/column:-right-1 inset-y-0 right-[-11px] w-1'\n )}\n />\n );\n}\n\nexport function ColumnGroupElement(props: PlateElementProps) {\n return (\n <PlateElement className=\"mb-2\" {...props}>\n <ColumnFloatingToolbar>\n <div className=\"flex size-full rounded\">{props.children}</div>\n </ColumnFloatingToolbar>\n </PlateElement>\n );\n}\n\nfunction ColumnFloatingToolbar({ children }: React.PropsWithChildren) {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n const element = useElement<TColumnElement>();\n const { props: buttonProps } = useRemoveNodeButton({ element });\n const selected = useSelected();\n const isCollapsed = useEditorSelector(\n (editor) => editor.api.isCollapsed(),\n []\n );\n const isFocusedLast = useFocusedLast();\n\n const open = isFocusedLast && !readOnly && selected && isCollapsed;\n\n const onColumnChange = (widths: string[]) => {\n setColumns(editor, {\n at: element,\n widths,\n });\n };\n\n return (\n <Popover open={open} modal={false}>\n <PopoverAnchor>{children}</PopoverAnchor>\n <PopoverContent\n className=\"w-auto p-1\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n align=\"center\"\n side=\"top\"\n sideOffset={10}\n >\n <div className=\"box-content flex h-8 items-center\">\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['50%', '50%'])}\n >\n <DoubleColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['33%', '33%', '33%'])}\n >\n <ThreeColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['70%', '30%'])}\n >\n <RightSideDoubleColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['30%', '70%'])}\n >\n <LeftSideDoubleColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['25%', '50%', '25%'])}\n >\n <DoubleSideDoubleColumnOutlined />\n </Button>\n\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <Button variant=\"ghost\" className=\"size-8\" {...buttonProps}>\n <Trash2Icon />\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nconst DoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M8.5 3H13V13H8.5V3ZM7.5 2H8.5H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H8.5H7.5H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H7.5ZM7.5 13H3L3 3H7.5V13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst ThreeColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M9.25 3H6.75V13H9.25V3ZM9.25 2H6.75H5.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H5.75H6.75H9.25H10.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H10.25H9.25ZM10.25 3V13H13V3H10.25ZM3 13H5.75V3H3L3 13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst RightSideDoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M11.25 3H13V13H11.25V3ZM10.25 2H11.25H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H11.25H10.25H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H10.25ZM10.25 13H3L3 3H10.25V13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst LeftSideDoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M5.75 3H13V13H5.75V3ZM4.75 2H5.75H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H5.75H4.75H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H4.75ZM4.75 13H3L3 3H4.75V13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst DoubleSideDoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M10.25 3H5.75V13H10.25V3ZM10.25 2H5.75H4.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H4.75H5.75H10.25H11.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H11.25H10.25ZM11.25 3V13H13V3H11.25ZM3 13H4.75V3H3L3 13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n","'use client';\n\nimport { ColumnItemPlugin, ColumnPlugin } from '@platejs/layout/react';\n\nimport { ColumnElement, ColumnGroupElement } from '@/components/ui/column-node';\n\nexport const ColumnKit = [\n ColumnPlugin.withComponent(ColumnGroupElement),\n ColumnItemPlugin.withComponent(ColumnElement),\n];\n","'use client';\n\nimport type { ExtendConfig, Path } from 'platejs';\n\nimport {\n type BaseCommentConfig,\n BaseCommentPlugin,\n getDraftCommentKey,\n} from '@platejs/comment';\nimport { isSlateString } from 'platejs';\nimport { toTPlatePlugin } from 'platejs/react';\n\nimport { CommentLeaf } from '@/components/ui/comment-node';\n\ntype CommentConfig = ExtendConfig<\n BaseCommentConfig,\n {\n activeId: string | null;\n commentingBlock: Path | null;\n hoverId: string | null;\n uniquePathMap: Map<string, Path>;\n }\n>;\n\nexport const commentPlugin = toTPlatePlugin<CommentConfig>(BaseCommentPlugin, {\n handlers: {\n onClick: ({ api, event, setOption, type }) => {\n let leaf = event.target as HTMLElement;\n let isSet = false;\n\n const unsetActiveSuggestion = () => {\n setOption('activeId', null);\n isSet = true;\n };\n\n if (!isSlateString(leaf)) unsetActiveSuggestion();\n\n while (leaf.parentElement) {\n if (leaf.classList.contains(`slate-${type}`)) {\n const commentsEntry = api.comment!.node();\n\n if (!commentsEntry) {\n unsetActiveSuggestion();\n\n break;\n }\n\n const id = api.comment!.nodeId(commentsEntry[0]);\n\n setOption('activeId', id ?? null);\n isSet = true;\n\n break;\n }\n\n leaf = leaf.parentElement;\n }\n\n if (!isSet) unsetActiveSuggestion();\n },\n },\n options: {\n activeId: null,\n commentingBlock: null,\n hoverId: null,\n uniquePathMap: new Map(),\n },\n})\n .extendTransforms(\n ({\n editor,\n setOption,\n tf: {\n comment: { setDraft },\n },\n }) => ({\n setDraft: () => {\n if (editor.api.isCollapsed()) {\n editor.tf.select(editor.api.block()![1]);\n }\n\n setDraft();\n\n editor.tf.collapse();\n setOption('activeId', getDraftCommentKey());\n setOption('commentingBlock', editor.selection!.focus.path.slice(0, 1));\n },\n })\n )\n .configure({\n node: { component: CommentLeaf },\n shortcuts: {\n setDraft: { keys: 'mod+shift+m' },\n },\n });\n\nexport const CommentKit = [commentPlugin];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TCommentText } from 'platejs';\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { getCommentCount } from '@platejs/comment';\nimport { PlateLeaf, useEditorPlugin, usePluginOption } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\nimport { commentPlugin } from '@/components/editor/plugins/comment-kit';\n\nexport function CommentLeaf(props: PlateLeafProps<TCommentText>) {\n const { children, leaf } = props;\n\n const { api, setOption } = useEditorPlugin(commentPlugin);\n const hoverId = usePluginOption(commentPlugin, 'hoverId');\n const activeId = usePluginOption(commentPlugin, 'activeId');\n\n const isOverlapping = getCommentCount(leaf) > 1;\n const currentId = api.comment.nodeId(leaf);\n const isActive = activeId === currentId;\n const isHover = hoverId === currentId;\n\n return (\n <PlateLeaf\n {...props}\n className={cn(\n 'border-b-2 border-b-highlight/[.36] bg-highlight/[.13] transition-colors duration-200',\n (isHover || isActive) && 'border-b-highlight bg-highlight/25',\n isOverlapping && 'border-b-2 border-b-highlight/[.7] bg-highlight/25',\n (isHover || isActive) &&\n isOverlapping &&\n 'border-b-highlight bg-highlight/45'\n )}\n attributes={{\n ...props.attributes,\n onClick: () => setOption('activeId', currentId ?? null),\n onMouseEnter: () => setOption('hoverId', currentId ?? null),\n onMouseLeave: () => setOption('hoverId', null),\n }}\n >\n {children}\n </PlateLeaf>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport {\n type CursorData,\n type CursorOverlayState,\n useCursorOverlay,\n} from '@platejs/selection/react';\nimport { RangeApi } from 'platejs';\nimport { usePluginOption } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function CursorOverlay() {\n const { cursors } = useCursorOverlay();\n\n return (\n <>\n {cursors.map((cursor) => (\n <Cursor key={cursor.id} {...cursor} />\n ))}\n </>\n );\n}\n\nfunction Cursor({\n id,\n caretPosition,\n data,\n selection,\n selectionRects,\n}: CursorOverlayState<CursorData>) {\n const streaming = usePluginOption(AIChatPlugin, 'streaming');\n const { style, selectionStyle = style } = data ?? ({} as CursorData);\n const isCursor = RangeApi.isCollapsed(selection);\n\n if (streaming) return null;\n\n return (\n <>\n {selectionRects.map((position, i) => (\n <div\n key={i}\n className={cn(\n 'pointer-events-none absolute z-10',\n id === 'selection' && 'bg-brand/25',\n id === 'selection' && isCursor && 'bg-primary'\n )}\n style={{\n ...selectionStyle,\n ...position,\n }}\n />\n ))}\n {caretPosition && (\n <div\n className={cn(\n 'pointer-events-none absolute z-10 w-0.5',\n id === 'drag' && 'w-px bg-brand'\n )}\n style={{ ...caretPosition, ...style }}\n />\n )}\n </>\n );\n}\n","'use client';\n\nimport { CursorOverlayPlugin } from '@platejs/selection/react';\n\nimport { CursorOverlay } from '@/components/ui/cursor-overlay';\n\nexport const CursorOverlayKit = [\n CursorOverlayPlugin.configure({\n render: {\n afterEditable: () => <CursorOverlay />,\n },\n }),\n];\n","import * as React from \"react\"\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from \"lucide-react\"\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/ui/button\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-md bg-accent\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n )\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n )\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n )\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n","'use client';\n\nimport { DatePlugin } from '@platejs/date/react';\n\nimport { DateElement } from '@/components/ui/date-node';\n\nexport const DateKit = [DatePlugin.withComponent(DateElement)];\n","'use client';\n\nimport type { TDateElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { PlateElement, useReadOnly } from 'platejs/react';\n\nimport { Calendar } from '@/components/ui/calendar';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport function DateElement(props: PlateElementProps<TDateElement>) {\n const { editor, element } = props;\n\n const readOnly = useReadOnly();\n\n const trigger = (\n <span\n className={cn(\n 'w-fit cursor-pointer rounded-sm bg-muted px-1 text-muted-foreground'\n )}\n contentEditable={false}\n draggable\n >\n {element.date ? (\n (() => {\n const today = new Date();\n const elementDate = new Date(element.date);\n const isToday =\n elementDate.getDate() === today.getDate() &&\n elementDate.getMonth() === today.getMonth() &&\n elementDate.getFullYear() === today.getFullYear();\n\n const isYesterday =\n new Date(today.setDate(today.getDate() - 1)).toDateString() ===\n elementDate.toDateString();\n const isTomorrow =\n new Date(today.setDate(today.getDate() + 2)).toDateString() ===\n elementDate.toDateString();\n\n if (isToday) return 'Today';\n if (isYesterday) return 'Yesterday';\n if (isTomorrow) return 'Tomorrow';\n\n return elementDate.toLocaleDateString(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n })()\n ) : (\n <span>Pick a date</span>\n )}\n </span>\n );\n\n if (readOnly) {\n return trigger;\n }\n\n return (\n <PlateElement\n {...props}\n className=\"inline-block\"\n attributes={{\n ...props.attributes,\n contentEditable: false,\n }}\n >\n <Popover>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n selected={new Date(element.date as string)}\n onSelect={(date) => {\n if (!date) return;\n\n editor.tf.setNodes(\n { date: date.toDateString() },\n { at: element }\n );\n }}\n mode=\"single\"\n initialFocus\n />\n </PopoverContent>\n </Popover>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { DndPlugin, useDraggable, useDropLine } from '@platejs/dnd';\nimport { expandListItemsWithChildren } from '@platejs/list';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { GripVertical } from 'lucide-react';\nimport { type TElement, getPluginByType, isType, KEYS } from 'platejs';\nimport {\n type PlateEditor,\n type PlateElementProps,\n type RenderNodeWrapper,\n MemoizedChildren,\n useEditorRef,\n useElement,\n usePluginOption,\n} from 'platejs/react';\nimport { useSelected } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nconst UNDRAGGABLE_KEYS = [KEYS.column, KEYS.tr, KEYS.td];\n\nexport const BlockDraggable: RenderNodeWrapper = (props) => {\n const { editor, element, path } = props;\n\n const enabled = React.useMemo(() => {\n if (editor.dom.readOnly) return false;\n\n if (path.length === 1 && !isType(editor, element, UNDRAGGABLE_KEYS)) {\n return true;\n }\n if (path.length === 3 && !isType(editor, element, UNDRAGGABLE_KEYS)) {\n const block = editor.api.some({\n at: path,\n match: {\n type: editor.getType(KEYS.column),\n },\n });\n\n if (block) {\n return true;\n }\n }\n if (path.length === 4 && !isType(editor, element, UNDRAGGABLE_KEYS)) {\n const block = editor.api.some({\n at: path,\n match: {\n type: editor.getType(KEYS.table),\n },\n });\n\n if (block) {\n return true;\n }\n }\n\n return false;\n }, [editor, element, path]);\n\n if (!enabled) return;\n\n return (props) => <Draggable {...props} />;\n};\n\nfunction Draggable(props: PlateElementProps) {\n const { children, editor, element, path } = props;\n const blockSelectionApi = editor.getApi(BlockSelectionPlugin).blockSelection;\n\n const { isAboutToDrag, isDragging, nodeRef, previewRef, handleRef } =\n useDraggable({\n element,\n onDropHandler: (_, { dragItem }) => {\n const id = (dragItem as { id: string[] | string }).id;\n\n if (blockSelectionApi) {\n blockSelectionApi.add(id);\n }\n resetPreview();\n },\n });\n\n const isInColumn = path.length === 3;\n const isInTable = path.length === 4;\n\n const [previewTop, setPreviewTop] = React.useState(0);\n\n const resetPreview = () => {\n if (previewRef.current) {\n previewRef.current.replaceChildren();\n previewRef.current?.classList.add('hidden');\n }\n };\n\n // clear up virtual multiple preview when drag end\n React.useEffect(() => {\n if (!isDragging) {\n resetPreview();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDragging]);\n\n React.useEffect(() => {\n if (isAboutToDrag) {\n previewRef.current?.classList.remove('opacity-0');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isAboutToDrag]);\n\n const [dragButtonTop, setDragButtonTop] = React.useState(0);\n\n return (\n <div\n className={cn(\n 'relative',\n isDragging && 'opacity-50',\n getPluginByType(editor, element.type)?.node.isContainer\n ? 'group/container'\n : 'group'\n )}\n onMouseEnter={() => {\n if (isDragging) return;\n setDragButtonTop(calcDragButtonTop(editor, element));\n }}\n >\n {!isInTable && (\n <Gutter>\n <div\n className={cn(\n 'slate-blockToolbarWrapper',\n 'flex h-[1.5em]',\n isInColumn && 'h-4'\n )}\n >\n <div\n className={cn(\n 'slate-blockToolbar relative w-4.5',\n 'pointer-events-auto mr-1 flex items-center',\n isInColumn && 'mr-1.5'\n )}\n >\n <Button\n ref={handleRef}\n variant=\"ghost\"\n className=\"-left-0 absolute h-6 w-full p-0\"\n style={{ top: `${dragButtonTop + 3}px` }}\n data-plate-prevent-deselect\n >\n <DragHandle\n isDragging={isDragging}\n previewRef={previewRef}\n resetPreview={resetPreview}\n setPreviewTop={setPreviewTop}\n />\n </Button>\n </div>\n </div>\n </Gutter>\n )}\n\n <div\n ref={previewRef}\n className={cn('-left-0 absolute hidden w-full')}\n style={{ top: `${-previewTop}px` }}\n contentEditable={false}\n />\n\n <div\n ref={nodeRef}\n className=\"slate-blockWrapper flow-root\"\n onContextMenu={(event) =>\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.addOnContextMenu({ element, event })\n }\n >\n <MemoizedChildren>{children}</MemoizedChildren>\n <DropLine />\n </div>\n </div>\n );\n}\n\nfunction Gutter({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n const editor = useEditorRef();\n const element = useElement();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n const selected = useSelected();\n\n return (\n <div\n {...props}\n className={cn(\n 'slate-gutterLeft',\n '-translate-x-full absolute top-0 z-50 flex h-full cursor-text hover:opacity-100 sm:opacity-0',\n getPluginByType(editor, element.type)?.node.isContainer\n ? 'group-hover/container:opacity-100'\n : 'group-hover:opacity-100',\n isSelectionAreaVisible && 'hidden',\n !selected && 'opacity-0',\n className\n )}\n contentEditable={false}\n >\n {children}\n </div>\n );\n}\n\nconst DragHandle = React.memo(function DragHandle({\n isDragging,\n previewRef,\n resetPreview,\n setPreviewTop,\n}: {\n isDragging: boolean;\n previewRef: React.RefObject<HTMLDivElement | null>;\n resetPreview: () => void;\n setPreviewTop: (top: number) => void;\n}) {\n const editor = useEditorRef();\n const element = useElement();\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <div\n className=\"flex size-full items-center justify-center\"\n onClick={(e) => {\n e.preventDefault();\n editor.getApi(BlockSelectionPlugin).blockSelection.focus();\n }}\n onMouseDown={(e) => {\n resetPreview();\n\n if ((e.button !== 0 && e.button !== 2) || e.shiftKey) return;\n\n const blockSelection = editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.getNodes({ sort: true });\n\n let selectionNodes =\n blockSelection.length > 0\n ? blockSelection\n : editor.api.blocks({ mode: 'highest' });\n\n // If current block is not in selection, use it as the starting point\n if (!selectionNodes.some(([node]) => node.id === element.id)) {\n selectionNodes = [[element, editor.api.findPath(element)!]];\n }\n\n // Process selection nodes to include list children\n const blocks = expandListItemsWithChildren(\n editor,\n selectionNodes\n ).map(([node]) => node);\n\n if (blockSelection.length === 0) {\n editor.tf.blur();\n editor.tf.collapse();\n }\n\n const elements = createDragPreviewElements(editor, blocks);\n previewRef.current?.append(...elements);\n previewRef.current?.classList.remove('hidden');\n previewRef.current?.classList.add('opacity-0');\n editor.setOption(DndPlugin, 'multiplePreviewRef', previewRef);\n\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.set(blocks.map((block) => block.id as string));\n }}\n onMouseEnter={() => {\n if (isDragging) return;\n\n const blockSelection = editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.getNodes({ sort: true });\n\n let selectedBlocks =\n blockSelection.length > 0\n ? blockSelection\n : editor.api.blocks({ mode: 'highest' });\n\n // If current block is not in selection, use it as the starting point\n if (!selectedBlocks.some(([node]) => node.id === element.id)) {\n selectedBlocks = [[element, editor.api.findPath(element)!]];\n }\n\n // Process selection to include list children\n const processedBlocks = expandListItemsWithChildren(\n editor,\n selectedBlocks\n );\n\n const ids = processedBlocks.map((block) => block[0].id as string);\n\n if (ids.length > 1 && ids.includes(element.id as string)) {\n const previewTop = calculatePreviewTop(editor, {\n blocks: processedBlocks.map((block) => block[0]),\n element,\n });\n setPreviewTop(previewTop);\n } else {\n setPreviewTop(0);\n }\n }}\n onMouseUp={() => {\n resetPreview();\n }}\n data-plate-prevent-deselect\n role=\"button\"\n >\n <GripVertical className=\"text-muted-foreground\" />\n </div>\n </TooltipTrigger>\n <TooltipContent>Drag to move</TooltipContent>\n </Tooltip>\n );\n});\n\nconst DropLine = React.memo(function DropLine({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n const { dropLine } = useDropLine();\n\n if (!dropLine) return null;\n\n return (\n <div\n {...props}\n className={cn(\n 'slate-dropLine',\n 'absolute inset-x-0 h-0.5 opacity-100 transition-opacity',\n 'bg-brand/50',\n dropLine === 'top' && '-top-px',\n dropLine === 'bottom' && '-bottom-px',\n className\n )}\n />\n );\n});\n\nconst createDragPreviewElements = (\n editor: PlateEditor,\n blocks: TElement[]\n): HTMLElement[] => {\n const elements: HTMLElement[] = [];\n const ids: string[] = [];\n\n /**\n * Remove data attributes from the element to avoid recognized as slate\n * elements incorrectly.\n */\n const removeDataAttributes = (element: HTMLElement) => {\n Array.from(element.attributes).forEach((attr) => {\n if (\n attr.name.startsWith('data-slate') ||\n attr.name.startsWith('data-block-id')\n ) {\n element.removeAttribute(attr.name);\n }\n });\n\n Array.from(element.children).forEach((child) => {\n removeDataAttributes(child as HTMLElement);\n });\n };\n\n const resolveElement = (node: TElement, index: number) => {\n const domNode = editor.api.toDOMNode(node)!;\n const newDomNode = domNode.cloneNode(true) as HTMLElement;\n\n // Apply visual compensation for horizontal scroll\n const applyScrollCompensation = (\n original: Element,\n cloned: HTMLElement\n ) => {\n const scrollLeft = original.scrollLeft;\n\n if (scrollLeft > 0) {\n // Create a wrapper to handle the scroll offset\n const scrollWrapper = document.createElement('div');\n scrollWrapper.style.overflow = 'hidden';\n scrollWrapper.style.width = `${original.clientWidth}px`;\n\n // Create inner container with the full content\n const innerContainer = document.createElement('div');\n innerContainer.style.transform = `translateX(-${scrollLeft}px)`;\n innerContainer.style.width = `${original.scrollWidth}px`;\n\n // Move all children to the inner container\n while (cloned.firstChild) {\n innerContainer.append(cloned.firstChild);\n }\n\n // Apply the original element's styles to maintain appearance\n const originalStyles = window.getComputedStyle(original);\n cloned.style.padding = '0';\n innerContainer.style.padding = originalStyles.padding;\n\n scrollWrapper.append(innerContainer);\n cloned.append(scrollWrapper);\n }\n };\n\n applyScrollCompensation(domNode, newDomNode);\n\n ids.push(node.id as string);\n const wrapper = document.createElement('div');\n wrapper.append(newDomNode);\n wrapper.style.display = 'flow-root';\n\n const lastDomNode = blocks[index - 1];\n\n if (lastDomNode) {\n const lastDomNodeRect = editor.api\n .toDOMNode(lastDomNode)!\n .parentElement!.getBoundingClientRect();\n\n const domNodeRect = domNode.parentElement!.getBoundingClientRect();\n\n const distance = domNodeRect.top - lastDomNodeRect.bottom;\n\n // Check if the two elements are adjacent (touching each other)\n if (distance > 15) {\n wrapper.style.marginTop = `${distance}px`;\n }\n }\n\n removeDataAttributes(newDomNode);\n elements.push(wrapper);\n };\n\n blocks.forEach((node, index) => {\n resolveElement(node, index);\n });\n\n editor.setOption(DndPlugin, 'draggingId', ids);\n\n return elements;\n};\n\nconst calculatePreviewTop = (\n editor: PlateEditor,\n {\n blocks,\n element,\n }: {\n blocks: TElement[];\n element: TElement;\n }\n): number => {\n const child = editor.api.toDOMNode(element)!;\n const editable = editor.api.toDOMNode(editor)!;\n const firstSelectedChild = blocks[0];\n\n const firstDomNode = editor.api.toDOMNode(firstSelectedChild)!;\n // Get editor's top padding\n const editorPaddingTop = Number(\n window.getComputedStyle(editable).paddingTop.replace('px', '')\n );\n\n // Calculate distance from first selected node to editor top\n const firstNodeToEditorDistance =\n firstDomNode.getBoundingClientRect().top -\n editable.getBoundingClientRect().top -\n editorPaddingTop;\n\n // Get margin top of first selected node\n const firstMarginTopString = window.getComputedStyle(firstDomNode).marginTop;\n const marginTop = Number(firstMarginTopString.replace('px', ''));\n\n // Calculate distance from current node to editor top\n const currentToEditorDistance =\n child.getBoundingClientRect().top -\n editable.getBoundingClientRect().top -\n editorPaddingTop;\n\n const currentMarginTopString = window.getComputedStyle(child).marginTop;\n const currentMarginTop = Number(currentMarginTopString.replace('px', ''));\n\n const previewElementsTopDistance =\n currentToEditorDistance -\n firstNodeToEditorDistance +\n marginTop -\n currentMarginTop;\n\n return previewElementsTopDistance;\n};\n\nconst calcDragButtonTop = (editor: PlateEditor, element: TElement): number => {\n const child = editor.api.toDOMNode(element)!;\n\n const currentMarginTopString = window.getComputedStyle(child).marginTop;\n const currentMarginTop = Number(currentMarginTopString.replace('px', ''));\n\n return currentMarginTop;\n};\n","'use client';\n\nimport { DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\n\nimport { DndPlugin } from '@platejs/dnd';\nimport { PlaceholderPlugin } from '@platejs/media/react';\n\nimport { BlockDraggable } from '@/components/ui/block-draggable';\n\nexport const DndKit = [\n DndPlugin.configure({\n options: {\n enableScroller: true,\n onDropFiles: ({ dragItem, editor, target }) => {\n editor\n .getTransforms(PlaceholderPlugin)\n .insert.media(dragItem.files, { at: target, nextBlock: false });\n },\n },\n render: {\n aboveNodes: BlockDraggable,\n aboveSlate: ({ children }) => (\n <DndProvider backend={HTML5Backend}>{children}</DndProvider>\n ),\n },\n }),\n];\n","'use client';\n\nimport { DocxPlugin } from '@platejs/docx';\nimport { JuicePlugin } from '@platejs/juice';\n\nexport const DocxKit = [DocxPlugin, JuicePlugin];\n","'use client';\n\nimport { ExitBreakPlugin } from 'platejs';\n\nexport const ExitBreakKit = [\n ExitBreakPlugin.configure({\n shortcuts: {\n insert: { keys: 'mod+enter' },\n insertBefore: { keys: 'mod+shift+enter' },\n },\n }),\n];\n","'use client';\n\nimport { cn } from '@/lib/utils';\n\nimport { Toolbar } from './toolbar';\n\nexport function FixedToolbar(props: React.ComponentProps<typeof Toolbar>) {\n return (\n <Toolbar\n {...props}\n className={cn(\n 'scrollbar-hide sticky top-0 left-0 z-50 w-full justify-between overflow-x-auto rounded-t-lg border-b border-b-border bg-background/95 p-1 backdrop-blur-sm supports-backdrop-blur:bg-background/60',\n props.className\n )}\n />\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { Alignment } from '@platejs/basic-styles';\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { TextAlignPlugin } from '@platejs/basic-styles/react';\nimport {\n AlignCenterIcon,\n AlignJustifyIcon,\n AlignLeftIcon,\n AlignRightIcon,\n} from 'lucide-react';\nimport { useEditorPlugin, useSelectionFragmentProp } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\n\nimport { ToolbarButton } from './toolbar';\n\nconst items = [\n {\n icon: AlignLeftIcon,\n value: 'left',\n },\n {\n icon: AlignCenterIcon,\n value: 'center',\n },\n {\n icon: AlignRightIcon,\n value: 'right',\n },\n {\n icon: AlignJustifyIcon,\n value: 'justify',\n },\n];\n\nexport function AlignToolbarButton(props: DropdownMenuProps) {\n const { editor, tf } = useEditorPlugin(TextAlignPlugin);\n const value =\n useSelectionFragmentProp({\n defaultValue: 'start',\n getProp: (node) => node.align,\n }) ?? 'left';\n\n const [open, setOpen] = React.useState(false);\n const IconValue =\n items.find((item) => item.value === value)?.icon ?? AlignLeftIcon;\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Align\" isDropdown>\n <IconValue />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent className=\"min-w-0\" align=\"start\">\n <DropdownMenuRadioGroup\n value={value}\n onValueChange={(value) => {\n tf.textAlign.setNodes(value as Alignment);\n editor.tf.focus();\n }}\n >\n {items.map(({ icon: Icon, value: itemValue }) => (\n <DropdownMenuRadioItem\n key={itemValue}\n className=\"pl-2 data-[state=checked]:bg-accent *:first:[span]:hidden\"\n value={itemValue}\n >\n <Icon />\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","'use client';\n/* eslint-disable react-hooks/refs -- Ref usage for color picker component refs */\n\nimport React from 'react';\n\nimport type {\n DropdownMenuItemProps,\n DropdownMenuProps,\n} from '@radix-ui/react-dropdown-menu';\n\nimport { useComposedRef } from '@udecode/cn';\nimport debounce from 'lodash/debounce.js';\nimport { EraserIcon, PlusIcon } from 'lucide-react';\nimport { useEditorRef, useEditorSelector } from 'platejs/react';\n\nimport { buttonVariants } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nimport { ToolbarButton, ToolbarMenuGroup } from './toolbar';\n\nexport function FontColorToolbarButton({\n children,\n nodeType,\n tooltip,\n}: {\n nodeType: string;\n tooltip?: string;\n} & DropdownMenuProps) {\n const editor = useEditorRef();\n\n const selectionDefined = useEditorSelector(\n (editor) => !!editor.selection,\n []\n );\n\n const color = useEditorSelector(\n (editor) => editor.api.mark(nodeType) as string,\n [nodeType]\n );\n\n const [selectedColor, setSelectedColor] = React.useState<string>();\n const [open, setOpen] = React.useState(false);\n\n const onToggle = React.useCallback(\n (value = !open) => {\n setOpen(value);\n },\n [open, setOpen]\n );\n\n const updateColor = React.useCallback(\n (value: string) => {\n if (editor.selection) {\n setSelectedColor(value);\n\n editor.tf.select(editor.selection);\n editor.tf.focus();\n\n editor.tf.addMarks({ [nodeType]: value });\n }\n },\n [editor, nodeType]\n );\n\n const updateColorAndClose = React.useCallback(\n (value: string) => {\n updateColor(value);\n onToggle();\n },\n [onToggle, updateColor]\n );\n\n const clearColor = React.useCallback(() => {\n if (editor.selection) {\n editor.tf.select(editor.selection);\n editor.tf.focus();\n\n if (selectedColor) {\n editor.tf.removeMarks(nodeType);\n }\n\n onToggle();\n }\n }, [editor, selectedColor, onToggle, nodeType]);\n\n React.useEffect(() => {\n if (selectionDefined) {\n setSelectedColor(color);\n }\n }, [color, selectionDefined]);\n\n return (\n <DropdownMenu\n open={open}\n onOpenChange={(value) => {\n setOpen(value);\n }}\n modal={false}\n >\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip={tooltip}>\n {children}\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <ColorPicker\n color={selectedColor || color}\n clearColor={clearColor}\n colors={DEFAULT_COLORS}\n customColors={DEFAULT_CUSTOM_COLORS}\n updateColor={updateColorAndClose}\n updateCustomColor={updateColor}\n />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction PureColorPicker({\n className,\n clearColor,\n color,\n colors,\n customColors,\n updateColor,\n updateCustomColor,\n ...props\n}: React.ComponentProps<'div'> & {\n colors: TColor[];\n customColors: TColor[];\n clearColor: () => void;\n updateColor: (color: string) => void;\n updateCustomColor: (color: string) => void;\n color?: string;\n}) {\n return (\n <div className={cn('flex flex-col', className)} {...props}>\n <ToolbarMenuGroup label=\"Custom Colors\">\n <ColorCustom\n color={color}\n className=\"px-2\"\n colors={colors}\n customColors={customColors}\n updateColor={updateColor}\n updateCustomColor={updateCustomColor}\n />\n </ToolbarMenuGroup>\n <ToolbarMenuGroup label=\"Default Colors\">\n <ColorDropdownMenuItems\n color={color}\n className=\"px-2\"\n colors={colors}\n updateColor={updateColor}\n />\n </ToolbarMenuGroup>\n {color && (\n <ToolbarMenuGroup>\n <DropdownMenuItem className=\"p-2\" onClick={clearColor}>\n <EraserIcon />\n <span>Clear</span>\n </DropdownMenuItem>\n </ToolbarMenuGroup>\n )}\n </div>\n );\n}\n\nconst ColorPicker = React.memo(\n PureColorPicker,\n (prev, next) =>\n prev.color === next.color &&\n prev.colors === next.colors &&\n prev.customColors === next.customColors\n);\n\nfunction ColorCustom({\n className,\n color,\n colors,\n customColors,\n updateColor,\n updateCustomColor,\n ...props\n}: {\n colors: TColor[];\n customColors: TColor[];\n updateColor: (color: string) => void;\n updateCustomColor: (color: string) => void;\n color?: string;\n} & React.ComponentPropsWithoutRef<'div'>) {\n const [customColor, setCustomColor] = React.useState<string>();\n const [value, setValue] = React.useState<string>(color || '#000000');\n\n React.useEffect(() => {\n if (\n !color ||\n customColors.some((c) => c.value === color) ||\n colors.some((c) => c.value === color)\n ) {\n return;\n }\n\n setCustomColor(color);\n }, [color, colors, customColors]);\n\n const computedColors = React.useMemo(\n () =>\n customColor\n ? [\n ...customColors,\n {\n isBrightColor: false,\n name: '',\n value: customColor,\n },\n ]\n : customColors,\n [customColor, customColors]\n );\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const updateCustomColorDebounced = React.useCallback(\n debounce(updateCustomColor, 100),\n [updateCustomColor]\n );\n\n return (\n <div className={cn('relative flex flex-col gap-4', className)} {...props}>\n <ColorDropdownMenuItems\n color={color}\n colors={computedColors}\n updateColor={updateColor}\n >\n <ColorInput\n value={value}\n onChange={(e) => {\n setValue(e.target.value);\n updateCustomColorDebounced(e.target.value);\n }}\n >\n <DropdownMenuItem\n className={cn(\n buttonVariants({\n size: 'icon',\n variant: 'outline',\n }),\n 'absolute top-1 right-2 bottom-2 flex size-8 items-center justify-center rounded-full'\n )}\n onSelect={(e) => {\n e.preventDefault();\n }}\n >\n <span className=\"sr-only\">Custom</span>\n <PlusIcon />\n </DropdownMenuItem>\n </ColorInput>\n </ColorDropdownMenuItems>\n </div>\n );\n}\n\nfunction ColorInput({\n children,\n className,\n value = '#000000',\n ...props\n}: React.ComponentProps<'input'>) {\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n\n return (\n <div className=\"flex flex-col items-center\">\n {React.Children.map(children, (child) => {\n if (!child) return child;\n\n return React.cloneElement(\n child as React.ReactElement<{\n onClick: () => void;\n }>,\n {\n onClick: () => inputRef.current?.click(),\n }\n );\n })}\n <input\n {...props}\n ref={useComposedRef(props.ref, inputRef)}\n className={cn('size-0 overflow-hidden border-0 p-0', className)}\n value={value}\n type=\"color\"\n />\n </div>\n );\n}\n\ntype TColor = {\n isBrightColor: boolean;\n name: string;\n value: string;\n};\n\nfunction ColorDropdownMenuItem({\n className,\n isBrightColor,\n isSelected,\n name,\n updateColor,\n value,\n ...props\n}: {\n isBrightColor: boolean;\n isSelected: boolean;\n value: string;\n updateColor: (color: string) => void;\n name?: string;\n} & DropdownMenuItemProps) {\n const content = (\n <DropdownMenuItem\n className={cn(\n buttonVariants({\n size: 'icon',\n variant: 'outline',\n }),\n 'my-1 flex size-6 items-center justify-center rounded-full border border-muted border-solid p-0 transition-all hover:scale-125',\n !isBrightColor && 'border-transparent',\n isSelected && 'border-2 border-primary',\n className\n )}\n style={{ backgroundColor: value }}\n onSelect={(e) => {\n e.preventDefault();\n updateColor(value);\n }}\n {...props}\n />\n );\n\n return name ? (\n <Tooltip>\n <TooltipTrigger>{content}</TooltipTrigger>\n <TooltipContent className=\"mb-1 capitalize\">{name}</TooltipContent>\n </Tooltip>\n ) : (\n content\n );\n}\n\nexport function ColorDropdownMenuItems({\n className,\n color,\n colors,\n updateColor,\n ...props\n}: {\n colors: TColor[];\n updateColor: (color: string) => void;\n color?: string;\n} & React.ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'grid grid-cols-[repeat(10,1fr)] place-items-center gap-x-1',\n className\n )}\n {...props}\n >\n <TooltipProvider>\n {colors.map(({ isBrightColor, name, value }) => (\n <ColorDropdownMenuItem\n name={name}\n key={name ?? value}\n value={value}\n isBrightColor={isBrightColor}\n isSelected={color === value}\n updateColor={updateColor}\n />\n ))}\n {props.children}\n </TooltipProvider>\n </div>\n );\n}\n\nexport const DEFAULT_COLORS = [\n {\n isBrightColor: false,\n name: 'black',\n value: '#000000',\n },\n {\n isBrightColor: false,\n name: 'dark grey 4',\n value: '#434343',\n },\n {\n isBrightColor: false,\n name: 'dark grey 3',\n value: '#666666',\n },\n {\n isBrightColor: false,\n name: 'dark grey 2',\n value: '#999999',\n },\n {\n isBrightColor: false,\n name: 'dark grey 1',\n value: '#B7B7B7',\n },\n {\n isBrightColor: false,\n name: 'grey',\n value: '#CCCCCC',\n },\n {\n isBrightColor: false,\n name: 'light grey 1',\n value: '#D9D9D9',\n },\n {\n isBrightColor: true,\n name: 'light grey 2',\n value: '#EFEFEF',\n },\n {\n isBrightColor: true,\n name: 'light grey 3',\n value: '#F3F3F3',\n },\n {\n isBrightColor: true,\n name: 'white',\n value: '#FFFFFF',\n },\n {\n isBrightColor: false,\n name: 'red berry',\n value: '#980100',\n },\n {\n isBrightColor: false,\n name: 'red',\n value: '#FE0000',\n },\n {\n isBrightColor: false,\n name: 'orange',\n value: '#FE9900',\n },\n {\n isBrightColor: true,\n name: 'yellow',\n value: '#FEFF00',\n },\n {\n isBrightColor: false,\n name: 'green',\n value: '#00FF00',\n },\n {\n isBrightColor: false,\n name: 'cyan',\n value: '#00FFFF',\n },\n {\n isBrightColor: false,\n name: 'cornflower blue',\n value: '#4B85E8',\n },\n {\n isBrightColor: false,\n name: 'blue',\n value: '#1300FF',\n },\n {\n isBrightColor: false,\n name: 'purple',\n value: '#9900FF',\n },\n {\n isBrightColor: false,\n name: 'magenta',\n value: '#FF00FF',\n },\n\n {\n isBrightColor: false,\n name: 'light red berry 3',\n value: '#E6B8AF',\n },\n {\n isBrightColor: false,\n name: 'light red 3',\n value: '#F4CCCC',\n },\n {\n isBrightColor: true,\n name: 'light orange 3',\n value: '#FCE4CD',\n },\n {\n isBrightColor: true,\n name: 'light yellow 3',\n value: '#FFF2CC',\n },\n {\n isBrightColor: true,\n name: 'light green 3',\n value: '#D9EAD3',\n },\n {\n isBrightColor: false,\n name: 'light cyan 3',\n value: '#D0DFE3',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 3',\n value: '#C9DAF8',\n },\n {\n isBrightColor: true,\n name: 'light blue 3',\n value: '#CFE1F3',\n },\n {\n isBrightColor: true,\n name: 'light purple 3',\n value: '#D9D2E9',\n },\n {\n isBrightColor: true,\n name: 'light magenta 3',\n value: '#EAD1DB',\n },\n\n {\n isBrightColor: false,\n name: 'light red berry 2',\n value: '#DC7E6B',\n },\n {\n isBrightColor: false,\n name: 'light red 2',\n value: '#EA9999',\n },\n {\n isBrightColor: false,\n name: 'light orange 2',\n value: '#F9CB9C',\n },\n {\n isBrightColor: true,\n name: 'light yellow 2',\n value: '#FFE598',\n },\n {\n isBrightColor: false,\n name: 'light green 2',\n value: '#B7D6A8',\n },\n {\n isBrightColor: false,\n name: 'light cyan 2',\n value: '#A1C4C9',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 2',\n value: '#A4C2F4',\n },\n {\n isBrightColor: false,\n name: 'light blue 2',\n value: '#9FC5E8',\n },\n {\n isBrightColor: false,\n name: 'light purple 2',\n value: '#B5A7D5',\n },\n {\n isBrightColor: false,\n name: 'light magenta 2',\n value: '#D5A6BD',\n },\n\n {\n isBrightColor: false,\n name: 'light red berry 1',\n value: '#CC4125',\n },\n {\n isBrightColor: false,\n name: 'light red 1',\n value: '#E06666',\n },\n {\n isBrightColor: false,\n name: 'light orange 1',\n value: '#F6B26B',\n },\n {\n isBrightColor: false,\n name: 'light yellow 1',\n value: '#FFD966',\n },\n {\n isBrightColor: false,\n name: 'light green 1',\n value: '#93C47D',\n },\n {\n isBrightColor: false,\n name: 'light cyan 1',\n value: '#76A5AE',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 1',\n value: '#6C9EEB',\n },\n {\n isBrightColor: false,\n name: 'light blue 1',\n value: '#6FA8DC',\n },\n {\n isBrightColor: false,\n name: 'light purple 1',\n value: '#8D7CC3',\n },\n {\n isBrightColor: false,\n name: 'light magenta 1',\n value: '#C27BA0',\n },\n\n {\n isBrightColor: false,\n name: 'dark red berry 1',\n value: '#A61B00',\n },\n {\n isBrightColor: false,\n name: 'dark red 1',\n value: '#CC0000',\n },\n {\n isBrightColor: false,\n name: 'dark orange 1',\n value: '#E59138',\n },\n {\n isBrightColor: false,\n name: 'dark yellow 1',\n value: '#F1C231',\n },\n {\n isBrightColor: false,\n name: 'dark green 1',\n value: '#6AA74F',\n },\n {\n isBrightColor: false,\n name: 'dark cyan 1',\n value: '#45818E',\n },\n {\n isBrightColor: false,\n name: 'dark cornflower blue 1',\n value: '#3B78D8',\n },\n {\n isBrightColor: false,\n name: 'dark blue 1',\n value: '#3E84C6',\n },\n {\n isBrightColor: false,\n name: 'dark purple 1',\n value: '#664EA6',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 1',\n value: '#A64D78',\n },\n\n {\n isBrightColor: false,\n name: 'dark red berry 2',\n value: '#84200D',\n },\n {\n isBrightColor: false,\n name: 'dark red 2',\n value: '#990001',\n },\n {\n isBrightColor: false,\n name: 'dark orange 2',\n value: '#B45F05',\n },\n {\n isBrightColor: false,\n name: 'dark yellow 2',\n value: '#BF9002',\n },\n {\n isBrightColor: false,\n name: 'dark green 2',\n value: '#38761D',\n },\n {\n isBrightColor: false,\n name: 'dark cyan 2',\n value: '#124F5C',\n },\n {\n isBrightColor: false,\n name: 'dark cornflower blue 2',\n value: '#1155CB',\n },\n {\n isBrightColor: false,\n name: 'dark blue 2',\n value: '#0C5394',\n },\n {\n isBrightColor: false,\n name: 'dark purple 2',\n value: '#351C75',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 2',\n value: '#741B47',\n },\n\n {\n isBrightColor: false,\n name: 'dark red berry 3',\n value: '#5B0F00',\n },\n {\n isBrightColor: false,\n name: 'dark red 3',\n value: '#660000',\n },\n {\n isBrightColor: false,\n name: 'dark orange 3',\n value: '#783F04',\n },\n {\n isBrightColor: false,\n name: 'dark yellow 3',\n value: '#7E6000',\n },\n {\n isBrightColor: false,\n name: 'dark green 3',\n value: '#274E12',\n },\n {\n isBrightColor: false,\n name: 'dark cyan 3',\n value: '#0D343D',\n },\n {\n isBrightColor: false,\n name: 'dark cornflower blue 3',\n value: '#1B4487',\n },\n {\n isBrightColor: false,\n name: 'dark blue 3',\n value: '#083763',\n },\n {\n isBrightColor: false,\n name: 'dark purple 3',\n value: '#1F124D',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 3',\n value: '#4C1130',\n },\n];\n\nconst DEFAULT_CUSTOM_COLORS = [\n {\n isBrightColor: false,\n name: 'dark orange 3',\n value: '#783F04',\n },\n {\n isBrightColor: false,\n name: 'dark grey 3',\n value: '#666666',\n },\n {\n isBrightColor: false,\n name: 'dark grey 2',\n value: '#999999',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 1',\n value: '#6C9EEB',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 3',\n value: '#4C1130',\n },\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport { Redo2Icon, Undo2Icon } from 'lucide-react';\nimport { useEditorRef, useEditorSelector } from 'platejs/react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function RedoToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const editor = useEditorRef();\n const disabled = useEditorSelector(\n (editor) => editor.history.redos.length === 0,\n []\n );\n\n return (\n <ToolbarButton\n {...props}\n disabled={disabled}\n onClick={() => editor.redo()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Redo\"\n >\n <Redo2Icon />\n </ToolbarButton>\n );\n}\n\nexport function UndoToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const editor = useEditorRef();\n const disabled = useEditorSelector(\n (editor) => editor.history.undos.length === 0,\n []\n );\n\n return (\n <ToolbarButton\n {...props}\n disabled={disabled}\n onClick={() => editor.undo()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Undo\"\n >\n <Undo2Icon />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { useIndentButton, useOutdentButton } from '@platejs/indent/react';\nimport { IndentIcon, OutdentIcon } from 'lucide-react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function IndentToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const { props: buttonProps } = useIndentButton();\n\n return (\n <ToolbarButton {...props} {...buttonProps} tooltip=\"Indent\">\n <IndentIcon />\n </ToolbarButton>\n );\n}\n\nexport function OutdentToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const { props: buttonProps } = useOutdentButton();\n\n return (\n <ToolbarButton {...props} {...buttonProps} tooltip=\"Outdent\">\n <OutdentIcon />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport type { PlateEditor } from 'platejs/react';\n\nimport { insertCallout } from '@platejs/callout';\nimport { insertCodeBlock, toggleCodeBlock } from '@platejs/code-block';\nimport { insertDate } from '@platejs/date';\nimport { insertExcalidraw } from '@platejs/excalidraw';\nimport { insertColumnGroup, toggleColumnGroup } from '@platejs/layout';\nimport { triggerFloatingLink } from '@platejs/link/react';\nimport { insertEquation, insertInlineEquation } from '@platejs/math';\nimport {\n insertAudioPlaceholder,\n insertFilePlaceholder,\n insertMedia,\n insertVideoPlaceholder,\n} from '@platejs/media';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport { TablePlugin } from '@platejs/table/react';\nimport { insertToc } from '@platejs/toc';\nimport {\n type NodeEntry,\n type Path,\n type TElement,\n KEYS,\n PathApi,\n} from 'platejs';\n\nconst ACTION_THREE_COLUMNS = 'action_three_columns';\n\nconst insertList = (editor: PlateEditor, type: string) => {\n editor.tf.insertNodes(\n editor.api.create.block({\n indent: 1,\n listStyleType: type,\n }),\n { select: true }\n );\n};\n\nconst insertBlockMap: Record<\n string,\n (editor: PlateEditor, type: string) => void\n> = {\n [KEYS.listTodo]: insertList,\n [KEYS.ol]: insertList,\n [KEYS.ul]: insertList,\n [ACTION_THREE_COLUMNS]: (editor) =>\n insertColumnGroup(editor, { columns: 3, select: true }),\n [KEYS.audio]: (editor) => insertAudioPlaceholder(editor, { select: true }),\n [KEYS.callout]: (editor) => insertCallout(editor, { select: true }),\n [KEYS.codeBlock]: (editor) => insertCodeBlock(editor, { select: true }),\n [KEYS.equation]: (editor) => insertEquation(editor, { select: true }),\n [KEYS.excalidraw]: (editor) => insertExcalidraw(editor, {}, { select: true }),\n [KEYS.file]: (editor) => insertFilePlaceholder(editor, { select: true }),\n [KEYS.img]: (editor) =>\n insertMedia(editor, {\n select: true,\n type: KEYS.img,\n }),\n [KEYS.mediaEmbed]: (editor) =>\n insertMedia(editor, {\n select: true,\n type: KEYS.mediaEmbed,\n }),\n [KEYS.table]: (editor) =>\n editor.getTransforms(TablePlugin).insert.table({}, { select: true }),\n [KEYS.toc]: (editor) => insertToc(editor, { select: true }),\n [KEYS.video]: (editor) => insertVideoPlaceholder(editor, { select: true }),\n};\n\nconst insertInlineMap: Record<\n string,\n (editor: PlateEditor, type: string) => void\n> = {\n [KEYS.date]: (editor) => insertDate(editor, { select: true }),\n [KEYS.inlineEquation]: (editor) =>\n insertInlineEquation(editor, '', { select: true }),\n [KEYS.link]: (editor) => triggerFloatingLink(editor, { focused: true }),\n};\n\ntype InsertBlockOptions = {\n upsert?: boolean;\n};\n\nexport const insertBlock = (\n editor: PlateEditor,\n type: string,\n options: InsertBlockOptions = {}\n) => {\n const { upsert = false } = options;\n\n editor.tf.withoutNormalizing(() => {\n const block = editor.api.block();\n\n if (!block) return;\n\n const [currentNode, path] = block;\n const isCurrentBlockEmpty = editor.api.isEmpty(currentNode);\n const currentBlockType = getBlockType(currentNode);\n\n const isSameBlockType = type === currentBlockType;\n\n if (upsert && isCurrentBlockEmpty && isSameBlockType) {\n return;\n }\n\n if (type in insertBlockMap) {\n insertBlockMap[type](editor, type);\n } else {\n editor.tf.insertNodes(editor.api.create.block({ type }), {\n at: PathApi.next(path),\n select: true,\n });\n }\n\n if (!isSameBlockType) {\n editor.getApi(SuggestionPlugin).suggestion.withoutSuggestions(() => {\n editor.tf.removeNodes({ previousEmptyBlock: true });\n });\n }\n });\n};\n\nexport const insertInlineElement = (editor: PlateEditor, type: string) => {\n if (insertInlineMap[type]) {\n insertInlineMap[type](editor, type);\n }\n};\n\nconst setList = (\n editor: PlateEditor,\n type: string,\n entry: NodeEntry<TElement>\n) => {\n editor.tf.setNodes(\n editor.api.create.block({\n indent: 1,\n listStyleType: type,\n }),\n {\n at: entry[1],\n }\n );\n};\n\nconst setBlockMap: Record<\n string,\n (editor: PlateEditor, type: string, entry: NodeEntry<TElement>) => void\n> = {\n [KEYS.listTodo]: setList,\n [KEYS.ol]: setList,\n [KEYS.ul]: setList,\n [ACTION_THREE_COLUMNS]: (editor) => toggleColumnGroup(editor, { columns: 3 }),\n [KEYS.codeBlock]: (editor) => toggleCodeBlock(editor),\n};\n\nexport const setBlockType = (\n editor: PlateEditor,\n type: string,\n { at }: { at?: Path } = {}\n) => {\n editor.tf.withoutNormalizing(() => {\n const setEntry = (entry: NodeEntry<TElement>) => {\n const [node, path] = entry;\n\n if (node[KEYS.listType]) {\n editor.tf.unsetNodes([KEYS.listType, 'indent'], { at: path });\n }\n if (type in setBlockMap) {\n return setBlockMap[type](editor, type, entry);\n }\n if (node.type !== type) {\n editor.tf.setNodes({ type }, { at: path });\n }\n };\n\n if (at) {\n const entry = editor.api.node<TElement>(at);\n\n if (entry) {\n setEntry(entry);\n\n return;\n }\n }\n\n const entries = editor.api.blocks({ mode: 'lowest' });\n\n entries.forEach((entry) => {\n setEntry(entry);\n });\n });\n};\n\nexport const getBlockType = (block: TElement) => {\n if (block[KEYS.listType]) {\n if (block[KEYS.listType] === KEYS.ol) {\n return KEYS.ol;\n }\n if (block[KEYS.listType] === KEYS.listTodo) {\n return KEYS.listTodo;\n }\n return KEYS.ul;\n }\n\n return block.type;\n};\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport {\n // CalendarIcon,\n // ChevronRightIcon,\n // Columns3Icon,\n // FileCodeIcon,\n // FilmIcon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n ImageIcon,\n Link2Icon,\n ListIcon,\n ListOrderedIcon,\n // MinusIcon,\n // PenToolIcon,\n PilcrowIcon,\n PlusIcon,\n // QuoteIcon,\n // RadicalIcon,\n // SquareIcon,\n TableIcon,\n // TableOfContentsIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { type PlateEditor, useEditorRef } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n insertBlock,\n insertInlineElement,\n} from '@/components/editor/transforms';\n\nimport { ToolbarButton, ToolbarMenuGroup } from './toolbar';\n\ntype Group = {\n group: string;\n items: Item[];\n};\n\ntype Item = {\n icon: React.ReactNode;\n value: string;\n onSelect: (editor: PlateEditor, value: string) => void;\n focusEditor?: boolean;\n label?: string;\n};\n\nconst groups: Group[] = [\n {\n group: 'Basic blocks',\n items: [\n {\n icon: <PilcrowIcon />,\n label: 'Paragraph',\n value: KEYS.p,\n },\n {\n icon: <Heading1Icon />,\n label: 'Heading 1',\n value: 'h1',\n },\n {\n icon: <Heading2Icon />,\n label: 'Heading 2',\n value: 'h2',\n },\n {\n icon: <Heading3Icon />,\n label: 'Heading 3',\n value: 'h3',\n },\n {\n icon: <TableIcon />,\n label: 'Table',\n value: KEYS.table,\n },\n // {\n // icon: <FileCodeIcon />,\n // label: 'Code',\n // value: KEYS.codeBlock,\n // },\n // {\n // icon: <QuoteIcon />,\n // label: 'Quote',\n // value: KEYS.blockquote,\n // },\n // {\n // icon: <MinusIcon />,\n // label: 'Divider',\n // value: KEYS.hr,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value);\n },\n })),\n },\n {\n group: 'Lists',\n items: [\n {\n icon: <ListIcon />,\n label: 'Bulleted list',\n value: KEYS.ul,\n },\n {\n icon: <ListOrderedIcon />,\n label: 'Numbered list',\n value: KEYS.ol,\n },\n // {\n // icon: <SquareIcon />,\n // label: 'To-do list',\n // value: KEYS.listTodo,\n // },\n // {\n // icon: <ChevronRightIcon />,\n // label: 'Toggle list',\n // value: KEYS.toggle,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value);\n },\n })),\n },\n {\n group: 'Media',\n items: [\n {\n icon: <ImageIcon />,\n label: 'Image',\n value: KEYS.img,\n },\n // {\n // icon: <FilmIcon />,\n // label: 'Embed',\n // value: KEYS.mediaEmbed,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value);\n },\n })),\n },\n // {\n // group: 'Advanced blocks',\n // items: [\n // {\n // icon: <TableOfContentsIcon />,\n // label: 'Table of contents',\n // value: KEYS.toc,\n // },\n // {\n // icon: <Columns3Icon />,\n // label: '3 columns',\n // value: 'action_three_columns',\n // },\n // {\n // focusEditor: false,\n // icon: <RadicalIcon />,\n // label: 'Equation',\n // value: KEYS.equation,\n // },\n // {\n // icon: <PenToolIcon />,\n // label: 'Excalidraw',\n // value: KEYS.excalidraw,\n // }\n // ].map((item) => ({\n // ...item,\n // onSelect: (editor, value) => {\n // insertBlock(editor, value);\n // },\n // })),\n // },\n {\n group: 'Inline',\n items: [\n {\n icon: <Link2Icon />,\n label: 'Link',\n value: KEYS.link,\n },\n // {\n // focusEditor: true,\n // icon: <CalendarIcon />,\n // label: 'Date',\n // value: KEYS.date,\n // },\n // {\n // focusEditor: false,\n // icon: <RadicalIcon />,\n // label: 'Inline Equation',\n // value: KEYS.inlineEquation,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertInlineElement(editor, value);\n },\n })),\n },\n];\n\nexport function InsertToolbarButton(props: DropdownMenuProps) {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Insert\" isDropdown>\n <PlusIcon />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"flex max-h-[500px] min-w-0 flex-col overflow-y-auto\"\n align=\"start\"\n >\n {groups.map(({ group, items: nestedItems }) => (\n <ToolbarMenuGroup key={group} label={group}>\n {nestedItems.map(({ icon, label, value, onSelect }) => (\n <DropdownMenuItem\n key={value}\n className=\"min-w-[180px]\"\n onSelect={() => {\n onSelect(editor, value);\n editor.tf.focus();\n }}\n >\n {icon}\n {label}\n </DropdownMenuItem>\n ))}\n </ToolbarMenuGroup>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n useLinkToolbarButton,\n useLinkToolbarButtonState,\n} from '@platejs/link/react';\nimport { Link } from 'lucide-react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function LinkToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const state = useLinkToolbarButtonState();\n const { props: buttonProps } = useLinkToolbarButton(state);\n\n return (\n <ToolbarButton {...props} {...buttonProps} data-plate-focus tooltip=\"Link\">\n <Link />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { ListStyleType, someList, toggleList } from '@platejs/list';\nimport {\n useIndentTodoToolBarButton,\n useIndentTodoToolBarButtonState,\n} from '@platejs/list/react';\nimport { List, ListOrdered, ListTodoIcon } from 'lucide-react';\nimport { useEditorRef, useEditorSelector } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\n\nimport {\n ToolbarButton,\n ToolbarSplitButton,\n ToolbarSplitButtonPrimary,\n ToolbarSplitButtonSecondary,\n} from './toolbar';\n\nexport function BulletedListToolbarButton() {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n const pressed = useEditorSelector(\n (editor) =>\n someList(editor, [\n ListStyleType.Disc,\n ListStyleType.Circle,\n ListStyleType.Square,\n ]),\n []\n );\n\n return (\n <ToolbarSplitButton pressed={open}>\n <ToolbarSplitButtonPrimary\n className=\"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\"\n onClick={() => {\n toggleList(editor, {\n listStyleType: ListStyleType.Disc,\n });\n }}\n data-state={pressed ? 'on' : 'off'}\n >\n <List className=\"size-4\" />\n </ToolbarSplitButtonPrimary>\n\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarSplitButtonSecondary />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\" alignOffset={-32}>\n <DropdownMenuGroup>\n <DropdownMenuItem\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Disc,\n })\n }\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"size-2 rounded-full border border-current bg-current\" />\n Default\n </div>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Circle,\n })\n }\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"size-2 rounded-full border border-current\" />\n Circle\n </div>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Square,\n })\n }\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"size-2 border border-current bg-current\" />\n Square\n </div>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </ToolbarSplitButton>\n );\n}\n\nexport function NumberedListToolbarButton() {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n const pressed = useEditorSelector(\n (editor) =>\n someList(editor, [\n ListStyleType.Decimal,\n ListStyleType.LowerAlpha,\n ListStyleType.UpperAlpha,\n ListStyleType.LowerRoman,\n ListStyleType.UpperRoman,\n ]),\n []\n );\n\n return (\n <ToolbarSplitButton pressed={open}>\n <ToolbarSplitButtonPrimary\n className=\"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\"\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Decimal,\n })\n }\n data-state={pressed ? 'on' : 'off'}\n >\n <ListOrdered className=\"size-4\" />\n </ToolbarSplitButtonPrimary>\n\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarSplitButtonSecondary />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\" alignOffset={-32}>\n <DropdownMenuGroup>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Decimal,\n })\n }\n >\n Decimal (1, 2, 3)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.LowerAlpha,\n })\n }\n >\n Lower Alpha (a, b, c)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: \"turkish-lower-alpha\",\n })\n }\n >\n Lower Alpha - Turkish (a, b, c, ç)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.UpperAlpha,\n })\n }\n >\n Upper Alpha (A, B, C)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: \"turkish-upper-alpha\",\n })\n }\n >\n Upper Alpha - Turkish (A, B, C, Ç)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.LowerRoman,\n })\n }\n >\n Lower Roman (i, ii, iii)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.UpperRoman,\n })\n }\n >\n Upper Roman (I, II, III)\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </ToolbarSplitButton>\n );\n}\n\nexport function TodoListToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const state = useIndentTodoToolBarButtonState({ nodeType: 'todo' });\n const { props: buttonProps } = useIndentTodoToolBarButton(state);\n\n return (\n <ToolbarButton {...props} {...buttonProps} tooltip=\"Todo\">\n <ListTodoIcon />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { useMarkToolbarButton, useMarkToolbarButtonState } from 'platejs/react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function MarkToolbarButton({\n clear,\n nodeType,\n ...props\n}: React.ComponentProps<typeof ToolbarButton> & {\n nodeType: string;\n clear?: string[] | string;\n}) {\n const state = useMarkToolbarButtonState({ clear, nodeType });\n const { props: buttonProps } = useMarkToolbarButton(state);\n\n return <ToolbarButton {...props} {...buttonProps} />;\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\n\nfunction AlertDialog({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return (\n <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n return (\n <AlertDialogPrimitive.Action\n className={cn(buttonVariants(), className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n return (\n <AlertDialogPrimitive.Cancel\n className={cn(buttonVariants({ variant: \"outline\" }), className)}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { PlaceholderPlugin } from '@platejs/media/react';\nimport {\n AudioLinesIcon,\n FileUpIcon,\n FilmIcon,\n ImageIcon,\n LinkIcon,\n} from 'lucide-react';\nimport { isUrl, KEYS } from 'platejs';\nimport { useEditorRef } from 'platejs/react';\nimport { toast } from 'sonner';\nimport { useFilePicker } from 'use-file-picker';\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@/components/ui/alert-dialog';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Input } from '@/components/ui/input';\n\nimport {\n ToolbarSplitButton,\n ToolbarSplitButtonPrimary,\n ToolbarSplitButtonSecondary,\n} from './toolbar';\n\nconst MEDIA_CONFIG: Record<\n string,\n {\n accept: string[];\n icon: React.ReactNode;\n title: string;\n tooltip: string;\n }\n> = {\n [KEYS.audio]: {\n accept: ['audio/*'],\n icon: <AudioLinesIcon className=\"size-4\" />,\n title: 'Insert Audio',\n tooltip: 'Audio',\n },\n [KEYS.file]: {\n accept: ['*'],\n icon: <FileUpIcon className=\"size-4\" />,\n title: 'Insert File',\n tooltip: 'File',\n },\n [KEYS.img]: {\n accept: ['image/*'],\n icon: <ImageIcon className=\"size-4\" />,\n title: 'Insert Image',\n tooltip: 'Image',\n },\n [KEYS.video]: {\n accept: ['video/*'],\n icon: <FilmIcon className=\"size-4\" />,\n title: 'Insert Video',\n tooltip: 'Video',\n },\n};\n\nexport function MediaToolbarButton({\n nodeType,\n ...props\n}: DropdownMenuProps & { nodeType: string }) {\n const currentConfig = MEDIA_CONFIG[nodeType];\n\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n const [dialogOpen, setDialogOpen] = React.useState(false);\n\n const { openFilePicker } = useFilePicker({\n accept: currentConfig.accept,\n multiple: true,\n onFilesSelected: ({ plainFiles: updatedFiles }) => {\n editor.getTransforms(PlaceholderPlugin).insert.media(updatedFiles);\n },\n });\n\n return (\n <>\n <ToolbarSplitButton\n onClick={() => {\n openFilePicker();\n }}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setOpen(true);\n }\n }}\n pressed={open}\n >\n <ToolbarSplitButtonPrimary>\n {currentConfig.icon}\n </ToolbarSplitButtonPrimary>\n\n <DropdownMenu\n open={open}\n onOpenChange={setOpen}\n modal={false}\n {...props}\n >\n <DropdownMenuTrigger asChild>\n <ToolbarSplitButtonSecondary />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n onClick={(e) => e.stopPropagation()}\n align=\"start\"\n alignOffset={-32}\n >\n <DropdownMenuGroup>\n <DropdownMenuItem onSelect={() => openFilePicker()}>\n {currentConfig.icon}\n Upload from computer\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={() => setDialogOpen(true)}>\n <LinkIcon />\n Insert via URL\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </ToolbarSplitButton>\n\n <AlertDialog\n open={dialogOpen}\n onOpenChange={(value) => {\n setDialogOpen(value);\n }}\n >\n <AlertDialogContent className=\"gap-6\">\n <MediaUrlDialogContent\n currentConfig={currentConfig}\n nodeType={nodeType}\n setOpen={setDialogOpen}\n />\n </AlertDialogContent>\n </AlertDialog>\n </>\n );\n}\n\nfunction MediaUrlDialogContent({\n currentConfig,\n nodeType,\n setOpen,\n}: {\n currentConfig: (typeof MEDIA_CONFIG)[string];\n nodeType: string;\n setOpen: (value: boolean) => void;\n}) {\n const editor = useEditorRef();\n const [url, setUrl] = React.useState('');\n\n const embedMedia = React.useCallback(() => {\n if (!isUrl(url)) return toast.error('Invalid URL');\n\n setOpen(false);\n editor.tf.insertNodes({\n children: [{ text: '' }],\n name: nodeType === KEYS.file ? url.split('/').pop() : undefined,\n type: nodeType,\n url,\n });\n }, [url, editor, nodeType, setOpen]);\n\n return (\n <>\n <AlertDialogHeader>\n <AlertDialogTitle>{currentConfig.title}</AlertDialogTitle>\n </AlertDialogHeader>\n\n <AlertDialogDescription className=\"group relative w-full\">\n <label\n className=\"-translate-y-1/2 absolute top-1/2 block cursor-text px-1 text-muted-foreground/70 text-sm transition-all group-focus-within:pointer-events-none group-focus-within:top-0 group-focus-within:cursor-default group-focus-within:font-medium group-focus-within:text-foreground group-focus-within:text-xs has-[+input:not(:placeholder-shown)]:pointer-events-none has-[+input:not(:placeholder-shown)]:top-0 has-[+input:not(:placeholder-shown)]:cursor-default has-[+input:not(:placeholder-shown)]:font-medium has-[+input:not(:placeholder-shown)]:text-foreground has-[+input:not(:placeholder-shown)]:text-xs\"\n htmlFor=\"url\"\n >\n <span className=\"inline-flex bg-background px-2\">URL</span>\n </label>\n <Input\n id=\"url\"\n className=\"w-full\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') embedMedia();\n }}\n placeholder=\"\"\n type=\"url\"\n autoFocus\n />\n </AlertDialogDescription>\n\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={(e) => {\n e.preventDefault();\n embedMedia();\n }}\n >\n Accept\n </AlertDialogAction>\n </AlertDialogFooter>\n </>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport {\n // KeyboardIcon,\n MoreHorizontalIcon,\n SubscriptIcon,\n SuperscriptIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorRef } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function MoreToolbarButton(props: DropdownMenuProps) {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Insert\">\n <MoreHorizontalIcon />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"ignore-click-outside/toolbar flex max-h-[500px] min-w-[180px] flex-col overflow-y-auto\"\n align=\"start\"\n >\n <DropdownMenuGroup>\n {/* <DropdownMenuItem\n onSelect={() => {\n editor.tf.toggleMark(KEYS.kbd);\n editor.tf.collapse({ edge: 'end' });\n editor.tf.focus();\n }}\n >\n <KeyboardIcon />\n Keyboard input\n </DropdownMenuItem> */}\n\n <DropdownMenuItem\n onSelect={() => {\n editor.tf.toggleMark(KEYS.sup, {\n remove: KEYS.sub,\n });\n editor.tf.focus();\n }}\n >\n <SuperscriptIcon />\n Superscript\n {/* (⌘+,) */}\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() => {\n editor.tf.toggleMark(KEYS.sub, {\n remove: KEYS.sup,\n });\n editor.tf.focus();\n }}\n >\n <SubscriptIcon />\n Subscript\n {/* (⌘+.) */}\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { TablePlugin, useTableMergeState } from '@platejs/table/react';\nimport {\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n Combine,\n Grid3x3Icon,\n Table,\n Trash2Icon,\n Ungroup,\n XIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorPlugin, useEditorSelector } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { cn } from '@/lib/utils';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function TableToolbarButton(props: DropdownMenuProps) {\n const tableSelected = useEditorSelector(\n (editor) => editor.api.some({ match: { type: KEYS.table } }),\n []\n );\n\n const { editor, tf } = useEditorPlugin(TablePlugin);\n const [open, setOpen] = React.useState(false);\n const mergeState = useTableMergeState();\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Table\" isDropdown>\n <Table />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"flex w-[180px] min-w-0 flex-col\"\n align=\"start\"\n >\n <DropdownMenuGroup>\n <DropdownMenuSub>\n <DropdownMenuSubTrigger className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\">\n <Grid3x3Icon className=\"size-4\" />\n <span>Table</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"m-0 p-0\">\n <TablePicker />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuSub>\n <DropdownMenuSubTrigger\n className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!tableSelected}\n >\n <div className=\"size-4\" />\n <span>Cell</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!mergeState.canMerge}\n onSelect={() => {\n tf.table.merge();\n editor.tf.focus();\n }}\n >\n <Combine />\n Merge cells\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!mergeState.canSplit}\n onSelect={() => {\n tf.table.split();\n editor.tf.focus();\n }}\n >\n <Ungroup />\n Split cell\n </DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuSub>\n <DropdownMenuSubTrigger\n className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!tableSelected}\n >\n <div className=\"size-4\" />\n <span>Row</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableRow({ before: true });\n editor.tf.focus();\n }}\n >\n <ArrowUp />\n Insert row before\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableRow();\n editor.tf.focus();\n }}\n >\n <ArrowDown />\n Insert row after\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.remove.tableRow();\n editor.tf.focus();\n }}\n >\n <XIcon />\n Delete row\n </DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuSub>\n <DropdownMenuSubTrigger\n className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!tableSelected}\n >\n <div className=\"size-4\" />\n <span>Column</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableColumn({ before: true });\n editor.tf.focus();\n }}\n >\n <ArrowLeft />\n Insert column before\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableColumn();\n editor.tf.focus();\n }}\n >\n <ArrowRight />\n Insert column after\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.remove.tableColumn();\n editor.tf.focus();\n }}\n >\n <XIcon />\n Delete column\n </DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.remove.table();\n editor.tf.focus();\n }}\n >\n <Trash2Icon />\n Delete table\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction TablePicker() {\n const { editor, tf } = useEditorPlugin(TablePlugin);\n\n const [tablePicker, setTablePicker] = React.useState({\n grid: Array.from({ length: 8 }, () => Array.from({ length: 8 }).fill(0)),\n size: { colCount: 0, rowCount: 0 },\n });\n\n const onCellMove = (rowIndex: number, colIndex: number) => {\n const newGrid = [...tablePicker.grid];\n\n for (let i = 0; i < newGrid.length; i++) {\n for (let j = 0; j < newGrid[i].length; j++) {\n newGrid[i][j] =\n i >= 0 && i <= rowIndex && j >= 0 && j <= colIndex ? 1 : 0;\n }\n }\n\n setTablePicker({\n grid: newGrid,\n size: { colCount: colIndex + 1, rowCount: rowIndex + 1 },\n });\n };\n\n return (\n <div\n className=\"flex! m-0 flex-col p-0\"\n onClick={() => {\n tf.insert.table(tablePicker.size, { select: true });\n editor.tf.focus();\n }}\n role=\"button\"\n >\n <div className=\"grid size-[130px] grid-cols-8 gap-0.5 p-1\">\n {tablePicker.grid.map((rows, rowIndex) =>\n rows.map((value, columIndex) => (\n <div\n key={`(${rowIndex},${columIndex})`}\n className={cn(\n 'col-span-1 size-3 border border-solid bg-secondary',\n !!value && 'border-current'\n )}\n onMouseMove={() => {\n onCellMove(rowIndex, columIndex);\n }}\n />\n ))\n )}\n </div>\n\n <div className=\"text-center text-current text-xs\">\n {tablePicker.size.rowCount} x {tablePicker.size.colCount}\n </div>\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\nimport type { TElement } from 'platejs';\n\nimport { DropdownMenuItemIndicator } from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n // ChevronRightIcon,\n // Columns3Icon,\n // FileCodeIcon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n Heading4Icon,\n Heading5Icon,\n Heading6Icon,\n ListIcon,\n ListOrderedIcon,\n PilcrowIcon,\n // QuoteIcon,\n // SquareIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorRef, useSelectionFragmentProp } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n getBlockType,\n setBlockType,\n} from '@/components/editor/transforms';\n\nimport { ToolbarButton, ToolbarMenuGroup } from './toolbar';\n\nexport const turnIntoItems = [\n {\n icon: <PilcrowIcon />,\n keywords: ['paragraph'],\n label: 'Text',\n value: KEYS.p,\n },\n {\n icon: <Heading1Icon />,\n keywords: ['title', 'h1'],\n label: 'Heading 1',\n value: 'h1',\n },\n {\n icon: <Heading2Icon />,\n keywords: ['subtitle', 'h2'],\n label: 'Heading 2',\n value: 'h2',\n },\n {\n icon: <Heading3Icon />,\n keywords: ['subtitle', 'h3'],\n label: 'Heading 3',\n value: 'h3',\n },\n {\n icon: <Heading4Icon />,\n keywords: ['subtitle', 'h4'],\n label: 'Heading 4',\n value: 'h4',\n },\n {\n icon: <Heading5Icon />,\n keywords: ['subtitle', 'h5'],\n label: 'Heading 5',\n value: 'h5',\n },\n {\n icon: <Heading6Icon />,\n keywords: ['subtitle', 'h6'],\n label: 'Heading 6',\n value: 'h6',\n },\n {\n icon: <ListIcon />,\n keywords: ['unordered', 'ul', '-'],\n label: 'Bulleted list',\n value: KEYS.ul,\n },\n {\n icon: <ListOrderedIcon />,\n keywords: ['ordered', 'ol', '1'],\n label: 'Numbered list',\n value: KEYS.ol,\n },\n // {\n // icon: <SquareIcon />,\n // keywords: ['checklist', 'task', 'checkbox', '[]'],\n // label: 'To-do list',\n // value: KEYS.listTodo,\n // },\n // {\n // icon: <ChevronRightIcon />,\n // keywords: ['collapsible', 'expandable'],\n // label: 'Toggle list',\n // value: KEYS.toggle,\n // },\n // {\n // icon: <FileCodeIcon />,\n // keywords: ['```'],\n // label: 'Code',\n // value: KEYS.codeBlock,\n // },\n // {\n // icon: <QuoteIcon />,\n // keywords: ['citation', 'blockquote', '>'],\n // label: 'Quote',\n // value: KEYS.blockquote,\n // },\n // {\n // icon: <Columns3Icon />,\n // label: '3 columns',\n // value: 'action_three_columns',\n // },\n];\n\nexport function TurnIntoToolbarButton(props: DropdownMenuProps) {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n const value = useSelectionFragmentProp({\n defaultValue: KEYS.p,\n getProp: (node) => getBlockType(node as TElement),\n });\n const selectedItem = React.useMemo(\n () =>\n turnIntoItems.find((item) => item.value === (value ?? KEYS.p)) ??\n turnIntoItems[0],\n [value]\n );\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton\n className=\"min-w-[125px]\"\n pressed={open}\n tooltip=\"Turn into\"\n isDropdown\n >\n {selectedItem.label}\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"ignore-click-outside/toolbar min-w-0\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n editor.tf.focus();\n }}\n align=\"start\"\n >\n <ToolbarMenuGroup\n value={value}\n onValueChange={(type) => {\n setBlockType(editor, type);\n }}\n label=\"Turn into\"\n >\n {turnIntoItems.map(({ icon, label, value: itemValue }) => (\n <DropdownMenuRadioItem\n key={itemValue}\n className=\"min-w-[180px] pl-2 *:first:[span]:hidden\"\n value={itemValue}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuItemIndicator>\n <CheckIcon />\n </DropdownMenuItemIndicator>\n </span>\n {icon}\n {label}\n </DropdownMenuRadioItem>\n ))}\n </ToolbarMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n // ArrowUpToLineIcon,\n BaselineIcon,\n BoldIcon,\n // Code2Icon,\n // HighlighterIcon,\n ItalicIcon,\n PaintBucketIcon,\n StrikethroughIcon,\n UnderlineIcon,\n // WandSparklesIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorReadOnly } from 'platejs/react';\n\n// import { AIToolbarButton } from './ai-toolbar-button';\nimport { AlignToolbarButton } from './align-toolbar-button';\n// import { CommentToolbarButton } from './comment-toolbar-button';\n// import { EmojiToolbarButton } from './emoji-toolbar-button';\n// import { ExportToolbarButton } from './export-toolbar-button';\nimport { FontColorToolbarButton } from './font-color-toolbar-button';\n// import { FontSizeToolbarButton } from './font-size-toolbar-button';\nimport { RedoToolbarButton, UndoToolbarButton } from './history-toolbar-button';\n// import { ImportToolbarButton } from './import-toolbar-button';\nimport {\n IndentToolbarButton,\n OutdentToolbarButton,\n} from './indent-toolbar-button';\nimport { InsertToolbarButton } from './insert-toolbar-button';\n// import { LineHeightToolbarButton } from './line-height-toolbar-button';\nimport { LinkToolbarButton } from './link-toolbar-button';\nimport {\n BulletedListToolbarButton,\n NumberedListToolbarButton,\n // TodoListToolbarButton,\n} from './list-toolbar-button';\nimport { MarkToolbarButton } from './mark-toolbar-button';\nimport { MediaToolbarButton } from './media-toolbar-button';\n// import { ModeToolbarButton } from './mode-toolbar-button';\nimport { MoreToolbarButton } from './more-toolbar-button';\nimport { TableToolbarButton } from './table-toolbar-button';\n// import { ToggleToolbarButton } from './toggle-toolbar-button';\nimport { ToolbarGroup } from './toolbar';\nimport { TurnIntoToolbarButton } from './turn-into-toolbar-button';\n\nexport function FixedToolbarButtons() {\n const readOnly = useEditorReadOnly();\n\n return (\n <div className=\"flex w-full\">\n {!readOnly && (\n <>\n <ToolbarGroup>\n <UndoToolbarButton />\n <RedoToolbarButton />\n </ToolbarGroup>\n\n {/* <ToolbarGroup>\n <AIToolbarButton tooltip=\"AI commands\">\n <WandSparklesIcon />\n </AIToolbarButton>\n </ToolbarGroup> */}\n\n {/* <ToolbarGroup>\n <ExportToolbarButton>\n <ArrowUpToLineIcon />\n </ExportToolbarButton>\n\n <ImportToolbarButton />\n </ToolbarGroup> */}\n\n <ToolbarGroup>\n <InsertToolbarButton />\n </ToolbarGroup>\n\n <ToolbarGroup>\n {/* <InsertToolbarButton /> */}\n <TurnIntoToolbarButton />\n {/* <FontSizeToolbarButton /> */}\n </ToolbarGroup>\n\n <ToolbarGroup>\n <MarkToolbarButton nodeType={KEYS.bold} tooltip=\"Bold (⌘+B)\">\n <BoldIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton nodeType={KEYS.italic} tooltip=\"Italic (⌘+I)\">\n <ItalicIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.underline}\n tooltip=\"Underline (⌘+U)\"\n >\n <UnderlineIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.strikethrough}\n tooltip=\"Strikethrough (⌘+⇧+M)\"\n >\n <StrikethroughIcon />\n </MarkToolbarButton>\n\n <LinkToolbarButton />\n\n {/* <MarkToolbarButton nodeType={KEYS.code} tooltip=\"Code (⌘+E)\">\n <Code2Icon />\n </MarkToolbarButton> */}\n\n {/* <FontColorToolbarButton nodeType={KEYS.color} tooltip=\"Text color\">\n <BaselineIcon />\n </FontColorToolbarButton>\n\n <FontColorToolbarButton\n nodeType={KEYS.backgroundColor}\n tooltip=\"Background color\"\n >\n <PaintBucketIcon />\n </FontColorToolbarButton> */}\n </ToolbarGroup>\n\n <ToolbarGroup>\n <FontColorToolbarButton nodeType={KEYS.color} tooltip=\"Text color\">\n <BaselineIcon />\n </FontColorToolbarButton>\n\n <FontColorToolbarButton\n nodeType={KEYS.backgroundColor}\n tooltip=\"Background color\"\n >\n <PaintBucketIcon />\n </FontColorToolbarButton>\n </ToolbarGroup>\n\n <ToolbarGroup>\n <AlignToolbarButton />\n\n <NumberedListToolbarButton />\n <BulletedListToolbarButton />\n {/* <TodoListToolbarButton /> */}\n {/* <ToggleToolbarButton /> */}\n <OutdentToolbarButton />\n <IndentToolbarButton />\n </ToolbarGroup>\n\n <ToolbarGroup>\n {/* <LinkToolbarButton /> */}\n <TableToolbarButton />\n {/* <EmojiToolbarButton /> */}\n <MediaToolbarButton nodeType={KEYS.img} />\n </ToolbarGroup>\n\n {/* <ToolbarGroup>\n <MediaToolbarButton nodeType={KEYS.img} />\n <MediaToolbarButton nodeType={KEYS.video} />\n <MediaToolbarButton nodeType={KEYS.audio} />\n <MediaToolbarButton nodeType={KEYS.file} />\n </ToolbarGroup> */}\n\n {/* <ToolbarGroup>\n <LineHeightToolbarButton />\n <OutdentToolbarButton />\n <IndentToolbarButton />\n </ToolbarGroup> */}\n\n <ToolbarGroup>\n <MoreToolbarButton />\n </ToolbarGroup>\n </>\n )}\n\n {/* <div className=\"grow\" />\n\n <ToolbarGroup>\n <MarkToolbarButton nodeType={KEYS.highlight} tooltip=\"Highlight\">\n <HighlighterIcon />\n </MarkToolbarButton>\n <CommentToolbarButton />\n </ToolbarGroup>\n\n <ToolbarGroup>\n <ModeToolbarButton />\n </ToolbarGroup> */}\n </div>\n );\n}\n","'use client';\n\nimport { createPlatePlugin } from 'platejs/react';\n\nimport { FixedToolbar } from '@/components/ui/fixed-toolbar';\nimport { FixedToolbarButtons } from '@/components/ui/fixed-toolbar-buttons';\n\nexport const FixedToolbarKit = [\n createPlatePlugin({\n key: 'fixed-toolbar',\n render: {\n beforeEditable: () => (\n <FixedToolbar>\n <FixedToolbarButtons />\n </FixedToolbar>\n ),\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n type FloatingToolbarState,\n flip,\n offset,\n useFloatingToolbar,\n useFloatingToolbarState,\n} from '@platejs/floating';\nimport { useComposedRef } from '@udecode/cn';\nimport { KEYS } from 'platejs';\nimport {\n useEditorId,\n useEventEditorValue,\n usePluginOption,\n} from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Toolbar } from './toolbar';\n\nexport function FloatingToolbar({\n children,\n className,\n state,\n ...props\n}: React.ComponentProps<typeof Toolbar> & {\n state?: FloatingToolbarState;\n}) {\n const editorId = useEditorId();\n const focusedEditorId = useEventEditorValue('focus');\n const isFloatingLinkOpen = !!usePluginOption({ key: KEYS.link }, 'mode');\n const isAIChatOpen = usePluginOption({ key: KEYS.aiChat }, 'open');\n\n const floatingToolbarState = useFloatingToolbarState({\n editorId,\n focusedEditorId,\n hideToolbar: isFloatingLinkOpen || isAIChatOpen,\n ...state,\n floatingOptions: {\n middleware: [\n offset(12),\n flip({\n fallbackPlacements: [\n 'top-start',\n 'top-end',\n 'bottom-start',\n 'bottom-end',\n ],\n padding: 12,\n }),\n ],\n placement: 'top',\n ...state?.floatingOptions,\n },\n });\n\n const {\n clickOutsideRef,\n hidden,\n props: rootProps,\n ref: floatingRef,\n } = useFloatingToolbar(floatingToolbarState);\n\n const ref = useComposedRef<HTMLDivElement>(props.ref, floatingRef);\n\n if (hidden) return null;\n\n return (\n <div ref={clickOutsideRef}>\n <Toolbar\n {...props}\n {...rootProps}\n ref={ref}\n className={cn(\n 'scrollbar-hide absolute z-50 overflow-x-auto whitespace-nowrap rounded-md border bg-popover p-1 opacity-100 shadow-md print:hidden',\n 'max-w-[80vw]',\n className\n )}\n >\n {children}\n </Toolbar>\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n BoldIcon,\n // Code2Icon,\n ItalicIcon,\n StrikethroughIcon,\n UnderlineIcon,\n // WandSparklesIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorReadOnly } from 'platejs/react';\n\n// import { AIToolbarButton } from './ai-toolbar-button';\n// import { CommentToolbarButton } from './comment-toolbar-button';\n// import { InlineEquationToolbarButton } from './equation-toolbar-button';\nimport { LinkToolbarButton } from './link-toolbar-button';\nimport { MarkToolbarButton } from './mark-toolbar-button';\nimport { MoreToolbarButton } from './more-toolbar-button';\n// import { SuggestionToolbarButton } from './suggestion-toolbar-button';\nimport { ToolbarGroup } from './toolbar';\nimport { TurnIntoToolbarButton } from './turn-into-toolbar-button';\n\nexport function FloatingToolbarButtons() {\n const readOnly = useEditorReadOnly();\n\n return (\n <>\n {!readOnly && (\n <>\n {/* <ToolbarGroup>\n <AIToolbarButton tooltip=\"AI commands\">\n <WandSparklesIcon />\n Ask AI\n </AIToolbarButton>\n </ToolbarGroup> */}\n\n <ToolbarGroup>\n <TurnIntoToolbarButton />\n\n <MarkToolbarButton nodeType={KEYS.bold} tooltip=\"Bold (⌘+B)\">\n <BoldIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton nodeType={KEYS.italic} tooltip=\"Italic (⌘+I)\">\n <ItalicIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.underline}\n tooltip=\"Underline (⌘+U)\"\n >\n <UnderlineIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.strikethrough}\n tooltip=\"Strikethrough (⌘+⇧+M)\"\n >\n <StrikethroughIcon />\n </MarkToolbarButton>\n\n {/* <MarkToolbarButton nodeType={KEYS.code} tooltip=\"Code (⌘+E)\">\n <Code2Icon />\n </MarkToolbarButton> */}\n\n {/* <InlineEquationToolbarButton /> */}\n\n <LinkToolbarButton />\n </ToolbarGroup>\n </>\n )}\n\n <ToolbarGroup>\n {/* <CommentToolbarButton /> */}\n {/* <SuggestionToolbarButton /> */}\n\n {!readOnly && <MoreToolbarButton />}\n </ToolbarGroup>\n </>\n );\n}\n","'use client';\n\nimport { createPlatePlugin } from 'platejs/react';\n\nimport { FloatingToolbar } from '@/components/ui/floating-toolbar';\nimport { FloatingToolbarButtons } from '@/components/ui/floating-toolbar-buttons';\n\nexport const FloatingToolbarKit = [\n createPlatePlugin({\n key: 'floating-toolbar',\n render: {\n afterEditable: () => (\n <FloatingToolbar>\n <FloatingToolbarButtons />\n </FloatingToolbar>\n ),\n },\n }),\n];\n","'use client';\n\nimport type { PlatePluginConfig } from 'platejs/react';\n\nimport {\n FontBackgroundColorPlugin,\n FontColorPlugin,\n FontFamilyPlugin,\n FontSizePlugin,\n} from '@platejs/basic-styles/react';\nimport { KEYS } from 'platejs';\n\nconst options = {\n inject: { targetPlugins: [KEYS.p] },\n} satisfies PlatePluginConfig;\n\nexport const FontKit = [\n FontColorPlugin.configure({\n inject: {\n ...options.inject,\n nodeProps: {\n defaultNodeValue: 'black',\n },\n },\n }),\n FontBackgroundColorPlugin.configure(options),\n FontSizePlugin.configure(options),\n FontFamilyPlugin.configure(options),\n];\n","'use client';\n\nimport { LineHeightPlugin } from '@platejs/basic-styles/react';\nimport { KEYS } from 'platejs';\n\nexport const LineHeightKit = [\n LineHeightPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 1.5,\n validNodeValues: [1, 1.2, 1.5, 2, 3],\n },\n targetPlugins: [...KEYS.heading, KEYS.p],\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TLinkElement } from 'platejs';\n\nimport {\n type UseVirtualFloatingOptions,\n flip,\n offset,\n} from '@platejs/floating';\nimport { getLinkAttributes } from '@platejs/link';\nimport {\n type LinkFloatingToolbarState,\n FloatingLinkUrlInput,\n useFloatingLinkEdit,\n useFloatingLinkEditState,\n useFloatingLinkInsert,\n useFloatingLinkInsertState,\n} from '@platejs/link/react';\nimport { cva } from 'class-variance-authority';\nimport { ExternalLink, Link, Text, Unlink } from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport {\n useEditorRef,\n useEditorSelection,\n useFormInputProps,\n usePluginOption,\n} from 'platejs/react';\n\nimport { buttonVariants } from '@/components/ui/button';\nimport { Separator } from '@/components/ui/separator';\n\nconst popoverVariants = cva(\n 'z-50 w-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-hidden'\n);\n\nconst inputVariants = cva(\n 'flex h-[28px] w-full rounded-md border-none bg-transparent px-1.5 py-1 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-transparent md:text-sm'\n);\n\nexport function LinkFloatingToolbar({\n state,\n}: {\n state?: LinkFloatingToolbarState;\n}) {\n const activeCommentId = usePluginOption({ key: KEYS.comment }, 'activeId');\n const activeSuggestionId = usePluginOption(\n { key: KEYS.suggestion },\n 'activeId'\n );\n\n const floatingOptions: UseVirtualFloatingOptions = React.useMemo(\n () => ({\n middleware: [\n offset(8),\n flip({\n fallbackPlacements: ['bottom-end', 'top-start', 'top-end'],\n padding: 12,\n }),\n ],\n placement:\n activeSuggestionId || activeCommentId ? 'top-start' : 'bottom-start',\n }),\n [activeCommentId, activeSuggestionId]\n );\n\n const insertState = useFloatingLinkInsertState({\n ...state,\n floatingOptions: {\n ...floatingOptions,\n ...state?.floatingOptions,\n },\n });\n const {\n hidden,\n props: insertProps,\n ref: insertRef,\n textInputProps,\n } = useFloatingLinkInsert(insertState);\n\n const editState = useFloatingLinkEditState({\n ...state,\n floatingOptions: {\n ...floatingOptions,\n ...state?.floatingOptions,\n },\n });\n const {\n editButtonProps,\n props: editProps,\n ref: editRef,\n unlinkButtonProps,\n } = useFloatingLinkEdit(editState);\n const inputProps = useFormInputProps({\n preventDefaultOnEnterKeydown: true,\n });\n\n if (hidden) return null;\n\n const input = (\n <div className=\"flex w-[330px] flex-col\" {...inputProps}>\n <div className=\"flex items-center\">\n <div className=\"flex items-center pr-1 pl-2 text-muted-foreground\">\n <Link className=\"size-4\" />\n </div>\n\n <FloatingLinkUrlInput\n className={inputVariants()}\n placeholder=\"Paste link\"\n data-plate-focus\n />\n </div>\n <Separator className=\"my-1\" />\n <div className=\"flex items-center\">\n <div className=\"flex items-center pr-1 pl-2 text-muted-foreground\">\n <Text className=\"size-4\" />\n </div>\n <input\n className={inputVariants()}\n placeholder=\"Text to display\"\n data-plate-focus\n {...textInputProps}\n />\n </div>\n </div>\n );\n\n const editContent = editState.isEditing ? (\n input\n ) : (\n <div className=\"box-content flex items-center\">\n <button\n className={buttonVariants({ size: 'sm', variant: 'ghost' })}\n type=\"button\"\n {...editButtonProps}\n >\n Edit link\n </button>\n\n <Separator orientation=\"vertical\" />\n\n <LinkOpenButton />\n\n <Separator orientation=\"vertical\" />\n\n <button\n className={buttonVariants({\n size: 'sm',\n variant: 'ghost',\n })}\n type=\"button\"\n {...unlinkButtonProps}\n >\n <Unlink width={18} />\n </button>\n </div>\n );\n\n return (\n <>\n <div ref={insertRef} className={popoverVariants()} {...insertProps}>\n {input}\n </div>\n\n <div ref={editRef} className={popoverVariants()} {...editProps}>\n {editContent}\n </div>\n </>\n );\n}\n\nfunction LinkOpenButton() {\n const editor = useEditorRef();\n const selection = useEditorSelection();\n\n const attributes = React.useMemo(\n () => {\n const entry = editor.api.node<TLinkElement>({\n match: { type: editor.getType(KEYS.link) },\n });\n if (!entry) {\n return {};\n }\n const [element] = entry;\n return getLinkAttributes(editor, element);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, selection]\n );\n\n return (\n <a\n {...attributes}\n className={buttonVariants({\n size: 'sm',\n variant: 'ghost',\n })}\n onMouseOver={(e) => {\n e.stopPropagation();\n }}\n aria-label=\"Open link in a new tab\"\n target=\"_blank\"\n >\n <ExternalLink width={18} />\n </a>\n );\n}\n","'use client';\n\nimport { LinkPlugin } from '@platejs/link/react';\n\nimport { LinkElement } from '@/components/ui/link-node';\nimport { LinkFloatingToolbar } from '@/components/ui/link-toolbar';\n\nexport const LinkKit = [\n LinkPlugin.configure({\n render: {\n node: LinkElement,\n afterEditable: () => <LinkFloatingToolbar />,\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TInlineSuggestionData, TLinkElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { getLinkAttributes } from '@platejs/link';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport { PlateElement } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function LinkElement(props: PlateElementProps<TLinkElement>) {\n const suggestionData = props.editor\n .getApi(SuggestionPlugin)\n .suggestion.suggestionData(props.element) as\n | TInlineSuggestionData\n | undefined;\n\n return (\n <PlateElement\n {...props}\n as=\"a\"\n className={cn(\n 'font-medium text-primary underline decoration-primary underline-offset-4',\n suggestionData?.type === 'remove' && 'bg-red-100 text-red-700',\n suggestionData?.type === 'insert' && 'bg-emerald-100 text-emerald-700'\n )}\n attributes={{\n ...props.attributes,\n ...getLinkAttributes(props.editor, props.element),\n onMouseOver: (e) => {\n e.stopPropagation();\n },\n }}\n >\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { IndentPlugin } from '@platejs/indent/react';\nimport { KEYS } from 'platejs';\n\nexport const IndentKit = [\n IndentPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n KEYS.img,\n ],\n },\n options: {\n offset: 24,\n },\n }),\n];\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n","'use client';\n\nimport React from 'react';\n\nimport type { TListElement } from 'platejs';\n\nimport { isOrderedList } from '@platejs/list';\nimport {\n useTodoListElement,\n useTodoListElementState,\n} from '@platejs/list/react';\nimport {\n type PlateElementProps,\n type RenderNodeWrapper,\n useReadOnly,\n} from 'platejs/react';\n\nimport { Checkbox } from '@/components/ui/checkbox';\nimport { cn } from '@/lib/utils';\n\nconst config: Record<\n string,\n {\n Li: React.FC<PlateElementProps>;\n Marker: React.FC<PlateElementProps>;\n }\n> = {\n todo: {\n Li: TodoLi,\n Marker: TodoMarker,\n },\n};\n\nexport const BlockList: RenderNodeWrapper = (props) => {\n if (!props.element.listStyleType) return;\n\n return (props) => <List {...props} />;\n};\n\nfunction List(props: PlateElementProps) {\n const { listStart, listStyleType } = props.element as TListElement;\n const { Li, Marker } = config[listStyleType] ?? {};\n const List = isOrderedList(props.element) ? 'ol' : 'ul';\n\n return (\n <List\n className=\"relative m-0 p-0\"\n style={{ listStyleType }}\n start={listStart}\n >\n {Marker && <Marker {...props} />}\n {Li ? <Li {...props} /> : <li>{props.children}</li>}\n </List>\n );\n}\n\nfunction TodoMarker(props: PlateElementProps) {\n const state = useTodoListElementState({ element: props.element });\n const { checkboxProps } = useTodoListElement(state);\n const readOnly = useReadOnly();\n\n return (\n <div contentEditable={false}>\n <Checkbox\n className={cn(\n '-left-6 absolute top-1',\n readOnly && 'pointer-events-none'\n )}\n {...checkboxProps}\n />\n </div>\n );\n}\n\nfunction TodoLi(props: PlateElementProps) {\n return (\n <li\n className={cn(\n 'list-none',\n (props.element.checked as boolean) &&\n 'text-muted-foreground line-through'\n )}\n >\n {props.children}\n </li>\n );\n}\n","'use client';\n\nimport { ListPlugin } from '@platejs/list/react';\nimport { KEYS } from 'platejs';\n\nimport { IndentKit } from '@/components/editor/plugins/indent-kit';\nimport { BlockList } from '@/components/ui/block-list';\n\nexport const ListKit = [\n ...IndentKit,\n ListPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n KEYS.img,\n ],\n },\n render: {\n belowNodes: BlockList,\n },\n }),\n];\n","import { MarkdownPlugin, remarkMdx, remarkMention } from '@platejs/markdown';\nimport { KEYS } from 'platejs';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\n\nexport const MarkdownKit: any[] = [\n MarkdownPlugin.configure({\n options: {\n plainMarks: [KEYS.suggestion, KEYS.comment],\n remarkPlugins: [remarkMath, remarkGfm, remarkMdx, remarkMention],\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from 'react-textarea-autosize';\n\nimport type { TEquationElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useEquationElement, useEquationInput } from '@platejs/math/react';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { CornerDownLeftIcon, RadicalIcon } from 'lucide-react';\nimport {\n createPrimitiveComponent,\n PlateElement,\n useEditorRef,\n useEditorSelector,\n useElement,\n useReadOnly,\n useSelected,\n} from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport function EquationElement(props: PlateElementProps<TEquationElement>) {\n const selected = useSelected();\n const [open, setOpen] = React.useState(selected);\n const katexRef = React.useRef<HTMLDivElement | null>(null);\n\n useEquationElement({\n element: props.element,\n katexRef,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <PlateElement className=\"my-1\" {...props}>\n <Popover open={open} onOpenChange={setOpen} modal={false}>\n <PopoverTrigger asChild>\n <div\n className={cn(\n 'group flex cursor-pointer select-none items-center justify-center rounded-sm hover:bg-primary/10 data-[selected=true]:bg-primary/10',\n props.element.texExpression.length === 0\n ? 'bg-muted p-3 pr-9'\n : 'px-2 py-1'\n )}\n data-selected={selected}\n contentEditable={false}\n role=\"button\"\n >\n {props.element.texExpression.length > 0 ? (\n <span ref={katexRef} />\n ) : (\n <div className=\"flex h-7 w-full items-center gap-2 whitespace-nowrap text-muted-foreground text-sm\">\n <RadicalIcon className=\"size-6 text-muted-foreground/80\" />\n <div>Add a Tex equation</div>\n </div>\n )}\n </div>\n </PopoverTrigger>\n\n <EquationPopoverContent\n open={open}\n placeholder={\n 'f(x) = \\\\begin{cases}\\n x^2, &\\\\quad x > 0 \\\\\\\\\\n 0, &\\\\quad x = 0 \\\\\\\\\\n -x^2, &\\\\quad x < 0\\n\\\\end{cases}'\n }\n isInline={false}\n setOpen={setOpen}\n />\n </Popover>\n\n {props.children}\n </PlateElement>\n );\n}\n\nexport function InlineEquationElement(\n props: PlateElementProps<TEquationElement>\n) {\n const element = props.element;\n const katexRef = React.useRef<HTMLDivElement | null>(null);\n const selected = useSelected();\n const isCollapsed = useEditorSelector(\n (editor) => editor.api.isCollapsed(),\n []\n );\n const [open, setOpen] = React.useState(selected && isCollapsed);\n\n React.useEffect(() => {\n if (selected && isCollapsed) {\n setOpen(true);\n }\n }, [selected, isCollapsed]);\n\n useEquationElement({\n element,\n katexRef,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <PlateElement\n {...props}\n className={cn(\n 'mx-1 inline-block select-none rounded-sm [&_.katex-display]:my-0!'\n )}\n >\n <Popover open={open} onOpenChange={setOpen} modal={false}>\n <PopoverTrigger asChild>\n <div\n className={cn(\n 'after:-top-0.5 after:-left-1 after:absolute after:inset-0 after:z-1 after:h-[calc(100%)+4px] after:w-[calc(100%+8px)] after:rounded-sm after:content-[\"\"]',\n 'h-6',\n ((element.texExpression.length > 0 && open) || selected) &&\n 'after:bg-brand/15',\n element.texExpression.length === 0 &&\n 'text-muted-foreground after:bg-neutral-500/10'\n )}\n contentEditable={false}\n >\n <span\n ref={katexRef}\n className={cn(\n element.texExpression.length === 0 && 'hidden',\n 'font-mono leading-none'\n )}\n />\n {element.texExpression.length === 0 && (\n <span>\n <RadicalIcon className=\"mr-1 inline-block h-[19px] w-4 py-[1.5px] align-text-bottom\" />\n New equation\n </span>\n )}\n </div>\n </PopoverTrigger>\n\n <EquationPopoverContent\n className=\"my-auto\"\n open={open}\n placeholder=\"E = mc^2\"\n setOpen={setOpen}\n isInline\n />\n </Popover>\n\n {props.children}\n </PlateElement>\n );\n}\n\nconst EquationInput = createPrimitiveComponent(TextareaAutosize)({\n propsHook: useEquationInput,\n});\n\nconst EquationPopoverContent = ({\n className,\n isInline,\n open,\n setOpen,\n ...props\n}: {\n isInline: boolean;\n open: boolean;\n setOpen: (open: boolean) => void;\n} & TextareaAutosizeProps) => {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n const element = useElement<TEquationElement>();\n\n React.useEffect(() => {\n if (isInline && open) {\n setOpen(true);\n }\n }, [isInline, open, setOpen]);\n\n if (readOnly) return null;\n\n const onClose = () => {\n setOpen(false);\n\n if (isInline) {\n editor.tf.select(element, { focus: true, next: true });\n } else {\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.set(element.id as string);\n }\n };\n\n return (\n <PopoverContent\n className=\"flex gap-2\"\n onEscapeKeyDown={(e) => {\n e.preventDefault();\n }}\n contentEditable={false}\n >\n <EquationInput\n className={cn('max-h-[50vh] grow resize-none p-2 text-sm', className)}\n state={{ isInline, open, onClose }}\n autoFocus\n {...props}\n />\n\n <Button variant=\"secondary\" className=\"px-3\" onClick={onClose}>\n Done <CornerDownLeftIcon className=\"size-3.5\" />\n </Button>\n </PopoverContent>\n );\n};\n","'use client';\n\nimport { EquationPlugin, InlineEquationPlugin } from '@platejs/math/react';\n\nimport {\n EquationElement,\n InlineEquationElement,\n} from '@/components/ui/equation-node';\n\nexport const MathKit = [\n InlineEquationPlugin.withComponent(InlineEquationElement),\n EquationPlugin.withComponent(EquationElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport {\n Caption as CaptionPrimitive,\n CaptionTextarea as CaptionTextareaPrimitive,\n useCaptionButton,\n useCaptionButtonState,\n} from '@platejs/caption/react';\nimport { createPrimitiveComponent } from '@udecode/cn';\nimport { cva } from 'class-variance-authority';\n\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\nconst captionVariants = cva('max-w-full', {\n defaultVariants: {\n align: 'center',\n },\n variants: {\n align: {\n center: 'mx-auto',\n left: 'mr-auto',\n right: 'ml-auto',\n },\n },\n});\n\nexport function Caption({\n align,\n className,\n ...props\n}: React.ComponentProps<typeof CaptionPrimitive> &\n VariantProps<typeof captionVariants>) {\n return (\n <CaptionPrimitive\n {...props}\n className={cn(captionVariants({ align }), className)}\n />\n );\n}\n\nexport function CaptionTextarea(\n props: React.ComponentProps<typeof CaptionTextareaPrimitive>\n) {\n return (\n <CaptionTextareaPrimitive\n {...props}\n className={cn(\n 'mt-2 w-full resize-none border-none bg-inherit p-0 font-[inherit] text-inherit',\n 'focus:outline-none focus:[&::placeholder]:opacity-0',\n 'text-center print:placeholder:text-transparent',\n props.className\n )}\n />\n );\n}\n\nexport const CaptionButton: any = createPrimitiveComponent(Button)({\n propsHook: useCaptionButton,\n stateHook: useCaptionButtonState,\n});\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TAudioElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useMediaState } from '@platejs/media/react';\nimport { ResizableProvider } from '@platejs/resizable';\nimport { PlateElement, withHOC } from 'platejs/react';\n\nimport { Caption, CaptionTextarea } from './caption';\n\nexport const AudioElement = withHOC(\n ResizableProvider,\n function AudioElement(props: PlateElementProps<TAudioElement>) {\n const { align = 'center', readOnly, unsafeUrl } = useMediaState();\n\n return (\n <PlateElement {...props} className=\"mb-1\">\n <figure\n className=\"group relative cursor-default\"\n contentEditable={false}\n >\n <div className=\"h-16\">\n <audio className=\"size-full\" src={unsafeUrl} controls />\n </div>\n\n <Caption style={{ width: '100%' }} align={align}>\n <CaptionTextarea\n className=\"h-20\"\n readOnly={readOnly}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </figure>\n {props.children}\n </PlateElement>\n );\n }\n);\n","'use client';\n\nimport * as React from 'react';\n\nimport type { WithRequiredKey } from 'platejs';\n\nimport {\n FloatingMedia as FloatingMediaPrimitive,\n FloatingMediaStore,\n useFloatingMediaValue,\n useImagePreviewValue,\n} from '@platejs/media/react';\nimport { cva } from 'class-variance-authority';\nimport { Link, Trash2Icon } from 'lucide-react';\nimport {\n useEditorRef,\n useEditorSelector,\n useElement,\n useFocusedLast,\n useReadOnly,\n useRemoveNodeButton,\n useSelected,\n} from 'platejs/react';\n\nimport { Button, buttonVariants } from '@/components/ui/button';\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n} from '@/components/ui/popover';\nimport { Separator } from '@/components/ui/separator';\n\nimport { CaptionButton } from './caption';\n\nconst inputVariants = cva(\n 'flex h-[28px] w-full rounded-md border-none bg-transparent px-1.5 py-1 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-transparent md:text-sm'\n);\n\nexport function MediaToolbar({\n children,\n plugin,\n}: {\n children: React.ReactNode;\n plugin: WithRequiredKey;\n}) {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n const selected = useSelected();\n const isFocusedLast = useFocusedLast();\n const selectionCollapsed = useEditorSelector(\n (editor) => !editor.api.isExpanded(),\n []\n );\n const isImagePreviewOpen = useImagePreviewValue('isOpen', editor.id);\n const open =\n isFocusedLast &&\n !readOnly &&\n selected &&\n selectionCollapsed &&\n !isImagePreviewOpen;\n const isEditing = useFloatingMediaValue('isEditing');\n\n React.useEffect(() => {\n if (!open && isEditing) {\n FloatingMediaStore.set('isEditing', false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const element = useElement();\n const { props: buttonProps } = useRemoveNodeButton({ element });\n\n return (\n <Popover open={open} modal={false}>\n <PopoverAnchor>{children}</PopoverAnchor>\n\n <PopoverContent\n className=\"w-auto p-1\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n {isEditing ? (\n <div className=\"flex w-[330px] flex-col\">\n <div className=\"flex items-center\">\n <div className=\"flex items-center pr-1 pl-2 text-muted-foreground\">\n <Link className=\"size-4\" />\n </div>\n\n <FloatingMediaPrimitive.UrlInput\n className={inputVariants()}\n placeholder=\"Paste the embed link...\"\n options={{ plugin }}\n />\n </div>\n </div>\n ) : (\n <div className=\"box-content flex items-center\">\n <FloatingMediaPrimitive.EditButton\n className={buttonVariants({ size: 'sm', variant: 'ghost' })}\n >\n Edit link\n </FloatingMediaPrimitive.EditButton>\n\n <CaptionButton size=\"sm\" variant=\"ghost\">\n Caption\n </CaptionButton>\n\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n\n <Button size=\"sm\" variant=\"ghost\" {...buttonProps}>\n <Trash2Icon />\n </Button>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport {\n type ResizeHandle as ResizeHandlePrimitive,\n Resizable as ResizablePrimitive,\n useResizeHandle,\n useResizeHandleState,\n} from '@platejs/resizable';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nexport const mediaResizeHandleVariants = cva(\n cn(\n 'top-0 flex w-6 select-none flex-col justify-center',\n \"after:flex after:h-16 after:w-[3px] after:rounded-[6px] after:bg-ring after:opacity-0 after:content-['_'] group-hover:after:opacity-100\"\n ),\n {\n variants: {\n direction: {\n left: '-left-3 -ml-3 pl-3',\n right: '-right-3 -mr-3 items-end pr-3',\n },\n },\n }\n);\n\nconst resizeHandleVariants = cva('absolute z-40', {\n variants: {\n direction: {\n bottom: 'w-full cursor-row-resize',\n left: 'h-full cursor-col-resize',\n right: 'h-full cursor-col-resize',\n top: 'w-full cursor-row-resize',\n },\n },\n});\n\nexport function ResizeHandle({\n className,\n options,\n ...props\n}: React.ComponentProps<typeof ResizeHandlePrimitive> &\n VariantProps<typeof resizeHandleVariants>) {\n const state = useResizeHandleState(options ?? {});\n const resizeHandle = useResizeHandle(state);\n\n if (state.readOnly) return null;\n\n return (\n <div\n className={cn(\n resizeHandleVariants({ direction: options?.direction }),\n className\n )}\n data-resizing={state.isResizing}\n {...resizeHandle.props}\n {...props}\n />\n );\n}\n\nconst resizableVariants = cva('', {\n variants: {\n align: {\n center: 'mx-auto',\n left: 'mr-auto',\n right: 'ml-auto',\n },\n },\n});\n\nexport function Resizable({\n align,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive> &\n VariantProps<typeof resizableVariants>) {\n return (\n <ResizablePrimitive\n {...props}\n className={cn(resizableVariants({ align }), className)}\n />\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport LiteYouTubeEmbed from 'react-lite-youtube-embed';\nimport { Tweet } from 'react-tweet';\n\nimport type { TMediaEmbedElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { parseTwitterUrl, parseVideoUrl } from '@platejs/media';\nimport { MediaEmbedPlugin, useMediaState } from '@platejs/media/react';\nimport { ResizableProvider, useResizableValue } from '@platejs/resizable';\nimport { PlateElement, withHOC } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Caption, CaptionTextarea } from './caption';\nimport { MediaToolbar } from './media-toolbar';\nimport {\n mediaResizeHandleVariants,\n Resizable,\n ResizeHandle,\n} from './resize-handle';\n\nexport const MediaEmbedElement = withHOC(\n ResizableProvider,\n function MediaEmbedElement(props: PlateElementProps<TMediaEmbedElement>) {\n const {\n align = 'center',\n embed,\n focused,\n isTweet,\n isVideo,\n isYoutube,\n readOnly,\n selected,\n } = useMediaState({\n urlParsers: [parseTwitterUrl, parseVideoUrl],\n });\n const width = useResizableValue('width');\n const provider = embed?.provider;\n\n return (\n <MediaToolbar plugin={MediaEmbedPlugin}>\n <PlateElement className=\"py-2.5\" {...props}>\n <figure\n className=\"group relative m-0 w-full cursor-default\"\n contentEditable={false}\n >\n <Resizable\n align={align}\n options={{\n align,\n maxWidth: isTweet ? 550 : '100%',\n minWidth: isTweet ? 300 : 100,\n }}\n >\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'left' })}\n options={{ direction: 'left' }}\n />\n\n {isVideo ? (\n isYoutube ? (\n <LiteYouTubeEmbed\n id={embed!.id!}\n title=\"youtube\"\n wrapperClass={cn(\n 'rounded-sm',\n focused && selected && 'ring-2 ring-ring ring-offset-2',\n 'relative block cursor-pointer bg-black bg-center bg-cover [contain:content]',\n '[&.lyt-activated]:before:absolute [&.lyt-activated]:before:top-0 [&.lyt-activated]:before:h-[60px] [&.lyt-activated]:before:w-full [&.lyt-activated]:before:bg-top [&.lyt-activated]:before:bg-repeat-x [&.lyt-activated]:before:pb-[50px] [&.lyt-activated]:before:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&.lyt-activated]:before:bg-[url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==)]',\n 'after:block after:pb-[var(--aspect-ratio)] after:content-[\"\"]',\n '[&_>_iframe]:absolute [&_>_iframe]:top-0 [&_>_iframe]:left-0 [&_>_iframe]:size-full',\n '[&_>_.lty-playbtn]:z-1 [&_>_.lty-playbtn]:h-[46px] [&_>_.lty-playbtn]:w-[70px] [&_>_.lty-playbtn]:rounded-[14%] [&_>_.lty-playbtn]:bg-[#212121] [&_>_.lty-playbtn]:opacity-80 [&_>_.lty-playbtn]:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&:hover_>_.lty-playbtn]:bg-[red] [&:hover_>_.lty-playbtn]:opacity-100',\n '[&_>_.lty-playbtn]:before:border-[transparent_transparent_transparent_#fff] [&_>_.lty-playbtn]:before:border-y-[11px] [&_>_.lty-playbtn]:before:border-r-0 [&_>_.lty-playbtn]:before:border-l-[19px] [&_>_.lty-playbtn]:before:content-[\"\"]',\n '[&_>_.lty-playbtn]:absolute [&_>_.lty-playbtn]:top-1/2 [&_>_.lty-playbtn]:left-1/2 [&_>_.lty-playbtn]:[transform:translate3d(-50%,-50%,0)]',\n '[&_>_.lty-playbtn]:before:absolute [&_>_.lty-playbtn]:before:top-1/2 [&_>_.lty-playbtn]:before:left-1/2 [&_>_.lty-playbtn]:before:[transform:translate3d(-50%,-50%,0)]',\n '[&.lyt-activated]:cursor-[unset]',\n '[&.lyt-activated]:before:pointer-events-none [&.lyt-activated]:before:opacity-0',\n '[&.lyt-activated_>_.lty-playbtn]:pointer-events-none [&.lyt-activated_>_.lty-playbtn]:opacity-0!'\n )}\n />\n ) : (\n <div\n className={cn(\n provider === 'vimeo' && 'pb-[75%]',\n provider === 'youku' && 'pb-[56.25%]',\n provider === 'dailymotion' && 'pb-[56.0417%]',\n provider === 'coub' && 'pb-[51.25%]'\n )}\n >\n <iframe\n className={cn(\n 'absolute top-0 left-0 size-full rounded-sm',\n isVideo && 'border-0',\n focused && selected && 'ring-2 ring-ring ring-offset-2'\n )}\n title=\"embed\"\n src={embed!.url}\n allowFullScreen\n />\n </div>\n )\n ) : null}\n\n {isTweet && (\n <div\n className={cn(\n '[&_.react-tweet-theme]:my-0',\n !readOnly &&\n selected &&\n '[&_.react-tweet-theme]:ring-2 [&_.react-tweet-theme]:ring-ring [&_.react-tweet-theme]:ring-offset-2'\n )}\n >\n <Tweet id={embed!.id!} />\n </div>\n )}\n\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'right' })}\n options={{ direction: 'right' }}\n />\n </Resizable>\n\n <Caption style={{ width }} align={align}>\n <CaptionTextarea placeholder=\"Write a caption...\" />\n </Caption>\n </figure>\n\n {props.children}\n </PlateElement>\n </MediaToolbar>\n );\n }\n);\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TFileElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useMediaState } from '@platejs/media/react';\nimport { ResizableProvider } from '@platejs/resizable';\nimport { FileUp } from 'lucide-react';\nimport { PlateElement, useReadOnly, withHOC } from 'platejs/react';\n\nimport { Caption, CaptionTextarea } from './caption';\n\nexport const FileElement = withHOC(\n ResizableProvider,\n function FileElement(props: PlateElementProps<TFileElement>) {\n const readOnly = useReadOnly();\n const { name, unsafeUrl } = useMediaState();\n\n return (\n <PlateElement className=\"my-px rounded-sm\" {...props}>\n <a\n className=\"group relative m-0 flex cursor-pointer items-center rounded px-0.5 py-[3px] hover:bg-muted\"\n contentEditable={false}\n download={name}\n href={unsafeUrl}\n rel=\"noopener noreferrer\"\n role=\"button\"\n target=\"_blank\"\n >\n <div className=\"flex items-center gap-1 p-1\">\n <FileUp className=\"size-5\" />\n <div>{name}</div>\n </div>\n\n <Caption align=\"left\">\n <CaptionTextarea\n className=\"text-left\"\n readOnly={readOnly}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </a>\n {props.children}\n </PlateElement>\n );\n }\n);\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TImageElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useDraggable } from '@platejs/dnd';\nimport { Image, ImagePlugin, useMediaState } from '@platejs/media/react';\nimport { ResizableProvider, useResizableValue } from '@platejs/resizable';\nimport { PlateElement, withHOC } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Caption, CaptionTextarea } from './caption';\nimport { MediaToolbar } from './media-toolbar';\nimport {\n mediaResizeHandleVariants,\n Resizable,\n ResizeHandle,\n} from './resize-handle';\n\nexport const ImageElement = withHOC(\n ResizableProvider,\n function ImageElement(props: PlateElementProps<TImageElement>) {\n const { align = 'center', focused, readOnly, selected } = useMediaState();\n const width = useResizableValue('width');\n\n const { isDragging, handleRef } = useDraggable({\n element: props.element,\n });\n\n return (\n <MediaToolbar plugin={ImagePlugin}>\n <PlateElement {...props} className=\"py-2.5\">\n <figure className=\"group relative m-0\" contentEditable={false}>\n <Resizable\n align={align}\n options={{\n align,\n readOnly,\n }}\n >\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'left' })}\n options={{ direction: 'left' }}\n />\n <Image\n ref={handleRef}\n className={cn(\n 'block w-full max-w-full cursor-pointer object-cover px-0',\n 'rounded-sm',\n focused && selected && 'ring-2 ring-ring ring-offset-2',\n isDragging && 'opacity-50'\n )}\n alt={props.attributes.alt as string | undefined}\n />\n <ResizeHandle\n className={mediaResizeHandleVariants({\n direction: 'right',\n })}\n options={{ direction: 'right' }}\n />\n </Resizable>\n\n <Caption style={{ width }} align={align}>\n <CaptionTextarea\n readOnly={readOnly}\n onFocus={(e) => {\n e.preventDefault();\n }}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </figure>\n\n {props.children}\n </PlateElement>\n </MediaToolbar>\n );\n }\n);\n","import * as React from 'react';\n\nimport type { OurFileRouter } from '@/lib/uploadthing';\nimport type {\n ClientUploadedFileData,\n UploadFilesOptions,\n} from 'uploadthing/types';\n\nimport { generateReactHelpers } from '@uploadthing/react';\nimport { toast } from 'sonner';\nimport { z } from 'zod';\n\nexport type UploadedFile<T = unknown> = ClientUploadedFileData<T>;\n\ninterface UseUploadFileProps\n extends Pick<\n UploadFilesOptions<OurFileRouter['editorUploader']>,\n 'headers' | 'onUploadBegin' | 'onUploadProgress' | 'skipPolling'\n > {\n onUploadComplete?: (file: UploadedFile) => void;\n onUploadError?: (error: unknown) => void;\n}\n\nexport function useUploadFile({\n onUploadComplete,\n onUploadError,\n ...props\n}: UseUploadFileProps = {}) {\n const [uploadedFile, setUploadedFile] = React.useState<UploadedFile>();\n const [uploadingFile, setUploadingFile] = React.useState<File>();\n const [progress, setProgress] = React.useState<number>(0);\n const [isUploading, setIsUploading] = React.useState(false);\n\n async function uploadThing(file: File) {\n setIsUploading(true);\n setUploadingFile(file);\n\n try {\n const res = await uploadFiles('editorUploader', {\n ...props,\n files: [file],\n onUploadProgress: ({ progress }: { progress: number }) => {\n setProgress(Math.min(progress, 100));\n },\n });\n\n setUploadedFile(res[0]);\n\n onUploadComplete?.(res[0]);\n\n return uploadedFile;\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n\n const message =\n errorMessage.length > 0\n ? errorMessage\n : 'Something went wrong, please try again later.';\n\n toast.error(message);\n\n onUploadError?.(error);\n\n // Mock upload for unauthenticated users\n // toast.info('User not logged in. Mocking upload process.');\n const mockUploadedFile = {\n key: 'mock-key-0',\n appUrl: `https://mock-app-url.com/${file.name}`,\n name: file.name,\n size: file.size,\n type: file.type,\n url: URL.createObjectURL(file),\n } as UploadedFile;\n\n // Simulate upload progress\n let progress = 0;\n\n const simulateProgress = async () => {\n while (progress < 100) {\n await new Promise((resolve) => setTimeout(resolve, 50));\n progress += 2;\n setProgress(Math.min(progress, 100));\n }\n };\n\n await simulateProgress();\n\n setUploadedFile(mockUploadedFile);\n\n return mockUploadedFile;\n } finally {\n setProgress(0);\n setIsUploading(false);\n setUploadingFile(undefined);\n }\n }\n\n return {\n isUploading,\n progress,\n uploadedFile,\n uploadFile: uploadThing,\n uploadingFile,\n };\n}\n\nexport const { uploadFiles, useUploadThing }: any =\n generateReactHelpers<OurFileRouter>();\n\nexport function getErrorMessage(err: unknown) {\n const unknownError = 'Something went wrong, please try again later.';\n\n if (err instanceof z.ZodError) {\n const errors = err.issues.map((issue) => issue.message);\n\n return errors.join('\\n');\n }\n if (err instanceof Error) {\n return err.message;\n }\n return unknownError;\n}\n\nexport function showErrorToast(err: unknown) {\n const errorMessage = getErrorMessage(err);\n\n return toast.error(errorMessage);\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TPlaceholderElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport {\n PlaceholderPlugin,\n PlaceholderProvider,\n updateUploadHistory,\n} from '@platejs/media/react';\nimport { AudioLines, FileUp, Film, ImageIcon, Loader2Icon } from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { PlateElement, useEditorPlugin, withHOC } from 'platejs/react';\nimport { useFilePicker } from 'use-file-picker';\n\nimport { cn } from '@/lib/utils';\nimport { useUploadFile } from '@/hooks/use-upload-file';\n\nconst CONTENT: Record<\n string,\n {\n accept: string[];\n content: React.ReactNode;\n icon: React.ReactNode;\n }\n> = {\n [KEYS.audio]: {\n accept: ['audio/*'],\n content: 'Add an audio file',\n icon: <AudioLines />,\n },\n [KEYS.file]: {\n accept: ['*'],\n content: 'Add a file',\n icon: <FileUp />,\n },\n [KEYS.img]: {\n accept: ['image/*'],\n content: 'Add an image',\n icon: <ImageIcon />,\n },\n [KEYS.video]: {\n accept: ['video/*'],\n content: 'Add a video',\n icon: <Film />,\n },\n};\n\nexport const PlaceholderElement = withHOC(\n PlaceholderProvider,\n function PlaceholderElement(props: PlateElementProps<TPlaceholderElement>) {\n const { editor, element } = props;\n\n const { api } = useEditorPlugin(PlaceholderPlugin);\n\n const { isUploading, progress, uploadedFile, uploadFile, uploadingFile } =\n useUploadFile();\n\n const loading = isUploading && uploadingFile;\n\n const currentContent = CONTENT[element.mediaType];\n\n const isImage = element.mediaType === KEYS.img;\n\n const imageRef = React.useRef<HTMLImageElement>(null);\n\n const { openFilePicker } = useFilePicker({\n accept: currentContent.accept,\n multiple: true,\n onFilesSelected: ({ plainFiles: updatedFiles }) => {\n const firstFile = updatedFiles[0];\n const restFiles = updatedFiles.slice(1);\n\n replaceCurrentPlaceholder(firstFile);\n\n if (restFiles.length > 0) {\n editor.getTransforms(PlaceholderPlugin).insert.media(restFiles);\n }\n },\n });\n\n const replaceCurrentPlaceholder = React.useCallback(\n (file: File) => {\n void uploadFile(file);\n api.placeholder.addUploadingFile(element.id as string, file);\n },\n [api.placeholder, element.id, uploadFile]\n );\n\n React.useEffect(() => {\n if (!uploadedFile) return;\n\n const path = editor.api.findPath(element);\n\n editor.tf.withoutSaving(() => {\n editor.tf.removeNodes({ at: path });\n\n const node = {\n children: [{ text: '' }],\n initialHeight: imageRef.current?.height,\n initialWidth: imageRef.current?.width,\n isUpload: true,\n name: element.mediaType === KEYS.file ? uploadedFile.name : '',\n placeholderId: element.id as string,\n type: element.mediaType!,\n url: uploadedFile.url,\n };\n\n editor.tf.insertNodes(node, { at: path });\n\n updateUploadHistory(editor, node);\n });\n\n api.placeholder.removeUploadingFile(element.id as string);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [uploadedFile, element.id]);\n\n // React dev mode will call React.useEffect twice\n const isReplaced = React.useRef(false);\n\n /** Paste and drop */\n React.useEffect(() => {\n if (isReplaced.current) return;\n\n isReplaced.current = true;\n const currentFiles = api.placeholder.getUploadingFile(\n element.id as string\n );\n\n if (!currentFiles) return;\n\n replaceCurrentPlaceholder(currentFiles);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isReplaced]);\n\n return (\n <PlateElement className=\"my-1\" {...props}>\n {(!loading || !isImage) && (\n <div\n className={cn(\n 'flex cursor-pointer select-none items-center rounded-sm bg-muted p-3 pr-9 hover:bg-primary/10'\n )}\n onClick={() => !loading && openFilePicker()}\n contentEditable={false}\n >\n <div className=\"relative mr-3 flex text-muted-foreground/80 [&_svg]:size-6\">\n {currentContent.icon}\n </div>\n <div className=\"whitespace-nowrap text-muted-foreground text-sm\">\n <div>\n {loading ? uploadingFile?.name : currentContent.content}\n </div>\n\n {loading && !isImage && (\n <div className=\"mt-1 flex items-center gap-1.5\">\n <div>{formatBytes(uploadingFile?.size ?? 0)}</div>\n <div>–</div>\n <div className=\"flex items-center\">\n <Loader2Icon className=\"mr-1 size-3.5 animate-spin text-muted-foreground\" />\n {progress ?? 0}%\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n\n {isImage && loading && (\n <ImageProgress\n file={uploadingFile}\n imageRef={imageRef}\n progress={progress}\n />\n )}\n\n {props.children}\n </PlateElement>\n );\n }\n);\n\nexport function ImageProgress({\n className,\n file,\n imageRef,\n progress = 0,\n}: {\n file: File;\n className?: string;\n imageRef?: React.RefObject<HTMLImageElement | null>;\n progress?: number;\n}) {\n const [objectUrl, setObjectUrl] = React.useState<string | null>(null);\n\n React.useEffect(() => {\n const url = URL.createObjectURL(file);\n setObjectUrl(url);\n\n return () => {\n URL.revokeObjectURL(url);\n };\n }, [file]);\n\n if (!objectUrl) {\n return null;\n }\n\n return (\n <div className={cn('relative', className)} contentEditable={false}>\n <img\n ref={imageRef}\n className=\"h-auto w-full rounded-sm object-cover\"\n alt={file.name}\n src={objectUrl}\n />\n {progress < 100 && (\n <div className=\"absolute right-1 bottom-1 flex items-center space-x-2 rounded-full bg-black/50 px-1 py-0.5\">\n <Loader2Icon className=\"size-3.5 animate-spin text-muted-foreground\" />\n <span className=\"font-medium text-white text-xs\">\n {Math.round(progress)}%\n </span>\n </div>\n )}\n </div>\n );\n}\n\nfunction formatBytes(\n bytes: number,\n opts: {\n decimals?: number;\n sizeType?: 'accurate' | 'normal';\n } = {}\n) {\n const { decimals = 0, sizeType = 'normal' } = opts;\n\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n const accurateSizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB'];\n\n if (bytes === 0) return '0 Byte';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n\n return `${(bytes / 1024 ** i).toFixed(decimals)} ${\n sizeType === 'accurate'\n ? (accurateSizes[i] ?? 'Bytest')\n : (sizes[i] ?? 'Bytes')\n }`;\n}\n","'use client';\n\nimport {\n PreviewImage,\n useImagePreview,\n useImagePreviewValue,\n useScaleInput,\n} from '@platejs/media/react';\nimport { cva } from 'class-variance-authority';\nimport { ArrowLeft, ArrowRight, Download, Minus, Plus, X } from 'lucide-react';\nimport { useEditorRef } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nconst buttonVariants = cva('rounded bg-[rgba(0,0,0,0.5)] px-1', {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: 'text-white',\n disabled: 'cursor-not-allowed text-gray-400',\n },\n },\n});\n\nconst SCROLL_SPEED = 4;\n\nexport function MediaPreviewDialog() {\n const editor = useEditorRef();\n const isOpen = useImagePreviewValue('isOpen', editor.id);\n const scale = useImagePreviewValue('scale');\n const isEditingScale = useImagePreviewValue('isEditingScale');\n const {\n closeProps,\n currentUrlIndex,\n maskLayerProps,\n nextDisabled,\n nextProps,\n prevDisabled,\n prevProps,\n scaleTextProps,\n zommOutProps,\n zoomInDisabled,\n zoomInProps,\n zoomOutDisabled,\n } = useImagePreview({ scrollSpeed: SCROLL_SPEED });\n\n return (\n <div\n className={cn(\n 'fixed top-0 left-0 z-50 h-screen w-screen select-none',\n !isOpen && 'hidden'\n )}\n onContextMenu={(e) => e.stopPropagation()}\n {...maskLayerProps}\n >\n <div className=\"absolute inset-0 size-full bg-black opacity-30\" />\n <div className=\"absolute inset-0 size-full bg-black opacity-30\" />\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <div className=\"relative flex max-h-screen w-full items-center\">\n <PreviewImage\n className={cn(\n 'mx-auto block max-h-[calc(100vh-4rem)] w-auto object-contain transition-transform'\n )}\n />\n <div\n className=\"-translate-x-1/2 absolute bottom-0 left-1/2 z-40 flex w-fit justify-center gap-4 p-2 text-center text-white\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex gap-1\">\n <button\n {...prevProps}\n className={cn(\n buttonVariants({\n variant: prevDisabled ? 'disabled' : 'default',\n })\n )}\n type=\"button\"\n >\n <ArrowLeft />\n </button>\n {(currentUrlIndex ?? 0) + 1}\n <button\n {...nextProps}\n className={cn(\n buttonVariants({\n variant: nextDisabled ? 'disabled' : 'default',\n })\n )}\n type=\"button\"\n >\n <ArrowRight />\n </button>\n </div>\n <div className=\"flex\">\n <button\n className={cn(\n buttonVariants({\n variant: zoomOutDisabled ? 'disabled' : 'default',\n })\n )}\n {...zommOutProps}\n type=\"button\"\n >\n <Minus className=\"size-4\" />\n </button>\n <div className=\"mx-px\">\n {isEditingScale ? (\n <>\n <ScaleInput className=\"w-10 rounded px-1 text-slate-500 outline\" />{' '}\n <span>%</span>\n </>\n ) : (\n <span {...scaleTextProps}>{`${scale * 100}%`}</span>\n )}\n </div>\n <button\n className={cn(\n buttonVariants({\n variant: zoomInDisabled ? 'disabled' : 'default',\n })\n )}\n {...zoomInProps}\n type=\"button\"\n >\n <Plus className=\"size-4\" />\n </button>\n </div>\n {/* TODO: downLoad the image */}\n <button className={cn(buttonVariants())} type=\"button\">\n <Download className=\"size-4\" />\n </button>\n <button\n {...closeProps}\n className={cn(buttonVariants())}\n type=\"button\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction ScaleInput(props: React.ComponentProps<'input'>) {\n const { props: scaleInputProps, ref } = useScaleInput();\n\n return <input {...scaleInputProps} {...props} ref={ref} />;\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { PlaceholderPlugin, UploadErrorCode } from '@platejs/media/react';\nimport { usePluginOption } from 'platejs/react';\nimport { toast } from 'sonner';\n\nexport function MediaUploadToast() {\n useUploadErrorToast();\n\n return null;\n}\n\nconst useUploadErrorToast = () => {\n const uploadError = usePluginOption(PlaceholderPlugin, 'error');\n\n React.useEffect(() => {\n if (!uploadError) return;\n\n const { code, data } = uploadError;\n\n switch (code) {\n case UploadErrorCode.INVALID_FILE_SIZE: {\n toast.error(\n `The size of files ${data.files\n .map((f) => f.name)\n .join(', ')} is invalid`\n );\n\n break;\n }\n case UploadErrorCode.INVALID_FILE_TYPE: {\n toast.error(\n `The type of files ${data.files\n .map((f) => f.name)\n .join(', ')} is invalid`\n );\n\n break;\n }\n case UploadErrorCode.TOO_LARGE: {\n toast.error(\n `The size of files ${data.files\n .map((f) => f.name)\n .join(', ')} is too large than ${data.maxFileSize}`\n );\n\n break;\n }\n case UploadErrorCode.TOO_LESS_FILES: {\n toast.error(\n `The mini um number of files is ${data.minFileCount} for ${data.fileType}`\n );\n\n break;\n }\n case UploadErrorCode.TOO_MANY_FILES: {\n toast.error(\n `The maximum number of files is ${data.maxFileCount} ${\n data.fileType ? `for ${data.fileType}` : ''\n }`\n );\n\n break;\n }\n }\n }, [uploadError]);\n};\n","'use client';\n\nimport * as React from 'react';\nimport LiteYouTubeEmbed from 'react-lite-youtube-embed';\nimport ReactPlayer from 'react-player';\n\nimport type { TResizableProps, TVideoElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useDraggable } from '@platejs/dnd';\nimport { parseTwitterUrl, parseVideoUrl } from '@platejs/media';\nimport { useMediaState } from '@platejs/media/react';\nimport { ResizableProvider, useResizableValue } from '@platejs/resizable';\nimport { PlateElement, useEditorMounted, withHOC } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Caption, CaptionTextarea } from './caption';\nimport {\n mediaResizeHandleVariants,\n Resizable,\n ResizeHandle,\n} from './resize-handle';\n\nexport const VideoElement = withHOC(\n ResizableProvider,\n function VideoElement(\n props: PlateElementProps<TVideoElement & TResizableProps>\n ) {\n const {\n align = 'center',\n embed,\n isUpload,\n isYoutube,\n readOnly,\n unsafeUrl,\n } = useMediaState({\n urlParsers: [parseTwitterUrl, parseVideoUrl],\n });\n const width = useResizableValue('width');\n\n const isEditorMounted = useEditorMounted();\n\n const isTweet = true;\n\n const { isDragging, handleRef } = useDraggable({\n element: props.element,\n });\n\n return (\n <PlateElement className=\"py-2.5\" {...props}>\n <figure className=\"relative m-0 cursor-default\" contentEditable={false}>\n <Resizable\n className={cn(isDragging && 'opacity-50')}\n align={align}\n options={{\n align,\n maxWidth: isTweet ? 550 : '100%',\n minWidth: isTweet ? 300 : 100,\n readOnly,\n }}\n >\n <div className=\"group/media\">\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'left' })}\n options={{ direction: 'left' }}\n />\n\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'right' })}\n options={{ direction: 'right' }}\n />\n\n {!isUpload && isYoutube && (\n <div ref={handleRef}>\n <LiteYouTubeEmbed\n id={embed!.id!}\n title=\"youtube\"\n wrapperClass={cn(\n 'aspect-video rounded-sm',\n 'relative block cursor-pointer bg-black bg-center bg-cover [contain:content]',\n '[&.lyt-activated]:before:absolute [&.lyt-activated]:before:top-0 [&.lyt-activated]:before:h-[60px] [&.lyt-activated]:before:w-full [&.lyt-activated]:before:bg-top [&.lyt-activated]:before:bg-repeat-x [&.lyt-activated]:before:pb-[50px] [&.lyt-activated]:before:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&.lyt-activated]:before:bg-[url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==)]',\n 'after:block after:pb-[var(--aspect-ratio)] after:content-[\"\"]',\n '[&_>_iframe]:absolute [&_>_iframe]:top-0 [&_>_iframe]:left-0 [&_>_iframe]:size-full',\n '[&_>_.lty-playbtn]:z-1 [&_>_.lty-playbtn]:h-[46px] [&_>_.lty-playbtn]:w-[70px] [&_>_.lty-playbtn]:rounded-[14%] [&_>_.lty-playbtn]:bg-[#212121] [&_>_.lty-playbtn]:opacity-80 [&_>_.lty-playbtn]:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&:hover_>_.lty-playbtn]:bg-[red] [&:hover_>_.lty-playbtn]:opacity-100',\n '[&_>_.lty-playbtn]:before:border-[transparent_transparent_transparent_#fff] [&_>_.lty-playbtn]:before:border-y-[11px] [&_>_.lty-playbtn]:before:border-r-0 [&_>_.lty-playbtn]:before:border-l-[19px] [&_>_.lty-playbtn]:before:content-[\"\"]',\n '[&_>_.lty-playbtn]:absolute [&_>_.lty-playbtn]:top-1/2 [&_>_.lty-playbtn]:left-1/2 [&_>_.lty-playbtn]:[transform:translate3d(-50%,-50%,0)]',\n '[&_>_.lty-playbtn]:before:absolute [&_>_.lty-playbtn]:before:top-1/2 [&_>_.lty-playbtn]:before:left-1/2 [&_>_.lty-playbtn]:before:[transform:translate3d(-50%,-50%,0)]',\n '[&.lyt-activated]:cursor-[unset]',\n '[&.lyt-activated]:before:pointer-events-none [&.lyt-activated]:before:opacity-0',\n '[&.lyt-activated_>_.lty-playbtn]:pointer-events-none [&.lyt-activated_>_.lty-playbtn]:opacity-0!'\n )}\n />\n </div>\n )}\n\n {isUpload && isEditorMounted && (\n <div ref={handleRef}>\n <ReactPlayer\n height=\"100%\"\n src={unsafeUrl}\n width=\"100%\"\n controls\n />\n </div>\n )}\n </div>\n </Resizable>\n\n <Caption style={{ width }} align={align}>\n <CaptionTextarea\n readOnly={readOnly}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </figure>\n {props.children}\n </PlateElement>\n );\n }\n);\n","'use client';\n\nimport { CaptionPlugin } from '@platejs/caption/react';\nimport {\n AudioPlugin,\n FilePlugin,\n ImagePlugin,\n MediaEmbedPlugin,\n PlaceholderPlugin,\n VideoPlugin,\n} from '@platejs/media/react';\nimport { KEYS } from 'platejs';\n\nimport { AudioElement } from '@/components/ui/media-audio-node';\nimport { MediaEmbedElement } from '@/components/ui/media-embed-node';\nimport { FileElement } from '@/components/ui/media-file-node';\nimport { ImageElement } from '@/components/ui/media-image-node';\nimport { PlaceholderElement } from '@/components/ui/media-placeholder-node';\nimport { MediaPreviewDialog } from '@/components/ui/media-preview-dialog';\nimport { MediaUploadToast } from '@/components/ui/media-upload-toast';\nimport { VideoElement } from '@/components/ui/media-video-node';\n\nexport const MediaKit = [\n ImagePlugin.configure({\n options: { disableUploadInsert: true },\n render: { afterEditable: MediaPreviewDialog, node: ImageElement },\n }),\n MediaEmbedPlugin.withComponent(MediaEmbedElement),\n VideoPlugin.withComponent(VideoElement),\n AudioPlugin.withComponent(AudioElement),\n FilePlugin.withComponent(FileElement),\n PlaceholderPlugin.configure({\n options: { disableEmptyPlaceholder: true },\n render: { afterEditable: MediaUploadToast, node: PlaceholderElement },\n }),\n CaptionPlugin.configure({\n options: {\n query: {\n allow: [KEYS.img, KEYS.video, KEYS.audio, KEYS.file, KEYS.mediaEmbed],\n },\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { Point, TElement } from 'platejs';\n\nimport {\n type ComboboxItemProps,\n Combobox,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxItem,\n ComboboxPopover,\n ComboboxProvider,\n ComboboxRow,\n Portal,\n useComboboxContext,\n useComboboxStore,\n} from '@ariakit/react';\nimport { filterWords } from '@platejs/combobox';\nimport {\n type UseComboboxInputResult,\n useComboboxInput,\n useHTMLInputCursorState,\n} from '@platejs/combobox/react';\nimport { cva } from 'class-variance-authority';\nimport { useComposedRef, useEditorRef } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\ntype FilterFn = (\n item: { value: string; group?: string; keywords?: string[]; label?: string },\n search: string\n) => boolean;\n\ntype InlineComboboxContextValue = {\n filter: FilterFn | false;\n inputProps: UseComboboxInputResult['props'];\n inputRef: React.RefObject<HTMLInputElement | null>;\n removeInput: UseComboboxInputResult['removeInput'];\n showTrigger: boolean;\n trigger: string;\n setHasEmpty: (hasEmpty: boolean) => void;\n};\n\nconst InlineComboboxContext = React.createContext<InlineComboboxContextValue>(\n null as unknown as InlineComboboxContextValue\n);\n\nconst defaultFilter: FilterFn = (\n { group, keywords = [], label, value },\n search\n) => {\n const uniqueTerms = new Set(\n [value, ...keywords, group, label].filter(Boolean)\n );\n\n return Array.from(uniqueTerms).some((keyword) =>\n filterWords(keyword!, search)\n );\n};\n\ntype InlineComboboxProps = {\n children: React.ReactNode;\n element: TElement;\n trigger: string;\n filter?: FilterFn | false;\n hideWhenNoValue?: boolean;\n showTrigger?: boolean;\n value?: string;\n setValue?: (value: string) => void;\n};\n\nconst InlineCombobox = ({\n children,\n element,\n filter = defaultFilter,\n hideWhenNoValue = false,\n setValue: setValueProp,\n showTrigger = true,\n trigger,\n value: valueProp,\n}: InlineComboboxProps) => {\n const editor = useEditorRef();\n const inputRef = React.useRef<HTMLInputElement>(null);\n const cursorState = useHTMLInputCursorState(inputRef);\n\n const [valueState, setValueState] = React.useState('');\n const hasValueProp = valueProp !== undefined;\n const value = hasValueProp ? valueProp : valueState;\n\n const setValue = React.useCallback(\n (newValue: string) => {\n setValueProp?.(newValue);\n\n if (!hasValueProp) {\n setValueState(newValue);\n }\n },\n [setValueProp, hasValueProp]\n );\n\n /**\n * Track the point just before the input element so we know where to\n * insertText if the combobox closes due to a selection change.\n */\n const insertPoint = React.useRef<Point | null>(null);\n\n React.useEffect(() => {\n const path = editor.api.findPath(element);\n\n if (!path) return;\n\n const point = editor.api.before(path);\n\n if (!point) return;\n\n const pointRef = editor.api.pointRef(point);\n insertPoint.current = pointRef.current;\n\n return () => {\n pointRef.unref();\n };\n }, [editor, element]);\n\n const { props: inputProps, removeInput } = useComboboxInput({\n cancelInputOnBlur: true,\n cursorState,\n ref: inputRef,\n onCancelInput: (cause) => {\n if (cause !== 'backspace') {\n editor.tf.insertText(trigger + value, {\n at: insertPoint?.current ?? undefined,\n });\n }\n if (cause === 'arrowLeft' || cause === 'arrowRight') {\n editor.tf.move({\n distance: 1,\n reverse: cause === 'arrowLeft',\n });\n }\n },\n });\n\n const [hasEmpty, setHasEmpty] = React.useState(false);\n\n const contextValue: InlineComboboxContextValue = React.useMemo(\n () => ({\n filter,\n inputProps,\n inputRef,\n removeInput,\n setHasEmpty,\n showTrigger,\n trigger,\n }),\n [\n trigger,\n showTrigger,\n filter,\n inputRef,\n inputProps,\n removeInput,\n setHasEmpty,\n ]\n );\n\n const store = useComboboxStore({\n // open: ,\n setValue: (newValue) => React.startTransition(() => setValue(newValue)),\n });\n\n const items = store.useState('items');\n\n /**\n * If there is no active ID and the list of items changes, select the first\n * item.\n */\n React.useEffect(() => {\n if (!store.getState().activeId) {\n store.setActiveId(store.first());\n }\n }, [items, store]);\n\n return (\n <span contentEditable={false}>\n <ComboboxProvider\n open={\n (items.length > 0 || hasEmpty) &&\n (!hideWhenNoValue || value.length > 0)\n }\n store={store}\n >\n <InlineComboboxContext.Provider value={contextValue}>\n {children}\n </InlineComboboxContext.Provider>\n </ComboboxProvider>\n </span>\n );\n};\n\nconst InlineComboboxInput = ({\n className,\n ref: propRef,\n ...props\n}: React.HTMLAttributes<HTMLInputElement> & {\n ref?: React.RefObject<HTMLInputElement | null>;\n}) => {\n const {\n inputProps,\n inputRef: contextRef,\n showTrigger,\n trigger,\n } = React.useContext(InlineComboboxContext);\n\n const store = useComboboxContext()!;\n const value = store.useState('value');\n\n const ref = useComposedRef(propRef, contextRef);\n\n /**\n * To create an auto-resizing input, we render a visually hidden span\n * containing the input value and position the input element on top of it.\n * This works well for all cases except when input exceeds the width of the\n * container.\n */\n\n return (\n <>\n {showTrigger && trigger}\n\n <span className=\"relative min-h-[1lh]\">\n <span\n className=\"invisible overflow-hidden text-nowrap\"\n aria-hidden=\"true\"\n >\n {value || '\\u200B'}\n </span>\n\n <Combobox\n ref={ref}\n className={cn(\n 'absolute top-0 left-0 size-full bg-transparent outline-none',\n className\n )}\n value={value}\n autoSelect\n {...inputProps}\n {...props}\n />\n </span>\n </>\n );\n};\n\nInlineComboboxInput.displayName = 'InlineComboboxInput';\n\nconst InlineComboboxContent: typeof ComboboxPopover = ({\n className,\n ...props\n}) => {\n // Portal prevents CSS from leaking into popover\n return (\n <Portal>\n <ComboboxPopover\n className={cn(\n 'z-500 max-h-[288px] w-[300px] overflow-y-auto rounded-md bg-popover shadow-md',\n className\n )}\n {...props}\n />\n </Portal>\n );\n};\n\nconst comboboxItemVariants = cva(\n 'relative mx-1 flex h-[28px] select-none items-center rounded-sm px-2 text-foreground text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n {\n defaultVariants: {\n interactive: true,\n },\n variants: {\n interactive: {\n false: '',\n true: 'cursor-pointer transition-colors hover:bg-accent hover:text-accent-foreground data-[active-item=true]:bg-accent data-[active-item=true]:text-accent-foreground',\n },\n },\n }\n);\n\nconst InlineComboboxItem = ({\n className,\n focusEditor = true,\n group,\n keywords,\n label,\n onClick,\n ...props\n}: {\n focusEditor?: boolean;\n group?: string;\n keywords?: string[];\n label?: string;\n} & ComboboxItemProps &\n Required<Pick<ComboboxItemProps, 'value'>>) => {\n const { value } = props;\n\n const { filter, removeInput } = React.useContext(InlineComboboxContext);\n\n const store = useComboboxContext()!;\n\n // Optimization: Do not subscribe to value if filter is false\n const search = filter && store.useState('value');\n\n const visible = React.useMemo(\n () =>\n !filter || filter({ group, keywords, label, value }, search as string),\n [filter, group, keywords, label, value, search]\n );\n\n if (!visible) return null;\n\n return (\n <ComboboxItem\n className={cn(comboboxItemVariants(), className)}\n onClick={(event) => {\n removeInput(focusEditor);\n onClick?.(event);\n }}\n {...props}\n />\n );\n};\n\nconst InlineComboboxEmpty = ({\n children,\n className,\n}: React.HTMLAttributes<HTMLDivElement>) => {\n const { setHasEmpty } = React.useContext(InlineComboboxContext);\n const store = useComboboxContext()!;\n const items = store.useState('items');\n\n React.useEffect(() => {\n setHasEmpty(true);\n\n return () => {\n setHasEmpty(false);\n };\n }, [setHasEmpty]);\n\n if (items.length > 0) return null;\n\n return (\n <div\n className={cn(comboboxItemVariants({ interactive: false }), className)}\n >\n {children}\n </div>\n );\n};\n\nconst InlineComboboxRow = ComboboxRow;\n\nfunction InlineComboboxGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxGroup>) {\n return (\n <ComboboxGroup\n {...props}\n className={cn(\n 'hidden not-last:border-b py-1.5 [&:has([role=option])]:block',\n className\n )}\n />\n );\n}\n\nfunction InlineComboboxGroupLabel({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxGroupLabel>) {\n return (\n <ComboboxGroupLabel\n {...props}\n className={cn(\n 'mt-1.5 mb-2 px-3 font-medium text-muted-foreground text-xs',\n className\n )}\n />\n );\n}\n\nexport {\n InlineCombobox,\n InlineComboboxContent,\n InlineComboboxEmpty,\n InlineComboboxGroup,\n InlineComboboxGroupLabel,\n InlineComboboxInput,\n InlineComboboxItem,\n InlineComboboxRow,\n};\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TComboboxInputElement, TMentionElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { getMentionOnSelectItem } from '@platejs/mention';\nimport { IS_APPLE, KEYS } from 'platejs';\nimport {\n PlateElement,\n useFocused,\n useReadOnly,\n useSelected,\n} from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\nimport { useMounted } from '@/hooks/use-mounted';\n\nimport {\n InlineCombobox,\n InlineComboboxContent,\n InlineComboboxEmpty,\n InlineComboboxGroup,\n InlineComboboxInput,\n InlineComboboxItem,\n} from './inline-combobox';\n\nexport function MentionElement(\n props: PlateElementProps<TMentionElement> & {\n prefix?: string;\n }\n) {\n const element = props.element;\n\n const selected = useSelected();\n const focused = useFocused();\n const mounted = useMounted();\n const readOnly = useReadOnly();\n\n return (\n <PlateElement\n {...props}\n className={cn(\n 'inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline font-medium text-sm',\n !readOnly && 'cursor-pointer',\n selected && focused && 'ring-2 ring-ring',\n element.children[0][KEYS.bold] === true && 'font-bold',\n element.children[0][KEYS.italic] === true && 'italic',\n element.children[0][KEYS.underline] === true && 'underline'\n )}\n attributes={{\n ...props.attributes,\n contentEditable: false,\n 'data-slate-value': element.value,\n draggable: true,\n }}\n >\n {mounted && IS_APPLE ? (\n // Mac OS IME https://github.com/ianstormtaylor/slate/issues/3490\n <>\n {props.children}\n {props.prefix}\n {element.value}\n </>\n ) : (\n // Others like Android https://github.com/ianstormtaylor/slate/pull/5360\n <>\n {props.prefix}\n {element.value}\n {props.children}\n </>\n )}\n </PlateElement>\n );\n}\n\nconst onSelectItem = getMentionOnSelectItem();\n\nexport function MentionInputElement(\n props: PlateElementProps<TComboboxInputElement>\n) {\n const { editor, element } = props;\n const [search, setSearch] = React.useState('');\n\n return (\n <PlateElement {...props} as=\"span\">\n <InlineCombobox\n value={search}\n element={element}\n setValue={setSearch}\n showTrigger={false}\n trigger=\"@\"\n >\n <span className=\"inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline text-sm ring-ring focus-within:ring-2\">\n <InlineComboboxInput />\n </span>\n\n <InlineComboboxContent className=\"my-1.5\">\n <InlineComboboxEmpty>No results</InlineComboboxEmpty>\n\n <InlineComboboxGroup>\n {MENTIONABLES.map((item) => (\n <InlineComboboxItem\n key={item.key}\n value={item.text}\n onClick={() => onSelectItem(editor, item, search)}\n >\n {item.text}\n </InlineComboboxItem>\n ))}\n </InlineComboboxGroup>\n </InlineComboboxContent>\n </InlineCombobox>\n\n {props.children}\n </PlateElement>\n );\n}\n\nconst MENTIONABLES = [\n { key: '0', text: 'Aayla Secura' },\n { key: '1', text: 'Adi Gallia' },\n {\n key: '2',\n text: 'Admiral Dodd Rancit',\n },\n {\n key: '3',\n text: 'Admiral Firmus Piett',\n },\n {\n key: '4',\n text: 'Admiral Gial Ackbar',\n },\n { key: '5', text: 'Admiral Ozzel' },\n { key: '6', text: 'Admiral Raddus' },\n {\n key: '7',\n text: 'Admiral Terrinald Screed',\n },\n { key: '8', text: 'Admiral Trench' },\n {\n key: '9',\n text: 'Admiral U.O. Statura',\n },\n { key: '10', text: 'Agen Kolar' },\n { key: '11', text: 'Agent Kallus' },\n {\n key: '12',\n text: 'Aiolin and Morit Astarte',\n },\n { key: '13', text: 'Aks Moe' },\n { key: '14', text: 'Almec' },\n { key: '15', text: 'Alton Kastle' },\n { key: '16', text: 'Amee' },\n { key: '17', text: 'AP-5' },\n { key: '18', text: 'Armitage Hux' },\n { key: '19', text: 'Artoo' },\n { key: '20', text: 'Arvel Crynyd' },\n { key: '21', text: 'Asajj Ventress' },\n { key: '22', text: 'Aurra Sing' },\n { key: '23', text: 'AZI-3' },\n { key: '24', text: 'Bala-Tik' },\n { key: '25', text: 'Barada' },\n { key: '26', text: 'Bargwill Tomder' },\n { key: '27', text: 'Baron Papanoida' },\n { key: '28', text: 'Barriss Offee' },\n { key: '29', text: 'Baze Malbus' },\n { key: '30', text: 'Bazine Netal' },\n { key: '31', text: 'BB-8' },\n { key: '32', text: 'BB-9E' },\n { key: '33', text: 'Ben Quadinaros' },\n { key: '34', text: 'Berch Teller' },\n { key: '35', text: 'Beru Lars' },\n { key: '36', text: 'Bib Fortuna' },\n {\n key: '37',\n text: 'Biggs Darklighter',\n },\n { key: '38', text: 'Black Krrsantan' },\n { key: '39', text: 'Bo-Katan Kryze' },\n { key: '40', text: 'Boba Fett' },\n { key: '41', text: 'Bobbajo' },\n { key: '42', text: 'Bodhi Rook' },\n { key: '43', text: 'Borvo the Hutt' },\n { key: '44', text: 'Boss Nass' },\n { key: '45', text: 'Bossk' },\n {\n key: '46',\n text: 'Breha Antilles-Organa',\n },\n { key: '47', text: 'Bren Derlin' },\n { key: '48', text: 'Brendol Hux' },\n { key: '49', text: 'BT-1' },\n];\n","'use client';\n\nimport { MentionInputPlugin, MentionPlugin } from '@platejs/mention/react';\n\nimport {\n MentionElement,\n MentionInputElement,\n} from '@/components/ui/mention-node';\n\nexport const MentionKit = [\n MentionPlugin.configure({\n options: { triggerPreviousCharPattern: /^$|^[\\s\"']$/ },\n }).withComponent(MentionElement),\n MentionInputPlugin.withComponent(MentionInputElement),\n];\n","import * as React from 'react';\n\nexport function useMounted() {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n return mounted;\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateEditor, PlateElementProps } from 'platejs/react';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport {\n CalendarIcon,\n ChevronRightIcon,\n Code2,\n Columns3Icon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n LightbulbIcon,\n ListIcon,\n ListOrdered,\n PenToolIcon,\n PilcrowIcon,\n Quote,\n RadicalIcon,\n SparklesIcon,\n Square,\n Table,\n TableOfContentsIcon,\n} from 'lucide-react';\nimport { type TComboboxInputElement, KEYS } from 'platejs';\nimport { PlateElement } from 'platejs/react';\n\nimport {\n insertBlock,\n insertInlineElement,\n} from '@/components/editor/transforms';\n\nimport {\n InlineCombobox,\n InlineComboboxContent,\n InlineComboboxEmpty,\n InlineComboboxGroup,\n InlineComboboxGroupLabel,\n InlineComboboxInput,\n InlineComboboxItem,\n} from './inline-combobox';\n\ntype Group = {\n group: string;\n items: {\n icon: React.ReactNode;\n value: string;\n onSelect: (editor: PlateEditor, value: string) => void;\n className?: string;\n focusEditor?: boolean;\n keywords?: string[];\n label?: string;\n }[];\n};\n\nconst groups: Group[] = [\n {\n group: 'AI',\n items: [\n {\n focusEditor: false,\n icon: <SparklesIcon />,\n value: 'AI',\n onSelect: (editor) => {\n editor.getApi(AIChatPlugin).aiChat.show();\n },\n },\n ],\n },\n {\n group: 'Basic blocks',\n items: [\n {\n icon: <PilcrowIcon />,\n keywords: ['paragraph'],\n label: 'Text',\n value: KEYS.p,\n },\n {\n icon: <Heading1Icon />,\n keywords: ['title', 'h1'],\n label: 'Heading 1',\n value: KEYS.h1,\n },\n {\n icon: <Heading2Icon />,\n keywords: ['subtitle', 'h2'],\n label: 'Heading 2',\n value: KEYS.h2,\n },\n {\n icon: <Heading3Icon />,\n keywords: ['subtitle', 'h3'],\n label: 'Heading 3',\n value: KEYS.h3,\n },\n {\n icon: <ListIcon />,\n keywords: ['unordered', 'ul', '-'],\n label: 'Bulleted list',\n value: KEYS.ul,\n },\n {\n icon: <ListOrdered />,\n keywords: ['ordered', 'ol', '1'],\n label: 'Numbered list',\n value: KEYS.ol,\n },\n {\n icon: <Square />,\n keywords: ['checklist', 'task', 'checkbox', '[]'],\n label: 'To-do list',\n value: KEYS.listTodo,\n },\n {\n icon: <ChevronRightIcon />,\n keywords: ['collapsible', 'expandable'],\n label: 'Toggle',\n value: KEYS.toggle,\n },\n {\n icon: <Code2 />,\n keywords: ['```'],\n label: 'Code Block',\n value: KEYS.codeBlock,\n },\n {\n icon: <Table />,\n label: 'Table',\n value: KEYS.table,\n },\n {\n icon: <Quote />,\n keywords: ['citation', 'blockquote', 'quote', '>'],\n label: 'Blockquote',\n value: KEYS.blockquote,\n },\n {\n description: 'Insert a highlighted block.',\n icon: <LightbulbIcon />,\n keywords: ['note'],\n label: 'Callout',\n value: KEYS.callout,\n },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value, { upsert: true });\n },\n })),\n },\n {\n group: 'Advanced blocks',\n items: [\n {\n icon: <TableOfContentsIcon />,\n keywords: ['toc'],\n label: 'Table of contents',\n value: KEYS.toc,\n },\n {\n icon: <Columns3Icon />,\n label: '3 columns',\n value: 'action_three_columns',\n },\n {\n focusEditor: false,\n icon: <RadicalIcon />,\n label: 'Equation',\n value: KEYS.equation,\n },\n {\n icon: <PenToolIcon />,\n keywords: ['excalidraw'],\n label: 'Excalidraw',\n value: KEYS.excalidraw,\n },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value, { upsert: true });\n },\n })),\n },\n {\n group: 'Inline',\n items: [\n {\n focusEditor: true,\n icon: <CalendarIcon />,\n keywords: ['time'],\n label: 'Date',\n value: KEYS.date,\n },\n {\n focusEditor: false,\n icon: <RadicalIcon />,\n label: 'Inline Equation',\n value: KEYS.inlineEquation,\n },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertInlineElement(editor, value);\n },\n })),\n },\n];\n\nexport function SlashInputElement(\n props: PlateElementProps<TComboboxInputElement>\n) {\n const { editor, element } = props;\n\n return (\n <PlateElement {...props} as=\"span\">\n <InlineCombobox element={element} trigger=\"/\">\n <InlineComboboxInput />\n\n <InlineComboboxContent>\n <InlineComboboxEmpty>No results</InlineComboboxEmpty>\n\n {groups.map(({ group, items }) => (\n <InlineComboboxGroup key={group}>\n <InlineComboboxGroupLabel>{group}</InlineComboboxGroupLabel>\n\n {items.map(\n ({ focusEditor, icon, keywords, label, value, onSelect }) => (\n <InlineComboboxItem\n key={value}\n value={value}\n onClick={() => onSelect(editor, value)}\n label={label}\n focusEditor={focusEditor}\n group={group}\n keywords={keywords}\n >\n <div className=\"mr-2 text-muted-foreground\">{icon}</div>\n {label ?? value}\n </InlineComboboxItem>\n )\n )}\n </InlineComboboxGroup>\n ))}\n </InlineComboboxContent>\n </InlineCombobox>\n\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { SlashInputPlugin, SlashPlugin } from '@platejs/slash-command/react';\nimport { KEYS } from 'platejs';\n\nimport { SlashInputElement } from '@/components/ui/slash-node';\n\nexport const SlashKit = [\n SlashPlugin.configure({\n options: {\n triggerQuery: (editor) =>\n !editor.api.some({\n match: { type: editor.getType(KEYS.codeBlock) },\n }),\n },\n }),\n SlashInputPlugin.withComponent(SlashInputElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TSuggestionData, TSuggestionText } from 'platejs';\nimport type { PlateLeafProps, RenderNodeWrapper } from 'platejs/react';\n\nimport { cva } from 'class-variance-authority';\nimport { CornerDownLeftIcon } from 'lucide-react';\nimport { PlateLeaf, useEditorPlugin, usePluginOption } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\nimport {\n type SuggestionConfig,\n suggestionPlugin,\n} from '@/components/editor/plugins/suggestion-kit';\n\nconst suggestionVariants = cva(\n cn(\n 'bg-emerald-100 text-emerald-700 no-underline transition-colors duration-200'\n ),\n {\n defaultVariants: {\n insertActive: false,\n remove: false,\n removeActive: false,\n },\n variants: {\n insertActive: {\n false: '',\n true: 'bg-emerald-200/80',\n },\n remove: {\n false: '',\n true: 'bg-red-100 text-red-700',\n },\n removeActive: {\n false: '',\n true: 'bg-red-200/80 no-underline',\n },\n },\n }\n);\n\nexport function SuggestionLeaf(props: PlateLeafProps<TSuggestionText>) {\n const { api, setOption } = useEditorPlugin(suggestionPlugin);\n const leaf = props.leaf;\n\n const leafId: string = api.suggestion.nodeId(leaf) ?? '';\n const activeSuggestionId = usePluginOption(suggestionPlugin, 'activeId');\n const hoverSuggestionId = usePluginOption(suggestionPlugin, 'hoverId');\n const dataList = api.suggestion.dataList(leaf);\n\n const hasRemove = dataList.some((data) => data.type === 'remove');\n const hasActive = dataList.some((data) => data.id === activeSuggestionId);\n const hasHover = dataList.some((data) => data.id === hoverSuggestionId);\n\n const diffOperation = { type: hasRemove ? 'delete' : 'insert' } as const;\n\n const Component = ({ delete: 'del', insert: 'ins', update: 'span' } as const)[\n diffOperation.type\n ];\n\n return (\n <PlateLeaf\n {...props}\n as={Component}\n className={cn(\n suggestionVariants({\n insertActive: hasActive || hasHover,\n remove: hasRemove,\n removeActive: (hasActive || hasHover) && hasRemove,\n })\n )}\n attributes={{\n ...props.attributes,\n onMouseEnter: () => setOption('hoverId', leafId),\n onMouseLeave: () => setOption('hoverId', null),\n }}\n >\n {props.children}\n </PlateLeaf>\n );\n}\nexport const SuggestionLineBreak: RenderNodeWrapper<SuggestionConfig> = ({\n api,\n element,\n}) => {\n if (!api.suggestion.isBlockSuggestion(element)) return;\n\n const suggestionData = element.suggestion;\n\n return function Component({ children }) {\n return (\n <SuggestionLineBreakContent suggestionData={suggestionData}>\n {children}\n </SuggestionLineBreakContent>\n );\n };\n};\n\nfunction SuggestionLineBreakContent({\n children,\n suggestionData,\n}: {\n children: React.ReactNode;\n suggestionData: TSuggestionData;\n}) {\n const { isLineBreak, type } = suggestionData;\n const isRemove = type === 'remove';\n const isInsert = type === 'insert';\n\n const activeSuggestionId = usePluginOption(suggestionPlugin, 'activeId');\n const hoverSuggestionId = usePluginOption(suggestionPlugin, 'hoverId');\n\n const isActive = activeSuggestionId === suggestionData.id;\n const isHover = hoverSuggestionId === suggestionData.id;\n\n const spanRef = React.useRef<HTMLSpanElement>(null);\n const { setOption } = useEditorPlugin(suggestionPlugin);\n\n return (\n <>\n {isLineBreak ? (\n <>\n {children}\n <span\n ref={spanRef}\n className={cn(\n 'absolute text-justify',\n suggestionVariants({\n insertActive: isInsert && (isActive || isHover),\n remove: isRemove,\n removeActive: (isActive || isHover) && isRemove,\n })\n )}\n style={{\n bottom: 3.5,\n height: 21,\n }}\n contentEditable={false}\n >\n <CornerDownLeftIcon className=\"mt-0.5 size-4\" />\n </span>\n </>\n ) : (\n <div\n className={cn(\n suggestionVariants({\n insertActive: isInsert && (isActive || isHover),\n remove: isRemove,\n removeActive: (isActive || isHover) && isRemove,\n })\n )}\n onMouseEnter={() => setOption('hoverId', suggestionData.id)}\n onMouseLeave={() => setOption('hoverId', null)}\n data-block-suggestion=\"true\"\n >\n {children}\n </div>\n )}\n </>\n );\n}\n","import * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n \"relative flex size-8 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn(\"aspect-square size-full\", className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"bg-muted flex size-full items-center justify-center rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarImage, AvatarFallback }\n","'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\nimport type { PlateContentProps, PlateViewProps } from 'platejs/react';\n\nimport { cva } from 'class-variance-authority';\nimport { PlateContainer, PlateContent, PlateView } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nconst editorContainerVariants = cva(\n 'relative w-full cursor-text select-text overflow-y-auto caret-primary selection:bg-brand/25 focus-visible:outline-none [&_.slate-selection-area]:z-50 [&_.slate-selection-area]:border [&_.slate-selection-area]:border-brand/25 [&_.slate-selection-area]:bg-brand/15',\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n comment: cn(\n 'flex flex-wrap justify-between gap-1 px-1 py-0.5 text-sm',\n 'rounded-md border-[1.5px] border-transparent bg-transparent',\n 'has-[[data-slate-editor]:focus]:border-brand/50 has-[[data-slate-editor]:focus]:ring-2 has-[[data-slate-editor]:focus]:ring-brand/30',\n 'has-aria-disabled:border-input has-aria-disabled:bg-muted'\n ),\n default: 'h-full',\n demo: 'h-[650px]',\n select: cn(\n 'group rounded-md border border-input ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2',\n 'has-data-readonly:w-fit has-data-readonly:cursor-default has-data-readonly:border-transparent has-data-readonly:focus-within:[box-shadow:none]'\n ),\n },\n },\n }\n);\n\nexport function EditorContainer({\n className,\n variant,\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof editorContainerVariants>) {\n return (\n <PlateContainer\n className={cn(\n 'ignore-click-outside/toolbar',\n editorContainerVariants({ variant }),\n className\n )}\n {...props}\n />\n );\n}\n\nconst editorVariants = cva(\n cn(\n 'group/editor',\n 'relative w-full cursor-text select-text overflow-x-hidden whitespace-pre-wrap break-words',\n 'rounded-md ring-offset-background focus-visible:outline-none',\n '**:data-slate-placeholder:!top-1/2 **:data-slate-placeholder:-translate-y-1/2 placeholder:text-muted-foreground/80 **:data-slate-placeholder:text-muted-foreground/80 **:data-slate-placeholder:opacity-100!',\n '[&_strong]:font-bold'\n ),\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n },\n focused: {\n true: 'ring-2 ring-ring ring-offset-2',\n },\n variant: {\n ai: 'w-full px-0 text-base md:text-sm',\n aiChat:\n 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm',\n comment: cn('rounded-none border-none bg-transparent text-sm'),\n default:\n 'size-full px-16 pt-4 pb-72 text-base sm:px-[max(64px,calc(50%-350px))]',\n demo: 'size-full px-16 pt-4 pb-72 text-base sm:px-[max(64px,calc(50%-350px))]',\n fullWidth: 'size-full px-16 pt-4 pb-72 text-base sm:px-24',\n none: '',\n select: 'px-3 py-2 text-base data-readonly:w-fit',\n },\n },\n }\n);\n\nexport type EditorProps = PlateContentProps &\n VariantProps<typeof editorVariants>;\n\nexport const Editor = ({\n className,\n disabled,\n focused,\n variant,\n ref,\n ...props\n}: EditorProps & { ref?: React.RefObject<HTMLDivElement | null> }) => (\n <PlateContent\n ref={ref}\n className={cn(\n editorVariants({\n disabled,\n focused,\n variant,\n }),\n className\n )}\n disabled={disabled}\n disableDefaultStyles\n {...props}\n />\n);\n\nEditor.displayName = 'Editor';\n\nexport function EditorView({\n className,\n variant,\n ...props\n}: PlateViewProps & VariantProps<typeof editorVariants>) {\n return (\n <PlateView\n {...props}\n className={cn(editorVariants({ variant }), className)}\n />\n );\n}\n\nEditorView.displayName = 'EditorView';\n","'use client';\n\nimport * as React from 'react';\n\nimport type { CreatePlateEditorOptions } from 'platejs/react';\n\nimport { getCommentKey, getDraftCommentKey } from '@platejs/comment';\nimport { CommentPlugin, useCommentId } from '@platejs/comment/react';\nimport {\n differenceInDays,\n differenceInHours,\n differenceInMinutes,\n format,\n} from 'date-fns';\nimport {\n ArrowUpIcon,\n CheckIcon,\n MoreHorizontalIcon,\n PencilIcon,\n TrashIcon,\n XIcon,\n} from 'lucide-react';\nimport { type Value, KEYS, nanoid, NodeApi } from 'platejs';\nimport {\n Plate,\n useEditorPlugin,\n useEditorRef,\n usePlateEditor,\n usePluginOption,\n} from 'platejs/react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';\nimport { Button } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { cn } from '@/lib/utils';\nimport { BasicMarksKit } from '@/components/editor/plugins/basic-marks-kit';\nimport {\n type TDiscussion,\n discussionPlugin,\n} from '@/components/editor/plugins/discussion-kit';\n\nimport { Editor, EditorContainer } from './editor';\n\nexport type TComment = {\n id: string;\n contentRich: Value;\n createdAt: Date;\n discussionId: string;\n isEdited: boolean;\n userId: string;\n};\n\nexport function Comment(props: {\n comment: TComment;\n discussionLength: number;\n editingId: string | null;\n index: number;\n setEditingId: React.Dispatch<React.SetStateAction<string | null>>;\n documentContent?: string;\n showDocumentContent?: boolean;\n onEditorClick?: () => void;\n}) {\n const {\n comment,\n discussionLength,\n documentContent,\n editingId,\n index,\n setEditingId,\n showDocumentContent = false,\n onEditorClick,\n } = props;\n\n const editor = useEditorRef();\n const userInfo = usePluginOption(discussionPlugin, 'user', comment.userId);\n const currentUserId = usePluginOption(discussionPlugin, 'currentUserId');\n\n const resolveDiscussion = async (id: string) => {\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .map((discussion) => {\n if (discussion.id === id) {\n return { ...discussion, isResolved: true };\n }\n return discussion;\n });\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n };\n\n const removeDiscussion = async (id: string) => {\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .filter((discussion) => discussion.id !== id);\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n };\n\n const updateComment = async (input: {\n id: string;\n contentRich: Value;\n discussionId: string;\n isEdited: boolean;\n }) => {\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .map((discussion) => {\n if (discussion.id === input.discussionId) {\n const updatedComments = discussion.comments.map((comment) => {\n if (comment.id === input.id) {\n return {\n ...comment,\n contentRich: input.contentRich,\n isEdited: true,\n updatedAt: new Date(),\n };\n }\n return comment;\n });\n return { ...discussion, comments: updatedComments };\n }\n return discussion;\n });\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n };\n\n const { tf } = useEditorPlugin(CommentPlugin);\n\n // Replace to your own backend or refer to potion\n const isMyComment = currentUserId === comment.userId;\n\n const initialValue = comment.contentRich;\n\n const commentEditor = useCommentEditor(\n {\n id: comment.id,\n value: initialValue,\n },\n [initialValue]\n );\n\n const onCancel = () => {\n setEditingId(null);\n commentEditor.tf.replaceNodes(initialValue, {\n at: [],\n children: true,\n });\n };\n\n const onSave = () => {\n void updateComment({\n id: comment.id,\n contentRich: commentEditor.children,\n discussionId: comment.discussionId,\n isEdited: true,\n });\n setEditingId(null);\n };\n\n const onResolveComment = () => {\n void resolveDiscussion(comment.discussionId);\n tf.comment.unsetMark({ id: comment.discussionId });\n };\n\n const isFirst = index === 0;\n const isLast = index === discussionLength - 1;\n const isEditing = editingId && editingId === comment.id;\n\n const [hovering, setHovering] = React.useState(false);\n const [dropdownOpen, setDropdownOpen] = React.useState(false);\n\n return (\n <div\n onMouseEnter={() => setHovering(true)}\n onMouseLeave={() => setHovering(false)}\n >\n <div className=\"relative flex items-center\">\n <Avatar className=\"size-5\">\n <AvatarImage alt={userInfo?.name} src={userInfo?.avatarUrl} />\n <AvatarFallback>{userInfo?.name?.[0]}</AvatarFallback>\n </Avatar>\n <h4 className=\"mx-2 font-semibold text-sm leading-none\">\n {/* Replace to your own backend or refer to potion */}\n {userInfo?.name}\n </h4>\n\n <div className=\"text-muted-foreground/80 text-xs leading-none\">\n <span className=\"mr-1\">\n {formatCommentDate(new Date(comment.createdAt))}\n </span>\n {comment.isEdited && <span>(edited)</span>}\n </div>\n\n {isMyComment && (hovering || dropdownOpen) && (\n <div className=\"absolute top-0 right-0 flex space-x-1\">\n {index === 0 && (\n <Button\n variant=\"ghost\"\n className=\"h-6 p-1 text-muted-foreground\"\n onClick={onResolveComment}\n type=\"button\"\n >\n <CheckIcon className=\"size-4\" />\n </Button>\n )}\n\n <CommentMoreDropdown\n onCloseAutoFocus={() => {\n setTimeout(() => {\n commentEditor.tf.focus({ edge: 'endEditor' });\n }, 0);\n }}\n onRemoveComment={() => {\n if (discussionLength === 1) {\n tf.comment.unsetMark({ id: comment.discussionId });\n void removeDiscussion(comment.discussionId);\n }\n }}\n comment={comment}\n dropdownOpen={dropdownOpen}\n setDropdownOpen={setDropdownOpen}\n setEditingId={setEditingId}\n />\n </div>\n )}\n </div>\n\n {isFirst && showDocumentContent && (\n <div className=\"relative mt-1 flex pl-[32px] text-sm text-subtle-foreground\">\n {discussionLength > 1 && (\n <div className=\"absolute top-[5px] left-3 h-full w-0.5 shrink-0 bg-muted\" />\n )}\n <div className=\"my-px w-0.5 shrink-0 bg-highlight\" />\n {documentContent && <div className=\"ml-2\">{documentContent}</div>}\n </div>\n )}\n\n <div className=\"relative my-1 pl-[26px]\">\n {!isLast && (\n <div className=\"absolute top-0 left-3 h-full w-0.5 shrink-0 bg-muted\" />\n )}\n <Plate readOnly={!isEditing} editor={commentEditor}>\n <EditorContainer variant=\"comment\">\n <Editor\n variant=\"comment\"\n className=\"w-auto grow\"\n onClick={() => onEditorClick?.()}\n />\n\n {isEditing && (\n <div className=\"ml-auto flex shrink-0 gap-1\">\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-[28px]\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n void onCancel();\n }}\n >\n <div className=\"flex size-5 shrink-0 items-center justify-center rounded-[50%] bg-primary/40\">\n <XIcon className=\"size-3 stroke-[3px] text-background\" />\n </div>\n </Button>\n\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n void onSave();\n }}\n >\n <div className=\"flex size-5 shrink-0 items-center justify-center rounded-[50%] bg-brand\">\n <CheckIcon className=\"size-3 stroke-[3px] text-background\" />\n </div>\n </Button>\n </div>\n )}\n </EditorContainer>\n </Plate>\n </div>\n </div>\n );\n}\n\nfunction CommentMoreDropdown(props: {\n comment: TComment;\n dropdownOpen: boolean;\n setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;\n setEditingId: React.Dispatch<React.SetStateAction<string | null>>;\n onCloseAutoFocus?: () => void;\n onRemoveComment?: () => void;\n}) {\n const {\n comment,\n dropdownOpen,\n setDropdownOpen,\n setEditingId,\n onCloseAutoFocus,\n onRemoveComment,\n } = props;\n\n const editor = useEditorRef();\n\n const selectedEditCommentRef = React.useRef<boolean>(false);\n\n const onDeleteComment = React.useCallback(() => {\n if (!comment.id)\n return alert('You are operating too quickly, please try again later.');\n\n // Find and update the discussion\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .map((discussion) => {\n if (discussion.id !== comment.discussionId) {\n return discussion;\n }\n\n const commentIndex = discussion.comments.findIndex(\n (c) => c.id === comment.id\n );\n if (commentIndex === -1) {\n return discussion;\n }\n\n return {\n ...discussion,\n comments: [\n ...discussion.comments.slice(0, commentIndex),\n ...discussion.comments.slice(commentIndex + 1),\n ],\n };\n });\n\n // Save back to session storage\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n onRemoveComment?.();\n }, [comment.discussionId, comment.id, editor, onRemoveComment]);\n\n const onEditComment = React.useCallback(() => {\n selectedEditCommentRef.current = true;\n\n if (!comment.id)\n return alert('You are operating too quickly, please try again later.');\n\n setEditingId(comment.id);\n }, [comment.id, setEditingId]);\n\n return (\n <DropdownMenu\n open={dropdownOpen}\n onOpenChange={setDropdownOpen}\n modal={false}\n >\n <DropdownMenuTrigger asChild onClick={(e) => e.stopPropagation()}>\n <Button variant=\"ghost\" className={cn('h-6 p-1 text-muted-foreground')}>\n <MoreHorizontalIcon className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-48\"\n onCloseAutoFocus={(e) => {\n if (selectedEditCommentRef.current) {\n onCloseAutoFocus?.();\n selectedEditCommentRef.current = false;\n }\n\n return e.preventDefault();\n }}\n >\n <DropdownMenuGroup>\n <DropdownMenuItem onClick={onEditComment}>\n <PencilIcon className=\"size-4\" />\n Edit comment\n </DropdownMenuItem>\n <DropdownMenuItem onClick={onDeleteComment}>\n <TrashIcon className=\"size-4\" />\n Delete comment\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nconst useCommentEditor = (\n options: Omit<CreatePlateEditorOptions, 'plugins'> = {},\n deps: any[] = []\n) => {\n const commentEditor = usePlateEditor(\n {\n id: 'comment',\n plugins: BasicMarksKit,\n value: [],\n ...options,\n },\n deps\n );\n\n return commentEditor;\n};\n\nexport function CommentCreateForm({\n autoFocus = false,\n className,\n discussionId: discussionIdProp,\n focusOnMount = false,\n}: {\n autoFocus?: boolean;\n className?: string;\n discussionId?: string;\n focusOnMount?: boolean;\n}) {\n const discussions = usePluginOption(discussionPlugin, 'discussions');\n\n const editor = useEditorRef();\n const commentId = useCommentId();\n const discussionId = discussionIdProp ?? commentId;\n\n const userInfo = usePluginOption(discussionPlugin, 'currentUser');\n const [commentValue, setCommentValue] = React.useState<Value | undefined>();\n const commentContent = React.useMemo(\n () =>\n commentValue\n ? NodeApi.string({ children: commentValue, type: KEYS.p })\n : '',\n [commentValue]\n );\n const commentEditor = useCommentEditor();\n\n React.useEffect(() => {\n if (commentEditor && focusOnMount) {\n commentEditor.tf.focus();\n }\n }, [commentEditor, focusOnMount]);\n\n const onAddComment = React.useCallback(async () => {\n if (!commentValue) return;\n\n commentEditor.tf.reset();\n\n if (discussionId) {\n // Get existing discussion\n const discussion = discussions.find((d) => d.id === discussionId);\n if (!discussion) {\n // Mock creating suggestion\n const newDiscussion: TDiscussion = {\n id: discussionId,\n comments: [\n {\n id: nanoid(),\n contentRich: commentValue,\n createdAt: new Date(),\n discussionId,\n isEdited: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n },\n ],\n createdAt: new Date(),\n isResolved: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n };\n\n editor.setOption(discussionPlugin, 'discussions', [\n ...discussions,\n newDiscussion,\n ]);\n return;\n }\n\n // Create reply comment\n const comment: TComment = {\n id: nanoid(),\n contentRich: commentValue,\n createdAt: new Date(),\n discussionId,\n isEdited: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n };\n\n // Add reply to discussion comments\n const updatedDiscussion = {\n ...discussion,\n comments: [...discussion.comments, comment],\n };\n\n // Filter out old discussion and add updated one\n const updatedDiscussions = discussions\n .filter((d) => d.id !== discussionId)\n .concat(updatedDiscussion);\n\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n\n return;\n }\n\n const commentsNodeEntry = editor\n .getApi(CommentPlugin)\n .comment.nodes({ at: [], isDraft: true });\n\n if (commentsNodeEntry.length === 0) return;\n\n const documentContent = commentsNodeEntry\n .map(([node]) => node.text)\n .join('');\n\n const _discussionId = nanoid();\n // Mock creating new discussion\n const newDiscussion: TDiscussion = {\n id: _discussionId,\n comments: [\n {\n id: nanoid(),\n contentRich: commentValue,\n createdAt: new Date(),\n discussionId: _discussionId,\n isEdited: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n },\n ],\n createdAt: new Date(),\n documentContent,\n isResolved: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n };\n\n editor.setOption(discussionPlugin, 'discussions', [\n ...discussions,\n newDiscussion,\n ]);\n\n const id = newDiscussion.id;\n\n commentsNodeEntry.forEach(([, path]) => {\n editor.tf.setNodes(\n {\n [getCommentKey(id)]: true,\n },\n { at: path, split: true }\n );\n editor.tf.unsetNodes([getDraftCommentKey()], { at: path });\n });\n }, [commentValue, commentEditor.tf, discussionId, editor, discussions]);\n\n return (\n <div className={cn('flex w-full', className)}>\n <div className=\"mt-2 mr-1 shrink-0\">\n {/* Replace to your own backend or refer to potion */}\n <Avatar className=\"size-5\">\n <AvatarImage alt={userInfo?.name} src={userInfo?.avatarUrl} />\n <AvatarFallback>{userInfo?.name?.[0]}</AvatarFallback>\n </Avatar>\n </div>\n\n <div className=\"relative flex grow gap-2\">\n <Plate\n onChange={({ value }) => {\n setCommentValue(value);\n }}\n editor={commentEditor}\n >\n <EditorContainer variant=\"comment\">\n <Editor\n variant=\"comment\"\n className=\"min-h-[25px] grow pt-0.5 pr-8\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n onAddComment();\n }\n }}\n placeholder=\"Reply...\"\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"absolute right-0.5 bottom-0.5 ml-auto size-6 shrink-0\"\n disabled={commentContent.trim().length === 0}\n onClick={(e) => {\n e.stopPropagation();\n onAddComment();\n }}\n >\n <div className=\"flex size-6 items-center justify-center rounded-full\">\n <ArrowUpIcon />\n </div>\n </Button>\n </EditorContainer>\n </Plate>\n </div>\n </div>\n );\n}\n\nexport const formatCommentDate = (date: Date) => {\n const now = new Date();\n const diffMinutes = differenceInMinutes(now, date);\n const diffHours = differenceInHours(now, date);\n const diffDays = differenceInDays(now, date);\n\n if (diffMinutes < 60) {\n return `${diffMinutes}m`;\n }\n if (diffHours < 24) {\n return `${diffHours}h`;\n }\n if (diffDays < 2) {\n return `${diffDays}d`;\n }\n\n return format(date, 'MM/dd/yyyy');\n};\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TResolvedSuggestion } from '@platejs/suggestion';\n\nimport {\n acceptSuggestion,\n getSuggestionKey,\n keyId2SuggestionId,\n rejectSuggestion,\n} from '@platejs/suggestion';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport { CheckIcon, XIcon } from 'lucide-react';\nimport {\n type NodeEntry,\n type Path,\n type TElement,\n type TSuggestionText,\n ElementApi,\n KEYS,\n PathApi,\n TextApi,\n} from 'platejs';\nimport { useEditorPlugin, usePluginOption } from 'platejs/react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';\nimport { Button } from '@/components/ui/button';\nimport {\n type TDiscussion,\n discussionPlugin,\n} from '@/components/editor/plugins/discussion-kit';\nimport { suggestionPlugin } from '@/components/editor/plugins/suggestion-kit';\n\nimport {\n type TComment,\n Comment,\n CommentCreateForm,\n formatCommentDate,\n} from './comment';\n\nexport interface ResolvedSuggestion extends TResolvedSuggestion {\n comments: TComment[];\n}\n\nconst BLOCK_SUGGESTION = '__block__';\n\nconst TYPE_TEXT_MAP: Record<string, (node?: TElement) => string> = {\n [KEYS.audio]: () => 'Audio',\n [KEYS.blockquote]: () => 'Blockquote',\n [KEYS.callout]: () => 'Callout',\n [KEYS.codeBlock]: () => 'Code Block',\n [KEYS.column]: () => 'Column',\n [KEYS.equation]: () => 'Equation',\n [KEYS.file]: () => 'File',\n [KEYS.h1]: () => 'Heading 1',\n [KEYS.h2]: () => 'Heading 2',\n [KEYS.h3]: () => 'Heading 3',\n [KEYS.h4]: () => 'Heading 4',\n [KEYS.h5]: () => 'Heading 5',\n [KEYS.h6]: () => 'Heading 6',\n [KEYS.hr]: () => 'Horizontal Rule',\n [KEYS.img]: () => 'Image',\n [KEYS.mediaEmbed]: () => 'Media',\n [KEYS.p]: (node) => {\n if (node?.[KEYS.listType] === KEYS.listTodo) return 'Todo List';\n if (node?.[KEYS.listType] === KEYS.ol) return 'Ordered List';\n if (node?.[KEYS.listType] === KEYS.ul) return 'List';\n\n return 'Paragraph';\n },\n [KEYS.table]: () => 'Table',\n [KEYS.toc]: () => 'Table of Contents',\n [KEYS.toggle]: () => 'Toggle',\n [KEYS.video]: () => 'Video',\n};\n\nexport function BlockSuggestionCard({\n idx,\n isLast,\n suggestion,\n}: {\n idx: number;\n isLast: boolean;\n suggestion: ResolvedSuggestion;\n}) {\n const { api, editor } = useEditorPlugin(SuggestionPlugin);\n\n const userInfo = usePluginOption(discussionPlugin, 'user', suggestion.userId);\n\n const accept = (suggestion: ResolvedSuggestion) => {\n api.suggestion.withoutSuggestions(() => {\n acceptSuggestion(editor, suggestion);\n });\n };\n\n const reject = (suggestion: ResolvedSuggestion) => {\n api.suggestion.withoutSuggestions(() => {\n rejectSuggestion(editor, suggestion);\n });\n };\n\n const [hovering, setHovering] = React.useState(false);\n\n const suggestionText2Array = (text: string) => {\n if (text === BLOCK_SUGGESTION) return ['line breaks'];\n\n return text.split(BLOCK_SUGGESTION).filter(Boolean);\n };\n\n const [editingId, setEditingId] = React.useState<string | null>(null);\n\n return (\n <div\n key={`${suggestion.suggestionId}-${idx}`}\n className=\"relative\"\n onMouseEnter={() => setHovering(true)}\n onMouseLeave={() => setHovering(false)}\n >\n <div className=\"flex flex-col p-4\">\n <div className=\"relative flex items-center\">\n {/* Replace to your own backend or refer to potion */}\n <Avatar className=\"size-5\">\n <AvatarImage alt={userInfo?.name} src={userInfo?.avatarUrl} />\n <AvatarFallback>{userInfo?.name?.[0]}</AvatarFallback>\n </Avatar>\n <h4 className=\"mx-2 font-semibold text-sm leading-none\">\n {userInfo?.name}\n </h4>\n <div className=\"text-muted-foreground/80 text-xs leading-none\">\n <span className=\"mr-1\">\n {formatCommentDate(new Date(suggestion.createdAt))}\n </span>\n </div>\n </div>\n\n <div className=\"relative mt-1 mb-4 pl-[32px]\">\n <div className=\"flex flex-col gap-2\">\n {suggestion.type === 'remove' &&\n suggestionText2Array(suggestion.text!).map((text, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n <span className=\"text-muted-foreground text-sm\">Delete:</span>\n\n <span key={index} className=\"text-sm\">\n {text}\n </span>\n </div>\n ))}\n\n {suggestion.type === 'insert' &&\n suggestionText2Array(suggestion.newText!).map((text, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n <span className=\"text-muted-foreground text-sm\">Add:</span>\n\n <span key={index} className=\"text-sm\">\n {text || 'line breaks'}\n </span>\n </div>\n ))}\n\n {suggestion.type === 'replace' && (\n <div className=\"flex flex-col gap-2\">\n {suggestionText2Array(suggestion.newText!).map(\n (text, index) => (\n <React.Fragment key={index}>\n <div\n key={index}\n className=\"flex items-start gap-2 text-brand/80\"\n >\n <span className=\"text-sm\">with:</span>\n <span className=\"text-sm\">{text || 'line breaks'}</span>\n </div>\n </React.Fragment>\n )\n )}\n\n {suggestionText2Array(suggestion.text!).map((text, index) => (\n <React.Fragment key={index}>\n <div key={index} className=\"flex items-start gap-2\">\n <span className=\"text-muted-foreground text-sm\">\n {index === 0 ? 'Replace:' : 'Delete:'}\n </span>\n <span className=\"text-sm\">{text || 'line breaks'}</span>\n </div>\n </React.Fragment>\n ))}\n </div>\n )}\n\n {suggestion.type === 'update' && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-muted-foreground text-sm\">\n {Object.keys(suggestion.properties).map((key) => (\n <span key={key}>Un{key}</span>\n ))}\n\n {Object.keys(suggestion.newProperties).map((key) => (\n <span key={key}>\n {key.charAt(0).toUpperCase() + key.slice(1)}\n </span>\n ))}\n </span>\n <span className=\"text-sm\">{suggestion.newText}</span>\n </div>\n )}\n </div>\n </div>\n\n {suggestion.comments.map((comment, index) => (\n <Comment\n key={comment.id ?? index}\n comment={comment}\n discussionLength={suggestion.comments.length}\n documentContent=\"__suggestion__\"\n editingId={editingId}\n index={index}\n setEditingId={setEditingId}\n />\n ))}\n\n {hovering && (\n <div className=\"absolute top-4 right-4 flex gap-2\">\n <Button\n variant=\"ghost\"\n className=\"size-6 p-1 text-muted-foreground\"\n onClick={() => accept(suggestion)}\n >\n <CheckIcon className=\"size-4\" />\n </Button>\n\n <Button\n variant=\"ghost\"\n className=\"size-6 p-1 text-muted-foreground\"\n onClick={() => reject(suggestion)}\n >\n <XIcon className=\"size-4\" />\n </Button>\n </div>\n )}\n\n <CommentCreateForm discussionId={suggestion.suggestionId} />\n </div>\n\n {!isLast && <div className=\"h-px w-full bg-muted\" />}\n </div>\n );\n}\n\nexport const useResolveSuggestion = (\n suggestionNodes: NodeEntry<TElement | TSuggestionText>[],\n blockPath: Path\n) => {\n const discussions = usePluginOption(discussionPlugin, 'discussions');\n\n const { api, editor, getOption, setOption } =\n useEditorPlugin(suggestionPlugin);\n\n suggestionNodes.forEach(([node]) => {\n const id = api.suggestion.nodeId(node);\n const map = getOption('uniquePathMap');\n\n if (!id) return;\n\n const previousPath = map.get(id);\n\n // If there are no suggestion nodes in the corresponding path in the map, then update it.\n if (PathApi.isPath(previousPath)) {\n const nodes = api.suggestion.node({ id, at: previousPath, isText: true });\n const parentNode = api.node(previousPath);\n let lineBreakId: string | null = null;\n\n if (parentNode && ElementApi.isElement(parentNode[0])) {\n lineBreakId = api.suggestion.nodeId(parentNode[0]) ?? null;\n }\n\n if (!nodes && lineBreakId !== id) {\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n }\n } else {\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n }\n });\n\n const resolvedSuggestion: ResolvedSuggestion[] = React.useMemo(() => {\n const map = getOption('uniquePathMap');\n\n if (suggestionNodes.length === 0) return [];\n\n const suggestionIds = new Set(\n suggestionNodes\n .flatMap(([node]) => {\n if (TextApi.isText(node)) {\n const dataList = api.suggestion.dataList(node);\n const includeUpdate = dataList.some(\n (data) => data.type === 'update'\n );\n\n if (!includeUpdate) {\n return api.suggestion.nodeId(node) ?? [];\n }\n\n return dataList\n .filter((data) => data.type === 'update')\n .map((d) => d.id);\n }\n if (ElementApi.isElement(node)) {\n return api.suggestion.nodeId(node) ?? [];\n }\n\n return [];\n })\n .filter(Boolean)\n );\n\n const res: ResolvedSuggestion[] = [];\n\n suggestionIds.forEach((id) => {\n if (!id) return;\n\n const path = map.get(id);\n\n if (!path || !PathApi.isPath(path)) return;\n if (!PathApi.equals(path, blockPath)) return;\n\n const entries = [\n ...editor.api.nodes<TElement | TSuggestionText>({\n at: [],\n mode: 'all',\n match: (n) =>\n (n[KEYS.suggestion] && n[getSuggestionKey(id)]) ||\n api.suggestion.nodeId(n as TElement) === id,\n }),\n ];\n\n // move line break to the end\n entries.sort(([, path1], [, path2]) =>\n PathApi.isChild(path1, path2) ? -1 : 1\n );\n\n let newText = '';\n let text = '';\n let properties: any = {};\n let newProperties: any = {};\n\n // overlapping suggestion\n entries.forEach(([node]) => {\n if (TextApi.isText(node)) {\n const dataList = api.suggestion.dataList(node);\n\n dataList.forEach((data) => {\n if (data.id === id) {\n switch (data.type) {\n case 'insert': {\n newText += node.text;\n\n break;\n }\n case 'remove': {\n text += node.text;\n\n break;\n }\n case 'update': {\n properties = {\n ...properties,\n ...data.properties,\n };\n\n newProperties = {\n ...newProperties,\n ...data.newProperties,\n };\n\n newText += node.text;\n\n break;\n }\n // No default\n }\n }\n });\n } else {\n const lineBreakData = api.suggestion.isBlockSuggestion(node)\n ? node.suggestion\n : undefined;\n\n if (lineBreakData?.id === keyId2SuggestionId(id)) {\n if (lineBreakData.type === 'insert') {\n newText += lineBreakData.isLineBreak\n ? BLOCK_SUGGESTION\n : BLOCK_SUGGESTION + TYPE_TEXT_MAP[node.type](node);\n } else if (lineBreakData.type === 'remove') {\n text += lineBreakData.isLineBreak\n ? BLOCK_SUGGESTION\n : BLOCK_SUGGESTION + TYPE_TEXT_MAP[node.type](node);\n }\n }\n }\n });\n\n if (entries.length === 0) return;\n\n const nodeData = api.suggestion.suggestionData(entries[0][0]);\n\n if (!nodeData) return;\n\n // const comments = data?.discussions.find((d) => d.id === id)?.comments;\n const comments =\n discussions.find((s: TDiscussion) => s.id === id)?.comments || [];\n const createdAt = new Date(nodeData.createdAt);\n\n const keyId = getSuggestionKey(id);\n\n if (nodeData.type === 'update') {\n res.push({\n comments,\n createdAt,\n keyId,\n newProperties,\n newText,\n properties,\n suggestionId: keyId2SuggestionId(id),\n type: 'update',\n userId: nodeData.userId,\n });\n } else if (newText.length > 0 && text.length > 0) {\n res.push({\n comments,\n createdAt,\n keyId,\n newText,\n suggestionId: keyId2SuggestionId(id),\n text,\n type: 'replace',\n userId: nodeData.userId,\n });\n } else if (newText.length > 0) {\n res.push({\n comments,\n createdAt,\n keyId,\n newText,\n suggestionId: keyId2SuggestionId(id),\n type: 'insert',\n userId: nodeData.userId,\n });\n } else if (text.length > 0) {\n res.push({\n comments,\n createdAt,\n keyId,\n suggestionId: keyId2SuggestionId(id),\n text,\n type: 'remove',\n userId: nodeData.userId,\n });\n }\n });\n\n return res;\n }, [\n api.suggestion,\n blockPath,\n discussions,\n editor.api,\n getOption,\n suggestionNodes,\n ]);\n\n return resolvedSuggestion;\n};\n\nexport const isResolvedSuggestion = (\n suggestion: ResolvedSuggestion | TDiscussion\n): suggestion is ResolvedSuggestion => 'suggestionId' in suggestion;\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps, RenderNodeWrapper } from 'platejs/react';\n\nimport { getDraftCommentKey } from '@platejs/comment';\nimport { CommentPlugin } from '@platejs/comment/react';\nimport { getTransientSuggestionKey } from '@platejs/suggestion';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport {\n MessageSquareTextIcon,\n MessagesSquareIcon,\n PencilLineIcon,\n} from 'lucide-react';\nimport {\n type AnyPluginConfig,\n type NodeEntry,\n type Path,\n type TCommentText,\n type TElement,\n type TSuggestionText,\n PathApi,\n TextApi,\n} from 'platejs';\nimport { useEditorPlugin, useEditorRef, usePluginOption } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { commentPlugin } from '@/components/editor/plugins/comment-kit';\nimport {\n type TDiscussion,\n discussionPlugin,\n} from '@/components/editor/plugins/discussion-kit';\nimport { suggestionPlugin } from '@/components/editor/plugins/suggestion-kit';\n\nimport {\n BlockSuggestionCard,\n isResolvedSuggestion,\n useResolveSuggestion,\n} from './block-suggestion';\nimport { Comment, CommentCreateForm } from './comment';\n\nexport const BlockDiscussion: RenderNodeWrapper<AnyPluginConfig> = (props) => {\n const { editor, element } = props;\n\n const commentsApi = editor.getApi(CommentPlugin).comment;\n const blockPath = editor.api.findPath(element);\n\n // avoid duplicate in table or column\n if (!blockPath || blockPath.length > 1) return;\n\n const draftCommentNode = commentsApi.node({ at: blockPath, isDraft: true });\n\n const commentNodes = [...commentsApi.nodes({ at: blockPath })];\n\n const suggestionNodes = [\n ...editor.getApi(SuggestionPlugin).suggestion.nodes({ at: blockPath }),\n ].filter(([node]) => !node[getTransientSuggestionKey()]);\n\n if (\n commentNodes.length === 0 &&\n suggestionNodes.length === 0 &&\n !draftCommentNode\n ) {\n return;\n }\n\n return (props) => (\n <BlockCommentContent\n blockPath={blockPath}\n commentNodes={commentNodes}\n draftCommentNode={draftCommentNode}\n suggestionNodes={suggestionNodes}\n {...props}\n />\n );\n};\n\nconst BlockCommentContent = ({\n blockPath,\n children,\n commentNodes,\n draftCommentNode,\n suggestionNodes,\n}: PlateElementProps & {\n blockPath: Path;\n commentNodes: NodeEntry<TCommentText>[];\n draftCommentNode: NodeEntry<TCommentText> | undefined;\n suggestionNodes: NodeEntry<TElement | TSuggestionText>[];\n}) => {\n const editor = useEditorRef();\n const resolvedSuggestions = useResolveSuggestion(suggestionNodes, blockPath);\n const resolvedDiscussions = useResolvedDiscussion(commentNodes, blockPath);\n\n const suggestionsCount = resolvedSuggestions.length;\n const discussionsCount = resolvedDiscussions.length;\n const totalCount = suggestionsCount + discussionsCount;\n\n const activeSuggestionId = usePluginOption(suggestionPlugin, 'activeId');\n const activeSuggestion =\n activeSuggestionId &&\n resolvedSuggestions.find((s) => s.suggestionId === activeSuggestionId);\n\n const commentingBlock = usePluginOption(commentPlugin, 'commentingBlock');\n const activeCommentId = usePluginOption(commentPlugin, 'activeId');\n const isCommenting = activeCommentId === getDraftCommentKey();\n const activeDiscussion =\n activeCommentId &&\n resolvedDiscussions.find((d) => d.id === activeCommentId);\n\n const noneActive = !activeSuggestion && !activeDiscussion;\n\n const sortedMergedData = [\n ...resolvedDiscussions,\n ...resolvedSuggestions,\n ].sort((a, b) => a.createdAt.getTime() - b.createdAt.getTime());\n\n const selected =\n resolvedDiscussions.some((d) => d.id === activeCommentId) ||\n resolvedSuggestions.some((s) => s.suggestionId === activeSuggestionId);\n\n const [_open, setOpen] = React.useState(selected);\n\n // in some cases, we may comment the multiple blocks\n const commentingCurrent =\n !!commentingBlock && PathApi.equals(blockPath, commentingBlock);\n\n const open =\n _open ||\n selected ||\n (isCommenting && !!draftCommentNode && commentingCurrent);\n\n const anchorElement = React.useMemo(() => {\n let activeNode: NodeEntry | undefined;\n\n if (activeSuggestion) {\n activeNode = suggestionNodes.find(\n ([node]) =>\n TextApi.isText(node) &&\n editor.getApi(SuggestionPlugin).suggestion.nodeId(node) ===\n activeSuggestion.suggestionId\n );\n }\n\n if (activeCommentId) {\n if (activeCommentId === getDraftCommentKey()) {\n activeNode = draftCommentNode;\n } else {\n activeNode = commentNodes.find(\n ([node]) =>\n editor.getApi(commentPlugin).comment.nodeId(node) ===\n activeCommentId\n );\n }\n }\n\n if (!activeNode) return null;\n\n return editor.api.toDOMNode(activeNode[0])!;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open,\n activeSuggestion,\n activeCommentId,\n editor.api,\n suggestionNodes,\n draftCommentNode,\n commentNodes,\n ]);\n\n if (suggestionsCount + resolvedDiscussions.length === 0 && !draftCommentNode)\n return <div className=\"w-full\">{children}</div>;\n\n return (\n <div className=\"flex w-full justify-between\">\n <Popover\n open={open}\n onOpenChange={(_open_) => {\n if (!_open_ && isCommenting && draftCommentNode) {\n editor.tf.unsetNodes(getDraftCommentKey(), {\n at: [],\n mode: 'lowest',\n match: (n) => n[getDraftCommentKey()],\n });\n }\n setOpen(_open_);\n }}\n >\n <div className=\"w-full\">{children}</div>\n {anchorElement && (\n <PopoverAnchor\n asChild\n className=\"w-full\"\n virtualRef={{ current: anchorElement }}\n />\n )}\n\n <PopoverContent\n className=\"max-h-[min(50dvh,calc(-24px+var(--radix-popper-available-height)))] w-[380px] min-w-[130px] max-w-[calc(100vw-24px)] overflow-y-auto p-0 data-[state=closed]:opacity-0\"\n onCloseAutoFocus={(e) => e.preventDefault()}\n onOpenAutoFocus={(e) => e.preventDefault()}\n align=\"center\"\n side=\"bottom\"\n >\n {isCommenting ? (\n <CommentCreateForm className=\"p-4\" focusOnMount />\n ) : noneActive ? (\n sortedMergedData.map((item, index) =>\n isResolvedSuggestion(item) ? (\n <BlockSuggestionCard\n key={item.suggestionId}\n idx={index}\n isLast={index === sortedMergedData.length - 1}\n suggestion={item}\n />\n ) : (\n <BlockComment\n key={item.id}\n discussion={item}\n isLast={index === sortedMergedData.length - 1}\n />\n )\n )\n ) : (\n <>\n {activeSuggestion && (\n <BlockSuggestionCard\n key={activeSuggestion.suggestionId}\n idx={0}\n isLast={true}\n suggestion={activeSuggestion}\n />\n )}\n\n {activeDiscussion && (\n <BlockComment discussion={activeDiscussion} isLast={true} />\n )}\n </>\n )}\n </PopoverContent>\n\n {totalCount > 0 && (\n <div className=\"relative left-0 size-0 select-none\">\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n className=\"!px-1.5 mt-1 ml-1 flex h-6 gap-1 py-0 text-muted-foreground/80 hover:text-muted-foreground/80 data-[active=true]:bg-muted\"\n data-active={open}\n contentEditable={false}\n >\n {suggestionsCount > 0 && discussionsCount === 0 && (\n <PencilLineIcon className=\"size-4 shrink-0\" />\n )}\n\n {suggestionsCount === 0 && discussionsCount > 0 && (\n <MessageSquareTextIcon className=\"size-4 shrink-0\" />\n )}\n\n {suggestionsCount > 0 && discussionsCount > 0 && (\n <MessagesSquareIcon className=\"size-4 shrink-0\" />\n )}\n\n <span className=\"font-semibold text-xs\">{totalCount}</span>\n </Button>\n </PopoverTrigger>\n </div>\n )}\n </Popover>\n </div>\n );\n};\n\nfunction BlockComment({\n discussion,\n isLast,\n}: {\n discussion: TDiscussion;\n isLast: boolean;\n}) {\n const [editingId, setEditingId] = React.useState<string | null>(null);\n\n return (\n <React.Fragment key={discussion.id}>\n <div className=\"p-4\">\n {discussion.comments.map((comment, index) => (\n <Comment\n key={comment.id ?? index}\n comment={comment}\n discussionLength={discussion.comments.length}\n documentContent={discussion?.documentContent}\n editingId={editingId}\n index={index}\n setEditingId={setEditingId}\n showDocumentContent\n />\n ))}\n <CommentCreateForm discussionId={discussion.id} />\n </div>\n\n {!isLast && <div className=\"h-px w-full bg-muted\" />}\n </React.Fragment>\n );\n}\n\nconst useResolvedDiscussion = (\n commentNodes: NodeEntry<TCommentText>[],\n blockPath: Path\n) => {\n const { api, getOption, setOption } = useEditorPlugin(commentPlugin);\n\n const discussions = usePluginOption(discussionPlugin, 'discussions');\n\n commentNodes.forEach(([node]) => {\n const id = api.comment.nodeId(node);\n const map = getOption('uniquePathMap');\n\n if (!id) return;\n\n const previousPath = map.get(id);\n\n // If there are no comment nodes in the corresponding path in the map, then update it.\n if (PathApi.isPath(previousPath)) {\n const nodes = api.comment.node({ id, at: previousPath });\n\n if (!nodes) {\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n return;\n }\n\n return;\n }\n // TODO: fix throw error\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n });\n\n const commentsIds = new Set(\n commentNodes.map(([node]) => api.comment.nodeId(node)).filter(Boolean)\n );\n\n const resolvedDiscussions = discussions\n .map((d: TDiscussion) => ({\n ...d,\n createdAt: new Date(d.createdAt),\n }))\n .filter((item: TDiscussion) => {\n /** If comment cross blocks just show it in the first block */\n const commentsPathMap = getOption('uniquePathMap');\n const firstBlockPath = commentsPathMap.get(item.id);\n\n if (!firstBlockPath) return false;\n if (!PathApi.equals(firstBlockPath, blockPath)) return false;\n\n return (\n api.comment.has({ id: item.id }) &&\n commentsIds.has(item.id) &&\n !item.isResolved\n );\n });\n\n return resolvedDiscussions;\n};\n","'use client';\n\nimport type { TComment } from '@/components/ui/comment';\n\nimport { createPlatePlugin } from 'platejs/react';\n\nimport { BlockDiscussion } from '@/components/ui/block-discussion';\n\nexport type TDiscussion = {\n id: string;\n comments: TComment[];\n createdAt: Date;\n isResolved: boolean;\n userId: string;\n documentContent?: string;\n};\n\nconst discussionsData: TDiscussion[] = [\n {\n id: 'discussion1',\n comments: [\n {\n id: 'comment1',\n contentRich: [\n {\n children: [\n {\n text: 'Comments are a great way to provide feedback and discuss changes.',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 600_000),\n discussionId: 'discussion1',\n isEdited: false,\n userId: 'charlie',\n },\n {\n id: 'comment2',\n contentRich: [\n {\n children: [\n {\n text: 'Agreed! The link to the docs makes it easy to learn more.',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 500_000),\n discussionId: 'discussion1',\n isEdited: false,\n userId: 'bob',\n },\n ],\n createdAt: new Date(),\n documentContent: 'comments',\n isResolved: false,\n userId: 'charlie',\n },\n {\n id: 'discussion2',\n comments: [\n {\n id: 'comment1',\n contentRich: [\n {\n children: [\n {\n text: 'Nice demonstration of overlapping annotations with both comments and suggestions!',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 300_000),\n discussionId: 'discussion2',\n isEdited: false,\n userId: 'bob',\n },\n {\n id: 'comment2',\n contentRich: [\n {\n children: [\n {\n text: 'This helps users understand how powerful the editor can be.',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 200_000),\n discussionId: 'discussion2',\n isEdited: false,\n userId: 'charlie',\n },\n ],\n createdAt: new Date(),\n documentContent: 'overlapping',\n isResolved: false,\n userId: 'bob',\n },\n];\n\nconst avatarUrl = (seed: string) =>\n `https://api.dicebear.com/9.x/glass/svg?seed=${seed}`;\n\nconst usersData: Record<\n string,\n { id: string; avatarUrl: string; name: string; hue?: number }\n> = {\n alice: {\n id: 'alice',\n avatarUrl: avatarUrl('alice6'),\n name: 'Alice',\n },\n bob: {\n id: 'bob',\n avatarUrl: avatarUrl('bob4'),\n name: 'Bob',\n },\n charlie: {\n id: 'charlie',\n avatarUrl: avatarUrl('charlie2'),\n name: 'Charlie',\n },\n};\n\n// This plugin is purely UI. It's only used to store the discussions and users data\nexport const discussionPlugin = createPlatePlugin({\n key: 'discussion',\n options: {\n currentUserId: 'alice',\n discussions: discussionsData,\n users: usersData,\n },\n})\n .configure({\n render: { aboveNodes: BlockDiscussion },\n })\n .extendSelectors(({ getOption }) => ({\n currentUser: () => getOption('users')[getOption('currentUserId')],\n user: (id: string) => getOption('users')[id],\n }));\n\nexport const DiscussionKit = [discussionPlugin];\n","'use client';\n\nimport type { ExtendConfig, Path } from 'platejs';\n\nimport {\n type BaseSuggestionConfig,\n BaseSuggestionPlugin,\n} from '@platejs/suggestion';\nimport { isSlateEditor, isSlateString } from 'platejs';\nimport { toTPlatePlugin } from 'platejs/react';\n\nimport {\n SuggestionLeaf,\n SuggestionLineBreak,\n} from '@/components/ui/suggestion-node';\n\nimport { discussionPlugin } from './discussion-kit';\n\nexport type SuggestionConfig = ExtendConfig<\n BaseSuggestionConfig,\n {\n activeId: string | null;\n hoverId: string | null;\n uniquePathMap: Map<string, Path>;\n }\n>;\n\nexport const suggestionPlugin = toTPlatePlugin<SuggestionConfig>(\n BaseSuggestionPlugin,\n ({ editor }) => ({\n options: {\n activeId: null,\n currentUserId: editor.getOption(discussionPlugin, 'currentUserId'),\n hoverId: null,\n uniquePathMap: new Map(),\n },\n })\n).configure({\n handlers: {\n // unset active suggestion when clicking outside of suggestion\n onClick: ({ api, event, setOption, type }) => {\n let leaf = event.target as HTMLElement;\n let isSet = false;\n\n const isBlockLeaf = leaf.dataset.blockSuggestion === 'true';\n\n const unsetActiveSuggestion = () => {\n setOption('activeId', null);\n isSet = true;\n };\n\n if (!isSlateString(leaf) && !isBlockLeaf) {\n unsetActiveSuggestion();\n }\n\n while (leaf.parentElement && !isSlateEditor(leaf.parentElement)) {\n const isBlockSuggestion = leaf.dataset.blockSuggestion === 'true';\n\n if (leaf.classList.contains(`slate-${type}`) || isBlockSuggestion) {\n const suggestionEntry = api.suggestion!.node({\n isText: !isBlockSuggestion,\n });\n\n if (!suggestionEntry) {\n unsetActiveSuggestion();\n\n break;\n }\n\n const id = api.suggestion!.nodeId(suggestionEntry[0]);\n setOption('activeId', id ?? null);\n\n isSet = true;\n\n break;\n }\n\n leaf = leaf.parentElement;\n }\n\n if (!isSet) unsetActiveSuggestion();\n },\n },\n render: {\n belowNodes: SuggestionLineBreak as any,\n node: SuggestionLeaf,\n },\n});\n\nexport const SuggestionKit = [suggestionPlugin];\n","'use client';\n\nimport type { LucideProps } from 'lucide-react';\n\nexport function BorderAllIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border All</title>\n <path\n clipRule=\"evenodd\"\n d=\"M0.25 1C0.25 0.585786 0.585786 0.25 1 0.25H14C14.4142 0.25 14.75 0.585786 14.75 1V14C14.75 14.4142 14.4142 14.75 14 14.75H1C0.585786 14.75 0.25 14.4142 0.25 14V1ZM1.75 1.75V13.25H13.25V1.75H1.75Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"11\" />\n </svg>\n );\n}\n\nexport function BorderBottomIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Bottom</title>\n <path\n clipRule=\"evenodd\"\n d=\"M1 13.25L14 13.25V14.75L1 14.75V13.25Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"11\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"11\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"11\" />\n </svg>\n );\n}\n\nexport function BorderLeftIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Left</title>\n <path\n clipRule=\"evenodd\"\n d=\"M1.75 1L1.75 14L0.249999 14L0.25 1L1.75 1Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 10 7)\"\n width=\"1\"\n x=\"10\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 10 13)\"\n width=\"1\"\n x=\"10\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 12 7)\"\n width=\"1\"\n x=\"12\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 12 13)\"\n width=\"1\"\n x=\"12\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 7)\"\n width=\"1\"\n x=\"8\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 7)\"\n width=\"1\"\n x=\"14\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 13)\"\n width=\"1\"\n x=\"8\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 13)\"\n width=\"1\"\n x=\"14\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 5)\"\n width=\"1\"\n x=\"8\"\n y=\"5\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 5)\"\n width=\"1\"\n x=\"14\"\n y=\"5\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 3)\"\n width=\"1\"\n x=\"8\"\n y=\"3\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 3)\"\n width=\"1\"\n x=\"14\"\n y=\"3\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 9)\"\n width=\"1\"\n x=\"8\"\n y=\"9\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 9)\"\n width=\"1\"\n x=\"14\"\n y=\"9\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 11)\"\n width=\"1\"\n x=\"8\"\n y=\"11\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 11)\"\n width=\"1\"\n x=\"14\"\n y=\"11\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 6 7)\"\n width=\"1\"\n x=\"6\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 6 13)\"\n width=\"1\"\n x=\"6\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 4 7)\"\n width=\"1\"\n x=\"4\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 4 13)\"\n width=\"1\"\n x=\"4\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 10 1)\"\n width=\"1\"\n x=\"10\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 12 1)\"\n width=\"1\"\n x=\"12\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 1)\"\n width=\"1\"\n x=\"8\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 1)\"\n width=\"1\"\n x=\"14\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 6 1)\"\n width=\"1\"\n x=\"6\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 4 1)\"\n width=\"1\"\n x=\"4\"\n y=\"1\"\n />\n </svg>\n );\n}\n\nexport function BorderNoneIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border None</title>\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"5.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"5.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"3.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"3.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"7.025\" />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n width=\"1\"\n x=\"13\"\n y=\"13.025\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"7.025\" />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n width=\"1\"\n x=\"11\"\n y=\"13.025\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"9.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"9.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"11.025\" />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n width=\"1\"\n x=\"13\"\n y=\"11.025\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"5.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"3.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"9.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"11.025\" />\n </svg>\n );\n}\n\nexport function BorderRightIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Right</title>\n <path\n clipRule=\"evenodd\"\n d=\"M13.25 1L13.25 14L14.75 14L14.75 1L13.25 1Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 5 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 5 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 3 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 3 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 5)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 5)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 3)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 3)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 9)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 9)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 11)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 11)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 9 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 9 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 11 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 11 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 5 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 3 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 9 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 11 1)\"\n width=\"1\"\n />\n </svg>\n );\n}\n\nexport function BorderTopIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Top</title>\n <path\n clipRule=\"evenodd\"\n d=\"M14 1.75L1 1.75L1 0.249999L14 0.25L14 1.75Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 10)\"\n width=\"1\"\n x=\"8\"\n y=\"10\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 10)\"\n width=\"1\"\n x=\"2\"\n y=\"10\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 12)\"\n width=\"1\"\n x=\"8\"\n y=\"12\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 12)\"\n width=\"1\"\n x=\"2\"\n y=\"12\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 8)\"\n width=\"1\"\n x=\"8\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 14)\"\n width=\"1\"\n x=\"8\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 8)\"\n width=\"1\"\n x=\"2\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 14)\"\n width=\"1\"\n x=\"2\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 10 8)\"\n width=\"1\"\n x=\"10\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 10 14)\"\n width=\"1\"\n x=\"10\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 12 8)\"\n width=\"1\"\n x=\"12\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 12 14)\"\n width=\"1\"\n x=\"12\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 6 8)\"\n width=\"1\"\n x=\"6\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 6 14)\"\n width=\"1\"\n x=\"6\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 4 8)\"\n width=\"1\"\n x=\"4\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 4 14)\"\n width=\"1\"\n x=\"4\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 6)\"\n width=\"1\"\n x=\"8\"\n y=\"6\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 6)\"\n width=\"1\"\n x=\"2\"\n y=\"6\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 4)\"\n width=\"1\"\n x=\"8\"\n y=\"4\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 4)\"\n width=\"1\"\n x=\"2\"\n y=\"4\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 10)\"\n width=\"1\"\n x=\"14\"\n y=\"10\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 12)\"\n width=\"1\"\n x=\"14\"\n y=\"12\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 8)\"\n width=\"1\"\n x=\"14\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 14)\"\n width=\"1\"\n x=\"14\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 6)\"\n width=\"1\"\n x=\"14\"\n y=\"6\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 4)\"\n width=\"1\"\n x=\"14\"\n y=\"4\"\n />\n </svg>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { useDraggable, useDropLine } from '@platejs/dnd';\nimport {\n BlockSelectionPlugin,\n useBlockSelected,\n} from '@platejs/selection/react';\nimport { setCellBackground } from '@platejs/table';\nimport {\n TablePlugin,\n TableProvider,\n useTableBordersDropdownMenuContentState,\n useTableCellElement,\n useTableCellElementResizable,\n useTableElement,\n useTableMergeState,\n} from '@platejs/table/react';\nimport { PopoverAnchor } from '@radix-ui/react-popover';\nimport { cva } from 'class-variance-authority';\nimport {\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n CombineIcon,\n EraserIcon,\n Grid2X2Icon,\n GripVertical,\n PaintBucketIcon,\n SquareSplitHorizontalIcon,\n Trash2Icon,\n XIcon,\n} from 'lucide-react';\nimport {\n type TElement,\n type TTableCellElement,\n type TTableElement,\n type TTableRowElement,\n KEYS,\n PathApi,\n} from 'platejs';\nimport {\n type PlateElementProps,\n PlateElement,\n useComposedRef,\n useEditorPlugin,\n useEditorRef,\n useEditorSelector,\n useElement,\n useFocusedLast,\n usePluginOption,\n useReadOnly,\n useRemoveNodeButton,\n useSelected,\n withHOC,\n} from 'platejs/react';\nimport { useElementSelector } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Popover, PopoverContent } from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nimport { blockSelectionVariants } from './block-selection';\nimport {\n ColorDropdownMenuItems,\n DEFAULT_COLORS,\n} from './font-color-toolbar-button';\nimport { ResizeHandle } from './resize-handle';\nimport {\n BorderAllIcon,\n BorderBottomIcon,\n BorderLeftIcon,\n BorderNoneIcon,\n BorderRightIcon,\n BorderTopIcon,\n} from './table-icons';\nimport {\n Toolbar,\n ToolbarButton,\n ToolbarGroup,\n ToolbarMenuGroup,\n} from './toolbar';\nexport const TableElement = withHOC(\n TableProvider,\n function TableElement({\n children,\n ...props\n }: PlateElementProps<TTableElement>) {\n const readOnly = useReadOnly();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n const hasControls = !readOnly && !isSelectionAreaVisible;\n const {\n isSelectingCell,\n marginLeft,\n props: tableProps,\n } = useTableElement();\n\n const isSelectingTable = useBlockSelected(props.element.id as string);\n\n const content = (\n <PlateElement\n {...props}\n className={cn(\n 'overflow-x-auto py-5',\n hasControls && '-ml-2 *:data-[slot=block-selection]:left-2'\n )}\n style={{ paddingLeft: marginLeft }}\n >\n <div className=\"group/table relative w-fit\">\n <table\n className={cn(\n 'mr-0 ml-px table h-px table-fixed border-collapse',\n isSelectingCell && 'selection:bg-transparent'\n )}\n {...tableProps}\n >\n <tbody className=\"min-w-full\">{children}</tbody>\n </table>\n\n {isSelectingTable && (\n <div className={blockSelectionVariants()} contentEditable={false} />\n )}\n </div>\n </PlateElement>\n );\n\n if (readOnly) {\n return content;\n }\n\n return <TableFloatingToolbar>{content}</TableFloatingToolbar>;\n }\n);\n\nfunction TableFloatingToolbar({\n children,\n ...props\n}: React.ComponentProps<typeof PopoverContent>) {\n const { tf } = useEditorPlugin(TablePlugin);\n const selected = useSelected();\n const element = useElement<TTableElement>();\n const { props: buttonProps } = useRemoveNodeButton({ element });\n const collapsedInside = useEditorSelector(\n (editor) => selected && editor.api.isCollapsed(),\n [selected]\n );\n const isFocusedLast = useFocusedLast();\n\n const { canMerge, canSplit } = useTableMergeState();\n\n return (\n <Popover\n open={isFocusedLast && (canMerge || canSplit || collapsedInside)}\n modal={false}\n >\n <PopoverAnchor asChild>{children}</PopoverAnchor>\n <PopoverContent\n asChild\n onOpenAutoFocus={(e) => e.preventDefault()}\n contentEditable={false}\n {...props}\n >\n <Toolbar\n className=\"scrollbar-hide flex w-auto max-w-[80vw] flex-row overflow-x-auto rounded-md border bg-popover p-1 shadow-md print:hidden\"\n contentEditable={false}\n >\n <ToolbarGroup>\n <ColorDropdownMenu tooltip=\"Background color\">\n <PaintBucketIcon />\n </ColorDropdownMenu>\n {canMerge && (\n <ToolbarButton\n onClick={() => tf.table.merge()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Merge cells\"\n >\n <CombineIcon />\n </ToolbarButton>\n )}\n {canSplit && (\n <ToolbarButton\n onClick={() => tf.table.split()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Split cell\"\n >\n <SquareSplitHorizontalIcon />\n </ToolbarButton>\n )}\n\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton tooltip=\"Cell borders\">\n <Grid2X2Icon />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuPortal>\n <TableBordersDropdownMenuContent />\n </DropdownMenuPortal>\n </DropdownMenu>\n\n {collapsedInside && (\n <ToolbarGroup>\n <ToolbarButton tooltip=\"Delete table\" {...buttonProps}>\n <Trash2Icon />\n </ToolbarButton>\n </ToolbarGroup>\n )}\n </ToolbarGroup>\n\n {collapsedInside && (\n <ToolbarGroup>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableRow({ before: true });\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert row before\"\n >\n <ArrowUp />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableRow();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert row after\"\n >\n <ArrowDown />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.remove.tableRow();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Delete row\"\n >\n <XIcon />\n </ToolbarButton>\n </ToolbarGroup>\n )}\n\n {collapsedInside && (\n <ToolbarGroup>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableColumn({ before: true });\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert column before\"\n >\n <ArrowLeft />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableColumn();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert column after\"\n >\n <ArrowRight />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.remove.tableColumn();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Delete column\"\n >\n <XIcon />\n </ToolbarButton>\n </ToolbarGroup>\n )}\n </Toolbar>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction TableBordersDropdownMenuContent(\n props: React.ComponentProps<typeof DropdownMenuPrimitive.Content>\n) {\n const editor = useEditorRef();\n const {\n getOnSelectTableBorder,\n hasBottomBorder,\n hasLeftBorder,\n hasNoBorders,\n hasOuterBorders,\n hasRightBorder,\n hasTopBorder,\n } = useTableBordersDropdownMenuContentState();\n\n return (\n <DropdownMenuContent\n className=\"min-w-[220px]\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n editor.tf.focus();\n }}\n align=\"start\"\n side=\"right\"\n sideOffset={0}\n {...props}\n >\n <DropdownMenuGroup>\n <DropdownMenuCheckboxItem\n checked={hasTopBorder}\n onCheckedChange={getOnSelectTableBorder('top')}\n >\n <BorderTopIcon />\n <div>Top Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasRightBorder}\n onCheckedChange={getOnSelectTableBorder('right')}\n >\n <BorderRightIcon />\n <div>Right Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasBottomBorder}\n onCheckedChange={getOnSelectTableBorder('bottom')}\n >\n <BorderBottomIcon />\n <div>Bottom Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasLeftBorder}\n onCheckedChange={getOnSelectTableBorder('left')}\n >\n <BorderLeftIcon />\n <div>Left Border</div>\n </DropdownMenuCheckboxItem>\n </DropdownMenuGroup>\n\n <DropdownMenuGroup>\n <DropdownMenuCheckboxItem\n checked={hasNoBorders}\n onCheckedChange={getOnSelectTableBorder('none')}\n >\n <BorderNoneIcon />\n <div>No Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasOuterBorders}\n onCheckedChange={getOnSelectTableBorder('outer')}\n >\n <BorderAllIcon />\n <div>Outside Borders</div>\n </DropdownMenuCheckboxItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n );\n}\n\nfunction ColorDropdownMenu({\n children,\n tooltip,\n}: {\n children: React.ReactNode;\n tooltip: string;\n}) {\n const [open, setOpen] = React.useState(false);\n\n const editor = useEditorRef();\n const selectedCells = usePluginOption(TablePlugin, 'selectedCells');\n\n const onUpdateColor = React.useCallback(\n (color: string) => {\n setOpen(false);\n setCellBackground(editor, { color, selectedCells: selectedCells ?? [] });\n },\n [selectedCells, editor]\n );\n\n const onClearColor = React.useCallback(() => {\n setOpen(false);\n setCellBackground(editor, {\n color: null,\n selectedCells: selectedCells ?? [],\n });\n }, [selectedCells, editor]);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton tooltip={tooltip}>{children}</ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <ToolbarMenuGroup label=\"Colors\">\n <ColorDropdownMenuItems\n className=\"px-2\"\n colors={DEFAULT_COLORS}\n updateColor={onUpdateColor}\n />\n </ToolbarMenuGroup>\n <DropdownMenuGroup>\n <DropdownMenuItem className=\"p-2\" onClick={onClearColor}>\n <EraserIcon />\n <span>Clear</span>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nexport function TableRowElement({\n children,\n ...props\n}: PlateElementProps<TTableRowElement>) {\n const { element } = props;\n const readOnly = useReadOnly();\n const selected = useSelected();\n const editor = useEditorRef();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n const hasControls = !readOnly && !isSelectionAreaVisible;\n\n const { isDragging, previewRef, handleRef } = useDraggable({\n element,\n type: element.type,\n canDropNode: ({ dragEntry, dropEntry }) =>\n PathApi.equals(\n PathApi.parent(dragEntry[1]),\n PathApi.parent(dropEntry[1])\n ),\n onDropHandler: (_, { dragItem }) => {\n const dragElement = (dragItem as { element: TElement }).element;\n\n if (dragElement) {\n editor.tf.select(dragElement);\n }\n },\n });\n\n return (\n <PlateElement\n {...props}\n ref={useComposedRef(props.ref, previewRef)}\n as=\"tr\"\n className={cn('group/row', isDragging && 'opacity-50')}\n attributes={{\n ...props.attributes,\n 'data-selected': selected ? 'true' : undefined,\n }}\n >\n {hasControls && (\n <td className=\"w-2 select-none\" contentEditable={false}>\n <RowDragHandle dragRef={handleRef} />\n <RowDropLine />\n </td>\n )}\n\n {children}\n </PlateElement>\n );\n}\n\nfunction RowDragHandle({ dragRef }: { dragRef: React.Ref<any> }) {\n const editor = useEditorRef();\n const element = useElement();\n\n return (\n <Button\n ref={dragRef}\n variant=\"outline\"\n className={cn(\n '-translate-y-1/2 absolute top-1/2 left-0 z-51 h-6 w-4 p-0 focus-visible:ring-0 focus-visible:ring-offset-0',\n 'cursor-grab active:cursor-grabbing',\n 'opacity-0 transition-opacity duration-100 group-hover/row:opacity-100 group-has-data-[resizing=\"true\"]/row:opacity-0'\n )}\n onClick={() => {\n editor.tf.select(element);\n }}\n >\n <GripVertical className=\"text-muted-foreground\" />\n </Button>\n );\n}\n\nfunction RowDropLine() {\n const { dropLine } = useDropLine();\n\n if (!dropLine) return null;\n\n return (\n <div\n className={cn(\n 'absolute inset-x-0 left-2 z-50 h-0.5 bg-brand/50',\n dropLine === 'top' ? '-top-px' : '-bottom-px'\n )}\n />\n );\n}\n\nexport function TableCellElement({\n isHeader,\n ...props\n}: PlateElementProps<TTableCellElement> & {\n isHeader?: boolean;\n}) {\n const { api } = useEditorPlugin(TablePlugin);\n const readOnly = useReadOnly();\n const element = props.element;\n\n const tableId = useElementSelector(([node]) => node.id as string, [], {\n key: KEYS.table,\n });\n const rowId = useElementSelector(([node]) => node.id as string, [], {\n key: KEYS.tr,\n });\n const isSelectingTable = useBlockSelected(tableId);\n const isSelectingRow = useBlockSelected(rowId) || isSelectingTable;\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n\n const { borders, colIndex, colSpan, minHeight, rowIndex, selected, width } =\n useTableCellElement();\n\n const { bottomProps, hiddenLeft, leftProps, rightProps } =\n useTableCellElementResizable({\n colIndex,\n colSpan,\n rowIndex,\n });\n\n return (\n <PlateElement\n {...props}\n as={isHeader ? 'th' : 'td'}\n className={cn(\n 'h-full overflow-visible border-none bg-background p-0',\n element.background ? 'bg-(--cellBackground)' : 'bg-background',\n isHeader && 'text-left *:m-0',\n 'before:size-full',\n selected && 'before:z-10 before:bg-brand/5',\n \"before:absolute before:box-border before:select-none before:content-['']\",\n borders.bottom?.size && 'before:border-b before:border-b-border',\n borders.right?.size && 'before:border-r before:border-r-border',\n borders.left?.size && 'before:border-l before:border-l-border',\n borders.top?.size && 'before:border-t before:border-t-border'\n )}\n style={\n {\n '--cellBackground': element.background,\n maxWidth: width || 240,\n minWidth: width || 120,\n } as React.CSSProperties\n }\n attributes={{\n ...props.attributes,\n colSpan: api.table.getColSpan(element),\n rowSpan: api.table.getRowSpan(element),\n }}\n >\n <div\n className=\"relative z-20 box-border h-full px-3 py-2\"\n style={{ minHeight }}\n >\n {props.children}\n </div>\n\n {!isSelectionAreaVisible && (\n <div\n className=\"group absolute top-0 size-full select-none\"\n contentEditable={false}\n suppressContentEditableWarning={true}\n >\n {!readOnly && (\n <>\n <ResizeHandle\n {...rightProps}\n className=\"-top-2 -right-1 h-[calc(100%_+_8px)] w-2\"\n data-col={colIndex}\n />\n <ResizeHandle {...bottomProps} className=\"-bottom-1 h-2\" />\n {!hiddenLeft && (\n <ResizeHandle\n {...leftProps}\n className=\"-left-1 top-0 w-2\"\n data-resizer-left={colIndex === 0 ? 'true' : undefined}\n />\n )}\n\n <div\n className={cn(\n 'absolute top-0 z-30 hidden h-full w-1 bg-ring',\n 'right-[-1.5px]',\n columnResizeVariants({ colIndex: colIndex as any })\n )}\n />\n {colIndex === 0 && (\n <div\n className={cn(\n 'absolute top-0 z-30 h-full w-1 bg-ring',\n 'left-[-1.5px]',\n 'fade-in hidden animate-in group-has-[[data-resizer-left]:hover]/table:block group-has-[[data-resizer-left][data-resizing=\"true\"]]/table:block'\n )}\n />\n )}\n </>\n )}\n </div>\n )}\n\n {isSelectingRow && (\n <div className={blockSelectionVariants()} contentEditable={false} />\n )}\n </PlateElement>\n );\n}\n\nexport function TableCellHeaderElement(\n props: React.ComponentProps<typeof TableCellElement>\n) {\n return <TableCellElement {...props} isHeader />;\n}\n\nconst columnResizeVariants = cva('fade-in hidden animate-in', {\n variants: {\n colIndex: {\n 0: 'group-has-[[data-col=\"0\"]:hover]/table:block group-has-[[data-col=\"0\"][data-resizing=\"true\"]]/table:block',\n 1: 'group-has-[[data-col=\"1\"]:hover]/table:block group-has-[[data-col=\"1\"][data-resizing=\"true\"]]/table:block',\n 2: 'group-has-[[data-col=\"2\"]:hover]/table:block group-has-[[data-col=\"2\"][data-resizing=\"true\"]]/table:block',\n 3: 'group-has-[[data-col=\"3\"]:hover]/table:block group-has-[[data-col=\"3\"][data-resizing=\"true\"]]/table:block',\n 4: 'group-has-[[data-col=\"4\"]:hover]/table:block group-has-[[data-col=\"4\"][data-resizing=\"true\"]]/table:block',\n 5: 'group-has-[[data-col=\"5\"]:hover]/table:block group-has-[[data-col=\"5\"][data-resizing=\"true\"]]/table:block',\n 6: 'group-has-[[data-col=\"6\"]:hover]/table:block group-has-[[data-col=\"6\"][data-resizing=\"true\"]]/table:block',\n 7: 'group-has-[[data-col=\"7\"]:hover]/table:block group-has-[[data-col=\"7\"][data-resizing=\"true\"]]/table:block',\n 8: 'group-has-[[data-col=\"8\"]:hover]/table:block group-has-[[data-col=\"8\"][data-resizing=\"true\"]]/table:block',\n 9: 'group-has-[[data-col=\"9\"]:hover]/table:block group-has-[[data-col=\"9\"][data-resizing=\"true\"]]/table:block',\n 10: 'group-has-[[data-col=\"10\"]:hover]/table:block group-has-[[data-col=\"10\"][data-resizing=\"true\"]]/table:block',\n },\n },\n});\n","'use client';\n\nimport {\n TableCellHeaderPlugin,\n TableCellPlugin,\n TablePlugin,\n TableRowPlugin,\n} from '@platejs/table/react';\n\nimport {\n TableCellElement,\n TableCellHeaderElement,\n TableElement,\n TableRowElement,\n} from '@/components/ui/table-node';\n\nexport const TableKit = [\n TablePlugin.withComponent(TableElement),\n TableRowPlugin.withComponent(TableRowElement),\n TableCellPlugin.withComponent(TableCellElement),\n TableCellHeaderPlugin.withComponent(TableCellHeaderElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useTocElement, useTocElementState } from '@platejs/toc/react';\nimport { cva } from 'class-variance-authority';\nimport { PlateElement } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\n\nconst headingItemVariants = cva(\n 'block h-auto w-full cursor-pointer truncate rounded-none px-0.5 py-1.5 text-left font-medium text-muted-foreground underline decoration-[0.5px] underline-offset-4 hover:bg-accent hover:text-muted-foreground',\n {\n variants: {\n depth: {\n 1: 'pl-0.5',\n 2: 'pl-[26px]',\n 3: 'pl-[50px]',\n },\n },\n }\n);\n\nexport function TocElement(props: PlateElementProps) {\n const state = useTocElementState();\n const { props: btnProps } = useTocElement(state);\n const { headingList } = state;\n\n return (\n <PlateElement {...props} className=\"mb-1 p-0\">\n <div contentEditable={false}>\n {headingList.length > 0 ? (\n headingList.map((item) => (\n <Button\n key={item.id}\n variant=\"ghost\"\n className={headingItemVariants({\n depth: item.depth as 1 | 2 | 3,\n })}\n onClick={(e) => btnProps.onClick(e, item, 'smooth')}\n aria-current\n >\n {item.title}\n </Button>\n ))\n ) : (\n <div className=\"text-gray-500 text-sm\">\n Create a heading to display the table of contents.\n </div>\n )}\n </div>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { TocPlugin } from '@platejs/toc/react';\n\nimport { TocElement } from '@/components/ui/toc-node';\n\nexport const TocKit = [\n TocPlugin.configure({\n options: {\n // isScroll: true,\n topOffset: 80,\n },\n }).withComponent(TocElement),\n];\n","'use client';\n\nimport { TogglePlugin } from '@platejs/toggle/react';\n\nimport { IndentKit } from '@/components/editor/plugins/indent-kit';\nimport { ToggleElement } from '@/components/ui/toggle-node';\n\nexport const ToggleKit = [\n ...IndentKit,\n TogglePlugin.withComponent(ToggleElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useToggleButton, useToggleButtonState } from '@platejs/toggle/react';\nimport { ChevronRight } from 'lucide-react';\nimport { PlateElement } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\n\nexport function ToggleElement(props: PlateElementProps) {\n const element = props.element;\n const state = useToggleButtonState(element.id as string);\n const { buttonProps, open } = useToggleButton(state);\n\n return (\n <PlateElement {...props} className=\"pl-6\">\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"-left-0.5 absolute top-0 size-6 cursor-pointer select-none items-center justify-center rounded-md p-px text-muted-foreground transition-colors hover:bg-accent [&_svg]:size-4\"\n contentEditable={false}\n {...buttonProps}\n >\n <ChevronRight\n className={\n open\n ? 'rotate-90 transition-transform duration-75'\n : 'rotate-0 transition-transform duration-75'\n }\n />\n </Button>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { type Value, TrailingBlockPlugin } from 'platejs';\nimport { type TPlateEditor, useEditorRef } from 'platejs/react';\n\n// import { AIKit } from '@/components/editor/plugins/ai-kit';\nimport { AlignKit } from '@/components/editor/plugins/align-kit';\nimport { AutoformatKit } from '@/components/editor/plugins/autoformat-kit';\nimport { BasicBlocksKit } from '@/components/editor/plugins/basic-blocks-kit';\nimport { BasicMarksKit } from '@/components/editor/plugins/basic-marks-kit';\nimport { BlockMenuKit } from '@/components/editor/plugins/block-menu-kit';\nimport { BlockPlaceholderKit } from '@/components/editor/plugins/block-placeholder-kit';\nimport { CalloutKit } from '@/components/editor/plugins/callout-kit';\nimport { CodeBlockKit } from '@/components/editor/plugins/code-block-kit';\nimport { ColumnKit } from '@/components/editor/plugins/column-kit';\nimport { CommentKit } from '@/components/editor/plugins/comment-kit';\n// import { CopilotKit } from '@/components/editor/plugins/copilot-kit';\nimport { CursorOverlayKit } from '@/components/editor/plugins/cursor-overlay-kit';\nimport { DateKit } from '@/components/editor/plugins/date-kit';\n// import { DiscussionKit } from '@/components/editor/plugins/discussion-kit';\nimport { DndKit } from '@/components/editor/plugins/dnd-kit';\nimport { DocxKit } from '@/components/editor/plugins/docx-kit';\n// import { EmojiKit } from '@/components/editor/plugins/emoji-kit';\nimport { ExitBreakKit } from '@/components/editor/plugins/exit-break-kit';\nimport { FixedToolbarKit } from '@/components/editor/plugins/fixed-toolbar-kit';\nimport { FloatingToolbarKit } from '@/components/editor/plugins/floating-toolbar-kit';\nimport { FontKit } from '@/components/editor/plugins/font-kit';\nimport { LineHeightKit } from '@/components/editor/plugins/line-height-kit';\nimport { LinkKit } from '@/components/editor/plugins/link-kit';\nimport { ListKit } from '@/components/editor/plugins/list-kit';\nimport { MarkdownKit } from '@/components/editor/plugins/markdown-kit';\nimport { MathKit } from '@/components/editor/plugins/math-kit';\nimport { MediaKit } from '@/components/editor/plugins/media-kit';\nimport { MentionKit } from '@/components/editor/plugins/mention-kit';\nimport { SlashKit } from '@/components/editor/plugins/slash-kit';\nimport { SuggestionKit } from '@/components/editor/plugins/suggestion-kit';\nimport { TableKit } from '@/components/editor/plugins/table-kit';\nimport { TocKit } from '@/components/editor/plugins/toc-kit';\nimport { ToggleKit } from '@/components/editor/plugins/toggle-kit';\n\nexport const EditorKit: any[] = [\n // ...CopilotKit,\n // ...AIKit,\n\n // Elements\n ...BasicBlocksKit,\n ...CodeBlockKit,\n ...TableKit,\n ...ToggleKit,\n ...TocKit,\n ...MediaKit,\n ...CalloutKit,\n ...ColumnKit,\n ...MathKit,\n ...DateKit,\n ...LinkKit,\n ...MentionKit,\n\n // Marks\n ...BasicMarksKit,\n ...FontKit,\n\n // Block Style\n ...ListKit,\n ...AlignKit,\n ...LineHeightKit,\n\n // Collaboration\n // ...DiscussionKit,\n ...CommentKit,\n ...SuggestionKit,\n\n // Editing\n ...SlashKit,\n ...AutoformatKit,\n ...CursorOverlayKit,\n ...BlockMenuKit,\n ...DndKit,\n // ...EmojiKit,\n ...ExitBreakKit,\n TrailingBlockPlugin,\n\n // Parsers\n ...DocxKit,\n ...MarkdownKit,\n\n // UI\n ...BlockPlaceholderKit,\n ...FixedToolbarKit,\n ...FloatingToolbarKit,\n];\n\nexport type MyEditor = TPlateEditor<Value, (typeof EditorKit)[number]>;\n\nexport const useEditor = (): MyEditor | null => useEditorRef<MyEditor>();\n","'use client';\n\nimport * as React from 'react';\n\nimport { Plate, usePlateEditor } from 'platejs/react';\n\nimport { EditorKit } from '@/components/editor/editor-kit';\nimport { Editor, EditorContainer } from '@/components/ui/editor';\n\nimport { type Value } from 'platejs';\n\nexport interface PlateEditorProps {\n initialValue?: Value | string;\n onChange?: (value: Value) => void;\n}\n\nexport function PlateEditor({ initialValue, onChange }: PlateEditorProps) {\n const editor = usePlateEditor({\n plugins: EditorKit,\n value: initialValue,\n });\n\n return (\n <div className=\"h-screen w-full bg-white rounded-sm border-1\">\n <Plate\n editor={editor}\n onChange={({ value }) => {\n onChange?.(value);\n }}\n >\n <EditorContainer>\n <Editor variant=\"fullWidth\" />\n </EditorContainer>\n </Plate>\n </div>\n );\n}\n","import { BaseTextAlignPlugin } from '@platejs/basic-styles';\nimport { KEYS } from 'platejs';\n\nexport const BaseAlignKit = [\n BaseTextAlignPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 'start',\n nodeKey: 'align',\n styleKey: 'textAlign',\n validNodeValues: ['start', 'left', 'center', 'right', 'end', 'justify'],\n },\n targetPlugins: [...KEYS.heading, KEYS.p, KEYS.img, KEYS.mediaEmbed],\n },\n }),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport { SlateElement } from 'platejs/static';\n\nconst headingVariants = cva('relative mb-1', {\n variants: {\n variant: {\n h1: 'mt-[1.6em] pb-1 font-bold font-heading text-4xl',\n h2: 'mt-[1.4em] pb-px font-heading font-semibold text-2xl tracking-tight',\n h3: 'mt-[1em] pb-px font-heading font-semibold text-xl tracking-tight',\n h4: 'mt-[0.75em] font-heading font-semibold text-lg tracking-tight',\n h5: 'mt-[0.75em] font-semibold text-lg tracking-tight',\n h6: 'mt-[0.75em] font-semibold text-base tracking-tight',\n },\n },\n});\n\nexport function HeadingElementStatic({\n variant = 'h1',\n ...props\n}: SlateElementProps & VariantProps<typeof headingVariants>) {\n return (\n <SlateElement\n as={variant!}\n className={headingVariants({ variant })}\n {...props}\n >\n {props.children}\n </SlateElement>\n );\n}\n\nexport function H1ElementStatic(props: SlateElementProps) {\n return <HeadingElementStatic variant=\"h1\" {...props} />;\n}\n\nexport function H2ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h2\" {...props} />;\n}\n\nexport function H3ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h3\" {...props} />;\n}\n\nexport function H4ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h4\" {...props} />;\n}\n\nexport function H5ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h5\" {...props} />;\n}\n\nexport function H6ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h6\" {...props} />;\n}\n","import {\n BaseBlockquotePlugin,\n BaseH1Plugin,\n BaseH2Plugin,\n BaseH3Plugin,\n BaseH4Plugin,\n BaseH5Plugin,\n BaseH6Plugin,\n BaseHorizontalRulePlugin,\n} from '@platejs/basic-nodes';\nimport { BaseParagraphPlugin } from 'platejs';\n\nimport { BlockquoteElementStatic } from '@/components/ui/blockquote-node-static';\nimport {\n H1ElementStatic,\n H2ElementStatic,\n H3ElementStatic,\n H4ElementStatic,\n H5ElementStatic,\n H6ElementStatic,\n} from '@/components/ui/heading-node-static';\nimport { HrElementStatic } from '@/components/ui/hr-node-static';\nimport { ParagraphElementStatic } from '@/components/ui/paragraph-node-static';\n\nexport const BaseBasicBlocksKit = [\n BaseParagraphPlugin.withComponent(ParagraphElementStatic),\n BaseH1Plugin.withComponent(H1ElementStatic),\n BaseH2Plugin.withComponent(H2ElementStatic),\n BaseH3Plugin.withComponent(H3ElementStatic),\n BaseH4Plugin.withComponent(H4ElementStatic),\n BaseH5Plugin.withComponent(H5ElementStatic),\n BaseH6Plugin.withComponent(H6ElementStatic),\n BaseBlockquotePlugin.withComponent(BlockquoteElementStatic),\n BaseHorizontalRulePlugin.withComponent(HrElementStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function ParagraphElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props} className={cn('m-0 px-0 py-1')}>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport { type SlateElementProps, SlateElement } from 'platejs/static';\n\nexport function BlockquoteElementStatic(props: SlateElementProps) {\n return (\n <SlateElement\n as=\"blockquote\"\n className=\"my-1 border-l-2 pl-6 italic\"\n {...props}\n />\n );\n}\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function HrElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props}>\n <div className=\"cursor-text py-6\" contentEditable={false}>\n <hr\n className={cn(\n 'h-0.5 rounded-sm border-none bg-muted bg-clip-content'\n )}\n />\n </div>\n {props.children}\n </SlateElement>\n );\n}\n","import {\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseHighlightPlugin,\n BaseItalicPlugin,\n BaseKbdPlugin,\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\n BaseUnderlinePlugin,\n} from '@platejs/basic-nodes';\n\nimport { CodeLeafStatic } from '@/components/ui/code-node-static';\nimport { HighlightLeafStatic } from '@/components/ui/highlight-node-static';\nimport { KbdLeafStatic } from '@/components/ui/kbd-node-static';\n\nexport const BaseBasicMarksKit = [\n BaseBoldPlugin,\n BaseItalicPlugin,\n BaseUnderlinePlugin,\n BaseCodePlugin.withComponent(CodeLeafStatic),\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\n BaseHighlightPlugin.withComponent(HighlightLeafStatic),\n BaseKbdPlugin.withComponent(KbdLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function CodeLeafStatic(props: SlateLeafProps) {\n return (\n <SlateLeaf\n {...props}\n as=\"code\"\n className=\"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm\"\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import * as React from 'react';\n\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function HighlightLeafStatic(props: SlateLeafProps) {\n return (\n <SlateLeaf {...props} as=\"mark\" className=\"bg-highlight/30 text-inherit\">\n {props.children}\n </SlateLeaf>\n );\n}\n","import * as React from 'react';\n\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function KbdLeafStatic(props: SlateLeafProps) {\n return (\n <SlateLeaf\n {...props}\n as=\"kbd\"\n className=\"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-sm shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(248,_249,_250)_0px_1px_5px_0px_inset,_rgb(193,_200,_205)_0px_0px_0px_0.5px,_rgb(193,_200,_205)_0px_2px_1px_-1px,_rgb(193,_200,_205)_0px_1px_0px_0px] dark:shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(26,_29,_30)_0px_1px_5px_0px_inset,_rgb(76,_81,_85)_0px_0px_0px_0.5px,_rgb(76,_81,_85)_0px_2px_1px_-1px,_rgb(76,_81,_85)_0px_1px_0px_0px]\"\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import { BaseCalloutPlugin } from '@platejs/callout';\n\nimport { CalloutElementStatic } from '@/components/ui/callout-node-static';\n\nexport const BaseCalloutKit = [\n BaseCalloutPlugin.withComponent(CalloutElementStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function CalloutElementStatic({\n children,\n className,\n ...props\n}: SlateElementProps) {\n return (\n <SlateElement\n className={cn('my-1 flex rounded-sm bg-muted p-4 pl-3', className)}\n style={{\n backgroundColor: props.element.backgroundColor as any,\n }}\n {...props}\n >\n <div className=\"flex w-full gap-2 rounded-md\">\n <div\n className=\"size-6 select-none text-[18px]\"\n style={{\n fontFamily:\n '\"Apple Color Emoji\", \"Segoe UI Emoji\", NotoColorEmoji, \"Noto Color Emoji\", \"Segoe UI Symbol\", \"Android Emoji\", EmojiSymbols',\n }}\n >\n <span data-plate-prevent-deserialization>\n {(props.element.icon as any) || '💡'}\n </span>\n </div>\n <div className=\"w-full\">{children}</div>\n </div>\n </SlateElement>\n );\n}\n","import {\n BaseCodeBlockPlugin,\n BaseCodeLinePlugin,\n BaseCodeSyntaxPlugin,\n} from '@platejs/code-block';\nimport { all, createLowlight } from 'lowlight';\n\nimport {\n CodeBlockElementStatic,\n CodeLineElementStatic,\n CodeSyntaxLeafStatic,\n} from '@/components/ui/code-block-node-static';\n\nconst lowlight = createLowlight(all);\n\nexport const BaseCodeBlockKit = [\n BaseCodeBlockPlugin.configure({\n node: { component: CodeBlockElementStatic },\n options: { lowlight },\n }),\n BaseCodeLinePlugin.withComponent(CodeLineElementStatic),\n BaseCodeSyntaxPlugin.withComponent(CodeSyntaxLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { TCodeBlockElement } from 'platejs';\n\nimport {\n type SlateElementProps,\n type SlateLeafProps,\n SlateElement,\n SlateLeaf,\n} from 'platejs/static';\n\nexport function CodeBlockElementStatic(\n props: SlateElementProps<TCodeBlockElement>\n) {\n return (\n <SlateElement\n className=\"py-1 **:[.hljs-addition]:bg-[#f0fff4] **:[.hljs-addition]:text-[#22863a] dark:**:[.hljs-addition]:bg-[#3c5743] dark:**:[.hljs-addition]:text-[#ceead5] **:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#005cc5] dark:**:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#6596cf] **:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#e36209] dark:**:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#c3854e] **:[.hljs-bullet]:text-[#735c0f] **:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] dark:**:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] **:[.hljs-deletion]:bg-[#ffeef0] **:[.hljs-deletion]:text-[#b31d28] dark:**:[.hljs-deletion]:bg-[#473235] dark:**:[.hljs-deletion]:text-[#e7c7cb] **:[.hljs-emphasis]:italic **:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#d73a49] dark:**:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#ee6960] **:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#22863a] dark:**:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#36a84f] **:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#032f62] dark:**:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#3593ff] **:[.hljs-section]:font-bold **:[.hljs-section]:text-[#005cc5] dark:**:[.hljs-section]:text-[#61a5f2] **:[.hljs-strong]:font-bold **:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#6f42c1] dark:**:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#a77bfa]\"\n {...props}\n >\n <div className=\"relative rounded-md bg-muted/50\">\n <pre className=\"overflow-x-auto p-8 pr-4 font-mono text-sm leading-[normal] [tab-size:2] print:break-inside-avoid\">\n <code>{props.children}</code>\n </pre>\n </div>\n </SlateElement>\n );\n}\n\nexport function CodeLineElementStatic(props: SlateElementProps) {\n return <SlateElement {...props} />;\n}\n\nexport function CodeSyntaxLeafStatic(props: SlateLeafProps) {\n const tokenClassName = props.leaf.className as string;\n\n return <SlateLeaf className={tokenClassName} {...props} />;\n}\n","import { BaseColumnItemPlugin, BaseColumnPlugin } from '@platejs/layout';\n\nimport {\n ColumnElementStatic,\n ColumnGroupElementStatic,\n} from '@/components/ui/column-node-static';\n\nexport const BaseColumnKit = [\n BaseColumnPlugin.withComponent(ColumnGroupElementStatic),\n BaseColumnItemPlugin.withComponent(ColumnElementStatic),\n];\n","import * as React from 'react';\n\nimport type { TColumnElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nexport function ColumnElementStatic(props: SlateElementProps<TColumnElement>) {\n const { width } = props.element;\n\n return (\n <div className=\"group/column relative\" style={{ width: width ?? '100%' }}>\n <SlateElement\n className=\"h-full px-2 pt-2 group-first/column:pl-0 group-last/column:pr-0\"\n {...props}\n >\n <div className=\"relative h-full border border-transparent p-1.5\">\n {props.children}\n </div>\n </SlateElement>\n </div>\n );\n}\n\nexport function ColumnGroupElementStatic(props: SlateElementProps) {\n return (\n <SlateElement className=\"mb-2\" {...props}>\n <div className=\"flex size-full rounded\">{props.children}</div>\n </SlateElement>\n );\n}\n","import { BaseCommentPlugin } from '@platejs/comment';\n\nimport { CommentLeafStatic } from '@/components/ui/comment-node-static';\n\nexport const BaseCommentKit = [\n BaseCommentPlugin.withComponent(CommentLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { TCommentText } from 'platejs';\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function CommentLeafStatic(props: SlateLeafProps<TCommentText>) {\n return (\n <SlateLeaf\n {...props}\n className=\"border-b-2 border-b-highlight/35 bg-highlight/15\"\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import { BaseDatePlugin } from '@platejs/date';\n\nimport { DateElementStatic } from '@/components/ui/date-node-static';\n\nexport const BaseDateKit = [BaseDatePlugin.withComponent(DateElementStatic)];\n","import * as React from 'react';\n\nimport type { TDateElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nexport function DateElementStatic(props: SlateElementProps<TDateElement>) {\n const { element } = props;\n\n return (\n <SlateElement className=\"inline-block\" {...props}>\n <span className=\"w-fit rounded-sm bg-muted px-1 text-muted-foreground\">\n {element.date ? (\n (() => {\n const today = new Date();\n const elementDate = new Date(element.date);\n const isToday =\n elementDate.getDate() === today.getDate() &&\n elementDate.getMonth() === today.getMonth() &&\n elementDate.getFullYear() === today.getFullYear();\n\n const isYesterday =\n new Date(today.setDate(today.getDate() - 1)).toDateString() ===\n elementDate.toDateString();\n const isTomorrow =\n new Date(today.setDate(today.getDate() + 2)).toDateString() ===\n elementDate.toDateString();\n\n if (isToday) return 'Today';\n if (isYesterday) return 'Yesterday';\n if (isTomorrow) return 'Tomorrow';\n\n return elementDate.toLocaleDateString(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n })()\n ) : (\n <span>Pick a date</span>\n )}\n </span>\n {props.children}\n </SlateElement>\n );\n}\n","import type { SlatePluginConfig } from 'platejs';\n\nimport {\n BaseFontBackgroundColorPlugin,\n BaseFontColorPlugin,\n BaseFontFamilyPlugin,\n BaseFontSizePlugin,\n} from '@platejs/basic-styles';\nimport { KEYS } from 'platejs';\n\nconst options = {\n inject: { targetPlugins: [KEYS.p] },\n} satisfies SlatePluginConfig;\n\nexport const BaseFontKit = [\n BaseFontColorPlugin.configure(options),\n BaseFontBackgroundColorPlugin.configure(options),\n BaseFontSizePlugin.configure(options),\n BaseFontFamilyPlugin.configure(options),\n];\n","import { BaseLineHeightPlugin } from '@platejs/basic-styles';\nimport { KEYS } from 'platejs';\n\nexport const BaseLineHeightKit = [\n BaseLineHeightPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 1.5,\n validNodeValues: [1, 1.2, 1.5, 2, 3],\n },\n targetPlugins: [...KEYS.heading, KEYS.p],\n },\n }),\n];\n","import { BaseLinkPlugin } from '@platejs/link';\n\nimport { LinkElementStatic } from '@/components/ui/link-node-static';\n\nexport const BaseLinkKit = [BaseLinkPlugin.withComponent(LinkElementStatic)];\n","import * as React from 'react';\n\nimport type { TLinkElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { getLinkAttributes } from '@platejs/link';\nimport { SlateElement } from 'platejs/static';\n\nexport function LinkElementStatic(props: SlateElementProps<TLinkElement>) {\n return (\n <SlateElement\n {...props}\n as=\"a\"\n className=\"font-medium text-primary underline decoration-primary underline-offset-4\"\n attributes={{\n ...props.attributes,\n ...getLinkAttributes(props.editor, props.element),\n }}\n >\n {props.children}\n </SlateElement>\n );\n}\n","import { BaseIndentPlugin } from '@platejs/indent';\nimport { KEYS } from 'platejs';\n\nexport const BaseIndentKit = [\n BaseIndentPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n ],\n },\n options: {\n offset: 24,\n },\n }),\n];\n","import * as React from 'react';\n\nimport type { RenderStaticNodeWrapper, TListElement } from 'platejs';\nimport type { SlateRenderElementProps } from 'platejs/static';\n\nimport { isOrderedList } from '@platejs/list';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst config: Record<\n string,\n {\n Li: React.FC<SlateRenderElementProps>;\n Marker: React.FC<SlateRenderElementProps>;\n }\n> = {\n todo: {\n Li: TodoLiStatic,\n Marker: TodoMarkerStatic,\n },\n};\n\nexport const BlockListStatic: RenderStaticNodeWrapper = (props) => {\n if (!props.element.listStyleType) return;\n\n return (props) => <List {...props} />;\n};\n\nfunction List(props: SlateRenderElementProps) {\n const { listStart, listStyleType } = props.element as TListElement;\n const { Li, Marker } = config[listStyleType] ?? {};\n const List = isOrderedList(props.element) ? 'ol' : 'ul';\n\n return (\n <List\n className=\"relative m-0 p-0\"\n style={{ listStyleType }}\n start={listStart}\n >\n {Marker && <Marker {...props} />}\n {Li ? <Li {...props} /> : <li>{props.children}</li>}\n </List>\n );\n}\n\nfunction TodoMarkerStatic(props: SlateRenderElementProps) {\n const checked = props.element.checked as boolean;\n\n return (\n <div contentEditable={false}>\n <button\n className={cn(\n 'peer -left-6 pointer-events-none absolute top-1 size-4 shrink-0 rounded-sm border border-primary bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',\n props.className\n )}\n data-state={checked ? 'checked' : 'unchecked'}\n type=\"button\"\n >\n <div className={cn('flex items-center justify-center text-current')}>\n {checked && <CheckIcon className=\"size-4\" />}\n </div>\n </button>\n </div>\n );\n}\n\nfunction TodoLiStatic(props: SlateRenderElementProps) {\n return (\n <li\n className={cn(\n 'list-none',\n (props.element.checked as boolean) &&\n 'text-muted-foreground line-through'\n )}\n >\n {props.children}\n </li>\n );\n}\n","import { BaseListPlugin } from '@platejs/list';\nimport { KEYS } from 'platejs';\n\nimport { BaseIndentKit } from '@/components/editor/plugins/indent-base-kit';\nimport { BlockListStatic } from '@/components/ui/block-list-static';\n\nexport const BaseListKit = [\n ...BaseIndentKit,\n BaseListPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n ],\n },\n render: {\n belowNodes: BlockListStatic,\n },\n }),\n];\n","import { BaseEquationPlugin, BaseInlineEquationPlugin } from '@platejs/math';\n\nimport {\n EquationElementStatic,\n InlineEquationElementStatic,\n} from '@/components/ui/equation-node-static';\n\nexport const BaseMathKit = [\n BaseInlineEquationPlugin.withComponent(InlineEquationElementStatic),\n BaseEquationPlugin.withComponent(EquationElementStatic),\n];\n","import * as React from 'react';\n\nimport type { TEquationElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { getEquationHtml } from '@platejs/math';\nimport { RadicalIcon } from 'lucide-react';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function EquationElementStatic(\n props: SlateElementProps<TEquationElement>\n) {\n const { element } = props;\n\n const html = getEquationHtml({\n element,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <SlateElement className=\"my-1\" {...props}>\n <div\n className={cn(\n 'group flex select-none items-center justify-center rounded-sm hover:bg-primary/10 data-[selected=true]:bg-primary/10',\n element.texExpression.length === 0 ? 'bg-muted p-3 pr-9' : 'px-2 py-1'\n )}\n >\n {element.texExpression.length > 0 ? (\n <span\n dangerouslySetInnerHTML={{\n __html: html,\n }}\n />\n ) : (\n <div className=\"flex h-7 w-full items-center gap-2 whitespace-nowrap text-muted-foreground text-sm\">\n <RadicalIcon className=\"size-6 text-muted-foreground/80\" />\n <div>Add a Tex equation</div>\n </div>\n )}\n </div>\n {props.children}\n </SlateElement>\n );\n}\n\nexport function InlineEquationElementStatic(\n props: SlateElementProps<TEquationElement>\n) {\n const html = getEquationHtml({\n element: props.element,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <SlateElement\n {...props}\n className=\"inline-block select-none rounded-sm [&_.katex-display]:my-0\"\n >\n <div\n className={cn(\n 'after:-top-0.5 after:-left-1 after:absolute after:inset-0 after:z-1 after:h-[calc(100%)+4px] after:w-[calc(100%+8px)] after:rounded-sm after:content-[\"\"]',\n 'h-6',\n props.element.texExpression.length === 0 &&\n 'text-muted-foreground after:bg-neutral-500/10'\n )}\n >\n <span\n className={cn(\n props.element.texExpression.length === 0 && 'hidden',\n 'font-mono leading-none'\n )}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </div>\n {props.children}\n </SlateElement>\n );\n}\n","import { BaseCaptionPlugin } from '@platejs/caption';\nimport {\n BaseAudioPlugin,\n BaseFilePlugin,\n BaseImagePlugin,\n BaseMediaEmbedPlugin,\n BasePlaceholderPlugin,\n BaseVideoPlugin,\n} from '@platejs/media';\nimport { KEYS } from 'platejs';\n\nimport { AudioElementStatic } from '@/components/ui/media-audio-node-static';\nimport { FileElementStatic } from '@/components/ui/media-file-node-static';\nimport { ImageElementStatic } from '@/components/ui/media-image-node-static';\nimport { VideoElementStatic } from '@/components/ui/media-video-node-static';\n\nexport const BaseMediaKit = [\n BaseImagePlugin.withComponent(ImageElementStatic),\n BaseVideoPlugin.withComponent(VideoElementStatic),\n BaseAudioPlugin.withComponent(AudioElementStatic),\n BaseFilePlugin.withComponent(FileElementStatic),\n BaseCaptionPlugin.configure({\n options: {\n query: {\n allow: [KEYS.img, KEYS.video, KEYS.audio, KEYS.file, KEYS.mediaEmbed],\n },\n },\n }),\n BaseMediaEmbedPlugin,\n BasePlaceholderPlugin,\n];\n","import * as React from 'react';\n\nimport type { TCaptionProps, TImageElement, TResizableProps } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { NodeApi } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function ImageElementStatic(\n props: SlateElementProps<TImageElement & TCaptionProps & TResizableProps>\n) {\n const { align = 'center', caption, url, width } = props.element;\n\n return (\n <SlateElement {...props} className=\"py-2.5\">\n <figure className=\"group relative m-0 inline-block\" style={{ width }}>\n <div\n className=\"relative min-w-[92px] max-w-full\"\n style={{ textAlign: align }}\n >\n <img\n className={cn(\n 'w-full max-w-full cursor-default object-cover px-0',\n 'rounded-sm'\n )}\n alt={(props.attributes as any).alt}\n src={url}\n />\n {caption && (\n <figcaption className=\"mx-auto mt-2 h-[24px] max-w-full\">\n {NodeApi.string(caption[0])}\n </figcaption>\n )}\n </div>\n </figure>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport type { TCaptionElement, TResizableProps, TVideoElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { NodeApi } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nexport function VideoElementStatic(\n props: SlateElementProps<TVideoElement & TCaptionElement & TResizableProps>\n) {\n const { align = 'center', caption, url, width } = props.element;\n\n return (\n <SlateElement className=\"py-2.5\" {...props}>\n <div style={{ textAlign: align }}>\n <figure\n className=\"group relative m-0 inline-block cursor-default\"\n style={{ width }}\n >\n <video\n className=\"w-full max-w-full rounded-sm object-cover px-0\"\n src={url}\n controls\n />\n {caption && <figcaption>{NodeApi.string(caption[0])}</figcaption>}\n </figure>\n </div>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport type { TAudioElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nexport function AudioElementStatic(props: SlateElementProps<TAudioElement>) {\n return (\n <SlateElement {...props} className=\"mb-1\">\n <figure className=\"group relative cursor-default\">\n <div className=\"h-16\">\n <audio className=\"size-full\" src={props.element.url} controls />\n </div>\n </figure>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport type { TFileElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { FileUp } from 'lucide-react';\nimport { SlateElement } from 'platejs/static';\n\nexport function FileElementStatic(props: SlateElementProps<TFileElement>) {\n const { name, url } = props.element;\n\n return (\n <SlateElement className=\"my-px rounded-sm\" {...props}>\n <a\n className=\"group relative m-0 flex cursor-pointer items-center rounded px-0.5 py-[3px] hover:bg-muted\"\n contentEditable={false}\n download={name}\n href={url}\n rel=\"noopener noreferrer\"\n role=\"button\"\n target=\"_blank\"\n >\n <div className=\"flex items-center gap-1 p-1\">\n <FileUp className=\"size-5\" />\n <div>{name}</div>\n </div>\n </a>\n {props.children}\n </SlateElement>\n );\n}\n","import { BaseMentionPlugin } from '@platejs/mention';\n\nimport { MentionElementStatic } from '@/components/ui/mention-node-static';\n\nexport const BaseMentionKit = [\n BaseMentionPlugin.withComponent(MentionElementStatic),\n];\n","import * as React from 'react';\n\nimport type { TMentionElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { KEYS } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function MentionElementStatic(\n props: SlateElementProps<TMentionElement> & {\n prefix?: string;\n }\n) {\n const { prefix } = props;\n const element = props.element;\n\n return (\n <SlateElement\n {...props}\n className={cn(\n 'inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline font-medium text-sm',\n element.children[0][KEYS.bold] === true && 'font-bold',\n element.children[0][KEYS.italic] === true && 'italic',\n element.children[0][KEYS.underline] === true && 'underline'\n )}\n attributes={{\n ...props.attributes,\n 'data-slate-value': element.value,\n }}\n >\n {props.children}\n {prefix}\n {element.value}\n </SlateElement>\n );\n}\n","import { BaseSuggestionPlugin } from '@platejs/suggestion';\n\nimport { SuggestionLeafStatic } from '@/components/ui/suggestion-node-static';\n\nexport const BaseSuggestionKit = [\n BaseSuggestionPlugin.withComponent(SuggestionLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { TSuggestionText } from 'platejs';\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { BaseSuggestionPlugin } from '@platejs/suggestion';\nimport { SlateLeaf } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function SuggestionLeafStatic(props: SlateLeafProps<TSuggestionText>) {\n const { editor, leaf } = props;\n\n const dataList = editor\n .getApi(BaseSuggestionPlugin)\n .suggestion.dataList(leaf);\n const hasRemove = dataList.some((data) => data.type === 'remove');\n const diffOperation = { type: hasRemove ? 'delete' : 'insert' } as const;\n\n const Component = ({ delete: 'del', insert: 'ins', update: 'span' } as const)[\n diffOperation.type\n ];\n\n return (\n <SlateLeaf\n {...props}\n as={Component}\n className={cn(\n 'border-b-2 border-b-brand/[.24] bg-brand/[.08] text-brand/80 no-underline transition-colors duration-200',\n hasRemove &&\n 'border-b-gray-300 bg-gray-300/25 text-gray-400 line-through'\n )}\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import * as React from 'react';\n\nimport type { TTableCellElement, TTableElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { BaseTablePlugin } from '@platejs/table';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function TableElementStatic({\n children,\n ...props\n}: SlateElementProps<TTableElement>) {\n const { disableMarginLeft } = props.editor.getOptions(BaseTablePlugin);\n const marginLeft = disableMarginLeft ? 0 : props.element.marginLeft;\n\n return (\n <SlateElement\n {...props}\n className=\"overflow-x-auto py-5\"\n style={{ paddingLeft: marginLeft }}\n >\n <div className=\"group/table relative w-fit\">\n <table className=\"mr-0 ml-px table h-px table-fixed border-collapse\">\n <tbody className=\"min-w-full\">{children}</tbody>\n </table>\n </div>\n </SlateElement>\n );\n}\n\nexport function TableRowElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props} as=\"tr\" className=\"h-full\">\n {props.children}\n </SlateElement>\n );\n}\n\nexport function TableCellElementStatic({\n isHeader,\n ...props\n}: SlateElementProps<TTableCellElement> & {\n isHeader?: boolean;\n}) {\n const { editor, element } = props;\n const { api } = editor.getPlugin(BaseTablePlugin);\n\n const { minHeight, width } = api.table.getCellSize({ element });\n const borders = api.table.getCellBorders({ element });\n\n return (\n <SlateElement\n {...props}\n as={isHeader ? 'th' : 'td'}\n className={cn(\n 'h-full overflow-visible border-none bg-background p-0',\n element.background ? 'bg-(--cellBackground)' : 'bg-background',\n isHeader && 'text-left font-normal *:m-0',\n 'before:size-full',\n \"before:absolute before:box-border before:select-none before:content-['']\",\n borders &&\n cn(\n borders.bottom?.size && 'before:border-b before:border-b-border',\n borders.right?.size && 'before:border-r before:border-r-border',\n borders.left?.size && 'before:border-l before:border-l-border',\n borders.top?.size && 'before:border-t before:border-t-border'\n )\n )}\n style={\n {\n '--cellBackground': element.background,\n maxWidth: width || 240,\n minWidth: width || 120,\n } as React.CSSProperties\n }\n attributes={{\n ...props.attributes,\n colSpan: api.table.getColSpan(element),\n rowSpan: api.table.getRowSpan(element),\n }}\n >\n <div\n className=\"relative z-20 box-border h-full px-4 py-2\"\n style={{ minHeight }}\n >\n {props.children}\n </div>\n </SlateElement>\n );\n}\n\nexport function TableCellHeaderElementStatic(\n props: SlateElementProps<TTableCellElement>\n) {\n return <TableCellElementStatic {...props} isHeader />;\n}\n","import {\n BaseTableCellHeaderPlugin,\n BaseTableCellPlugin,\n BaseTablePlugin,\n BaseTableRowPlugin,\n} from '@platejs/table';\n\nimport {\n TableCellElementStatic,\n TableCellHeaderElementStatic,\n TableElementStatic,\n TableRowElementStatic,\n} from '@/components/ui/table-node-static';\n\nexport const BaseTableKit = [\n BaseTablePlugin.withComponent(TableElementStatic),\n BaseTableRowPlugin.withComponent(TableRowElementStatic),\n BaseTableCellPlugin.withComponent(TableCellElementStatic),\n BaseTableCellHeaderPlugin.withComponent(TableCellHeaderElementStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { type Heading, BaseTocPlugin, isHeading } from '@platejs/toc';\nimport { cva } from 'class-variance-authority';\nimport { type SlateEditor, type TElement, NodeApi } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nimport { Button } from '@/components/ui/button';\n\nconst headingItemVariants = cva(\n 'block h-auto w-full cursor-pointer truncate rounded-none px-0.5 py-1.5 text-left font-medium text-muted-foreground underline decoration-[0.5px] underline-offset-4 hover:bg-accent hover:text-muted-foreground',\n {\n variants: {\n depth: {\n 1: 'pl-0.5',\n 2: 'pl-[26px]',\n 3: 'pl-[50px]',\n },\n },\n }\n);\n\nexport function TocElementStatic(props: SlateElementProps) {\n const { editor } = props;\n const headingList = getHeadingList(editor);\n\n return (\n <SlateElement {...props} className=\"mb-1 p-0\">\n <div>\n {headingList.length > 0 ? (\n headingList.map((item) => (\n <Button\n key={item.title}\n variant=\"ghost\"\n className={headingItemVariants({\n depth: item.depth as 1 | 2 | 3,\n })}\n >\n {item.title}\n </Button>\n ))\n ) : (\n <div className=\"text-gray-500 text-sm\">\n Create a heading to display the table of contents.\n </div>\n )}\n </div>\n {props.children}\n </SlateElement>\n );\n}\n\nconst headingDepth: Record<string, number> = {\n h1: 1,\n h2: 2,\n h3: 3,\n h4: 4,\n h5: 5,\n h6: 6,\n};\n\nconst getHeadingList = (editor?: SlateEditor) => {\n if (!editor) return [];\n\n const options = editor.getOptions(BaseTocPlugin);\n\n if (options.queryHeading) {\n return options.queryHeading(editor);\n }\n\n const headingList: Heading[] = [];\n\n const values = editor.api.nodes<TElement>({\n at: [],\n match: (n) => isHeading(n),\n });\n\n if (!values) return [];\n\n Array.from(values).forEach(([node, path]) => {\n const { type } = node;\n const title = NodeApi.string(node);\n const depth = headingDepth[type];\n const id = node.id as string;\n\n if (title) {\n headingList.push({ id, depth, path, title, type });\n }\n });\n\n return headingList;\n};\n","import { BaseTocPlugin } from '@platejs/toc';\n\nimport { TocElementStatic } from '@/components/ui/toc-node-static';\n\nexport const BaseTocKit = [BaseTocPlugin.withComponent(TocElementStatic)];\n","import { BaseTogglePlugin } from '@platejs/toggle';\n\nimport { ToggleElementStatic } from '@/components/ui/toggle-node-static';\n\nexport const BaseToggleKit = [\n BaseTogglePlugin.withComponent(ToggleElementStatic),\n];\n","import { BaseAlignKit } from './plugins/align-base-kit';\nimport { BaseBasicBlocksKit } from './plugins/basic-blocks-base-kit';\nimport { BaseBasicMarksKit } from './plugins/basic-marks-base-kit';\nimport { BaseCalloutKit } from './plugins/callout-base-kit';\nimport { BaseCodeBlockKit } from './plugins/code-block-base-kit';\nimport { BaseColumnKit } from './plugins/column-base-kit';\nimport { BaseCommentKit } from './plugins/comment-base-kit';\nimport { BaseDateKit } from './plugins/date-base-kit';\nimport { BaseFontKit } from './plugins/font-base-kit';\nimport { BaseLineHeightKit } from './plugins/line-height-base-kit';\nimport { BaseLinkKit } from './plugins/link-base-kit';\nimport { BaseListKit } from './plugins/list-base-kit';\nimport { MarkdownKit } from './plugins/markdown-kit';\nimport { BaseMathKit } from './plugins/math-base-kit';\nimport { BaseMediaKit } from './plugins/media-base-kit';\nimport { BaseMentionKit } from './plugins/mention-base-kit';\nimport { BaseSuggestionKit } from './plugins/suggestion-base-kit';\nimport { BaseTableKit } from './plugins/table-base-kit';\nimport { BaseTocKit } from './plugins/toc-base-kit';\nimport { BaseToggleKit } from './plugins/toggle-base-kit';\n\nexport const BaseEditorKit: any[] = [\n ...BaseBasicBlocksKit,\n ...BaseCodeBlockKit,\n ...BaseTableKit,\n ...BaseToggleKit,\n ...BaseTocKit,\n ...BaseMediaKit,\n ...BaseCalloutKit,\n ...BaseColumnKit,\n ...BaseMathKit,\n ...BaseDateKit,\n ...BaseLinkKit,\n ...BaseMentionKit,\n ...BaseBasicMarksKit,\n ...BaseFontKit,\n ...BaseListKit,\n ...BaseAlignKit,\n ...BaseLineHeightKit,\n ...BaseCommentKit,\n ...BaseSuggestionKit,\n ...MarkdownKit,\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { ChevronRight } from 'lucide-react';\nimport { SlateElement } from 'platejs/static';\n\nexport function ToggleElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props} className=\"pl-6\">\n <div\n className=\"-left-0.5 absolute top-0 size-6 cursor-pointer select-none items-center justify-center rounded-md p-px text-muted-foreground transition-colors hover:bg-accent [&_svg]:size-4\"\n contentEditable={false}\n >\n <ChevronRight className=\"rotate-0 transition-transform duration-75\" />\n </div>\n {props.children}\n </SlateElement>\n );\n}\n"],"names":["process","env","NODE_ENV","getComponentNameFromType","type","$$typeof","REACT_CLIENT_REFERENCE","displayName","name","REACT_FRAGMENT_TYPE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","tag","console","error","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","Symbol","toStringTag","constructor","call","getTaskName","UnknownOwner","Error","elementRefGetterWithDeprecationWarning","componentName","this","didWarnAboutElementRef","props","ref","jsxDEVImpl","config","maybeKey","isStaticChildren","debugStack","debugTask","dispatcher","children","isArrayImpl","length","validateChildKeys","Object","freeze","hasOwnProperty","keys","filter","k","join","didWarnAboutKeySpread","getter","getOwnPropertyDescriptor","get","isReactWarning","key","hasValidKey","propName","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","defineKeyPropWarningGetter","owner","refProp","REACT_ELEMENT_TYPE","_owner","enumerable","_store","writable","ReactElement","ReactSharedInternals","A","getOwner","node","isValidElement","validated","status","object","React","require$$0","for","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","unknownOwnerDebugStack","react_stack_bottom_frame","callStackForError","bind","unknownOwnerDebugTask","reactJsxRuntime_development","Fragment","jsx","trackActualOwner","recentlyCreatedOwnerStacks","jsxs","jsxRuntimeModule","exports","jsxProd","reactJsxRuntime_production","require$$1","AlignKit","TextAlignPlugin","configure","inject","nodeProps","defaultNodeValue","nodeKey","styleKey","validNodeValues","targetPlugins","KEYS","heading","p","img","mediaEmbed","autoformatMarks","match","mode","bold","italic","underline","strikethrough","sup","sub","highlight","code","autoformatBlocks","h1","h2","h3","h4","h5","h6","blockquote","codeBlock","format","editor","insertEmptyCodeBlock","defaultType","insertNodesOptions","select","hr","tf","setNodes","insertNodes","text","autoformatLists","toggleList","listStyleType","ul","String","raw","matchByRegex","matchString","listRestartPolite","Number","ol","listTodo","checked","AutoformatKit","AutoformatPlugin","options","enableUndoOnDelete","rules","autoformatSmartQuotes","autoformatPunctuation","autoformatLegal","autoformatLegalHtml","autoformatArrow","autoformatMath","map","rule","query","api","some","getType","headingVariants","cva","variants","variant","HeadingElement","PlateElement","as","className","cn","inputs","twMerge","clsx","BasicBlocksKit","ParagraphPlugin","withComponent","H1Plugin","component","break","empty","shortcuts","toggle","H2Plugin","H3Plugin","H4Plugin","H5Plugin","H6Plugin","BlockquotePlugin","HorizontalRulePlugin","readOnly","useReadOnly","selected","useSelected","focused","useFocused","contentEditable","BasicMarksKit","BoldPlugin","ItalicPlugin","UnderlinePlugin","CodePlugin","PlateLeaf","StrikethroughPlugin","SubscriptPlugin","SuperscriptPlugin","HighlightPlugin","KbdPlugin","ContextMenu","ContextMenuPrimitive","Root","ContextMenuTrigger","Trigger","ContextMenuGroup","Group","ContextMenuSub","Sub","ContextMenuSubTrigger","inset","SubTrigger","ChevronRightIcon","ContextMenuSubContent","SubContent","ContextMenuContent","Portal","Content","ContextMenuItem","Item","blockSelectionVariants","defaultVariants","active","false","true","BlockSelection","isBlockSelected","useBlockSelected","isDragging","usePluginOption","DndPlugin","plugin","BlockMenuKit","BlockSelectionPlugin","enableContextMenu","isSelectable","element","getPluginTypes","column","codeLine","td","includes","onKeyDownSelecting","isHotkey","getApi","AIChatPlugin","aiChat","show","belowRootNodes","attributes","BlockMenuPlugin","aboveEditable","useEditorPlugin","setValue","useState","isTouch","isTouchDevice","setIsTouchDevice","useEffect","onResize","window","navigator","maxTouchPoints","addEventListener","removeEventListener","useIsTouchDevice","usePlateState","isOpen","BLOCK_CONTEXT_MENU_ID","handleTurnInto","useCallback","blockSelection","getNodes","forEach","path","listType","unsetNodes","at","toggleBlock","handleAlign","align","getTransforms","onOpenChange","open","blockMenu","hide","modal","asChild","onContextMenu","event","dataset","target","slateEditor","plateOpenContextMenu","preventDefault","setTimeout","clientX","y","clientY","onCloseAutoFocus","focus","onClick","removeNodes","duplicate","setIndent","BlockPlaceholderKit","BlockPlaceholderPlugin","placeholders","buttonVariants","default","destructive","outline","secondary","ghost","link","size","sm","lg","icon","Button","Comp","Slot","TooltipProvider","delayDuration","TooltipPrimitive","Provider","Tooltip","TooltipTrigger","TooltipContent","sideOffset","Arrow","DropdownMenu","DropdownMenuPrimitive","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","CheckIcon","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","CircleIcon","DropdownMenuLabel","Label","DropdownMenuSeparator","Separator","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent","orientation","decorative","SeparatorPrimitive","Toolbar","ToolbarPrimitive","ToolbarToggleGroup","toolbarButtonVariants","dropdownArrowVariants","ToolbarButton","Component","isDropdown","pressed","disabled","ToolbarToggleItem","ChevronDown","tooltip","tooltipContentProps","tooltipProps","tooltipTriggerProps","mounted","setMounted","ToolbarSplitButton","ToolbarSplitButtonPrimary","ToolbarSplitButtonSecondary","stopPropagation","role","ToggleItem","ToolbarGroup","ToolbarMenuGroup","label","EmojiPopover","control","setIsOpen","Popover","EmojiPicker","clearSearch","emoji","emojiLibrary","focusedCategory","hasFound","i18n","icons","categories","emojiCategoryIcons","search","emojiSearchIcons","isSearching","refs","searchResult","searchValue","setSearch","settings","EmojiSettings","visibleCategories","handleCategoryClick","onMouseOver","onSelectEmoji","EmojiPickerNavigation","EmojiPickerSearchBar","EmojiPickerSearchAndClear","EmojiPickerContent","EmojiPickerPreview","EmojiButton","memo","index","onSelect","onMouseEnter","onMouseLeave","skins","native","tabIndex","style","fontFamily","RowOfButtons","row","id","elements","emojiId","getEmoji","getRowWidth","perLine","buttonSize","isCategoryVisible","categoryId","has","EmojiList","getGrid","sections","section","root","width","height","getRows","SearchList","current","contentRoot","content","onChange","placeholder","autoComplete","autoFocus","loupe","title","clear","delete","EmojiPreview","NoEmoji","searchNoResultsTitle","searchNoResultsSubtitle","PickAnEmoji","pick","showPickEmoji","showNoEmoji","showPreview","side","activity","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","viewBox","xmlns","cx","cy","r","d","solid","custom","StarIcon","flags","FlagIcon","foods","AppleIcon","frequent","ClockIcon","nature","LeafIcon","objects","LightbulbIcon","people","SmileIcon","places","CompassIcon","symbols","MusicIcon","XIcon","SearchIcon","CalloutKit","CalloutPlugin","emojiPickerState","useEmojiDropdownMenuState","closeOnSelect","emojiToolbarDropdownProps","calloutProps","useCalloutEmojiPicker","backgroundColor","Command","CommandPrimitive","CommandInput","Input","CommandList","List","CommandEmpty","Empty","CommandGroup","CommandItem","PopoverPrimitive","PopoverTrigger","PopoverContent","PopoverAnchor","Anchor","CodeBlockCombobox","setOpen","useEditorRef","useElement","lang","setSearchValue","items","useMemo","languages","language","toLowerCase","find","shouldFilter","onValueChange","Check","CopyButton","hasCopied","setHasCopied","clipboard","writeText","CopyIcon","lowlight","createLowlight","all","CodeBlockKit","CodeBlockPlugin","isLangSupported","formatCodeBlock","BracesIcon","NodeApi","string","CodeLinePlugin","CodeSyntaxPlugin","tokenClassName","leaf","ColumnElement","withHOC","ResizableProvider","isSelectionAreaVisible","previewRef","handleRef","useDraggable","canDropNode","dragEntry","dropEntry","PathApi","equals","parent","ColumnDragHandle","useComposedRef","DropLine","GripHorizontal","dropLine","useDropLine","ColumnFloatingToolbar","buttonProps","useRemoveNodeButton","isCollapsed","useEditorSelector","useFocusedLast","onColumnChange","widths","setColumns","onOpenAutoFocus","DoubleColumnOutlined","ThreeColumnOutlined","RightSideDoubleColumnOutlined","LeftSideDoubleColumnOutlined","DoubleSideDoubleColumnOutlined","Trash2Icon","clipRule","fillRule","ColumnKit","ColumnPlugin","ColumnItemPlugin","commentPlugin","toTPlatePlugin","BaseCommentPlugin","handlers","setOption","isSet","unsetActiveSuggestion","isSlateString","parentElement","classList","contains","commentsEntry","comment","nodeId","activeId","commentingBlock","hoverId","uniquePathMap","Map","extendTransforms","setDraft","block","collapse","getDraftCommentKey","selection","slice","isOverlapping","getCommentCount","currentId","isActive","isHover","CommentKit","CursorOverlay","cursors","useCursorOverlay","cursor","Cursor","caretPosition","data","selectionRects","streaming","selectionStyle","isCursor","RangeApi","position","i","CursorOverlayKit","CursorOverlayPlugin","afterEditable","Calendar","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","defaultClassNames","getDefaultClassNames","DayPicker","formatMonthDropdown","date","toLocaleString","month","months","nav","button_previous","button_next","month_caption","dropdowns","dropdown_root","dropdown","caption_label","table","weekdays","weekday","week","week_number_header","week_number","day","showWeekNumber","range_start","range_middle","range_end","today","outside","hidden","rootRef","Chevron","ChevronLeftIcon","ChevronDownIcon","DayButton","CalendarDayButton","WeekNumber","modifiers","useRef","toLocaleDateString","DateKit","DatePlugin","trigger","draggable","Date","elementDate","isToday","getDate","getMonth","getFullYear","isYesterday","setDate","toDateString","isTomorrow","year","initialFocus","UNDRAGGABLE_KEYS","tr","Draggable","blockSelectionApi","isAboutToDrag","nodeRef","onDropHandler","_","dragItem","add","resetPreview","isInColumn","isInTable","previewTop","setPreviewTop","replaceChildren","remove","dragButtonTop","setDragButtonTop","getPluginByType","isContainer","calcDragButtonTop","Gutter","top","DragHandle","addOnContextMenu","MemoizedChildren","onMouseDown","button","shiftKey","sort","selectionNodes","blocks","findPath","expandListItemsWithChildren","blur","createDragPreviewElements","append","set","selectedBlocks","processedBlocks","ids","calculatePreviewTop","onMouseUp","GripVertical","removeDataAttributes","from","attr","startsWith","removeAttribute","child","domNode","toDOMNode","newDomNode","cloneNode","original","cloned","scrollLeft","scrollWrapper","document","createElement","overflow","clientWidth","innerContainer","transform","scrollWidth","firstChild","originalStyles","getComputedStyle","padding","applyScrollCompensation","push","wrapper","display","lastDomNode","lastDomNodeRect","getBoundingClientRect","distance","bottom","marginTop","resolveElement","editable","firstSelectedChild","firstDomNode","editorPaddingTop","paddingTop","replace","firstNodeToEditorDistance","firstMarginTopString","currentToEditorDistance","currentMarginTopString","DndKit","enableScroller","onDropFiles","PlaceholderPlugin","insert","media","files","nextBlock","aboveNodes","dom","isType","aboveSlate","DndProvider","backend","HTML5Backend","DocxKit","DocxPlugin","JuicePlugin","ExitBreakKit","ExitBreakPlugin","insertBefore","FixedToolbar","AlignLeftIcon","AlignCenterIcon","AlignRightIcon","AlignJustifyIcon","AlignToolbarButton","useSelectionFragmentProp","defaultValue","getProp","IconValue","item","textAlign","Icon","itemValue","isObject_1","freeGlobal","global","_freeGlobal","freeSelf","self","Function","_root","trimmedEndIndex","reWhitespace","_trimmedEndIndex","test","charAt","reTrimStart","_baseTrim","_Symbol","getRawTag","objectProto","nativeObjectToString","toString","symToStringTag","_getRawTag","isOwn","unmasked","result","objectToString","_objectToString","require$$2","_baseGetTag","baseGetTag","isObjectLike","isObjectLike_1","isSymbol_1","isObject","now","now_1","toNumber","baseTrim","isSymbol","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","toNumber_1","other","valueOf","isBinary","nativeMax","Math","max","nativeMin","min","debounce_1","func","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","arguments","leadingEdge","clearTimeout","cancel","flush","FontColorToolbarButton","nodeType","selectionDefined","color","mark","selectedColor","setSelectedColor","onToggle","updateColor","addMarks","updateColorAndClose","clearColor","removeMarks","ColorPicker","colors","DEFAULT_COLORS","customColors","DEFAULT_CUSTOM_COLORS","updateCustomColor","ColorCustom","ColorDropdownMenuItems","EraserIcon","prev","next","customColor","setCustomColor","c","computedColors","isBrightColor","updateCustomColorDebounced","debounce","ColorInput","PlusIcon","inputRef","Children","cloneElement","click","ColorDropdownMenuItem","isSelected","RedoToolbarButton","history","redos","redo","Redo2Icon","UndoToolbarButton","undos","undo","Undo2Icon","IndentToolbarButton","useIndentButton","IndentIcon","OutdentToolbarButton","useOutdentButton","OutdentIcon","ACTION_THREE_COLUMNS","insertList","create","indent","insertBlockMap","insertColumnGroup","columns","audio","insertAudioPlaceholder","callout","insertCallout","insertCodeBlock","equation","insertEquation","excalidraw","insertExcalidraw","file","insertFilePlaceholder","insertMedia","TablePlugin","toc","insertToc","video","insertVideoPlaceholder","insertInlineMap","insertDate","inlineEquation","insertInlineEquation","triggerFloatingLink","insertBlock","upsert","withoutNormalizing","currentNode","isCurrentBlockEmpty","isEmpty","currentBlockType","getBlockType","isSameBlockType","SuggestionPlugin","suggestion","withoutSuggestions","previousEmptyBlock","insertInlineElement","setList","entry","setBlockMap","toggleColumnGroup","toggleCodeBlock","groups","group","PilcrowIcon","Heading1Icon","Heading2Icon","Heading3Icon","TableIcon","ListIcon","ListOrderedIcon","ImageIcon","Link2Icon","InsertToolbarButton","nestedItems","LinkToolbarButton","state","useLinkToolbarButtonState","useLinkToolbarButton","Link","BulletedListToolbarButton","someList","ListStyleType","Disc","Circle","Square","alignOffset","NumberedListToolbarButton","Decimal","LowerAlpha","UpperAlpha","LowerRoman","UpperRoman","ListOrdered","MarkToolbarButton","useMarkToolbarButtonState","useMarkToolbarButton","AlertDialog","AlertDialogPrimitive","AlertDialogPortal","AlertDialogOverlay","Overlay","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","Action","AlertDialogCancel","Cancel","MEDIA_CONFIG","accept","AudioLinesIcon","FileUpIcon","FilmIcon","MediaToolbarButton","currentConfig","dialogOpen","setDialogOpen","openFilePicker","useFilePicker","multiple","onFilesSelected","plainFiles","updatedFiles","onKeyDown","LinkIcon","MediaUrlDialogContent","url","setUrl","embedMedia","isUrl","toast","split","pop","htmlFor","MoreToolbarButton","MoreHorizontalIcon","toggleMark","SuperscriptIcon","SubscriptIcon","TableToolbarButton","tableSelected","mergeState","useTableMergeState","Table","Grid3x3Icon","TablePicker","canMerge","merge","Combine","canSplit","Ungroup","tableRow","before","ArrowUp","ArrowDown","tableColumn","ArrowLeft","ArrowRight","tablePicker","setTablePicker","grid","colCount","rowCount","rows","rowIndex","columIndex","onMouseMove","colIndex","newGrid","j","onCellMove","turnIntoItems","keywords","Heading4Icon","Heading5Icon","Heading6Icon","TurnIntoToolbarButton","selectedItem","setEntry","setBlockType","DropdownMenuItemIndicator","FixedToolbarButtons","useEditorReadOnly","BoldIcon","ItalicIcon","UnderlineIcon","StrikethroughIcon","BaselineIcon","PaintBucketIcon","FixedToolbarKit","createPlatePlugin","beforeEditable","FloatingToolbar","editorId","useEditorId","focusedEditorId","useEventEditorValue","isFloatingLinkOpen","isAIChatOpen","floatingToolbarState","useFloatingToolbarState","hideToolbar","floatingOptions","middleware","offset","flip","fallbackPlacements","placement","clickOutsideRef","rootProps","floatingRef","useFloatingToolbar","FloatingToolbarButtons","FloatingToolbarKit","FontKit","FontColorPlugin","FontBackgroundColorPlugin","FontSizePlugin","FontFamilyPlugin","LineHeightKit","LineHeightPlugin","popoverVariants","inputVariants","LinkFloatingToolbar","activeCommentId","activeSuggestionId","insertState","useFloatingLinkInsertState","insertProps","insertRef","textInputProps","useFloatingLinkInsert","editState","useFloatingLinkEditState","editButtonProps","editProps","editRef","unlinkButtonProps","useFloatingLinkEdit","inputProps","useFormInputProps","preventDefaultOnEnterKeydown","input","FloatingLinkUrlInput","Text","editContent","isEditing","LinkOpenButton","Unlink","useEditorSelection","getLinkAttributes","ExternalLink","LinkKit","LinkPlugin","suggestionData","IndentKit","IndentPlugin","Checkbox","CheckboxPrimitive","Indicator","todo","Li","Marker","useTodoListElementState","checkboxProps","useTodoListElement","listStart","isOrderedList","start","ListKit","ListPlugin","belowNodes","MarkdownKit","MarkdownPlugin","plainMarks","remarkPlugins","remarkMath","remarkGfm","remarkMdx","remarkMention","EquationInput","createPrimitiveComponent","TextareaAutosize","propsHook","useEquationInput","EquationPopoverContent","isInline","onClose","onEscapeKeyDown","CornerDownLeftIcon","MathKit","InlineEquationPlugin","katexRef","useEquationElement","displayMode","errorColor","fleqn","leqno","macros","output","strict","throwOnError","trust","texExpression","RadicalIcon","EquationPlugin","captionVariants","center","left","right","Caption","CaptionPrimitive","CaptionTextarea","CaptionTextareaPrimitive","CaptionButton","useCaptionButton","stateHook","useCaptionButtonState","AudioElement","unsafeUrl","useMediaState","src","controls","MediaToolbar","isFocusedLast","selectionCollapsed","isExpanded","isImagePreviewOpen","useImagePreviewValue","useFloatingMediaValue","FloatingMediaStore","FloatingMediaPrimitive","UrlInput","EditButton","mediaResizeHandleVariants","direction","resizeHandleVariants","ResizeHandle","useResizeHandleState","resizeHandle","useResizeHandle","isResizing","resizableVariants","Resizable","ResizablePrimitive","MediaEmbedElement","embed","isTweet","isVideo","isYoutube","urlParsers","parseTwitterUrl","parseVideoUrl","useResizableValue","provider","MediaEmbedPlugin","maxWidth","minWidth","LiteYouTubeEmbed","wrapperClass","allowFullScreen","Tweet","FileElement","download","href","rel","FileUp","ImageElement","ImagePlugin","Image","alt","onFocus","useUploadFile","onUploadComplete","onUploadError","uploadedFile","setUploadedFile","uploadingFile","setUploadingFile","progress","setProgress","isUploading","setIsUploading","uploadFile","async","res","uploadFiles","onUploadProgress","errorMessage","err","unknownError","z","ZodError","issues","issue","message","getErrorMessage","mockUploadedFile","appUrl","URL","createObjectURL","simulateProgress","Promise","resolve","useUploadThing","generateReactHelpers","CONTENT","AudioLines","Film","PlaceholderElement","PlaceholderProvider","loading","currentContent","mediaType","isImage","imageRef","firstFile","restFiles","replaceCurrentPlaceholder","addUploadingFile","withoutSaving","initialHeight","initialWidth","isUpload","placeholderId","updateUploadHistory","removeUploadingFile","isReplaced","currentFiles","getUploadingFile","formatBytes","Loader2Icon","ImageProgress","objectUrl","setObjectUrl","revokeObjectURL","round","bytes","opts","decimals","sizeType","floor","log","toFixed","ScaleInput","scaleInputProps","useScaleInput","useUploadErrorToast","uploadError","UploadErrorCode","INVALID_FILE_SIZE","f","INVALID_FILE_TYPE","TOO_LARGE","maxFileSize","TOO_LESS_FILES","minFileCount","fileType","TOO_MANY_FILES","maxFileCount","VideoElement","isEditorMounted","useEditorMounted","ReactPlayer","MediaKit","disableUploadInsert","scale","isEditingScale","closeProps","currentUrlIndex","maskLayerProps","nextDisabled","nextProps","prevDisabled","prevProps","scaleTextProps","zommOutProps","zoomInDisabled","zoomInProps","zoomOutDisabled","useImagePreview","scrollSpeed","PreviewImage","Minus","Plus","Download","X","VideoPlugin","AudioPlugin","FilePlugin","disableEmptyPlaceholder","CaptionPlugin","allow","InlineComboboxContext","createContext","defaultFilter","uniqueTerms","Set","Boolean","keyword","filterWords","InlineCombobox","hideWhenNoValue","setValueProp","showTrigger","valueProp","cursorState","useHTMLInputCursorState","valueState","setValueState","hasValueProp","newValue","insertPoint","point","pointRef","unref","removeInput","useComboboxInput","cancelInputOnBlur","onCancelInput","cause","insertText","move","reverse","hasEmpty","setHasEmpty","contextValue","store","useComboboxStore","startTransition","getState","setActiveId","first","ComboboxProvider","InlineComboboxInput","propRef","contextRef","useContext","useComboboxContext","Combobox","autoSelect","InlineComboboxContent","ComboboxPopover","comboboxItemVariants","interactive","InlineComboboxItem","focusEditor","ComboboxItem","InlineComboboxEmpty","InlineComboboxGroup","ComboboxGroup","InlineComboboxGroupLabel","ComboboxGroupLabel","onSelectItem","getMentionOnSelectItem","MENTIONABLES","MentionKit","MentionPlugin","triggerPreviousCharPattern","useMounted","IS_APPLE","prefix","MentionInputPlugin","SparklesIcon","Code2","Quote","description","TableOfContentsIcon","Columns3Icon","PenToolIcon","CalendarIcon","SlashKit","SlashPlugin","triggerQuery","SlashInputPlugin","suggestionVariants","insertActive","removeActive","SuggestionLineBreakContent","isLineBreak","isRemove","isInsert","suggestionPlugin","hoverSuggestionId","spanRef","Avatar","AvatarPrimitive","AvatarImage","AvatarFallback","Fallback","editorContainerVariants","demo","EditorContainer","PlateContainer","editorVariants","ai","fullWidth","none","Editor","PlateContent","disableDefaultStyles","EditorView","PlateView","Comment","discussionLength","documentContent","editingId","setEditingId","showDocumentContent","onEditorClick","userInfo","discussionPlugin","userId","currentUserId","CommentPlugin","isMyComment","initialValue","contentRich","commentEditor","useCommentEditor","onSave","updatedDiscussions","getOption","discussion","discussionId","updatedComments","comments","isEdited","updatedAt","updateComment","isFirst","isLast","hovering","setHovering","dropdownOpen","setDropdownOpen","avatarUrl","formatCommentDate","createdAt","isResolved","resolveDiscussion","unsetMark","CommentMoreDropdown","edge","onRemoveComment","removeDiscussion","Plate","replaceNodes","selectedEditCommentRef","onDeleteComment","alert","commentIndex","findIndex","onEditComment","PencilIcon","TrashIcon","deps","usePlateEditor","plugins","CommentCreateForm","discussionIdProp","focusOnMount","discussions","commentId","useCommentId","commentValue","setCommentValue","commentContent","onAddComment","reset","newDiscussion","nanoid","updatedDiscussion","concat","commentsNodeEntry","nodes","isDraft","_discussionId","getCommentKey","trim","ArrowUpIcon","diffMinutes","differenceInMinutes","diffHours","differenceInHours","diffDays","differenceInDays","BLOCK_SUGGESTION","TYPE_TEXT_MAP","BlockSuggestionCard","idx","suggestionText2Array","newText","properties","newProperties","toUpperCase","acceptSuggestion","reject","rejectSuggestion","suggestionId","BlockCommentContent","blockPath","commentNodes","draftCommentNode","suggestionNodes","resolvedSuggestions","previousPath","isPath","isText","parentNode","lineBreakId","ElementApi","isElement","suggestionIds","flatMap","TextApi","dataList","entries","n","getSuggestionKey","path1","path2","isChild","lineBreakData","isBlockSuggestion","keyId2SuggestionId","nodeData","s","keyId","useResolveSuggestion","resolvedDiscussions","useResolvedDiscussion","suggestionsCount","discussionsCount","totalCount","activeSuggestion","isCommenting","activeDiscussion","noneActive","sortedMergedData","a","b","getTime","_open","commentingCurrent","anchorElement","activeNode","_open_","virtualRef","BlockComment","PencilLineIcon","MessageSquareTextIcon","MessagesSquareIcon","commentsIds","firstBlockPath","seed","users","alice","bob","charlie","commentsApi","getTransientSuggestionKey","extendSelectors","currentUser","user","BaseSuggestionPlugin","isBlockLeaf","blockSuggestion","isSlateEditor","suggestionEntry","leafId","hasRemove","hasActive","hasHover","update","SuggestionKit","BorderAllIcon","rx","BorderBottomIcon","BorderLeftIcon","BorderNoneIcon","BorderRightIcon","BorderTopIcon","TableElement","TableProvider","hasControls","isSelectingCell","marginLeft","tableProps","useTableElement","isSelectingTable","paddingLeft","TableFloatingToolbar","collapsedInside","ColorDropdownMenu","CombineIcon","SquareSplitHorizontalIcon","Grid2X2Icon","TableBordersDropdownMenuContent","getOnSelectTableBorder","hasBottomBorder","hasLeftBorder","hasNoBorders","hasOuterBorders","hasRightBorder","hasTopBorder","useTableBordersDropdownMenuContentState","onCheckedChange","selectedCells","onUpdateColor","setCellBackground","onClearColor","RowDragHandle","dragRef","RowDropLine","TableCellElement","isHeader","tableId","useElementSelector","rowId","isSelectingRow","borders","colSpan","minHeight","useTableCellElement","bottomProps","hiddenLeft","leftProps","rightProps","useTableCellElementResizable","background","getColSpan","rowSpan","getRowSpan","suppressContentEditableWarning","columnResizeVariants","TableKit","TableRowPlugin","dragElement","TableCellPlugin","TableCellHeaderPlugin","headingItemVariants","depth","TocKit","TocPlugin","topOffset","useTocElementState","btnProps","useTocElement","headingList","ToggleKit","TogglePlugin","useToggleButtonState","useToggleButton","ChevronRight","EditorKit","TrailingBlockPlugin","PlateEditor","BaseAlignKit","BaseTextAlignPlugin","HeadingElementStatic","SlateElement","BaseBasicBlocksKit","BaseParagraphPlugin","BaseH1Plugin","BaseH2Plugin","BaseH3Plugin","BaseH4Plugin","BaseH5Plugin","BaseH6Plugin","BaseBlockquotePlugin","BaseHorizontalRulePlugin","BaseBasicMarksKit","BaseBoldPlugin","BaseItalicPlugin","BaseUnderlinePlugin","BaseCodePlugin","SlateLeaf","BaseStrikethroughPlugin","BaseSubscriptPlugin","BaseSuperscriptPlugin","BaseHighlightPlugin","BaseKbdPlugin","BaseCalloutKit","BaseCalloutPlugin","BaseCodeBlockKit","BaseCodeBlockPlugin","BaseCodeLinePlugin","BaseCodeSyntaxPlugin","BaseColumnKit","BaseColumnPlugin","BaseColumnItemPlugin","BaseCommentKit","BaseDateKit","BaseDatePlugin","BaseFontKit","BaseFontColorPlugin","BaseFontBackgroundColorPlugin","BaseFontSizePlugin","BaseFontFamilyPlugin","BaseLineHeightKit","BaseLineHeightPlugin","BaseLinkKit","BaseLinkPlugin","BaseIndentKit","BaseIndentPlugin","BaseListKit","BaseListPlugin","BaseMathKit","BaseInlineEquationPlugin","html","getEquationHtml","dangerouslySetInnerHTML","__html","BaseEquationPlugin","BaseMediaKit","BaseImagePlugin","caption","BaseVideoPlugin","BaseAudioPlugin","BaseFilePlugin","BaseCaptionPlugin","BaseMediaEmbedPlugin","BasePlaceholderPlugin","BaseMentionKit","BaseMentionPlugin","BaseSuggestionKit","TableCellElementStatic","getPlugin","BaseTablePlugin","getCellSize","getCellBorders","BaseTableKit","disableMarginLeft","getOptions","BaseTableRowPlugin","BaseTableCellPlugin","BaseTableCellHeaderPlugin","headingDepth","getHeadingList","BaseTocPlugin","queryHeading","values","isHeading","BaseTocKit","BaseEditorKit","BaseTogglePlugin"],"mappings":"62XAWA,eAAiBA,QAAQC,IAAIC,UAAA,WAEzB,SAASC,EAAyBC,GAChC,GAAI,MAAQA,EAAM,OAAO,KACzB,GAAI,mBAAsBA,EACxB,OAAOA,EAAKC,WAAaC,EACrB,KACAF,EAAKG,aAAeH,EAAKI,MAAQ,KACvC,GAAI,iBAAoBJ,EAAM,OAAOA,EACrC,OAAQA,GACN,KAAKK,EACH,MAAO,WACT,KAAKC,EACH,MAAO,WACT,KAAKC,EACH,MAAO,aACT,KAAKC,EACH,MA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AA,IAACmQ,GAAA,CAAevK,UAAU,kBAAmBnJ,SAAAjD,OAG/Cqe,CAEJ,CAEO,SAAS6e,IAAuB9wB,UACrCA,EAAA6vB,MACAA,EAAAW,OACAA,EAAAN,YACAA,KACG95B;AAMH,OACEgE,GAAAA,IAAC,MAAA,CACC4F,UAAWC,GACT,6DACAD,MAEE5J,EAEJS,gCAACoT,GAAA,CACEpT,SAAA,CAAA25B,EAAOrxB,IAAI,EAAGmyB,gBAAe19B,OAAMuB,0BAClCiF,GAAAA,IAAC23B,GAAA,CACCn+B,OAEAuB,QACAm8B,gBACAU,WAAYnC,IAAU16B,EACtB+6B,eAJKt8B,GAAQuB,IAOhBiB,EAAMS,aAIf,CAEO,MAAM45B,GAAiB,CAC5B,CACEa,eAAe,EACf19B,KAAM,QACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,OACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,QACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,YACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,MACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,SACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,SACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,QACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,OACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,OACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,SACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,UACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,oBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,0BACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,oBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,0BACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,oBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,0BACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,mBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,aACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,yBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,mBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,aACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,yBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACN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ources":["../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js","../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js","../src/components/editor/plugins/align-kit.tsx","../src/components/editor/plugins/autoformat-kit.tsx","../src/components/ui/heading-node.tsx","../src/lib/utils.ts","../src/components/editor/plugins/basic-blocks-kit.tsx","../src/components/ui/paragraph-node.tsx","../src/components/ui/blockquote-node.tsx","../src/components/ui/hr-node.tsx","../src/components/editor/plugins/basic-marks-kit.tsx","../src/components/ui/code-node.tsx","../src/components/ui/highlight-node.tsx","../src/components/ui/kbd-node.tsx","../src/components/ui/context-menu.tsx","../src/components/ui/block-selection.tsx","../src/components/editor/plugins/block-selection-kit.tsx","../src/components/editor/plugins/block-menu-kit.tsx","../src/components/ui/block-context-menu.tsx","../src/hooks/use-is-touch-device.ts","../src/components/editor/plugins/block-placeholder-kit.tsx","../src/components/ui/button.tsx","../src/components/ui/tooltip.tsx","../src/components/ui/dropdown-menu.tsx","../src/components/ui/separator.tsx","../src/components/ui/toolbar.tsx","../src/components/ui/emoji-toolbar-button.tsx","../src/components/editor/plugins/callout-kit.tsx","../src/components/ui/callout-node.tsx","../src/components/ui/command.tsx","../src/components/ui/popover.tsx","../src/components/ui/code-block-node.tsx","../src/components/editor/plugins/code-block-kit.tsx","../src/components/ui/column-node.tsx","../src/components/editor/plugins/column-kit.tsx","../src/components/editor/plugins/comment-kit.tsx","../src/components/ui/comment-node.tsx","../src/components/ui/cursor-overlay.tsx","../src/components/editor/plugins/cursor-overlay-kit.tsx","../src/components/ui/calendar.tsx","../src/components/editor/plugins/date-kit.tsx","../src/components/ui/date-node.tsx","../src/components/ui/block-draggable.tsx","../src/components/editor/plugins/dnd-kit.tsx","../src/components/editor/plugins/docx-kit.tsx","../src/components/editor/plugins/exit-break-kit.tsx","../src/components/ui/fixed-toolbar.tsx","../src/components/ui/align-toolbar-button.tsx","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js","../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js","../src/components/ui/font-color-toolbar-button.tsx","../src/components/ui/history-toolbar-button.tsx","../src/components/ui/indent-toolbar-button.tsx","../src/components/editor/transforms.ts","../src/components/ui/insert-toolbar-button.tsx","../src/components/ui/link-toolbar-button.tsx","../src/components/ui/list-toolbar-button.tsx","../src/components/ui/mark-toolbar-button.tsx","../src/components/ui/alert-dialog.tsx","../src/components/ui/input.tsx","../src/components/ui/media-toolbar-button.tsx","../src/components/ui/more-toolbar-button.tsx","../src/components/ui/table-toolbar-button.tsx","../src/components/ui/turn-into-toolbar-button.tsx","../src/components/ui/fixed-toolbar-buttons.tsx","../src/components/editor/plugins/fixed-toolbar-kit.tsx","../src/components/ui/floating-toolbar.tsx","../src/components/ui/floating-toolbar-buttons.tsx","../src/components/editor/plugins/floating-toolbar-kit.tsx","../src/components/editor/plugins/font-kit.tsx","../src/components/editor/plugins/line-height-kit.tsx","../src/components/ui/link-toolbar.tsx","../src/components/editor/plugins/link-kit.tsx","../src/components/ui/link-node.tsx","../src/components/editor/plugins/indent-kit.tsx","../src/components/ui/checkbox.tsx","../src/components/ui/block-list.tsx","../src/components/editor/plugins/list-kit.tsx","../src/components/editor/plugins/markdown-kit.tsx","../src/components/ui/equation-node.tsx","../src/components/editor/plugins/math-kit.tsx","../src/components/ui/caption.tsx","../src/components/ui/media-audio-node.tsx","../src/components/ui/media-toolbar.tsx","../src/components/ui/resize-handle.tsx","../src/components/ui/media-embed-node.tsx","../src/components/ui/media-file-node.tsx","../src/components/ui/media-image-node.tsx","../src/hooks/use-upload-file.ts","../src/components/ui/media-placeholder-node.tsx","../src/components/ui/media-preview-dialog.tsx","../src/components/ui/media-upload-toast.tsx","../src/components/ui/media-video-node.tsx","../src/components/editor/plugins/media-kit.tsx","../src/components/ui/inline-combobox.tsx","../src/components/ui/mention-node.tsx","../src/components/editor/plugins/mention-kit.tsx","../src/hooks/use-mounted.ts","../src/components/ui/slash-node.tsx","../src/components/editor/plugins/slash-kit.tsx","../src/components/ui/suggestion-node.tsx","../src/components/ui/avatar.tsx","../src/components/ui/editor.tsx","../src/components/ui/comment.tsx","../src/components/ui/block-suggestion.tsx","../src/components/ui/block-discussion.tsx","../src/components/editor/plugins/discussion-kit.tsx","../src/components/editor/plugins/suggestion-kit.tsx","../src/components/ui/table-icons.tsx","../src/components/ui/table-node.tsx","../src/components/editor/plugins/table-kit.tsx","../src/components/ui/toc-node.tsx","../src/components/editor/plugins/toc-kit.tsx","../src/components/editor/plugins/toggle-kit.tsx","../src/components/ui/toggle-node.tsx","../src/components/editor/editor-kit.tsx","../src/components/editor/plate-editor.tsx","../src/components/editor/plugins/align-base-kit.tsx","../src/components/ui/heading-node-static.tsx","../src/components/editor/plugins/basic-blocks-base-kit.tsx","../src/components/ui/paragraph-node-static.tsx","../src/components/ui/blockquote-node-static.tsx","../src/components/ui/hr-node-static.tsx","../src/components/editor/plugins/basic-marks-base-kit.tsx","../src/components/ui/code-node-static.tsx","../src/components/ui/highlight-node-static.tsx","../src/components/ui/kbd-node-static.tsx","../src/components/editor/plugins/callout-base-kit.tsx","../src/components/ui/callout-node-static.tsx","../src/components/editor/plugins/code-block-base-kit.tsx","../src/components/ui/code-block-node-static.tsx","../src/components/editor/plugins/column-base-kit.tsx","../src/components/ui/column-node-static.tsx","../src/components/editor/plugins/comment-base-kit.tsx","../src/components/ui/comment-node-static.tsx","../src/components/editor/plugins/date-base-kit.tsx","../src/components/ui/date-node-static.tsx","../src/components/editor/plugins/font-base-kit.tsx","../src/components/editor/plugins/line-height-base-kit.tsx","../src/components/editor/plugins/link-base-kit.tsx","../src/components/ui/link-node-static.tsx","../src/components/editor/plugins/indent-base-kit.tsx","../src/components/ui/block-list-static.tsx","../src/components/editor/plugins/list-base-kit.tsx","../src/components/editor/plugins/math-base-kit.tsx","../src/components/ui/equation-node-static.tsx","../src/components/editor/plugins/media-base-kit.tsx","../src/components/ui/media-image-node-static.tsx","../src/components/ui/media-video-node-static.tsx","../src/components/ui/media-audio-node-static.tsx","../src/components/ui/media-file-node-static.tsx","../src/components/editor/plugins/mention-base-kit.tsx","../src/components/ui/mention-node-static.tsx","../src/components/editor/plugins/suggestion-base-kit.tsx","../src/components/ui/suggestion-node-static.tsx","../src/components/ui/table-node-static.tsx","../src/components/editor/plugins/table-base-kit.tsx","../src/components/ui/toc-node-static.tsx","../src/components/editor/plugins/toc-base-kit.tsx","../src/components/editor/plugins/toggle-base-kit.tsx","../src/components/editor/editor-base-kit.tsx","../src/components/ui/toggle-node-static.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","'use client';\n\nimport { TextAlignPlugin } from '@platejs/basic-styles/react';\nimport { KEYS } from 'platejs';\n\nexport const AlignKit = [\n TextAlignPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 'start',\n nodeKey: 'align',\n styleKey: 'textAlign',\n validNodeValues: ['start', 'left', 'center', 'right', 'end', 'justify'],\n },\n targetPlugins: [...KEYS.heading, KEYS.p, KEYS.img, KEYS.mediaEmbed],\n },\n }),\n];\n","'use client';\n\nimport type { AutoformatRule } from '@platejs/autoformat';\n\nimport {\n autoformatArrow,\n autoformatLegal,\n autoformatLegalHtml,\n autoformatMath,\n AutoformatPlugin,\n autoformatPunctuation,\n autoformatSmartQuotes,\n} from '@platejs/autoformat';\nimport { insertEmptyCodeBlock } from '@platejs/code-block';\nimport { toggleList } from '@platejs/list';\nimport { KEYS } from 'platejs';\n\nconst autoformatMarks: AutoformatRule[] = [\n {\n match: '***',\n mode: 'mark',\n type: [KEYS.bold, KEYS.italic],\n },\n {\n match: '__*',\n mode: 'mark',\n type: [KEYS.underline, KEYS.italic],\n },\n {\n match: '__**',\n mode: 'mark',\n type: [KEYS.underline, KEYS.bold],\n },\n {\n match: '___***',\n mode: 'mark',\n type: [KEYS.underline, KEYS.bold, KEYS.italic],\n },\n {\n match: '**',\n mode: 'mark',\n type: KEYS.bold,\n },\n {\n match: '__',\n mode: 'mark',\n type: KEYS.underline,\n },\n {\n match: '*',\n mode: 'mark',\n type: KEYS.italic,\n },\n {\n match: '_',\n mode: 'mark',\n type: KEYS.italic,\n },\n {\n match: '~~',\n mode: 'mark',\n type: KEYS.strikethrough,\n },\n {\n match: '^',\n mode: 'mark',\n type: KEYS.sup,\n },\n {\n match: '~',\n mode: 'mark',\n type: KEYS.sub,\n },\n {\n match: '==',\n mode: 'mark',\n type: KEYS.highlight,\n },\n {\n match: '≡',\n mode: 'mark',\n type: KEYS.highlight,\n },\n {\n match: '`',\n mode: 'mark',\n type: KEYS.code,\n },\n];\n\nconst autoformatBlocks: AutoformatRule[] = [\n {\n match: '# ',\n mode: 'block',\n type: KEYS.h1,\n },\n {\n match: '## ',\n mode: 'block',\n type: KEYS.h2,\n },\n {\n match: '### ',\n mode: 'block',\n type: KEYS.h3,\n },\n {\n match: '#### ',\n mode: 'block',\n type: KEYS.h4,\n },\n {\n match: '##### ',\n mode: 'block',\n type: KEYS.h5,\n },\n {\n match: '###### ',\n mode: 'block',\n type: KEYS.h6,\n },\n {\n match: '> ',\n mode: 'block',\n type: KEYS.blockquote,\n },\n {\n match: '```',\n mode: 'block',\n type: KEYS.codeBlock,\n format: (editor) => {\n insertEmptyCodeBlock(editor, {\n defaultType: KEYS.p,\n insertNodesOptions: { select: true },\n });\n },\n },\n // {\n // match: '+ ',\n // mode: 'block',\n // preFormat: openNextToggles,\n // type: KEYS.toggle,\n // },\n {\n match: ['---', '—-', '___ '],\n mode: 'block',\n type: KEYS.hr,\n format: (editor) => {\n editor.tf.setNodes({ type: KEYS.hr });\n editor.tf.insertNodes({\n children: [{ text: '' }],\n type: KEYS.p,\n });\n },\n },\n];\n\nconst autoformatLists: AutoformatRule[] = [\n {\n match: ['* ', '- '],\n mode: 'block',\n type: 'list',\n format: (editor) => {\n toggleList(editor, {\n listStyleType: KEYS.ul,\n });\n },\n },\n {\n match: [String.raw`^\\d+\\.$ `, String.raw`^\\d+\\)$ `],\n matchByRegex: true,\n mode: 'block',\n type: 'list',\n format: (editor, { matchString }) => {\n toggleList(editor, {\n listRestartPolite: Number(matchString) || 1,\n listStyleType: KEYS.ol,\n });\n },\n },\n {\n match: ['[] '],\n mode: 'block',\n type: 'list',\n format: (editor) => {\n toggleList(editor, {\n listStyleType: KEYS.listTodo,\n });\n editor.tf.setNodes({\n checked: false,\n listStyleType: KEYS.listTodo,\n });\n },\n },\n {\n match: ['[x] '],\n mode: 'block',\n type: 'list',\n format: (editor) => {\n toggleList(editor, {\n listStyleType: KEYS.listTodo,\n });\n editor.tf.setNodes({\n checked: true,\n listStyleType: KEYS.listTodo,\n });\n },\n },\n];\n\nexport const AutoformatKit = [\n AutoformatPlugin.configure({\n options: {\n enableUndoOnDelete: true,\n rules: [\n ...autoformatBlocks,\n ...autoformatMarks,\n ...autoformatSmartQuotes,\n ...autoformatPunctuation,\n ...autoformatLegal,\n ...autoformatLegalHtml,\n ...autoformatArrow,\n ...autoformatMath,\n ...autoformatLists,\n ].map(\n (rule): AutoformatRule => ({\n ...rule,\n query: (editor) =>\n !editor.api.some({\n match: { type: editor.getType(KEYS.codeBlock) },\n }),\n })\n ),\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport { PlateElement } from 'platejs/react';\n\nconst headingVariants = cva('relative mb-1', {\n variants: {\n variant: {\n h1: 'mt-[1.6em] pb-1 font-bold font-heading text-4xl',\n h2: 'mt-[1.4em] pb-px font-heading font-semibold text-2xl tracking-tight',\n h3: 'mt-[1em] pb-px font-heading font-semibold text-xl tracking-tight',\n h4: 'mt-[0.75em] font-heading font-semibold text-lg tracking-tight',\n h5: 'mt-[0.75em] font-semibold text-lg tracking-tight',\n h6: 'mt-[0.75em] font-semibold text-base tracking-tight',\n },\n },\n});\n\nexport function HeadingElement({\n variant = 'h1',\n ...props\n}: PlateElementProps & VariantProps<typeof headingVariants>) {\n return (\n <PlateElement\n as={variant!}\n className={headingVariants({ variant })}\n {...props}\n >\n {props.children}\n </PlateElement>\n );\n}\n\nexport function H1Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h1\" {...props} />;\n}\n\nexport function H2Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h2\" {...props} />;\n}\n\nexport function H3Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h3\" {...props} />;\n}\n\nexport function H4Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h4\" {...props} />;\n}\n\nexport function H5Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h5\" {...props} />;\n}\n\nexport function H6Element(props: PlateElementProps) {\n return <HeadingElement variant=\"h6\" {...props} />;\n}\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client';\n\nimport {\n BlockquotePlugin,\n H1Plugin,\n H2Plugin,\n H3Plugin,\n H4Plugin,\n H5Plugin,\n H6Plugin,\n HorizontalRulePlugin,\n} from '@platejs/basic-nodes/react';\nimport { ParagraphPlugin } from 'platejs/react';\n\nimport { BlockquoteElement } from '@/components/ui/blockquote-node';\nimport {\n H1Element,\n H2Element,\n H3Element,\n H4Element,\n H5Element,\n H6Element,\n} from '@/components/ui/heading-node';\nimport { HrElement } from '@/components/ui/hr-node';\nimport { ParagraphElement } from '@/components/ui/paragraph-node';\n\nexport const BasicBlocksKit = [\n ParagraphPlugin.withComponent(ParagraphElement),\n H1Plugin.configure({\n node: {\n component: H1Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+1' } },\n }),\n H2Plugin.configure({\n node: {\n component: H2Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+2' } },\n }),\n H3Plugin.configure({\n node: {\n component: H3Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+3' } },\n }),\n H4Plugin.configure({\n node: {\n component: H4Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+4' } },\n }),\n H5Plugin.configure({\n node: {\n component: H5Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+5' } },\n }),\n H6Plugin.configure({\n node: {\n component: H6Element,\n },\n rules: {\n break: { empty: 'reset' },\n },\n shortcuts: { toggle: { keys: 'mod+alt+6' } },\n }),\n BlockquotePlugin.configure({\n node: { component: BlockquoteElement },\n shortcuts: { toggle: { keys: 'mod+shift+period' } },\n }),\n HorizontalRulePlugin.withComponent(HrElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { PlateElement } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function ParagraphElement(props: PlateElementProps) {\n return (\n <PlateElement {...props} className={cn('m-0 px-0 py-1')}>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { type PlateElementProps, PlateElement } from 'platejs/react';\n\nexport function BlockquoteElement(props: PlateElementProps) {\n return (\n <PlateElement\n as=\"blockquote\"\n className=\"my-1 border-l-2 pl-6 italic\"\n {...props}\n />\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport {\n PlateElement,\n useFocused,\n useReadOnly,\n useSelected,\n} from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function HrElement(props: PlateElementProps) {\n const readOnly = useReadOnly();\n const selected = useSelected();\n const focused = useFocused();\n\n return (\n <PlateElement {...props}>\n <div className=\"py-6\" contentEditable={false}>\n <hr\n className={cn(\n 'h-0.5 rounded-sm border-none bg-muted bg-clip-content',\n selected && focused && 'ring-2 ring-ring ring-offset-2',\n !readOnly && 'cursor-pointer'\n )}\n />\n </div>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport {\n BoldPlugin,\n CodePlugin,\n HighlightPlugin,\n ItalicPlugin,\n KbdPlugin,\n StrikethroughPlugin,\n SubscriptPlugin,\n SuperscriptPlugin,\n UnderlinePlugin,\n} from '@platejs/basic-nodes/react';\n\nimport { CodeLeaf } from '@/components/ui/code-node';\nimport { HighlightLeaf } from '@/components/ui/highlight-node';\nimport { KbdLeaf } from '@/components/ui/kbd-node';\n\nexport const BasicMarksKit = [\n BoldPlugin,\n ItalicPlugin,\n UnderlinePlugin,\n CodePlugin.configure({\n node: { component: CodeLeaf },\n shortcuts: { toggle: { keys: 'mod+e' } },\n }),\n StrikethroughPlugin.configure({\n shortcuts: { toggle: { keys: 'mod+shift+x' } },\n }),\n SubscriptPlugin.configure({\n shortcuts: { toggle: { keys: 'mod+comma' } },\n }),\n SuperscriptPlugin.configure({\n shortcuts: { toggle: { keys: 'mod+period' } },\n }),\n HighlightPlugin.configure({\n node: { component: HighlightLeaf },\n shortcuts: { toggle: { keys: 'mod+shift+h' } },\n }),\n KbdPlugin.withComponent(KbdLeaf),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { PlateLeaf } from 'platejs/react';\n\nexport function CodeLeaf(props: PlateLeafProps) {\n return (\n <PlateLeaf\n {...props}\n as=\"code\"\n className=\"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm\"\n >\n {props.children}\n </PlateLeaf>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { PlateLeaf } from 'platejs/react';\n\nexport function HighlightLeaf(props: PlateLeafProps) {\n return (\n <PlateLeaf {...props} as=\"mark\" className=\"bg-highlight/30 text-inherit\">\n {props.children}\n </PlateLeaf>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { PlateLeaf } from 'platejs/react';\n\nexport function KbdLeaf(props: PlateLeafProps) {\n return (\n <PlateLeaf\n {...props}\n as=\"kbd\"\n className=\"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-sm shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(248,_249,_250)_0px_1px_5px_0px_inset,_rgb(193,_200,_205)_0px_0px_0px_0.5px,_rgb(193,_200,_205)_0px_2px_1px_-1px,_rgb(193,_200,_205)_0px_1px_0px_0px] dark:shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(26,_29,_30)_0px_1px_5px_0px_inset,_rgb(76,_81,_85)_0px_0px_0px_0.5px,_rgb(76,_81,_85)_0px_2px_1px_-1px,_rgb(76,_81,_85)_0px_1px_0px_0px]\"\n >\n {props.children}\n </PlateLeaf>\n );\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction ContextMenu({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />\n}\n\nfunction ContextMenuTrigger({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />\n )\n}\n\nfunction ContextMenuGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return (\n <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />\n )\n}\n\nfunction ContextMenuPortal({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return (\n <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />\n )\n}\n\nfunction ContextMenuSub({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />\n}\n\nfunction ContextMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return (\n <ContextMenuPrimitive.RadioGroup\n data-slot=\"context-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n )\n}\n\nfunction ContextMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n )\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n )\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ContextMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { DndPlugin } from '@platejs/dnd';\nimport { useBlockSelected } from '@platejs/selection/react';\nimport { cva } from 'class-variance-authority';\nimport { type PlateElementProps, usePluginOption } from 'platejs/react';\n\nexport const blockSelectionVariants = cva(\n 'pointer-events-none absolute inset-0 z-1 bg-brand/[.13] transition-opacity',\n {\n defaultVariants: {\n active: true,\n },\n variants: {\n active: {\n false: 'opacity-0',\n true: 'opacity-100',\n },\n },\n }\n);\n\nexport function BlockSelection(props: PlateElementProps) {\n const isBlockSelected = useBlockSelected();\n const isDragging = usePluginOption(DndPlugin, 'isDragging');\n\n if (\n !isBlockSelected ||\n props.plugin.key === 'tr' ||\n props.plugin.key === 'table'\n )\n return null;\n\n return (\n <div\n className={blockSelectionVariants({\n active: isBlockSelected && !isDragging,\n })}\n data-slot=\"block-selection\"\n />\n );\n}\n","'use client';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { getPluginTypes, isHotkey, KEYS } from 'platejs';\n\nimport { BlockSelection } from '@/components/ui/block-selection';\n\nexport const BlockSelectionKit = [\n BlockSelectionPlugin.configure(({ editor }) => ({\n options: {\n enableContextMenu: true,\n isSelectable: (element) =>\n !getPluginTypes(editor, [KEYS.column, KEYS.codeLine, KEYS.td]).includes(\n element.type\n ),\n onKeyDownSelecting: (editor, e) => {\n if (isHotkey('mod+j')(e)) {\n editor.getApi(AIChatPlugin).aiChat.show();\n }\n },\n },\n render: {\n belowRootNodes: (props) => {\n if (!props.attributes.className?.includes('slate-selectable'))\n return null;\n\n return <BlockSelection {...(props as any)} />;\n },\n },\n })),\n];\n","'use client';\n\nimport { BlockMenuPlugin } from '@platejs/selection/react';\n\nimport { BlockContextMenu } from '@/components/ui/block-context-menu';\n\nimport { BlockSelectionKit } from './block-selection-kit';\n\nexport const BlockMenuKit = [\n ...BlockSelectionKit,\n BlockMenuPlugin.configure({\n render: { aboveEditable: BlockContextMenu },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport {\n BLOCK_CONTEXT_MENU_ID,\n BlockMenuPlugin,\n BlockSelectionPlugin,\n} from '@platejs/selection/react';\nimport { KEYS } from 'platejs';\nimport { useEditorPlugin, usePlateState, usePluginOption } from 'platejs/react';\n\nimport {\n ContextMenu,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n} from '@/components/ui/context-menu';\nimport { useIsTouchDevice } from '@/hooks/use-is-touch-device';\n\ntype Value = 'askAI' | null;\n\nexport function BlockContextMenu({ children }: { children: React.ReactNode }) {\n const { api, editor } = useEditorPlugin(BlockMenuPlugin);\n const [value, setValue] = React.useState<Value>(null);\n const isTouch = useIsTouchDevice();\n const [readOnly] = usePlateState('readOnly');\n const openId = usePluginOption(BlockMenuPlugin, 'openId');\n const isOpen = openId === BLOCK_CONTEXT_MENU_ID;\n\n const handleTurnInto = React.useCallback(\n (type: string) => {\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.getNodes()\n .forEach(([node, path]) => {\n if (node[KEYS.listType]) {\n editor.tf.unsetNodes([KEYS.listType, 'indent'], {\n at: path,\n });\n }\n\n editor.tf.toggleBlock(type, { at: path });\n });\n },\n [editor]\n );\n\n const handleAlign = React.useCallback(\n (align: 'center' | 'left' | 'right') => {\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.setNodes({ align });\n },\n [editor]\n );\n\n if (isTouch) {\n return children;\n }\n\n return (\n <ContextMenu\n onOpenChange={(open) => {\n if (!open) {\n api.blockMenu.hide();\n }\n }}\n modal={false}\n >\n <ContextMenuTrigger\n asChild\n onContextMenu={(event) => {\n const dataset = (event.target as HTMLElement).dataset;\n const disabled =\n dataset?.slateEditor === 'true' ||\n readOnly ||\n dataset?.plateOpenContextMenu === 'false';\n\n if (disabled) return event.preventDefault();\n\n setTimeout(() => {\n api.blockMenu.show(BLOCK_CONTEXT_MENU_ID, {\n x: event.clientX,\n y: event.clientY,\n });\n }, 0);\n }}\n >\n <div className=\"w-full\">{children}</div>\n </ContextMenuTrigger>\n {isOpen && (\n <ContextMenuContent\n className=\"w-64\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n editor.getApi(BlockSelectionPlugin).blockSelection.focus();\n\n if (value === 'askAI') {\n editor.getApi(AIChatPlugin).aiChat.show();\n }\n\n setValue(null);\n }}\n >\n <ContextMenuGroup>\n <ContextMenuItem\n onClick={() => {\n setValue('askAI');\n }}\n >\n Ask AI\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() => {\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.removeNodes();\n editor.tf.focus();\n }}\n >\n Delete\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() => {\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.duplicate();\n }}\n >\n Duplicate\n {/* <ContextMenuShortcut>⌘ + D</ContextMenuShortcut> */}\n </ContextMenuItem>\n <ContextMenuSub>\n <ContextMenuSubTrigger>Turn into</ContextMenuSubTrigger>\n <ContextMenuSubContent className=\"w-48\">\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.p)}>\n Paragraph\n </ContextMenuItem>\n\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.h1)}>\n Heading 1\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.h2)}>\n Heading 2\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleTurnInto(KEYS.h3)}>\n Heading 3\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() => handleTurnInto(KEYS.blockquote)}\n >\n Blockquote\n </ContextMenuItem>\n </ContextMenuSubContent>\n </ContextMenuSub>\n </ContextMenuGroup>\n\n <ContextMenuGroup>\n <ContextMenuItem\n onClick={() =>\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.setIndent(1)\n }\n >\n Indent\n </ContextMenuItem>\n <ContextMenuItem\n onClick={() =>\n editor\n .getTransforms(BlockSelectionPlugin)\n .blockSelection.setIndent(-1)\n }\n >\n Outdent\n </ContextMenuItem>\n <ContextMenuSub>\n <ContextMenuSubTrigger>Align</ContextMenuSubTrigger>\n <ContextMenuSubContent className=\"w-48\">\n <ContextMenuItem onClick={() => handleAlign('left')}>\n Left\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleAlign('center')}>\n Center\n </ContextMenuItem>\n <ContextMenuItem onClick={() => handleAlign('right')}>\n Right\n </ContextMenuItem>\n </ContextMenuSubContent>\n </ContextMenuSub>\n </ContextMenuGroup>\n </ContextMenuContent>\n )}\n </ContextMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nexport function useIsTouchDevice() {\n const [isTouchDevice, setIsTouchDevice] = React.useState(false);\n\n React.useEffect(() => {\n function onResize() {\n setIsTouchDevice(\n 'ontouchstart' in window ||\n navigator.maxTouchPoints > 0 ||\n navigator.maxTouchPoints > 0\n );\n }\n\n window.addEventListener('resize', onResize);\n onResize();\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return isTouchDevice;\n}\n","'use client';\n\nimport { KEYS } from 'platejs';\nimport { BlockPlaceholderPlugin } from 'platejs/react';\n\nexport const BlockPlaceholderKit = [\n BlockPlaceholderPlugin.configure({\n options: {\n className:\n 'before:absolute before:cursor-text before:text-muted-foreground/80 before:content-[attr(placeholder)]',\n placeholders: {\n [KEYS.p]: 'Type something...',\n },\n query: ({ path }) => path.length === 1,\n },\n }),\n];\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-1500 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-foreground fill-foreground z-1500 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n )\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","'use client';\n\nimport * as React from 'react';\n\nimport * as ToolbarPrimitive from '@radix-ui/react-toolbar';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport {\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuSeparator,\n} from '@/components/ui/dropdown-menu';\nimport { Separator } from '@/components/ui/separator';\nimport { Tooltip, TooltipTrigger } from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nexport function Toolbar({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.Root>) {\n return (\n <ToolbarPrimitive.Root\n className={cn('relative flex select-none items-center', className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarToggleGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.ToolbarToggleGroup>) {\n return (\n <ToolbarPrimitive.ToolbarToggleGroup\n className={cn('flex items-center', className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarLink({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.Link>) {\n return (\n <ToolbarPrimitive.Link\n className={cn('font-medium underline underline-offset-4', className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.Separator>) {\n return (\n <ToolbarPrimitive.Separator\n className={cn('mx-2 my-1 w-px shrink-0 bg-border', className)}\n {...props}\n />\n );\n}\n\n// From toggleVariants\nconst toolbarButtonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-checked:bg-accent aria-checked:text-accent-foreground aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n defaultVariants: {\n size: 'default',\n variant: 'default',\n },\n variants: {\n size: {\n default: 'h-9 min-w-9 px-2',\n lg: 'h-10 min-w-10 px-2.5',\n sm: 'h-8 min-w-8 px-1.5',\n },\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',\n },\n },\n }\n);\n\nconst dropdownArrowVariants = cva(\n cn(\n 'inline-flex items-center justify-center rounded-r-md font-medium text-foreground text-sm transition-colors disabled:pointer-events-none disabled:opacity-50'\n ),\n {\n defaultVariants: {\n size: 'sm',\n variant: 'default',\n },\n variants: {\n size: {\n default: 'h-9 w-6',\n lg: 'h-10 w-8',\n sm: 'h-8 w-4',\n },\n variant: {\n default:\n 'bg-transparent hover:bg-muted hover:text-muted-foreground aria-checked:bg-accent aria-checked:text-accent-foreground',\n outline:\n 'border border-input border-l-0 bg-transparent hover:bg-accent hover:text-accent-foreground',\n },\n },\n }\n);\n\ntype ToolbarButtonProps = {\n isDropdown?: boolean;\n pressed?: boolean;\n} & Omit<\n React.ComponentPropsWithoutRef<typeof ToolbarToggleItem>,\n 'asChild' | 'value'\n> &\n VariantProps<typeof toolbarButtonVariants>;\n\nexport const ToolbarButton = withTooltip(function ToolbarButton({\n children,\n className,\n isDropdown,\n pressed,\n size = 'sm',\n variant,\n ...props\n}: ToolbarButtonProps) {\n return typeof pressed === 'boolean' ? (\n <ToolbarToggleGroup disabled={props.disabled} value=\"single\" type=\"single\">\n <ToolbarToggleItem\n className={cn(\n toolbarButtonVariants({\n size,\n variant,\n }),\n isDropdown && 'justify-between gap-1 pr-1',\n className\n )}\n value={pressed ? 'single' : ''}\n {...props}\n >\n {isDropdown ? (\n <>\n <div className=\"flex flex-1 items-center gap-2 whitespace-nowrap\">\n {children}\n </div>\n <div>\n <ChevronDown\n className=\"size-3.5 text-muted-foreground\"\n data-icon\n />\n </div>\n </>\n ) : (\n children\n )}\n </ToolbarToggleItem>\n </ToolbarToggleGroup>\n ) : (\n <ToolbarPrimitive.Button\n className={cn(\n toolbarButtonVariants({\n size,\n variant,\n }),\n isDropdown && 'pr-1',\n className\n )}\n {...props}\n >\n {children}\n </ToolbarPrimitive.Button>\n );\n});\n\nexport function ToolbarSplitButton({\n className,\n ...props\n}: React.ComponentPropsWithoutRef<typeof ToolbarButton>) {\n return (\n <ToolbarButton\n className={cn('group flex gap-0 px-0 hover:bg-transparent', className)}\n {...props}\n />\n );\n}\n\ntype ToolbarSplitButtonPrimaryProps = Omit<\n React.ComponentPropsWithoutRef<typeof ToolbarToggleItem>,\n 'value'\n> &\n VariantProps<typeof toolbarButtonVariants>;\n\nexport function ToolbarSplitButtonPrimary({\n children,\n className,\n size = 'sm',\n variant,\n ...props\n}: ToolbarSplitButtonPrimaryProps) {\n return (\n <span\n className={cn(\n toolbarButtonVariants({\n size,\n variant,\n }),\n 'rounded-r-none',\n 'group-data-[pressed=true]:bg-accent group-data-[pressed=true]:text-accent-foreground',\n className\n )}\n {...props}\n >\n {children}\n </span>\n );\n}\n\nexport function ToolbarSplitButtonSecondary({\n className,\n size,\n variant,\n ...props\n}: React.ComponentPropsWithoutRef<'span'> &\n VariantProps<typeof dropdownArrowVariants>) {\n return (\n <span\n className={cn(\n dropdownArrowVariants({\n size,\n variant,\n }),\n 'group-data-[pressed=true]:bg-accent group-data-[pressed=true]:text-accent-foreground',\n className\n )}\n onClick={(e) => e.stopPropagation()}\n role=\"button\"\n {...props}\n >\n <ChevronDown className=\"size-3.5 text-muted-foreground\" data-icon />\n </span>\n );\n}\n\nexport function ToolbarToggleItem({\n className,\n size = 'sm',\n variant,\n ...props\n}: React.ComponentProps<typeof ToolbarPrimitive.ToggleItem> &\n VariantProps<typeof toolbarButtonVariants>) {\n return (\n <ToolbarPrimitive.ToggleItem\n className={cn(toolbarButtonVariants({ size, variant }), className)}\n {...props}\n />\n );\n}\n\nexport function ToolbarGroup({\n children,\n className,\n}: React.ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'group/toolbar-group',\n 'relative hidden has-[button]:flex',\n className\n )}\n >\n <div className=\"flex items-center\">{children}</div>\n\n <div className=\"group-last/toolbar-group:hidden! mx-1.5 py-0.5\">\n <Separator orientation=\"vertical\" />\n </div>\n </div>\n );\n}\n\ntype TooltipProps<T extends React.ElementType> = {\n tooltip?: React.ReactNode;\n tooltipContentProps?: Omit<\n React.ComponentPropsWithoutRef<typeof TooltipContent>,\n 'children'\n >;\n tooltipProps?: Omit<\n React.ComponentPropsWithoutRef<typeof Tooltip>,\n 'children'\n >;\n tooltipTriggerProps?: React.ComponentPropsWithoutRef<typeof TooltipTrigger>;\n} & React.ComponentProps<T>;\n\nfunction withTooltip<T extends React.ElementType>(Component: T) {\n return function ExtendComponent({\n tooltip,\n tooltipContentProps,\n tooltipProps,\n tooltipTriggerProps,\n ...props\n }: TooltipProps<T>) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n const component = <Component {...(props as React.ComponentProps<T>)} />;\n\n if (tooltip && mounted) {\n return (\n <Tooltip {...tooltipProps}>\n <TooltipTrigger asChild {...tooltipTriggerProps}>\n {component}\n </TooltipTrigger>\n\n <TooltipContent {...tooltipContentProps}>{tooltip}</TooltipContent>\n </Tooltip>\n );\n }\n\n return component;\n };\n}\n\nfunction TooltipContent({\n children,\n className,\n // CHANGE\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n className={cn(\n 'z-1500 w-fit origin-(--radix-tooltip-content-transform-origin) text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs',\n className\n )}\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n {...props}\n >\n {children}\n {/* CHANGE */}\n {/* <TooltipPrimitive.Arrow className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary\" /> */}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport function ToolbarMenuGroup({\n children,\n className,\n label,\n ...props\n}: React.ComponentProps<typeof DropdownMenuRadioGroup> & { label?: string }) {\n return (\n <>\n <DropdownMenuSeparator\n className={cn(\n 'hidden',\n 'mb-0 shrink-0 peer-has-[[role=menuitem]]/menu-group:block peer-has-[[role=menuitemradio]]/menu-group:block peer-has-[[role=option]]/menu-group:block'\n )}\n />\n\n <DropdownMenuRadioGroup\n {...props}\n className={cn(\n 'hidden',\n 'peer/menu-group group/menu-group my-1.5 has-[[role=menuitem]]:block has-[[role=menuitemradio]]:block has-[[role=option]]:block',\n className\n )}\n >\n {label && (\n <DropdownMenuLabel className=\"select-none font-semibold text-muted-foreground text-xs\">\n {label}\n </DropdownMenuLabel>\n )}\n {children}\n </DropdownMenuRadioGroup>\n </>\n );\n}\n","'use client';\n/* eslint-disable react-hooks/refs */\n\nimport * as React from 'react';\n\nimport type { Emoji } from '@emoji-mart/data';\n\nimport {\n type EmojiCategoryList,\n type EmojiIconList,\n type GridRow,\n EmojiSettings,\n} from '@platejs/emoji';\nimport {\n type EmojiDropdownMenuOptions,\n type UseEmojiPickerType,\n useEmojiDropdownMenuState,\n} from '@platejs/emoji/react';\nimport * as Popover from '@radix-ui/react-popover';\nimport {\n AppleIcon,\n ClockIcon,\n CompassIcon,\n FlagIcon,\n LeafIcon,\n LightbulbIcon,\n MusicIcon,\n SearchIcon,\n SmileIcon,\n StarIcon,\n XIcon,\n} from 'lucide-react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\nimport { ToolbarButton } from '@/components/ui/toolbar';\n\nexport function EmojiToolbarButton({\n options,\n ...props\n}: {\n options?: EmojiDropdownMenuOptions;\n} & React.ComponentPropsWithoutRef<typeof ToolbarButton>) {\n const { emojiPickerState, isOpen, setIsOpen } =\n useEmojiDropdownMenuState(options);\n\n return (\n <EmojiPopover\n control={\n <ToolbarButton pressed={isOpen} tooltip=\"Emoji\" isDropdown {...props}>\n <SmileIcon />\n </ToolbarButton>\n }\n isOpen={isOpen}\n setIsOpen={setIsOpen}\n >\n <EmojiPicker\n {...emojiPickerState}\n isOpen={isOpen}\n setIsOpen={setIsOpen}\n settings={options?.settings}\n />\n </EmojiPopover>\n );\n}\n\nexport function EmojiPopover({\n children,\n control,\n isOpen,\n setIsOpen,\n}: {\n children: React.ReactNode;\n control: React.ReactNode;\n isOpen: boolean;\n setIsOpen: (open: boolean) => void;\n}) {\n return (\n <Popover.Root open={isOpen} onOpenChange={setIsOpen}>\n <Popover.Trigger asChild>{control}</Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content className=\"z-100\">{children}</Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\nexport function EmojiPicker({\n clearSearch,\n emoji,\n emojiLibrary,\n focusedCategory,\n hasFound,\n i18n,\n icons = {\n categories: emojiCategoryIcons,\n search: emojiSearchIcons,\n },\n isSearching,\n refs,\n searchResult,\n searchValue,\n setSearch,\n settings = EmojiSettings,\n visibleCategories,\n handleCategoryClick,\n onMouseOver,\n onSelectEmoji,\n}: Omit<UseEmojiPickerType, 'icons'> & {\n icons?: EmojiIconList<React.ReactElement>;\n}) {\n return (\n <div\n className={cn(\n 'flex flex-col rounded-xl bg-popover text-popover-foreground',\n 'h-[23rem] w-80 border shadow-md'\n )}\n >\n <EmojiPickerNavigation\n onClick={handleCategoryClick}\n emojiLibrary={emojiLibrary}\n focusedCategory={focusedCategory}\n i18n={i18n}\n icons={icons}\n />\n <EmojiPickerSearchBar\n i18n={i18n}\n searchValue={searchValue}\n setSearch={setSearch}\n >\n <EmojiPickerSearchAndClear\n clearSearch={clearSearch}\n i18n={i18n}\n searchValue={searchValue}\n />\n </EmojiPickerSearchBar>\n <EmojiPickerContent\n onMouseOver={onMouseOver}\n onSelectEmoji={onSelectEmoji}\n emojiLibrary={emojiLibrary}\n i18n={i18n}\n isSearching={isSearching}\n refs={refs}\n searchResult={searchResult}\n settings={settings}\n visibleCategories={visibleCategories}\n />\n <EmojiPickerPreview\n emoji={emoji}\n hasFound={hasFound}\n i18n={i18n}\n isSearching={isSearching}\n />\n </div>\n );\n}\n\nconst EmojiButton = React.memo(function EmojiButton({\n emoji,\n index,\n onMouseOver,\n onSelect,\n}: {\n emoji: Emoji;\n index: number;\n onMouseOver: (emoji?: Emoji) => void;\n onSelect: (emoji: Emoji) => void;\n}) {\n return (\n <button\n className=\"group relative flex size-9 cursor-pointer items-center justify-center border-none bg-transparent text-2xl leading-none\"\n onClick={() => onSelect(emoji)}\n onMouseEnter={() => onMouseOver(emoji)}\n onMouseLeave={() => onMouseOver()}\n aria-label={emoji.skins[0].native}\n data-index={index}\n tabIndex={-1}\n type=\"button\"\n >\n <div\n className=\"absolute inset-0 rounded-full opacity-0 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <span\n className=\"relative\"\n style={{\n fontFamily:\n '\"Apple Color Emoji\", \"Segoe UI Emoji\", NotoColorEmoji, \"Noto Color Emoji\", \"Segoe UI Symbol\", \"Android Emoji\", EmojiSymbols',\n }}\n data-emoji-set=\"native\"\n >\n {emoji.skins[0].native}\n </span>\n </button>\n );\n});\n\nconst RowOfButtons = React.memo(function RowOfButtons({\n emojiLibrary,\n row,\n onMouseOver,\n onSelectEmoji,\n}: {\n row: GridRow;\n} & Pick<\n UseEmojiPickerType,\n 'emojiLibrary' | 'onMouseOver' | 'onSelectEmoji'\n>) {\n return (\n <div key={row.id} className=\"flex\" data-index={row.id}>\n {row.elements.map((emojiId, index) => (\n <EmojiButton\n key={emojiId}\n onMouseOver={onMouseOver}\n onSelect={onSelectEmoji}\n emoji={emojiLibrary.getEmoji(emojiId)}\n index={index}\n />\n ))}\n </div>\n );\n});\n\nfunction EmojiPickerContent({\n emojiLibrary,\n i18n,\n isSearching = false,\n refs,\n searchResult,\n settings = EmojiSettings,\n visibleCategories,\n onMouseOver,\n onSelectEmoji,\n}: Pick<\n UseEmojiPickerType,\n | 'emojiLibrary'\n | 'i18n'\n | 'isSearching'\n | 'onMouseOver'\n | 'onSelectEmoji'\n | 'refs'\n | 'searchResult'\n | 'settings'\n | 'visibleCategories'\n>) {\n const getRowWidth = settings.perLine.value * settings.buttonSize.value;\n\n const isCategoryVisible = React.useCallback(\n (categoryId: any) =>\n visibleCategories.has(categoryId)\n ? visibleCategories.get(categoryId)\n : false,\n [visibleCategories]\n );\n\n const EmojiList = React.useCallback(\n () =>\n emojiLibrary\n .getGrid()\n .sections()\n .map(({ id: categoryId }) => {\n const section = emojiLibrary.getGrid().section(categoryId);\n const { buttonSize } = settings;\n\n return (\n <div\n key={categoryId}\n ref={section.root}\n style={{ width: getRowWidth }}\n data-id={categoryId}\n >\n <div className=\"-top-px sticky z-1 bg-popover/90 p-1 py-2 font-semibold text-sm backdrop-blur-xs\">\n {i18n.categories[categoryId]}\n </div>\n <div\n className=\"relative flex flex-wrap\"\n style={{ height: section.getRows().length * buttonSize.value }}\n >\n {isCategoryVisible(categoryId) &&\n section\n .getRows()\n .map((row: GridRow) => (\n <RowOfButtons\n key={row.id}\n onMouseOver={onMouseOver}\n onSelectEmoji={onSelectEmoji}\n emojiLibrary={emojiLibrary}\n row={row}\n />\n ))}\n </div>\n </div>\n );\n }),\n [\n emojiLibrary,\n getRowWidth,\n i18n.categories,\n isCategoryVisible,\n onSelectEmoji,\n onMouseOver,\n settings,\n ]\n );\n\n const SearchList = React.useCallback(\n () => (\n <div style={{ width: getRowWidth }} data-id=\"search\">\n <div className=\"-top-px sticky z-1 bg-popover/90 p-1 py-2 font-semibold text-card-foreground text-sm backdrop-blur-xs\">\n {i18n.searchResult}\n </div>\n <div className=\"relative flex flex-wrap\">\n {searchResult.map((emoji: Emoji, index: number) => (\n <EmojiButton\n key={emoji.id}\n onMouseOver={onMouseOver}\n onSelect={onSelectEmoji}\n emoji={emojiLibrary.getEmoji(emoji.id)}\n index={index}\n />\n ))}\n </div>\n </div>\n ),\n [\n emojiLibrary,\n getRowWidth,\n i18n.searchResult,\n searchResult,\n onSelectEmoji,\n onMouseOver,\n ]\n );\n\n return (\n <div\n ref={refs.current.contentRoot}\n className={cn(\n 'h-full min-h-[50%] overflow-y-auto overflow-x-hidden px-2',\n '[&::-webkit-scrollbar]:w-4',\n '[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:size-0',\n '[&::-webkit-scrollbar-thumb]:min-h-11 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted [&::-webkit-scrollbar-thumb]:hover:bg-muted-foreground/25',\n '[&::-webkit-scrollbar-thumb]:border-4 [&::-webkit-scrollbar-thumb]:border-popover [&::-webkit-scrollbar-thumb]:border-solid [&::-webkit-scrollbar-thumb]:bg-clip-padding'\n )}\n data-id=\"scroll\"\n >\n <div ref={refs.current.content} className=\"h-full\">\n {isSearching ? SearchList() : EmojiList()}\n </div>\n </div>\n );\n}\n\nfunction EmojiPickerSearchBar({\n children,\n i18n,\n searchValue,\n setSearch,\n}: {\n children: React.ReactNode;\n} & Pick<UseEmojiPickerType, 'i18n' | 'searchValue' | 'setSearch'>) {\n return (\n <div className=\"flex items-center px-2\">\n <div className=\"relative flex grow items-center\">\n <input\n className=\"block w-full appearance-none rounded-full border-0 bg-muted px-10 py-2 text-sm outline-none placeholder:text-muted-foreground focus-visible:outline-none\"\n value={searchValue}\n onChange={(event) => setSearch(event.target.value)}\n placeholder={i18n.search}\n aria-label=\"Search\"\n autoComplete=\"off\"\n type=\"text\"\n autoFocus\n />\n {children}\n </div>\n </div>\n );\n}\n\nfunction EmojiPickerSearchAndClear({\n clearSearch,\n i18n,\n searchValue,\n}: Pick<UseEmojiPickerType, 'clearSearch' | 'i18n' | 'searchValue'>) {\n return (\n <div className=\"flex items-center text-foreground\">\n <div\n className={cn(\n '-translate-y-1/2 absolute top-1/2 left-2.5 z-10 flex size-5 items-center justify-center text-foreground'\n )}\n >\n {emojiSearchIcons.loupe}\n </div>\n {searchValue && (\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className={cn(\n '-translate-y-1/2 absolute top-1/2 right-0.5 flex size-8 cursor-pointer items-center justify-center rounded-full border-none bg-transparent text-popover-foreground hover:bg-transparent'\n )}\n onClick={clearSearch}\n title={i18n.clear}\n aria-label=\"Clear\"\n type=\"button\"\n >\n {emojiSearchIcons.delete}\n </Button>\n )}\n </div>\n );\n}\n\nfunction EmojiPreview({ emoji }: Pick<UseEmojiPickerType, 'emoji'>) {\n return (\n <div className=\"flex h-14 max-h-14 min-h-14 items-center border-muted border-t p-2\">\n <div className=\"flex items-center justify-center text-2xl\">\n {emoji?.skins[0].native}\n </div>\n <div className=\"overflow-hidden pl-2\">\n <div className=\"truncate font-semibold text-sm\">{emoji?.name}</div>\n <div className=\"truncate text-sm\">{`:${emoji?.id}:`}</div>\n </div>\n </div>\n );\n}\n\nfunction NoEmoji({ i18n }: Pick<UseEmojiPickerType, 'i18n'>) {\n return (\n <div className=\"flex h-14 max-h-14 min-h-14 items-center border-muted border-t p-2\">\n <div className=\"flex items-center justify-center text-2xl\">😢</div>\n <div className=\"overflow-hidden pl-2\">\n <div className=\"truncate font-bold text-sm\">\n {i18n.searchNoResultsTitle}\n </div>\n <div className=\"truncate text-sm\">{i18n.searchNoResultsSubtitle}</div>\n </div>\n </div>\n );\n}\n\nfunction PickAnEmoji({ i18n }: Pick<UseEmojiPickerType, 'i18n'>) {\n return (\n <div className=\"flex h-14 max-h-14 min-h-14 items-center border-muted border-t p-2\">\n <div className=\"flex items-center justify-center text-2xl\">☝️</div>\n <div className=\"overflow-hidden pl-2\">\n <div className=\"truncate font-semibold text-sm\">{i18n.pick}</div>\n </div>\n </div>\n );\n}\n\nfunction EmojiPickerPreview({\n emoji,\n hasFound = true,\n i18n,\n isSearching = false,\n ...props\n}: Pick<UseEmojiPickerType, 'emoji' | 'hasFound' | 'i18n' | 'isSearching'>) {\n const showPickEmoji = !emoji && (!isSearching || hasFound);\n const showNoEmoji = isSearching && !hasFound;\n const showPreview = emoji && !showNoEmoji && !showNoEmoji;\n\n return (\n <>\n {showPreview && <EmojiPreview emoji={emoji} {...props} />}\n {showPickEmoji && <PickAnEmoji i18n={i18n} {...props} />}\n {showNoEmoji && <NoEmoji i18n={i18n} {...props} />}\n </>\n );\n}\n\nfunction EmojiPickerNavigation({\n emojiLibrary,\n focusedCategory,\n i18n,\n icons,\n onClick,\n}: {\n onClick: (id: EmojiCategoryList) => void;\n} & Pick<\n UseEmojiPickerType,\n 'emojiLibrary' | 'focusedCategory' | 'i18n' | 'icons'\n>) {\n return (\n <TooltipProvider delayDuration={500}>\n <nav\n id=\"emoji-nav\"\n className=\"mb-2.5 border-0 border-b border-b-border border-solid p-1.5\"\n >\n <div className=\"relative flex items-center justify-evenly\">\n {emojiLibrary\n .getGrid()\n .sections()\n .map(({ id }) => (\n <Tooltip key={id}>\n <TooltipTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className={cn(\n 'h-fit rounded-full fill-current p-1.5 text-muted-foreground hover:bg-muted hover:text-muted-foreground',\n id === focusedCategory &&\n 'pointer-events-none bg-accent fill-current text-accent-foreground'\n )}\n onClick={() => {\n onClick(id);\n }}\n aria-label={i18n.categories[id]}\n type=\"button\"\n >\n <span className=\"inline-flex size-5 items-center justify-center\">\n {icons.categories[id].outline}\n </span>\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">\n {i18n.categories[id]}\n </TooltipContent>\n </Tooltip>\n ))}\n </div>\n </nav>\n </TooltipProvider>\n );\n}\n\nconst emojiCategoryIcons: Record<\n EmojiCategoryList,\n {\n outline: React.ReactElement;\n solid: React.ReactElement; // Needed to add another solid variant - outline will be used for now\n }\n> = {\n activity: {\n outline: (\n <svg\n className=\"size-full\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M2.1 13.4A10.1 10.1 0 0 0 13.4 2.1\" />\n <path d=\"m5 4.9 14 14.2\" />\n <path d=\"M21.9 10.6a10.1 10.1 0 0 0-11.3 11.3\" />\n </svg>\n ),\n solid: (\n <svg\n className=\"size-full\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M2.1 13.4A10.1 10.1 0 0 0 13.4 2.1\" />\n <path d=\"m5 4.9 14 14.2\" />\n <path d=\"M21.9 10.6a10.1 10.1 0 0 0-11.3 11.3\" />\n </svg>\n ),\n },\n\n custom: {\n outline: <StarIcon className=\"size-full\" />,\n solid: <StarIcon className=\"size-full\" />,\n },\n\n flags: {\n outline: <FlagIcon className=\"size-full\" />,\n solid: <FlagIcon className=\"size-full\" />,\n },\n\n foods: {\n outline: <AppleIcon className=\"size-full\" />,\n solid: <AppleIcon className=\"size-full\" />,\n },\n\n frequent: {\n outline: <ClockIcon className=\"size-full\" />,\n solid: <ClockIcon className=\"size-full\" />,\n },\n\n nature: {\n outline: <LeafIcon className=\"size-full\" />,\n solid: <LeafIcon className=\"size-full\" />,\n },\n\n objects: {\n outline: <LightbulbIcon className=\"size-full\" />,\n solid: <LightbulbIcon className=\"size-full\" />,\n },\n\n people: {\n outline: <SmileIcon className=\"size-full\" />,\n solid: <SmileIcon className=\"size-full\" />,\n },\n\n places: {\n outline: <CompassIcon className=\"size-full\" />,\n solid: <CompassIcon className=\"size-full\" />,\n },\n\n symbols: {\n outline: <MusicIcon className=\"size-full\" />,\n solid: <MusicIcon className=\"size-full\" />,\n },\n};\n\nconst emojiSearchIcons = {\n delete: <XIcon className=\"size-4 text-current\" />,\n loupe: <SearchIcon className=\"size-4 text-current\" />,\n};\n","'use client';\n\nimport { CalloutPlugin } from '@platejs/callout/react';\n\nimport { CalloutElement } from '@/components/ui/callout-node';\n\nexport const CalloutKit = [CalloutPlugin.withComponent(CalloutElement)];\n","'use client';\n\nimport * as React from 'react';\n\nimport { useCalloutEmojiPicker } from '@platejs/callout/react';\nimport { useEmojiDropdownMenuState } from '@platejs/emoji/react';\nimport { PlateElement } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\nimport { EmojiPicker, EmojiPopover } from './emoji-toolbar-button';\n\nexport function CalloutElement({\n attributes,\n children,\n className,\n ...props\n}: React.ComponentProps<typeof PlateElement>) {\n const { emojiPickerState, isOpen, setIsOpen } = useEmojiDropdownMenuState({\n closeOnSelect: true,\n });\n\n const { emojiToolbarDropdownProps, props: calloutProps } =\n useCalloutEmojiPicker({\n isOpen,\n setIsOpen,\n });\n\n return (\n <PlateElement\n className={cn('my-1 flex rounded-sm bg-muted p-4 pl-3', className)}\n style={{\n backgroundColor: props.element.backgroundColor as any,\n }}\n attributes={{\n ...attributes,\n 'data-plate-open-context-menu': true,\n }}\n {...props}\n >\n <div className=\"flex w-full gap-2 rounded-md\">\n <EmojiPopover\n {...emojiToolbarDropdownProps}\n control={\n <Button\n variant=\"ghost\"\n className=\"size-6 select-none p-1 text-[18px] hover:bg-muted-foreground/15\"\n style={{\n fontFamily:\n '\"Apple Color Emoji\", \"Segoe UI Emoji\", NotoColorEmoji, \"Noto Color Emoji\", \"Segoe UI Symbol\", \"Android Emoji\", EmojiSymbols',\n }}\n contentEditable={false}\n >\n {(props.element.icon as any) || '💡'}\n </Button>\n }\n >\n <EmojiPicker {...emojiPickerState} {...calloutProps} />\n </EmojiPopover>\n <div className=\"w-full\">{children}</div>\n </div>\n </PlateElement>\n );\n}\n","import * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { SearchIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\"\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string\n description?: string\n className?: string\n showCloseButton?: boolean\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n )\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"bg-border -mx-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n )\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n","'use client';\n\nimport * as React from 'react';\n\nimport { formatCodeBlock, isLangSupported } from '@platejs/code-block';\nimport { BracesIcon, Check, CheckIcon, CopyIcon } from 'lucide-react';\nimport { type TCodeBlockElement, type TCodeSyntaxLeaf, NodeApi } from 'platejs';\nimport {\n type PlateElementProps,\n type PlateLeafProps,\n PlateElement,\n PlateLeaf,\n} from 'platejs/react';\nimport { useEditorRef, useElement, useReadOnly } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/components/ui/command';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport function CodeBlockElement(props: PlateElementProps<TCodeBlockElement>) {\n const { editor, element } = props;\n\n return (\n <PlateElement\n className=\"py-1 **:[.hljs-addition]:bg-[#f0fff4] **:[.hljs-addition]:text-[#22863a] dark:**:[.hljs-addition]:bg-[#3c5743] dark:**:[.hljs-addition]:text-[#ceead5] **:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#005cc5] dark:**:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#6596cf] **:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#e36209] dark:**:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#c3854e] **:[.hljs-bullet]:text-[#735c0f] **:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] dark:**:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] **:[.hljs-deletion]:bg-[#ffeef0] **:[.hljs-deletion]:text-[#b31d28] dark:**:[.hljs-deletion]:bg-[#473235] dark:**:[.hljs-deletion]:text-[#e7c7cb] **:[.hljs-emphasis]:italic **:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#d73a49] dark:**:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#ee6960] **:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#22863a] dark:**:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#36a84f] **:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#032f62] dark:**:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#3593ff] **:[.hljs-section]:font-bold **:[.hljs-section]:text-[#005cc5] dark:**:[.hljs-section]:text-[#61a5f2] **:[.hljs-strong]:font-bold **:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#6f42c1] dark:**:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#a77bfa]\"\n {...props}\n >\n <div className=\"relative rounded-md bg-muted/50\">\n <pre className=\"overflow-x-auto p-8 pr-4 font-mono text-sm leading-[normal] [tab-size:2] print:break-inside-avoid\">\n <code>{props.children}</code>\n </pre>\n\n <div\n className=\"absolute top-1 right-1 z-10 flex select-none gap-0.5\"\n contentEditable={false}\n >\n {isLangSupported(element.lang) && (\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-6 text-xs\"\n onClick={() => formatCodeBlock(editor, { element })}\n title=\"Format code\"\n >\n <BracesIcon className=\"!size-3.5 text-muted-foreground\" />\n </Button>\n )}\n\n <CodeBlockCombobox />\n\n <CopyButton\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-6 gap-1 text-muted-foreground text-xs\"\n value={() => NodeApi.string(element)}\n />\n </div>\n </div>\n </PlateElement>\n );\n}\n\nfunction CodeBlockCombobox() {\n const [open, setOpen] = React.useState(false);\n const readOnly = useReadOnly();\n const editor = useEditorRef();\n const element = useElement<TCodeBlockElement>();\n const value = element.lang || 'plaintext';\n const [searchValue, setSearchValue] = React.useState('');\n\n const items = React.useMemo(\n () =>\n languages.filter(\n (language) =>\n !searchValue ||\n language.label.toLowerCase().includes(searchValue.toLowerCase())\n ),\n [searchValue]\n );\n\n if (readOnly) return null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 select-none justify-between gap-1 px-2 text-muted-foreground text-xs\"\n aria-expanded={open}\n role=\"combobox\"\n >\n {languages.find((language) => language.value === value)?.label ??\n 'Plain Text'}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[200px] p-0\"\n onCloseAutoFocus={() => setSearchValue('')}\n >\n <Command shouldFilter={false}>\n <CommandInput\n className=\"h-9\"\n value={searchValue}\n onValueChange={(value) => setSearchValue(value)}\n placeholder=\"Search language...\"\n />\n <CommandEmpty>No language found.</CommandEmpty>\n\n <CommandList className=\"h-[344px] overflow-y-auto\">\n <CommandGroup>\n {items.map((language) => (\n <CommandItem\n key={language.label}\n className=\"cursor-pointer\"\n value={language.value}\n onSelect={(value) => {\n editor.tf.setNodes<TCodeBlockElement>(\n { lang: value },\n { at: element }\n );\n setSearchValue(value);\n setOpen(false);\n }}\n >\n <Check\n className={cn(\n value === language.value ? 'opacity-100' : 'opacity-0'\n )}\n />\n {language.label}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction CopyButton({\n value,\n ...props\n}: { value: (() => string) | string } & Omit<\n React.ComponentProps<typeof Button>,\n 'value'\n>) {\n const [hasCopied, setHasCopied] = React.useState(false);\n\n React.useEffect(() => {\n setTimeout(() => {\n setHasCopied(false);\n }, 2000);\n }, [hasCopied]);\n\n return (\n <Button\n onClick={() => {\n void navigator.clipboard.writeText(\n typeof value === 'function' ? value() : value\n );\n setHasCopied(true);\n }}\n {...props}\n >\n <span className=\"sr-only\">Copy</span>\n {hasCopied ? (\n <CheckIcon className=\"!size-3\" />\n ) : (\n <CopyIcon className=\"!size-3\" />\n )}\n </Button>\n );\n}\n\nexport function CodeLineElement(props: PlateElementProps) {\n return <PlateElement {...props} />;\n}\n\nexport function CodeSyntaxLeaf(props: PlateLeafProps<TCodeSyntaxLeaf>) {\n const tokenClassName = props.leaf.className as string;\n\n return <PlateLeaf className={tokenClassName} {...props} />;\n}\n\nconst languages: { label: string; value: string }[] = [\n { label: 'Auto', value: 'auto' },\n { label: 'Plain Text', value: 'plaintext' },\n { label: 'ABAP', value: 'abap' },\n { label: 'Agda', value: 'agda' },\n { label: 'Arduino', value: 'arduino' },\n { label: 'ASCII Art', value: 'ascii' },\n { label: 'Assembly', value: 'x86asm' },\n { label: 'Bash', value: 'bash' },\n { label: 'BASIC', value: 'basic' },\n { label: 'BNF', value: 'bnf' },\n { label: 'C', value: 'c' },\n { label: 'C#', value: 'csharp' },\n { label: 'C++', value: 'cpp' },\n { label: 'Clojure', value: 'clojure' },\n { label: 'CoffeeScript', value: 'coffeescript' },\n { label: 'Coq', value: 'coq' },\n { label: 'CSS', value: 'css' },\n { label: 'Dart', value: 'dart' },\n { label: 'Dhall', value: 'dhall' },\n { label: 'Diff', value: 'diff' },\n { label: 'Docker', value: 'dockerfile' },\n { label: 'EBNF', value: 'ebnf' },\n { label: 'Elixir', value: 'elixir' },\n { label: 'Elm', value: 'elm' },\n { label: 'Erlang', value: 'erlang' },\n { label: 'F#', value: 'fsharp' },\n { label: 'Flow', value: 'flow' },\n { label: 'Fortran', value: 'fortran' },\n { label: 'Gherkin', value: 'gherkin' },\n { label: 'GLSL', value: 'glsl' },\n { label: 'Go', value: 'go' },\n { label: 'GraphQL', value: 'graphql' },\n { label: 'Groovy', value: 'groovy' },\n { label: 'Haskell', value: 'haskell' },\n { label: 'HCL', value: 'hcl' },\n { label: 'HTML', value: 'html' },\n { label: 'Idris', value: 'idris' },\n { label: 'Java', value: 'java' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'JSON', value: 'json' },\n { label: 'Julia', value: 'julia' },\n { label: 'Kotlin', value: 'kotlin' },\n { label: 'LaTeX', value: 'latex' },\n { label: 'Less', value: 'less' },\n { label: 'Lisp', value: 'lisp' },\n { label: 'LiveScript', value: 'livescript' },\n { label: 'LLVM IR', value: 'llvm' },\n { label: 'Lua', value: 'lua' },\n { label: 'Makefile', value: 'makefile' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'Markup', value: 'markup' },\n { label: 'MATLAB', value: 'matlab' },\n { label: 'Mathematica', value: 'mathematica' },\n { label: 'Mermaid', value: 'mermaid' },\n { label: 'Nix', value: 'nix' },\n { label: 'Notion Formula', value: 'notion' },\n { label: 'Objective-C', value: 'objectivec' },\n { label: 'OCaml', value: 'ocaml' },\n { label: 'Pascal', value: 'pascal' },\n { label: 'Perl', value: 'perl' },\n { label: 'PHP', value: 'php' },\n { label: 'PowerShell', value: 'powershell' },\n { label: 'Prolog', value: 'prolog' },\n { label: 'Protocol Buffers', value: 'protobuf' },\n { label: 'PureScript', value: 'purescript' },\n { label: 'Python', value: 'python' },\n { label: 'R', value: 'r' },\n { label: 'Racket', value: 'racket' },\n { label: 'Reason', value: 'reasonml' },\n { label: 'Ruby', value: 'ruby' },\n { label: 'Rust', value: 'rust' },\n { label: 'Sass', value: 'scss' },\n { label: 'Scala', value: 'scala' },\n { label: 'Scheme', value: 'scheme' },\n { label: 'SCSS', value: 'scss' },\n { label: 'Shell', value: 'shell' },\n { label: 'Smalltalk', value: 'smalltalk' },\n { label: 'Solidity', value: 'solidity' },\n { label: 'SQL', value: 'sql' },\n { label: 'Swift', value: 'swift' },\n { label: 'TOML', value: 'toml' },\n { label: 'TypeScript', value: 'typescript' },\n { label: 'VB.Net', value: 'vbnet' },\n { label: 'Verilog', value: 'verilog' },\n { label: 'VHDL', value: 'vhdl' },\n { label: 'Visual Basic', value: 'vbnet' },\n { label: 'WebAssembly', value: 'wasm' },\n { label: 'XML', value: 'xml' },\n { label: 'YAML', value: 'yaml' },\n];\n","'use client';\n\nimport {\n CodeBlockPlugin,\n CodeLinePlugin,\n CodeSyntaxPlugin,\n} from '@platejs/code-block/react';\nimport { all, createLowlight } from 'lowlight';\n\nimport {\n CodeBlockElement,\n CodeLineElement,\n CodeSyntaxLeaf,\n} from '@/components/ui/code-block-node';\n\nconst lowlight = createLowlight(all);\n\nexport const CodeBlockKit = [\n CodeBlockPlugin.configure({\n node: { component: CodeBlockElement },\n options: { lowlight },\n shortcuts: { toggle: { keys: 'mod+alt+8' } },\n }),\n CodeLinePlugin.withComponent(CodeLineElement),\n CodeSyntaxPlugin.withComponent(CodeSyntaxLeaf),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TColumnElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useDraggable, useDropLine } from '@platejs/dnd';\nimport { setColumns } from '@platejs/layout';\nimport { ResizableProvider } from '@platejs/resizable';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { useComposedRef } from '@udecode/cn';\nimport { type LucideProps, Trash2Icon } from 'lucide-react';\nimport { GripHorizontal } from 'lucide-react';\nimport { PathApi } from 'platejs';\nimport {\n PlateElement,\n useEditorRef,\n useEditorSelector,\n useElement,\n useFocusedLast,\n usePluginOption,\n useReadOnly,\n useRemoveNodeButton,\n useSelected,\n withHOC,\n} from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n} from '@/components/ui/popover';\nimport { Separator } from '@/components/ui/separator';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nexport const ColumnElement = withHOC(\n ResizableProvider,\n function ColumnElement(props: PlateElementProps<TColumnElement>) {\n const { width } = props.element;\n const readOnly = useReadOnly();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n\n const { isDragging, previewRef, handleRef } = useDraggable({\n element: props.element,\n orientation: 'horizontal',\n type: 'column',\n canDropNode: ({ dragEntry, dropEntry }) =>\n PathApi.equals(\n PathApi.parent(dragEntry[1]),\n PathApi.parent(dropEntry[1])\n ),\n });\n\n return (\n <div className=\"group/column relative\" style={{ width: width ?? '100%' }}>\n {!readOnly && !isSelectionAreaVisible && (\n <div\n ref={handleRef}\n className={cn(\n '-translate-x-1/2 -translate-y-1/2 absolute top-2 left-1/2 z-50',\n 'pointer-events-auto flex items-center',\n 'opacity-0 transition-opacity group-hover/column:opacity-100'\n )}\n >\n <ColumnDragHandle />\n </div>\n )}\n\n <PlateElement\n {...props}\n ref={useComposedRef(props.ref, previewRef)}\n className=\"h-full px-2 pt-2 group-first/column:pl-0 group-last/column:pr-0\"\n >\n <div\n className={cn(\n 'relative h-full border border-transparent p-1.5',\n !readOnly && 'rounded-lg border-border border-dashed',\n isDragging && 'opacity-50'\n )}\n >\n {props.children}\n\n {!readOnly && !isSelectionAreaVisible && <DropLine />}\n </div>\n </PlateElement>\n </div>\n );\n }\n);\n\nconst ColumnDragHandle = React.memo(function ColumnDragHandle() {\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button variant=\"ghost\" className=\"!px-1 h-5\">\n <GripHorizontal\n className=\"text-muted-foreground\"\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n />\n </Button>\n </TooltipTrigger>\n\n <TooltipContent>Drag to move column</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n});\n\nfunction DropLine() {\n const { dropLine } = useDropLine({ orientation: 'horizontal' });\n\n if (!dropLine) return null;\n\n return (\n <div\n className={cn(\n 'slate-dropLine',\n 'absolute bg-brand/50',\n dropLine === 'left' &&\n 'group-first/column:-left-1 inset-y-0 left-[-10.5px] w-1',\n dropLine === 'right' &&\n 'group-last/column:-right-1 inset-y-0 right-[-11px] w-1'\n )}\n />\n );\n}\n\nexport function ColumnGroupElement(props: PlateElementProps) {\n return (\n <PlateElement className=\"mb-2\" {...props}>\n <ColumnFloatingToolbar>\n <div className=\"flex size-full rounded\">{props.children}</div>\n </ColumnFloatingToolbar>\n </PlateElement>\n );\n}\n\nfunction ColumnFloatingToolbar({ children }: React.PropsWithChildren) {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n const element = useElement<TColumnElement>();\n const { props: buttonProps } = useRemoveNodeButton({ element });\n const selected = useSelected();\n const isCollapsed = useEditorSelector(\n (editor) => editor.api.isCollapsed(),\n []\n );\n const isFocusedLast = useFocusedLast();\n\n const open = isFocusedLast && !readOnly && selected && isCollapsed;\n\n const onColumnChange = (widths: string[]) => {\n setColumns(editor, {\n at: element,\n widths,\n });\n };\n\n return (\n <Popover open={open} modal={false}>\n <PopoverAnchor>{children}</PopoverAnchor>\n <PopoverContent\n className=\"w-auto p-1\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n align=\"center\"\n side=\"top\"\n sideOffset={10}\n >\n <div className=\"box-content flex h-8 items-center\">\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['50%', '50%'])}\n >\n <DoubleColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['33%', '33%', '33%'])}\n >\n <ThreeColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['70%', '30%'])}\n >\n <RightSideDoubleColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['30%', '70%'])}\n >\n <LeftSideDoubleColumnOutlined />\n </Button>\n <Button\n variant=\"ghost\"\n className=\"size-8\"\n onClick={() => onColumnChange(['25%', '50%', '25%'])}\n >\n <DoubleSideDoubleColumnOutlined />\n </Button>\n\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <Button variant=\"ghost\" className=\"size-8\" {...buttonProps}>\n <Trash2Icon />\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nconst DoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M8.5 3H13V13H8.5V3ZM7.5 2H8.5H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H8.5H7.5H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H7.5ZM7.5 13H3L3 3H7.5V13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst ThreeColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M9.25 3H6.75V13H9.25V3ZM9.25 2H6.75H5.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H5.75H6.75H9.25H10.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H10.25H9.25ZM10.25 3V13H13V3H10.25ZM3 13H5.75V3H3L3 13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst RightSideDoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M11.25 3H13V13H11.25V3ZM10.25 2H11.25H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H11.25H10.25H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H10.25ZM10.25 13H3L3 3H10.25V13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst LeftSideDoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M5.75 3H13V13H5.75V3ZM4.75 2H5.75H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H5.75H4.75H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H4.75ZM4.75 13H3L3 3H4.75V13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n\nconst DoubleSideDoubleColumnOutlined = (props: LucideProps) => (\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M10.25 3H5.75V13H10.25V3ZM10.25 2H5.75H4.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H4.75H5.75H10.25H11.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H11.25H10.25ZM11.25 3V13H13V3H11.25ZM3 13H4.75V3H3L3 13Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n);\n","'use client';\n\nimport { ColumnItemPlugin, ColumnPlugin } from '@platejs/layout/react';\n\nimport { ColumnElement, ColumnGroupElement } from '@/components/ui/column-node';\n\nexport const ColumnKit = [\n ColumnPlugin.withComponent(ColumnGroupElement),\n ColumnItemPlugin.withComponent(ColumnElement),\n];\n","'use client';\n\nimport type { ExtendConfig, Path } from 'platejs';\n\nimport {\n type BaseCommentConfig,\n BaseCommentPlugin,\n getDraftCommentKey,\n} from '@platejs/comment';\nimport { isSlateString } from 'platejs';\nimport { toTPlatePlugin } from 'platejs/react';\n\nimport { CommentLeaf } from '@/components/ui/comment-node';\n\ntype CommentConfig = ExtendConfig<\n BaseCommentConfig,\n {\n activeId: string | null;\n commentingBlock: Path | null;\n hoverId: string | null;\n uniquePathMap: Map<string, Path>;\n }\n>;\n\nexport const commentPlugin = toTPlatePlugin<CommentConfig>(BaseCommentPlugin, {\n handlers: {\n onClick: ({ api, event, setOption, type }) => {\n let leaf = event.target as HTMLElement;\n let isSet = false;\n\n const unsetActiveSuggestion = () => {\n setOption('activeId', null);\n isSet = true;\n };\n\n if (!isSlateString(leaf)) unsetActiveSuggestion();\n\n while (leaf.parentElement) {\n if (leaf.classList.contains(`slate-${type}`)) {\n const commentsEntry = api.comment!.node();\n\n if (!commentsEntry) {\n unsetActiveSuggestion();\n\n break;\n }\n\n const id = api.comment!.nodeId(commentsEntry[0]);\n\n setOption('activeId', id ?? null);\n isSet = true;\n\n break;\n }\n\n leaf = leaf.parentElement;\n }\n\n if (!isSet) unsetActiveSuggestion();\n },\n },\n options: {\n activeId: null,\n commentingBlock: null,\n hoverId: null,\n uniquePathMap: new Map(),\n },\n})\n .extendTransforms(\n ({\n editor,\n setOption,\n tf: {\n comment: { setDraft },\n },\n }) => ({\n setDraft: () => {\n if (editor.api.isCollapsed()) {\n editor.tf.select(editor.api.block()![1]);\n }\n\n setDraft();\n\n editor.tf.collapse();\n setOption('activeId', getDraftCommentKey());\n setOption('commentingBlock', editor.selection!.focus.path.slice(0, 1));\n },\n })\n )\n .configure({\n node: { component: CommentLeaf },\n shortcuts: {\n setDraft: { keys: 'mod+shift+m' },\n },\n });\n\nexport const CommentKit = [commentPlugin];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TCommentText } from 'platejs';\nimport type { PlateLeafProps } from 'platejs/react';\n\nimport { getCommentCount } from '@platejs/comment';\nimport { PlateLeaf, useEditorPlugin, usePluginOption } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\nimport { commentPlugin } from '@/components/editor/plugins/comment-kit';\n\nexport function CommentLeaf(props: PlateLeafProps<TCommentText>) {\n const { children, leaf } = props;\n\n const { api, setOption } = useEditorPlugin(commentPlugin);\n const hoverId = usePluginOption(commentPlugin, 'hoverId');\n const activeId = usePluginOption(commentPlugin, 'activeId');\n\n const isOverlapping = getCommentCount(leaf) > 1;\n const currentId = api.comment.nodeId(leaf);\n const isActive = activeId === currentId;\n const isHover = hoverId === currentId;\n\n return (\n <PlateLeaf\n {...props}\n className={cn(\n 'border-b-2 border-b-highlight/[.36] bg-highlight/[.13] transition-colors duration-200',\n (isHover || isActive) && 'border-b-highlight bg-highlight/25',\n isOverlapping && 'border-b-2 border-b-highlight/[.7] bg-highlight/25',\n (isHover || isActive) &&\n isOverlapping &&\n 'border-b-highlight bg-highlight/45'\n )}\n attributes={{\n ...props.attributes,\n onClick: () => setOption('activeId', currentId ?? null),\n onMouseEnter: () => setOption('hoverId', currentId ?? null),\n onMouseLeave: () => setOption('hoverId', null),\n }}\n >\n {children}\n </PlateLeaf>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport {\n type CursorData,\n type CursorOverlayState,\n useCursorOverlay,\n} from '@platejs/selection/react';\nimport { RangeApi } from 'platejs';\nimport { usePluginOption } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function CursorOverlay() {\n const { cursors } = useCursorOverlay();\n\n return (\n <>\n {cursors.map((cursor) => (\n <Cursor key={cursor.id} {...cursor} />\n ))}\n </>\n );\n}\n\nfunction Cursor({\n id,\n caretPosition,\n data,\n selection,\n selectionRects,\n}: CursorOverlayState<CursorData>) {\n const streaming = usePluginOption(AIChatPlugin, 'streaming');\n const { style, selectionStyle = style } = data ?? ({} as CursorData);\n const isCursor = RangeApi.isCollapsed(selection);\n\n if (streaming) return null;\n\n return (\n <>\n {selectionRects.map((position, i) => (\n <div\n key={i}\n className={cn(\n 'pointer-events-none absolute z-10',\n id === 'selection' && 'bg-brand/25',\n id === 'selection' && isCursor && 'bg-primary'\n )}\n style={{\n ...selectionStyle,\n ...position,\n }}\n />\n ))}\n {caretPosition && (\n <div\n className={cn(\n 'pointer-events-none absolute z-10 w-0.5',\n id === 'drag' && 'w-px bg-brand'\n )}\n style={{ ...caretPosition, ...style }}\n />\n )}\n </>\n );\n}\n","'use client';\n\nimport { CursorOverlayPlugin } from '@platejs/selection/react';\n\nimport { CursorOverlay } from '@/components/ui/cursor-overlay';\n\nexport const CursorOverlayKit = [\n CursorOverlayPlugin.configure({\n render: {\n afterEditable: () => <CursorOverlay />,\n },\n }),\n];\n","import * as React from \"react\"\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from \"lucide-react\"\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/ui/button\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-md bg-accent\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n )\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n )\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n )\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n","'use client';\n\nimport { DatePlugin } from '@platejs/date/react';\n\nimport { DateElement } from '@/components/ui/date-node';\n\nexport const DateKit = [DatePlugin.withComponent(DateElement)];\n","'use client';\n\nimport type { TDateElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { PlateElement, useReadOnly } from 'platejs/react';\n\nimport { Calendar } from '@/components/ui/calendar';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport function DateElement(props: PlateElementProps<TDateElement>) {\n const { editor, element } = props;\n\n const readOnly = useReadOnly();\n\n const trigger = (\n <span\n className={cn(\n 'w-fit cursor-pointer rounded-sm bg-muted px-1 text-muted-foreground'\n )}\n contentEditable={false}\n draggable\n >\n {element.date ? (\n (() => {\n const today = new Date();\n const elementDate = new Date(element.date);\n const isToday =\n elementDate.getDate() === today.getDate() &&\n elementDate.getMonth() === today.getMonth() &&\n elementDate.getFullYear() === today.getFullYear();\n\n const isYesterday =\n new Date(today.setDate(today.getDate() - 1)).toDateString() ===\n elementDate.toDateString();\n const isTomorrow =\n new Date(today.setDate(today.getDate() + 2)).toDateString() ===\n elementDate.toDateString();\n\n if (isToday) return 'Today';\n if (isYesterday) return 'Yesterday';\n if (isTomorrow) return 'Tomorrow';\n\n return elementDate.toLocaleDateString(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n })()\n ) : (\n <span>Pick a date</span>\n )}\n </span>\n );\n\n if (readOnly) {\n return trigger;\n }\n\n return (\n <PlateElement\n {...props}\n className=\"inline-block\"\n attributes={{\n ...props.attributes,\n contentEditable: false,\n }}\n >\n <Popover>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n selected={new Date(element.date as string)}\n onSelect={(date) => {\n if (!date) return;\n\n editor.tf.setNodes(\n { date: date.toDateString() },\n { at: element }\n );\n }}\n mode=\"single\"\n initialFocus\n />\n </PopoverContent>\n </Popover>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { DndPlugin, useDraggable, useDropLine } from '@platejs/dnd';\nimport { expandListItemsWithChildren } from '@platejs/list';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { GripVertical } from 'lucide-react';\nimport { type TElement, getPluginByType, isType, KEYS } from 'platejs';\nimport {\n type PlateEditor,\n type PlateElementProps,\n type RenderNodeWrapper,\n MemoizedChildren,\n useEditorRef,\n useElement,\n usePluginOption,\n} from 'platejs/react';\nimport { useSelected } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nconst UNDRAGGABLE_KEYS = [KEYS.column, KEYS.tr, KEYS.td];\n\nexport const BlockDraggable: RenderNodeWrapper = (props) => {\n const { editor, element, path } = props;\n\n const enabled = React.useMemo(() => {\n if (editor.dom.readOnly) return false;\n\n if (path.length === 1 && !isType(editor, element, UNDRAGGABLE_KEYS)) {\n return true;\n }\n if (path.length === 3 && !isType(editor, element, UNDRAGGABLE_KEYS)) {\n const block = editor.api.some({\n at: path,\n match: {\n type: editor.getType(KEYS.column),\n },\n });\n\n if (block) {\n return true;\n }\n }\n if (path.length === 4 && !isType(editor, element, UNDRAGGABLE_KEYS)) {\n const block = editor.api.some({\n at: path,\n match: {\n type: editor.getType(KEYS.table),\n },\n });\n\n if (block) {\n return true;\n }\n }\n\n return false;\n }, [editor, element, path]);\n\n if (!enabled) return;\n\n return (props) => <Draggable {...props} />;\n};\n\nfunction Draggable(props: PlateElementProps) {\n const { children, editor, element, path } = props;\n const blockSelectionApi = editor.getApi(BlockSelectionPlugin).blockSelection;\n\n const { isAboutToDrag, isDragging, nodeRef, previewRef, handleRef } =\n useDraggable({\n element,\n onDropHandler: (_, { dragItem }) => {\n const id = (dragItem as { id: string[] | string }).id;\n\n if (blockSelectionApi) {\n blockSelectionApi.add(id);\n }\n resetPreview();\n },\n });\n\n const isInColumn = path.length === 3;\n const isInTable = path.length === 4;\n\n const [previewTop, setPreviewTop] = React.useState(0);\n\n const resetPreview = () => {\n if (previewRef.current) {\n previewRef.current.replaceChildren();\n previewRef.current?.classList.add('hidden');\n }\n };\n\n // clear up virtual multiple preview when drag end\n React.useEffect(() => {\n if (!isDragging) {\n resetPreview();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDragging]);\n\n React.useEffect(() => {\n if (isAboutToDrag) {\n previewRef.current?.classList.remove('opacity-0');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isAboutToDrag]);\n\n const [dragButtonTop, setDragButtonTop] = React.useState(0);\n\n return (\n <div\n className={cn(\n 'relative',\n isDragging && 'opacity-50',\n getPluginByType(editor, element.type)?.node.isContainer\n ? 'group/container'\n : 'group'\n )}\n onMouseEnter={() => {\n if (isDragging) return;\n setDragButtonTop(calcDragButtonTop(editor, element));\n }}\n >\n {!isInTable && (\n <Gutter>\n <div\n className={cn(\n 'slate-blockToolbarWrapper',\n 'flex h-[1.5em]',\n isInColumn && 'h-4'\n )}\n >\n <div\n className={cn(\n 'slate-blockToolbar relative w-4.5',\n 'pointer-events-auto mr-1 flex items-center',\n isInColumn && 'mr-1.5'\n )}\n >\n <Button\n ref={handleRef}\n variant=\"ghost\"\n className=\"-left-0 absolute h-6 w-full p-0\"\n style={{ top: `${dragButtonTop + 3}px` }}\n data-plate-prevent-deselect\n >\n <DragHandle\n isDragging={isDragging}\n previewRef={previewRef}\n resetPreview={resetPreview}\n setPreviewTop={setPreviewTop}\n />\n </Button>\n </div>\n </div>\n </Gutter>\n )}\n\n <div\n ref={previewRef}\n className={cn('-left-0 absolute hidden w-full')}\n style={{ top: `${-previewTop}px` }}\n contentEditable={false}\n />\n\n <div\n ref={nodeRef}\n className=\"slate-blockWrapper flow-root\"\n onContextMenu={(event) =>\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.addOnContextMenu({ element, event })\n }\n >\n <MemoizedChildren>{children}</MemoizedChildren>\n <DropLine />\n </div>\n </div>\n );\n}\n\nfunction Gutter({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n const editor = useEditorRef();\n const element = useElement();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n const selected = useSelected();\n\n return (\n <div\n {...props}\n className={cn(\n 'slate-gutterLeft',\n '-translate-x-full absolute top-0 z-50 flex h-full cursor-text hover:opacity-100 sm:opacity-0',\n getPluginByType(editor, element.type)?.node.isContainer\n ? 'group-hover/container:opacity-100'\n : 'group-hover:opacity-100',\n isSelectionAreaVisible && 'hidden',\n !selected && 'opacity-0',\n className\n )}\n contentEditable={false}\n >\n {children}\n </div>\n );\n}\n\nconst DragHandle = React.memo(function DragHandle({\n isDragging,\n previewRef,\n resetPreview,\n setPreviewTop,\n}: {\n isDragging: boolean;\n previewRef: React.RefObject<HTMLDivElement | null>;\n resetPreview: () => void;\n setPreviewTop: (top: number) => void;\n}) {\n const editor = useEditorRef();\n const element = useElement();\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <div\n className=\"flex size-full items-center justify-center\"\n onClick={(e) => {\n e.preventDefault();\n editor.getApi(BlockSelectionPlugin).blockSelection.focus();\n }}\n onMouseDown={(e) => {\n resetPreview();\n\n if ((e.button !== 0 && e.button !== 2) || e.shiftKey) return;\n\n const blockSelection = editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.getNodes({ sort: true });\n\n let selectionNodes =\n blockSelection.length > 0\n ? blockSelection\n : editor.api.blocks({ mode: 'highest' });\n\n // If current block is not in selection, use it as the starting point\n if (!selectionNodes.some(([node]) => node.id === element.id)) {\n selectionNodes = [[element, editor.api.findPath(element)!]];\n }\n\n // Process selection nodes to include list children\n const blocks = expandListItemsWithChildren(\n editor,\n selectionNodes\n ).map(([node]) => node);\n\n if (blockSelection.length === 0) {\n editor.tf.blur();\n editor.tf.collapse();\n }\n\n const elements = createDragPreviewElements(editor, blocks);\n previewRef.current?.append(...elements);\n previewRef.current?.classList.remove('hidden');\n previewRef.current?.classList.add('opacity-0');\n editor.setOption(DndPlugin, 'multiplePreviewRef', previewRef);\n\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.set(blocks.map((block) => block.id as string));\n }}\n onMouseEnter={() => {\n if (isDragging) return;\n\n const blockSelection = editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.getNodes({ sort: true });\n\n let selectedBlocks =\n blockSelection.length > 0\n ? blockSelection\n : editor.api.blocks({ mode: 'highest' });\n\n // If current block is not in selection, use it as the starting point\n if (!selectedBlocks.some(([node]) => node.id === element.id)) {\n selectedBlocks = [[element, editor.api.findPath(element)!]];\n }\n\n // Process selection to include list children\n const processedBlocks = expandListItemsWithChildren(\n editor,\n selectedBlocks\n );\n\n const ids = processedBlocks.map((block) => block[0].id as string);\n\n if (ids.length > 1 && ids.includes(element.id as string)) {\n const previewTop = calculatePreviewTop(editor, {\n blocks: processedBlocks.map((block) => block[0]),\n element,\n });\n setPreviewTop(previewTop);\n } else {\n setPreviewTop(0);\n }\n }}\n onMouseUp={() => {\n resetPreview();\n }}\n data-plate-prevent-deselect\n role=\"button\"\n >\n <GripVertical className=\"text-muted-foreground\" />\n </div>\n </TooltipTrigger>\n <TooltipContent>Drag to move</TooltipContent>\n </Tooltip>\n );\n});\n\nconst DropLine = React.memo(function DropLine({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n const { dropLine } = useDropLine();\n\n if (!dropLine) return null;\n\n return (\n <div\n {...props}\n className={cn(\n 'slate-dropLine',\n 'absolute inset-x-0 h-0.5 opacity-100 transition-opacity',\n 'bg-brand/50',\n dropLine === 'top' && '-top-px',\n dropLine === 'bottom' && '-bottom-px',\n className\n )}\n />\n );\n});\n\nconst createDragPreviewElements = (\n editor: PlateEditor,\n blocks: TElement[]\n): HTMLElement[] => {\n const elements: HTMLElement[] = [];\n const ids: string[] = [];\n\n /**\n * Remove data attributes from the element to avoid recognized as slate\n * elements incorrectly.\n */\n const removeDataAttributes = (element: HTMLElement) => {\n Array.from(element.attributes).forEach((attr) => {\n if (\n attr.name.startsWith('data-slate') ||\n attr.name.startsWith('data-block-id')\n ) {\n element.removeAttribute(attr.name);\n }\n });\n\n Array.from(element.children).forEach((child) => {\n removeDataAttributes(child as HTMLElement);\n });\n };\n\n const resolveElement = (node: TElement, index: number) => {\n const domNode = editor.api.toDOMNode(node)!;\n const newDomNode = domNode.cloneNode(true) as HTMLElement;\n\n // Apply visual compensation for horizontal scroll\n const applyScrollCompensation = (\n original: Element,\n cloned: HTMLElement\n ) => {\n const scrollLeft = original.scrollLeft;\n\n if (scrollLeft > 0) {\n // Create a wrapper to handle the scroll offset\n const scrollWrapper = document.createElement('div');\n scrollWrapper.style.overflow = 'hidden';\n scrollWrapper.style.width = `${original.clientWidth}px`;\n\n // Create inner container with the full content\n const innerContainer = document.createElement('div');\n innerContainer.style.transform = `translateX(-${scrollLeft}px)`;\n innerContainer.style.width = `${original.scrollWidth}px`;\n\n // Move all children to the inner container\n while (cloned.firstChild) {\n innerContainer.append(cloned.firstChild);\n }\n\n // Apply the original element's styles to maintain appearance\n const originalStyles = window.getComputedStyle(original);\n cloned.style.padding = '0';\n innerContainer.style.padding = originalStyles.padding;\n\n scrollWrapper.append(innerContainer);\n cloned.append(scrollWrapper);\n }\n };\n\n applyScrollCompensation(domNode, newDomNode);\n\n ids.push(node.id as string);\n const wrapper = document.createElement('div');\n wrapper.append(newDomNode);\n wrapper.style.display = 'flow-root';\n\n const lastDomNode = blocks[index - 1];\n\n if (lastDomNode) {\n const lastDomNodeRect = editor.api\n .toDOMNode(lastDomNode)!\n .parentElement!.getBoundingClientRect();\n\n const domNodeRect = domNode.parentElement!.getBoundingClientRect();\n\n const distance = domNodeRect.top - lastDomNodeRect.bottom;\n\n // Check if the two elements are adjacent (touching each other)\n if (distance > 15) {\n wrapper.style.marginTop = `${distance}px`;\n }\n }\n\n removeDataAttributes(newDomNode);\n elements.push(wrapper);\n };\n\n blocks.forEach((node, index) => {\n resolveElement(node, index);\n });\n\n editor.setOption(DndPlugin, 'draggingId', ids);\n\n return elements;\n};\n\nconst calculatePreviewTop = (\n editor: PlateEditor,\n {\n blocks,\n element,\n }: {\n blocks: TElement[];\n element: TElement;\n }\n): number => {\n const child = editor.api.toDOMNode(element)!;\n const editable = editor.api.toDOMNode(editor)!;\n const firstSelectedChild = blocks[0];\n\n const firstDomNode = editor.api.toDOMNode(firstSelectedChild)!;\n // Get editor's top padding\n const editorPaddingTop = Number(\n window.getComputedStyle(editable).paddingTop.replace('px', '')\n );\n\n // Calculate distance from first selected node to editor top\n const firstNodeToEditorDistance =\n firstDomNode.getBoundingClientRect().top -\n editable.getBoundingClientRect().top -\n editorPaddingTop;\n\n // Get margin top of first selected node\n const firstMarginTopString = window.getComputedStyle(firstDomNode).marginTop;\n const marginTop = Number(firstMarginTopString.replace('px', ''));\n\n // Calculate distance from current node to editor top\n const currentToEditorDistance =\n child.getBoundingClientRect().top -\n editable.getBoundingClientRect().top -\n editorPaddingTop;\n\n const currentMarginTopString = window.getComputedStyle(child).marginTop;\n const currentMarginTop = Number(currentMarginTopString.replace('px', ''));\n\n const previewElementsTopDistance =\n currentToEditorDistance -\n firstNodeToEditorDistance +\n marginTop -\n currentMarginTop;\n\n return previewElementsTopDistance;\n};\n\nconst calcDragButtonTop = (editor: PlateEditor, element: TElement): number => {\n const child = editor.api.toDOMNode(element)!;\n\n const currentMarginTopString = window.getComputedStyle(child).marginTop;\n const currentMarginTop = Number(currentMarginTopString.replace('px', ''));\n\n return currentMarginTop;\n};\n","'use client';\n\nimport { DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\n\nimport { DndPlugin } from '@platejs/dnd';\nimport { PlaceholderPlugin } from '@platejs/media/react';\n\nimport { BlockDraggable } from '@/components/ui/block-draggable';\n\nexport const DndKit = [\n DndPlugin.configure({\n options: {\n enableScroller: true,\n onDropFiles: ({ dragItem, editor, target }) => {\n editor\n .getTransforms(PlaceholderPlugin)\n .insert.media(dragItem.files, { at: target, nextBlock: false });\n },\n },\n render: {\n aboveNodes: BlockDraggable,\n aboveSlate: ({ children }) => (\n <DndProvider backend={HTML5Backend}>{children}</DndProvider>\n ),\n },\n }),\n];\n","'use client';\n\nimport { DocxPlugin } from '@platejs/docx';\nimport { JuicePlugin } from '@platejs/juice';\n\nexport const DocxKit = [DocxPlugin, JuicePlugin];\n","'use client';\n\nimport { ExitBreakPlugin } from 'platejs';\n\nexport const ExitBreakKit = [\n ExitBreakPlugin.configure({\n shortcuts: {\n insert: { keys: 'mod+enter' },\n insertBefore: { keys: 'mod+shift+enter' },\n },\n }),\n];\n","'use client';\n\nimport { cn } from '@/lib/utils';\n\nimport { Toolbar } from './toolbar';\n\nexport function FixedToolbar(props: React.ComponentProps<typeof Toolbar>) {\n return (\n <Toolbar\n {...props}\n className={cn(\n 'scrollbar-hide sticky top-0 left-0 z-50 w-full justify-between overflow-x-auto rounded-t-lg border-b border-b-border bg-background/95 p-1 backdrop-blur-sm supports-backdrop-blur:bg-background/60',\n props.className\n )}\n />\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { Alignment } from '@platejs/basic-styles';\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { TextAlignPlugin } from '@platejs/basic-styles/react';\nimport {\n AlignCenterIcon,\n AlignJustifyIcon,\n AlignLeftIcon,\n AlignRightIcon,\n} from 'lucide-react';\nimport { useEditorPlugin, useSelectionFragmentProp } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\n\nimport { ToolbarButton } from './toolbar';\n\nconst items = [\n {\n icon: AlignLeftIcon,\n value: 'left',\n },\n {\n icon: AlignCenterIcon,\n value: 'center',\n },\n {\n icon: AlignRightIcon,\n value: 'right',\n },\n {\n icon: AlignJustifyIcon,\n value: 'justify',\n },\n];\n\nexport function AlignToolbarButton(props: DropdownMenuProps) {\n const { editor, tf } = useEditorPlugin(TextAlignPlugin);\n const value =\n useSelectionFragmentProp({\n defaultValue: 'start',\n getProp: (node) => node.align,\n }) ?? 'left';\n\n const [open, setOpen] = React.useState(false);\n const IconValue =\n items.find((item) => item.value === value)?.icon ?? AlignLeftIcon;\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Align\" isDropdown>\n <IconValue />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent className=\"min-w-0\" align=\"start\">\n <DropdownMenuRadioGroup\n value={value}\n onValueChange={(value) => {\n tf.textAlign.setNodes(value as Alignment);\n editor.tf.focus();\n }}\n >\n {items.map(({ icon: Icon, value: itemValue }) => (\n <DropdownMenuRadioItem\n key={itemValue}\n className=\"pl-2 data-[state=checked]:bg-accent *:first:[span]:hidden\"\n value={itemValue}\n >\n <Icon />\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","'use client';\n/* eslint-disable react-hooks/refs -- Ref usage for color picker component refs */\n\nimport React from 'react';\n\nimport type {\n DropdownMenuItemProps,\n DropdownMenuProps,\n} from '@radix-ui/react-dropdown-menu';\n\nimport { useComposedRef } from '@udecode/cn';\nimport debounce from 'lodash/debounce.js';\nimport { EraserIcon, PlusIcon } from 'lucide-react';\nimport { useEditorRef, useEditorSelector } from 'platejs/react';\n\nimport { buttonVariants } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\nimport { ToolbarButton, ToolbarMenuGroup } from './toolbar';\n\nexport function FontColorToolbarButton({\n children,\n nodeType,\n tooltip,\n}: {\n nodeType: string;\n tooltip?: string;\n} & DropdownMenuProps) {\n const editor = useEditorRef();\n\n const selectionDefined = useEditorSelector(\n (editor) => !!editor.selection,\n []\n );\n\n const color = useEditorSelector(\n (editor) => editor.api.mark(nodeType) as string,\n [nodeType]\n );\n\n const [selectedColor, setSelectedColor] = React.useState<string>();\n const [open, setOpen] = React.useState(false);\n\n const onToggle = React.useCallback(\n (value = !open) => {\n setOpen(value);\n },\n [open, setOpen]\n );\n\n const updateColor = React.useCallback(\n (value: string) => {\n if (editor.selection) {\n setSelectedColor(value);\n\n editor.tf.select(editor.selection);\n editor.tf.focus();\n\n editor.tf.addMarks({ [nodeType]: value });\n }\n },\n [editor, nodeType]\n );\n\n const updateColorAndClose = React.useCallback(\n (value: string) => {\n updateColor(value);\n onToggle();\n },\n [onToggle, updateColor]\n );\n\n const clearColor = React.useCallback(() => {\n if (editor.selection) {\n editor.tf.select(editor.selection);\n editor.tf.focus();\n\n if (selectedColor) {\n editor.tf.removeMarks(nodeType);\n }\n\n onToggle();\n }\n }, [editor, selectedColor, onToggle, nodeType]);\n\n React.useEffect(() => {\n if (selectionDefined) {\n setSelectedColor(color);\n }\n }, [color, selectionDefined]);\n\n return (\n <DropdownMenu\n open={open}\n onOpenChange={(value) => {\n setOpen(value);\n }}\n modal={false}\n >\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip={tooltip}>\n {children}\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <ColorPicker\n color={selectedColor || color}\n clearColor={clearColor}\n colors={DEFAULT_COLORS}\n customColors={DEFAULT_CUSTOM_COLORS}\n updateColor={updateColorAndClose}\n updateCustomColor={updateColor}\n />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction PureColorPicker({\n className,\n clearColor,\n color,\n colors,\n customColors,\n updateColor,\n updateCustomColor,\n ...props\n}: React.ComponentProps<'div'> & {\n colors: TColor[];\n customColors: TColor[];\n clearColor: () => void;\n updateColor: (color: string) => void;\n updateCustomColor: (color: string) => void;\n color?: string;\n}) {\n return (\n <div className={cn('flex flex-col', className)} {...props}>\n <ToolbarMenuGroup label=\"Custom Colors\">\n <ColorCustom\n color={color}\n className=\"px-2\"\n colors={colors}\n customColors={customColors}\n updateColor={updateColor}\n updateCustomColor={updateCustomColor}\n />\n </ToolbarMenuGroup>\n <ToolbarMenuGroup label=\"Default Colors\">\n <ColorDropdownMenuItems\n color={color}\n className=\"px-2\"\n colors={colors}\n updateColor={updateColor}\n />\n </ToolbarMenuGroup>\n {color && (\n <ToolbarMenuGroup>\n <DropdownMenuItem className=\"p-2\" onClick={clearColor}>\n <EraserIcon />\n <span>Clear</span>\n </DropdownMenuItem>\n </ToolbarMenuGroup>\n )}\n </div>\n );\n}\n\nconst ColorPicker = React.memo(\n PureColorPicker,\n (prev, next) =>\n prev.color === next.color &&\n prev.colors === next.colors &&\n prev.customColors === next.customColors\n);\n\nfunction ColorCustom({\n className,\n color,\n colors,\n customColors,\n updateColor,\n updateCustomColor,\n ...props\n}: {\n colors: TColor[];\n customColors: TColor[];\n updateColor: (color: string) => void;\n updateCustomColor: (color: string) => void;\n color?: string;\n} & React.ComponentPropsWithoutRef<'div'>) {\n const [customColor, setCustomColor] = React.useState<string>();\n const [value, setValue] = React.useState<string>(color || '#000000');\n\n React.useEffect(() => {\n if (\n !color ||\n customColors.some((c) => c.value === color) ||\n colors.some((c) => c.value === color)\n ) {\n return;\n }\n\n setCustomColor(color);\n }, [color, colors, customColors]);\n\n const computedColors = React.useMemo(\n () =>\n customColor\n ? [\n ...customColors,\n {\n isBrightColor: false,\n name: '',\n value: customColor,\n },\n ]\n : customColors,\n [customColor, customColors]\n );\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const updateCustomColorDebounced = React.useCallback(\n debounce(updateCustomColor, 100),\n [updateCustomColor]\n );\n\n return (\n <div className={cn('relative flex flex-col gap-4', className)} {...props}>\n <ColorDropdownMenuItems\n color={color}\n colors={computedColors}\n updateColor={updateColor}\n >\n <ColorInput\n value={value}\n onChange={(e) => {\n setValue(e.target.value);\n updateCustomColorDebounced(e.target.value);\n }}\n >\n <DropdownMenuItem\n className={cn(\n buttonVariants({\n size: 'icon',\n variant: 'outline',\n }),\n 'absolute top-1 right-2 bottom-2 flex size-8 items-center justify-center rounded-full'\n )}\n onSelect={(e) => {\n e.preventDefault();\n }}\n >\n <span className=\"sr-only\">Custom</span>\n <PlusIcon />\n </DropdownMenuItem>\n </ColorInput>\n </ColorDropdownMenuItems>\n </div>\n );\n}\n\nfunction ColorInput({\n children,\n className,\n value = '#000000',\n ...props\n}: React.ComponentProps<'input'>) {\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n\n return (\n <div className=\"flex flex-col items-center\">\n {React.Children.map(children, (child) => {\n if (!child) return child;\n\n return React.cloneElement(\n child as React.ReactElement<{\n onClick: () => void;\n }>,\n {\n onClick: () => inputRef.current?.click(),\n }\n );\n })}\n <input\n {...props}\n ref={useComposedRef(props.ref, inputRef)}\n className={cn('size-0 overflow-hidden border-0 p-0', className)}\n value={value}\n type=\"color\"\n />\n </div>\n );\n}\n\ntype TColor = {\n isBrightColor: boolean;\n name: string;\n value: string;\n};\n\nfunction ColorDropdownMenuItem({\n className,\n isBrightColor,\n isSelected,\n name,\n updateColor,\n value,\n ...props\n}: {\n isBrightColor: boolean;\n isSelected: boolean;\n value: string;\n updateColor: (color: string) => void;\n name?: string;\n} & DropdownMenuItemProps) {\n const content = (\n <DropdownMenuItem\n className={cn(\n buttonVariants({\n size: 'icon',\n variant: 'outline',\n }),\n 'my-1 flex size-6 items-center justify-center rounded-full border border-muted border-solid p-0 transition-all hover:scale-125',\n !isBrightColor && 'border-transparent',\n isSelected && 'border-2 border-primary',\n className\n )}\n style={{ backgroundColor: value }}\n onSelect={(e) => {\n e.preventDefault();\n updateColor(value);\n }}\n {...props}\n />\n );\n\n return name ? (\n <Tooltip>\n <TooltipTrigger>{content}</TooltipTrigger>\n <TooltipContent className=\"mb-1 capitalize\">{name}</TooltipContent>\n </Tooltip>\n ) : (\n content\n );\n}\n\nexport function ColorDropdownMenuItems({\n className,\n color,\n colors,\n updateColor,\n ...props\n}: {\n colors: TColor[];\n updateColor: (color: string) => void;\n color?: string;\n} & React.ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'grid grid-cols-[repeat(10,1fr)] place-items-center gap-x-1',\n className\n )}\n {...props}\n >\n <TooltipProvider>\n {colors.map(({ isBrightColor, name, value }) => (\n <ColorDropdownMenuItem\n name={name}\n key={name ?? value}\n value={value}\n isBrightColor={isBrightColor}\n isSelected={color === value}\n updateColor={updateColor}\n />\n ))}\n {props.children}\n </TooltipProvider>\n </div>\n );\n}\n\nexport const DEFAULT_COLORS = [\n {\n isBrightColor: false,\n name: 'black',\n value: '#000000',\n },\n {\n isBrightColor: false,\n name: 'dark grey 4',\n value: '#434343',\n },\n {\n isBrightColor: false,\n name: 'dark grey 3',\n value: '#666666',\n },\n {\n isBrightColor: false,\n name: 'dark grey 2',\n value: '#999999',\n },\n {\n isBrightColor: false,\n name: 'dark grey 1',\n value: '#B7B7B7',\n },\n {\n isBrightColor: false,\n name: 'grey',\n value: '#CCCCCC',\n },\n {\n isBrightColor: false,\n name: 'light grey 1',\n value: '#D9D9D9',\n },\n {\n isBrightColor: true,\n name: 'light grey 2',\n value: '#EFEFEF',\n },\n {\n isBrightColor: true,\n name: 'light grey 3',\n value: '#F3F3F3',\n },\n {\n isBrightColor: true,\n name: 'white',\n value: '#FFFFFF',\n },\n {\n isBrightColor: false,\n name: 'red berry',\n value: '#980100',\n },\n {\n isBrightColor: false,\n name: 'red',\n value: '#FE0000',\n },\n {\n isBrightColor: false,\n name: 'orange',\n value: '#FE9900',\n },\n {\n isBrightColor: true,\n name: 'yellow',\n value: '#FEFF00',\n },\n {\n isBrightColor: false,\n name: 'green',\n value: '#00FF00',\n },\n {\n isBrightColor: false,\n name: 'cyan',\n value: '#00FFFF',\n },\n {\n isBrightColor: false,\n name: 'cornflower blue',\n value: '#4B85E8',\n },\n {\n isBrightColor: false,\n name: 'blue',\n value: '#1300FF',\n },\n {\n isBrightColor: false,\n name: 'purple',\n value: '#9900FF',\n },\n {\n isBrightColor: false,\n name: 'magenta',\n value: '#FF00FF',\n },\n\n {\n isBrightColor: false,\n name: 'light red berry 3',\n value: '#E6B8AF',\n },\n {\n isBrightColor: false,\n name: 'light red 3',\n value: '#F4CCCC',\n },\n {\n isBrightColor: true,\n name: 'light orange 3',\n value: '#FCE4CD',\n },\n {\n isBrightColor: true,\n name: 'light yellow 3',\n value: '#FFF2CC',\n },\n {\n isBrightColor: true,\n name: 'light green 3',\n value: '#D9EAD3',\n },\n {\n isBrightColor: false,\n name: 'light cyan 3',\n value: '#D0DFE3',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 3',\n value: '#C9DAF8',\n },\n {\n isBrightColor: true,\n name: 'light blue 3',\n value: '#CFE1F3',\n },\n {\n isBrightColor: true,\n name: 'light purple 3',\n value: '#D9D2E9',\n },\n {\n isBrightColor: true,\n name: 'light magenta 3',\n value: '#EAD1DB',\n },\n\n {\n isBrightColor: false,\n name: 'light red berry 2',\n value: '#DC7E6B',\n },\n {\n isBrightColor: false,\n name: 'light red 2',\n value: '#EA9999',\n },\n {\n isBrightColor: false,\n name: 'light orange 2',\n value: '#F9CB9C',\n },\n {\n isBrightColor: true,\n name: 'light yellow 2',\n value: '#FFE598',\n },\n {\n isBrightColor: false,\n name: 'light green 2',\n value: '#B7D6A8',\n },\n {\n isBrightColor: false,\n name: 'light cyan 2',\n value: '#A1C4C9',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 2',\n value: '#A4C2F4',\n },\n {\n isBrightColor: false,\n name: 'light blue 2',\n value: '#9FC5E8',\n },\n {\n isBrightColor: false,\n name: 'light purple 2',\n value: '#B5A7D5',\n },\n {\n isBrightColor: false,\n name: 'light magenta 2',\n value: '#D5A6BD',\n },\n\n {\n isBrightColor: false,\n name: 'light red berry 1',\n value: '#CC4125',\n },\n {\n isBrightColor: false,\n name: 'light red 1',\n value: '#E06666',\n },\n {\n isBrightColor: false,\n name: 'light orange 1',\n value: '#F6B26B',\n },\n {\n isBrightColor: false,\n name: 'light yellow 1',\n value: '#FFD966',\n },\n {\n isBrightColor: false,\n name: 'light green 1',\n value: '#93C47D',\n },\n {\n isBrightColor: false,\n name: 'light cyan 1',\n value: '#76A5AE',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 1',\n value: '#6C9EEB',\n },\n {\n isBrightColor: false,\n name: 'light blue 1',\n value: '#6FA8DC',\n },\n {\n isBrightColor: false,\n name: 'light purple 1',\n value: '#8D7CC3',\n },\n {\n isBrightColor: false,\n name: 'light magenta 1',\n value: '#C27BA0',\n },\n\n {\n isBrightColor: false,\n name: 'dark red berry 1',\n value: '#A61B00',\n },\n {\n isBrightColor: false,\n name: 'dark red 1',\n value: '#CC0000',\n },\n {\n isBrightColor: false,\n name: 'dark orange 1',\n value: '#E59138',\n },\n {\n isBrightColor: false,\n name: 'dark yellow 1',\n value: '#F1C231',\n },\n {\n isBrightColor: false,\n name: 'dark green 1',\n value: '#6AA74F',\n },\n {\n isBrightColor: false,\n name: 'dark cyan 1',\n value: '#45818E',\n },\n {\n isBrightColor: false,\n name: 'dark cornflower blue 1',\n value: '#3B78D8',\n },\n {\n isBrightColor: false,\n name: 'dark blue 1',\n value: '#3E84C6',\n },\n {\n isBrightColor: false,\n name: 'dark purple 1',\n value: '#664EA6',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 1',\n value: '#A64D78',\n },\n\n {\n isBrightColor: false,\n name: 'dark red berry 2',\n value: '#84200D',\n },\n {\n isBrightColor: false,\n name: 'dark red 2',\n value: '#990001',\n },\n {\n isBrightColor: false,\n name: 'dark orange 2',\n value: '#B45F05',\n },\n {\n isBrightColor: false,\n name: 'dark yellow 2',\n value: '#BF9002',\n },\n {\n isBrightColor: false,\n name: 'dark green 2',\n value: '#38761D',\n },\n {\n isBrightColor: false,\n name: 'dark cyan 2',\n value: '#124F5C',\n },\n {\n isBrightColor: false,\n name: 'dark cornflower blue 2',\n value: '#1155CB',\n },\n {\n isBrightColor: false,\n name: 'dark blue 2',\n value: '#0C5394',\n },\n {\n isBrightColor: false,\n name: 'dark purple 2',\n value: '#351C75',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 2',\n value: '#741B47',\n },\n\n {\n isBrightColor: false,\n name: 'dark red berry 3',\n value: '#5B0F00',\n },\n {\n isBrightColor: false,\n name: 'dark red 3',\n value: '#660000',\n },\n {\n isBrightColor: false,\n name: 'dark orange 3',\n value: '#783F04',\n },\n {\n isBrightColor: false,\n name: 'dark yellow 3',\n value: '#7E6000',\n },\n {\n isBrightColor: false,\n name: 'dark green 3',\n value: '#274E12',\n },\n {\n isBrightColor: false,\n name: 'dark cyan 3',\n value: '#0D343D',\n },\n {\n isBrightColor: false,\n name: 'dark cornflower blue 3',\n value: '#1B4487',\n },\n {\n isBrightColor: false,\n name: 'dark blue 3',\n value: '#083763',\n },\n {\n isBrightColor: false,\n name: 'dark purple 3',\n value: '#1F124D',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 3',\n value: '#4C1130',\n },\n];\n\nconst DEFAULT_CUSTOM_COLORS = [\n {\n isBrightColor: false,\n name: 'dark orange 3',\n value: '#783F04',\n },\n {\n isBrightColor: false,\n name: 'dark grey 3',\n value: '#666666',\n },\n {\n isBrightColor: false,\n name: 'dark grey 2',\n value: '#999999',\n },\n {\n isBrightColor: false,\n name: 'light cornflower blue 1',\n value: '#6C9EEB',\n },\n {\n isBrightColor: false,\n name: 'dark magenta 3',\n value: '#4C1130',\n },\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport { Redo2Icon, Undo2Icon } from 'lucide-react';\nimport { useEditorRef, useEditorSelector } from 'platejs/react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function RedoToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const editor = useEditorRef();\n const disabled = useEditorSelector(\n (editor) => editor.history.redos.length === 0,\n []\n );\n\n return (\n <ToolbarButton\n {...props}\n disabled={disabled}\n onClick={() => editor.redo()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Redo\"\n >\n <Redo2Icon />\n </ToolbarButton>\n );\n}\n\nexport function UndoToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const editor = useEditorRef();\n const disabled = useEditorSelector(\n (editor) => editor.history.undos.length === 0,\n []\n );\n\n return (\n <ToolbarButton\n {...props}\n disabled={disabled}\n onClick={() => editor.undo()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Undo\"\n >\n <Undo2Icon />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { useIndentButton, useOutdentButton } from '@platejs/indent/react';\nimport { IndentIcon, OutdentIcon } from 'lucide-react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function IndentToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const { props: buttonProps } = useIndentButton();\n\n return (\n <ToolbarButton {...props} {...buttonProps} tooltip=\"Indent\">\n <IndentIcon />\n </ToolbarButton>\n );\n}\n\nexport function OutdentToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const { props: buttonProps } = useOutdentButton();\n\n return (\n <ToolbarButton {...props} {...buttonProps} tooltip=\"Outdent\">\n <OutdentIcon />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport type { PlateEditor } from 'platejs/react';\n\nimport { insertCallout } from '@platejs/callout';\nimport { insertCodeBlock, toggleCodeBlock } from '@platejs/code-block';\nimport { insertDate } from '@platejs/date';\nimport { insertExcalidraw } from '@platejs/excalidraw';\nimport { insertColumnGroup, toggleColumnGroup } from '@platejs/layout';\nimport { triggerFloatingLink } from '@platejs/link/react';\nimport { insertEquation, insertInlineEquation } from '@platejs/math';\nimport {\n insertAudioPlaceholder,\n insertFilePlaceholder,\n insertMedia,\n insertVideoPlaceholder,\n} from '@platejs/media';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport { TablePlugin } from '@platejs/table/react';\nimport { insertToc } from '@platejs/toc';\nimport {\n type NodeEntry,\n type Path,\n type TElement,\n KEYS,\n PathApi,\n} from 'platejs';\n\nconst ACTION_THREE_COLUMNS = 'action_three_columns';\n\nconst insertList = (editor: PlateEditor, type: string) => {\n editor.tf.insertNodes(\n editor.api.create.block({\n indent: 1,\n listStyleType: type,\n }),\n { select: true }\n );\n};\n\nconst insertBlockMap: Record<\n string,\n (editor: PlateEditor, type: string) => void\n> = {\n [KEYS.listTodo]: insertList,\n [KEYS.ol]: insertList,\n [KEYS.ul]: insertList,\n [ACTION_THREE_COLUMNS]: (editor) =>\n insertColumnGroup(editor, { columns: 3, select: true }),\n [KEYS.audio]: (editor) => insertAudioPlaceholder(editor, { select: true }),\n [KEYS.callout]: (editor) => insertCallout(editor, { select: true }),\n [KEYS.codeBlock]: (editor) => insertCodeBlock(editor, { select: true }),\n [KEYS.equation]: (editor) => insertEquation(editor, { select: true }),\n [KEYS.excalidraw]: (editor) => insertExcalidraw(editor, {}, { select: true }),\n [KEYS.file]: (editor) => insertFilePlaceholder(editor, { select: true }),\n [KEYS.img]: (editor) =>\n insertMedia(editor, {\n select: true,\n type: KEYS.img,\n }),\n [KEYS.mediaEmbed]: (editor) =>\n insertMedia(editor, {\n select: true,\n type: KEYS.mediaEmbed,\n }),\n [KEYS.table]: (editor) =>\n editor.getTransforms(TablePlugin).insert.table({}, { select: true }),\n [KEYS.toc]: (editor) => insertToc(editor, { select: true }),\n [KEYS.video]: (editor) => insertVideoPlaceholder(editor, { select: true }),\n};\n\nconst insertInlineMap: Record<\n string,\n (editor: PlateEditor, type: string) => void\n> = {\n [KEYS.date]: (editor) => insertDate(editor, { select: true }),\n [KEYS.inlineEquation]: (editor) =>\n insertInlineEquation(editor, '', { select: true }),\n [KEYS.link]: (editor) => triggerFloatingLink(editor, { focused: true }),\n};\n\ntype InsertBlockOptions = {\n upsert?: boolean;\n};\n\nexport const insertBlock = (\n editor: PlateEditor,\n type: string,\n options: InsertBlockOptions = {}\n) => {\n const { upsert = false } = options;\n\n editor.tf.withoutNormalizing(() => {\n const block = editor.api.block();\n\n if (!block) return;\n\n const [currentNode, path] = block;\n const isCurrentBlockEmpty = editor.api.isEmpty(currentNode);\n const currentBlockType = getBlockType(currentNode);\n\n const isSameBlockType = type === currentBlockType;\n\n if (upsert && isCurrentBlockEmpty && isSameBlockType) {\n return;\n }\n\n if (type in insertBlockMap) {\n insertBlockMap[type](editor, type);\n } else {\n editor.tf.insertNodes(editor.api.create.block({ type }), {\n at: PathApi.next(path),\n select: true,\n });\n }\n\n if (!isSameBlockType) {\n editor.getApi(SuggestionPlugin).suggestion.withoutSuggestions(() => {\n editor.tf.removeNodes({ previousEmptyBlock: true });\n });\n }\n });\n};\n\nexport const insertInlineElement = (editor: PlateEditor, type: string) => {\n if (insertInlineMap[type]) {\n insertInlineMap[type](editor, type);\n }\n};\n\nconst setList = (\n editor: PlateEditor,\n type: string,\n entry: NodeEntry<TElement>\n) => {\n editor.tf.setNodes(\n editor.api.create.block({\n indent: 1,\n listStyleType: type,\n }),\n {\n at: entry[1],\n }\n );\n};\n\nconst setBlockMap: Record<\n string,\n (editor: PlateEditor, type: string, entry: NodeEntry<TElement>) => void\n> = {\n [KEYS.listTodo]: setList,\n [KEYS.ol]: setList,\n [KEYS.ul]: setList,\n [ACTION_THREE_COLUMNS]: (editor) => toggleColumnGroup(editor, { columns: 3 }),\n [KEYS.codeBlock]: (editor) => toggleCodeBlock(editor),\n};\n\nexport const setBlockType = (\n editor: PlateEditor,\n type: string,\n { at }: { at?: Path } = {}\n) => {\n editor.tf.withoutNormalizing(() => {\n const setEntry = (entry: NodeEntry<TElement>) => {\n const [node, path] = entry;\n\n if (node[KEYS.listType]) {\n editor.tf.unsetNodes([KEYS.listType, 'indent'], { at: path });\n }\n if (type in setBlockMap) {\n return setBlockMap[type](editor, type, entry);\n }\n if (node.type !== type) {\n editor.tf.setNodes({ type }, { at: path });\n }\n };\n\n if (at) {\n const entry = editor.api.node<TElement>(at);\n\n if (entry) {\n setEntry(entry);\n\n return;\n }\n }\n\n const entries = editor.api.blocks({ mode: 'lowest' });\n\n entries.forEach((entry) => {\n setEntry(entry);\n });\n });\n};\n\nexport const getBlockType = (block: TElement) => {\n if (block[KEYS.listType]) {\n if (block[KEYS.listType] === KEYS.ol) {\n return KEYS.ol;\n }\n if (block[KEYS.listType] === KEYS.listTodo) {\n return KEYS.listTodo;\n }\n return KEYS.ul;\n }\n\n return block.type;\n};\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport {\n // CalendarIcon,\n // ChevronRightIcon,\n // Columns3Icon,\n // FileCodeIcon,\n // FilmIcon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n ImageIcon,\n Link2Icon,\n ListIcon,\n ListOrderedIcon,\n // MinusIcon,\n // PenToolIcon,\n PilcrowIcon,\n PlusIcon,\n // QuoteIcon,\n // RadicalIcon,\n // SquareIcon,\n TableIcon,\n // TableOfContentsIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { type PlateEditor, useEditorRef } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n insertBlock,\n insertInlineElement,\n} from '@/components/editor/transforms';\n\nimport { ToolbarButton, ToolbarMenuGroup } from './toolbar';\n\ntype Group = {\n group: string;\n items: Item[];\n};\n\ntype Item = {\n icon: React.ReactNode;\n value: string;\n onSelect: (editor: PlateEditor, value: string) => void;\n focusEditor?: boolean;\n label?: string;\n};\n\nconst groups: Group[] = [\n {\n group: 'Basic blocks',\n items: [\n {\n icon: <PilcrowIcon />,\n label: 'Paragraph',\n value: KEYS.p,\n },\n {\n icon: <Heading1Icon />,\n label: 'Heading 1',\n value: 'h1',\n },\n {\n icon: <Heading2Icon />,\n label: 'Heading 2',\n value: 'h2',\n },\n {\n icon: <Heading3Icon />,\n label: 'Heading 3',\n value: 'h3',\n },\n {\n icon: <TableIcon />,\n label: 'Table',\n value: KEYS.table,\n },\n // {\n // icon: <FileCodeIcon />,\n // label: 'Code',\n // value: KEYS.codeBlock,\n // },\n // {\n // icon: <QuoteIcon />,\n // label: 'Quote',\n // value: KEYS.blockquote,\n // },\n // {\n // icon: <MinusIcon />,\n // label: 'Divider',\n // value: KEYS.hr,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value);\n },\n })),\n },\n {\n group: 'Lists',\n items: [\n {\n icon: <ListIcon />,\n label: 'Bulleted list',\n value: KEYS.ul,\n },\n {\n icon: <ListOrderedIcon />,\n label: 'Numbered list',\n value: KEYS.ol,\n },\n // {\n // icon: <SquareIcon />,\n // label: 'To-do list',\n // value: KEYS.listTodo,\n // },\n // {\n // icon: <ChevronRightIcon />,\n // label: 'Toggle list',\n // value: KEYS.toggle,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value);\n },\n })),\n },\n {\n group: 'Media',\n items: [\n {\n icon: <ImageIcon />,\n label: 'Image',\n value: KEYS.img,\n },\n // {\n // icon: <FilmIcon />,\n // label: 'Embed',\n // value: KEYS.mediaEmbed,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value);\n },\n })),\n },\n // {\n // group: 'Advanced blocks',\n // items: [\n // {\n // icon: <TableOfContentsIcon />,\n // label: 'Table of contents',\n // value: KEYS.toc,\n // },\n // {\n // icon: <Columns3Icon />,\n // label: '3 columns',\n // value: 'action_three_columns',\n // },\n // {\n // focusEditor: false,\n // icon: <RadicalIcon />,\n // label: 'Equation',\n // value: KEYS.equation,\n // },\n // {\n // icon: <PenToolIcon />,\n // label: 'Excalidraw',\n // value: KEYS.excalidraw,\n // }\n // ].map((item) => ({\n // ...item,\n // onSelect: (editor, value) => {\n // insertBlock(editor, value);\n // },\n // })),\n // },\n {\n group: 'Inline',\n items: [\n {\n icon: <Link2Icon />,\n label: 'Link',\n value: KEYS.link,\n },\n // {\n // focusEditor: true,\n // icon: <CalendarIcon />,\n // label: 'Date',\n // value: KEYS.date,\n // },\n // {\n // focusEditor: false,\n // icon: <RadicalIcon />,\n // label: 'Inline Equation',\n // value: KEYS.inlineEquation,\n // },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertInlineElement(editor, value);\n },\n })),\n },\n];\n\nexport function InsertToolbarButton(props: DropdownMenuProps) {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Insert\" isDropdown>\n <PlusIcon />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"flex max-h-[500px] min-w-0 flex-col overflow-y-auto\"\n align=\"start\"\n >\n {groups.map(({ group, items: nestedItems }) => (\n <ToolbarMenuGroup key={group} label={group}>\n {nestedItems.map(({ icon, label, value, onSelect }) => (\n <DropdownMenuItem\n key={value}\n className=\"min-w-[180px]\"\n onSelect={() => {\n onSelect(editor, value);\n editor.tf.focus();\n }}\n >\n {icon}\n {label}\n </DropdownMenuItem>\n ))}\n </ToolbarMenuGroup>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n useLinkToolbarButton,\n useLinkToolbarButtonState,\n} from '@platejs/link/react';\nimport { Link } from 'lucide-react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function LinkToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const state = useLinkToolbarButtonState();\n const { props: buttonProps } = useLinkToolbarButton(state);\n\n return (\n <ToolbarButton {...props} {...buttonProps} data-plate-focus tooltip=\"Link\">\n <Link />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { ListStyleType, someList, toggleList } from '@platejs/list';\nimport {\n useIndentTodoToolBarButton,\n useIndentTodoToolBarButtonState,\n} from '@platejs/list/react';\nimport { List, ListOrdered, ListTodoIcon } from 'lucide-react';\nimport { useEditorRef, useEditorSelector } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\n\nimport {\n ToolbarButton,\n ToolbarSplitButton,\n ToolbarSplitButtonPrimary,\n ToolbarSplitButtonSecondary,\n} from './toolbar';\n\nexport function BulletedListToolbarButton() {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n const pressed = useEditorSelector(\n (editor) =>\n someList(editor, [\n ListStyleType.Disc,\n ListStyleType.Circle,\n ListStyleType.Square,\n ]),\n []\n );\n\n return (\n <ToolbarSplitButton pressed={open}>\n <ToolbarSplitButtonPrimary\n className=\"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\"\n onClick={() => {\n toggleList(editor, {\n listStyleType: ListStyleType.Disc,\n });\n }}\n data-state={pressed ? 'on' : 'off'}\n >\n <List className=\"size-4\" />\n </ToolbarSplitButtonPrimary>\n\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarSplitButtonSecondary />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\" alignOffset={-32}>\n <DropdownMenuGroup>\n <DropdownMenuItem\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Disc,\n })\n }\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"size-2 rounded-full border border-current bg-current\" />\n Default\n </div>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Circle,\n })\n }\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"size-2 rounded-full border border-current\" />\n Circle\n </div>\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Square,\n })\n }\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"size-2 border border-current bg-current\" />\n Square\n </div>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </ToolbarSplitButton>\n );\n}\n\nexport function NumberedListToolbarButton() {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n const pressed = useEditorSelector(\n (editor) =>\n someList(editor, [\n ListStyleType.Decimal,\n ListStyleType.LowerAlpha,\n ListStyleType.UpperAlpha,\n ListStyleType.LowerRoman,\n ListStyleType.UpperRoman,\n ]),\n []\n );\n\n return (\n <ToolbarSplitButton pressed={open}>\n <ToolbarSplitButtonPrimary\n className=\"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\"\n onClick={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Decimal,\n })\n }\n data-state={pressed ? 'on' : 'off'}\n >\n <ListOrdered className=\"size-4\" />\n </ToolbarSplitButtonPrimary>\n\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarSplitButtonSecondary />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\" alignOffset={-32}>\n <DropdownMenuGroup>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.Decimal,\n })\n }\n >\n Decimal (1, 2, 3)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.LowerAlpha,\n })\n }\n >\n Lower Alpha (a, b, c)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: \"turkish-lower-alpha\",\n })\n }\n >\n Lower Alpha - Turkish (a, b, c, ç)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.UpperAlpha,\n })\n }\n >\n Upper Alpha (A, B, C)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: \"turkish-upper-alpha\",\n })\n }\n >\n Upper Alpha - Turkish (A, B, C, Ç)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.LowerRoman,\n })\n }\n >\n Lower Roman (i, ii, iii)\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() =>\n toggleList(editor, {\n listStyleType: ListStyleType.UpperRoman,\n })\n }\n >\n Upper Roman (I, II, III)\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </ToolbarSplitButton>\n );\n}\n\nexport function TodoListToolbarButton(\n props: React.ComponentProps<typeof ToolbarButton>\n) {\n const state = useIndentTodoToolBarButtonState({ nodeType: 'todo' });\n const { props: buttonProps } = useIndentTodoToolBarButton(state);\n\n return (\n <ToolbarButton {...props} {...buttonProps} tooltip=\"Todo\">\n <ListTodoIcon />\n </ToolbarButton>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { useMarkToolbarButton, useMarkToolbarButtonState } from 'platejs/react';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function MarkToolbarButton({\n clear,\n nodeType,\n ...props\n}: React.ComponentProps<typeof ToolbarButton> & {\n nodeType: string;\n clear?: string[] | string;\n}) {\n const state = useMarkToolbarButtonState({ clear, nodeType });\n const { props: buttonProps } = useMarkToolbarButton(state);\n\n return <ToolbarButton {...props} {...buttonProps} />;\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\n\nfunction AlertDialog({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return (\n <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n return (\n <AlertDialogPrimitive.Action\n className={cn(buttonVariants(), className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n return (\n <AlertDialogPrimitive.Cancel\n className={cn(buttonVariants({ variant: \"outline\" }), className)}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { PlaceholderPlugin } from '@platejs/media/react';\nimport {\n AudioLinesIcon,\n FileUpIcon,\n FilmIcon,\n ImageIcon,\n LinkIcon,\n} from 'lucide-react';\nimport { isUrl, KEYS } from 'platejs';\nimport { useEditorRef } from 'platejs/react';\nimport { toast } from 'sonner';\nimport { useFilePicker } from 'use-file-picker';\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@/components/ui/alert-dialog';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Input } from '@/components/ui/input';\n\nimport {\n ToolbarSplitButton,\n ToolbarSplitButtonPrimary,\n ToolbarSplitButtonSecondary,\n} from './toolbar';\n\nconst MEDIA_CONFIG: Record<\n string,\n {\n accept: string[];\n icon: React.ReactNode;\n title: string;\n tooltip: string;\n }\n> = {\n [KEYS.audio]: {\n accept: ['audio/*'],\n icon: <AudioLinesIcon className=\"size-4\" />,\n title: 'Insert Audio',\n tooltip: 'Audio',\n },\n [KEYS.file]: {\n accept: ['*'],\n icon: <FileUpIcon className=\"size-4\" />,\n title: 'Insert File',\n tooltip: 'File',\n },\n [KEYS.img]: {\n accept: ['image/*'],\n icon: <ImageIcon className=\"size-4\" />,\n title: 'Insert Image',\n tooltip: 'Image',\n },\n [KEYS.video]: {\n accept: ['video/*'],\n icon: <FilmIcon className=\"size-4\" />,\n title: 'Insert Video',\n tooltip: 'Video',\n },\n};\n\nexport function MediaToolbarButton({\n nodeType,\n ...props\n}: DropdownMenuProps & { nodeType: string }) {\n const currentConfig = MEDIA_CONFIG[nodeType];\n\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n const [dialogOpen, setDialogOpen] = React.useState(false);\n\n const { openFilePicker } = useFilePicker({\n accept: currentConfig.accept,\n multiple: true,\n onFilesSelected: ({ plainFiles: updatedFiles }) => {\n editor.getTransforms(PlaceholderPlugin).insert.media(updatedFiles);\n },\n });\n\n return (\n <>\n <ToolbarSplitButton\n onClick={() => {\n openFilePicker();\n }}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setOpen(true);\n }\n }}\n pressed={open}\n >\n <ToolbarSplitButtonPrimary>\n {currentConfig.icon}\n </ToolbarSplitButtonPrimary>\n\n <DropdownMenu\n open={open}\n onOpenChange={setOpen}\n modal={false}\n {...props}\n >\n <DropdownMenuTrigger asChild>\n <ToolbarSplitButtonSecondary />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n onClick={(e) => e.stopPropagation()}\n align=\"start\"\n alignOffset={-32}\n >\n <DropdownMenuGroup>\n <DropdownMenuItem onSelect={() => openFilePicker()}>\n {currentConfig.icon}\n Upload from computer\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={() => setDialogOpen(true)}>\n <LinkIcon />\n Insert via URL\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </ToolbarSplitButton>\n\n <AlertDialog\n open={dialogOpen}\n onOpenChange={(value) => {\n setDialogOpen(value);\n }}\n >\n <AlertDialogContent className=\"gap-6\">\n <MediaUrlDialogContent\n currentConfig={currentConfig}\n nodeType={nodeType}\n setOpen={setDialogOpen}\n />\n </AlertDialogContent>\n </AlertDialog>\n </>\n );\n}\n\nfunction MediaUrlDialogContent({\n currentConfig,\n nodeType,\n setOpen,\n}: {\n currentConfig: (typeof MEDIA_CONFIG)[string];\n nodeType: string;\n setOpen: (value: boolean) => void;\n}) {\n const editor = useEditorRef();\n const [url, setUrl] = React.useState('');\n\n const embedMedia = React.useCallback(() => {\n if (!isUrl(url)) return toast.error('Invalid URL');\n\n setOpen(false);\n editor.tf.insertNodes({\n children: [{ text: '' }],\n name: nodeType === KEYS.file ? url.split('/').pop() : undefined,\n type: nodeType,\n url,\n });\n }, [url, editor, nodeType, setOpen]);\n\n return (\n <>\n <AlertDialogHeader>\n <AlertDialogTitle>{currentConfig.title}</AlertDialogTitle>\n </AlertDialogHeader>\n\n <AlertDialogDescription className=\"group relative w-full\">\n <label\n className=\"-translate-y-1/2 absolute top-1/2 block cursor-text px-1 text-muted-foreground/70 text-sm transition-all group-focus-within:pointer-events-none group-focus-within:top-0 group-focus-within:cursor-default group-focus-within:font-medium group-focus-within:text-foreground group-focus-within:text-xs has-[+input:not(:placeholder-shown)]:pointer-events-none has-[+input:not(:placeholder-shown)]:top-0 has-[+input:not(:placeholder-shown)]:cursor-default has-[+input:not(:placeholder-shown)]:font-medium has-[+input:not(:placeholder-shown)]:text-foreground has-[+input:not(:placeholder-shown)]:text-xs\"\n htmlFor=\"url\"\n >\n <span className=\"inline-flex bg-background px-2\">URL</span>\n </label>\n <Input\n id=\"url\"\n className=\"w-full\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') embedMedia();\n }}\n placeholder=\"\"\n type=\"url\"\n autoFocus\n />\n </AlertDialogDescription>\n\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={(e) => {\n e.preventDefault();\n embedMedia();\n }}\n >\n Accept\n </AlertDialogAction>\n </AlertDialogFooter>\n </>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport {\n // KeyboardIcon,\n MoreHorizontalIcon,\n SubscriptIcon,\n SuperscriptIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorRef } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function MoreToolbarButton(props: DropdownMenuProps) {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Insert\">\n <MoreHorizontalIcon />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"ignore-click-outside/toolbar flex max-h-[500px] min-w-[180px] flex-col overflow-y-auto\"\n align=\"start\"\n >\n <DropdownMenuGroup>\n {/* <DropdownMenuItem\n onSelect={() => {\n editor.tf.toggleMark(KEYS.kbd);\n editor.tf.collapse({ edge: 'end' });\n editor.tf.focus();\n }}\n >\n <KeyboardIcon />\n Keyboard input\n </DropdownMenuItem> */}\n\n <DropdownMenuItem\n onSelect={() => {\n editor.tf.toggleMark(KEYS.sup, {\n remove: KEYS.sub,\n });\n editor.tf.focus();\n }}\n >\n <SuperscriptIcon />\n Superscript\n {/* (⌘+,) */}\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={() => {\n editor.tf.toggleMark(KEYS.sub, {\n remove: KEYS.sup,\n });\n editor.tf.focus();\n }}\n >\n <SubscriptIcon />\n Subscript\n {/* (⌘+.) */}\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport { TablePlugin, useTableMergeState } from '@platejs/table/react';\nimport {\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n Combine,\n Grid3x3Icon,\n Table,\n Trash2Icon,\n Ungroup,\n XIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorPlugin, useEditorSelector } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { cn } from '@/lib/utils';\n\nimport { ToolbarButton } from './toolbar';\n\nexport function TableToolbarButton(props: DropdownMenuProps) {\n const tableSelected = useEditorSelector(\n (editor) => editor.api.some({ match: { type: KEYS.table } }),\n []\n );\n\n const { editor, tf } = useEditorPlugin(TablePlugin);\n const [open, setOpen] = React.useState(false);\n const mergeState = useTableMergeState();\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton pressed={open} tooltip=\"Table\" isDropdown>\n <Table />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"flex w-[180px] min-w-0 flex-col\"\n align=\"start\"\n >\n <DropdownMenuGroup>\n <DropdownMenuSub>\n <DropdownMenuSubTrigger className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\">\n <Grid3x3Icon className=\"size-4\" />\n <span>Table</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"m-0 p-0\">\n <TablePicker />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuSub>\n <DropdownMenuSubTrigger\n className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!tableSelected}\n >\n <div className=\"size-4\" />\n <span>Cell</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!mergeState.canMerge}\n onSelect={() => {\n tf.table.merge();\n editor.tf.focus();\n }}\n >\n <Combine />\n Merge cells\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!mergeState.canSplit}\n onSelect={() => {\n tf.table.split();\n editor.tf.focus();\n }}\n >\n <Ungroup />\n Split cell\n </DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuSub>\n <DropdownMenuSubTrigger\n className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!tableSelected}\n >\n <div className=\"size-4\" />\n <span>Row</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableRow({ before: true });\n editor.tf.focus();\n }}\n >\n <ArrowUp />\n Insert row before\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableRow();\n editor.tf.focus();\n }}\n >\n <ArrowDown />\n Insert row after\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.remove.tableRow();\n editor.tf.focus();\n }}\n >\n <XIcon />\n Delete row\n </DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuSub>\n <DropdownMenuSubTrigger\n className=\"gap-2 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!tableSelected}\n >\n <div className=\"size-4\" />\n <span>Column</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableColumn({ before: true });\n editor.tf.focus();\n }}\n >\n <ArrowLeft />\n Insert column before\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.insert.tableColumn();\n editor.tf.focus();\n }}\n >\n <ArrowRight />\n Insert column after\n </DropdownMenuItem>\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.remove.tableColumn();\n editor.tf.focus();\n }}\n >\n <XIcon />\n Delete column\n </DropdownMenuItem>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n\n <DropdownMenuItem\n className=\"min-w-[180px]\"\n disabled={!tableSelected}\n onSelect={() => {\n tf.remove.table();\n editor.tf.focus();\n }}\n >\n <Trash2Icon />\n Delete table\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction TablePicker() {\n const { editor, tf } = useEditorPlugin(TablePlugin);\n\n const [tablePicker, setTablePicker] = React.useState({\n grid: Array.from({ length: 8 }, () => Array.from({ length: 8 }).fill(0)),\n size: { colCount: 0, rowCount: 0 },\n });\n\n const onCellMove = (rowIndex: number, colIndex: number) => {\n const newGrid = [...tablePicker.grid];\n\n for (let i = 0; i < newGrid.length; i++) {\n for (let j = 0; j < newGrid[i].length; j++) {\n newGrid[i][j] =\n i >= 0 && i <= rowIndex && j >= 0 && j <= colIndex ? 1 : 0;\n }\n }\n\n setTablePicker({\n grid: newGrid,\n size: { colCount: colIndex + 1, rowCount: rowIndex + 1 },\n });\n };\n\n return (\n <div\n className=\"flex! m-0 flex-col p-0\"\n onClick={() => {\n tf.insert.table(tablePicker.size, { select: true });\n editor.tf.focus();\n }}\n role=\"button\"\n >\n <div className=\"grid size-[130px] grid-cols-8 gap-0.5 p-1\">\n {tablePicker.grid.map((rows, rowIndex) =>\n rows.map((value, columIndex) => (\n <div\n key={`(${rowIndex},${columIndex})`}\n className={cn(\n 'col-span-1 size-3 border border-solid bg-secondary',\n !!value && 'border-current'\n )}\n onMouseMove={() => {\n onCellMove(rowIndex, columIndex);\n }}\n />\n ))\n )}\n </div>\n\n <div className=\"text-center text-current text-xs\">\n {tablePicker.size.rowCount} x {tablePicker.size.colCount}\n </div>\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\nimport type { TElement } from 'platejs';\n\nimport { DropdownMenuItemIndicator } from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n // ChevronRightIcon,\n // Columns3Icon,\n // FileCodeIcon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n Heading4Icon,\n Heading5Icon,\n Heading6Icon,\n ListIcon,\n ListOrderedIcon,\n PilcrowIcon,\n // QuoteIcon,\n // SquareIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorRef, useSelectionFragmentProp } from 'platejs/react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n getBlockType,\n setBlockType,\n} from '@/components/editor/transforms';\n\nimport { ToolbarButton, ToolbarMenuGroup } from './toolbar';\n\nexport const turnIntoItems = [\n {\n icon: <PilcrowIcon />,\n keywords: ['paragraph'],\n label: 'Text',\n value: KEYS.p,\n },\n {\n icon: <Heading1Icon />,\n keywords: ['title', 'h1'],\n label: 'Heading 1',\n value: 'h1',\n },\n {\n icon: <Heading2Icon />,\n keywords: ['subtitle', 'h2'],\n label: 'Heading 2',\n value: 'h2',\n },\n {\n icon: <Heading3Icon />,\n keywords: ['subtitle', 'h3'],\n label: 'Heading 3',\n value: 'h3',\n },\n {\n icon: <Heading4Icon />,\n keywords: ['subtitle', 'h4'],\n label: 'Heading 4',\n value: 'h4',\n },\n {\n icon: <Heading5Icon />,\n keywords: ['subtitle', 'h5'],\n label: 'Heading 5',\n value: 'h5',\n },\n {\n icon: <Heading6Icon />,\n keywords: ['subtitle', 'h6'],\n label: 'Heading 6',\n value: 'h6',\n },\n {\n icon: <ListIcon />,\n keywords: ['unordered', 'ul', '-'],\n label: 'Bulleted list',\n value: KEYS.ul,\n },\n {\n icon: <ListOrderedIcon />,\n keywords: ['ordered', 'ol', '1'],\n label: 'Numbered list',\n value: KEYS.ol,\n },\n // {\n // icon: <SquareIcon />,\n // keywords: ['checklist', 'task', 'checkbox', '[]'],\n // label: 'To-do list',\n // value: KEYS.listTodo,\n // },\n // {\n // icon: <ChevronRightIcon />,\n // keywords: ['collapsible', 'expandable'],\n // label: 'Toggle list',\n // value: KEYS.toggle,\n // },\n // {\n // icon: <FileCodeIcon />,\n // keywords: ['```'],\n // label: 'Code',\n // value: KEYS.codeBlock,\n // },\n // {\n // icon: <QuoteIcon />,\n // keywords: ['citation', 'blockquote', '>'],\n // label: 'Quote',\n // value: KEYS.blockquote,\n // },\n // {\n // icon: <Columns3Icon />,\n // label: '3 columns',\n // value: 'action_three_columns',\n // },\n];\n\nexport function TurnIntoToolbarButton(props: DropdownMenuProps) {\n const editor = useEditorRef();\n const [open, setOpen] = React.useState(false);\n\n const value = useSelectionFragmentProp({\n defaultValue: KEYS.p,\n getProp: (node) => getBlockType(node as TElement),\n });\n const selectedItem = React.useMemo(\n () =>\n turnIntoItems.find((item) => item.value === (value ?? KEYS.p)) ??\n turnIntoItems[0],\n [value]\n );\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton\n className=\"min-w-[125px]\"\n pressed={open}\n tooltip=\"Turn into\"\n isDropdown\n >\n {selectedItem.label}\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent\n className=\"ignore-click-outside/toolbar min-w-0\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n editor.tf.focus();\n }}\n align=\"start\"\n >\n <ToolbarMenuGroup\n value={value}\n onValueChange={(type) => {\n setBlockType(editor, type);\n }}\n label=\"Turn into\"\n >\n {turnIntoItems.map(({ icon, label, value: itemValue }) => (\n <DropdownMenuRadioItem\n key={itemValue}\n className=\"min-w-[180px] pl-2 *:first:[span]:hidden\"\n value={itemValue}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuItemIndicator>\n <CheckIcon />\n </DropdownMenuItemIndicator>\n </span>\n {icon}\n {label}\n </DropdownMenuRadioItem>\n ))}\n </ToolbarMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n // ArrowUpToLineIcon,\n BaselineIcon,\n BoldIcon,\n // Code2Icon,\n // HighlighterIcon,\n ItalicIcon,\n PaintBucketIcon,\n StrikethroughIcon,\n UnderlineIcon,\n // WandSparklesIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorReadOnly } from 'platejs/react';\n\n// import { AIToolbarButton } from './ai-toolbar-button';\nimport { AlignToolbarButton } from './align-toolbar-button';\n// import { CommentToolbarButton } from './comment-toolbar-button';\n// import { EmojiToolbarButton } from './emoji-toolbar-button';\n// import { ExportToolbarButton } from './export-toolbar-button';\nimport { FontColorToolbarButton } from './font-color-toolbar-button';\n// import { FontSizeToolbarButton } from './font-size-toolbar-button';\nimport { RedoToolbarButton, UndoToolbarButton } from './history-toolbar-button';\n// import { ImportToolbarButton } from './import-toolbar-button';\nimport {\n IndentToolbarButton,\n OutdentToolbarButton,\n} from './indent-toolbar-button';\nimport { InsertToolbarButton } from './insert-toolbar-button';\n// import { LineHeightToolbarButton } from './line-height-toolbar-button';\nimport { LinkToolbarButton } from './link-toolbar-button';\nimport {\n BulletedListToolbarButton,\n NumberedListToolbarButton,\n // TodoListToolbarButton,\n} from './list-toolbar-button';\nimport { MarkToolbarButton } from './mark-toolbar-button';\nimport { MediaToolbarButton } from './media-toolbar-button';\n// import { ModeToolbarButton } from './mode-toolbar-button';\nimport { MoreToolbarButton } from './more-toolbar-button';\nimport { TableToolbarButton } from './table-toolbar-button';\n// import { ToggleToolbarButton } from './toggle-toolbar-button';\nimport { ToolbarGroup } from './toolbar';\nimport { TurnIntoToolbarButton } from './turn-into-toolbar-button';\n\nexport function FixedToolbarButtons() {\n const readOnly = useEditorReadOnly();\n\n return (\n <div className=\"flex w-full\">\n {!readOnly && (\n <>\n <ToolbarGroup>\n <UndoToolbarButton />\n <RedoToolbarButton />\n </ToolbarGroup>\n\n {/* <ToolbarGroup>\n <AIToolbarButton tooltip=\"AI commands\">\n <WandSparklesIcon />\n </AIToolbarButton>\n </ToolbarGroup> */}\n\n {/* <ToolbarGroup>\n <ExportToolbarButton>\n <ArrowUpToLineIcon />\n </ExportToolbarButton>\n\n <ImportToolbarButton />\n </ToolbarGroup> */}\n\n <ToolbarGroup>\n <InsertToolbarButton />\n </ToolbarGroup>\n\n <ToolbarGroup>\n {/* <InsertToolbarButton /> */}\n <TurnIntoToolbarButton />\n {/* <FontSizeToolbarButton /> */}\n </ToolbarGroup>\n\n <ToolbarGroup>\n <MarkToolbarButton nodeType={KEYS.bold} tooltip=\"Bold (⌘+B)\">\n <BoldIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton nodeType={KEYS.italic} tooltip=\"Italic (⌘+I)\">\n <ItalicIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.underline}\n tooltip=\"Underline (⌘+U)\"\n >\n <UnderlineIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.strikethrough}\n tooltip=\"Strikethrough (⌘+⇧+M)\"\n >\n <StrikethroughIcon />\n </MarkToolbarButton>\n\n <LinkToolbarButton />\n\n {/* <MarkToolbarButton nodeType={KEYS.code} tooltip=\"Code (⌘+E)\">\n <Code2Icon />\n </MarkToolbarButton> */}\n\n {/* <FontColorToolbarButton nodeType={KEYS.color} tooltip=\"Text color\">\n <BaselineIcon />\n </FontColorToolbarButton>\n\n <FontColorToolbarButton\n nodeType={KEYS.backgroundColor}\n tooltip=\"Background color\"\n >\n <PaintBucketIcon />\n </FontColorToolbarButton> */}\n </ToolbarGroup>\n\n <ToolbarGroup>\n <FontColorToolbarButton nodeType={KEYS.color} tooltip=\"Text color\">\n <BaselineIcon />\n </FontColorToolbarButton>\n\n <FontColorToolbarButton\n nodeType={KEYS.backgroundColor}\n tooltip=\"Background color\"\n >\n <PaintBucketIcon />\n </FontColorToolbarButton>\n </ToolbarGroup>\n\n <ToolbarGroup>\n <AlignToolbarButton />\n\n <NumberedListToolbarButton />\n <BulletedListToolbarButton />\n {/* <TodoListToolbarButton /> */}\n {/* <ToggleToolbarButton /> */}\n <OutdentToolbarButton />\n <IndentToolbarButton />\n </ToolbarGroup>\n\n <ToolbarGroup>\n {/* <LinkToolbarButton /> */}\n <TableToolbarButton />\n {/* <EmojiToolbarButton /> */}\n <MediaToolbarButton nodeType={KEYS.img} />\n </ToolbarGroup>\n\n {/* <ToolbarGroup>\n <MediaToolbarButton nodeType={KEYS.img} />\n <MediaToolbarButton nodeType={KEYS.video} />\n <MediaToolbarButton nodeType={KEYS.audio} />\n <MediaToolbarButton nodeType={KEYS.file} />\n </ToolbarGroup> */}\n\n {/* <ToolbarGroup>\n <LineHeightToolbarButton />\n <OutdentToolbarButton />\n <IndentToolbarButton />\n </ToolbarGroup> */}\n\n <ToolbarGroup>\n <MoreToolbarButton />\n </ToolbarGroup>\n </>\n )}\n\n {/* <div className=\"grow\" />\n\n <ToolbarGroup>\n <MarkToolbarButton nodeType={KEYS.highlight} tooltip=\"Highlight\">\n <HighlighterIcon />\n </MarkToolbarButton>\n <CommentToolbarButton />\n </ToolbarGroup>\n\n <ToolbarGroup>\n <ModeToolbarButton />\n </ToolbarGroup> */}\n </div>\n );\n}\n","'use client';\n\nimport { createPlatePlugin } from 'platejs/react';\n\nimport { FixedToolbar } from '@/components/ui/fixed-toolbar';\nimport { FixedToolbarButtons } from '@/components/ui/fixed-toolbar-buttons';\n\nexport const FixedToolbarKit = [\n createPlatePlugin({\n key: 'fixed-toolbar',\n render: {\n beforeEditable: () => (\n <FixedToolbar>\n <FixedToolbarButtons />\n </FixedToolbar>\n ),\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n type FloatingToolbarState,\n flip,\n offset,\n useFloatingToolbar,\n useFloatingToolbarState,\n} from '@platejs/floating';\nimport { useComposedRef } from '@udecode/cn';\nimport { KEYS } from 'platejs';\nimport {\n useEditorId,\n useEventEditorValue,\n usePluginOption,\n} from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Toolbar } from './toolbar';\n\nexport function FloatingToolbar({\n children,\n className,\n state,\n ...props\n}: React.ComponentProps<typeof Toolbar> & {\n state?: FloatingToolbarState;\n}) {\n const editorId = useEditorId();\n const focusedEditorId = useEventEditorValue('focus');\n const isFloatingLinkOpen = !!usePluginOption({ key: KEYS.link }, 'mode');\n const isAIChatOpen = usePluginOption({ key: KEYS.aiChat }, 'open');\n\n const floatingToolbarState = useFloatingToolbarState({\n editorId,\n focusedEditorId,\n hideToolbar: isFloatingLinkOpen || isAIChatOpen,\n ...state,\n floatingOptions: {\n middleware: [\n offset(12),\n flip({\n fallbackPlacements: [\n 'top-start',\n 'top-end',\n 'bottom-start',\n 'bottom-end',\n ],\n padding: 12,\n }),\n ],\n placement: 'top',\n ...state?.floatingOptions,\n },\n });\n\n const {\n clickOutsideRef,\n hidden,\n props: rootProps,\n ref: floatingRef,\n } = useFloatingToolbar(floatingToolbarState);\n\n const ref = useComposedRef<HTMLDivElement>(props.ref, floatingRef);\n\n if (hidden) return null;\n\n return (\n <div ref={clickOutsideRef}>\n <Toolbar\n {...props}\n {...rootProps}\n ref={ref}\n className={cn(\n 'scrollbar-hide absolute z-50 overflow-x-auto whitespace-nowrap rounded-md border bg-popover p-1 opacity-100 shadow-md print:hidden',\n 'max-w-[80vw]',\n className\n )}\n >\n {children}\n </Toolbar>\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport {\n BoldIcon,\n // Code2Icon,\n ItalicIcon,\n StrikethroughIcon,\n UnderlineIcon,\n // WandSparklesIcon,\n} from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { useEditorReadOnly } from 'platejs/react';\n\n// import { AIToolbarButton } from './ai-toolbar-button';\n// import { CommentToolbarButton } from './comment-toolbar-button';\n// import { InlineEquationToolbarButton } from './equation-toolbar-button';\nimport { LinkToolbarButton } from './link-toolbar-button';\nimport { MarkToolbarButton } from './mark-toolbar-button';\nimport { MoreToolbarButton } from './more-toolbar-button';\n// import { SuggestionToolbarButton } from './suggestion-toolbar-button';\nimport { ToolbarGroup } from './toolbar';\nimport { TurnIntoToolbarButton } from './turn-into-toolbar-button';\n\nexport function FloatingToolbarButtons() {\n const readOnly = useEditorReadOnly();\n\n return (\n <>\n {!readOnly && (\n <>\n {/* <ToolbarGroup>\n <AIToolbarButton tooltip=\"AI commands\">\n <WandSparklesIcon />\n Ask AI\n </AIToolbarButton>\n </ToolbarGroup> */}\n\n <ToolbarGroup>\n <TurnIntoToolbarButton />\n\n <MarkToolbarButton nodeType={KEYS.bold} tooltip=\"Bold (⌘+B)\">\n <BoldIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton nodeType={KEYS.italic} tooltip=\"Italic (⌘+I)\">\n <ItalicIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.underline}\n tooltip=\"Underline (⌘+U)\"\n >\n <UnderlineIcon />\n </MarkToolbarButton>\n\n <MarkToolbarButton\n nodeType={KEYS.strikethrough}\n tooltip=\"Strikethrough (⌘+⇧+M)\"\n >\n <StrikethroughIcon />\n </MarkToolbarButton>\n\n {/* <MarkToolbarButton nodeType={KEYS.code} tooltip=\"Code (⌘+E)\">\n <Code2Icon />\n </MarkToolbarButton> */}\n\n {/* <InlineEquationToolbarButton /> */}\n\n <LinkToolbarButton />\n </ToolbarGroup>\n </>\n )}\n\n <ToolbarGroup>\n {/* <CommentToolbarButton /> */}\n {/* <SuggestionToolbarButton /> */}\n\n {!readOnly && <MoreToolbarButton />}\n </ToolbarGroup>\n </>\n );\n}\n","'use client';\n\nimport { createPlatePlugin } from 'platejs/react';\n\nimport { FloatingToolbar } from '@/components/ui/floating-toolbar';\nimport { FloatingToolbarButtons } from '@/components/ui/floating-toolbar-buttons';\n\nexport const FloatingToolbarKit = [\n createPlatePlugin({\n key: 'floating-toolbar',\n render: {\n afterEditable: () => (\n <FloatingToolbar>\n <FloatingToolbarButtons />\n </FloatingToolbar>\n ),\n },\n }),\n];\n","'use client';\n\nimport type { PlatePluginConfig } from 'platejs/react';\n\nimport {\n FontBackgroundColorPlugin,\n FontColorPlugin,\n FontFamilyPlugin,\n FontSizePlugin,\n} from '@platejs/basic-styles/react';\nimport { KEYS } from 'platejs';\n\nconst options = {\n inject: { targetPlugins: [KEYS.p] },\n} satisfies PlatePluginConfig;\n\nexport const FontKit = [\n FontColorPlugin.configure({\n inject: {\n ...options.inject,\n nodeProps: {\n defaultNodeValue: 'black',\n },\n },\n }),\n FontBackgroundColorPlugin.configure(options),\n FontSizePlugin.configure(options),\n FontFamilyPlugin.configure(options),\n];\n","'use client';\n\nimport { LineHeightPlugin } from '@platejs/basic-styles/react';\nimport { KEYS } from 'platejs';\n\nexport const LineHeightKit = [\n LineHeightPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 1.5,\n validNodeValues: [1, 1.2, 1.5, 2, 3],\n },\n targetPlugins: [...KEYS.heading, KEYS.p],\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TLinkElement } from 'platejs';\n\nimport {\n type UseVirtualFloatingOptions,\n flip,\n offset,\n} from '@platejs/floating';\nimport { getLinkAttributes } from '@platejs/link';\nimport {\n type LinkFloatingToolbarState,\n FloatingLinkUrlInput,\n useFloatingLinkEdit,\n useFloatingLinkEditState,\n useFloatingLinkInsert,\n useFloatingLinkInsertState,\n} from '@platejs/link/react';\nimport { cva } from 'class-variance-authority';\nimport { ExternalLink, Link, Text, Unlink } from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport {\n useEditorRef,\n useEditorSelection,\n useFormInputProps,\n usePluginOption,\n} from 'platejs/react';\n\nimport { buttonVariants } from '@/components/ui/button';\nimport { Separator } from '@/components/ui/separator';\n\nconst popoverVariants = cva(\n 'z-50 w-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-hidden'\n);\n\nconst inputVariants = cva(\n 'flex h-[28px] w-full rounded-md border-none bg-transparent px-1.5 py-1 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-transparent md:text-sm'\n);\n\nexport function LinkFloatingToolbar({\n state,\n}: {\n state?: LinkFloatingToolbarState;\n}) {\n const activeCommentId = usePluginOption({ key: KEYS.comment }, 'activeId');\n const activeSuggestionId = usePluginOption(\n { key: KEYS.suggestion },\n 'activeId'\n );\n\n const floatingOptions: UseVirtualFloatingOptions = React.useMemo(\n () => ({\n middleware: [\n offset(8),\n flip({\n fallbackPlacements: ['bottom-end', 'top-start', 'top-end'],\n padding: 12,\n }),\n ],\n placement:\n activeSuggestionId || activeCommentId ? 'top-start' : 'bottom-start',\n }),\n [activeCommentId, activeSuggestionId]\n );\n\n const insertState = useFloatingLinkInsertState({\n ...state,\n floatingOptions: {\n ...floatingOptions,\n ...state?.floatingOptions,\n },\n });\n const {\n hidden,\n props: insertProps,\n ref: insertRef,\n textInputProps,\n } = useFloatingLinkInsert(insertState);\n\n const editState = useFloatingLinkEditState({\n ...state,\n floatingOptions: {\n ...floatingOptions,\n ...state?.floatingOptions,\n },\n });\n const {\n editButtonProps,\n props: editProps,\n ref: editRef,\n unlinkButtonProps,\n } = useFloatingLinkEdit(editState);\n const inputProps = useFormInputProps({\n preventDefaultOnEnterKeydown: true,\n });\n\n if (hidden) return null;\n\n const input = (\n <div className=\"flex w-[330px] flex-col\" {...inputProps}>\n <div className=\"flex items-center\">\n <div className=\"flex items-center pr-1 pl-2 text-muted-foreground\">\n <Link className=\"size-4\" />\n </div>\n\n <FloatingLinkUrlInput\n className={inputVariants()}\n placeholder=\"Paste link\"\n data-plate-focus\n />\n </div>\n <Separator className=\"my-1\" />\n <div className=\"flex items-center\">\n <div className=\"flex items-center pr-1 pl-2 text-muted-foreground\">\n <Text className=\"size-4\" />\n </div>\n <input\n className={inputVariants()}\n placeholder=\"Text to display\"\n data-plate-focus\n {...textInputProps}\n />\n </div>\n </div>\n );\n\n const editContent = editState.isEditing ? (\n input\n ) : (\n <div className=\"box-content flex items-center\">\n <button\n className={buttonVariants({ size: 'sm', variant: 'ghost' })}\n type=\"button\"\n {...editButtonProps}\n >\n Edit link\n </button>\n\n <Separator orientation=\"vertical\" />\n\n <LinkOpenButton />\n\n <Separator orientation=\"vertical\" />\n\n <button\n className={buttonVariants({\n size: 'sm',\n variant: 'ghost',\n })}\n type=\"button\"\n {...unlinkButtonProps}\n >\n <Unlink width={18} />\n </button>\n </div>\n );\n\n return (\n <>\n <div ref={insertRef} className={popoverVariants()} {...insertProps}>\n {input}\n </div>\n\n <div ref={editRef} className={popoverVariants()} {...editProps}>\n {editContent}\n </div>\n </>\n );\n}\n\nfunction LinkOpenButton() {\n const editor = useEditorRef();\n const selection = useEditorSelection();\n\n const attributes = React.useMemo(\n () => {\n const entry = editor.api.node<TLinkElement>({\n match: { type: editor.getType(KEYS.link) },\n });\n if (!entry) {\n return {};\n }\n const [element] = entry;\n return getLinkAttributes(editor, element);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, selection]\n );\n\n return (\n <a\n {...attributes}\n className={buttonVariants({\n size: 'sm',\n variant: 'ghost',\n })}\n onMouseOver={(e) => {\n e.stopPropagation();\n }}\n aria-label=\"Open link in a new tab\"\n target=\"_blank\"\n >\n <ExternalLink width={18} />\n </a>\n );\n}\n","'use client';\n\nimport { LinkPlugin } from '@platejs/link/react';\n\nimport { LinkElement } from '@/components/ui/link-node';\nimport { LinkFloatingToolbar } from '@/components/ui/link-toolbar';\n\nexport const LinkKit = [\n LinkPlugin.configure({\n render: {\n node: LinkElement,\n afterEditable: () => <LinkFloatingToolbar />,\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TInlineSuggestionData, TLinkElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { getLinkAttributes } from '@platejs/link';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport { PlateElement } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nexport function LinkElement(props: PlateElementProps<TLinkElement>) {\n const suggestionData = props.editor\n .getApi(SuggestionPlugin)\n .suggestion.suggestionData(props.element) as\n | TInlineSuggestionData\n | undefined;\n\n return (\n <PlateElement\n {...props}\n as=\"a\"\n className={cn(\n 'font-medium text-primary underline decoration-primary underline-offset-4',\n suggestionData?.type === 'remove' && 'bg-red-100 text-red-700',\n suggestionData?.type === 'insert' && 'bg-emerald-100 text-emerald-700'\n )}\n attributes={{\n ...props.attributes,\n ...getLinkAttributes(props.editor, props.element),\n onMouseOver: (e) => {\n e.stopPropagation();\n },\n }}\n >\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { IndentPlugin } from '@platejs/indent/react';\nimport { KEYS } from 'platejs';\n\nexport const IndentKit = [\n IndentPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n KEYS.img,\n ],\n },\n options: {\n offset: 24,\n },\n }),\n];\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n","'use client';\n\nimport React from 'react';\n\nimport type { TListElement } from 'platejs';\n\nimport { isOrderedList } from '@platejs/list';\nimport {\n useTodoListElement,\n useTodoListElementState,\n} from '@platejs/list/react';\nimport {\n type PlateElementProps,\n type RenderNodeWrapper,\n useReadOnly,\n} from 'platejs/react';\n\nimport { Checkbox } from '@/components/ui/checkbox';\nimport { cn } from '@/lib/utils';\n\nconst config: Record<\n string,\n {\n Li: React.FC<PlateElementProps>;\n Marker: React.FC<PlateElementProps>;\n }\n> = {\n todo: {\n Li: TodoLi,\n Marker: TodoMarker,\n },\n};\n\nexport const BlockList: RenderNodeWrapper = (props) => {\n if (!props.element.listStyleType) return;\n\n return (props) => <List {...props} />;\n};\n\nfunction List(props: PlateElementProps) {\n const { listStart, listStyleType } = props.element as TListElement;\n const { Li, Marker } = config[listStyleType] ?? {};\n const List = isOrderedList(props.element) ? 'ol' : 'ul';\n\n return (\n <List\n className=\"relative m-0 p-0\"\n style={{ listStyleType }}\n start={listStart}\n >\n {Marker && <Marker {...props} />}\n {Li ? <Li {...props} /> : <li>{props.children}</li>}\n </List>\n );\n}\n\nfunction TodoMarker(props: PlateElementProps) {\n const state = useTodoListElementState({ element: props.element });\n const { checkboxProps } = useTodoListElement(state);\n const readOnly = useReadOnly();\n\n return (\n <div contentEditable={false}>\n <Checkbox\n className={cn(\n '-left-6 absolute top-1',\n readOnly && 'pointer-events-none'\n )}\n {...checkboxProps}\n />\n </div>\n );\n}\n\nfunction TodoLi(props: PlateElementProps) {\n return (\n <li\n className={cn(\n 'list-none',\n (props.element.checked as boolean) &&\n 'text-muted-foreground line-through'\n )}\n >\n {props.children}\n </li>\n );\n}\n","'use client';\n\nimport { ListPlugin } from '@platejs/list/react';\nimport { KEYS } from 'platejs';\n\nimport { IndentKit } from '@/components/editor/plugins/indent-kit';\nimport { BlockList } from '@/components/ui/block-list';\n\nexport const ListKit = [\n ...IndentKit,\n ListPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n KEYS.img,\n ],\n },\n render: {\n belowNodes: BlockList,\n },\n }),\n];\n","import { MarkdownPlugin, remarkMdx, remarkMention } from '@platejs/markdown';\nimport { KEYS } from 'platejs';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\n\nexport const MarkdownKit: any[] = [\n MarkdownPlugin.configure({\n options: {\n plainMarks: [KEYS.suggestion, KEYS.comment],\n remarkPlugins: [remarkMath, remarkGfm, remarkMdx, remarkMention],\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from 'react-textarea-autosize';\n\nimport type { TEquationElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useEquationElement, useEquationInput } from '@platejs/math/react';\nimport { BlockSelectionPlugin } from '@platejs/selection/react';\nimport { CornerDownLeftIcon, RadicalIcon } from 'lucide-react';\nimport {\n createPrimitiveComponent,\n PlateElement,\n useEditorRef,\n useEditorSelector,\n useElement,\n useReadOnly,\n useSelected,\n} from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nexport function EquationElement(props: PlateElementProps<TEquationElement>) {\n const selected = useSelected();\n const [open, setOpen] = React.useState(selected);\n const katexRef = React.useRef<HTMLDivElement | null>(null);\n\n useEquationElement({\n element: props.element,\n katexRef,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <PlateElement className=\"my-1\" {...props}>\n <Popover open={open} onOpenChange={setOpen} modal={false}>\n <PopoverTrigger asChild>\n <div\n className={cn(\n 'group flex cursor-pointer select-none items-center justify-center rounded-sm hover:bg-primary/10 data-[selected=true]:bg-primary/10',\n props.element.texExpression.length === 0\n ? 'bg-muted p-3 pr-9'\n : 'px-2 py-1'\n )}\n data-selected={selected}\n contentEditable={false}\n role=\"button\"\n >\n {props.element.texExpression.length > 0 ? (\n <span ref={katexRef} />\n ) : (\n <div className=\"flex h-7 w-full items-center gap-2 whitespace-nowrap text-muted-foreground text-sm\">\n <RadicalIcon className=\"size-6 text-muted-foreground/80\" />\n <div>Add a Tex equation</div>\n </div>\n )}\n </div>\n </PopoverTrigger>\n\n <EquationPopoverContent\n open={open}\n placeholder={\n 'f(x) = \\\\begin{cases}\\n x^2, &\\\\quad x > 0 \\\\\\\\\\n 0, &\\\\quad x = 0 \\\\\\\\\\n -x^2, &\\\\quad x < 0\\n\\\\end{cases}'\n }\n isInline={false}\n setOpen={setOpen}\n />\n </Popover>\n\n {props.children}\n </PlateElement>\n );\n}\n\nexport function InlineEquationElement(\n props: PlateElementProps<TEquationElement>\n) {\n const element = props.element;\n const katexRef = React.useRef<HTMLDivElement | null>(null);\n const selected = useSelected();\n const isCollapsed = useEditorSelector(\n (editor) => editor.api.isCollapsed(),\n []\n );\n const [open, setOpen] = React.useState(selected && isCollapsed);\n\n React.useEffect(() => {\n if (selected && isCollapsed) {\n setOpen(true);\n }\n }, [selected, isCollapsed]);\n\n useEquationElement({\n element,\n katexRef,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <PlateElement\n {...props}\n className={cn(\n 'mx-1 inline-block select-none rounded-sm [&_.katex-display]:my-0!'\n )}\n >\n <Popover open={open} onOpenChange={setOpen} modal={false}>\n <PopoverTrigger asChild>\n <div\n className={cn(\n 'after:-top-0.5 after:-left-1 after:absolute after:inset-0 after:z-1 after:h-[calc(100%)+4px] after:w-[calc(100%+8px)] after:rounded-sm after:content-[\"\"]',\n 'h-6',\n ((element.texExpression.length > 0 && open) || selected) &&\n 'after:bg-brand/15',\n element.texExpression.length === 0 &&\n 'text-muted-foreground after:bg-neutral-500/10'\n )}\n contentEditable={false}\n >\n <span\n ref={katexRef}\n className={cn(\n element.texExpression.length === 0 && 'hidden',\n 'font-mono leading-none'\n )}\n />\n {element.texExpression.length === 0 && (\n <span>\n <RadicalIcon className=\"mr-1 inline-block h-[19px] w-4 py-[1.5px] align-text-bottom\" />\n New equation\n </span>\n )}\n </div>\n </PopoverTrigger>\n\n <EquationPopoverContent\n className=\"my-auto\"\n open={open}\n placeholder=\"E = mc^2\"\n setOpen={setOpen}\n isInline\n />\n </Popover>\n\n {props.children}\n </PlateElement>\n );\n}\n\nconst EquationInput = createPrimitiveComponent(TextareaAutosize)({\n propsHook: useEquationInput,\n});\n\nconst EquationPopoverContent = ({\n className,\n isInline,\n open,\n setOpen,\n ...props\n}: {\n isInline: boolean;\n open: boolean;\n setOpen: (open: boolean) => void;\n} & TextareaAutosizeProps) => {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n const element = useElement<TEquationElement>();\n\n React.useEffect(() => {\n if (isInline && open) {\n setOpen(true);\n }\n }, [isInline, open, setOpen]);\n\n if (readOnly) return null;\n\n const onClose = () => {\n setOpen(false);\n\n if (isInline) {\n editor.tf.select(element, { focus: true, next: true });\n } else {\n editor\n .getApi(BlockSelectionPlugin)\n .blockSelection.set(element.id as string);\n }\n };\n\n return (\n <PopoverContent\n className=\"flex gap-2\"\n onEscapeKeyDown={(e) => {\n e.preventDefault();\n }}\n contentEditable={false}\n >\n <EquationInput\n className={cn('max-h-[50vh] grow resize-none p-2 text-sm', className)}\n state={{ isInline, open, onClose }}\n autoFocus\n {...props}\n />\n\n <Button variant=\"secondary\" className=\"px-3\" onClick={onClose}>\n Done <CornerDownLeftIcon className=\"size-3.5\" />\n </Button>\n </PopoverContent>\n );\n};\n","'use client';\n\nimport { EquationPlugin, InlineEquationPlugin } from '@platejs/math/react';\n\nimport {\n EquationElement,\n InlineEquationElement,\n} from '@/components/ui/equation-node';\n\nexport const MathKit = [\n InlineEquationPlugin.withComponent(InlineEquationElement),\n EquationPlugin.withComponent(EquationElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport {\n Caption as CaptionPrimitive,\n CaptionTextarea as CaptionTextareaPrimitive,\n useCaptionButton,\n useCaptionButtonState,\n} from '@platejs/caption/react';\nimport { createPrimitiveComponent } from '@udecode/cn';\nimport { cva } from 'class-variance-authority';\n\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\nconst captionVariants = cva('max-w-full', {\n defaultVariants: {\n align: 'center',\n },\n variants: {\n align: {\n center: 'mx-auto',\n left: 'mr-auto',\n right: 'ml-auto',\n },\n },\n});\n\nexport function Caption({\n align,\n className,\n ...props\n}: React.ComponentProps<typeof CaptionPrimitive> &\n VariantProps<typeof captionVariants>) {\n return (\n <CaptionPrimitive\n {...props}\n className={cn(captionVariants({ align }), className)}\n />\n );\n}\n\nexport function CaptionTextarea(\n props: React.ComponentProps<typeof CaptionTextareaPrimitive>\n) {\n return (\n <CaptionTextareaPrimitive\n {...props}\n className={cn(\n 'mt-2 w-full resize-none border-none bg-inherit p-0 font-[inherit] text-inherit',\n 'focus:outline-none focus:[&::placeholder]:opacity-0',\n 'text-center print:placeholder:text-transparent',\n props.className\n )}\n />\n );\n}\n\nexport const CaptionButton: any = createPrimitiveComponent(Button)({\n propsHook: useCaptionButton,\n stateHook: useCaptionButtonState,\n});\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TAudioElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useMediaState } from '@platejs/media/react';\nimport { ResizableProvider } from '@platejs/resizable';\nimport { PlateElement, withHOC } from 'platejs/react';\n\nimport { Caption, CaptionTextarea } from './caption';\n\nexport const AudioElement = withHOC(\n ResizableProvider,\n function AudioElement(props: PlateElementProps<TAudioElement>) {\n const { align = 'center', readOnly, unsafeUrl } = useMediaState();\n\n return (\n <PlateElement {...props} className=\"mb-1\">\n <figure\n className=\"group relative cursor-default\"\n contentEditable={false}\n >\n <div className=\"h-16\">\n <audio className=\"size-full\" src={unsafeUrl} controls />\n </div>\n\n <Caption style={{ width: '100%' }} align={align}>\n <CaptionTextarea\n className=\"h-20\"\n readOnly={readOnly}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </figure>\n {props.children}\n </PlateElement>\n );\n }\n);\n","'use client';\n\nimport * as React from 'react';\n\nimport type { WithRequiredKey } from 'platejs';\n\nimport {\n FloatingMedia as FloatingMediaPrimitive,\n FloatingMediaStore,\n useFloatingMediaValue,\n useImagePreviewValue,\n} from '@platejs/media/react';\nimport { cva } from 'class-variance-authority';\nimport { Link, Trash2Icon } from 'lucide-react';\nimport {\n useEditorRef,\n useEditorSelector,\n useElement,\n useFocusedLast,\n useReadOnly,\n useRemoveNodeButton,\n useSelected,\n} from 'platejs/react';\n\nimport { Button, buttonVariants } from '@/components/ui/button';\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n} from '@/components/ui/popover';\nimport { Separator } from '@/components/ui/separator';\n\nimport { CaptionButton } from './caption';\n\nconst inputVariants = cva(\n 'flex h-[28px] w-full rounded-md border-none bg-transparent px-1.5 py-1 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-transparent md:text-sm'\n);\n\nexport function MediaToolbar({\n children,\n plugin,\n}: {\n children: React.ReactNode;\n plugin: WithRequiredKey;\n}) {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n const selected = useSelected();\n const isFocusedLast = useFocusedLast();\n const selectionCollapsed = useEditorSelector(\n (editor) => !editor.api.isExpanded(),\n []\n );\n const isImagePreviewOpen = useImagePreviewValue('isOpen', editor.id);\n const open =\n isFocusedLast &&\n !readOnly &&\n selected &&\n selectionCollapsed &&\n !isImagePreviewOpen;\n const isEditing = useFloatingMediaValue('isEditing');\n\n React.useEffect(() => {\n if (!open && isEditing) {\n FloatingMediaStore.set('isEditing', false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const element = useElement();\n const { props: buttonProps } = useRemoveNodeButton({ element });\n\n return (\n <Popover open={open} modal={false}>\n <PopoverAnchor>{children}</PopoverAnchor>\n\n <PopoverContent\n className=\"w-auto p-1\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n {isEditing ? (\n <div className=\"flex w-[330px] flex-col\">\n <div className=\"flex items-center\">\n <div className=\"flex items-center pr-1 pl-2 text-muted-foreground\">\n <Link className=\"size-4\" />\n </div>\n\n <FloatingMediaPrimitive.UrlInput\n className={inputVariants()}\n placeholder=\"Paste the embed link...\"\n options={{ plugin }}\n />\n </div>\n </div>\n ) : (\n <div className=\"box-content flex items-center\">\n <FloatingMediaPrimitive.EditButton\n className={buttonVariants({ size: 'sm', variant: 'ghost' })}\n >\n Edit link\n </FloatingMediaPrimitive.EditButton>\n\n <CaptionButton size=\"sm\" variant=\"ghost\">\n Caption\n </CaptionButton>\n\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n\n <Button size=\"sm\" variant=\"ghost\" {...buttonProps}>\n <Trash2Icon />\n </Button>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport {\n type ResizeHandle as ResizeHandlePrimitive,\n Resizable as ResizablePrimitive,\n useResizeHandle,\n useResizeHandleState,\n} from '@platejs/resizable';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nexport const mediaResizeHandleVariants = cva(\n cn(\n 'top-0 flex w-6 select-none flex-col justify-center',\n \"after:flex after:h-16 after:w-[3px] after:rounded-[6px] after:bg-ring after:opacity-0 after:content-['_'] group-hover:after:opacity-100\"\n ),\n {\n variants: {\n direction: {\n left: '-left-3 -ml-3 pl-3',\n right: '-right-3 -mr-3 items-end pr-3',\n },\n },\n }\n);\n\nconst resizeHandleVariants = cva('absolute z-40', {\n variants: {\n direction: {\n bottom: 'w-full cursor-row-resize',\n left: 'h-full cursor-col-resize',\n right: 'h-full cursor-col-resize',\n top: 'w-full cursor-row-resize',\n },\n },\n});\n\nexport function ResizeHandle({\n className,\n options,\n ...props\n}: React.ComponentProps<typeof ResizeHandlePrimitive> &\n VariantProps<typeof resizeHandleVariants>) {\n const state = useResizeHandleState(options ?? {});\n const resizeHandle = useResizeHandle(state);\n\n if (state.readOnly) return null;\n\n return (\n <div\n className={cn(\n resizeHandleVariants({ direction: options?.direction }),\n className\n )}\n data-resizing={state.isResizing}\n {...resizeHandle.props}\n {...props}\n />\n );\n}\n\nconst resizableVariants = cva('', {\n variants: {\n align: {\n center: 'mx-auto',\n left: 'mr-auto',\n right: 'ml-auto',\n },\n },\n});\n\nexport function Resizable({\n align,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive> &\n VariantProps<typeof resizableVariants>) {\n return (\n <ResizablePrimitive\n {...props}\n className={cn(resizableVariants({ align }), className)}\n />\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport LiteYouTubeEmbed from 'react-lite-youtube-embed';\nimport { Tweet } from 'react-tweet';\n\nimport type { TMediaEmbedElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { parseTwitterUrl, parseVideoUrl } from '@platejs/media';\nimport { MediaEmbedPlugin, useMediaState } from '@platejs/media/react';\nimport { ResizableProvider, useResizableValue } from '@platejs/resizable';\nimport { PlateElement, withHOC } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Caption, CaptionTextarea } from './caption';\nimport { MediaToolbar } from './media-toolbar';\nimport {\n mediaResizeHandleVariants,\n Resizable,\n ResizeHandle,\n} from './resize-handle';\n\nexport const MediaEmbedElement = withHOC(\n ResizableProvider,\n function MediaEmbedElement(props: PlateElementProps<TMediaEmbedElement>) {\n const {\n align = 'center',\n embed,\n focused,\n isTweet,\n isVideo,\n isYoutube,\n readOnly,\n selected,\n } = useMediaState({\n urlParsers: [parseTwitterUrl, parseVideoUrl],\n });\n const width = useResizableValue('width');\n const provider = embed?.provider;\n\n return (\n <MediaToolbar plugin={MediaEmbedPlugin}>\n <PlateElement className=\"py-2.5\" {...props}>\n <figure\n className=\"group relative m-0 w-full cursor-default\"\n contentEditable={false}\n >\n <Resizable\n align={align}\n options={{\n align,\n maxWidth: isTweet ? 550 : '100%',\n minWidth: isTweet ? 300 : 100,\n }}\n >\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'left' })}\n options={{ direction: 'left' }}\n />\n\n {isVideo ? (\n isYoutube ? (\n <LiteYouTubeEmbed\n id={embed!.id!}\n title=\"youtube\"\n wrapperClass={cn(\n 'rounded-sm',\n focused && selected && 'ring-2 ring-ring ring-offset-2',\n 'relative block cursor-pointer bg-black bg-center bg-cover [contain:content]',\n '[&.lyt-activated]:before:absolute [&.lyt-activated]:before:top-0 [&.lyt-activated]:before:h-[60px] [&.lyt-activated]:before:w-full [&.lyt-activated]:before:bg-top [&.lyt-activated]:before:bg-repeat-x [&.lyt-activated]:before:pb-[50px] [&.lyt-activated]:before:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&.lyt-activated]:before:bg-[url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==)]',\n 'after:block after:pb-[var(--aspect-ratio)] after:content-[\"\"]',\n '[&_>_iframe]:absolute [&_>_iframe]:top-0 [&_>_iframe]:left-0 [&_>_iframe]:size-full',\n '[&_>_.lty-playbtn]:z-1 [&_>_.lty-playbtn]:h-[46px] [&_>_.lty-playbtn]:w-[70px] [&_>_.lty-playbtn]:rounded-[14%] [&_>_.lty-playbtn]:bg-[#212121] [&_>_.lty-playbtn]:opacity-80 [&_>_.lty-playbtn]:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&:hover_>_.lty-playbtn]:bg-[red] [&:hover_>_.lty-playbtn]:opacity-100',\n '[&_>_.lty-playbtn]:before:border-[transparent_transparent_transparent_#fff] [&_>_.lty-playbtn]:before:border-y-[11px] [&_>_.lty-playbtn]:before:border-r-0 [&_>_.lty-playbtn]:before:border-l-[19px] [&_>_.lty-playbtn]:before:content-[\"\"]',\n '[&_>_.lty-playbtn]:absolute [&_>_.lty-playbtn]:top-1/2 [&_>_.lty-playbtn]:left-1/2 [&_>_.lty-playbtn]:[transform:translate3d(-50%,-50%,0)]',\n '[&_>_.lty-playbtn]:before:absolute [&_>_.lty-playbtn]:before:top-1/2 [&_>_.lty-playbtn]:before:left-1/2 [&_>_.lty-playbtn]:before:[transform:translate3d(-50%,-50%,0)]',\n '[&.lyt-activated]:cursor-[unset]',\n '[&.lyt-activated]:before:pointer-events-none [&.lyt-activated]:before:opacity-0',\n '[&.lyt-activated_>_.lty-playbtn]:pointer-events-none [&.lyt-activated_>_.lty-playbtn]:opacity-0!'\n )}\n />\n ) : (\n <div\n className={cn(\n provider === 'vimeo' && 'pb-[75%]',\n provider === 'youku' && 'pb-[56.25%]',\n provider === 'dailymotion' && 'pb-[56.0417%]',\n provider === 'coub' && 'pb-[51.25%]'\n )}\n >\n <iframe\n className={cn(\n 'absolute top-0 left-0 size-full rounded-sm',\n isVideo && 'border-0',\n focused && selected && 'ring-2 ring-ring ring-offset-2'\n )}\n title=\"embed\"\n src={embed!.url}\n allowFullScreen\n />\n </div>\n )\n ) : null}\n\n {isTweet && (\n <div\n className={cn(\n '[&_.react-tweet-theme]:my-0',\n !readOnly &&\n selected &&\n '[&_.react-tweet-theme]:ring-2 [&_.react-tweet-theme]:ring-ring [&_.react-tweet-theme]:ring-offset-2'\n )}\n >\n <Tweet id={embed!.id!} />\n </div>\n )}\n\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'right' })}\n options={{ direction: 'right' }}\n />\n </Resizable>\n\n <Caption style={{ width }} align={align}>\n <CaptionTextarea placeholder=\"Write a caption...\" />\n </Caption>\n </figure>\n\n {props.children}\n </PlateElement>\n </MediaToolbar>\n );\n }\n);\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TFileElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useMediaState } from '@platejs/media/react';\nimport { ResizableProvider } from '@platejs/resizable';\nimport { FileUp } from 'lucide-react';\nimport { PlateElement, useReadOnly, withHOC } from 'platejs/react';\n\nimport { Caption, CaptionTextarea } from './caption';\n\nexport const FileElement = withHOC(\n ResizableProvider,\n function FileElement(props: PlateElementProps<TFileElement>) {\n const readOnly = useReadOnly();\n const { name, unsafeUrl } = useMediaState();\n\n return (\n <PlateElement className=\"my-px rounded-sm\" {...props}>\n <a\n className=\"group relative m-0 flex cursor-pointer items-center rounded px-0.5 py-[3px] hover:bg-muted\"\n contentEditable={false}\n download={name}\n href={unsafeUrl}\n rel=\"noopener noreferrer\"\n role=\"button\"\n target=\"_blank\"\n >\n <div className=\"flex items-center gap-1 p-1\">\n <FileUp className=\"size-5\" />\n <div>{name}</div>\n </div>\n\n <Caption align=\"left\">\n <CaptionTextarea\n className=\"text-left\"\n readOnly={readOnly}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </a>\n {props.children}\n </PlateElement>\n );\n }\n);\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TImageElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useDraggable } from '@platejs/dnd';\nimport { Image, ImagePlugin, useMediaState } from '@platejs/media/react';\nimport { ResizableProvider, useResizableValue } from '@platejs/resizable';\nimport { PlateElement, withHOC } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Caption, CaptionTextarea } from './caption';\nimport { MediaToolbar } from './media-toolbar';\nimport {\n mediaResizeHandleVariants,\n Resizable,\n ResizeHandle,\n} from './resize-handle';\n\nexport const ImageElement = withHOC(\n ResizableProvider,\n function ImageElement(props: PlateElementProps<TImageElement>) {\n const { align = 'center', focused, readOnly, selected } = useMediaState();\n const width = useResizableValue('width');\n\n const { isDragging, handleRef } = useDraggable({\n element: props.element,\n });\n\n return (\n <MediaToolbar plugin={ImagePlugin}>\n <PlateElement {...props} className=\"py-2.5\">\n <figure className=\"group relative m-0\" contentEditable={false}>\n <Resizable\n align={align}\n options={{\n align,\n readOnly,\n }}\n >\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'left' })}\n options={{ direction: 'left' }}\n />\n <Image\n ref={handleRef}\n className={cn(\n 'block w-full max-w-full cursor-pointer object-cover px-0',\n 'rounded-sm',\n focused && selected && 'ring-2 ring-ring ring-offset-2',\n isDragging && 'opacity-50'\n )}\n alt={props.attributes.alt as string | undefined}\n />\n <ResizeHandle\n className={mediaResizeHandleVariants({\n direction: 'right',\n })}\n options={{ direction: 'right' }}\n />\n </Resizable>\n\n <Caption style={{ width }} align={align}>\n <CaptionTextarea\n readOnly={readOnly}\n onFocus={(e) => {\n e.preventDefault();\n }}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </figure>\n\n {props.children}\n </PlateElement>\n </MediaToolbar>\n );\n }\n);\n","import * as React from 'react';\n\nimport type { OurFileRouter } from '@/lib/uploadthing';\nimport type {\n ClientUploadedFileData,\n UploadFilesOptions,\n} from 'uploadthing/types';\n\nimport { generateReactHelpers } from '@uploadthing/react';\nimport { toast } from 'sonner';\nimport { z } from 'zod';\n\nexport type UploadedFile<T = unknown> = ClientUploadedFileData<T>;\n\ninterface UseUploadFileProps\n extends Pick<\n UploadFilesOptions<OurFileRouter['editorUploader']>,\n 'headers' | 'onUploadBegin' | 'onUploadProgress' | 'skipPolling'\n > {\n onUploadComplete?: (file: UploadedFile) => void;\n onUploadError?: (error: unknown) => void;\n}\n\nexport function useUploadFile({\n onUploadComplete,\n onUploadError,\n ...props\n}: UseUploadFileProps = {}) {\n const [uploadedFile, setUploadedFile] = React.useState<UploadedFile>();\n const [uploadingFile, setUploadingFile] = React.useState<File>();\n const [progress, setProgress] = React.useState<number>(0);\n const [isUploading, setIsUploading] = React.useState(false);\n\n async function uploadThing(file: File) {\n setIsUploading(true);\n setUploadingFile(file);\n\n try {\n const res = await uploadFiles('editorUploader', {\n ...props,\n files: [file],\n onUploadProgress: ({ progress }: { progress: number }) => {\n setProgress(Math.min(progress, 100));\n },\n });\n\n setUploadedFile(res[0]);\n\n onUploadComplete?.(res[0]);\n\n return uploadedFile;\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n\n const message =\n errorMessage.length > 0\n ? errorMessage\n : 'Something went wrong, please try again later.';\n\n toast.error(message);\n\n onUploadError?.(error);\n\n // Mock upload for unauthenticated users\n // toast.info('User not logged in. Mocking upload process.');\n const mockUploadedFile = {\n key: 'mock-key-0',\n appUrl: `https://mock-app-url.com/${file.name}`,\n name: file.name,\n size: file.size,\n type: file.type,\n url: URL.createObjectURL(file),\n } as UploadedFile;\n\n // Simulate upload progress\n let progress = 0;\n\n const simulateProgress = async () => {\n while (progress < 100) {\n await new Promise((resolve) => setTimeout(resolve, 50));\n progress += 2;\n setProgress(Math.min(progress, 100));\n }\n };\n\n await simulateProgress();\n\n setUploadedFile(mockUploadedFile);\n\n return mockUploadedFile;\n } finally {\n setProgress(0);\n setIsUploading(false);\n setUploadingFile(undefined);\n }\n }\n\n return {\n isUploading,\n progress,\n uploadedFile,\n uploadFile: uploadThing,\n uploadingFile,\n };\n}\n\nexport const { uploadFiles, useUploadThing }: any =\n generateReactHelpers<OurFileRouter>();\n\nexport function getErrorMessage(err: unknown) {\n const unknownError = 'Something went wrong, please try again later.';\n\n if (err instanceof z.ZodError) {\n const errors = err.issues.map((issue) => issue.message);\n\n return errors.join('\\n');\n }\n if (err instanceof Error) {\n return err.message;\n }\n return unknownError;\n}\n\nexport function showErrorToast(err: unknown) {\n const errorMessage = getErrorMessage(err);\n\n return toast.error(errorMessage);\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TPlaceholderElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport {\n PlaceholderPlugin,\n PlaceholderProvider,\n updateUploadHistory,\n} from '@platejs/media/react';\nimport { AudioLines, FileUp, Film, ImageIcon, Loader2Icon } from 'lucide-react';\nimport { KEYS } from 'platejs';\nimport { PlateElement, useEditorPlugin, withHOC } from 'platejs/react';\nimport { useFilePicker } from 'use-file-picker';\n\nimport { cn } from '@/lib/utils';\nimport { useUploadFile } from '@/hooks/use-upload-file';\n\nconst CONTENT: Record<\n string,\n {\n accept: string[];\n content: React.ReactNode;\n icon: React.ReactNode;\n }\n> = {\n [KEYS.audio]: {\n accept: ['audio/*'],\n content: 'Add an audio file',\n icon: <AudioLines />,\n },\n [KEYS.file]: {\n accept: ['*'],\n content: 'Add a file',\n icon: <FileUp />,\n },\n [KEYS.img]: {\n accept: ['image/*'],\n content: 'Add an image',\n icon: <ImageIcon />,\n },\n [KEYS.video]: {\n accept: ['video/*'],\n content: 'Add a video',\n icon: <Film />,\n },\n};\n\nexport const PlaceholderElement = withHOC(\n PlaceholderProvider,\n function PlaceholderElement(props: PlateElementProps<TPlaceholderElement>) {\n const { editor, element } = props;\n\n const { api } = useEditorPlugin(PlaceholderPlugin);\n\n const { isUploading, progress, uploadedFile, uploadFile, uploadingFile } =\n useUploadFile();\n\n const loading = isUploading && uploadingFile;\n\n const currentContent = CONTENT[element.mediaType];\n\n const isImage = element.mediaType === KEYS.img;\n\n const imageRef = React.useRef<HTMLImageElement>(null);\n\n const { openFilePicker } = useFilePicker({\n accept: currentContent.accept,\n multiple: true,\n onFilesSelected: ({ plainFiles: updatedFiles }) => {\n const firstFile = updatedFiles[0];\n const restFiles = updatedFiles.slice(1);\n\n replaceCurrentPlaceholder(firstFile);\n\n if (restFiles.length > 0) {\n editor.getTransforms(PlaceholderPlugin).insert.media(restFiles);\n }\n },\n });\n\n const replaceCurrentPlaceholder = React.useCallback(\n (file: File) => {\n void uploadFile(file);\n api.placeholder.addUploadingFile(element.id as string, file);\n },\n [api.placeholder, element.id, uploadFile]\n );\n\n React.useEffect(() => {\n if (!uploadedFile) return;\n\n const path = editor.api.findPath(element);\n\n editor.tf.withoutSaving(() => {\n editor.tf.removeNodes({ at: path });\n\n const node = {\n children: [{ text: '' }],\n initialHeight: imageRef.current?.height,\n initialWidth: imageRef.current?.width,\n isUpload: true,\n name: element.mediaType === KEYS.file ? uploadedFile.name : '',\n placeholderId: element.id as string,\n type: element.mediaType!,\n url: uploadedFile.url,\n };\n\n editor.tf.insertNodes(node, { at: path });\n\n updateUploadHistory(editor, node);\n });\n\n api.placeholder.removeUploadingFile(element.id as string);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [uploadedFile, element.id]);\n\n // React dev mode will call React.useEffect twice\n const isReplaced = React.useRef(false);\n\n /** Paste and drop */\n React.useEffect(() => {\n if (isReplaced.current) return;\n\n isReplaced.current = true;\n const currentFiles = api.placeholder.getUploadingFile(\n element.id as string\n );\n\n if (!currentFiles) return;\n\n replaceCurrentPlaceholder(currentFiles);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isReplaced]);\n\n return (\n <PlateElement className=\"my-1\" {...props}>\n {(!loading || !isImage) && (\n <div\n className={cn(\n 'flex cursor-pointer select-none items-center rounded-sm bg-muted p-3 pr-9 hover:bg-primary/10'\n )}\n onClick={() => !loading && openFilePicker()}\n contentEditable={false}\n >\n <div className=\"relative mr-3 flex text-muted-foreground/80 [&_svg]:size-6\">\n {currentContent.icon}\n </div>\n <div className=\"whitespace-nowrap text-muted-foreground text-sm\">\n <div>\n {loading ? uploadingFile?.name : currentContent.content}\n </div>\n\n {loading && !isImage && (\n <div className=\"mt-1 flex items-center gap-1.5\">\n <div>{formatBytes(uploadingFile?.size ?? 0)}</div>\n <div>–</div>\n <div className=\"flex items-center\">\n <Loader2Icon className=\"mr-1 size-3.5 animate-spin text-muted-foreground\" />\n {progress ?? 0}%\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n\n {isImage && loading && (\n <ImageProgress\n file={uploadingFile}\n imageRef={imageRef}\n progress={progress}\n />\n )}\n\n {props.children}\n </PlateElement>\n );\n }\n);\n\nexport function ImageProgress({\n className,\n file,\n imageRef,\n progress = 0,\n}: {\n file: File;\n className?: string;\n imageRef?: React.RefObject<HTMLImageElement | null>;\n progress?: number;\n}) {\n const [objectUrl, setObjectUrl] = React.useState<string | null>(null);\n\n React.useEffect(() => {\n const url = URL.createObjectURL(file);\n setObjectUrl(url);\n\n return () => {\n URL.revokeObjectURL(url);\n };\n }, [file]);\n\n if (!objectUrl) {\n return null;\n }\n\n return (\n <div className={cn('relative', className)} contentEditable={false}>\n <img\n ref={imageRef}\n className=\"h-auto w-full rounded-sm object-cover\"\n alt={file.name}\n src={objectUrl}\n />\n {progress < 100 && (\n <div className=\"absolute right-1 bottom-1 flex items-center space-x-2 rounded-full bg-black/50 px-1 py-0.5\">\n <Loader2Icon className=\"size-3.5 animate-spin text-muted-foreground\" />\n <span className=\"font-medium text-white text-xs\">\n {Math.round(progress)}%\n </span>\n </div>\n )}\n </div>\n );\n}\n\nfunction formatBytes(\n bytes: number,\n opts: {\n decimals?: number;\n sizeType?: 'accurate' | 'normal';\n } = {}\n) {\n const { decimals = 0, sizeType = 'normal' } = opts;\n\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n const accurateSizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB'];\n\n if (bytes === 0) return '0 Byte';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n\n return `${(bytes / 1024 ** i).toFixed(decimals)} ${\n sizeType === 'accurate'\n ? (accurateSizes[i] ?? 'Bytest')\n : (sizes[i] ?? 'Bytes')\n }`;\n}\n","'use client';\n\nimport {\n PreviewImage,\n useImagePreview,\n useImagePreviewValue,\n useScaleInput,\n} from '@platejs/media/react';\nimport { cva } from 'class-variance-authority';\nimport { ArrowLeft, ArrowRight, Download, Minus, Plus, X } from 'lucide-react';\nimport { useEditorRef } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nconst buttonVariants = cva('rounded bg-[rgba(0,0,0,0.5)] px-1', {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: 'text-white',\n disabled: 'cursor-not-allowed text-gray-400',\n },\n },\n});\n\nconst SCROLL_SPEED = 4;\n\nexport function MediaPreviewDialog() {\n const editor = useEditorRef();\n const isOpen = useImagePreviewValue('isOpen', editor.id);\n const scale = useImagePreviewValue('scale');\n const isEditingScale = useImagePreviewValue('isEditingScale');\n const {\n closeProps,\n currentUrlIndex,\n maskLayerProps,\n nextDisabled,\n nextProps,\n prevDisabled,\n prevProps,\n scaleTextProps,\n zommOutProps,\n zoomInDisabled,\n zoomInProps,\n zoomOutDisabled,\n } = useImagePreview({ scrollSpeed: SCROLL_SPEED });\n\n return (\n <div\n className={cn(\n 'fixed top-0 left-0 z-50 h-screen w-screen select-none',\n !isOpen && 'hidden'\n )}\n onContextMenu={(e) => e.stopPropagation()}\n {...maskLayerProps}\n >\n <div className=\"absolute inset-0 size-full bg-black opacity-30\" />\n <div className=\"absolute inset-0 size-full bg-black opacity-30\" />\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <div className=\"relative flex max-h-screen w-full items-center\">\n <PreviewImage\n className={cn(\n 'mx-auto block max-h-[calc(100vh-4rem)] w-auto object-contain transition-transform'\n )}\n />\n <div\n className=\"-translate-x-1/2 absolute bottom-0 left-1/2 z-40 flex w-fit justify-center gap-4 p-2 text-center text-white\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex gap-1\">\n <button\n {...prevProps}\n className={cn(\n buttonVariants({\n variant: prevDisabled ? 'disabled' : 'default',\n })\n )}\n type=\"button\"\n >\n <ArrowLeft />\n </button>\n {(currentUrlIndex ?? 0) + 1}\n <button\n {...nextProps}\n className={cn(\n buttonVariants({\n variant: nextDisabled ? 'disabled' : 'default',\n })\n )}\n type=\"button\"\n >\n <ArrowRight />\n </button>\n </div>\n <div className=\"flex\">\n <button\n className={cn(\n buttonVariants({\n variant: zoomOutDisabled ? 'disabled' : 'default',\n })\n )}\n {...zommOutProps}\n type=\"button\"\n >\n <Minus className=\"size-4\" />\n </button>\n <div className=\"mx-px\">\n {isEditingScale ? (\n <>\n <ScaleInput className=\"w-10 rounded px-1 text-slate-500 outline\" />{' '}\n <span>%</span>\n </>\n ) : (\n <span {...scaleTextProps}>{`${scale * 100}%`}</span>\n )}\n </div>\n <button\n className={cn(\n buttonVariants({\n variant: zoomInDisabled ? 'disabled' : 'default',\n })\n )}\n {...zoomInProps}\n type=\"button\"\n >\n <Plus className=\"size-4\" />\n </button>\n </div>\n {/* TODO: downLoad the image */}\n <button className={cn(buttonVariants())} type=\"button\">\n <Download className=\"size-4\" />\n </button>\n <button\n {...closeProps}\n className={cn(buttonVariants())}\n type=\"button\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction ScaleInput(props: React.ComponentProps<'input'>) {\n const { props: scaleInputProps, ref } = useScaleInput();\n\n return <input {...scaleInputProps} {...props} ref={ref} />;\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { PlaceholderPlugin, UploadErrorCode } from '@platejs/media/react';\nimport { usePluginOption } from 'platejs/react';\nimport { toast } from 'sonner';\n\nexport function MediaUploadToast() {\n useUploadErrorToast();\n\n return null;\n}\n\nconst useUploadErrorToast = () => {\n const uploadError = usePluginOption(PlaceholderPlugin, 'error');\n\n React.useEffect(() => {\n if (!uploadError) return;\n\n const { code, data } = uploadError;\n\n switch (code) {\n case UploadErrorCode.INVALID_FILE_SIZE: {\n toast.error(\n `The size of files ${data.files\n .map((f) => f.name)\n .join(', ')} is invalid`\n );\n\n break;\n }\n case UploadErrorCode.INVALID_FILE_TYPE: {\n toast.error(\n `The type of files ${data.files\n .map((f) => f.name)\n .join(', ')} is invalid`\n );\n\n break;\n }\n case UploadErrorCode.TOO_LARGE: {\n toast.error(\n `The size of files ${data.files\n .map((f) => f.name)\n .join(', ')} is too large than ${data.maxFileSize}`\n );\n\n break;\n }\n case UploadErrorCode.TOO_LESS_FILES: {\n toast.error(\n `The mini um number of files is ${data.minFileCount} for ${data.fileType}`\n );\n\n break;\n }\n case UploadErrorCode.TOO_MANY_FILES: {\n toast.error(\n `The maximum number of files is ${data.maxFileCount} ${\n data.fileType ? `for ${data.fileType}` : ''\n }`\n );\n\n break;\n }\n }\n }, [uploadError]);\n};\n","'use client';\n\nimport * as React from 'react';\nimport LiteYouTubeEmbed from 'react-lite-youtube-embed';\nimport ReactPlayer from 'react-player';\n\nimport type { TResizableProps, TVideoElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useDraggable } from '@platejs/dnd';\nimport { parseTwitterUrl, parseVideoUrl } from '@platejs/media';\nimport { useMediaState } from '@platejs/media/react';\nimport { ResizableProvider, useResizableValue } from '@platejs/resizable';\nimport { PlateElement, useEditorMounted, withHOC } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Caption, CaptionTextarea } from './caption';\nimport {\n mediaResizeHandleVariants,\n Resizable,\n ResizeHandle,\n} from './resize-handle';\n\nexport const VideoElement = withHOC(\n ResizableProvider,\n function VideoElement(\n props: PlateElementProps<TVideoElement & TResizableProps>\n ) {\n const {\n align = 'center',\n embed,\n isUpload,\n isYoutube,\n readOnly,\n unsafeUrl,\n } = useMediaState({\n urlParsers: [parseTwitterUrl, parseVideoUrl],\n });\n const width = useResizableValue('width');\n\n const isEditorMounted = useEditorMounted();\n\n const isTweet = true;\n\n const { isDragging, handleRef } = useDraggable({\n element: props.element,\n });\n\n return (\n <PlateElement className=\"py-2.5\" {...props}>\n <figure className=\"relative m-0 cursor-default\" contentEditable={false}>\n <Resizable\n className={cn(isDragging && 'opacity-50')}\n align={align}\n options={{\n align,\n maxWidth: isTweet ? 550 : '100%',\n minWidth: isTweet ? 300 : 100,\n readOnly,\n }}\n >\n <div className=\"group/media\">\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'left' })}\n options={{ direction: 'left' }}\n />\n\n <ResizeHandle\n className={mediaResizeHandleVariants({ direction: 'right' })}\n options={{ direction: 'right' }}\n />\n\n {!isUpload && isYoutube && (\n <div ref={handleRef}>\n <LiteYouTubeEmbed\n id={embed!.id!}\n title=\"youtube\"\n wrapperClass={cn(\n 'aspect-video rounded-sm',\n 'relative block cursor-pointer bg-black bg-center bg-cover [contain:content]',\n '[&.lyt-activated]:before:absolute [&.lyt-activated]:before:top-0 [&.lyt-activated]:before:h-[60px] [&.lyt-activated]:before:w-full [&.lyt-activated]:before:bg-top [&.lyt-activated]:before:bg-repeat-x [&.lyt-activated]:before:pb-[50px] [&.lyt-activated]:before:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&.lyt-activated]:before:bg-[url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==)]',\n 'after:block after:pb-[var(--aspect-ratio)] after:content-[\"\"]',\n '[&_>_iframe]:absolute [&_>_iframe]:top-0 [&_>_iframe]:left-0 [&_>_iframe]:size-full',\n '[&_>_.lty-playbtn]:z-1 [&_>_.lty-playbtn]:h-[46px] [&_>_.lty-playbtn]:w-[70px] [&_>_.lty-playbtn]:rounded-[14%] [&_>_.lty-playbtn]:bg-[#212121] [&_>_.lty-playbtn]:opacity-80 [&_>_.lty-playbtn]:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]',\n '[&:hover_>_.lty-playbtn]:bg-[red] [&:hover_>_.lty-playbtn]:opacity-100',\n '[&_>_.lty-playbtn]:before:border-[transparent_transparent_transparent_#fff] [&_>_.lty-playbtn]:before:border-y-[11px] [&_>_.lty-playbtn]:before:border-r-0 [&_>_.lty-playbtn]:before:border-l-[19px] [&_>_.lty-playbtn]:before:content-[\"\"]',\n '[&_>_.lty-playbtn]:absolute [&_>_.lty-playbtn]:top-1/2 [&_>_.lty-playbtn]:left-1/2 [&_>_.lty-playbtn]:[transform:translate3d(-50%,-50%,0)]',\n '[&_>_.lty-playbtn]:before:absolute [&_>_.lty-playbtn]:before:top-1/2 [&_>_.lty-playbtn]:before:left-1/2 [&_>_.lty-playbtn]:before:[transform:translate3d(-50%,-50%,0)]',\n '[&.lyt-activated]:cursor-[unset]',\n '[&.lyt-activated]:before:pointer-events-none [&.lyt-activated]:before:opacity-0',\n '[&.lyt-activated_>_.lty-playbtn]:pointer-events-none [&.lyt-activated_>_.lty-playbtn]:opacity-0!'\n )}\n />\n </div>\n )}\n\n {isUpload && isEditorMounted && (\n <div ref={handleRef}>\n <ReactPlayer\n height=\"100%\"\n src={unsafeUrl}\n width=\"100%\"\n controls\n />\n </div>\n )}\n </div>\n </Resizable>\n\n <Caption style={{ width }} align={align}>\n <CaptionTextarea\n readOnly={readOnly}\n placeholder=\"Write a caption...\"\n />\n </Caption>\n </figure>\n {props.children}\n </PlateElement>\n );\n }\n);\n","'use client';\n\nimport { CaptionPlugin } from '@platejs/caption/react';\nimport {\n AudioPlugin,\n FilePlugin,\n ImagePlugin,\n MediaEmbedPlugin,\n PlaceholderPlugin,\n VideoPlugin,\n} from '@platejs/media/react';\nimport { KEYS } from 'platejs';\n\nimport { AudioElement } from '@/components/ui/media-audio-node';\nimport { MediaEmbedElement } from '@/components/ui/media-embed-node';\nimport { FileElement } from '@/components/ui/media-file-node';\nimport { ImageElement } from '@/components/ui/media-image-node';\nimport { PlaceholderElement } from '@/components/ui/media-placeholder-node';\nimport { MediaPreviewDialog } from '@/components/ui/media-preview-dialog';\nimport { MediaUploadToast } from '@/components/ui/media-upload-toast';\nimport { VideoElement } from '@/components/ui/media-video-node';\n\nexport const MediaKit = [\n ImagePlugin.configure({\n options: { disableUploadInsert: true },\n render: { afterEditable: MediaPreviewDialog, node: ImageElement },\n }),\n MediaEmbedPlugin.withComponent(MediaEmbedElement),\n VideoPlugin.withComponent(VideoElement),\n AudioPlugin.withComponent(AudioElement),\n FilePlugin.withComponent(FileElement),\n PlaceholderPlugin.configure({\n options: { disableEmptyPlaceholder: true },\n render: { afterEditable: MediaUploadToast, node: PlaceholderElement },\n }),\n CaptionPlugin.configure({\n options: {\n query: {\n allow: [KEYS.img, KEYS.video, KEYS.audio, KEYS.file, KEYS.mediaEmbed],\n },\n },\n }),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { Point, TElement } from 'platejs';\n\nimport {\n type ComboboxItemProps,\n Combobox,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxItem,\n ComboboxPopover,\n ComboboxProvider,\n ComboboxRow,\n Portal,\n useComboboxContext,\n useComboboxStore,\n} from '@ariakit/react';\nimport { filterWords } from '@platejs/combobox';\nimport {\n type UseComboboxInputResult,\n useComboboxInput,\n useHTMLInputCursorState,\n} from '@platejs/combobox/react';\nimport { cva } from 'class-variance-authority';\nimport { useComposedRef, useEditorRef } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\ntype FilterFn = (\n item: { value: string; group?: string; keywords?: string[]; label?: string },\n search: string\n) => boolean;\n\ntype InlineComboboxContextValue = {\n filter: FilterFn | false;\n inputProps: UseComboboxInputResult['props'];\n inputRef: React.RefObject<HTMLInputElement | null>;\n removeInput: UseComboboxInputResult['removeInput'];\n showTrigger: boolean;\n trigger: string;\n setHasEmpty: (hasEmpty: boolean) => void;\n};\n\nconst InlineComboboxContext = React.createContext<InlineComboboxContextValue>(\n null as unknown as InlineComboboxContextValue\n);\n\nconst defaultFilter: FilterFn = (\n { group, keywords = [], label, value },\n search\n) => {\n const uniqueTerms = new Set(\n [value, ...keywords, group, label].filter(Boolean)\n );\n\n return Array.from(uniqueTerms).some((keyword) =>\n filterWords(keyword!, search)\n );\n};\n\ntype InlineComboboxProps = {\n children: React.ReactNode;\n element: TElement;\n trigger: string;\n filter?: FilterFn | false;\n hideWhenNoValue?: boolean;\n showTrigger?: boolean;\n value?: string;\n setValue?: (value: string) => void;\n};\n\nconst InlineCombobox = ({\n children,\n element,\n filter = defaultFilter,\n hideWhenNoValue = false,\n setValue: setValueProp,\n showTrigger = true,\n trigger,\n value: valueProp,\n}: InlineComboboxProps) => {\n const editor = useEditorRef();\n const inputRef = React.useRef<HTMLInputElement>(null);\n const cursorState = useHTMLInputCursorState(inputRef);\n\n const [valueState, setValueState] = React.useState('');\n const hasValueProp = valueProp !== undefined;\n const value = hasValueProp ? valueProp : valueState;\n\n const setValue = React.useCallback(\n (newValue: string) => {\n setValueProp?.(newValue);\n\n if (!hasValueProp) {\n setValueState(newValue);\n }\n },\n [setValueProp, hasValueProp]\n );\n\n /**\n * Track the point just before the input element so we know where to\n * insertText if the combobox closes due to a selection change.\n */\n const insertPoint = React.useRef<Point | null>(null);\n\n React.useEffect(() => {\n const path = editor.api.findPath(element);\n\n if (!path) return;\n\n const point = editor.api.before(path);\n\n if (!point) return;\n\n const pointRef = editor.api.pointRef(point);\n insertPoint.current = pointRef.current;\n\n return () => {\n pointRef.unref();\n };\n }, [editor, element]);\n\n const { props: inputProps, removeInput } = useComboboxInput({\n cancelInputOnBlur: true,\n cursorState,\n ref: inputRef,\n onCancelInput: (cause) => {\n if (cause !== 'backspace') {\n editor.tf.insertText(trigger + value, {\n at: insertPoint?.current ?? undefined,\n });\n }\n if (cause === 'arrowLeft' || cause === 'arrowRight') {\n editor.tf.move({\n distance: 1,\n reverse: cause === 'arrowLeft',\n });\n }\n },\n });\n\n const [hasEmpty, setHasEmpty] = React.useState(false);\n\n const contextValue: InlineComboboxContextValue = React.useMemo(\n () => ({\n filter,\n inputProps,\n inputRef,\n removeInput,\n setHasEmpty,\n showTrigger,\n trigger,\n }),\n [\n trigger,\n showTrigger,\n filter,\n inputRef,\n inputProps,\n removeInput,\n setHasEmpty,\n ]\n );\n\n const store = useComboboxStore({\n // open: ,\n setValue: (newValue) => React.startTransition(() => setValue(newValue)),\n });\n\n const items = store.useState('items');\n\n /**\n * If there is no active ID and the list of items changes, select the first\n * item.\n */\n React.useEffect(() => {\n if (!store.getState().activeId) {\n store.setActiveId(store.first());\n }\n }, [items, store]);\n\n return (\n <span contentEditable={false}>\n <ComboboxProvider\n open={\n (items.length > 0 || hasEmpty) &&\n (!hideWhenNoValue || value.length > 0)\n }\n store={store}\n >\n <InlineComboboxContext.Provider value={contextValue}>\n {children}\n </InlineComboboxContext.Provider>\n </ComboboxProvider>\n </span>\n );\n};\n\nconst InlineComboboxInput = ({\n className,\n ref: propRef,\n ...props\n}: React.HTMLAttributes<HTMLInputElement> & {\n ref?: React.RefObject<HTMLInputElement | null>;\n}) => {\n const {\n inputProps,\n inputRef: contextRef,\n showTrigger,\n trigger,\n } = React.useContext(InlineComboboxContext);\n\n const store = useComboboxContext()!;\n const value = store.useState('value');\n\n const ref = useComposedRef(propRef, contextRef);\n\n /**\n * To create an auto-resizing input, we render a visually hidden span\n * containing the input value and position the input element on top of it.\n * This works well for all cases except when input exceeds the width of the\n * container.\n */\n\n return (\n <>\n {showTrigger && trigger}\n\n <span className=\"relative min-h-[1lh]\">\n <span\n className=\"invisible overflow-hidden text-nowrap\"\n aria-hidden=\"true\"\n >\n {value || '\\u200B'}\n </span>\n\n <Combobox\n ref={ref}\n className={cn(\n 'absolute top-0 left-0 size-full bg-transparent outline-none',\n className\n )}\n value={value}\n autoSelect\n {...inputProps}\n {...props}\n />\n </span>\n </>\n );\n};\n\nInlineComboboxInput.displayName = 'InlineComboboxInput';\n\nconst InlineComboboxContent: typeof ComboboxPopover = ({\n className,\n ...props\n}) => {\n // Portal prevents CSS from leaking into popover\n return (\n <Portal>\n <ComboboxPopover\n className={cn(\n 'z-500 max-h-[288px] w-[300px] overflow-y-auto rounded-md bg-popover shadow-md',\n className\n )}\n {...props}\n />\n </Portal>\n );\n};\n\nconst comboboxItemVariants = cva(\n 'relative mx-1 flex h-[28px] select-none items-center rounded-sm px-2 text-foreground text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n {\n defaultVariants: {\n interactive: true,\n },\n variants: {\n interactive: {\n false: '',\n true: 'cursor-pointer transition-colors hover:bg-accent hover:text-accent-foreground data-[active-item=true]:bg-accent data-[active-item=true]:text-accent-foreground',\n },\n },\n }\n);\n\nconst InlineComboboxItem = ({\n className,\n focusEditor = true,\n group,\n keywords,\n label,\n onClick,\n ...props\n}: {\n focusEditor?: boolean;\n group?: string;\n keywords?: string[];\n label?: string;\n} & ComboboxItemProps &\n Required<Pick<ComboboxItemProps, 'value'>>) => {\n const { value } = props;\n\n const { filter, removeInput } = React.useContext(InlineComboboxContext);\n\n const store = useComboboxContext()!;\n\n // Optimization: Do not subscribe to value if filter is false\n const search = filter && store.useState('value');\n\n const visible = React.useMemo(\n () =>\n !filter || filter({ group, keywords, label, value }, search as string),\n [filter, group, keywords, label, value, search]\n );\n\n if (!visible) return null;\n\n return (\n <ComboboxItem\n className={cn(comboboxItemVariants(), className)}\n onClick={(event) => {\n removeInput(focusEditor);\n onClick?.(event);\n }}\n {...props}\n />\n );\n};\n\nconst InlineComboboxEmpty = ({\n children,\n className,\n}: React.HTMLAttributes<HTMLDivElement>) => {\n const { setHasEmpty } = React.useContext(InlineComboboxContext);\n const store = useComboboxContext()!;\n const items = store.useState('items');\n\n React.useEffect(() => {\n setHasEmpty(true);\n\n return () => {\n setHasEmpty(false);\n };\n }, [setHasEmpty]);\n\n if (items.length > 0) return null;\n\n return (\n <div\n className={cn(comboboxItemVariants({ interactive: false }), className)}\n >\n {children}\n </div>\n );\n};\n\nconst InlineComboboxRow = ComboboxRow;\n\nfunction InlineComboboxGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxGroup>) {\n return (\n <ComboboxGroup\n {...props}\n className={cn(\n 'hidden not-last:border-b py-1.5 [&:has([role=option])]:block',\n className\n )}\n />\n );\n}\n\nfunction InlineComboboxGroupLabel({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxGroupLabel>) {\n return (\n <ComboboxGroupLabel\n {...props}\n className={cn(\n 'mt-1.5 mb-2 px-3 font-medium text-muted-foreground text-xs',\n className\n )}\n />\n );\n}\n\nexport {\n InlineCombobox,\n InlineComboboxContent,\n InlineComboboxEmpty,\n InlineComboboxGroup,\n InlineComboboxGroupLabel,\n InlineComboboxInput,\n InlineComboboxItem,\n InlineComboboxRow,\n};\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TComboboxInputElement, TMentionElement } from 'platejs';\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { getMentionOnSelectItem } from '@platejs/mention';\nimport { IS_APPLE, KEYS } from 'platejs';\nimport {\n PlateElement,\n useFocused,\n useReadOnly,\n useSelected,\n} from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\nimport { useMounted } from '@/hooks/use-mounted';\n\nimport {\n InlineCombobox,\n InlineComboboxContent,\n InlineComboboxEmpty,\n InlineComboboxGroup,\n InlineComboboxInput,\n InlineComboboxItem,\n} from './inline-combobox';\n\nexport function MentionElement(\n props: PlateElementProps<TMentionElement> & {\n prefix?: string;\n }\n) {\n const element = props.element;\n\n const selected = useSelected();\n const focused = useFocused();\n const mounted = useMounted();\n const readOnly = useReadOnly();\n\n return (\n <PlateElement\n {...props}\n className={cn(\n 'inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline font-medium text-sm',\n !readOnly && 'cursor-pointer',\n selected && focused && 'ring-2 ring-ring',\n element.children[0][KEYS.bold] === true && 'font-bold',\n element.children[0][KEYS.italic] === true && 'italic',\n element.children[0][KEYS.underline] === true && 'underline'\n )}\n attributes={{\n ...props.attributes,\n contentEditable: false,\n 'data-slate-value': element.value,\n draggable: true,\n }}\n >\n {mounted && IS_APPLE ? (\n // Mac OS IME https://github.com/ianstormtaylor/slate/issues/3490\n <>\n {props.children}\n {props.prefix}\n {element.value}\n </>\n ) : (\n // Others like Android https://github.com/ianstormtaylor/slate/pull/5360\n <>\n {props.prefix}\n {element.value}\n {props.children}\n </>\n )}\n </PlateElement>\n );\n}\n\nconst onSelectItem = getMentionOnSelectItem();\n\nexport function MentionInputElement(\n props: PlateElementProps<TComboboxInputElement>\n) {\n const { editor, element } = props;\n const [search, setSearch] = React.useState('');\n\n return (\n <PlateElement {...props} as=\"span\">\n <InlineCombobox\n value={search}\n element={element}\n setValue={setSearch}\n showTrigger={false}\n trigger=\"@\"\n >\n <span className=\"inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline text-sm ring-ring focus-within:ring-2\">\n <InlineComboboxInput />\n </span>\n\n <InlineComboboxContent className=\"my-1.5\">\n <InlineComboboxEmpty>No results</InlineComboboxEmpty>\n\n <InlineComboboxGroup>\n {MENTIONABLES.map((item) => (\n <InlineComboboxItem\n key={item.key}\n value={item.text}\n onClick={() => onSelectItem(editor, item, search)}\n >\n {item.text}\n </InlineComboboxItem>\n ))}\n </InlineComboboxGroup>\n </InlineComboboxContent>\n </InlineCombobox>\n\n {props.children}\n </PlateElement>\n );\n}\n\nconst MENTIONABLES = [\n { key: '0', text: 'Aayla Secura' },\n { key: '1', text: 'Adi Gallia' },\n {\n key: '2',\n text: 'Admiral Dodd Rancit',\n },\n {\n key: '3',\n text: 'Admiral Firmus Piett',\n },\n {\n key: '4',\n text: 'Admiral Gial Ackbar',\n },\n { key: '5', text: 'Admiral Ozzel' },\n { key: '6', text: 'Admiral Raddus' },\n {\n key: '7',\n text: 'Admiral Terrinald Screed',\n },\n { key: '8', text: 'Admiral Trench' },\n {\n key: '9',\n text: 'Admiral U.O. Statura',\n },\n { key: '10', text: 'Agen Kolar' },\n { key: '11', text: 'Agent Kallus' },\n {\n key: '12',\n text: 'Aiolin and Morit Astarte',\n },\n { key: '13', text: 'Aks Moe' },\n { key: '14', text: 'Almec' },\n { key: '15', text: 'Alton Kastle' },\n { key: '16', text: 'Amee' },\n { key: '17', text: 'AP-5' },\n { key: '18', text: 'Armitage Hux' },\n { key: '19', text: 'Artoo' },\n { key: '20', text: 'Arvel Crynyd' },\n { key: '21', text: 'Asajj Ventress' },\n { key: '22', text: 'Aurra Sing' },\n { key: '23', text: 'AZI-3' },\n { key: '24', text: 'Bala-Tik' },\n { key: '25', text: 'Barada' },\n { key: '26', text: 'Bargwill Tomder' },\n { key: '27', text: 'Baron Papanoida' },\n { key: '28', text: 'Barriss Offee' },\n { key: '29', text: 'Baze Malbus' },\n { key: '30', text: 'Bazine Netal' },\n { key: '31', text: 'BB-8' },\n { key: '32', text: 'BB-9E' },\n { key: '33', text: 'Ben Quadinaros' },\n { key: '34', text: 'Berch Teller' },\n { key: '35', text: 'Beru Lars' },\n { key: '36', text: 'Bib Fortuna' },\n {\n key: '37',\n text: 'Biggs Darklighter',\n },\n { key: '38', text: 'Black Krrsantan' },\n { key: '39', text: 'Bo-Katan Kryze' },\n { key: '40', text: 'Boba Fett' },\n { key: '41', text: 'Bobbajo' },\n { key: '42', text: 'Bodhi Rook' },\n { key: '43', text: 'Borvo the Hutt' },\n { key: '44', text: 'Boss Nass' },\n { key: '45', text: 'Bossk' },\n {\n key: '46',\n text: 'Breha Antilles-Organa',\n },\n { key: '47', text: 'Bren Derlin' },\n { key: '48', text: 'Brendol Hux' },\n { key: '49', text: 'BT-1' },\n];\n","'use client';\n\nimport { MentionInputPlugin, MentionPlugin } from '@platejs/mention/react';\n\nimport {\n MentionElement,\n MentionInputElement,\n} from '@/components/ui/mention-node';\n\nexport const MentionKit = [\n MentionPlugin.configure({\n options: { triggerPreviousCharPattern: /^$|^[\\s\"']$/ },\n }).withComponent(MentionElement),\n MentionInputPlugin.withComponent(MentionInputElement),\n];\n","import * as React from 'react';\n\nexport function useMounted() {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n return mounted;\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateEditor, PlateElementProps } from 'platejs/react';\n\nimport { AIChatPlugin } from '@platejs/ai/react';\nimport {\n CalendarIcon,\n ChevronRightIcon,\n Code2,\n Columns3Icon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n LightbulbIcon,\n ListIcon,\n ListOrdered,\n PenToolIcon,\n PilcrowIcon,\n Quote,\n RadicalIcon,\n SparklesIcon,\n Square,\n Table,\n TableOfContentsIcon,\n} from 'lucide-react';\nimport { type TComboboxInputElement, KEYS } from 'platejs';\nimport { PlateElement } from 'platejs/react';\n\nimport {\n insertBlock,\n insertInlineElement,\n} from '@/components/editor/transforms';\n\nimport {\n InlineCombobox,\n InlineComboboxContent,\n InlineComboboxEmpty,\n InlineComboboxGroup,\n InlineComboboxGroupLabel,\n InlineComboboxInput,\n InlineComboboxItem,\n} from './inline-combobox';\n\ntype Group = {\n group: string;\n items: {\n icon: React.ReactNode;\n value: string;\n onSelect: (editor: PlateEditor, value: string) => void;\n className?: string;\n focusEditor?: boolean;\n keywords?: string[];\n label?: string;\n }[];\n};\n\nconst groups: Group[] = [\n {\n group: 'AI',\n items: [\n {\n focusEditor: false,\n icon: <SparklesIcon />,\n value: 'AI',\n onSelect: (editor) => {\n editor.getApi(AIChatPlugin).aiChat.show();\n },\n },\n ],\n },\n {\n group: 'Basic blocks',\n items: [\n {\n icon: <PilcrowIcon />,\n keywords: ['paragraph'],\n label: 'Text',\n value: KEYS.p,\n },\n {\n icon: <Heading1Icon />,\n keywords: ['title', 'h1'],\n label: 'Heading 1',\n value: KEYS.h1,\n },\n {\n icon: <Heading2Icon />,\n keywords: ['subtitle', 'h2'],\n label: 'Heading 2',\n value: KEYS.h2,\n },\n {\n icon: <Heading3Icon />,\n keywords: ['subtitle', 'h3'],\n label: 'Heading 3',\n value: KEYS.h3,\n },\n {\n icon: <ListIcon />,\n keywords: ['unordered', 'ul', '-'],\n label: 'Bulleted list',\n value: KEYS.ul,\n },\n {\n icon: <ListOrdered />,\n keywords: ['ordered', 'ol', '1'],\n label: 'Numbered list',\n value: KEYS.ol,\n },\n {\n icon: <Square />,\n keywords: ['checklist', 'task', 'checkbox', '[]'],\n label: 'To-do list',\n value: KEYS.listTodo,\n },\n {\n icon: <ChevronRightIcon />,\n keywords: ['collapsible', 'expandable'],\n label: 'Toggle',\n value: KEYS.toggle,\n },\n {\n icon: <Code2 />,\n keywords: ['```'],\n label: 'Code Block',\n value: KEYS.codeBlock,\n },\n {\n icon: <Table />,\n label: 'Table',\n value: KEYS.table,\n },\n {\n icon: <Quote />,\n keywords: ['citation', 'blockquote', 'quote', '>'],\n label: 'Blockquote',\n value: KEYS.blockquote,\n },\n {\n description: 'Insert a highlighted block.',\n icon: <LightbulbIcon />,\n keywords: ['note'],\n label: 'Callout',\n value: KEYS.callout,\n },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value, { upsert: true });\n },\n })),\n },\n {\n group: 'Advanced blocks',\n items: [\n {\n icon: <TableOfContentsIcon />,\n keywords: ['toc'],\n label: 'Table of contents',\n value: KEYS.toc,\n },\n {\n icon: <Columns3Icon />,\n label: '3 columns',\n value: 'action_three_columns',\n },\n {\n focusEditor: false,\n icon: <RadicalIcon />,\n label: 'Equation',\n value: KEYS.equation,\n },\n {\n icon: <PenToolIcon />,\n keywords: ['excalidraw'],\n label: 'Excalidraw',\n value: KEYS.excalidraw,\n },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertBlock(editor, value, { upsert: true });\n },\n })),\n },\n {\n group: 'Inline',\n items: [\n {\n focusEditor: true,\n icon: <CalendarIcon />,\n keywords: ['time'],\n label: 'Date',\n value: KEYS.date,\n },\n {\n focusEditor: false,\n icon: <RadicalIcon />,\n label: 'Inline Equation',\n value: KEYS.inlineEquation,\n },\n ].map((item) => ({\n ...item,\n onSelect: (editor, value) => {\n insertInlineElement(editor, value);\n },\n })),\n },\n];\n\nexport function SlashInputElement(\n props: PlateElementProps<TComboboxInputElement>\n) {\n const { editor, element } = props;\n\n return (\n <PlateElement {...props} as=\"span\">\n <InlineCombobox element={element} trigger=\"/\">\n <InlineComboboxInput />\n\n <InlineComboboxContent>\n <InlineComboboxEmpty>No results</InlineComboboxEmpty>\n\n {groups.map(({ group, items }) => (\n <InlineComboboxGroup key={group}>\n <InlineComboboxGroupLabel>{group}</InlineComboboxGroupLabel>\n\n {items.map(\n ({ focusEditor, icon, keywords, label, value, onSelect }) => (\n <InlineComboboxItem\n key={value}\n value={value}\n onClick={() => onSelect(editor, value)}\n label={label}\n focusEditor={focusEditor}\n group={group}\n keywords={keywords}\n >\n <div className=\"mr-2 text-muted-foreground\">{icon}</div>\n {label ?? value}\n </InlineComboboxItem>\n )\n )}\n </InlineComboboxGroup>\n ))}\n </InlineComboboxContent>\n </InlineCombobox>\n\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { SlashInputPlugin, SlashPlugin } from '@platejs/slash-command/react';\nimport { KEYS } from 'platejs';\n\nimport { SlashInputElement } from '@/components/ui/slash-node';\n\nexport const SlashKit = [\n SlashPlugin.configure({\n options: {\n triggerQuery: (editor) =>\n !editor.api.some({\n match: { type: editor.getType(KEYS.codeBlock) },\n }),\n },\n }),\n SlashInputPlugin.withComponent(SlashInputElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TSuggestionData, TSuggestionText } from 'platejs';\nimport type { PlateLeafProps, RenderNodeWrapper } from 'platejs/react';\n\nimport { cva } from 'class-variance-authority';\nimport { CornerDownLeftIcon } from 'lucide-react';\nimport { PlateLeaf, useEditorPlugin, usePluginOption } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\nimport {\n type SuggestionConfig,\n suggestionPlugin,\n} from '@/components/editor/plugins/suggestion-kit';\n\nconst suggestionVariants = cva(\n cn(\n 'bg-emerald-100 text-emerald-700 no-underline transition-colors duration-200'\n ),\n {\n defaultVariants: {\n insertActive: false,\n remove: false,\n removeActive: false,\n },\n variants: {\n insertActive: {\n false: '',\n true: 'bg-emerald-200/80',\n },\n remove: {\n false: '',\n true: 'bg-red-100 text-red-700',\n },\n removeActive: {\n false: '',\n true: 'bg-red-200/80 no-underline',\n },\n },\n }\n);\n\nexport function SuggestionLeaf(props: PlateLeafProps<TSuggestionText>) {\n const { api, setOption } = useEditorPlugin(suggestionPlugin);\n const leaf = props.leaf;\n\n const leafId: string = api.suggestion.nodeId(leaf) ?? '';\n const activeSuggestionId = usePluginOption(suggestionPlugin, 'activeId');\n const hoverSuggestionId = usePluginOption(suggestionPlugin, 'hoverId');\n const dataList = api.suggestion.dataList(leaf);\n\n const hasRemove = dataList.some((data) => data.type === 'remove');\n const hasActive = dataList.some((data) => data.id === activeSuggestionId);\n const hasHover = dataList.some((data) => data.id === hoverSuggestionId);\n\n const diffOperation = { type: hasRemove ? 'delete' : 'insert' } as const;\n\n const Component = ({ delete: 'del', insert: 'ins', update: 'span' } as const)[\n diffOperation.type\n ];\n\n return (\n <PlateLeaf\n {...props}\n as={Component}\n className={cn(\n suggestionVariants({\n insertActive: hasActive || hasHover,\n remove: hasRemove,\n removeActive: (hasActive || hasHover) && hasRemove,\n })\n )}\n attributes={{\n ...props.attributes,\n onMouseEnter: () => setOption('hoverId', leafId),\n onMouseLeave: () => setOption('hoverId', null),\n }}\n >\n {props.children}\n </PlateLeaf>\n );\n}\nexport const SuggestionLineBreak: RenderNodeWrapper<SuggestionConfig> = ({\n api,\n element,\n}) => {\n if (!api.suggestion.isBlockSuggestion(element)) return;\n\n const suggestionData = element.suggestion;\n\n return function Component({ children }) {\n return (\n <SuggestionLineBreakContent suggestionData={suggestionData}>\n {children}\n </SuggestionLineBreakContent>\n );\n };\n};\n\nfunction SuggestionLineBreakContent({\n children,\n suggestionData,\n}: {\n children: React.ReactNode;\n suggestionData: TSuggestionData;\n}) {\n const { isLineBreak, type } = suggestionData;\n const isRemove = type === 'remove';\n const isInsert = type === 'insert';\n\n const activeSuggestionId = usePluginOption(suggestionPlugin, 'activeId');\n const hoverSuggestionId = usePluginOption(suggestionPlugin, 'hoverId');\n\n const isActive = activeSuggestionId === suggestionData.id;\n const isHover = hoverSuggestionId === suggestionData.id;\n\n const spanRef = React.useRef<HTMLSpanElement>(null);\n const { setOption } = useEditorPlugin(suggestionPlugin);\n\n return (\n <>\n {isLineBreak ? (\n <>\n {children}\n <span\n ref={spanRef}\n className={cn(\n 'absolute text-justify',\n suggestionVariants({\n insertActive: isInsert && (isActive || isHover),\n remove: isRemove,\n removeActive: (isActive || isHover) && isRemove,\n })\n )}\n style={{\n bottom: 3.5,\n height: 21,\n }}\n contentEditable={false}\n >\n <CornerDownLeftIcon className=\"mt-0.5 size-4\" />\n </span>\n </>\n ) : (\n <div\n className={cn(\n suggestionVariants({\n insertActive: isInsert && (isActive || isHover),\n remove: isRemove,\n removeActive: (isActive || isHover) && isRemove,\n })\n )}\n onMouseEnter={() => setOption('hoverId', suggestionData.id)}\n onMouseLeave={() => setOption('hoverId', null)}\n data-block-suggestion=\"true\"\n >\n {children}\n </div>\n )}\n </>\n );\n}\n","import * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n \"relative flex size-8 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn(\"aspect-square size-full\", className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"bg-muted flex size-full items-center justify-center rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarImage, AvatarFallback }\n","'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\nimport type { PlateContentProps, PlateViewProps } from 'platejs/react';\n\nimport { cva } from 'class-variance-authority';\nimport { PlateContainer, PlateContent, PlateView } from 'platejs/react';\n\nimport { cn } from '@/lib/utils';\n\nconst editorContainerVariants = cva(\n 'relative w-full cursor-text select-text overflow-y-auto caret-primary selection:bg-brand/25 focus-visible:outline-none [&_.slate-selection-area]:z-50 [&_.slate-selection-area]:border [&_.slate-selection-area]:border-brand/25 [&_.slate-selection-area]:bg-brand/15',\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n comment: cn(\n 'flex flex-wrap justify-between gap-1 px-1 py-0.5 text-sm',\n 'rounded-md border-[1.5px] border-transparent bg-transparent',\n 'has-[[data-slate-editor]:focus]:border-brand/50 has-[[data-slate-editor]:focus]:ring-2 has-[[data-slate-editor]:focus]:ring-brand/30',\n 'has-aria-disabled:border-input has-aria-disabled:bg-muted'\n ),\n default: 'h-full',\n demo: 'h-[650px]',\n select: cn(\n 'group rounded-md border border-input ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2',\n 'has-data-readonly:w-fit has-data-readonly:cursor-default has-data-readonly:border-transparent has-data-readonly:focus-within:[box-shadow:none]'\n ),\n },\n },\n }\n);\n\nexport function EditorContainer({\n className,\n variant,\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof editorContainerVariants>) {\n return (\n <PlateContainer\n className={cn(\n 'ignore-click-outside/toolbar',\n editorContainerVariants({ variant }),\n className\n )}\n {...props}\n />\n );\n}\n\nconst editorVariants = cva(\n cn(\n 'group/editor',\n 'relative w-full cursor-text select-text overflow-x-hidden whitespace-pre-wrap break-words',\n 'rounded-md ring-offset-background focus-visible:outline-none',\n '**:data-slate-placeholder:!top-1/2 **:data-slate-placeholder:-translate-y-1/2 placeholder:text-muted-foreground/80 **:data-slate-placeholder:text-muted-foreground/80 **:data-slate-placeholder:opacity-100!',\n '[&_strong]:font-bold'\n ),\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n },\n focused: {\n true: 'ring-2 ring-ring ring-offset-2',\n },\n variant: {\n ai: 'w-full px-0 text-base md:text-sm',\n aiChat:\n 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm',\n comment: cn('rounded-none border-none bg-transparent text-sm'),\n default:\n 'size-full px-16 pt-4 pb-72 text-base sm:px-[max(64px,calc(50%-350px))]',\n demo: 'size-full px-16 pt-4 pb-72 text-base sm:px-[max(64px,calc(50%-350px))]',\n fullWidth: 'size-full px-16 pt-4 pb-72 text-base sm:px-24',\n none: '',\n select: 'px-3 py-2 text-base data-readonly:w-fit',\n },\n },\n }\n);\n\nexport type EditorProps = PlateContentProps &\n VariantProps<typeof editorVariants>;\n\nexport const Editor = ({\n className,\n disabled,\n focused,\n variant,\n ref,\n ...props\n}: EditorProps & { ref?: React.RefObject<HTMLDivElement | null> }) => (\n <PlateContent\n ref={ref}\n className={cn(\n editorVariants({\n disabled,\n focused,\n variant,\n }),\n className\n )}\n disabled={disabled}\n disableDefaultStyles\n {...props}\n />\n);\n\nEditor.displayName = 'Editor';\n\nexport function EditorView({\n className,\n variant,\n ...props\n}: PlateViewProps & VariantProps<typeof editorVariants>) {\n return (\n <PlateView\n {...props}\n className={cn(editorVariants({ variant }), className)}\n />\n );\n}\n\nEditorView.displayName = 'EditorView';\n","'use client';\n\nimport * as React from 'react';\n\nimport type { CreatePlateEditorOptions } from 'platejs/react';\n\nimport { getCommentKey, getDraftCommentKey } from '@platejs/comment';\nimport { CommentPlugin, useCommentId } from '@platejs/comment/react';\nimport {\n differenceInDays,\n differenceInHours,\n differenceInMinutes,\n format,\n} from 'date-fns';\nimport {\n ArrowUpIcon,\n CheckIcon,\n MoreHorizontalIcon,\n PencilIcon,\n TrashIcon,\n XIcon,\n} from 'lucide-react';\nimport { type Value, KEYS, nanoid, NodeApi } from 'platejs';\nimport {\n Plate,\n useEditorPlugin,\n useEditorRef,\n usePlateEditor,\n usePluginOption,\n} from 'platejs/react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';\nimport { Button } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { cn } from '@/lib/utils';\nimport { BasicMarksKit } from '@/components/editor/plugins/basic-marks-kit';\nimport {\n type TDiscussion,\n discussionPlugin,\n} from '@/components/editor/plugins/discussion-kit';\n\nimport { Editor, EditorContainer } from './editor';\n\nexport type TComment = {\n id: string;\n contentRich: Value;\n createdAt: Date;\n discussionId: string;\n isEdited: boolean;\n userId: string;\n};\n\nexport function Comment(props: {\n comment: TComment;\n discussionLength: number;\n editingId: string | null;\n index: number;\n setEditingId: React.Dispatch<React.SetStateAction<string | null>>;\n documentContent?: string;\n showDocumentContent?: boolean;\n onEditorClick?: () => void;\n}) {\n const {\n comment,\n discussionLength,\n documentContent,\n editingId,\n index,\n setEditingId,\n showDocumentContent = false,\n onEditorClick,\n } = props;\n\n const editor = useEditorRef();\n const userInfo = usePluginOption(discussionPlugin, 'user', comment.userId);\n const currentUserId = usePluginOption(discussionPlugin, 'currentUserId');\n\n const resolveDiscussion = async (id: string) => {\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .map((discussion) => {\n if (discussion.id === id) {\n return { ...discussion, isResolved: true };\n }\n return discussion;\n });\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n };\n\n const removeDiscussion = async (id: string) => {\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .filter((discussion) => discussion.id !== id);\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n };\n\n const updateComment = async (input: {\n id: string;\n contentRich: Value;\n discussionId: string;\n isEdited: boolean;\n }) => {\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .map((discussion) => {\n if (discussion.id === input.discussionId) {\n const updatedComments = discussion.comments.map((comment) => {\n if (comment.id === input.id) {\n return {\n ...comment,\n contentRich: input.contentRich,\n isEdited: true,\n updatedAt: new Date(),\n };\n }\n return comment;\n });\n return { ...discussion, comments: updatedComments };\n }\n return discussion;\n });\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n };\n\n const { tf } = useEditorPlugin(CommentPlugin);\n\n // Replace to your own backend or refer to potion\n const isMyComment = currentUserId === comment.userId;\n\n const initialValue = comment.contentRich;\n\n const commentEditor = useCommentEditor(\n {\n id: comment.id,\n value: initialValue,\n },\n [initialValue]\n );\n\n const onCancel = () => {\n setEditingId(null);\n commentEditor.tf.replaceNodes(initialValue, {\n at: [],\n children: true,\n });\n };\n\n const onSave = () => {\n void updateComment({\n id: comment.id,\n contentRich: commentEditor.children,\n discussionId: comment.discussionId,\n isEdited: true,\n });\n setEditingId(null);\n };\n\n const onResolveComment = () => {\n void resolveDiscussion(comment.discussionId);\n tf.comment.unsetMark({ id: comment.discussionId });\n };\n\n const isFirst = index === 0;\n const isLast = index === discussionLength - 1;\n const isEditing = editingId && editingId === comment.id;\n\n const [hovering, setHovering] = React.useState(false);\n const [dropdownOpen, setDropdownOpen] = React.useState(false);\n\n return (\n <div\n onMouseEnter={() => setHovering(true)}\n onMouseLeave={() => setHovering(false)}\n >\n <div className=\"relative flex items-center\">\n <Avatar className=\"size-5\">\n <AvatarImage alt={userInfo?.name} src={userInfo?.avatarUrl} />\n <AvatarFallback>{userInfo?.name?.[0]}</AvatarFallback>\n </Avatar>\n <h4 className=\"mx-2 font-semibold text-sm leading-none\">\n {/* Replace to your own backend or refer to potion */}\n {userInfo?.name}\n </h4>\n\n <div className=\"text-muted-foreground/80 text-xs leading-none\">\n <span className=\"mr-1\">\n {formatCommentDate(new Date(comment.createdAt))}\n </span>\n {comment.isEdited && <span>(edited)</span>}\n </div>\n\n {isMyComment && (hovering || dropdownOpen) && (\n <div className=\"absolute top-0 right-0 flex space-x-1\">\n {index === 0 && (\n <Button\n variant=\"ghost\"\n className=\"h-6 p-1 text-muted-foreground\"\n onClick={onResolveComment}\n type=\"button\"\n >\n <CheckIcon className=\"size-4\" />\n </Button>\n )}\n\n <CommentMoreDropdown\n onCloseAutoFocus={() => {\n setTimeout(() => {\n commentEditor.tf.focus({ edge: 'endEditor' });\n }, 0);\n }}\n onRemoveComment={() => {\n if (discussionLength === 1) {\n tf.comment.unsetMark({ id: comment.discussionId });\n void removeDiscussion(comment.discussionId);\n }\n }}\n comment={comment}\n dropdownOpen={dropdownOpen}\n setDropdownOpen={setDropdownOpen}\n setEditingId={setEditingId}\n />\n </div>\n )}\n </div>\n\n {isFirst && showDocumentContent && (\n <div className=\"relative mt-1 flex pl-[32px] text-sm text-subtle-foreground\">\n {discussionLength > 1 && (\n <div className=\"absolute top-[5px] left-3 h-full w-0.5 shrink-0 bg-muted\" />\n )}\n <div className=\"my-px w-0.5 shrink-0 bg-highlight\" />\n {documentContent && <div className=\"ml-2\">{documentContent}</div>}\n </div>\n )}\n\n <div className=\"relative my-1 pl-[26px]\">\n {!isLast && (\n <div className=\"absolute top-0 left-3 h-full w-0.5 shrink-0 bg-muted\" />\n )}\n <Plate readOnly={!isEditing} editor={commentEditor}>\n <EditorContainer variant=\"comment\">\n <Editor\n variant=\"comment\"\n className=\"w-auto grow\"\n onClick={() => onEditorClick?.()}\n />\n\n {isEditing && (\n <div className=\"ml-auto flex shrink-0 gap-1\">\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-[28px]\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n void onCancel();\n }}\n >\n <div className=\"flex size-5 shrink-0 items-center justify-center rounded-[50%] bg-primary/40\">\n <XIcon className=\"size-3 stroke-[3px] text-background\" />\n </div>\n </Button>\n\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n void onSave();\n }}\n >\n <div className=\"flex size-5 shrink-0 items-center justify-center rounded-[50%] bg-brand\">\n <CheckIcon className=\"size-3 stroke-[3px] text-background\" />\n </div>\n </Button>\n </div>\n )}\n </EditorContainer>\n </Plate>\n </div>\n </div>\n );\n}\n\nfunction CommentMoreDropdown(props: {\n comment: TComment;\n dropdownOpen: boolean;\n setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;\n setEditingId: React.Dispatch<React.SetStateAction<string | null>>;\n onCloseAutoFocus?: () => void;\n onRemoveComment?: () => void;\n}) {\n const {\n comment,\n dropdownOpen,\n setDropdownOpen,\n setEditingId,\n onCloseAutoFocus,\n onRemoveComment,\n } = props;\n\n const editor = useEditorRef();\n\n const selectedEditCommentRef = React.useRef<boolean>(false);\n\n const onDeleteComment = React.useCallback(() => {\n if (!comment.id)\n return alert('You are operating too quickly, please try again later.');\n\n // Find and update the discussion\n const updatedDiscussions = editor\n .getOption(discussionPlugin, 'discussions')\n .map((discussion) => {\n if (discussion.id !== comment.discussionId) {\n return discussion;\n }\n\n const commentIndex = discussion.comments.findIndex(\n (c) => c.id === comment.id\n );\n if (commentIndex === -1) {\n return discussion;\n }\n\n return {\n ...discussion,\n comments: [\n ...discussion.comments.slice(0, commentIndex),\n ...discussion.comments.slice(commentIndex + 1),\n ],\n };\n });\n\n // Save back to session storage\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n onRemoveComment?.();\n }, [comment.discussionId, comment.id, editor, onRemoveComment]);\n\n const onEditComment = React.useCallback(() => {\n selectedEditCommentRef.current = true;\n\n if (!comment.id)\n return alert('You are operating too quickly, please try again later.');\n\n setEditingId(comment.id);\n }, [comment.id, setEditingId]);\n\n return (\n <DropdownMenu\n open={dropdownOpen}\n onOpenChange={setDropdownOpen}\n modal={false}\n >\n <DropdownMenuTrigger asChild onClick={(e) => e.stopPropagation()}>\n <Button variant=\"ghost\" className={cn('h-6 p-1 text-muted-foreground')}>\n <MoreHorizontalIcon className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-48\"\n onCloseAutoFocus={(e) => {\n if (selectedEditCommentRef.current) {\n onCloseAutoFocus?.();\n selectedEditCommentRef.current = false;\n }\n\n return e.preventDefault();\n }}\n >\n <DropdownMenuGroup>\n <DropdownMenuItem onClick={onEditComment}>\n <PencilIcon className=\"size-4\" />\n Edit comment\n </DropdownMenuItem>\n <DropdownMenuItem onClick={onDeleteComment}>\n <TrashIcon className=\"size-4\" />\n Delete comment\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nconst useCommentEditor = (\n options: Omit<CreatePlateEditorOptions, 'plugins'> = {},\n deps: any[] = []\n) => {\n const commentEditor = usePlateEditor(\n {\n id: 'comment',\n plugins: BasicMarksKit,\n value: [],\n ...options,\n },\n deps\n );\n\n return commentEditor;\n};\n\nexport function CommentCreateForm({\n autoFocus = false,\n className,\n discussionId: discussionIdProp,\n focusOnMount = false,\n}: {\n autoFocus?: boolean;\n className?: string;\n discussionId?: string;\n focusOnMount?: boolean;\n}) {\n const discussions = usePluginOption(discussionPlugin, 'discussions');\n\n const editor = useEditorRef();\n const commentId = useCommentId();\n const discussionId = discussionIdProp ?? commentId;\n\n const userInfo = usePluginOption(discussionPlugin, 'currentUser');\n const [commentValue, setCommentValue] = React.useState<Value | undefined>();\n const commentContent = React.useMemo(\n () =>\n commentValue\n ? NodeApi.string({ children: commentValue, type: KEYS.p })\n : '',\n [commentValue]\n );\n const commentEditor = useCommentEditor();\n\n React.useEffect(() => {\n if (commentEditor && focusOnMount) {\n commentEditor.tf.focus();\n }\n }, [commentEditor, focusOnMount]);\n\n const onAddComment = React.useCallback(async () => {\n if (!commentValue) return;\n\n commentEditor.tf.reset();\n\n if (discussionId) {\n // Get existing discussion\n const discussion = discussions.find((d) => d.id === discussionId);\n if (!discussion) {\n // Mock creating suggestion\n const newDiscussion: TDiscussion = {\n id: discussionId,\n comments: [\n {\n id: nanoid(),\n contentRich: commentValue,\n createdAt: new Date(),\n discussionId,\n isEdited: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n },\n ],\n createdAt: new Date(),\n isResolved: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n };\n\n editor.setOption(discussionPlugin, 'discussions', [\n ...discussions,\n newDiscussion,\n ]);\n return;\n }\n\n // Create reply comment\n const comment: TComment = {\n id: nanoid(),\n contentRich: commentValue,\n createdAt: new Date(),\n discussionId,\n isEdited: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n };\n\n // Add reply to discussion comments\n const updatedDiscussion = {\n ...discussion,\n comments: [...discussion.comments, comment],\n };\n\n // Filter out old discussion and add updated one\n const updatedDiscussions = discussions\n .filter((d) => d.id !== discussionId)\n .concat(updatedDiscussion);\n\n editor.setOption(discussionPlugin, 'discussions', updatedDiscussions);\n\n return;\n }\n\n const commentsNodeEntry = editor\n .getApi(CommentPlugin)\n .comment.nodes({ at: [], isDraft: true });\n\n if (commentsNodeEntry.length === 0) return;\n\n const documentContent = commentsNodeEntry\n .map(([node]) => node.text)\n .join('');\n\n const _discussionId = nanoid();\n // Mock creating new discussion\n const newDiscussion: TDiscussion = {\n id: _discussionId,\n comments: [\n {\n id: nanoid(),\n contentRich: commentValue,\n createdAt: new Date(),\n discussionId: _discussionId,\n isEdited: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n },\n ],\n createdAt: new Date(),\n documentContent,\n isResolved: false,\n userId: editor.getOption(discussionPlugin, 'currentUserId'),\n };\n\n editor.setOption(discussionPlugin, 'discussions', [\n ...discussions,\n newDiscussion,\n ]);\n\n const id = newDiscussion.id;\n\n commentsNodeEntry.forEach(([, path]) => {\n editor.tf.setNodes(\n {\n [getCommentKey(id)]: true,\n },\n { at: path, split: true }\n );\n editor.tf.unsetNodes([getDraftCommentKey()], { at: path });\n });\n }, [commentValue, commentEditor.tf, discussionId, editor, discussions]);\n\n return (\n <div className={cn('flex w-full', className)}>\n <div className=\"mt-2 mr-1 shrink-0\">\n {/* Replace to your own backend or refer to potion */}\n <Avatar className=\"size-5\">\n <AvatarImage alt={userInfo?.name} src={userInfo?.avatarUrl} />\n <AvatarFallback>{userInfo?.name?.[0]}</AvatarFallback>\n </Avatar>\n </div>\n\n <div className=\"relative flex grow gap-2\">\n <Plate\n onChange={({ value }) => {\n setCommentValue(value);\n }}\n editor={commentEditor}\n >\n <EditorContainer variant=\"comment\">\n <Editor\n variant=\"comment\"\n className=\"min-h-[25px] grow pt-0.5 pr-8\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n onAddComment();\n }\n }}\n placeholder=\"Reply...\"\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"absolute right-0.5 bottom-0.5 ml-auto size-6 shrink-0\"\n disabled={commentContent.trim().length === 0}\n onClick={(e) => {\n e.stopPropagation();\n onAddComment();\n }}\n >\n <div className=\"flex size-6 items-center justify-center rounded-full\">\n <ArrowUpIcon />\n </div>\n </Button>\n </EditorContainer>\n </Plate>\n </div>\n </div>\n );\n}\n\nexport const formatCommentDate = (date: Date) => {\n const now = new Date();\n const diffMinutes = differenceInMinutes(now, date);\n const diffHours = differenceInHours(now, date);\n const diffDays = differenceInDays(now, date);\n\n if (diffMinutes < 60) {\n return `${diffMinutes}m`;\n }\n if (diffHours < 24) {\n return `${diffHours}h`;\n }\n if (diffDays < 2) {\n return `${diffDays}d`;\n }\n\n return format(date, 'MM/dd/yyyy');\n};\n","'use client';\n\nimport * as React from 'react';\n\nimport type { TResolvedSuggestion } from '@platejs/suggestion';\n\nimport {\n acceptSuggestion,\n getSuggestionKey,\n keyId2SuggestionId,\n rejectSuggestion,\n} from '@platejs/suggestion';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport { CheckIcon, XIcon } from 'lucide-react';\nimport {\n type NodeEntry,\n type Path,\n type TElement,\n type TSuggestionText,\n ElementApi,\n KEYS,\n PathApi,\n TextApi,\n} from 'platejs';\nimport { useEditorPlugin, usePluginOption } from 'platejs/react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';\nimport { Button } from '@/components/ui/button';\nimport {\n type TDiscussion,\n discussionPlugin,\n} from '@/components/editor/plugins/discussion-kit';\nimport { suggestionPlugin } from '@/components/editor/plugins/suggestion-kit';\n\nimport {\n type TComment,\n Comment,\n CommentCreateForm,\n formatCommentDate,\n} from './comment';\n\nexport interface ResolvedSuggestion extends TResolvedSuggestion {\n comments: TComment[];\n}\n\nconst BLOCK_SUGGESTION = '__block__';\n\nconst TYPE_TEXT_MAP: Record<string, (node?: TElement) => string> = {\n [KEYS.audio]: () => 'Audio',\n [KEYS.blockquote]: () => 'Blockquote',\n [KEYS.callout]: () => 'Callout',\n [KEYS.codeBlock]: () => 'Code Block',\n [KEYS.column]: () => 'Column',\n [KEYS.equation]: () => 'Equation',\n [KEYS.file]: () => 'File',\n [KEYS.h1]: () => 'Heading 1',\n [KEYS.h2]: () => 'Heading 2',\n [KEYS.h3]: () => 'Heading 3',\n [KEYS.h4]: () => 'Heading 4',\n [KEYS.h5]: () => 'Heading 5',\n [KEYS.h6]: () => 'Heading 6',\n [KEYS.hr]: () => 'Horizontal Rule',\n [KEYS.img]: () => 'Image',\n [KEYS.mediaEmbed]: () => 'Media',\n [KEYS.p]: (node) => {\n if (node?.[KEYS.listType] === KEYS.listTodo) return 'Todo List';\n if (node?.[KEYS.listType] === KEYS.ol) return 'Ordered List';\n if (node?.[KEYS.listType] === KEYS.ul) return 'List';\n\n return 'Paragraph';\n },\n [KEYS.table]: () => 'Table',\n [KEYS.toc]: () => 'Table of Contents',\n [KEYS.toggle]: () => 'Toggle',\n [KEYS.video]: () => 'Video',\n};\n\nexport function BlockSuggestionCard({\n idx,\n isLast,\n suggestion,\n}: {\n idx: number;\n isLast: boolean;\n suggestion: ResolvedSuggestion;\n}) {\n const { api, editor } = useEditorPlugin(SuggestionPlugin);\n\n const userInfo = usePluginOption(discussionPlugin, 'user', suggestion.userId);\n\n const accept = (suggestion: ResolvedSuggestion) => {\n api.suggestion.withoutSuggestions(() => {\n acceptSuggestion(editor, suggestion);\n });\n };\n\n const reject = (suggestion: ResolvedSuggestion) => {\n api.suggestion.withoutSuggestions(() => {\n rejectSuggestion(editor, suggestion);\n });\n };\n\n const [hovering, setHovering] = React.useState(false);\n\n const suggestionText2Array = (text: string) => {\n if (text === BLOCK_SUGGESTION) return ['line breaks'];\n\n return text.split(BLOCK_SUGGESTION).filter(Boolean);\n };\n\n const [editingId, setEditingId] = React.useState<string | null>(null);\n\n return (\n <div\n key={`${suggestion.suggestionId}-${idx}`}\n className=\"relative\"\n onMouseEnter={() => setHovering(true)}\n onMouseLeave={() => setHovering(false)}\n >\n <div className=\"flex flex-col p-4\">\n <div className=\"relative flex items-center\">\n {/* Replace to your own backend or refer to potion */}\n <Avatar className=\"size-5\">\n <AvatarImage alt={userInfo?.name} src={userInfo?.avatarUrl} />\n <AvatarFallback>{userInfo?.name?.[0]}</AvatarFallback>\n </Avatar>\n <h4 className=\"mx-2 font-semibold text-sm leading-none\">\n {userInfo?.name}\n </h4>\n <div className=\"text-muted-foreground/80 text-xs leading-none\">\n <span className=\"mr-1\">\n {formatCommentDate(new Date(suggestion.createdAt))}\n </span>\n </div>\n </div>\n\n <div className=\"relative mt-1 mb-4 pl-[32px]\">\n <div className=\"flex flex-col gap-2\">\n {suggestion.type === 'remove' &&\n suggestionText2Array(suggestion.text!).map((text, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n <span className=\"text-muted-foreground text-sm\">Delete:</span>\n\n <span key={index} className=\"text-sm\">\n {text}\n </span>\n </div>\n ))}\n\n {suggestion.type === 'insert' &&\n suggestionText2Array(suggestion.newText!).map((text, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n <span className=\"text-muted-foreground text-sm\">Add:</span>\n\n <span key={index} className=\"text-sm\">\n {text || 'line breaks'}\n </span>\n </div>\n ))}\n\n {suggestion.type === 'replace' && (\n <div className=\"flex flex-col gap-2\">\n {suggestionText2Array(suggestion.newText!).map(\n (text, index) => (\n <React.Fragment key={index}>\n <div\n key={index}\n className=\"flex items-start gap-2 text-brand/80\"\n >\n <span className=\"text-sm\">with:</span>\n <span className=\"text-sm\">{text || 'line breaks'}</span>\n </div>\n </React.Fragment>\n )\n )}\n\n {suggestionText2Array(suggestion.text!).map((text, index) => (\n <React.Fragment key={index}>\n <div key={index} className=\"flex items-start gap-2\">\n <span className=\"text-muted-foreground text-sm\">\n {index === 0 ? 'Replace:' : 'Delete:'}\n </span>\n <span className=\"text-sm\">{text || 'line breaks'}</span>\n </div>\n </React.Fragment>\n ))}\n </div>\n )}\n\n {suggestion.type === 'update' && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-muted-foreground text-sm\">\n {Object.keys(suggestion.properties).map((key) => (\n <span key={key}>Un{key}</span>\n ))}\n\n {Object.keys(suggestion.newProperties).map((key) => (\n <span key={key}>\n {key.charAt(0).toUpperCase() + key.slice(1)}\n </span>\n ))}\n </span>\n <span className=\"text-sm\">{suggestion.newText}</span>\n </div>\n )}\n </div>\n </div>\n\n {suggestion.comments.map((comment, index) => (\n <Comment\n key={comment.id ?? index}\n comment={comment}\n discussionLength={suggestion.comments.length}\n documentContent=\"__suggestion__\"\n editingId={editingId}\n index={index}\n setEditingId={setEditingId}\n />\n ))}\n\n {hovering && (\n <div className=\"absolute top-4 right-4 flex gap-2\">\n <Button\n variant=\"ghost\"\n className=\"size-6 p-1 text-muted-foreground\"\n onClick={() => accept(suggestion)}\n >\n <CheckIcon className=\"size-4\" />\n </Button>\n\n <Button\n variant=\"ghost\"\n className=\"size-6 p-1 text-muted-foreground\"\n onClick={() => reject(suggestion)}\n >\n <XIcon className=\"size-4\" />\n </Button>\n </div>\n )}\n\n <CommentCreateForm discussionId={suggestion.suggestionId} />\n </div>\n\n {!isLast && <div className=\"h-px w-full bg-muted\" />}\n </div>\n );\n}\n\nexport const useResolveSuggestion = (\n suggestionNodes: NodeEntry<TElement | TSuggestionText>[],\n blockPath: Path\n) => {\n const discussions = usePluginOption(discussionPlugin, 'discussions');\n\n const { api, editor, getOption, setOption } =\n useEditorPlugin(suggestionPlugin);\n\n suggestionNodes.forEach(([node]) => {\n const id = api.suggestion.nodeId(node);\n const map = getOption('uniquePathMap');\n\n if (!id) return;\n\n const previousPath = map.get(id);\n\n // If there are no suggestion nodes in the corresponding path in the map, then update it.\n if (PathApi.isPath(previousPath)) {\n const nodes = api.suggestion.node({ id, at: previousPath, isText: true });\n const parentNode = api.node(previousPath);\n let lineBreakId: string | null = null;\n\n if (parentNode && ElementApi.isElement(parentNode[0])) {\n lineBreakId = api.suggestion.nodeId(parentNode[0]) ?? null;\n }\n\n if (!nodes && lineBreakId !== id) {\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n }\n } else {\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n }\n });\n\n const resolvedSuggestion: ResolvedSuggestion[] = React.useMemo(() => {\n const map = getOption('uniquePathMap');\n\n if (suggestionNodes.length === 0) return [];\n\n const suggestionIds = new Set(\n suggestionNodes\n .flatMap(([node]) => {\n if (TextApi.isText(node)) {\n const dataList = api.suggestion.dataList(node);\n const includeUpdate = dataList.some(\n (data) => data.type === 'update'\n );\n\n if (!includeUpdate) {\n return api.suggestion.nodeId(node) ?? [];\n }\n\n return dataList\n .filter((data) => data.type === 'update')\n .map((d) => d.id);\n }\n if (ElementApi.isElement(node)) {\n return api.suggestion.nodeId(node) ?? [];\n }\n\n return [];\n })\n .filter(Boolean)\n );\n\n const res: ResolvedSuggestion[] = [];\n\n suggestionIds.forEach((id) => {\n if (!id) return;\n\n const path = map.get(id);\n\n if (!path || !PathApi.isPath(path)) return;\n if (!PathApi.equals(path, blockPath)) return;\n\n const entries = [\n ...editor.api.nodes<TElement | TSuggestionText>({\n at: [],\n mode: 'all',\n match: (n) =>\n (n[KEYS.suggestion] && n[getSuggestionKey(id)]) ||\n api.suggestion.nodeId(n as TElement) === id,\n }),\n ];\n\n // move line break to the end\n entries.sort(([, path1], [, path2]) =>\n PathApi.isChild(path1, path2) ? -1 : 1\n );\n\n let newText = '';\n let text = '';\n let properties: any = {};\n let newProperties: any = {};\n\n // overlapping suggestion\n entries.forEach(([node]) => {\n if (TextApi.isText(node)) {\n const dataList = api.suggestion.dataList(node);\n\n dataList.forEach((data) => {\n if (data.id === id) {\n switch (data.type) {\n case 'insert': {\n newText += node.text;\n\n break;\n }\n case 'remove': {\n text += node.text;\n\n break;\n }\n case 'update': {\n properties = {\n ...properties,\n ...data.properties,\n };\n\n newProperties = {\n ...newProperties,\n ...data.newProperties,\n };\n\n newText += node.text;\n\n break;\n }\n // No default\n }\n }\n });\n } else {\n const lineBreakData = api.suggestion.isBlockSuggestion(node)\n ? node.suggestion\n : undefined;\n\n if (lineBreakData?.id === keyId2SuggestionId(id)) {\n if (lineBreakData.type === 'insert') {\n newText += lineBreakData.isLineBreak\n ? BLOCK_SUGGESTION\n : BLOCK_SUGGESTION + TYPE_TEXT_MAP[node.type](node);\n } else if (lineBreakData.type === 'remove') {\n text += lineBreakData.isLineBreak\n ? BLOCK_SUGGESTION\n : BLOCK_SUGGESTION + TYPE_TEXT_MAP[node.type](node);\n }\n }\n }\n });\n\n if (entries.length === 0) return;\n\n const nodeData = api.suggestion.suggestionData(entries[0][0]);\n\n if (!nodeData) return;\n\n // const comments = data?.discussions.find((d) => d.id === id)?.comments;\n const comments =\n discussions.find((s: TDiscussion) => s.id === id)?.comments || [];\n const createdAt = new Date(nodeData.createdAt);\n\n const keyId = getSuggestionKey(id);\n\n if (nodeData.type === 'update') {\n res.push({\n comments,\n createdAt,\n keyId,\n newProperties,\n newText,\n properties,\n suggestionId: keyId2SuggestionId(id),\n type: 'update',\n userId: nodeData.userId,\n });\n } else if (newText.length > 0 && text.length > 0) {\n res.push({\n comments,\n createdAt,\n keyId,\n newText,\n suggestionId: keyId2SuggestionId(id),\n text,\n type: 'replace',\n userId: nodeData.userId,\n });\n } else if (newText.length > 0) {\n res.push({\n comments,\n createdAt,\n keyId,\n newText,\n suggestionId: keyId2SuggestionId(id),\n type: 'insert',\n userId: nodeData.userId,\n });\n } else if (text.length > 0) {\n res.push({\n comments,\n createdAt,\n keyId,\n suggestionId: keyId2SuggestionId(id),\n text,\n type: 'remove',\n userId: nodeData.userId,\n });\n }\n });\n\n return res;\n }, [\n api.suggestion,\n blockPath,\n discussions,\n editor.api,\n getOption,\n suggestionNodes,\n ]);\n\n return resolvedSuggestion;\n};\n\nexport const isResolvedSuggestion = (\n suggestion: ResolvedSuggestion | TDiscussion\n): suggestion is ResolvedSuggestion => 'suggestionId' in suggestion;\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps, RenderNodeWrapper } from 'platejs/react';\n\nimport { getDraftCommentKey } from '@platejs/comment';\nimport { CommentPlugin } from '@platejs/comment/react';\nimport { getTransientSuggestionKey } from '@platejs/suggestion';\nimport { SuggestionPlugin } from '@platejs/suggestion/react';\nimport {\n MessageSquareTextIcon,\n MessagesSquareIcon,\n PencilLineIcon,\n} from 'lucide-react';\nimport {\n type AnyPluginConfig,\n type NodeEntry,\n type Path,\n type TCommentText,\n type TElement,\n type TSuggestionText,\n PathApi,\n TextApi,\n} from 'platejs';\nimport { useEditorPlugin, useEditorRef, usePluginOption } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/ui/popover';\nimport { commentPlugin } from '@/components/editor/plugins/comment-kit';\nimport {\n type TDiscussion,\n discussionPlugin,\n} from '@/components/editor/plugins/discussion-kit';\nimport { suggestionPlugin } from '@/components/editor/plugins/suggestion-kit';\n\nimport {\n BlockSuggestionCard,\n isResolvedSuggestion,\n useResolveSuggestion,\n} from './block-suggestion';\nimport { Comment, CommentCreateForm } from './comment';\n\nexport const BlockDiscussion: RenderNodeWrapper<AnyPluginConfig> = (props) => {\n const { editor, element } = props;\n\n const commentsApi = editor.getApi(CommentPlugin).comment;\n const blockPath = editor.api.findPath(element);\n\n // avoid duplicate in table or column\n if (!blockPath || blockPath.length > 1) return;\n\n const draftCommentNode = commentsApi.node({ at: blockPath, isDraft: true });\n\n const commentNodes = [...commentsApi.nodes({ at: blockPath })];\n\n const suggestionNodes = [\n ...editor.getApi(SuggestionPlugin).suggestion.nodes({ at: blockPath }),\n ].filter(([node]) => !node[getTransientSuggestionKey()]);\n\n if (\n commentNodes.length === 0 &&\n suggestionNodes.length === 0 &&\n !draftCommentNode\n ) {\n return;\n }\n\n return (props) => (\n <BlockCommentContent\n blockPath={blockPath}\n commentNodes={commentNodes}\n draftCommentNode={draftCommentNode}\n suggestionNodes={suggestionNodes}\n {...props}\n />\n );\n};\n\nconst BlockCommentContent = ({\n blockPath,\n children,\n commentNodes,\n draftCommentNode,\n suggestionNodes,\n}: PlateElementProps & {\n blockPath: Path;\n commentNodes: NodeEntry<TCommentText>[];\n draftCommentNode: NodeEntry<TCommentText> | undefined;\n suggestionNodes: NodeEntry<TElement | TSuggestionText>[];\n}) => {\n const editor = useEditorRef();\n const resolvedSuggestions = useResolveSuggestion(suggestionNodes, blockPath);\n const resolvedDiscussions = useResolvedDiscussion(commentNodes, blockPath);\n\n const suggestionsCount = resolvedSuggestions.length;\n const discussionsCount = resolvedDiscussions.length;\n const totalCount = suggestionsCount + discussionsCount;\n\n const activeSuggestionId = usePluginOption(suggestionPlugin, 'activeId');\n const activeSuggestion =\n activeSuggestionId &&\n resolvedSuggestions.find((s) => s.suggestionId === activeSuggestionId);\n\n const commentingBlock = usePluginOption(commentPlugin, 'commentingBlock');\n const activeCommentId = usePluginOption(commentPlugin, 'activeId');\n const isCommenting = activeCommentId === getDraftCommentKey();\n const activeDiscussion =\n activeCommentId &&\n resolvedDiscussions.find((d) => d.id === activeCommentId);\n\n const noneActive = !activeSuggestion && !activeDiscussion;\n\n const sortedMergedData = [\n ...resolvedDiscussions,\n ...resolvedSuggestions,\n ].sort((a, b) => a.createdAt.getTime() - b.createdAt.getTime());\n\n const selected =\n resolvedDiscussions.some((d) => d.id === activeCommentId) ||\n resolvedSuggestions.some((s) => s.suggestionId === activeSuggestionId);\n\n const [_open, setOpen] = React.useState(selected);\n\n // in some cases, we may comment the multiple blocks\n const commentingCurrent =\n !!commentingBlock && PathApi.equals(blockPath, commentingBlock);\n\n const open =\n _open ||\n selected ||\n (isCommenting && !!draftCommentNode && commentingCurrent);\n\n const anchorElement = React.useMemo(() => {\n let activeNode: NodeEntry | undefined;\n\n if (activeSuggestion) {\n activeNode = suggestionNodes.find(\n ([node]) =>\n TextApi.isText(node) &&\n editor.getApi(SuggestionPlugin).suggestion.nodeId(node) ===\n activeSuggestion.suggestionId\n );\n }\n\n if (activeCommentId) {\n if (activeCommentId === getDraftCommentKey()) {\n activeNode = draftCommentNode;\n } else {\n activeNode = commentNodes.find(\n ([node]) =>\n editor.getApi(commentPlugin).comment.nodeId(node) ===\n activeCommentId\n );\n }\n }\n\n if (!activeNode) return null;\n\n return editor.api.toDOMNode(activeNode[0])!;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open,\n activeSuggestion,\n activeCommentId,\n editor.api,\n suggestionNodes,\n draftCommentNode,\n commentNodes,\n ]);\n\n if (suggestionsCount + resolvedDiscussions.length === 0 && !draftCommentNode)\n return <div className=\"w-full\">{children}</div>;\n\n return (\n <div className=\"flex w-full justify-between\">\n <Popover\n open={open}\n onOpenChange={(_open_) => {\n if (!_open_ && isCommenting && draftCommentNode) {\n editor.tf.unsetNodes(getDraftCommentKey(), {\n at: [],\n mode: 'lowest',\n match: (n) => n[getDraftCommentKey()],\n });\n }\n setOpen(_open_);\n }}\n >\n <div className=\"w-full\">{children}</div>\n {anchorElement && (\n <PopoverAnchor\n asChild\n className=\"w-full\"\n virtualRef={{ current: anchorElement }}\n />\n )}\n\n <PopoverContent\n className=\"max-h-[min(50dvh,calc(-24px+var(--radix-popper-available-height)))] w-[380px] min-w-[130px] max-w-[calc(100vw-24px)] overflow-y-auto p-0 data-[state=closed]:opacity-0\"\n onCloseAutoFocus={(e) => e.preventDefault()}\n onOpenAutoFocus={(e) => e.preventDefault()}\n align=\"center\"\n side=\"bottom\"\n >\n {isCommenting ? (\n <CommentCreateForm className=\"p-4\" focusOnMount />\n ) : noneActive ? (\n sortedMergedData.map((item, index) =>\n isResolvedSuggestion(item) ? (\n <BlockSuggestionCard\n key={item.suggestionId}\n idx={index}\n isLast={index === sortedMergedData.length - 1}\n suggestion={item}\n />\n ) : (\n <BlockComment\n key={item.id}\n discussion={item}\n isLast={index === sortedMergedData.length - 1}\n />\n )\n )\n ) : (\n <>\n {activeSuggestion && (\n <BlockSuggestionCard\n key={activeSuggestion.suggestionId}\n idx={0}\n isLast={true}\n suggestion={activeSuggestion}\n />\n )}\n\n {activeDiscussion && (\n <BlockComment discussion={activeDiscussion} isLast={true} />\n )}\n </>\n )}\n </PopoverContent>\n\n {totalCount > 0 && (\n <div className=\"relative left-0 size-0 select-none\">\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n className=\"!px-1.5 mt-1 ml-1 flex h-6 gap-1 py-0 text-muted-foreground/80 hover:text-muted-foreground/80 data-[active=true]:bg-muted\"\n data-active={open}\n contentEditable={false}\n >\n {suggestionsCount > 0 && discussionsCount === 0 && (\n <PencilLineIcon className=\"size-4 shrink-0\" />\n )}\n\n {suggestionsCount === 0 && discussionsCount > 0 && (\n <MessageSquareTextIcon className=\"size-4 shrink-0\" />\n )}\n\n {suggestionsCount > 0 && discussionsCount > 0 && (\n <MessagesSquareIcon className=\"size-4 shrink-0\" />\n )}\n\n <span className=\"font-semibold text-xs\">{totalCount}</span>\n </Button>\n </PopoverTrigger>\n </div>\n )}\n </Popover>\n </div>\n );\n};\n\nfunction BlockComment({\n discussion,\n isLast,\n}: {\n discussion: TDiscussion;\n isLast: boolean;\n}) {\n const [editingId, setEditingId] = React.useState<string | null>(null);\n\n return (\n <React.Fragment key={discussion.id}>\n <div className=\"p-4\">\n {discussion.comments.map((comment, index) => (\n <Comment\n key={comment.id ?? index}\n comment={comment}\n discussionLength={discussion.comments.length}\n documentContent={discussion?.documentContent}\n editingId={editingId}\n index={index}\n setEditingId={setEditingId}\n showDocumentContent\n />\n ))}\n <CommentCreateForm discussionId={discussion.id} />\n </div>\n\n {!isLast && <div className=\"h-px w-full bg-muted\" />}\n </React.Fragment>\n );\n}\n\nconst useResolvedDiscussion = (\n commentNodes: NodeEntry<TCommentText>[],\n blockPath: Path\n) => {\n const { api, getOption, setOption } = useEditorPlugin(commentPlugin);\n\n const discussions = usePluginOption(discussionPlugin, 'discussions');\n\n commentNodes.forEach(([node]) => {\n const id = api.comment.nodeId(node);\n const map = getOption('uniquePathMap');\n\n if (!id) return;\n\n const previousPath = map.get(id);\n\n // If there are no comment nodes in the corresponding path in the map, then update it.\n if (PathApi.isPath(previousPath)) {\n const nodes = api.comment.node({ id, at: previousPath });\n\n if (!nodes) {\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n return;\n }\n\n return;\n }\n // TODO: fix throw error\n setOption('uniquePathMap', new Map(map).set(id, blockPath));\n });\n\n const commentsIds = new Set(\n commentNodes.map(([node]) => api.comment.nodeId(node)).filter(Boolean)\n );\n\n const resolvedDiscussions = discussions\n .map((d: TDiscussion) => ({\n ...d,\n createdAt: new Date(d.createdAt),\n }))\n .filter((item: TDiscussion) => {\n /** If comment cross blocks just show it in the first block */\n const commentsPathMap = getOption('uniquePathMap');\n const firstBlockPath = commentsPathMap.get(item.id);\n\n if (!firstBlockPath) return false;\n if (!PathApi.equals(firstBlockPath, blockPath)) return false;\n\n return (\n api.comment.has({ id: item.id }) &&\n commentsIds.has(item.id) &&\n !item.isResolved\n );\n });\n\n return resolvedDiscussions;\n};\n","'use client';\n\nimport type { TComment } from '@/components/ui/comment';\n\nimport { createPlatePlugin } from 'platejs/react';\n\nimport { BlockDiscussion } from '@/components/ui/block-discussion';\n\nexport type TDiscussion = {\n id: string;\n comments: TComment[];\n createdAt: Date;\n isResolved: boolean;\n userId: string;\n documentContent?: string;\n};\n\nconst discussionsData: TDiscussion[] = [\n {\n id: 'discussion1',\n comments: [\n {\n id: 'comment1',\n contentRich: [\n {\n children: [\n {\n text: 'Comments are a great way to provide feedback and discuss changes.',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 600_000),\n discussionId: 'discussion1',\n isEdited: false,\n userId: 'charlie',\n },\n {\n id: 'comment2',\n contentRich: [\n {\n children: [\n {\n text: 'Agreed! The link to the docs makes it easy to learn more.',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 500_000),\n discussionId: 'discussion1',\n isEdited: false,\n userId: 'bob',\n },\n ],\n createdAt: new Date(),\n documentContent: 'comments',\n isResolved: false,\n userId: 'charlie',\n },\n {\n id: 'discussion2',\n comments: [\n {\n id: 'comment1',\n contentRich: [\n {\n children: [\n {\n text: 'Nice demonstration of overlapping annotations with both comments and suggestions!',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 300_000),\n discussionId: 'discussion2',\n isEdited: false,\n userId: 'bob',\n },\n {\n id: 'comment2',\n contentRich: [\n {\n children: [\n {\n text: 'This helps users understand how powerful the editor can be.',\n },\n ],\n type: 'p',\n },\n ],\n createdAt: new Date(Date.now() - 200_000),\n discussionId: 'discussion2',\n isEdited: false,\n userId: 'charlie',\n },\n ],\n createdAt: new Date(),\n documentContent: 'overlapping',\n isResolved: false,\n userId: 'bob',\n },\n];\n\nconst avatarUrl = (seed: string) =>\n `https://api.dicebear.com/9.x/glass/svg?seed=${seed}`;\n\nconst usersData: Record<\n string,\n { id: string; avatarUrl: string; name: string; hue?: number }\n> = {\n alice: {\n id: 'alice',\n avatarUrl: avatarUrl('alice6'),\n name: 'Alice',\n },\n bob: {\n id: 'bob',\n avatarUrl: avatarUrl('bob4'),\n name: 'Bob',\n },\n charlie: {\n id: 'charlie',\n avatarUrl: avatarUrl('charlie2'),\n name: 'Charlie',\n },\n};\n\n// This plugin is purely UI. It's only used to store the discussions and users data\nexport const discussionPlugin = createPlatePlugin({\n key: 'discussion',\n options: {\n currentUserId: 'alice',\n discussions: discussionsData,\n users: usersData,\n },\n})\n .configure({\n render: { aboveNodes: BlockDiscussion },\n })\n .extendSelectors(({ getOption }) => ({\n currentUser: () => getOption('users')[getOption('currentUserId')],\n user: (id: string) => getOption('users')[id],\n }));\n\nexport const DiscussionKit = [discussionPlugin];\n","'use client';\n\nimport type { ExtendConfig, Path } from 'platejs';\n\nimport {\n type BaseSuggestionConfig,\n BaseSuggestionPlugin,\n} from '@platejs/suggestion';\nimport { isSlateEditor, isSlateString } from 'platejs';\nimport { toTPlatePlugin } from 'platejs/react';\n\nimport {\n SuggestionLeaf,\n SuggestionLineBreak,\n} from '@/components/ui/suggestion-node';\n\nimport { discussionPlugin } from './discussion-kit';\n\nexport type SuggestionConfig = ExtendConfig<\n BaseSuggestionConfig,\n {\n activeId: string | null;\n hoverId: string | null;\n uniquePathMap: Map<string, Path>;\n }\n>;\n\nexport const suggestionPlugin = toTPlatePlugin<SuggestionConfig>(\n BaseSuggestionPlugin,\n ({ editor }) => ({\n options: {\n activeId: null,\n currentUserId: editor.getOption(discussionPlugin, 'currentUserId'),\n hoverId: null,\n uniquePathMap: new Map(),\n },\n })\n).configure({\n handlers: {\n // unset active suggestion when clicking outside of suggestion\n onClick: ({ api, event, setOption, type }) => {\n let leaf = event.target as HTMLElement;\n let isSet = false;\n\n const isBlockLeaf = leaf.dataset.blockSuggestion === 'true';\n\n const unsetActiveSuggestion = () => {\n setOption('activeId', null);\n isSet = true;\n };\n\n if (!isSlateString(leaf) && !isBlockLeaf) {\n unsetActiveSuggestion();\n }\n\n while (leaf.parentElement && !isSlateEditor(leaf.parentElement)) {\n const isBlockSuggestion = leaf.dataset.blockSuggestion === 'true';\n\n if (leaf.classList.contains(`slate-${type}`) || isBlockSuggestion) {\n const suggestionEntry = api.suggestion!.node({\n isText: !isBlockSuggestion,\n });\n\n if (!suggestionEntry) {\n unsetActiveSuggestion();\n\n break;\n }\n\n const id = api.suggestion!.nodeId(suggestionEntry[0]);\n setOption('activeId', id ?? null);\n\n isSet = true;\n\n break;\n }\n\n leaf = leaf.parentElement;\n }\n\n if (!isSet) unsetActiveSuggestion();\n },\n },\n render: {\n belowNodes: SuggestionLineBreak as any,\n node: SuggestionLeaf,\n },\n});\n\nexport const SuggestionKit = [suggestionPlugin];\n","'use client';\n\nimport type { LucideProps } from 'lucide-react';\n\nexport function BorderAllIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border All</title>\n <path\n clipRule=\"evenodd\"\n d=\"M0.25 1C0.25 0.585786 0.585786 0.25 1 0.25H14C14.4142 0.25 14.75 0.585786 14.75 1V14C14.75 14.4142 14.4142 14.75 14 14.75H1C0.585786 14.75 0.25 14.4142 0.25 14V1ZM1.75 1.75V13.25H13.25V1.75H1.75Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"11\" />\n </svg>\n );\n}\n\nexport function BorderBottomIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Bottom</title>\n <path\n clipRule=\"evenodd\"\n d=\"M1 13.25L14 13.25V14.75L1 14.75V13.25Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"11\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"11\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"5\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"3\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"7\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"1\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"9\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"11\" />\n </svg>\n );\n}\n\nexport function BorderLeftIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Left</title>\n <path\n clipRule=\"evenodd\"\n d=\"M1.75 1L1.75 14L0.249999 14L0.25 1L1.75 1Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 10 7)\"\n width=\"1\"\n x=\"10\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 10 13)\"\n width=\"1\"\n x=\"10\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 12 7)\"\n width=\"1\"\n x=\"12\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 12 13)\"\n width=\"1\"\n x=\"12\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 7)\"\n width=\"1\"\n x=\"8\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 7)\"\n width=\"1\"\n x=\"14\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 13)\"\n width=\"1\"\n x=\"8\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 13)\"\n width=\"1\"\n x=\"14\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 5)\"\n width=\"1\"\n x=\"8\"\n y=\"5\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 5)\"\n width=\"1\"\n x=\"14\"\n y=\"5\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 3)\"\n width=\"1\"\n x=\"8\"\n y=\"3\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 3)\"\n width=\"1\"\n x=\"14\"\n y=\"3\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 9)\"\n width=\"1\"\n x=\"8\"\n y=\"9\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 9)\"\n width=\"1\"\n x=\"14\"\n y=\"9\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 11)\"\n width=\"1\"\n x=\"8\"\n y=\"11\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 11)\"\n width=\"1\"\n x=\"14\"\n y=\"11\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 6 7)\"\n width=\"1\"\n x=\"6\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 6 13)\"\n width=\"1\"\n x=\"6\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 4 7)\"\n width=\"1\"\n x=\"4\"\n y=\"7\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 4 13)\"\n width=\"1\"\n x=\"4\"\n y=\"13\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 10 1)\"\n width=\"1\"\n x=\"10\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 12 1)\"\n width=\"1\"\n x=\"12\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 8 1)\"\n width=\"1\"\n x=\"8\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 14 1)\"\n width=\"1\"\n x=\"14\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 6 1)\"\n width=\"1\"\n x=\"6\"\n y=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(90 4 1)\"\n width=\"1\"\n x=\"4\"\n y=\"1\"\n />\n </svg>\n );\n}\n\nexport function BorderNoneIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border None</title>\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"5.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"5.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"3.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"3.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"7.025\" />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n width=\"1\"\n x=\"13\"\n y=\"13.025\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"5\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"3\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"9\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"7.025\" />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n width=\"1\"\n x=\"11\"\n y=\"13.025\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"11\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"9.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"13\" y=\"9.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"7\" y=\"11.025\" />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n width=\"1\"\n x=\"13\"\n y=\"11.025\"\n />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"5.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"3.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"7.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"13.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"1.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"9.025\" />\n <rect fill=\"currentColor\" height=\"1\" rx=\".5\" width=\"1\" x=\"1\" y=\"11.025\" />\n </svg>\n );\n}\n\nexport function BorderRightIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Right</title>\n <path\n clipRule=\"evenodd\"\n d=\"M13.25 1L13.25 14L14.75 14L14.75 1L13.25 1Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 5 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 5 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 3 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 3 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 5)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 5)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 3)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 3)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 9)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 9)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 11)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 11)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 9 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 9 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 11 7)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 11 13)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 5 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 3 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 7 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 1 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 9 1)\"\n width=\"1\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"matrix(0 1 1 0 11 1)\"\n width=\"1\"\n />\n </svg>\n );\n}\n\nexport function BorderTopIcon(props: LucideProps) {\n return (\n <svg\n fill=\"none\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n width=\"15\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>Border Top</title>\n <path\n clipRule=\"evenodd\"\n d=\"M14 1.75L1 1.75L1 0.249999L14 0.25L14 1.75Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 10)\"\n width=\"1\"\n x=\"8\"\n y=\"10\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 10)\"\n width=\"1\"\n x=\"2\"\n y=\"10\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 12)\"\n width=\"1\"\n x=\"8\"\n y=\"12\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 12)\"\n width=\"1\"\n x=\"2\"\n y=\"12\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 8)\"\n width=\"1\"\n x=\"8\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 14)\"\n width=\"1\"\n x=\"8\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 8)\"\n width=\"1\"\n x=\"2\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 14)\"\n width=\"1\"\n x=\"2\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 10 8)\"\n width=\"1\"\n x=\"10\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 10 14)\"\n width=\"1\"\n x=\"10\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 12 8)\"\n width=\"1\"\n x=\"12\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 12 14)\"\n width=\"1\"\n x=\"12\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 6 8)\"\n width=\"1\"\n x=\"6\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 6 14)\"\n width=\"1\"\n x=\"6\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 4 8)\"\n width=\"1\"\n x=\"4\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 4 14)\"\n width=\"1\"\n x=\"4\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 6)\"\n width=\"1\"\n x=\"8\"\n y=\"6\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 6)\"\n width=\"1\"\n x=\"2\"\n y=\"6\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 8 4)\"\n width=\"1\"\n x=\"8\"\n y=\"4\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 2 4)\"\n width=\"1\"\n x=\"2\"\n y=\"4\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 10)\"\n width=\"1\"\n x=\"14\"\n y=\"10\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 12)\"\n width=\"1\"\n x=\"14\"\n y=\"12\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 8)\"\n width=\"1\"\n x=\"14\"\n y=\"8\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 14)\"\n width=\"1\"\n x=\"14\"\n y=\"14\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 6)\"\n width=\"1\"\n x=\"14\"\n y=\"6\"\n />\n <rect\n fill=\"currentColor\"\n height=\"1\"\n rx=\".5\"\n transform=\"rotate(-180 14 4)\"\n width=\"1\"\n x=\"14\"\n y=\"4\"\n />\n </svg>\n );\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { useDraggable, useDropLine } from '@platejs/dnd';\nimport {\n BlockSelectionPlugin,\n useBlockSelected,\n} from '@platejs/selection/react';\nimport { setCellBackground } from '@platejs/table';\nimport {\n TablePlugin,\n TableProvider,\n useTableBordersDropdownMenuContentState,\n useTableCellElement,\n useTableCellElementResizable,\n useTableElement,\n useTableMergeState,\n} from '@platejs/table/react';\nimport { PopoverAnchor } from '@radix-ui/react-popover';\nimport { cva } from 'class-variance-authority';\nimport {\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n CombineIcon,\n EraserIcon,\n Grid2X2Icon,\n GripVertical,\n PaintBucketIcon,\n SquareSplitHorizontalIcon,\n Trash2Icon,\n XIcon,\n} from 'lucide-react';\nimport {\n type TElement,\n type TTableCellElement,\n type TTableElement,\n type TTableRowElement,\n KEYS,\n PathApi,\n} from 'platejs';\nimport {\n type PlateElementProps,\n PlateElement,\n useComposedRef,\n useEditorPlugin,\n useEditorRef,\n useEditorSelector,\n useElement,\n useFocusedLast,\n usePluginOption,\n useReadOnly,\n useRemoveNodeButton,\n useSelected,\n withHOC,\n} from 'platejs/react';\nimport { useElementSelector } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Popover, PopoverContent } from '@/components/ui/popover';\nimport { cn } from '@/lib/utils';\n\nimport { blockSelectionVariants } from './block-selection';\nimport {\n ColorDropdownMenuItems,\n DEFAULT_COLORS,\n} from './font-color-toolbar-button';\nimport { ResizeHandle } from './resize-handle';\nimport {\n BorderAllIcon,\n BorderBottomIcon,\n BorderLeftIcon,\n BorderNoneIcon,\n BorderRightIcon,\n BorderTopIcon,\n} from './table-icons';\nimport {\n Toolbar,\n ToolbarButton,\n ToolbarGroup,\n ToolbarMenuGroup,\n} from './toolbar';\nexport const TableElement = withHOC(\n TableProvider,\n function TableElement({\n children,\n ...props\n }: PlateElementProps<TTableElement>) {\n const readOnly = useReadOnly();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n const hasControls = !readOnly && !isSelectionAreaVisible;\n const {\n isSelectingCell,\n marginLeft,\n props: tableProps,\n } = useTableElement();\n\n const isSelectingTable = useBlockSelected(props.element.id as string);\n\n const content = (\n <PlateElement\n {...props}\n className={cn(\n 'overflow-x-auto py-5',\n hasControls && '-ml-2 *:data-[slot=block-selection]:left-2'\n )}\n style={{ paddingLeft: marginLeft }}\n >\n <div className=\"group/table relative w-fit\">\n <table\n className={cn(\n 'mr-0 ml-px table h-px table-fixed border-collapse',\n isSelectingCell && 'selection:bg-transparent'\n )}\n {...tableProps}\n >\n <tbody className=\"min-w-full\">{children}</tbody>\n </table>\n\n {isSelectingTable && (\n <div className={blockSelectionVariants()} contentEditable={false} />\n )}\n </div>\n </PlateElement>\n );\n\n if (readOnly) {\n return content;\n }\n\n return <TableFloatingToolbar>{content}</TableFloatingToolbar>;\n }\n);\n\nfunction TableFloatingToolbar({\n children,\n ...props\n}: React.ComponentProps<typeof PopoverContent>) {\n const { tf } = useEditorPlugin(TablePlugin);\n const selected = useSelected();\n const element = useElement<TTableElement>();\n const { props: buttonProps } = useRemoveNodeButton({ element });\n const collapsedInside = useEditorSelector(\n (editor) => selected && editor.api.isCollapsed(),\n [selected]\n );\n const isFocusedLast = useFocusedLast();\n\n const { canMerge, canSplit } = useTableMergeState();\n\n return (\n <Popover\n open={isFocusedLast && (canMerge || canSplit || collapsedInside)}\n modal={false}\n >\n <PopoverAnchor asChild>{children}</PopoverAnchor>\n <PopoverContent\n asChild\n onOpenAutoFocus={(e) => e.preventDefault()}\n contentEditable={false}\n {...props}\n >\n <Toolbar\n className=\"scrollbar-hide flex w-auto max-w-[80vw] flex-row overflow-x-auto rounded-md border bg-popover p-1 shadow-md print:hidden\"\n contentEditable={false}\n >\n <ToolbarGroup>\n <ColorDropdownMenu tooltip=\"Background color\">\n <PaintBucketIcon />\n </ColorDropdownMenu>\n {canMerge && (\n <ToolbarButton\n onClick={() => tf.table.merge()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Merge cells\"\n >\n <CombineIcon />\n </ToolbarButton>\n )}\n {canSplit && (\n <ToolbarButton\n onClick={() => tf.table.split()}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Split cell\"\n >\n <SquareSplitHorizontalIcon />\n </ToolbarButton>\n )}\n\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton tooltip=\"Cell borders\">\n <Grid2X2Icon />\n </ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuPortal>\n <TableBordersDropdownMenuContent />\n </DropdownMenuPortal>\n </DropdownMenu>\n\n {collapsedInside && (\n <ToolbarGroup>\n <ToolbarButton tooltip=\"Delete table\" {...buttonProps}>\n <Trash2Icon />\n </ToolbarButton>\n </ToolbarGroup>\n )}\n </ToolbarGroup>\n\n {collapsedInside && (\n <ToolbarGroup>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableRow({ before: true });\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert row before\"\n >\n <ArrowUp />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableRow();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert row after\"\n >\n <ArrowDown />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.remove.tableRow();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Delete row\"\n >\n <XIcon />\n </ToolbarButton>\n </ToolbarGroup>\n )}\n\n {collapsedInside && (\n <ToolbarGroup>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableColumn({ before: true });\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert column before\"\n >\n <ArrowLeft />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.insert.tableColumn();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Insert column after\"\n >\n <ArrowRight />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => {\n tf.remove.tableColumn();\n }}\n onMouseDown={(e) => e.preventDefault()}\n tooltip=\"Delete column\"\n >\n <XIcon />\n </ToolbarButton>\n </ToolbarGroup>\n )}\n </Toolbar>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction TableBordersDropdownMenuContent(\n props: React.ComponentProps<typeof DropdownMenuPrimitive.Content>\n) {\n const editor = useEditorRef();\n const {\n getOnSelectTableBorder,\n hasBottomBorder,\n hasLeftBorder,\n hasNoBorders,\n hasOuterBorders,\n hasRightBorder,\n hasTopBorder,\n } = useTableBordersDropdownMenuContentState();\n\n return (\n <DropdownMenuContent\n className=\"min-w-[220px]\"\n onCloseAutoFocus={(e) => {\n e.preventDefault();\n editor.tf.focus();\n }}\n align=\"start\"\n side=\"right\"\n sideOffset={0}\n {...props}\n >\n <DropdownMenuGroup>\n <DropdownMenuCheckboxItem\n checked={hasTopBorder}\n onCheckedChange={getOnSelectTableBorder('top')}\n >\n <BorderTopIcon />\n <div>Top Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasRightBorder}\n onCheckedChange={getOnSelectTableBorder('right')}\n >\n <BorderRightIcon />\n <div>Right Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasBottomBorder}\n onCheckedChange={getOnSelectTableBorder('bottom')}\n >\n <BorderBottomIcon />\n <div>Bottom Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasLeftBorder}\n onCheckedChange={getOnSelectTableBorder('left')}\n >\n <BorderLeftIcon />\n <div>Left Border</div>\n </DropdownMenuCheckboxItem>\n </DropdownMenuGroup>\n\n <DropdownMenuGroup>\n <DropdownMenuCheckboxItem\n checked={hasNoBorders}\n onCheckedChange={getOnSelectTableBorder('none')}\n >\n <BorderNoneIcon />\n <div>No Border</div>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={hasOuterBorders}\n onCheckedChange={getOnSelectTableBorder('outer')}\n >\n <BorderAllIcon />\n <div>Outside Borders</div>\n </DropdownMenuCheckboxItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n );\n}\n\nfunction ColorDropdownMenu({\n children,\n tooltip,\n}: {\n children: React.ReactNode;\n tooltip: string;\n}) {\n const [open, setOpen] = React.useState(false);\n\n const editor = useEditorRef();\n const selectedCells = usePluginOption(TablePlugin, 'selectedCells');\n\n const onUpdateColor = React.useCallback(\n (color: string) => {\n setOpen(false);\n setCellBackground(editor, { color, selectedCells: selectedCells ?? [] });\n },\n [selectedCells, editor]\n );\n\n const onClearColor = React.useCallback(() => {\n setOpen(false);\n setCellBackground(editor, {\n color: null,\n selectedCells: selectedCells ?? [],\n });\n }, [selectedCells, editor]);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>\n <DropdownMenuTrigger asChild>\n <ToolbarButton tooltip={tooltip}>{children}</ToolbarButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <ToolbarMenuGroup label=\"Colors\">\n <ColorDropdownMenuItems\n className=\"px-2\"\n colors={DEFAULT_COLORS}\n updateColor={onUpdateColor}\n />\n </ToolbarMenuGroup>\n <DropdownMenuGroup>\n <DropdownMenuItem className=\"p-2\" onClick={onClearColor}>\n <EraserIcon />\n <span>Clear</span>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nexport function TableRowElement({\n children,\n ...props\n}: PlateElementProps<TTableRowElement>) {\n const { element } = props;\n const readOnly = useReadOnly();\n const selected = useSelected();\n const editor = useEditorRef();\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n const hasControls = !readOnly && !isSelectionAreaVisible;\n\n const { isDragging, previewRef, handleRef } = useDraggable({\n element,\n type: element.type,\n canDropNode: ({ dragEntry, dropEntry }) =>\n PathApi.equals(\n PathApi.parent(dragEntry[1]),\n PathApi.parent(dropEntry[1])\n ),\n onDropHandler: (_, { dragItem }) => {\n const dragElement = (dragItem as { element: TElement }).element;\n\n if (dragElement) {\n editor.tf.select(dragElement);\n }\n },\n });\n\n return (\n <PlateElement\n {...props}\n ref={useComposedRef(props.ref, previewRef)}\n as=\"tr\"\n className={cn('group/row', isDragging && 'opacity-50')}\n attributes={{\n ...props.attributes,\n 'data-selected': selected ? 'true' : undefined,\n }}\n >\n {hasControls && (\n <td className=\"w-2 select-none\" contentEditable={false}>\n <RowDragHandle dragRef={handleRef} />\n <RowDropLine />\n </td>\n )}\n\n {children}\n </PlateElement>\n );\n}\n\nfunction RowDragHandle({ dragRef }: { dragRef: React.Ref<any> }) {\n const editor = useEditorRef();\n const element = useElement();\n\n return (\n <Button\n ref={dragRef}\n variant=\"outline\"\n className={cn(\n '-translate-y-1/2 absolute top-1/2 left-0 z-51 h-6 w-4 p-0 focus-visible:ring-0 focus-visible:ring-offset-0',\n 'cursor-grab active:cursor-grabbing',\n 'opacity-0 transition-opacity duration-100 group-hover/row:opacity-100 group-has-data-[resizing=\"true\"]/row:opacity-0'\n )}\n onClick={() => {\n editor.tf.select(element);\n }}\n >\n <GripVertical className=\"text-muted-foreground\" />\n </Button>\n );\n}\n\nfunction RowDropLine() {\n const { dropLine } = useDropLine();\n\n if (!dropLine) return null;\n\n return (\n <div\n className={cn(\n 'absolute inset-x-0 left-2 z-50 h-0.5 bg-brand/50',\n dropLine === 'top' ? '-top-px' : '-bottom-px'\n )}\n />\n );\n}\n\nexport function TableCellElement({\n isHeader,\n ...props\n}: PlateElementProps<TTableCellElement> & {\n isHeader?: boolean;\n}) {\n const { api } = useEditorPlugin(TablePlugin);\n const readOnly = useReadOnly();\n const element = props.element;\n\n const tableId = useElementSelector(([node]) => node.id as string, [], {\n key: KEYS.table,\n });\n const rowId = useElementSelector(([node]) => node.id as string, [], {\n key: KEYS.tr,\n });\n const isSelectingTable = useBlockSelected(tableId);\n const isSelectingRow = useBlockSelected(rowId) || isSelectingTable;\n const isSelectionAreaVisible = usePluginOption(\n BlockSelectionPlugin,\n 'isSelectionAreaVisible'\n );\n\n const { borders, colIndex, colSpan, minHeight, rowIndex, selected, width } =\n useTableCellElement();\n\n const { bottomProps, hiddenLeft, leftProps, rightProps } =\n useTableCellElementResizable({\n colIndex,\n colSpan,\n rowIndex,\n });\n\n return (\n <PlateElement\n {...props}\n as={isHeader ? 'th' : 'td'}\n className={cn(\n 'h-full overflow-visible border-none bg-background p-0',\n element.background ? 'bg-(--cellBackground)' : 'bg-background',\n isHeader && 'text-left *:m-0',\n 'before:size-full',\n selected && 'before:z-10 before:bg-brand/5',\n \"before:absolute before:box-border before:select-none before:content-['']\",\n borders.bottom?.size && 'before:border-b before:border-b-border',\n borders.right?.size && 'before:border-r before:border-r-border',\n borders.left?.size && 'before:border-l before:border-l-border',\n borders.top?.size && 'before:border-t before:border-t-border'\n )}\n style={\n {\n '--cellBackground': element.background,\n maxWidth: width || 240,\n minWidth: width || 120,\n } as React.CSSProperties\n }\n attributes={{\n ...props.attributes,\n colSpan: api.table.getColSpan(element),\n rowSpan: api.table.getRowSpan(element),\n }}\n >\n <div\n className=\"relative z-20 box-border h-full px-3 py-2\"\n style={{ minHeight }}\n >\n {props.children}\n </div>\n\n {!isSelectionAreaVisible && (\n <div\n className=\"group absolute top-0 size-full select-none\"\n contentEditable={false}\n suppressContentEditableWarning={true}\n >\n {!readOnly && (\n <>\n <ResizeHandle\n {...rightProps}\n className=\"-top-2 -right-1 h-[calc(100%_+_8px)] w-2\"\n data-col={colIndex}\n />\n <ResizeHandle {...bottomProps} className=\"-bottom-1 h-2\" />\n {!hiddenLeft && (\n <ResizeHandle\n {...leftProps}\n className=\"-left-1 top-0 w-2\"\n data-resizer-left={colIndex === 0 ? 'true' : undefined}\n />\n )}\n\n <div\n className={cn(\n 'absolute top-0 z-30 hidden h-full w-1 bg-ring',\n 'right-[-1.5px]',\n columnResizeVariants({ colIndex: colIndex as any })\n )}\n />\n {colIndex === 0 && (\n <div\n className={cn(\n 'absolute top-0 z-30 h-full w-1 bg-ring',\n 'left-[-1.5px]',\n 'fade-in hidden animate-in group-has-[[data-resizer-left]:hover]/table:block group-has-[[data-resizer-left][data-resizing=\"true\"]]/table:block'\n )}\n />\n )}\n </>\n )}\n </div>\n )}\n\n {isSelectingRow && (\n <div className={blockSelectionVariants()} contentEditable={false} />\n )}\n </PlateElement>\n );\n}\n\nexport function TableCellHeaderElement(\n props: React.ComponentProps<typeof TableCellElement>\n) {\n return <TableCellElement {...props} isHeader />;\n}\n\nconst columnResizeVariants = cva('fade-in hidden animate-in', {\n variants: {\n colIndex: {\n 0: 'group-has-[[data-col=\"0\"]:hover]/table:block group-has-[[data-col=\"0\"][data-resizing=\"true\"]]/table:block',\n 1: 'group-has-[[data-col=\"1\"]:hover]/table:block group-has-[[data-col=\"1\"][data-resizing=\"true\"]]/table:block',\n 2: 'group-has-[[data-col=\"2\"]:hover]/table:block group-has-[[data-col=\"2\"][data-resizing=\"true\"]]/table:block',\n 3: 'group-has-[[data-col=\"3\"]:hover]/table:block group-has-[[data-col=\"3\"][data-resizing=\"true\"]]/table:block',\n 4: 'group-has-[[data-col=\"4\"]:hover]/table:block group-has-[[data-col=\"4\"][data-resizing=\"true\"]]/table:block',\n 5: 'group-has-[[data-col=\"5\"]:hover]/table:block group-has-[[data-col=\"5\"][data-resizing=\"true\"]]/table:block',\n 6: 'group-has-[[data-col=\"6\"]:hover]/table:block group-has-[[data-col=\"6\"][data-resizing=\"true\"]]/table:block',\n 7: 'group-has-[[data-col=\"7\"]:hover]/table:block group-has-[[data-col=\"7\"][data-resizing=\"true\"]]/table:block',\n 8: 'group-has-[[data-col=\"8\"]:hover]/table:block group-has-[[data-col=\"8\"][data-resizing=\"true\"]]/table:block',\n 9: 'group-has-[[data-col=\"9\"]:hover]/table:block group-has-[[data-col=\"9\"][data-resizing=\"true\"]]/table:block',\n 10: 'group-has-[[data-col=\"10\"]:hover]/table:block group-has-[[data-col=\"10\"][data-resizing=\"true\"]]/table:block',\n },\n },\n});\n","'use client';\n\nimport {\n TableCellHeaderPlugin,\n TableCellPlugin,\n TablePlugin,\n TableRowPlugin,\n} from '@platejs/table/react';\n\nimport {\n TableCellElement,\n TableCellHeaderElement,\n TableElement,\n TableRowElement,\n} from '@/components/ui/table-node';\n\nexport const TableKit = [\n TablePlugin.withComponent(TableElement),\n TableRowPlugin.withComponent(TableRowElement),\n TableCellPlugin.withComponent(TableCellElement),\n TableCellHeaderPlugin.withComponent(TableCellHeaderElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useTocElement, useTocElementState } from '@platejs/toc/react';\nimport { cva } from 'class-variance-authority';\nimport { PlateElement } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\n\nconst headingItemVariants = cva(\n 'block h-auto w-full cursor-pointer truncate rounded-none px-0.5 py-1.5 text-left font-medium text-muted-foreground underline decoration-[0.5px] underline-offset-4 hover:bg-accent hover:text-muted-foreground',\n {\n variants: {\n depth: {\n 1: 'pl-0.5',\n 2: 'pl-[26px]',\n 3: 'pl-[50px]',\n },\n },\n }\n);\n\nexport function TocElement(props: PlateElementProps) {\n const state = useTocElementState();\n const { props: btnProps } = useTocElement(state);\n const { headingList } = state;\n\n return (\n <PlateElement {...props} className=\"mb-1 p-0\">\n <div contentEditable={false}>\n {headingList.length > 0 ? (\n headingList.map((item) => (\n <Button\n key={item.id}\n variant=\"ghost\"\n className={headingItemVariants({\n depth: item.depth as 1 | 2 | 3,\n })}\n onClick={(e) => btnProps.onClick(e, item, 'smooth')}\n aria-current\n >\n {item.title}\n </Button>\n ))\n ) : (\n <div className=\"text-gray-500 text-sm\">\n Create a heading to display the table of contents.\n </div>\n )}\n </div>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { TocPlugin } from '@platejs/toc/react';\n\nimport { TocElement } from '@/components/ui/toc-node';\n\nexport const TocKit = [\n TocPlugin.configure({\n options: {\n // isScroll: true,\n topOffset: 80,\n },\n }).withComponent(TocElement),\n];\n","'use client';\n\nimport { TogglePlugin } from '@platejs/toggle/react';\n\nimport { IndentKit } from '@/components/editor/plugins/indent-kit';\nimport { ToggleElement } from '@/components/ui/toggle-node';\n\nexport const ToggleKit = [\n ...IndentKit,\n TogglePlugin.withComponent(ToggleElement),\n];\n","'use client';\n\nimport * as React from 'react';\n\nimport type { PlateElementProps } from 'platejs/react';\n\nimport { useToggleButton, useToggleButtonState } from '@platejs/toggle/react';\nimport { ChevronRight } from 'lucide-react';\nimport { PlateElement } from 'platejs/react';\n\nimport { Button } from '@/components/ui/button';\n\nexport function ToggleElement(props: PlateElementProps) {\n const element = props.element;\n const state = useToggleButtonState(element.id as string);\n const { buttonProps, open } = useToggleButton(state);\n\n return (\n <PlateElement {...props} className=\"pl-6\">\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"-left-0.5 absolute top-0 size-6 cursor-pointer select-none items-center justify-center rounded-md p-px text-muted-foreground transition-colors hover:bg-accent [&_svg]:size-4\"\n contentEditable={false}\n {...buttonProps}\n >\n <ChevronRight\n className={\n open\n ? 'rotate-90 transition-transform duration-75'\n : 'rotate-0 transition-transform duration-75'\n }\n />\n </Button>\n {props.children}\n </PlateElement>\n );\n}\n","'use client';\n\nimport { type Value, TrailingBlockPlugin } from 'platejs';\nimport { type TPlateEditor, useEditorRef } from 'platejs/react';\n\n// import { AIKit } from '@/components/editor/plugins/ai-kit';\nimport { AlignKit } from '@/components/editor/plugins/align-kit';\nimport { AutoformatKit } from '@/components/editor/plugins/autoformat-kit';\nimport { BasicBlocksKit } from '@/components/editor/plugins/basic-blocks-kit';\nimport { BasicMarksKit } from '@/components/editor/plugins/basic-marks-kit';\nimport { BlockMenuKit } from '@/components/editor/plugins/block-menu-kit';\nimport { BlockPlaceholderKit } from '@/components/editor/plugins/block-placeholder-kit';\nimport { CalloutKit } from '@/components/editor/plugins/callout-kit';\nimport { CodeBlockKit } from '@/components/editor/plugins/code-block-kit';\nimport { ColumnKit } from '@/components/editor/plugins/column-kit';\nimport { CommentKit } from '@/components/editor/plugins/comment-kit';\n// import { CopilotKit } from '@/components/editor/plugins/copilot-kit';\nimport { CursorOverlayKit } from '@/components/editor/plugins/cursor-overlay-kit';\nimport { DateKit } from '@/components/editor/plugins/date-kit';\n// import { DiscussionKit } from '@/components/editor/plugins/discussion-kit';\nimport { DndKit } from '@/components/editor/plugins/dnd-kit';\nimport { DocxKit } from '@/components/editor/plugins/docx-kit';\n// import { EmojiKit } from '@/components/editor/plugins/emoji-kit';\nimport { ExitBreakKit } from '@/components/editor/plugins/exit-break-kit';\nimport { FixedToolbarKit } from '@/components/editor/plugins/fixed-toolbar-kit';\nimport { FloatingToolbarKit } from '@/components/editor/plugins/floating-toolbar-kit';\nimport { FontKit } from '@/components/editor/plugins/font-kit';\nimport { LineHeightKit } from '@/components/editor/plugins/line-height-kit';\nimport { LinkKit } from '@/components/editor/plugins/link-kit';\nimport { ListKit } from '@/components/editor/plugins/list-kit';\nimport { MarkdownKit } from '@/components/editor/plugins/markdown-kit';\nimport { MathKit } from '@/components/editor/plugins/math-kit';\nimport { MediaKit } from '@/components/editor/plugins/media-kit';\nimport { MentionKit } from '@/components/editor/plugins/mention-kit';\nimport { SlashKit } from '@/components/editor/plugins/slash-kit';\nimport { SuggestionKit } from '@/components/editor/plugins/suggestion-kit';\nimport { TableKit } from '@/components/editor/plugins/table-kit';\nimport { TocKit } from '@/components/editor/plugins/toc-kit';\nimport { ToggleKit } from '@/components/editor/plugins/toggle-kit';\n\nexport const EditorKit: any[] = [\n // ...CopilotKit,\n // ...AIKit,\n\n // Elements\n ...BasicBlocksKit,\n ...CodeBlockKit,\n ...TableKit,\n ...ToggleKit,\n ...TocKit,\n ...MediaKit,\n ...CalloutKit,\n ...ColumnKit,\n ...MathKit,\n ...DateKit,\n ...LinkKit,\n ...MentionKit,\n\n // Marks\n ...BasicMarksKit,\n ...FontKit,\n\n // Block Style\n ...ListKit,\n ...AlignKit,\n ...LineHeightKit,\n\n // Collaboration\n // ...DiscussionKit,\n ...CommentKit,\n ...SuggestionKit,\n\n // Editing\n ...SlashKit,\n ...AutoformatKit,\n ...CursorOverlayKit,\n ...BlockMenuKit,\n ...DndKit,\n // ...EmojiKit,\n ...ExitBreakKit,\n TrailingBlockPlugin,\n\n // Parsers\n ...DocxKit,\n ...MarkdownKit,\n\n // UI\n ...BlockPlaceholderKit,\n ...FixedToolbarKit,\n ...FloatingToolbarKit,\n];\n\nexport type MyEditor = TPlateEditor<Value, (typeof EditorKit)[number]>;\n\nexport const useEditor = (): MyEditor | null => useEditorRef<MyEditor>();\n","'use client';\n\nimport * as React from 'react';\n\n// import { normalizeNodeId } from 'platejs';\nimport { Plate, usePlateEditor } from 'platejs/react';\n\nimport { EditorKit } from '@/components/editor/editor-kit';\n// import { SettingsDialog } from '@/components/editor/settings-dialog';\nimport { Editor, EditorContainer } from '@/components/ui/editor';\n\nimport { type Value } from 'platejs';\n\nexport interface PlateEditorProps {\n initialValue?: Value | string;\n onChange?: (value: Value) => void;\n}\n\nexport function PlateEditor({ initialValue, onChange }: PlateEditorProps) {\n const editor = usePlateEditor({\n plugins: EditorKit,\n value: initialValue,\n });\n\n return (\n <div className=\"h-screen w-full bg-white rounded-sm border-1\">\n <Plate\n editor={editor}\n onChange={({ value }) => {\n onChange?.(value);\n }}\n >\n <EditorContainer>\n <Editor variant=\"fullWidth\" />\n </EditorContainer>\n </Plate>\n </div>\n );\n}\n","import { BaseTextAlignPlugin } from '@platejs/basic-styles';\nimport { KEYS } from 'platejs';\n\nexport const BaseAlignKit = [\n BaseTextAlignPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 'start',\n nodeKey: 'align',\n styleKey: 'textAlign',\n validNodeValues: ['start', 'left', 'center', 'right', 'end', 'justify'],\n },\n targetPlugins: [...KEYS.heading, KEYS.p, KEYS.img, KEYS.mediaEmbed],\n },\n }),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport { SlateElement } from 'platejs/static';\n\nconst headingVariants = cva('relative mb-1', {\n variants: {\n variant: {\n h1: 'mt-[1.6em] pb-1 font-bold font-heading text-4xl',\n h2: 'mt-[1.4em] pb-px font-heading font-semibold text-2xl tracking-tight',\n h3: 'mt-[1em] pb-px font-heading font-semibold text-xl tracking-tight',\n h4: 'mt-[0.75em] font-heading font-semibold text-lg tracking-tight',\n h5: 'mt-[0.75em] font-semibold text-lg tracking-tight',\n h6: 'mt-[0.75em] font-semibold text-base tracking-tight',\n },\n },\n});\n\nexport function HeadingElementStatic({\n variant = 'h1',\n ...props\n}: SlateElementProps & VariantProps<typeof headingVariants>) {\n return (\n <SlateElement\n as={variant!}\n className={headingVariants({ variant })}\n {...props}\n >\n {props.children}\n </SlateElement>\n );\n}\n\nexport function H1ElementStatic(props: SlateElementProps) {\n return <HeadingElementStatic variant=\"h1\" {...props} />;\n}\n\nexport function H2ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h2\" {...props} />;\n}\n\nexport function H3ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h3\" {...props} />;\n}\n\nexport function H4ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h4\" {...props} />;\n}\n\nexport function H5ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h5\" {...props} />;\n}\n\nexport function H6ElementStatic(\n props: React.ComponentProps<typeof HeadingElementStatic>\n) {\n return <HeadingElementStatic variant=\"h6\" {...props} />;\n}\n","import {\n BaseBlockquotePlugin,\n BaseH1Plugin,\n BaseH2Plugin,\n BaseH3Plugin,\n BaseH4Plugin,\n BaseH5Plugin,\n BaseH6Plugin,\n BaseHorizontalRulePlugin,\n} from '@platejs/basic-nodes';\nimport { BaseParagraphPlugin } from 'platejs';\n\nimport { BlockquoteElementStatic } from '@/components/ui/blockquote-node-static';\nimport {\n H1ElementStatic,\n H2ElementStatic,\n H3ElementStatic,\n H4ElementStatic,\n H5ElementStatic,\n H6ElementStatic,\n} from '@/components/ui/heading-node-static';\nimport { HrElementStatic } from '@/components/ui/hr-node-static';\nimport { ParagraphElementStatic } from '@/components/ui/paragraph-node-static';\n\nexport const BaseBasicBlocksKit = [\n BaseParagraphPlugin.withComponent(ParagraphElementStatic),\n BaseH1Plugin.withComponent(H1ElementStatic),\n BaseH2Plugin.withComponent(H2ElementStatic),\n BaseH3Plugin.withComponent(H3ElementStatic),\n BaseH4Plugin.withComponent(H4ElementStatic),\n BaseH5Plugin.withComponent(H5ElementStatic),\n BaseH6Plugin.withComponent(H6ElementStatic),\n BaseBlockquotePlugin.withComponent(BlockquoteElementStatic),\n BaseHorizontalRulePlugin.withComponent(HrElementStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function ParagraphElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props} className={cn('m-0 px-0 py-1')}>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport { type SlateElementProps, SlateElement } from 'platejs/static';\n\nexport function BlockquoteElementStatic(props: SlateElementProps) {\n return (\n <SlateElement\n as=\"blockquote\"\n className=\"my-1 border-l-2 pl-6 italic\"\n {...props}\n />\n );\n}\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function HrElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props}>\n <div className=\"cursor-text py-6\" contentEditable={false}>\n <hr\n className={cn(\n 'h-0.5 rounded-sm border-none bg-muted bg-clip-content'\n )}\n />\n </div>\n {props.children}\n </SlateElement>\n );\n}\n","import {\n BaseBoldPlugin,\n BaseCodePlugin,\n BaseHighlightPlugin,\n BaseItalicPlugin,\n BaseKbdPlugin,\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\n BaseUnderlinePlugin,\n} from '@platejs/basic-nodes';\n\nimport { CodeLeafStatic } from '@/components/ui/code-node-static';\nimport { HighlightLeafStatic } from '@/components/ui/highlight-node-static';\nimport { KbdLeafStatic } from '@/components/ui/kbd-node-static';\n\nexport const BaseBasicMarksKit = [\n BaseBoldPlugin,\n BaseItalicPlugin,\n BaseUnderlinePlugin,\n BaseCodePlugin.withComponent(CodeLeafStatic),\n BaseStrikethroughPlugin,\n BaseSubscriptPlugin,\n BaseSuperscriptPlugin,\n BaseHighlightPlugin.withComponent(HighlightLeafStatic),\n BaseKbdPlugin.withComponent(KbdLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function CodeLeafStatic(props: SlateLeafProps) {\n return (\n <SlateLeaf\n {...props}\n as=\"code\"\n className=\"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm\"\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import * as React from 'react';\n\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function HighlightLeafStatic(props: SlateLeafProps) {\n return (\n <SlateLeaf {...props} as=\"mark\" className=\"bg-highlight/30 text-inherit\">\n {props.children}\n </SlateLeaf>\n );\n}\n","import * as React from 'react';\n\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function KbdLeafStatic(props: SlateLeafProps) {\n return (\n <SlateLeaf\n {...props}\n as=\"kbd\"\n className=\"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-sm shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(248,_249,_250)_0px_1px_5px_0px_inset,_rgb(193,_200,_205)_0px_0px_0px_0.5px,_rgb(193,_200,_205)_0px_2px_1px_-1px,_rgb(193,_200,_205)_0px_1px_0px_0px] dark:shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(26,_29,_30)_0px_1px_5px_0px_inset,_rgb(76,_81,_85)_0px_0px_0px_0.5px,_rgb(76,_81,_85)_0px_2px_1px_-1px,_rgb(76,_81,_85)_0px_1px_0px_0px]\"\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import { BaseCalloutPlugin } from '@platejs/callout';\n\nimport { CalloutElementStatic } from '@/components/ui/callout-node-static';\n\nexport const BaseCalloutKit = [\n BaseCalloutPlugin.withComponent(CalloutElementStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function CalloutElementStatic({\n children,\n className,\n ...props\n}: SlateElementProps) {\n return (\n <SlateElement\n className={cn('my-1 flex rounded-sm bg-muted p-4 pl-3', className)}\n style={{\n backgroundColor: props.element.backgroundColor as any,\n }}\n {...props}\n >\n <div className=\"flex w-full gap-2 rounded-md\">\n <div\n className=\"size-6 select-none text-[18px]\"\n style={{\n fontFamily:\n '\"Apple Color Emoji\", \"Segoe UI Emoji\", NotoColorEmoji, \"Noto Color Emoji\", \"Segoe UI Symbol\", \"Android Emoji\", EmojiSymbols',\n }}\n >\n <span data-plate-prevent-deserialization>\n {(props.element.icon as any) || '💡'}\n </span>\n </div>\n <div className=\"w-full\">{children}</div>\n </div>\n </SlateElement>\n );\n}\n","import {\n BaseCodeBlockPlugin,\n BaseCodeLinePlugin,\n BaseCodeSyntaxPlugin,\n} from '@platejs/code-block';\nimport { all, createLowlight } from 'lowlight';\n\nimport {\n CodeBlockElementStatic,\n CodeLineElementStatic,\n CodeSyntaxLeafStatic,\n} from '@/components/ui/code-block-node-static';\n\nconst lowlight = createLowlight(all);\n\nexport const BaseCodeBlockKit = [\n BaseCodeBlockPlugin.configure({\n node: { component: CodeBlockElementStatic },\n options: { lowlight },\n }),\n BaseCodeLinePlugin.withComponent(CodeLineElementStatic),\n BaseCodeSyntaxPlugin.withComponent(CodeSyntaxLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { TCodeBlockElement } from 'platejs';\n\nimport {\n type SlateElementProps,\n type SlateLeafProps,\n SlateElement,\n SlateLeaf,\n} from 'platejs/static';\n\nexport function CodeBlockElementStatic(\n props: SlateElementProps<TCodeBlockElement>\n) {\n return (\n <SlateElement\n className=\"py-1 **:[.hljs-addition]:bg-[#f0fff4] **:[.hljs-addition]:text-[#22863a] dark:**:[.hljs-addition]:bg-[#3c5743] dark:**:[.hljs-addition]:text-[#ceead5] **:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#005cc5] dark:**:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#6596cf] **:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#e36209] dark:**:[.hljs-built\\\\\\\\_in,.hljs-symbol]:text-[#c3854e] **:[.hljs-bullet]:text-[#735c0f] **:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] dark:**:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] **:[.hljs-deletion]:bg-[#ffeef0] **:[.hljs-deletion]:text-[#b31d28] dark:**:[.hljs-deletion]:bg-[#473235] dark:**:[.hljs-deletion]:text-[#e7c7cb] **:[.hljs-emphasis]:italic **:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#d73a49] dark:**:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\\\\\_]:text-[#ee6960] **:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#22863a] dark:**:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#36a84f] **:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#032f62] dark:**:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#3593ff] **:[.hljs-section]:font-bold **:[.hljs-section]:text-[#005cc5] dark:**:[.hljs-section]:text-[#61a5f2] **:[.hljs-strong]:font-bold **:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#6f42c1] dark:**:[.hljs-title,.hljs-title.class\\\\\\\\_,.hljs-title.class\\\\\\\\_.inherited\\\\\\\\_\\\\\\\\_,.hljs-title.function\\\\\\\\_]:text-[#a77bfa]\"\n {...props}\n >\n <div className=\"relative rounded-md bg-muted/50\">\n <pre className=\"overflow-x-auto p-8 pr-4 font-mono text-sm leading-[normal] [tab-size:2] print:break-inside-avoid\">\n <code>{props.children}</code>\n </pre>\n </div>\n </SlateElement>\n );\n}\n\nexport function CodeLineElementStatic(props: SlateElementProps) {\n return <SlateElement {...props} />;\n}\n\nexport function CodeSyntaxLeafStatic(props: SlateLeafProps) {\n const tokenClassName = props.leaf.className as string;\n\n return <SlateLeaf className={tokenClassName} {...props} />;\n}\n","import { BaseColumnItemPlugin, BaseColumnPlugin } from '@platejs/layout';\n\nimport {\n ColumnElementStatic,\n ColumnGroupElementStatic,\n} from '@/components/ui/column-node-static';\n\nexport const BaseColumnKit = [\n BaseColumnPlugin.withComponent(ColumnGroupElementStatic),\n BaseColumnItemPlugin.withComponent(ColumnElementStatic),\n];\n","import * as React from 'react';\n\nimport type { TColumnElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nexport function ColumnElementStatic(props: SlateElementProps<TColumnElement>) {\n const { width } = props.element;\n\n return (\n <div className=\"group/column relative\" style={{ width: width ?? '100%' }}>\n <SlateElement\n className=\"h-full px-2 pt-2 group-first/column:pl-0 group-last/column:pr-0\"\n {...props}\n >\n <div className=\"relative h-full border border-transparent p-1.5\">\n {props.children}\n </div>\n </SlateElement>\n </div>\n );\n}\n\nexport function ColumnGroupElementStatic(props: SlateElementProps) {\n return (\n <SlateElement className=\"mb-2\" {...props}>\n <div className=\"flex size-full rounded\">{props.children}</div>\n </SlateElement>\n );\n}\n","import { BaseCommentPlugin } from '@platejs/comment';\n\nimport { CommentLeafStatic } from '@/components/ui/comment-node-static';\n\nexport const BaseCommentKit = [\n BaseCommentPlugin.withComponent(CommentLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { TCommentText } from 'platejs';\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { SlateLeaf } from 'platejs/static';\n\nexport function CommentLeafStatic(props: SlateLeafProps<TCommentText>) {\n return (\n <SlateLeaf\n {...props}\n className=\"border-b-2 border-b-highlight/35 bg-highlight/15\"\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import { BaseDatePlugin } from '@platejs/date';\n\nimport { DateElementStatic } from '@/components/ui/date-node-static';\n\nexport const BaseDateKit = [BaseDatePlugin.withComponent(DateElementStatic)];\n","import * as React from 'react';\n\nimport type { TDateElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nexport function DateElementStatic(props: SlateElementProps<TDateElement>) {\n const { element } = props;\n\n return (\n <SlateElement className=\"inline-block\" {...props}>\n <span className=\"w-fit rounded-sm bg-muted px-1 text-muted-foreground\">\n {element.date ? (\n (() => {\n const today = new Date();\n const elementDate = new Date(element.date);\n const isToday =\n elementDate.getDate() === today.getDate() &&\n elementDate.getMonth() === today.getMonth() &&\n elementDate.getFullYear() === today.getFullYear();\n\n const isYesterday =\n new Date(today.setDate(today.getDate() - 1)).toDateString() ===\n elementDate.toDateString();\n const isTomorrow =\n new Date(today.setDate(today.getDate() + 2)).toDateString() ===\n elementDate.toDateString();\n\n if (isToday) return 'Today';\n if (isYesterday) return 'Yesterday';\n if (isTomorrow) return 'Tomorrow';\n\n return elementDate.toLocaleDateString(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n })()\n ) : (\n <span>Pick a date</span>\n )}\n </span>\n {props.children}\n </SlateElement>\n );\n}\n","import type { SlatePluginConfig } from 'platejs';\n\nimport {\n BaseFontBackgroundColorPlugin,\n BaseFontColorPlugin,\n BaseFontFamilyPlugin,\n BaseFontSizePlugin,\n} from '@platejs/basic-styles';\nimport { KEYS } from 'platejs';\n\nconst options = {\n inject: { targetPlugins: [KEYS.p] },\n} satisfies SlatePluginConfig;\n\nexport const BaseFontKit = [\n BaseFontColorPlugin.configure(options),\n BaseFontBackgroundColorPlugin.configure(options),\n BaseFontSizePlugin.configure(options),\n BaseFontFamilyPlugin.configure(options),\n];\n","import { BaseLineHeightPlugin } from '@platejs/basic-styles';\nimport { KEYS } from 'platejs';\n\nexport const BaseLineHeightKit = [\n BaseLineHeightPlugin.configure({\n inject: {\n nodeProps: {\n defaultNodeValue: 1.5,\n validNodeValues: [1, 1.2, 1.5, 2, 3],\n },\n targetPlugins: [...KEYS.heading, KEYS.p],\n },\n }),\n];\n","import { BaseLinkPlugin } from '@platejs/link';\n\nimport { LinkElementStatic } from '@/components/ui/link-node-static';\n\nexport const BaseLinkKit = [BaseLinkPlugin.withComponent(LinkElementStatic)];\n","import * as React from 'react';\n\nimport type { TLinkElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { getLinkAttributes } from '@platejs/link';\nimport { SlateElement } from 'platejs/static';\n\nexport function LinkElementStatic(props: SlateElementProps<TLinkElement>) {\n return (\n <SlateElement\n {...props}\n as=\"a\"\n className=\"font-medium text-primary underline decoration-primary underline-offset-4\"\n attributes={{\n ...props.attributes,\n ...getLinkAttributes(props.editor, props.element),\n }}\n >\n {props.children}\n </SlateElement>\n );\n}\n","import { BaseIndentPlugin } from '@platejs/indent';\nimport { KEYS } from 'platejs';\n\nexport const BaseIndentKit = [\n BaseIndentPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n ],\n },\n options: {\n offset: 24,\n },\n }),\n];\n","import * as React from 'react';\n\nimport type { RenderStaticNodeWrapper, TListElement } from 'platejs';\nimport type { SlateRenderElementProps } from 'platejs/static';\n\nimport { isOrderedList } from '@platejs/list';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst config: Record<\n string,\n {\n Li: React.FC<SlateRenderElementProps>;\n Marker: React.FC<SlateRenderElementProps>;\n }\n> = {\n todo: {\n Li: TodoLiStatic,\n Marker: TodoMarkerStatic,\n },\n};\n\nexport const BlockListStatic: RenderStaticNodeWrapper = (props) => {\n if (!props.element.listStyleType) return;\n\n return (props) => <List {...props} />;\n};\n\nfunction List(props: SlateRenderElementProps) {\n const { listStart, listStyleType } = props.element as TListElement;\n const { Li, Marker } = config[listStyleType] ?? {};\n const List = isOrderedList(props.element) ? 'ol' : 'ul';\n\n return (\n <List\n className=\"relative m-0 p-0\"\n style={{ listStyleType }}\n start={listStart}\n >\n {Marker && <Marker {...props} />}\n {Li ? <Li {...props} /> : <li>{props.children}</li>}\n </List>\n );\n}\n\nfunction TodoMarkerStatic(props: SlateRenderElementProps) {\n const checked = props.element.checked as boolean;\n\n return (\n <div contentEditable={false}>\n <button\n className={cn(\n 'peer -left-6 pointer-events-none absolute top-1 size-4 shrink-0 rounded-sm border border-primary bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',\n props.className\n )}\n data-state={checked ? 'checked' : 'unchecked'}\n type=\"button\"\n >\n <div className={cn('flex items-center justify-center text-current')}>\n {checked && <CheckIcon className=\"size-4\" />}\n </div>\n </button>\n </div>\n );\n}\n\nfunction TodoLiStatic(props: SlateRenderElementProps) {\n return (\n <li\n className={cn(\n 'list-none',\n (props.element.checked as boolean) &&\n 'text-muted-foreground line-through'\n )}\n >\n {props.children}\n </li>\n );\n}\n","import { BaseListPlugin } from '@platejs/list';\nimport { KEYS } from 'platejs';\n\nimport { BaseIndentKit } from '@/components/editor/plugins/indent-base-kit';\nimport { BlockListStatic } from '@/components/ui/block-list-static';\n\nexport const BaseListKit = [\n ...BaseIndentKit,\n BaseListPlugin.configure({\n inject: {\n targetPlugins: [\n ...KEYS.heading,\n KEYS.p,\n KEYS.blockquote,\n KEYS.codeBlock,\n KEYS.toggle,\n ],\n },\n render: {\n belowNodes: BlockListStatic,\n },\n }),\n];\n","import { BaseEquationPlugin, BaseInlineEquationPlugin } from '@platejs/math';\n\nimport {\n EquationElementStatic,\n InlineEquationElementStatic,\n} from '@/components/ui/equation-node-static';\n\nexport const BaseMathKit = [\n BaseInlineEquationPlugin.withComponent(InlineEquationElementStatic),\n BaseEquationPlugin.withComponent(EquationElementStatic),\n];\n","import * as React from 'react';\n\nimport type { TEquationElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { getEquationHtml } from '@platejs/math';\nimport { RadicalIcon } from 'lucide-react';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function EquationElementStatic(\n props: SlateElementProps<TEquationElement>\n) {\n const { element } = props;\n\n const html = getEquationHtml({\n element,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <SlateElement className=\"my-1\" {...props}>\n <div\n className={cn(\n 'group flex select-none items-center justify-center rounded-sm hover:bg-primary/10 data-[selected=true]:bg-primary/10',\n element.texExpression.length === 0 ? 'bg-muted p-3 pr-9' : 'px-2 py-1'\n )}\n >\n {element.texExpression.length > 0 ? (\n <span\n dangerouslySetInnerHTML={{\n __html: html,\n }}\n />\n ) : (\n <div className=\"flex h-7 w-full items-center gap-2 whitespace-nowrap text-muted-foreground text-sm\">\n <RadicalIcon className=\"size-6 text-muted-foreground/80\" />\n <div>Add a Tex equation</div>\n </div>\n )}\n </div>\n {props.children}\n </SlateElement>\n );\n}\n\nexport function InlineEquationElementStatic(\n props: SlateElementProps<TEquationElement>\n) {\n const html = getEquationHtml({\n element: props.element,\n options: {\n displayMode: true,\n errorColor: '#cc0000',\n fleqn: false,\n leqno: false,\n macros: { '\\\\f': '#1f(#2)' },\n output: 'htmlAndMathml',\n strict: 'warn',\n throwOnError: false,\n trust: false,\n },\n });\n\n return (\n <SlateElement\n {...props}\n className=\"inline-block select-none rounded-sm [&_.katex-display]:my-0\"\n >\n <div\n className={cn(\n 'after:-top-0.5 after:-left-1 after:absolute after:inset-0 after:z-1 after:h-[calc(100%)+4px] after:w-[calc(100%+8px)] after:rounded-sm after:content-[\"\"]',\n 'h-6',\n props.element.texExpression.length === 0 &&\n 'text-muted-foreground after:bg-neutral-500/10'\n )}\n >\n <span\n className={cn(\n props.element.texExpression.length === 0 && 'hidden',\n 'font-mono leading-none'\n )}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </div>\n {props.children}\n </SlateElement>\n );\n}\n","import { BaseCaptionPlugin } from '@platejs/caption';\nimport {\n BaseAudioPlugin,\n BaseFilePlugin,\n BaseImagePlugin,\n BaseMediaEmbedPlugin,\n BasePlaceholderPlugin,\n BaseVideoPlugin,\n} from '@platejs/media';\nimport { KEYS } from 'platejs';\n\nimport { AudioElementStatic } from '@/components/ui/media-audio-node-static';\nimport { FileElementStatic } from '@/components/ui/media-file-node-static';\nimport { ImageElementStatic } from '@/components/ui/media-image-node-static';\nimport { VideoElementStatic } from '@/components/ui/media-video-node-static';\n\nexport const BaseMediaKit = [\n BaseImagePlugin.withComponent(ImageElementStatic),\n BaseVideoPlugin.withComponent(VideoElementStatic),\n BaseAudioPlugin.withComponent(AudioElementStatic),\n BaseFilePlugin.withComponent(FileElementStatic),\n BaseCaptionPlugin.configure({\n options: {\n query: {\n allow: [KEYS.img, KEYS.video, KEYS.audio, KEYS.file, KEYS.mediaEmbed],\n },\n },\n }),\n BaseMediaEmbedPlugin,\n BasePlaceholderPlugin,\n];\n","import * as React from 'react';\n\nimport type { TCaptionProps, TImageElement, TResizableProps } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { NodeApi } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function ImageElementStatic(\n props: SlateElementProps<TImageElement & TCaptionProps & TResizableProps>\n) {\n const { align = 'center', caption, url, width } = props.element;\n\n return (\n <SlateElement {...props} className=\"py-2.5\">\n <figure className=\"group relative m-0 inline-block\" style={{ width }}>\n <div\n className=\"relative min-w-[92px] max-w-full\"\n style={{ textAlign: align }}\n >\n <img\n className={cn(\n 'w-full max-w-full cursor-default object-cover px-0',\n 'rounded-sm'\n )}\n alt={(props.attributes as any).alt}\n src={url}\n />\n {caption && (\n <figcaption className=\"mx-auto mt-2 h-[24px] max-w-full\">\n {NodeApi.string(caption[0])}\n </figcaption>\n )}\n </div>\n </figure>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport type { TCaptionElement, TResizableProps, TVideoElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { NodeApi } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nexport function VideoElementStatic(\n props: SlateElementProps<TVideoElement & TCaptionElement & TResizableProps>\n) {\n const { align = 'center', caption, url, width } = props.element;\n\n return (\n <SlateElement className=\"py-2.5\" {...props}>\n <div style={{ textAlign: align }}>\n <figure\n className=\"group relative m-0 inline-block cursor-default\"\n style={{ width }}\n >\n <video\n className=\"w-full max-w-full rounded-sm object-cover px-0\"\n src={url}\n controls\n />\n {caption && <figcaption>{NodeApi.string(caption[0])}</figcaption>}\n </figure>\n </div>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport type { TAudioElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { SlateElement } from 'platejs/static';\n\nexport function AudioElementStatic(props: SlateElementProps<TAudioElement>) {\n return (\n <SlateElement {...props} className=\"mb-1\">\n <figure className=\"group relative cursor-default\">\n <div className=\"h-16\">\n <audio className=\"size-full\" src={props.element.url} controls />\n </div>\n </figure>\n {props.children}\n </SlateElement>\n );\n}\n","import * as React from 'react';\n\nimport type { TFileElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { FileUp } from 'lucide-react';\nimport { SlateElement } from 'platejs/static';\n\nexport function FileElementStatic(props: SlateElementProps<TFileElement>) {\n const { name, url } = props.element;\n\n return (\n <SlateElement className=\"my-px rounded-sm\" {...props}>\n <a\n className=\"group relative m-0 flex cursor-pointer items-center rounded px-0.5 py-[3px] hover:bg-muted\"\n contentEditable={false}\n download={name}\n href={url}\n rel=\"noopener noreferrer\"\n role=\"button\"\n target=\"_blank\"\n >\n <div className=\"flex items-center gap-1 p-1\">\n <FileUp className=\"size-5\" />\n <div>{name}</div>\n </div>\n </a>\n {props.children}\n </SlateElement>\n );\n}\n","import { BaseMentionPlugin } from '@platejs/mention';\n\nimport { MentionElementStatic } from '@/components/ui/mention-node-static';\n\nexport const BaseMentionKit = [\n BaseMentionPlugin.withComponent(MentionElementStatic),\n];\n","import * as React from 'react';\n\nimport type { TMentionElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { KEYS } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function MentionElementStatic(\n props: SlateElementProps<TMentionElement> & {\n prefix?: string;\n }\n) {\n const { prefix } = props;\n const element = props.element;\n\n return (\n <SlateElement\n {...props}\n className={cn(\n 'inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline font-medium text-sm',\n element.children[0][KEYS.bold] === true && 'font-bold',\n element.children[0][KEYS.italic] === true && 'italic',\n element.children[0][KEYS.underline] === true && 'underline'\n )}\n attributes={{\n ...props.attributes,\n 'data-slate-value': element.value,\n }}\n >\n {props.children}\n {prefix}\n {element.value}\n </SlateElement>\n );\n}\n","import { BaseSuggestionPlugin } from '@platejs/suggestion';\n\nimport { SuggestionLeafStatic } from '@/components/ui/suggestion-node-static';\n\nexport const BaseSuggestionKit = [\n BaseSuggestionPlugin.withComponent(SuggestionLeafStatic),\n];\n","import * as React from 'react';\n\nimport type { TSuggestionText } from 'platejs';\nimport type { SlateLeafProps } from 'platejs/static';\n\nimport { BaseSuggestionPlugin } from '@platejs/suggestion';\nimport { SlateLeaf } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function SuggestionLeafStatic(props: SlateLeafProps<TSuggestionText>) {\n const { editor, leaf } = props;\n\n const dataList = editor\n .getApi(BaseSuggestionPlugin)\n .suggestion.dataList(leaf);\n const hasRemove = dataList.some((data) => data.type === 'remove');\n const diffOperation = { type: hasRemove ? 'delete' : 'insert' } as const;\n\n const Component = ({ delete: 'del', insert: 'ins', update: 'span' } as const)[\n diffOperation.type\n ];\n\n return (\n <SlateLeaf\n {...props}\n as={Component}\n className={cn(\n 'border-b-2 border-b-brand/[.24] bg-brand/[.08] text-brand/80 no-underline transition-colors duration-200',\n hasRemove &&\n 'border-b-gray-300 bg-gray-300/25 text-gray-400 line-through'\n )}\n >\n {props.children}\n </SlateLeaf>\n );\n}\n","import * as React from 'react';\n\nimport type { TTableCellElement, TTableElement } from 'platejs';\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { BaseTablePlugin } from '@platejs/table';\nimport { SlateElement } from 'platejs/static';\n\nimport { cn } from '@/lib/utils';\n\nexport function TableElementStatic({\n children,\n ...props\n}: SlateElementProps<TTableElement>) {\n const { disableMarginLeft } = props.editor.getOptions(BaseTablePlugin);\n const marginLeft = disableMarginLeft ? 0 : props.element.marginLeft;\n\n return (\n <SlateElement\n {...props}\n className=\"overflow-x-auto py-5\"\n style={{ paddingLeft: marginLeft }}\n >\n <div className=\"group/table relative w-fit\">\n <table className=\"mr-0 ml-px table h-px table-fixed border-collapse\">\n <tbody className=\"min-w-full\">{children}</tbody>\n </table>\n </div>\n </SlateElement>\n );\n}\n\nexport function TableRowElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props} as=\"tr\" className=\"h-full\">\n {props.children}\n </SlateElement>\n );\n}\n\nexport function TableCellElementStatic({\n isHeader,\n ...props\n}: SlateElementProps<TTableCellElement> & {\n isHeader?: boolean;\n}) {\n const { editor, element } = props;\n const { api } = editor.getPlugin(BaseTablePlugin);\n\n const { minHeight, width } = api.table.getCellSize({ element });\n const borders = api.table.getCellBorders({ element });\n\n return (\n <SlateElement\n {...props}\n as={isHeader ? 'th' : 'td'}\n className={cn(\n 'h-full overflow-visible border-none bg-background p-0',\n element.background ? 'bg-(--cellBackground)' : 'bg-background',\n isHeader && 'text-left font-normal *:m-0',\n 'before:size-full',\n \"before:absolute before:box-border before:select-none before:content-['']\",\n borders &&\n cn(\n borders.bottom?.size && 'before:border-b before:border-b-border',\n borders.right?.size && 'before:border-r before:border-r-border',\n borders.left?.size && 'before:border-l before:border-l-border',\n borders.top?.size && 'before:border-t before:border-t-border'\n )\n )}\n style={\n {\n '--cellBackground': element.background,\n maxWidth: width || 240,\n minWidth: width || 120,\n } as React.CSSProperties\n }\n attributes={{\n ...props.attributes,\n colSpan: api.table.getColSpan(element),\n rowSpan: api.table.getRowSpan(element),\n }}\n >\n <div\n className=\"relative z-20 box-border h-full px-4 py-2\"\n style={{ minHeight }}\n >\n {props.children}\n </div>\n </SlateElement>\n );\n}\n\nexport function TableCellHeaderElementStatic(\n props: SlateElementProps<TTableCellElement>\n) {\n return <TableCellElementStatic {...props} isHeader />;\n}\n","import {\n BaseTableCellHeaderPlugin,\n BaseTableCellPlugin,\n BaseTablePlugin,\n BaseTableRowPlugin,\n} from '@platejs/table';\n\nimport {\n TableCellElementStatic,\n TableCellHeaderElementStatic,\n TableElementStatic,\n TableRowElementStatic,\n} from '@/components/ui/table-node-static';\n\nexport const BaseTableKit = [\n BaseTablePlugin.withComponent(TableElementStatic),\n BaseTableRowPlugin.withComponent(TableRowElementStatic),\n BaseTableCellPlugin.withComponent(TableCellElementStatic),\n BaseTableCellHeaderPlugin.withComponent(TableCellHeaderElementStatic),\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { type Heading, BaseTocPlugin, isHeading } from '@platejs/toc';\nimport { cva } from 'class-variance-authority';\nimport { type SlateEditor, type TElement, NodeApi } from 'platejs';\nimport { SlateElement } from 'platejs/static';\n\nimport { Button } from '@/components/ui/button';\n\nconst headingItemVariants = cva(\n 'block h-auto w-full cursor-pointer truncate rounded-none px-0.5 py-1.5 text-left font-medium text-muted-foreground underline decoration-[0.5px] underline-offset-4 hover:bg-accent hover:text-muted-foreground',\n {\n variants: {\n depth: {\n 1: 'pl-0.5',\n 2: 'pl-[26px]',\n 3: 'pl-[50px]',\n },\n },\n }\n);\n\nexport function TocElementStatic(props: SlateElementProps) {\n const { editor } = props;\n const headingList = getHeadingList(editor);\n\n return (\n <SlateElement {...props} className=\"mb-1 p-0\">\n <div>\n {headingList.length > 0 ? (\n headingList.map((item) => (\n <Button\n key={item.title}\n variant=\"ghost\"\n className={headingItemVariants({\n depth: item.depth as 1 | 2 | 3,\n })}\n >\n {item.title}\n </Button>\n ))\n ) : (\n <div className=\"text-gray-500 text-sm\">\n Create a heading to display the table of contents.\n </div>\n )}\n </div>\n {props.children}\n </SlateElement>\n );\n}\n\nconst headingDepth: Record<string, number> = {\n h1: 1,\n h2: 2,\n h3: 3,\n h4: 4,\n h5: 5,\n h6: 6,\n};\n\nconst getHeadingList = (editor?: SlateEditor) => {\n if (!editor) return [];\n\n const options = editor.getOptions(BaseTocPlugin);\n\n if (options.queryHeading) {\n return options.queryHeading(editor);\n }\n\n const headingList: Heading[] = [];\n\n const values = editor.api.nodes<TElement>({\n at: [],\n match: (n) => isHeading(n),\n });\n\n if (!values) return [];\n\n Array.from(values).forEach(([node, path]) => {\n const { type } = node;\n const title = NodeApi.string(node);\n const depth = headingDepth[type];\n const id = node.id as string;\n\n if (title) {\n headingList.push({ id, depth, path, title, type });\n }\n });\n\n return headingList;\n};\n","import { BaseTocPlugin } from '@platejs/toc';\n\nimport { TocElementStatic } from '@/components/ui/toc-node-static';\n\nexport const BaseTocKit = [BaseTocPlugin.withComponent(TocElementStatic)];\n","import { BaseTogglePlugin } from '@platejs/toggle';\n\nimport { ToggleElementStatic } from '@/components/ui/toggle-node-static';\n\nexport const BaseToggleKit = [\n BaseTogglePlugin.withComponent(ToggleElementStatic),\n];\n","import { BaseAlignKit } from './plugins/align-base-kit';\nimport { BaseBasicBlocksKit } from './plugins/basic-blocks-base-kit';\nimport { BaseBasicMarksKit } from './plugins/basic-marks-base-kit';\nimport { BaseCalloutKit } from './plugins/callout-base-kit';\nimport { BaseCodeBlockKit } from './plugins/code-block-base-kit';\nimport { BaseColumnKit } from './plugins/column-base-kit';\nimport { BaseCommentKit } from './plugins/comment-base-kit';\nimport { BaseDateKit } from './plugins/date-base-kit';\nimport { BaseFontKit } from './plugins/font-base-kit';\nimport { BaseLineHeightKit } from './plugins/line-height-base-kit';\nimport { BaseLinkKit } from './plugins/link-base-kit';\nimport { BaseListKit } from './plugins/list-base-kit';\nimport { MarkdownKit } from './plugins/markdown-kit';\nimport { BaseMathKit } from './plugins/math-base-kit';\nimport { BaseMediaKit } from './plugins/media-base-kit';\nimport { BaseMentionKit } from './plugins/mention-base-kit';\nimport { BaseSuggestionKit } from './plugins/suggestion-base-kit';\nimport { BaseTableKit } from './plugins/table-base-kit';\nimport { BaseTocKit } from './plugins/toc-base-kit';\nimport { BaseToggleKit } from './plugins/toggle-base-kit';\n\nexport const BaseEditorKit: any[] = [\n ...BaseBasicBlocksKit,\n ...BaseCodeBlockKit,\n ...BaseTableKit,\n ...BaseToggleKit,\n ...BaseTocKit,\n ...BaseMediaKit,\n ...BaseCalloutKit,\n ...BaseColumnKit,\n ...BaseMathKit,\n ...BaseDateKit,\n ...BaseLinkKit,\n ...BaseMentionKit,\n ...BaseBasicMarksKit,\n ...BaseFontKit,\n ...BaseListKit,\n ...BaseAlignKit,\n ...BaseLineHeightKit,\n ...BaseCommentKit,\n ...BaseSuggestionKit,\n ...MarkdownKit,\n];\n","import * as React from 'react';\n\nimport type { SlateElementProps } from 'platejs/static';\n\nimport { ChevronRight } from 'lucide-react';\nimport { SlateElement } from 'platejs/static';\n\nexport function ToggleElementStatic(props: SlateElementProps) {\n return (\n <SlateElement {...props} className=\"pl-6\">\n <div\n className=\"-left-0.5 absolute top-0 size-6 cursor-pointer select-none items-center justify-center rounded-md p-px text-muted-foreground transition-colors hover:bg-accent [&_svg]:size-4\"\n contentEditable={false}\n >\n <ChevronRight className=\"rotate-0 transition-transform duration-75\" />\n </div>\n {props.children}\n </SlateElement>\n );\n}\n"],"names":["process","env","NODE_ENV","getComponentNameFromType","type","$$typeof","REACT_CLIENT_REFERENCE","displayName","name","REACT_FRAGMENT_TYPE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","tag","console","error","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","Symbol","toStringTag","constructor","call","getTaskName","UnknownOwner","Error","elementRefGetterWithDeprecationWarning","componentName","this","didWarnAboutElementRef","props","ref","jsxDEVImpl","config","maybeKey","isStaticChildren","debugStack","debugTask","dispatcher","children","isArrayImpl","length","validateChildKeys","Object","freeze","hasOwnProperty","keys","filter","k","join","didWarnAboutKeySpread","getter","getOwnPropertyDescriptor","get","isReactWarning","key","hasValidKey","propName","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","defineKeyPropWarningGetter","owner","refProp","REACT_ELEMENT_TYPE","_owner","enumerable","_store","writable","ReactElement","ReactSharedInternals","A","getOwner","node","isValidElement","validated","status","object","React","require$$0","for","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","unknownOwnerDebugStack","react_stack_bottom_frame","callStackForError","bind","unknownOwnerDebugTask","reactJsxRuntime_development","Fragment","jsx","trackActualOwner","recentlyCreatedOwnerStacks","jsxs","jsxRuntimeModule","exports","jsxProd","reactJsxRuntime_production","require$$1","AlignKit","TextAlignPlugin","configure","inject","nodeProps","defaultNodeValue","nodeKey","styleKey","validNodeValues","targetPlugins","KEYS","heading","p","img","mediaEmbed","autoformatMarks","match","mode","bold","italic","underline","strikethrough","sup","sub","highlight","code","autoformatBlocks","h1","h2","h3","h4","h5","h6","blockquote","codeBlock","format","editor","insertEmptyCodeBlock","defaultType","insertNodesOptions","select","hr","tf","setNodes","insertNodes","text","autoformatLists","toggleList","listStyleType","ul","String","raw","matchByRegex","matchString","listRestartPolite","Number","ol","listTodo","checked","AutoformatKit","AutoformatPlugin","options","enableUndoOnDelete","rules","autoformatSmartQuotes","autoformatPunctuation","autoformatLegal","autoformatLegalHtml","autoformatArrow","autoformatMath","map","rule","query","api","some","getType","headingVariants","cva","variants","variant","HeadingElement","PlateElement","as","className","cn","inputs","twMerge","clsx","BasicBlocksKit","ParagraphPlugin","withComponent","H1Plugin","component","break","empty","shortcuts","toggle","H2Plugin","H3Plugin","H4Plugin","H5Plugin","H6Plugin","BlockquotePlugin","HorizontalRulePlugin","readOnly","useReadOnly","selected","useSelected","focused","useFocused","contentEditable","BasicMarksKit","BoldPlugin","ItalicPlugin","UnderlinePlugin","CodePlugin","PlateLeaf","StrikethroughPlugin","SubscriptPlugin","SuperscriptPlugin","HighlightPlugin","KbdPlugin","ContextMenu","ContextMenuPrimitive","Root","ContextMenuTrigger","Trigger","ContextMenuGroup","Group","ContextMenuSub","Sub","ContextMenuSubTrigger","inset","SubTrigger","ChevronRightIcon","ContextMenuSubContent","SubContent","ContextMenuContent","Portal","Content","ContextMenuItem","Item","blockSelectionVariants","defaultVariants","active","false","true","BlockSelection","isBlockSelected","useBlockSelected","isDragging","usePluginOption","DndPlugin","plugin","BlockMenuKit","BlockSelectionPlugin","enableContextMenu","isSelectable","element","getPluginTypes","column","codeLine","td","includes","onKeyDownSelecting","isHotkey","getApi","AIChatPlugin","aiChat","show","belowRootNodes","attributes","BlockMenuPlugin","aboveEditable","useEditorPlugin","setValue","useState","isTouch","isTouchDevice","setIsTouchDevice","useEffect","onResize","window","navigator","maxTouchPoints","addEventListener","removeEventListener","useIsTouchDevice","usePlateState","isOpen","BLOCK_CONTEXT_MENU_ID","handleTurnInto","useCallback","blockSelection","getNodes","forEach","path","listType","unsetNodes","at","toggleBlock","handleAlign","align","getTransforms","onOpenChange","open","blockMenu","hide","modal","asChild","onContextMenu","event","dataset","target","slateEditor","plateOpenContextMenu","preventDefault","setTimeout","clientX","y","clientY","onCloseAutoFocus","focus","onClick","removeNodes","duplicate","setIndent","BlockPlaceholderKit","BlockPlaceholderPlugin","placeholders","buttonVariants","default","destructive","outline","secondary","ghost","link","size","sm","lg","icon","Button","Comp","Slot","TooltipProvider","delayDuration","TooltipPrimitive","Provider","Tooltip","TooltipTrigger","TooltipContent","sideOffset","Arrow","DropdownMenu","DropdownMenuPrimitive","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","CheckIcon","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","CircleIcon","DropdownMenuLabel","Label","DropdownMenuSeparator","Separator","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent","orientation","decorative","SeparatorPrimitive","Toolbar","ToolbarPrimitive","ToolbarToggleGroup","toolbarButtonVariants","dropdownArrowVariants","ToolbarButton","Component","isDropdown","pressed","disabled","ToolbarToggleItem","ChevronDown","tooltip","tooltipContentProps","tooltipProps","tooltipTriggerProps","mounted","setMounted","ToolbarSplitButton","ToolbarSplitButtonPrimary","ToolbarSplitButtonSecondary","stopPropagation","role","ToggleItem","ToolbarGroup","ToolbarMenuGroup","label","EmojiPopover","control","setIsOpen","Popover","EmojiPicker","clearSearch","emoji","emojiLibrary","focusedCategory","hasFound","i18n","icons","categories","emojiCategoryIcons","search","emojiSearchIcons","isSearching","refs","searchResult","searchValue","setSearch","settings","EmojiSettings","visibleCategories","handleCategoryClick","onMouseOver","onSelectEmoji","EmojiPickerNavigation","EmojiPickerSearchBar","EmojiPickerSearchAndClear","EmojiPickerContent","EmojiPickerPreview","EmojiButton","memo","index","onSelect","onMouseEnter","onMouseLeave","skins","native","tabIndex","style","fontFamily","RowOfButtons","row","id","elements","emojiId","getEmoji","getRowWidth","perLine","buttonSize","isCategoryVisible","categoryId","has","EmojiList","getGrid","sections","section","root","width","height","getRows","SearchList","current","contentRoot","content","onChange","placeholder","autoComplete","autoFocus","loupe","title","clear","delete","EmojiPreview","NoEmoji","searchNoResultsTitle","searchNoResultsSubtitle","PickAnEmoji","pick","showPickEmoji","showNoEmoji","showPreview","side","activity","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","viewBox","xmlns","cx","cy","r","d","solid","custom","StarIcon","flags","FlagIcon","foods","AppleIcon","frequent","ClockIcon","nature","LeafIcon","objects","LightbulbIcon","people","SmileIcon","places","CompassIcon","symbols","MusicIcon","XIcon","SearchIcon","CalloutKit","CalloutPlugin","emojiPickerState","useEmojiDropdownMenuState","closeOnSelect","emojiToolbarDropdownProps","calloutProps","useCalloutEmojiPicker","backgroundColor","Command","CommandPrimitive","CommandInput","Input","CommandList","List","CommandEmpty","Empty","CommandGroup","CommandItem","PopoverPrimitive","PopoverTrigger","PopoverContent","PopoverAnchor","Anchor","CodeBlockCombobox","setOpen","useEditorRef","useElement","lang","setSearchValue","items","useMemo","languages","language","toLowerCase","find","shouldFilter","onValueChange","Check","CopyButton","hasCopied","setHasCopied","clipboard","writeText","CopyIcon","lowlight","createLowlight","all","CodeBlockKit","CodeBlockPlugin","isLangSupported","formatCodeBlock","BracesIcon","NodeApi","string","CodeLinePlugin","CodeSyntaxPlugin","tokenClassName","leaf","ColumnElement","withHOC","ResizableProvider","isSelectionAreaVisible","previewRef","handleRef","useDraggable","canDropNode","dragEntry","dropEntry","PathApi","equals","parent","ColumnDragHandle","useComposedRef","DropLine","GripHorizontal","dropLine","useDropLine","ColumnFloatingToolbar","buttonProps","useRemoveNodeButton","isCollapsed","useEditorSelector","useFocusedLast","onColumnChange","widths","setColumns","onOpenAutoFocus","DoubleColumnOutlined","ThreeColumnOutlined","RightSideDoubleColumnOutlined","LeftSideDoubleColumnOutlined","DoubleSideDoubleColumnOutlined","Trash2Icon","clipRule","fillRule","ColumnKit","ColumnPlugin","ColumnItemPlugin","commentPlugin","toTPlatePlugin","BaseCommentPlugin","handlers","setOption","isSet","unsetActiveSuggestion","isSlateString","parentElement","classList","contains","commentsEntry","comment","nodeId","activeId","commentingBlock","hoverId","uniquePathMap","Map","extendTransforms","setDraft","block","collapse","getDraftCommentKey","selection","slice","isOverlapping","getCommentCount","currentId","isActive","isHover","CommentKit","CursorOverlay","cursors","useCursorOverlay","cursor","Cursor","caretPosition","data","selectionRects","streaming","selectionStyle","isCursor","RangeApi","position","i","CursorOverlayKit","CursorOverlayPlugin","afterEditable","Calendar","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","defaultClassNames","getDefaultClassNames","DayPicker","formatMonthDropdown","date","toLocaleString","month","months","nav","button_previous","button_next","month_caption","dropdowns","dropdown_root","dropdown","caption_label","table","weekdays","weekday","week","week_number_header","week_number","day","showWeekNumber","range_start","range_middle","range_end","today","outside","hidden","rootRef","Chevron","ChevronLeftIcon","ChevronDownIcon","DayButton","CalendarDayButton","WeekNumber","modifiers","useRef","toLocaleDateString","DateKit","DatePlugin","trigger","draggable","Date","elementDate","isToday","getDate","getMonth","getFullYear","isYesterday","setDate","toDateString","isTomorrow","year","initialFocus","UNDRAGGABLE_KEYS","tr","Draggable","blockSelectionApi","isAboutToDrag","nodeRef","onDropHandler","_","dragItem","add","resetPreview","isInColumn","isInTable","previewTop","setPreviewTop","replaceChildren","remove","dragButtonTop","setDragButtonTop","getPluginByType","isContainer","calcDragButtonTop","Gutter","top","DragHandle","addOnContextMenu","MemoizedChildren","onMouseDown","button","shiftKey","sort","selectionNodes","blocks","findPath","expandListItemsWithChildren","blur","createDragPreviewElements","append","set","selectedBlocks","processedBlocks","ids","calculatePreviewTop","onMouseUp","GripVertical","removeDataAttributes","from","attr","startsWith","removeAttribute","child","domNode","toDOMNode","newDomNode","cloneNode","original","cloned","scrollLeft","scrollWrapper","document","createElement","overflow","clientWidth","innerContainer","transform","scrollWidth","firstChild","originalStyles","getComputedStyle","padding","applyScrollCompensation","push","wrapper","display","lastDomNode","lastDomNodeRect","getBoundingClientRect","distance","bottom","marginTop","resolveElement","editable","firstSelectedChild","firstDomNode","editorPaddingTop","paddingTop","replace","firstNodeToEditorDistance","firstMarginTopString","currentToEditorDistance","currentMarginTopString","DndKit","enableScroller","onDropFiles","PlaceholderPlugin","insert","media","files","nextBlock","aboveNodes","dom","isType","aboveSlate","DndProvider","backend","HTML5Backend","DocxKit","DocxPlugin","JuicePlugin","ExitBreakKit","ExitBreakPlugin","insertBefore","FixedToolbar","AlignLeftIcon","AlignCenterIcon","AlignRightIcon","AlignJustifyIcon","AlignToolbarButton","useSelectionFragmentProp","defaultValue","getProp","IconValue","item","textAlign","Icon","itemValue","isObject_1","freeGlobal","global","_freeGlobal","freeSelf","self","Function","_root","trimmedEndIndex","reWhitespace","_trimmedEndIndex","test","charAt","reTrimStart","_baseTrim","_Symbol","getRawTag","objectProto","nativeObjectToString","toString","symToStringTag","_getRawTag","isOwn","unmasked","result","objectToString","_objectToString","require$$2","_baseGetTag","baseGetTag","isObjectLike","isObjectLike_1","isSymbol_1","isObject","now","now_1","toNumber","baseTrim","isSymbol","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","toNumber_1","other","valueOf","isBinary","nativeMax","Math","max","nativeMin","min","debounce_1","func","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","arguments","leadingEdge","clearTimeout","cancel","flush","FontColorToolbarButton","nodeType","selectionDefined","color","mark","selectedColor","setSelectedColor","onToggle","updateColor","addMarks","updateColorAndClose","clearColor","removeMarks","ColorPicker","colors","DEFAULT_COLORS","customColors","DEFAULT_CUSTOM_COLORS","updateCustomColor","ColorCustom","ColorDropdownMenuItems","EraserIcon","prev","next","customColor","setCustomColor","c","computedColors","isBrightColor","updateCustomColorDebounced","debounce","ColorInput","PlusIcon","inputRef","Children","cloneElement","click","ColorDropdownMenuItem","isSelected","RedoToolbarButton","history","redos","redo","Redo2Icon","UndoToolbarButton","undos","undo","Undo2Icon","IndentToolbarButton","useIndentButton","IndentIcon","OutdentToolbarButton","useOutdentButton","OutdentIcon","ACTION_THREE_COLUMNS","insertList","create","indent","insertBlockMap","insertColumnGroup","columns","audio","insertAudioPlaceholder","callout","insertCallout","insertCodeBlock","equation","insertEquation","excalidraw","insertExcalidraw","file","insertFilePlaceholder","insertMedia","TablePlugin","toc","insertToc","video","insertVideoPlaceholder","insertInlineMap","insertDate","inlineEquation","insertInlineEquation","triggerFloatingLink","insertBlock","upsert","withoutNormalizing","currentNode","isCurrentBlockEmpty","isEmpty","currentBlockType","getBlockType","isSameBlockType","SuggestionPlugin","suggestion","withoutSuggestions","previousEmptyBlock","insertInlineElement","setList","entry","setBlockMap","toggleColumnGroup","toggleCodeBlock","groups","group","PilcrowIcon","Heading1Icon","Heading2Icon","Heading3Icon","TableIcon","ListIcon","ListOrderedIcon","ImageIcon","Link2Icon","InsertToolbarButton","nestedItems","LinkToolbarButton","state","useLinkToolbarButtonState","useLinkToolbarButton","Link","BulletedListToolbarButton","someList","ListStyleType","Disc","Circle","Square","alignOffset","NumberedListToolbarButton","Decimal","LowerAlpha","UpperAlpha","LowerRoman","UpperRoman","ListOrdered","MarkToolbarButton","useMarkToolbarButtonState","useMarkToolbarButton","AlertDialog","AlertDialogPrimitive","AlertDialogPortal","AlertDialogOverlay","Overlay","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","Action","AlertDialogCancel","Cancel","MEDIA_CONFIG","accept","AudioLinesIcon","FileUpIcon","FilmIcon","MediaToolbarButton","currentConfig","dialogOpen","setDialogOpen","openFilePicker","useFilePicker","multiple","onFilesSelected","plainFiles","updatedFiles","onKeyDown","LinkIcon","MediaUrlDialogContent","url","setUrl","embedMedia","isUrl","toast","split","pop","htmlFor","MoreToolbarButton","MoreHorizontalIcon","toggleMark","SuperscriptIcon","SubscriptIcon","TableToolbarButton","tableSelected","mergeState","useTableMergeState","Table","Grid3x3Icon","TablePicker","canMerge","merge","Combine","canSplit","Ungroup","tableRow","before","ArrowUp","ArrowDown","tableColumn","ArrowLeft","ArrowRight","tablePicker","setTablePicker","grid","colCount","rowCount","rows","rowIndex","columIndex","onMouseMove","colIndex","newGrid","j","onCellMove","turnIntoItems","keywords","Heading4Icon","Heading5Icon","Heading6Icon","TurnIntoToolbarButton","selectedItem","setEntry","setBlockType","DropdownMenuItemIndicator","FixedToolbarButtons","useEditorReadOnly","BoldIcon","ItalicIcon","UnderlineIcon","StrikethroughIcon","BaselineIcon","PaintBucketIcon","FixedToolbarKit","createPlatePlugin","beforeEditable","FloatingToolbar","editorId","useEditorId","focusedEditorId","useEventEditorValue","isFloatingLinkOpen","isAIChatOpen","floatingToolbarState","useFloatingToolbarState","hideToolbar","floatingOptions","middleware","offset","flip","fallbackPlacements","placement","clickOutsideRef","rootProps","floatingRef","useFloatingToolbar","FloatingToolbarButtons","FloatingToolbarKit","FontKit","FontColorPlugin","FontBackgroundColorPlugin","FontSizePlugin","FontFamilyPlugin","LineHeightKit","LineHeightPlugin","popoverVariants","inputVariants","LinkFloatingToolbar","activeCommentId","activeSuggestionId","insertState","useFloatingLinkInsertState","insertProps","insertRef","textInputProps","useFloatingLinkInsert","editState","useFloatingLinkEditState","editButtonProps","editProps","editRef","unlinkButtonProps","useFloatingLinkEdit","inputProps","useFormInputProps","preventDefaultOnEnterKeydown","input","FloatingLinkUrlInput","Text","editContent","isEditing","LinkOpenButton","Unlink","useEditorSelection","getLinkAttributes","ExternalLink","LinkKit","LinkPlugin","suggestionData","IndentKit","IndentPlugin","Checkbox","CheckboxPrimitive","Indicator","todo","Li","Marker","useTodoListElementState","checkboxProps","useTodoListElement","listStart","isOrderedList","start","ListKit","ListPlugin","belowNodes","MarkdownKit","MarkdownPlugin","plainMarks","remarkPlugins","remarkMath","remarkGfm","remarkMdx","remarkMention","EquationInput","createPrimitiveComponent","TextareaAutosize","propsHook","useEquationInput","EquationPopoverContent","isInline","onClose","onEscapeKeyDown","CornerDownLeftIcon","MathKit","InlineEquationPlugin","katexRef","useEquationElement","displayMode","errorColor","fleqn","leqno","macros","output","strict","throwOnError","trust","texExpression","RadicalIcon","EquationPlugin","captionVariants","center","left","right","Caption","CaptionPrimitive","CaptionTextarea","CaptionTextareaPrimitive","CaptionButton","useCaptionButton","stateHook","useCaptionButtonState","AudioElement","unsafeUrl","useMediaState","src","controls","MediaToolbar","isFocusedLast","selectionCollapsed","isExpanded","isImagePreviewOpen","useImagePreviewValue","useFloatingMediaValue","FloatingMediaStore","FloatingMediaPrimitive","UrlInput","EditButton","mediaResizeHandleVariants","direction","resizeHandleVariants","ResizeHandle","useResizeHandleState","resizeHandle","useResizeHandle","isResizing","resizableVariants","Resizable","ResizablePrimitive","MediaEmbedElement","embed","isTweet","isVideo","isYoutube","urlParsers","parseTwitterUrl","parseVideoUrl","useResizableValue","provider","MediaEmbedPlugin","maxWidth","minWidth","LiteYouTubeEmbed","wrapperClass","allowFullScreen","Tweet","FileElement","download","href","rel","FileUp","ImageElement","ImagePlugin","Image","alt","onFocus","useUploadFile","onUploadComplete","onUploadError","uploadedFile","setUploadedFile","uploadingFile","setUploadingFile","progress","setProgress","isUploading","setIsUploading","uploadFile","async","res","uploadFiles","onUploadProgress","errorMessage","err","unknownError","z","ZodError","issues","issue","message","getErrorMessage","mockUploadedFile","appUrl","URL","createObjectURL","simulateProgress","Promise","resolve","useUploadThing","generateReactHelpers","CONTENT","AudioLines","Film","PlaceholderElement","PlaceholderProvider","loading","currentContent","mediaType","isImage","imageRef","firstFile","restFiles","replaceCurrentPlaceholder","addUploadingFile","withoutSaving","initialHeight","initialWidth","isUpload","placeholderId","updateUploadHistory","removeUploadingFile","isReplaced","currentFiles","getUploadingFile","formatBytes","Loader2Icon","ImageProgress","objectUrl","setObjectUrl","revokeObjectURL","round","bytes","opts","decimals","sizeType","floor","log","toFixed","ScaleInput","scaleInputProps","useScaleInput","useUploadErrorToast","uploadError","UploadErrorCode","INVALID_FILE_SIZE","f","INVALID_FILE_TYPE","TOO_LARGE","maxFileSize","TOO_LESS_FILES","minFileCount","fileType","TOO_MANY_FILES","maxFileCount","VideoElement","isEditorMounted","useEditorMounted","ReactPlayer","MediaKit","disableUploadInsert","scale","isEditingScale","closeProps","currentUrlIndex","maskLayerProps","nextDisabled","nextProps","prevDisabled","prevProps","scaleTextProps","zommOutProps","zoomInDisabled","zoomInProps","zoomOutDisabled","useImagePreview","scrollSpeed","PreviewImage","Minus","Plus","Download","X","VideoPlugin","AudioPlugin","FilePlugin","disableEmptyPlaceholder","CaptionPlugin","allow","InlineComboboxContext","createContext","defaultFilter","uniqueTerms","Set","Boolean","keyword","filterWords","InlineCombobox","hideWhenNoValue","setValueProp","showTrigger","valueProp","cursorState","useHTMLInputCursorState","valueState","setValueState","hasValueProp","newValue","insertPoint","point","pointRef","unref","removeInput","useComboboxInput","cancelInputOnBlur","onCancelInput","cause","insertText","move","reverse","hasEmpty","setHasEmpty","contextValue","store","useComboboxStore","startTransition","getState","setActiveId","first","ComboboxProvider","InlineComboboxInput","propRef","contextRef","useContext","useComboboxContext","Combobox","autoSelect","InlineComboboxContent","ComboboxPopover","comboboxItemVariants","interactive","InlineComboboxItem","focusEditor","ComboboxItem","InlineComboboxEmpty","InlineComboboxGroup","ComboboxGroup","InlineComboboxGroupLabel","ComboboxGroupLabel","onSelectItem","getMentionOnSelectItem","MENTIONABLES","MentionKit","MentionPlugin","triggerPreviousCharPattern","useMounted","IS_APPLE","prefix","MentionInputPlugin","SparklesIcon","Code2","Quote","description","TableOfContentsIcon","Columns3Icon","PenToolIcon","CalendarIcon","SlashKit","SlashPlugin","triggerQuery","SlashInputPlugin","suggestionVariants","insertActive","removeActive","SuggestionLineBreakContent","isLineBreak","isRemove","isInsert","suggestionPlugin","hoverSuggestionId","spanRef","Avatar","AvatarPrimitive","AvatarImage","AvatarFallback","Fallback","editorContainerVariants","demo","EditorContainer","PlateContainer","editorVariants","ai","fullWidth","none","Editor","PlateContent","disableDefaultStyles","EditorView","PlateView","Comment","discussionLength","documentContent","editingId","setEditingId","showDocumentContent","onEditorClick","userInfo","discussionPlugin","userId","currentUserId","CommentPlugin","isMyComment","initialValue","contentRich","commentEditor","useCommentEditor","onSave","updatedDiscussions","getOption","discussion","discussionId","updatedComments","comments","isEdited","updatedAt","updateComment","isFirst","isLast","hovering","setHovering","dropdownOpen","setDropdownOpen","avatarUrl","formatCommentDate","createdAt","isResolved","resolveDiscussion","unsetMark","CommentMoreDropdown","edge","onRemoveComment","removeDiscussion","Plate","replaceNodes","selectedEditCommentRef","onDeleteComment","alert","commentIndex","findIndex","onEditComment","PencilIcon","TrashIcon","deps","usePlateEditor","plugins","CommentCreateForm","discussionIdProp","focusOnMount","discussions","commentId","useCommentId","commentValue","setCommentValue","commentContent","onAddComment","reset","newDiscussion","nanoid","updatedDiscussion","concat","commentsNodeEntry","nodes","isDraft","_discussionId","getCommentKey","trim","ArrowUpIcon","diffMinutes","differenceInMinutes","diffHours","differenceInHours","diffDays","differenceInDays","BLOCK_SUGGESTION","TYPE_TEXT_MAP","BlockSuggestionCard","idx","suggestionText2Array","newText","properties","newProperties","toUpperCase","acceptSuggestion","reject","rejectSuggestion","suggestionId","BlockCommentContent","blockPath","commentNodes","draftCommentNode","suggestionNodes","resolvedSuggestions","previousPath","isPath","isText","parentNode","lineBreakId","ElementApi","isElement","suggestionIds","flatMap","TextApi","dataList","entries","n","getSuggestionKey","path1","path2","isChild","lineBreakData","isBlockSuggestion","keyId2SuggestionId","nodeData","s","keyId","useResolveSuggestion","resolvedDiscussions","useResolvedDiscussion","suggestionsCount","discussionsCount","totalCount","activeSuggestion","isCommenting","activeDiscussion","noneActive","sortedMergedData","a","b","getTime","_open","commentingCurrent","anchorElement","activeNode","_open_","virtualRef","BlockComment","PencilLineIcon","MessageSquareTextIcon","MessagesSquareIcon","commentsIds","firstBlockPath","seed","users","alice","bob","charlie","commentsApi","getTransientSuggestionKey","extendSelectors","currentUser","user","BaseSuggestionPlugin","isBlockLeaf","blockSuggestion","isSlateEditor","suggestionEntry","leafId","hasRemove","hasActive","hasHover","update","SuggestionKit","BorderAllIcon","rx","BorderBottomIcon","BorderLeftIcon","BorderNoneIcon","BorderRightIcon","BorderTopIcon","TableElement","TableProvider","hasControls","isSelectingCell","marginLeft","tableProps","useTableElement","isSelectingTable","paddingLeft","TableFloatingToolbar","collapsedInside","ColorDropdownMenu","CombineIcon","SquareSplitHorizontalIcon","Grid2X2Icon","TableBordersDropdownMenuContent","getOnSelectTableBorder","hasBottomBorder","hasLeftBorder","hasNoBorders","hasOuterBorders","hasRightBorder","hasTopBorder","useTableBordersDropdownMenuContentState","onCheckedChange","selectedCells","onUpdateColor","setCellBackground","onClearColor","RowDragHandle","dragRef","RowDropLine","TableCellElement","isHeader","tableId","useElementSelector","rowId","isSelectingRow","borders","colSpan","minHeight","useTableCellElement","bottomProps","hiddenLeft","leftProps","rightProps","useTableCellElementResizable","background","getColSpan","rowSpan","getRowSpan","suppressContentEditableWarning","columnResizeVariants","TableKit","TableRowPlugin","dragElement","TableCellPlugin","TableCellHeaderPlugin","headingItemVariants","depth","TocKit","TocPlugin","topOffset","useTocElementState","btnProps","useTocElement","headingList","ToggleKit","TogglePlugin","useToggleButtonState","useToggleButton","ChevronRight","EditorKit","TrailingBlockPlugin","PlateEditor","BaseAlignKit","BaseTextAlignPlugin","HeadingElementStatic","SlateElement","BaseBasicBlocksKit","BaseParagraphPlugin","BaseH1Plugin","BaseH2Plugin","BaseH3Plugin","BaseH4Plugin","BaseH5Plugin","BaseH6Plugin","BaseBlockquotePlugin","BaseHorizontalRulePlugin","BaseBasicMarksKit","BaseBoldPlugin","BaseItalicPlugin","BaseUnderlinePlugin","BaseCodePlugin","SlateLeaf","BaseStrikethroughPlugin","BaseSubscriptPlugin","BaseSuperscriptPlugin","BaseHighlightPlugin","BaseKbdPlugin","BaseCalloutKit","BaseCalloutPlugin","BaseCodeBlockKit","BaseCodeBlockPlugin","BaseCodeLinePlugin","BaseCodeSyntaxPlugin","BaseColumnKit","BaseColumnPlugin","BaseColumnItemPlugin","BaseCommentKit","BaseDateKit","BaseDatePlugin","BaseFontKit","BaseFontColorPlugin","BaseFontBackgroundColorPlugin","BaseFontSizePlugin","BaseFontFamilyPlugin","BaseLineHeightKit","BaseLineHeightPlugin","BaseLinkKit","BaseLinkPlugin","BaseIndentKit","BaseIndentPlugin","BaseListKit","BaseListPlugin","BaseMathKit","BaseInlineEquationPlugin","html","getEquationHtml","dangerouslySetInnerHTML","__html","BaseEquationPlugin","BaseMediaKit","BaseImagePlugin","caption","BaseVideoPlugin","BaseAudioPlugin","BaseFilePlugin","BaseCaptionPlugin","BaseMediaEmbedPlugin","BasePlaceholderPlugin","BaseMentionKit","BaseMentionPlugin","BaseSuggestionKit","TableCellElementStatic","getPlugin","BaseTablePlugin","getCellSize","getCellBorders","BaseTableKit","disableMarginLeft","getOptions","BaseTableRowPlugin","BaseTableCellPlugin","BaseTableCellHeaderPlugin","headingDepth","getHeadingList","BaseTocPlugin","queryHeading","values","isHeading","BaseTocKit","BaseEditorKit","BaseTogglePlugin"],"mappings":"62XAWA,eAAiBA,QAAQC,IAAIC,UAAA,WAEzB,SAASC,EAAyBC,GAChC,GAAI,MAAQA,EAAM,OAAO,KACzB,GAAI,mBAAsBA,EACxB,OAAOA,EAAKC,WAAaC,EACrB,KACAF,EAAKG,aAAeH,EAAKI,MAAQ,KACvC,GAAI,iBAAoBJ,EAAM,OAAOA,EACrC,OAAQA,GACN,KAAKK,EACH,MAAO,WACT,KAAKC,EACH,MAAO,WACT,KAAKC,EACH,MAAO,aACT,KAAKC,EACH,MAAO,WACT,KAAKC,EACH,MAAO,eACT,KAAKC,EACH,MAAO,WAEX,GAAI,iBAAoBV,EACtB,OACG,iBAAoBA,EAAKW,KACxBC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AA6vB,MACAA,EAAAW,OACAA,EAAAN,YACAA,KACG95B;AAMH,OACEgE,GAAAA,IAAC,MAAA,CACC4F,UAAWC,GACT,6DACAD,MAEE5J,EAEJS,gCAACoT,GAAA,CACEpT,SAAA,CAAA25B,EAAOrxB,IAAI,EAAGmyB,gBAAe19B,OAAMuB,0BAClCiF,GAAAA,IAAC23B,GAAA,CACCn+B,OAEAuB,QACAm8B,gBACAU,WAAYnC,IAAU16B,EACtB+6B,eAJKt8B,GAAQuB,IAOhBiB,EAAMS,aAIf,CAEO,MAAM45B,GAAiB,CAC5B,CACEa,eAAe,EACf19B,KAAM,QACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,OACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,QACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,YACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,MACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,SACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,SACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,QACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,OACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,OACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,SACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,UACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,oBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,0BACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,oBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,0BACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,oBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,0BACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,kBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,mBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,aACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,yBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,mBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,aACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,eACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,yBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,cACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,gBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,iBACNuB,MAAO,WAGT,CACEm8B,eAAe,EACf19B,KAAM,mBACNuB,MAAO,WAET,CACEm8B,eAAe,EACf19B,KAAM,aACNuB,MAAO,W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