@collabchron/notiq 0.2.0 → 1.0.0
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/LICENSE +21 -0
- package/README.md +230 -39
- package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +15 -0
- package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +161 -0
- package/dist/EquationComponent-CB6DFIHV.mjs +154 -0
- package/dist/ExcalidrawComponent-XW6646OH.mjs +528 -0
- package/dist/ExcalidrawPlugin-ZFHT62IF.mjs +14 -0
- package/dist/ExportPlugin-V2RLM63S.mjs +11 -0
- package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +12 -0
- package/dist/FloatingTextFormatToolbarPlugin-F2GY6LMI.mjs +30 -0
- package/dist/HintComponet-BRL6EAMS.mjs +217 -0
- package/dist/InlineImageComponent-UWIUWBHI.mjs +453 -0
- package/dist/MobileToolbar-BOOZAMQE.mjs +268 -0
- package/dist/SlashCommand-GMT5JI33.mjs +28 -0
- package/dist/StoryBuilderComponent-JGDBM5JU.mjs +562 -0
- package/{src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx → dist/TableCellActionMenuPlugin-PGK2K3VG.mjs} +667 -759
- package/{src/components/editor/plugins/TableHoverActionsPlugin/index.tsx → dist/TableHoverActionsPlugin-GJVE6VRW.mjs} +258 -314
- package/dist/TemplatePlugin-ZD3QEVTI.mjs +9 -0
- package/dist/ToolbarPlugin-7TOZRD2R.mjs +1547 -0
- package/dist/babel-JZ2EV6AX.mjs +7233 -0
- package/dist/background-color-XZTYLGO2.mjs +362 -0
- package/dist/block-format-YJCV2DIY.mjs +15 -0
- package/dist/chunk-2FNEAMSP.mjs +127 -0
- package/dist/chunk-3CPBODXA.mjs +84 -0
- package/dist/chunk-3G37YKTV.mjs +83 -0
- package/dist/chunk-3JVFG7ER.mjs +184 -0
- package/dist/chunk-456TN7IM.mjs +110 -0
- package/dist/chunk-4EXYCTGJ.mjs +27 -0
- package/{src/utils/getSelectedNode.ts → dist/chunk-4HBCVSE6.mjs} +26 -27
- package/dist/chunk-4MEDW3T6.mjs +125 -0
- package/dist/chunk-4VWFVWYP.mjs +36 -0
- package/dist/chunk-5BAKY5KN.mjs +84 -0
- package/dist/chunk-5QSNIVIG.mjs +333 -0
- package/dist/chunk-64Z3FI7T.mjs +37 -0
- package/{src/components/editor/nodes/Stepper/index.tsx → dist/chunk-6RNZQOH2.mjs} +214 -260
- package/dist/chunk-77KXU36M.mjs +64 -0
- package/dist/chunk-77UA6HYR.mjs +165 -0
- package/dist/chunk-7NZAPJ4G.mjs +102 -0
- package/dist/chunk-7VUMHWWL.mjs +152 -0
- package/dist/chunk-AMMKBSST.mjs +1256 -0
- package/dist/chunk-BIU7WTLX.mjs +95 -0
- package/dist/chunk-EGMI62PP.mjs +83 -0
- package/dist/chunk-EHNQD5KO.mjs +88 -0
- package/dist/chunk-FSM26655.mjs +37 -0
- package/{src/components/editor/nodes/Hint/index.tsx → dist/chunk-G53GLEAY.mjs} +158 -190
- package/dist/chunk-GK35L7UY.mjs +28 -0
- package/dist/chunk-GXYD4VZM.mjs +193 -0
- package/dist/chunk-GYIOYVCN.mjs +538 -0
- package/dist/chunk-GZPNVR7L.mjs +157 -0
- package/dist/chunk-JXDPPUJI.mjs +52 -0
- package/dist/chunk-K36V4SIW.mjs +141 -0
- package/dist/chunk-KJ6AJ44Q.mjs +128 -0
- package/dist/chunk-KJV3FAZ7.mjs +142 -0
- package/{src/components/editor/plugins/ImagesPlugin/index.tsx → dist/chunk-LGG4IUIA.mjs} +189 -222
- package/dist/chunk-LQN3CMKV.mjs +1906 -0
- package/dist/chunk-N3WN46VL.mjs +236 -0
- package/dist/chunk-PBD6LMLC.mjs +366 -0
- package/dist/chunk-POGRR73N.mjs +33 -0
- package/{src/components/editor/utils/editorFormatting.ts → dist/chunk-PZSUSXQG.mjs} +238 -282
- package/dist/chunk-QEIFVK5M.mjs +29 -0
- package/dist/chunk-QHIQKMVN.mjs +427 -0
- package/dist/chunk-TCYK7DM7.mjs +36 -0
- package/dist/chunk-TTHQCW5F.mjs +47 -0
- package/dist/chunk-U47ABU5Z.mjs +53 -0
- package/dist/chunk-WDG7J2DY.mjs +116 -0
- package/dist/chunk-WJRHXI2C.mjs +733 -0
- package/dist/chunk-XLER2DHM.mjs +357 -0
- package/dist/chunk-XWC4TK2N.mjs +315 -0
- package/dist/chunk-YHPNOWFH.mjs +15 -0
- package/dist/chunk-YKC3SO4Z.mjs +32 -0
- package/dist/chunk-YMBXLRW5.mjs +374 -0
- package/dist/chunk-YPHOEJ46.mjs +64 -0
- package/dist/chunk-YUDCJRJM.mjs +25 -0
- package/dist/chunk-Z4EWP7BI.mjs +65 -0
- package/dist/chunk-ZB5LZQKC.mjs +191 -0
- package/dist/chunk-ZJRKATOJ.mjs +65 -0
- package/dist/color-BPKOPQKN.mjs +12 -0
- package/dist/estree-XC56IUFX.mjs +4414 -0
- package/dist/font-FEZ3GKSF.mjs +13 -0
- package/dist/font-size-EK775WRH.mjs +15 -0
- package/dist/html-S3ACX7NI.mjs +2738 -0
- package/dist/image-2PJIAYAT.mjs +993 -0
- package/dist/index.d.mts +145 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.js +57855 -0
- package/dist/index.mjs +1790 -0
- package/dist/insert-gif-SAIDYURE.mjs +100 -0
- package/dist/insert-image-U3RJN3OW.mjs +259 -0
- package/dist/insert-node-5P2CRJ7S.mjs +201 -0
- package/dist/insert-poll-HCPM7MO6.mjs +33 -0
- package/dist/insert-table-24XYUS2W.mjs +66 -0
- package/dist/markdown-SNVBOSRA.mjs +3487 -0
- package/dist/poll-component-2R4MDLHS.mjs +303 -0
- package/dist/postcss-ONF3VDIM.mjs +5051 -0
- package/dist/standalone-EOIALU3M.mjs +2373 -0
- package/dist/stepper-FSARL6X6.mjs +304 -0
- package/dist/styles/notiq.css +1149 -0
- package/dist/text-align-VLECWO4H.mjs +118 -0
- package/dist/text-format-BG5WOOPZ.mjs +16 -0
- package/dist/typescript-AMPI6OVS.mjs +13135 -0
- package/package.json +94 -10
- package/src/styles/notiq.css +1149 -0
- package/src/styles/tailwind-plugin.ts +134 -0
- package/components.json +0 -21
- package/eslint.config.mjs +0 -16
- package/next.config.ts +0 -12
- package/postcss.config.mjs +0 -5
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/images/icons/plus.svg +0 -10
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/src/app/actions.ts +0 -2
- package/src/app/api/ai/route.ts +0 -175
- package/src/app/api/edgestore/[...edgestore]/route.ts +0 -28
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -205
- package/src/app/layout.tsx +0 -38
- package/src/app/page.tsx +0 -12
- package/src/components/editor/Core.tsx +0 -220
- package/src/components/editor/hooks/instructions-messages.ts +0 -300
- package/src/components/editor/hooks/use-mobile.ts +0 -19
- package/src/components/editor/hooks/useReport.ts +0 -67
- package/src/components/editor/hooks/useResizeObservert.ts +0 -22
- package/src/components/editor/index.tsx +0 -39
- package/src/components/editor/lexical-on-change.tsx +0 -28
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +0 -92
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +0 -65
- package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +0 -105
- package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +0 -143
- package/src/components/editor/nodes/EquationNode/EquationNode.tsx +0 -170
- package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +0 -228
- package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +0 -137
- package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +0 -317
- package/src/components/editor/nodes/ExcalidrawNode/index.tsx +0 -204
- package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +0 -134
- package/src/components/editor/nodes/Hint/HintComponet.tsx +0 -221
- package/src/components/editor/nodes/ImageNode/index.tsx +0 -328
- package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +0 -383
- package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +0 -94
- package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +0 -309
- package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +0 -146
- package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +0 -79
- package/src/components/editor/nodes/PollNode/index.tsx +0 -204
- package/src/components/editor/nodes/TweetNode/index.tsx +0 -214
- package/src/components/editor/nodes/index.ts +0 -81
- package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +0 -350
- package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +0 -56
- package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +0 -70
- package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +0 -192
- package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +0 -217
- package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +0 -26
- package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +0 -21
- package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +0 -76
- package/src/components/editor/plugins/CollapsiblePlugin/index.ts +0 -228
- package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +0 -44
- package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +0 -52
- package/src/components/editor/plugins/EquationsPlugin/index.tsx +0 -85
- package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +0 -98
- package/src/components/editor/plugins/FigmaPlugin/index.tsx +0 -42
- package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +0 -445
- package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +0 -275
- package/src/components/editor/plugins/InlineImagePlugin/index.tsx +0 -351
- package/src/components/editor/plugins/LayoutPlugin/index.tsx +0 -238
- package/src/components/editor/plugins/LinkPlugin/index.tsx +0 -36
- package/src/components/editor/plugins/LinkWithMetaData/index.tsx +0 -271
- package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -11
- package/src/components/editor/plugins/MarkdownTransformers/index.tsx +0 -304
- package/src/components/editor/plugins/PollPlugin/index.tsx +0 -49
- package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +0 -180
- package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +0 -253
- package/src/components/editor/plugins/SlashCommand/index.tsx +0 -621
- package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +0 -127
- package/src/components/editor/plugins/TabFocusPlugin/index.ts +0 -58
- package/src/components/editor/plugins/TableCellResizer/index.tsx +0 -438
- package/src/components/editor/plugins/TablePlugin/index.tsx +0 -99
- package/src/components/editor/plugins/ToolbarPlugin/index.tsx +0 -522
- package/src/components/editor/plugins/TwitterPlugin/index.ts +0 -35
- package/src/components/editor/plugins/YouTubeNode/index.tsx +0 -179
- package/src/components/editor/plugins/YouTubePlugin/index.ts +0 -41
- package/src/components/editor/themes/editor-theme.ts +0 -113
- package/src/components/editor/themes/theme.css +0 -377
- package/src/components/editor/utils/ai.ts +0 -291
- package/src/components/editor/utils/canUseDOM.ts +0 -12
- package/src/components/editor/utils/environment.ts +0 -50
- package/src/components/editor/utils/extract-data.ts +0 -166
- package/src/components/editor/utils/getAllLexicalChildren.ts +0 -13
- package/src/components/editor/utils/getDOMRangeRect.ts +0 -27
- package/src/components/editor/utils/getSelectedNode.ts +0 -27
- package/src/components/editor/utils/gif.ts +0 -29
- package/src/components/editor/utils/invariant.ts +0 -15
- package/src/components/editor/utils/setFloatingElemPosition.ts +0 -51
- package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +0 -40
- package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +0 -51
- package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +0 -15
- package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +0 -114
- package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +0 -6
- package/src/components/editor/utils/url.ts +0 -109
- package/src/components/editor/utils/useLayoutEffect.ts +0 -13
- package/src/components/providers/QueryProvider.tsx +0 -15
- package/src/components/providers/SharedHistoryContext.tsx +0 -28
- package/src/components/providers/ToolbarContext.tsx +0 -123
- package/src/components/providers/theme-provider.tsx +0 -11
- package/src/components/theme/ModeToggle.tsx +0 -40
- package/src/components/ui/FileInput.tsx +0 -40
- package/src/components/ui/Input.css +0 -32
- package/src/components/ui/Select.css +0 -42
- package/src/components/ui/Select.tsx +0 -36
- package/src/components/ui/TextInput.tsx +0 -48
- package/src/components/ui/ai/ai-button.tsx +0 -574
- package/src/components/ui/ai/border.tsx +0 -99
- package/src/components/ui/ai/placeholder-input-vanish.tsx +0 -282
- package/src/components/ui/button.tsx +0 -89
- package/src/components/ui/card.tsx +0 -76
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/dialog/Dialog.css +0 -25
- package/src/components/ui/dialog/Dialog.tsx +0 -34
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/drop-downs/background-color.tsx +0 -183
- package/src/components/ui/drop-downs/block-format.tsx +0 -159
- package/src/components/ui/drop-downs/code.tsx +0 -42
- package/src/components/ui/drop-downs/color.tsx +0 -177
- package/src/components/ui/drop-downs/font-size.tsx +0 -138
- package/src/components/ui/drop-downs/font.tsx +0 -155
- package/src/components/ui/drop-downs/index.tsx +0 -122
- package/src/components/ui/drop-downs/insert-node.tsx +0 -213
- package/src/components/ui/drop-downs/text-align.tsx +0 -123
- package/src/components/ui/drop-downs/text-format.tsx +0 -104
- package/src/components/ui/dropdown-menu.tsx +0 -201
- package/src/components/ui/equation/EquationEditor.css +0 -38
- package/src/components/ui/equation/EquationEditor.tsx +0 -56
- package/src/components/ui/equation/KatexEquationAlterer.css +0 -41
- package/src/components/ui/equation/KatexEquationAlterer.tsx +0 -83
- package/src/components/ui/equation/KatexRenderer.tsx +0 -66
- package/src/components/ui/excalidraw/ExcalidrawModal.css +0 -64
- package/src/components/ui/excalidraw/ExcalidrawModal.tsx +0 -234
- package/src/components/ui/excalidraw/Modal.css +0 -62
- package/src/components/ui/excalidraw/Modal.tsx +0 -110
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/image/error-image.tsx +0 -17
- package/src/components/ui/image/file-upload.tsx +0 -240
- package/src/components/ui/image/image-resizer.tsx +0 -297
- package/src/components/ui/image/image-toolbar.tsx +0 -264
- package/src/components/ui/image/index.tsx +0 -408
- package/src/components/ui/image/lazy-image.tsx +0 -68
- package/src/components/ui/image/lazy-video.tsx +0 -71
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/models/custom-dialog.tsx +0 -320
- package/src/components/ui/models/insert-gif.tsx +0 -90
- package/src/components/ui/models/insert-image.tsx +0 -52
- package/src/components/ui/models/insert-poll.tsx +0 -29
- package/src/components/ui/models/insert-table.tsx +0 -62
- package/src/components/ui/models/use-model.tsx +0 -91
- package/src/components/ui/poll/poll-component.tsx +0 -304
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/progress.tsx +0 -28
- package/src/components/ui/scroll-area.tsx +0 -48
- package/src/components/ui/separator.tsx +0 -31
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -31
- package/src/components/ui/stepper/step.tsx +0 -179
- package/src/components/ui/stepper/stepper.tsx +0 -89
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle.tsx +0 -71
- package/src/components/ui/tooltip.tsx +0 -32
- package/src/components/ui/write/text-format-floting-toolbar.tsx +0 -346
- package/src/lib/edgestore.ts +0 -9
- package/src/lib/pinecone-client.ts +0 -0
- package/src/lib/utils.ts +0 -6
- package/src/utils/docSerialization.ts +0 -77
- package/src/utils/emoji-list.ts +0 -16615
- package/src/utils/getDOMRangeRect.ts +0 -27
- package/src/utils/getThemeSelector.ts +0 -25
- package/src/utils/isMobileWidth.ts +0 -7
- package/src/utils/joinClasses.ts +0 -13
- package/src/utils/setFloatingElemPosition.ts +0 -74
- package/src/utils/setFloatingElemPositionForLinkEditor.ts +0 -46
- package/src/utils/swipe.ts +0 -127
- package/src/utils/url.ts +0 -38
- package/tsconfig.json +0 -27
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-YHPNOWFH.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadValues,
|
|
7
|
+
init_react_shim
|
|
8
|
+
} from "./chunk-77KXU36M.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/ui/button.tsx
|
|
11
|
+
init_react_shim();
|
|
12
|
+
import * as React2 from "react";
|
|
13
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
|
|
16
|
+
// src/components/ui/tooltip.tsx
|
|
17
|
+
init_react_shim();
|
|
18
|
+
import * as React from "react";
|
|
19
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
20
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
21
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
22
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
23
|
+
var TooltipContent = React.forwardRef((_a, ref) => {
|
|
24
|
+
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
25
|
+
return /* @__PURE__ */ React.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
|
|
26
|
+
TooltipPrimitive.Content,
|
|
27
|
+
__spreadValues({
|
|
28
|
+
ref,
|
|
29
|
+
sideOffset,
|
|
30
|
+
className: cn(
|
|
31
|
+
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",
|
|
32
|
+
className
|
|
33
|
+
)
|
|
34
|
+
}, props)
|
|
35
|
+
));
|
|
36
|
+
});
|
|
37
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
38
|
+
|
|
39
|
+
// src/components/ui/button.tsx
|
|
40
|
+
var buttonVariants = cva(
|
|
41
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
42
|
+
{
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
46
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
47
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
48
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
49
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
50
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
51
|
+
transparent: "bg-transparent border border-input"
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
default: "h-9 px-4 py-2",
|
|
55
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
56
|
+
lg: "h-10 rounded-md px-8",
|
|
57
|
+
icon: "h-9 w-9",
|
|
58
|
+
Toolbar: "h-7 w-7 p-3 ",
|
|
59
|
+
custom: ""
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
variant: "default",
|
|
64
|
+
size: "default"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
var Button = React2.forwardRef(
|
|
69
|
+
(_a, ref) => {
|
|
70
|
+
var _b = _a, { className, variant, tip, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "tip", "size", "asChild"]);
|
|
71
|
+
const Comp = asChild ? Slot : "button";
|
|
72
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, !!tip ? /* @__PURE__ */ React2.createElement(TooltipProvider, null, /* @__PURE__ */ React2.createElement(Tooltip, null, /* @__PURE__ */ React2.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React2.createElement(
|
|
73
|
+
Comp,
|
|
74
|
+
__spreadValues({
|
|
75
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
76
|
+
ref
|
|
77
|
+
}, props)
|
|
78
|
+
)), /* @__PURE__ */ React2.createElement(TooltipContent, null, /* @__PURE__ */ React2.createElement("p", null, tip)))) : /* @__PURE__ */ React2.createElement(
|
|
79
|
+
Comp,
|
|
80
|
+
__spreadValues({
|
|
81
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
82
|
+
ref
|
|
83
|
+
}, props)
|
|
84
|
+
));
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
Button.displayName = "Button";
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
TooltipProvider,
|
|
91
|
+
Tooltip,
|
|
92
|
+
TooltipTrigger,
|
|
93
|
+
TooltipContent,
|
|
94
|
+
Button
|
|
95
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Command,
|
|
3
|
+
CommandEmpty,
|
|
4
|
+
CommandGroup,
|
|
5
|
+
CommandInput,
|
|
6
|
+
CommandItem,
|
|
7
|
+
CommandList,
|
|
8
|
+
CommandShortcut
|
|
9
|
+
} from "./chunk-KJ6AJ44Q.mjs";
|
|
10
|
+
import {
|
|
11
|
+
Popover,
|
|
12
|
+
PopoverContent,
|
|
13
|
+
PopoverTrigger
|
|
14
|
+
} from "./chunk-64Z3FI7T.mjs";
|
|
15
|
+
import {
|
|
16
|
+
Button
|
|
17
|
+
} from "./chunk-BIU7WTLX.mjs";
|
|
18
|
+
import {
|
|
19
|
+
cn
|
|
20
|
+
} from "./chunk-YHPNOWFH.mjs";
|
|
21
|
+
import {
|
|
22
|
+
init_react_shim
|
|
23
|
+
} from "./chunk-77KXU36M.mjs";
|
|
24
|
+
|
|
25
|
+
// src/components/ui/drop-downs/index.tsx
|
|
26
|
+
init_react_shim();
|
|
27
|
+
import * as React from "react";
|
|
28
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
29
|
+
function DropDown({
|
|
30
|
+
className,
|
|
31
|
+
TriggerLabel,
|
|
32
|
+
TriggerClassName,
|
|
33
|
+
values,
|
|
34
|
+
disabled,
|
|
35
|
+
PopoverContentClassName,
|
|
36
|
+
triggerVariants = "outline",
|
|
37
|
+
ShowChevronsUpDown = true,
|
|
38
|
+
side = "bottom",
|
|
39
|
+
sideOffset = 5
|
|
40
|
+
}) {
|
|
41
|
+
const [value, setValue] = React.useState("");
|
|
42
|
+
return /* @__PURE__ */ React.createElement(Popover, { modal: false }, /* @__PURE__ */ React.createElement(PopoverTrigger, { disabled, asChild: true }, /* @__PURE__ */ React.createElement(
|
|
43
|
+
Button,
|
|
44
|
+
{
|
|
45
|
+
variant: triggerVariants,
|
|
46
|
+
role: "combobox",
|
|
47
|
+
size: "Toolbar",
|
|
48
|
+
style: TriggerClassName,
|
|
49
|
+
className
|
|
50
|
+
},
|
|
51
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex flex-row justify-center gap-x-3 items-center" }, TriggerLabel),
|
|
52
|
+
ShowChevronsUpDown && /* @__PURE__ */ React.createElement(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
53
|
+
)), /* @__PURE__ */ React.createElement(
|
|
54
|
+
PopoverContent,
|
|
55
|
+
{
|
|
56
|
+
side,
|
|
57
|
+
sideOffset,
|
|
58
|
+
style: PopoverContentClassName,
|
|
59
|
+
className: "w-[200px] p-0 dropdown-portal"
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ React.createElement(Command, null, /* @__PURE__ */ React.createElement(CommandInput, { placeholder: "Search..." }), /* @__PURE__ */ React.createElement(CommandList, null, /* @__PURE__ */ React.createElement(CommandEmpty, null, "No found."), /* @__PURE__ */ React.createElement(CommandGroup, null, values.map((framework) => /* @__PURE__ */ React.createElement(
|
|
62
|
+
CommandItem,
|
|
63
|
+
{
|
|
64
|
+
key: framework.label,
|
|
65
|
+
value: framework.label,
|
|
66
|
+
style: framework.style,
|
|
67
|
+
className: cn(
|
|
68
|
+
"cursor-pointer",
|
|
69
|
+
value === framework.label && "bg-gray-300/10"
|
|
70
|
+
),
|
|
71
|
+
onSelect: (currentValue) => {
|
|
72
|
+
setValue(currentValue === value ? "" : currentValue);
|
|
73
|
+
if (framework.func) framework == null ? void 0 : framework.func();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-row items-center justify-between" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4 flex-row" }, framework.icon, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, framework.label, /* @__PURE__ */ React.createElement("span", { className: "text-sm text-muted-foreground" }, framework.desc))), framework.shortcuts && /* @__PURE__ */ React.createElement(CommandShortcut, null, framework.shortcuts))
|
|
77
|
+
)))))
|
|
78
|
+
));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
DropDown
|
|
83
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExcalidrawModal
|
|
3
|
+
} from "./chunk-XWC4TK2N.mjs";
|
|
4
|
+
import {
|
|
5
|
+
$createExcalidrawNode,
|
|
6
|
+
ExcalidrawNode
|
|
7
|
+
} from "./chunk-KJV3FAZ7.mjs";
|
|
8
|
+
import {
|
|
9
|
+
React,
|
|
10
|
+
init_react_shim
|
|
11
|
+
} from "./chunk-77KXU36M.mjs";
|
|
12
|
+
|
|
13
|
+
// src/components/editor/plugins/ExcalidrawPlugin/index.tsx
|
|
14
|
+
init_react_shim();
|
|
15
|
+
import "@excalidraw/excalidraw/index.css";
|
|
16
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
17
|
+
import { $wrapNodeInElement } from "@lexical/utils";
|
|
18
|
+
import {
|
|
19
|
+
$createParagraphNode,
|
|
20
|
+
$insertNodes,
|
|
21
|
+
$isRootOrShadowRoot,
|
|
22
|
+
COMMAND_PRIORITY_EDITOR,
|
|
23
|
+
createCommand
|
|
24
|
+
} from "lexical";
|
|
25
|
+
import { useEffect, useState } from "react";
|
|
26
|
+
var INSERT_EXCALIDRAW_COMMAND = createCommand(
|
|
27
|
+
"INSERT_EXCALIDRAW_COMMAND"
|
|
28
|
+
);
|
|
29
|
+
function ExcalidrawPlugin() {
|
|
30
|
+
const [editor] = useLexicalComposerContext();
|
|
31
|
+
const [isModalOpen, setModalOpen] = useState(false);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!editor.hasNodes([ExcalidrawNode])) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
"ExcalidrawPlugin: ExcalidrawNode not registered on editor"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return editor.registerCommand(
|
|
39
|
+
INSERT_EXCALIDRAW_COMMAND,
|
|
40
|
+
() => {
|
|
41
|
+
setModalOpen(true);
|
|
42
|
+
return true;
|
|
43
|
+
},
|
|
44
|
+
COMMAND_PRIORITY_EDITOR
|
|
45
|
+
);
|
|
46
|
+
}, [editor]);
|
|
47
|
+
const onClose = () => {
|
|
48
|
+
setModalOpen(false);
|
|
49
|
+
};
|
|
50
|
+
const onDelete = () => {
|
|
51
|
+
setModalOpen(false);
|
|
52
|
+
};
|
|
53
|
+
const onSave = (elements, appState, files) => {
|
|
54
|
+
editor.update(() => {
|
|
55
|
+
const excalidrawNode = $createExcalidrawNode();
|
|
56
|
+
excalidrawNode.setData(
|
|
57
|
+
JSON.stringify({
|
|
58
|
+
appState,
|
|
59
|
+
elements,
|
|
60
|
+
files
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
$insertNodes([excalidrawNode]);
|
|
64
|
+
if ($isRootOrShadowRoot(excalidrawNode.getParentOrThrow())) {
|
|
65
|
+
$wrapNodeInElement(excalidrawNode, $createParagraphNode).selectEnd();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
setModalOpen(false);
|
|
69
|
+
};
|
|
70
|
+
return isModalOpen ? /* @__PURE__ */ React.createElement(
|
|
71
|
+
ExcalidrawModal,
|
|
72
|
+
{
|
|
73
|
+
initialElements: [],
|
|
74
|
+
initialAppState: {},
|
|
75
|
+
initialFiles: {},
|
|
76
|
+
isShown: isModalOpen,
|
|
77
|
+
onDelete,
|
|
78
|
+
onClose,
|
|
79
|
+
onSave,
|
|
80
|
+
closeOnClickOutside: false
|
|
81
|
+
}
|
|
82
|
+
) : null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
INSERT_EXCALIDRAW_COMMAND,
|
|
87
|
+
ExcalidrawPlugin
|
|
88
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-YHPNOWFH.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadValues,
|
|
7
|
+
init_react_shim
|
|
8
|
+
} from "./chunk-77KXU36M.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/ui/badge.tsx
|
|
11
|
+
init_react_shim();
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
var badgeVariants = cva(
|
|
15
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
20
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
22
|
+
outline: "text-foreground"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
function Badge(_a) {
|
|
31
|
+
var _b = _a, { className, variant } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
32
|
+
return /* @__PURE__ */ React.createElement("div", __spreadValues({ className: cn(badgeVariants({ variant }), className) }, props));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
Badge
|
|
37
|
+
};
|
|
@@ -1,190 +1,158 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
export function $insertHintNode(type: HintType) {
|
|
160
|
-
const selection = $getSelection();
|
|
161
|
-
if ($isRangeSelection(selection)) {
|
|
162
|
-
const hintNode = $createHintNode(type);
|
|
163
|
-
selection.insertNodes([hintNode]);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
export default function HintPlugin() {
|
|
170
|
-
const [editor] = useLexicalComposerContext();
|
|
171
|
-
useEffect(() => {
|
|
172
|
-
if (!editor.hasNodes([Hint])) {
|
|
173
|
-
throw new Error("Hint: Hint not registered on editor");
|
|
174
|
-
}
|
|
175
|
-
}, [editor]);
|
|
176
|
-
useEffect(() => {
|
|
177
|
-
return editor.registerCommand(
|
|
178
|
-
INSERT_HINT_COMMAND,
|
|
179
|
-
(payload: HintType, editor: LexicalEditor) => {
|
|
180
|
-
editor.update(() => {
|
|
181
|
-
$insertHintNode(payload);
|
|
182
|
-
});
|
|
183
|
-
return true;
|
|
184
|
-
},
|
|
185
|
-
COMMAND_PRIORITY_LOW
|
|
186
|
-
);
|
|
187
|
-
}, [editor]);
|
|
188
|
-
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues,
|
|
4
|
+
init_react_shim
|
|
5
|
+
} from "./chunk-77KXU36M.mjs";
|
|
6
|
+
|
|
7
|
+
// src/components/editor/nodes/Hint/index.tsx
|
|
8
|
+
init_react_shim();
|
|
9
|
+
import {
|
|
10
|
+
createCommand,
|
|
11
|
+
createEditor,
|
|
12
|
+
DecoratorNode,
|
|
13
|
+
$getSelection,
|
|
14
|
+
$isRangeSelection,
|
|
15
|
+
COMMAND_PRIORITY_LOW
|
|
16
|
+
} from "lexical";
|
|
17
|
+
import React, { Suspense, useEffect } from "react";
|
|
18
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
19
|
+
var HintComponent = React.lazy(() => import("./HintComponet-BRL6EAMS.mjs"));
|
|
20
|
+
var Hint = class _Hint extends DecoratorNode {
|
|
21
|
+
constructor(variant, caption, key) {
|
|
22
|
+
super(key);
|
|
23
|
+
this.__variant = variant;
|
|
24
|
+
if (!caption) {
|
|
25
|
+
const initialEditorState = {
|
|
26
|
+
root: {
|
|
27
|
+
children: [
|
|
28
|
+
{
|
|
29
|
+
children: [
|
|
30
|
+
{
|
|
31
|
+
detail: 0,
|
|
32
|
+
format: 0,
|
|
33
|
+
mode: "normal",
|
|
34
|
+
style: "",
|
|
35
|
+
text: " ",
|
|
36
|
+
type: "text",
|
|
37
|
+
version: 1
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
direction: null,
|
|
41
|
+
format: "",
|
|
42
|
+
indent: 0,
|
|
43
|
+
type: "paragraph",
|
|
44
|
+
version: 1,
|
|
45
|
+
textFormat: 0,
|
|
46
|
+
textStyle: ""
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
direction: null,
|
|
50
|
+
format: "",
|
|
51
|
+
indent: 0,
|
|
52
|
+
type: "root",
|
|
53
|
+
version: 1
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const newEditor = createEditor();
|
|
57
|
+
const parsedEditorState = newEditor.parseEditorState(JSON.stringify(initialEditorState));
|
|
58
|
+
newEditor.setEditorState(parsedEditorState);
|
|
59
|
+
this.__caption = newEditor;
|
|
60
|
+
} else {
|
|
61
|
+
this.__caption = caption;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static getType() {
|
|
65
|
+
return "hint";
|
|
66
|
+
}
|
|
67
|
+
static clone(node) {
|
|
68
|
+
return new _Hint(node.__variant, node.__caption, node.__key);
|
|
69
|
+
}
|
|
70
|
+
static importJSON(serializedNode) {
|
|
71
|
+
return new _Hint(
|
|
72
|
+
serializedNode.variant,
|
|
73
|
+
// Change from type to variant
|
|
74
|
+
void 0
|
|
75
|
+
).updateFromJSON(serializedNode);
|
|
76
|
+
}
|
|
77
|
+
setVariant(variant) {
|
|
78
|
+
const self = this.getWritable();
|
|
79
|
+
self.__variant = variant;
|
|
80
|
+
return self;
|
|
81
|
+
}
|
|
82
|
+
createDOM() {
|
|
83
|
+
const element = document.createElement("div");
|
|
84
|
+
element.className = `hint-${this.__type}`;
|
|
85
|
+
return element;
|
|
86
|
+
}
|
|
87
|
+
updateFromJSON(serializedNode) {
|
|
88
|
+
super.updateFromJSON(serializedNode);
|
|
89
|
+
const nestedEditor = this.__caption;
|
|
90
|
+
const editorState = nestedEditor.parseEditorState(serializedNode.caption.editorState);
|
|
91
|
+
if (!editorState.isEmpty()) {
|
|
92
|
+
nestedEditor.setEditorState(editorState);
|
|
93
|
+
}
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
exportJSON() {
|
|
97
|
+
return __spreadProps(__spreadValues({}, super.exportJSON()), {
|
|
98
|
+
variant: this.__variant,
|
|
99
|
+
type: "hint",
|
|
100
|
+
caption: this.__caption.toJSON()
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
updateDOM() {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
decorate() {
|
|
107
|
+
return /* @__PURE__ */ React.createElement(Suspense, { fallback: null }, /* @__PURE__ */ React.createElement(
|
|
108
|
+
HintComponent,
|
|
109
|
+
{
|
|
110
|
+
type: this.__variant,
|
|
111
|
+
captionEditor: this.__caption,
|
|
112
|
+
nodeKey: this.getKey()
|
|
113
|
+
}
|
|
114
|
+
));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
function $isHintNode(node) {
|
|
118
|
+
return node instanceof Hint;
|
|
119
|
+
}
|
|
120
|
+
function $createHintNode(type) {
|
|
121
|
+
return new Hint(type);
|
|
122
|
+
}
|
|
123
|
+
var INSERT_HINT_COMMAND = createCommand();
|
|
124
|
+
function $insertHintNode(type) {
|
|
125
|
+
const selection = $getSelection();
|
|
126
|
+
if ($isRangeSelection(selection)) {
|
|
127
|
+
const hintNode = $createHintNode(type);
|
|
128
|
+
selection.insertNodes([hintNode]);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function HintPlugin() {
|
|
132
|
+
const [editor] = useLexicalComposerContext();
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (!editor.hasNodes([Hint])) {
|
|
135
|
+
throw new Error("Hint: Hint not registered on editor");
|
|
136
|
+
}
|
|
137
|
+
}, [editor]);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
return editor.registerCommand(
|
|
140
|
+
INSERT_HINT_COMMAND,
|
|
141
|
+
(payload, editor2) => {
|
|
142
|
+
editor2.update(() => {
|
|
143
|
+
$insertHintNode(payload);
|
|
144
|
+
});
|
|
145
|
+
return true;
|
|
146
|
+
},
|
|
147
|
+
COMMAND_PRIORITY_LOW
|
|
148
|
+
);
|
|
149
|
+
}, [editor]);
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
Hint,
|
|
155
|
+
$isHintNode,
|
|
156
|
+
INSERT_HINT_COMMAND,
|
|
157
|
+
HintPlugin
|
|
158
|
+
};
|