laif-ds 0.1.76 → 0.1.80

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.
Files changed (96) hide show
  1. package/dist/_virtual/index.js +5 -3
  2. package/dist/_virtual/index2.js +5 -2
  3. package/dist/_virtual/index3.js +5 -5
  4. package/dist/_virtual/index4.js +2 -5
  5. package/dist/_virtual/index5.js +2 -5
  6. package/dist/_virtual/index7.js +3 -2
  7. package/dist/_virtual/prism-cpp.js +3 -0
  8. package/dist/_virtual/prism-cpp2.js +5 -0
  9. package/dist/_virtual/prism-java.js +3 -0
  10. package/dist/_virtual/prism-java2.js +5 -0
  11. package/dist/_virtual/prism-python.js +3 -0
  12. package/dist/_virtual/prism-python2.js +5 -0
  13. package/dist/_virtual/prism-rust.js +3 -0
  14. package/dist/_virtual/prism-rust2.js +5 -0
  15. package/dist/_virtual/prism-typescript.js +3 -0
  16. package/dist/_virtual/prism-typescript2.js +5 -0
  17. package/dist/_virtual/prism.js +3 -0
  18. package/dist/_virtual/prism2.js +5 -0
  19. package/dist/components/editor/context/toolbar-context.js +42 -0
  20. package/dist/components/editor/editor-hooks/use-modal.js +30 -0
  21. package/dist/components/editor/editor-hooks/use-update-toolbar.js +24 -0
  22. package/dist/components/editor/editor-ui/content-editable.js +26 -0
  23. package/dist/components/editor/plugins/actions/actions-plugin.js +7 -0
  24. package/dist/components/editor/plugins/actions/clear-editor-plugin.js +39 -0
  25. package/dist/components/editor/plugins/actions/counter-character-plugin.js +53 -0
  26. package/dist/components/editor/plugins/toolbar/block-format/block-format-data.js +52 -0
  27. package/dist/components/editor/plugins/toolbar/block-format/format-bulleted-list.js +26 -0
  28. package/dist/components/editor/plugins/toolbar/block-format/format-check-list.js +26 -0
  29. package/dist/components/editor/plugins/toolbar/block-format/format-heading.js +31 -0
  30. package/dist/components/editor/plugins/toolbar/block-format/format-numbered-list.js +26 -0
  31. package/dist/components/editor/plugins/toolbar/block-format/format-paragraph.js +23 -0
  32. package/dist/components/editor/plugins/toolbar/block-format/format-quote.js +24 -0
  33. package/dist/components/editor/plugins/toolbar/block-format-toolbar-plugin.js +56 -0
  34. package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +50 -0
  35. package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +69 -0
  36. package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +34 -0
  37. package/dist/components/editor/themes/editor-theme.js +112 -0
  38. package/dist/components/ui/app-editor.js +150 -0
  39. package/dist/components/ui/app-multiple-select-dropdown.js +2 -2
  40. package/dist/components/ui/button.js +25 -24
  41. package/dist/components/ui/calendar.js +9 -9
  42. package/dist/components/ui/dialog.js +43 -37
  43. package/dist/components/ui/sidebar.js +20 -19
  44. package/dist/index.d.ts +23 -1
  45. package/dist/index.js +48 -44
  46. package/dist/laif-ds.css +1 -0
  47. package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +159 -0
  48. package/dist/node_modules/@lexical/code/LexicalCode.prod.js +236 -0
  49. package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +46 -0
  50. package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +89 -0
  51. package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +108 -0
  52. package/dist/node_modules/@lexical/link/LexicalLink.prod.js +187 -0
  53. package/dist/node_modules/@lexical/list/LexicalList.prod.js +729 -0
  54. package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +367 -0
  55. package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +11 -0
  56. package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +17 -0
  57. package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +45 -0
  58. package/dist/node_modules/@lexical/react/LexicalComposerContext.prod.js +22 -0
  59. package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +55 -0
  60. package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +49 -0
  61. package/dist/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js +15 -0
  62. package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +17 -0
  63. package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +16 -0
  64. package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +56 -0
  65. package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +21 -0
  66. package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +376 -0
  67. package/dist/node_modules/@lexical/selection/LexicalSelection.prod.js +107 -0
  68. package/dist/node_modules/@lexical/table/LexicalTable.prod.js +661 -0
  69. package/dist/node_modules/@lexical/text/LexicalText.prod.js +37 -0
  70. package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +102 -0
  71. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
  72. package/dist/node_modules/eventemitter3/index.js +1 -1
  73. package/dist/node_modules/eventemitter3/index2.js +1 -1
  74. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  75. package/dist/node_modules/lexical/Lexical.prod.js +4901 -0
  76. package/dist/node_modules/prismjs/components/prism-c.js +77 -0
  77. package/dist/node_modules/prismjs/components/prism-clike.js +32 -0
  78. package/dist/node_modules/prismjs/components/prism-cpp.js +93 -0
  79. package/dist/node_modules/prismjs/components/prism-css.js +56 -0
  80. package/dist/node_modules/prismjs/components/prism-java.js +122 -0
  81. package/dist/node_modules/prismjs/components/prism-javascript.js +138 -0
  82. package/dist/node_modules/prismjs/components/prism-markdown.js +301 -0
  83. package/dist/node_modules/prismjs/components/prism-markup.js +174 -0
  84. package/dist/node_modules/prismjs/components/prism-objectivec.js +11 -0
  85. package/dist/node_modules/prismjs/components/prism-powershell.js +56 -0
  86. package/dist/node_modules/prismjs/components/prism-python.js +69 -0
  87. package/dist/node_modules/prismjs/components/prism-rust.js +124 -0
  88. package/dist/node_modules/prismjs/components/prism-sql.js +34 -0
  89. package/dist/node_modules/prismjs/components/prism-swift.js +114 -0
  90. package/dist/node_modules/prismjs/components/prism-typescript.js +53 -0
  91. package/dist/node_modules/prismjs/prism.js +1165 -0
  92. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  93. package/dist/node_modules/unified/lib/index.js +1 -1
  94. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  95. package/dist/styles.v3.css +1 -1
  96. package/package.json +12 -1
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { useState as m } from "react";
4
+ import { $isTableSelection as l } from "../../../../node_modules/@lexical/table/LexicalTable.prod.js";
5
+ import { FORMAT_TEXT_COMMAND as n, $isRangeSelection as d } from "../../../../node_modules/lexical/Lexical.prod.js";
6
+ import { useToolbarContext as c } from "../../context/toolbar-context.js";
7
+ import { useUpdateToolbarHandler as p } from "../../editor-hooks/use-update-toolbar.js";
8
+ import { Toggle as f } from "../../../ui/toggle.js";
9
+ import u from "../../../../node_modules/lucide-react/dist/esm/icons/code.js";
10
+ import T from "../../../../node_modules/lucide-react/dist/esm/icons/strikethrough.js";
11
+ import b from "../../../../node_modules/lucide-react/dist/esm/icons/underline.js";
12
+ import g from "../../../../node_modules/lucide-react/dist/esm/icons/italic.js";
13
+ import h from "../../../../node_modules/lucide-react/dist/esm/icons/bold.js";
14
+ const C = {
15
+ bold: h,
16
+ italic: g,
17
+ underline: b,
18
+ strikethrough: T,
19
+ code: u
20
+ };
21
+ function R({
22
+ format: o
23
+ }) {
24
+ const { activeEditor: a } = c(), [r, t] = m(!1);
25
+ p((e) => {
26
+ (d(e) || l(e)) && t(e.hasFormat(o));
27
+ });
28
+ const s = C[o];
29
+ return /* @__PURE__ */ i(
30
+ f,
31
+ {
32
+ "aria-label": "Toggle bold",
33
+ variant: "outline",
34
+ size: "sm",
35
+ defaultPressed: r,
36
+ pressed: r,
37
+ onPressedChange: t,
38
+ onClick: () => {
39
+ a.dispatchCommand(
40
+ n,
41
+ o
42
+ );
43
+ },
44
+ children: /* @__PURE__ */ i(s, { className: "h-4 w-4" })
45
+ }
46
+ );
47
+ }
48
+ export {
49
+ R as FontFormatToolbarPlugin
50
+ };
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
3
+ import { useState as s, useEffect as u } from "react";
4
+ import { useLexicalComposerContext as N } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
5
+ import { mergeRegister as b } from "../../../../node_modules/@lexical/utils/LexicalUtils.prod.js";
6
+ import { CAN_REDO_COMMAND as R, COMMAND_PRIORITY_CRITICAL as n, CAN_UNDO_COMMAND as M, UNDO_COMMAND as O, REDO_COMMAND as D } from "../../../../node_modules/lexical/Lexical.prod.js";
7
+ import { useToolbarContext as g } from "../../context/toolbar-context.js";
8
+ import { Button as d } from "../../../ui/button.js";
9
+ import x from "../../../../node_modules/lucide-react/dist/esm/icons/undo.js";
10
+ import A from "../../../../node_modules/lucide-react/dist/esm/icons/redo.js";
11
+ function j() {
12
+ const [i] = N(), { activeEditor: t, $updateToolbar: a } = g(), [r, l] = s(i.isEditable()), [m, c] = s(!1), [C, p] = s(!1);
13
+ return u(() => b(
14
+ i.registerEditableListener((e) => {
15
+ l(e);
16
+ }),
17
+ t.registerUpdateListener(({ editorState: e }) => {
18
+ e.read(() => {
19
+ a();
20
+ });
21
+ }),
22
+ t.registerCommand(
23
+ M,
24
+ (e) => (c(e), !1),
25
+ n
26
+ ),
27
+ t.registerCommand(
28
+ R,
29
+ (e) => (p(e), !1),
30
+ n
31
+ )
32
+ ), [a, t, i]), /* @__PURE__ */ f("div", { className: "flex items-center gap-1", children: [
33
+ /* @__PURE__ */ o(
34
+ d,
35
+ {
36
+ disabled: !m || !r,
37
+ onClick: () => {
38
+ t.dispatchCommand(O, void 0);
39
+ },
40
+ title: "Undo (⌘Z)",
41
+ type: "button",
42
+ "aria-label": "Undo",
43
+ size: "icon",
44
+ className: "!h-8 !w-8",
45
+ variant: "outline",
46
+ children: /* @__PURE__ */ o(x, { className: "size-4" })
47
+ }
48
+ ),
49
+ /* @__PURE__ */ o(
50
+ d,
51
+ {
52
+ disabled: !C || !r,
53
+ onClick: () => {
54
+ t.dispatchCommand(D, void 0);
55
+ },
56
+ title: "Redo (⇧⌘Z)",
57
+ type: "button",
58
+ "aria-label": "Redo",
59
+ variant: "outline",
60
+ size: "icon",
61
+ className: "!h-8 !w-8",
62
+ children: /* @__PURE__ */ o(A, { className: "size-4" })
63
+ }
64
+ )
65
+ ] });
66
+ }
67
+ export {
68
+ j as HistoryToolbarPlugin
69
+ };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { jsxs as p } from "react/jsx-runtime";
3
+ import { useState as e, useEffect as d } from "react";
4
+ import { useLexicalComposerContext as u } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
5
+ import { SELECTION_CHANGE_COMMAND as f, COMMAND_PRIORITY_CRITICAL as C } from "../../../../node_modules/lexical/Lexical.prod.js";
6
+ import { ToolbarContext as T } from "../../context/toolbar-context.js";
7
+ import { useEditorModal as E } from "../../editor-hooks/use-modal.js";
8
+ function O({
9
+ children: s
10
+ }) {
11
+ const [o] = u(), [t, a] = e(o), [r, i] = e("paragraph"), [m, n] = E(), l = () => {
12
+ };
13
+ return d(() => t.registerCommand(
14
+ f,
15
+ (M, c) => (a(c), !1),
16
+ C
17
+ ), [o]), /* @__PURE__ */ p(
18
+ T,
19
+ {
20
+ activeEditor: t,
21
+ $updateToolbar: l,
22
+ blockType: r,
23
+ setBlockType: i,
24
+ showModal: n,
25
+ children: [
26
+ m,
27
+ s({ blockType: r })
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ O as ToolbarPlugin
34
+ };
@@ -0,0 +1,112 @@
1
+ "use client";
2
+ /* empty css */
3
+ const t = {
4
+ ltr: "text-left",
5
+ rtl: "text-right",
6
+ heading: {
7
+ h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",
8
+ h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
9
+ h3: "scroll-m-20 text-2xl font-semibold tracking-tight",
10
+ h4: "scroll-m-20 text-xl font-semibold tracking-tight",
11
+ h5: "scroll-m-20 text-lg font-semibold tracking-tight",
12
+ h6: "scroll-m-20 text-base font-semibold tracking-tight"
13
+ },
14
+ paragraph: "leading-7 [&:not(:first-child)]:mt-6",
15
+ quote: "mt-6 border-l-2 pl-6 italic",
16
+ link: "text-blue-600 hover:underline hover:cursor-pointer",
17
+ list: {
18
+ checklist: "relative",
19
+ listitem: "mx-8",
20
+ listitemChecked: 'relative mx-2 px-6 list-none outline-none line-through before:content-[""] before:w-4 before:h-4 before:top-0.5 before:left-0 before:cursor-pointer before:block before:bg-cover before:absolute before:border before:border-primary before:rounded before:bg-primary before:bg-no-repeat after:content-[""] after:cursor-pointer after:border-white after:border-solid after:absolute after:block after:top-[6px] after:w-[3px] after:left-[7px] after:right-[7px] after:h-[6px] after:rotate-45 after:border-r-2 after:border-b-2 after:border-l-0 after:border-t-0',
21
+ listitemUnchecked: 'relative mx-2 px-6 list-none outline-none before:content-[""] before:w-4 before:h-4 before:top-0.5 before:left-0 before:cursor-pointer before:block before:bg-cover before:absolute before:border before:border-primary before:rounded',
22
+ nested: {
23
+ listitem: "list-none before:hidden after:hidden"
24
+ },
25
+ ol: "my-6 ml-6 list-decimal [&>li]:mt-2",
26
+ olDepth: [
27
+ "list-outside !list-decimal",
28
+ "list-outside !list-[upper-roman]",
29
+ "list-outside !list-[lower-roman]",
30
+ "list-outside !list-[upper-alpha]",
31
+ "list-outside !list-[lower-alpha]"
32
+ ],
33
+ ul: "m-0 p-0 list-outside"
34
+ },
35
+ hashtag: "text-blue-600 bg-blue-100 rounded-md px-1",
36
+ text: {
37
+ bold: "font-bold",
38
+ code: "bg-gray-100 p-1 rounded-md",
39
+ italic: "italic",
40
+ strikethrough: "line-through",
41
+ subscript: "sub",
42
+ superscript: "sup",
43
+ underline: "underline",
44
+ underlineStrikethrough: "underline line-through"
45
+ },
46
+ image: "relative inline-block user-select-none cursor-default editor-image",
47
+ inlineImage: "relative inline-block user-select-none cursor-default inline-editor-image",
48
+ keyword: "text-purple-900 font-bold",
49
+ code: "EditorTheme__code",
50
+ codeHighlight: {
51
+ atrule: "EditorTheme__tokenAttr",
52
+ attr: "EditorTheme__tokenAttr",
53
+ boolean: "EditorTheme__tokenProperty",
54
+ builtin: "EditorTheme__tokenSelector",
55
+ cdata: "EditorTheme__tokenComment",
56
+ char: "EditorTheme__tokenSelector",
57
+ class: "EditorTheme__tokenFunction",
58
+ "class-name": "EditorTheme__tokenFunction",
59
+ comment: "EditorTheme__tokenComment",
60
+ constant: "EditorTheme__tokenProperty",
61
+ deleted: "EditorTheme__tokenProperty",
62
+ doctype: "EditorTheme__tokenComment",
63
+ entity: "EditorTheme__tokenOperator",
64
+ function: "EditorTheme__tokenFunction",
65
+ important: "EditorTheme__tokenVariable",
66
+ inserted: "EditorTheme__tokenSelector",
67
+ keyword: "EditorTheme__tokenAttr",
68
+ namespace: "EditorTheme__tokenVariable",
69
+ number: "EditorTheme__tokenProperty",
70
+ operator: "EditorTheme__tokenOperator",
71
+ prolog: "EditorTheme__tokenComment",
72
+ property: "EditorTheme__tokenProperty",
73
+ punctuation: "EditorTheme__tokenPunctuation",
74
+ regex: "EditorTheme__tokenVariable",
75
+ selector: "EditorTheme__tokenSelector",
76
+ string: "EditorTheme__tokenSelector",
77
+ symbol: "EditorTheme__tokenProperty",
78
+ tag: "EditorTheme__tokenProperty",
79
+ url: "EditorTheme__tokenOperator",
80
+ variable: "EditorTheme__tokenVariable"
81
+ },
82
+ characterLimit: "!bg-destructive/50",
83
+ table: "EditorTheme__table w-fit overflow-scroll border-collapse",
84
+ tableCell: 'EditorTheme__tableCell w-24 relative border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right"',
85
+ tableCellActionButton: "EditorTheme__tableCellActionButton bg-background block border-0 rounded-2xl w-5 h-5 text-foreground cursor-pointer",
86
+ tableCellActionButtonContainer: "EditorTheme__tableCellActionButtonContainer block right-1 top-1.5 absolute z-10 w-5 h-5",
87
+ tableCellEditing: "EditorTheme__tableCellEditing rounded-sm shadow-sm",
88
+ tableCellHeader: "EditorTheme__tableCellHeader bg-muted border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right",
89
+ tableCellPrimarySelected: "EditorTheme__tableCellPrimarySelected border border-primary border-solid block h-[calc(100%-2px)] w-[calc(100%-2px)] absolute -left-[1px] -top-[1px] z-10 ",
90
+ tableCellResizer: "EditorTheme__tableCellResizer absolute -right-1 h-full w-2 cursor-ew-resize z-10 top-0",
91
+ tableCellSelected: "EditorTheme__tableCellSelected bg-muted",
92
+ tableCellSortedIndicator: "EditorTheme__tableCellSortedIndicator block opacity-50 bsolute bottom-0 left-0 w-full h-1 bg-muted",
93
+ tableResizeRuler: "EditorTheme__tableCellResizeRuler block absolute w-[1px] h-full bg-primary top-0",
94
+ tableRowStriping: "EditorTheme__tableRowStriping m-0 border-t p-0 even:bg-muted",
95
+ tableSelected: "EditorTheme__tableSelected ring-2 ring-primary ring-offset-2",
96
+ tableSelection: "EditorTheme__tableSelection bg-transparent",
97
+ layoutItem: "border border-dashed px-4 py-2",
98
+ layoutContainer: "grid gap-2.5 my-2.5 mx-0",
99
+ autocomplete: "text-muted-foreground",
100
+ blockCursor: "",
101
+ embedBlock: {
102
+ base: "user-select-none",
103
+ focus: "ring-2 ring-primary ring-offset-2"
104
+ },
105
+ hr: 'p-0.5 border-none my-1 mx-0 cursor-pointer after:content-[""] after:block after:h-0.5 after:bg-muted selected:ring-2 selected:ring-primary selected:ring-offset-2 selected:user-select-none',
106
+ indent: "[--lexical-indent-base-value:40px]",
107
+ mark: "",
108
+ markOverlap: ""
109
+ };
110
+ export {
111
+ t as editorTheme
112
+ };
@@ -0,0 +1,150 @@
1
+ "use client";
2
+ import { jsx as o, jsxs as t, Fragment as s } from "react/jsx-runtime";
3
+ import { LexicalComposer as w } from "../../node_modules/@lexical/react/LexicalComposer.prod.js";
4
+ import { OnChangePlugin as L } from "../../node_modules/@lexical/react/LexicalOnChangePlugin.prod.js";
5
+ import { LexicalErrorBoundary as S } from "../../node_modules/@lexical/react/LexicalErrorBoundary.prod.js";
6
+ import { RichTextPlugin as T } from "../../node_modules/@lexical/react/LexicalRichTextPlugin.prod.js";
7
+ import { HeadingNode as j, QuoteNode as A } from "../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
8
+ import { ParagraphNode as d, TextNode as p, $getRoot as f } from "../../node_modules/lexical/Lexical.prod.js";
9
+ import { $convertToMarkdownString as B, $convertFromMarkdownString as H, TRANSFORMERS as C } from "../../node_modules/@lexical/markdown/LexicalMarkdown.prod.js";
10
+ import { useState as R, useEffect as $ } from "react";
11
+ import { useLexicalComposerContext as O } from "../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
12
+ import { HistoryPlugin as z } from "../../node_modules/@lexical/react/LexicalHistoryPlugin.prod.js";
13
+ import { ContentEditable as D } from "../editor/editor-ui/content-editable.js";
14
+ import { ActionsPlugin as I } from "../editor/plugins/actions/actions-plugin.js";
15
+ import { ClearEditorActionPlugin as _ } from "../editor/plugins/actions/clear-editor-plugin.js";
16
+ import { ClearEditorPlugin as M } from "../../node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js";
17
+ import { CounterCharacterPlugin as Q } from "../editor/plugins/actions/counter-character-plugin.js";
18
+ import { ToolbarPlugin as c } from "../editor/plugins/toolbar/toolbar-plugin.js";
19
+ import { BlockFormatDropDown as J } from "../editor/plugins/toolbar/block-format-toolbar-plugin.js";
20
+ import { FormatParagraph as U } from "../editor/plugins/toolbar/block-format/format-paragraph.js";
21
+ import { FormatHeading as q } from "../editor/plugins/toolbar/block-format/format-heading.js";
22
+ import { FormatNumberedList as G } from "../editor/plugins/toolbar/block-format/format-numbered-list.js";
23
+ import { FormatBulletedList as K } from "../editor/plugins/toolbar/block-format/format-bulleted-list.js";
24
+ import { FormatCheckList as W } from "../editor/plugins/toolbar/block-format/format-check-list.js";
25
+ import { FormatQuote as X } from "../editor/plugins/toolbar/block-format/format-quote.js";
26
+ import { FontFormatToolbarPlugin as l } from "../editor/plugins/toolbar/font-format-toolbar-plugin.js";
27
+ import { ListPlugin as Y } from "../../node_modules/@lexical/react/LexicalListPlugin.prod.js";
28
+ import { CheckListPlugin as Z } from "../../node_modules/@lexical/react/LexicalCheckListPlugin.prod.js";
29
+ import { ListNode as V, ListItemNode as oo } from "../../node_modules/@lexical/list/LexicalList.prod.js";
30
+ import { editorTheme as ro } from "../editor/themes/editor-theme.js";
31
+ import { TooltipProvider as to } from "./tooltip.js";
32
+ import { HistoryToolbarPlugin as eo } from "../editor/plugins/toolbar/history-toolbar-plugin.js";
33
+ const io = "Start typing...";
34
+ function no({
35
+ defaultValue: r,
36
+ onlyMarkdown: i
37
+ }) {
38
+ const [n] = O();
39
+ return $(() => {
40
+ r && n.update(() => {
41
+ i ? H(r, C) : f().append(
42
+ new d().append(new p(r))
43
+ );
44
+ const a = f();
45
+ (a.getFirstChild() ?? a).selectStart();
46
+ });
47
+ }, [n, r, i]), null;
48
+ }
49
+ function Do({
50
+ defaultValue: r,
51
+ onMarkdownEdit: i,
52
+ plugins: n = [],
53
+ toolbars: a = [],
54
+ placeholder: F = io,
55
+ onlyMarkdown: h = !0,
56
+ className: N = "bg-d-background overflow-hidden rounded-lg border"
57
+ }) {
58
+ const [ao, P] = R(null), k = {
59
+ namespace: "AppEditor",
60
+ theme: ro,
61
+ nodes: [
62
+ j,
63
+ d,
64
+ p,
65
+ A,
66
+ V,
67
+ oo
68
+ ],
69
+ onError: (e) => {
70
+ console.error(e);
71
+ },
72
+ ...r && !h ? {
73
+ editorState: () => {
74
+ f().append(
75
+ new d().append(new p(r))
76
+ );
77
+ }
78
+ } : {}
79
+ }, g = (e) => n.includes(e), m = (e) => a.includes(e), u = g("clear"), b = g("counter"), v = m("block-format"), y = m("font-format"), x = m("history");
80
+ return /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(w, { initialConfig: k, children: /* @__PURE__ */ t(to, { children: [
81
+ r && /* @__PURE__ */ o(
82
+ no,
83
+ {
84
+ defaultValue: r,
85
+ onlyMarkdown: h
86
+ }
87
+ ),
88
+ /* @__PURE__ */ t("div", { className: "flex items-center", children: [
89
+ x && /* @__PURE__ */ o(c, { children: () => /* @__PURE__ */ o("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto border-b p-1", children: /* @__PURE__ */ o(eo, {}) }) }),
90
+ v && /* @__PURE__ */ o(c, { children: () => /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o("div", { className: "vertical-align-middle bg-d-background sticky top-0 z-10 flex gap-2 overflow-auto border-b p-1", children: /* @__PURE__ */ t(J, { children: [
91
+ /* @__PURE__ */ o(U, {}),
92
+ /* @__PURE__ */ o(q, { levels: ["h1", "h2", "h3"] }),
93
+ /* @__PURE__ */ o(G, {}),
94
+ /* @__PURE__ */ o(K, {}),
95
+ /* @__PURE__ */ o(W, {}),
96
+ /* @__PURE__ */ o(X, {})
97
+ ] }) }) }) }),
98
+ y && /* @__PURE__ */ o(c, { children: () => /* @__PURE__ */ t("div", { className: "vertical-align-middle bg-background sticky top-0 z-10 flex gap-2 overflow-auto border-b p-1", children: [
99
+ /* @__PURE__ */ o(l, { format: "bold" }),
100
+ /* @__PURE__ */ o(l, { format: "italic" }),
101
+ /* @__PURE__ */ o(l, { format: "underline" }),
102
+ /* @__PURE__ */ o(l, { format: "strikethrough" })
103
+ ] }) })
104
+ ] }),
105
+ /* @__PURE__ */ t("div", { className: "relative", children: [
106
+ x && /* @__PURE__ */ o(z, {}),
107
+ /* @__PURE__ */ o(
108
+ T,
109
+ {
110
+ ErrorBoundary: S,
111
+ contentEditable: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { ref: P, children: /* @__PURE__ */ o(
112
+ D,
113
+ {
114
+ placeholder: F,
115
+ className: `ContentEditable__root relative block h-72 min-h-full overflow-auto px-8 py-4 focus:outline-none ${N}`
116
+ }
117
+ ) }) })
118
+ }
119
+ ),
120
+ v && /* @__PURE__ */ t(s, { children: [
121
+ /* @__PURE__ */ o(Y, {}),
122
+ /* @__PURE__ */ o(Z, {})
123
+ ] }),
124
+ (u || b) && /* @__PURE__ */ o(I, { children: /* @__PURE__ */ t("div", { className: "clear-both flex items-center justify-between gap-2 border-t p-1", children: [
125
+ /* @__PURE__ */ o("div", { className: "flex flex-1 justify-start" }),
126
+ /* @__PURE__ */ o("div", { children: b && /* @__PURE__ */ o(Q, { charset: "UTF-16" }) }),
127
+ /* @__PURE__ */ o("div", { className: "flex flex-1 justify-end gap-2", children: u && /* @__PURE__ */ t(s, { children: [
128
+ /* @__PURE__ */ o(_, {}),
129
+ /* @__PURE__ */ o(M, {})
130
+ ] }) })
131
+ ] }) })
132
+ ] }),
133
+ /* @__PURE__ */ o(
134
+ L,
135
+ {
136
+ ignoreSelectionChange: !0,
137
+ onChange: (e) => {
138
+ if (!i) return;
139
+ const E = e.read(
140
+ () => B(C)
141
+ );
142
+ i(E);
143
+ }
144
+ }
145
+ )
146
+ ] }) }) });
147
+ }
148
+ export {
149
+ Do as AppEditor
150
+ };
@@ -65,8 +65,8 @@ function oe({
65
65
  "aria-expanded": u,
66
66
  disabled: k,
67
67
  className: N(
68
- "border-d-border relative w-full justify-between border bg-transparent font-normal",
69
- "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border !bg-transparent whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
68
+ "!bg-d-input relative w-full justify-between border font-normal",
69
+ "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
70
70
  "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
71
71
  j
72
72
  ),
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
3
- import { Root as g } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
2
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
+ import { Root as v } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
4
  import { cva as h } from "../../node_modules/class-variance-authority/dist/index.js";
5
5
  import { cn as l } from "../../lib/utils.js";
6
6
  import { Icon as u } from "./icon.js";
@@ -12,7 +12,8 @@ const m = h(
12
12
  default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90",
13
13
  destructive: "bg-d-destructive text-white shadow-xs hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60",
14
14
  outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
15
- secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80",
15
+ "outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary",
16
+ secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground",
16
17
  ghost: "hover:bg-d-accent hover:text-d-accent-foreground dark:hover:bg-d-accent/50",
17
18
  link: "text-d-primary underline-offset-4 hover:underline"
18
19
  },
@@ -31,40 +32,40 @@ const m = h(
31
32
  );
32
33
  function k({
33
34
  className: d,
34
- variant: n,
35
- size: e,
36
- asChild: o = !1,
37
- iconLeft: i,
38
- iconRight: a,
39
- isLoading: v = !1,
35
+ variant: o,
36
+ size: r,
37
+ asChild: a = !1,
38
+ iconLeft: n,
39
+ iconRight: i,
40
+ isLoading: g = !1,
40
41
  ...t
41
42
  }) {
42
- const s = o ? g : "button";
43
- return o ? /* @__PURE__ */ r(
43
+ const s = a ? v : "button";
44
+ return a ? /* @__PURE__ */ e(
44
45
  s,
45
46
  {
46
47
  "data-slot": "button",
47
- className: l(m({ variant: n, size: e, className: d })),
48
+ className: l(m({ variant: o, size: r, className: d })),
48
49
  ...t
49
50
  }
50
51
  ) : /* @__PURE__ */ c(
51
52
  s,
52
53
  {
53
54
  "data-slot": "button",
54
- className: l(m({ variant: n, size: e, className: d }), "relative"),
55
+ className: l(m({ variant: o, size: r, className: d }), "relative"),
55
56
  ...t,
56
57
  children: [
57
- v ? /* @__PURE__ */ c(
58
+ g ? /* @__PURE__ */ c(
58
59
  "svg",
59
60
  {
60
61
  className: "mr-1 -ml-1 animate-spin",
61
62
  xmlns: "http://www.w3.org/2000/svg",
62
63
  fill: "none",
63
64
  viewBox: "0 0 24 24",
64
- width: e === "sm" ? 14 : e === "lg" ? 20 : 16,
65
- height: e === "sm" ? 14 : e === "lg" ? 20 : 16,
65
+ width: r === "sm" ? 14 : r === "lg" ? 20 : 16,
66
+ height: r === "sm" ? 14 : r === "lg" ? 20 : 16,
66
67
  children: [
67
- /* @__PURE__ */ r(
68
+ /* @__PURE__ */ e(
68
69
  "circle",
69
70
  {
70
71
  className: "opacity-25",
@@ -75,7 +76,7 @@ function k({
75
76
  strokeWidth: "4"
76
77
  }
77
78
  ),
78
- /* @__PURE__ */ r(
79
+ /* @__PURE__ */ e(
79
80
  "path",
80
81
  {
81
82
  className: "opacity-75",
@@ -85,19 +86,19 @@ function k({
85
86
  )
86
87
  ]
87
88
  }
88
- ) : i && /* @__PURE__ */ r(
89
+ ) : n && /* @__PURE__ */ e(
89
90
  u,
90
91
  {
91
- name: i,
92
- size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
92
+ name: n,
93
+ size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
93
94
  }
94
95
  ),
95
96
  t.children,
96
- a && /* @__PURE__ */ r(
97
+ i && /* @__PURE__ */ e(
97
98
  u,
98
99
  {
99
- name: a,
100
- size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
100
+ name: i,
101
+ size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
101
102
  }
102
103
  )
103
104
  ]
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as n } from "react/jsx-runtime";
2
+ import { jsx as d } from "react/jsx-runtime";
3
3
  import * as g from "react";
4
4
  import { cn as e } from "../../lib/utils.js";
5
5
  import { buttonVariants as m, Button as b } from "./button.js";
@@ -19,7 +19,7 @@ function B({
19
19
  ...x
20
20
  }) {
21
21
  const t = f();
22
- return /* @__PURE__ */ n(
22
+ return /* @__PURE__ */ d(
23
23
  w,
24
24
  {
25
25
  showOutsideDays: r,
@@ -114,24 +114,24 @@ function B({
114
114
  ...i
115
115
  },
116
116
  components: {
117
- Root: ({ className: a, rootRef: d, ...o }) => /* @__PURE__ */ n(
117
+ Root: ({ className: a, rootRef: n, ...o }) => /* @__PURE__ */ d(
118
118
  "div",
119
119
  {
120
120
  "data-slot": "calendar",
121
- ref: d,
121
+ ref: n,
122
122
  className: e(a),
123
123
  ...o
124
124
  }
125
125
  ),
126
- Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n(_, { className: e("size-4", a), ...o }) : d === "right" ? /* @__PURE__ */ n(
126
+ Chevron: ({ className: a, orientation: n, ...o }) => n === "left" ? /* @__PURE__ */ d(_, { className: e("size-4", a), ...o }) : n === "right" ? /* @__PURE__ */ d(
127
127
  h,
128
128
  {
129
129
  className: e("size-4", a),
130
130
  ...o
131
131
  }
132
- ) : /* @__PURE__ */ n(y, { className: e("size-4", a), ...o }),
132
+ ) : /* @__PURE__ */ d(y, { className: e("size-4", a), ...o }),
133
133
  DayButton: v,
134
- WeekNumber: ({ children: a, ...d }) => /* @__PURE__ */ n("td", { ...d, children: /* @__PURE__ */ n("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
134
+ WeekNumber: ({ children: a, ...n }) => /* @__PURE__ */ d("td", { ...n, children: /* @__PURE__ */ d("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
135
135
  ...p
136
136
  },
137
137
  ...x
@@ -147,7 +147,7 @@ function v({
147
147
  const s = f(), u = g.useRef(null);
148
148
  return g.useEffect(() => {
149
149
  r.focused && u.current?.focus();
150
- }, [r.focused]), /* @__PURE__ */ n(
150
+ }, [r.focused]), /* @__PURE__ */ d(
151
151
  b,
152
152
  {
153
153
  ref: u,
@@ -159,7 +159,7 @@ function v({
159
159
  "data-range-end": r.range_end,
160
160
  "data-range-middle": r.range_middle,
161
161
  className: e(
162
- "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",
162
+ "data-[selected-single=true]:bg-d-primary data-[selected-single=true]:text-d-primary-foreground data-[range-middle=true]:bg-d-accent data-[range-middle=true]:text-d-accent-foreground data-[range-start=true]:bg-d-primary data-[range-start=true]:text-d-primary-foreground data-[range-end=true]:bg-d-primary data-[range-end=true]:text-d-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-d-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-[1px] 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",
163
163
  s.day,
164
164
  c
165
165
  ),