@dooherceg/tiptap-controlled-editor-with-table 0.0.8 → 0.0.9

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.
@@ -1,13 +1,11 @@
1
1
  import { Editor, EditorOptions } from '@tiptap/react';
2
- import { Ref } from 'react';
3
2
  export interface SimpleEditorProps extends Omit<Partial<EditorOptions>, "content"> {
4
3
  themeMode: "dark" | "light";
5
4
  content?: string;
6
5
  onContentChange?: (content: string) => void;
7
6
  placeholder?: string;
8
- ref?: Ref<SimpleEditorRef>;
9
7
  }
10
8
  export interface SimpleEditorRef {
11
9
  getEditor: () => Editor | null;
12
10
  }
13
- export declare function SimpleEditor({ themeMode, content, onContentChange, placeholder, ref, }: SimpleEditorProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export declare const SimpleEditor: import('react').ForwardRefExoticComponent<SimpleEditorProps & import('react').RefAttributes<SimpleEditorRef>>;
@@ -1,227 +1,220 @@
1
- import { jsx as t, jsxs as e, Fragment as y } from "react/jsx-runtime";
2
- import { useEditor as H, EditorContext as v, EditorContent as E } from "@tiptap/react";
3
- import { useState as S, useRef as C, useEffect as h, useImperativeHandle as x } from "react";
1
+ import { jsx as o, jsxs as e, Fragment as y } from "react/jsx-runtime";
2
+ import { useEditor as E, EditorContext as H, EditorContent as S } from "@tiptap/react";
3
+ import { forwardRef as v, useState as x, useRef as C, useEffect as h, useImperativeHandle as w } from "react";
4
4
  import '../../../assets/components/tiptap-templates/simple/simple-editor.css';import '../../../assets/components/tiptap-node/paragraph-node/paragraph-node.css';import '../../../assets/components/tiptap-node/list-node/list-node.css';import '../../../assets/components/tiptap-node/image-node/image-node.css';import '../../../assets/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.css';import '../../../assets/components/tiptap-node/heading-node/heading-node.css';import '../../../assets/components/tiptap-node/code-block-node/code-block-node.css';import '../../../assets/components/tiptap-node/blockquote-node/blockquote-node.css';import '../../../assets/styles/_variables.css';import '../../../assets/styles/_keyframe-animations.css';/* empty css */
5
5
  /* empty css */
6
- import { Highlight as w } from "../../../node_modules/@tiptap/extension-highlight/dist/index.js";
6
+ import { Highlight as R } from "../../../node_modules/@tiptap/extension-highlight/dist/index.js";
7
7
  import { Image as P } from "../../../node_modules/@tiptap/extension-image/dist/index.js";
8
- import { TaskList as R, TaskItem as M } from "../../../node_modules/@tiptap/extension-list/dist/index.js";
9
- import { Subscript as U } from "../../../node_modules/@tiptap/extension-subscript/dist/index.js";
10
- import { Superscript as z } from "../../../node_modules/@tiptap/extension-superscript/dist/index.js";
11
- import { TextAlign as N } from "../../../node_modules/@tiptap/extension-text-align/dist/index.js";
12
- import { Typography as A } from "../../../node_modules/@tiptap/extension-typography/dist/index.js";
13
- import { Selection as j, Placeholder as F } from "../../../node_modules/@tiptap/extensions/dist/index.js";
14
- import { StarterKit as V } from "@tiptap/starter-kit";
8
+ import { TaskList as M, TaskItem as U } from "../../../node_modules/@tiptap/extension-list/dist/index.js";
9
+ import { Subscript as z } from "../../../node_modules/@tiptap/extension-subscript/dist/index.js";
10
+ import { Superscript as N } from "../../../node_modules/@tiptap/extension-superscript/dist/index.js";
11
+ import { TextAlign as A } from "../../../node_modules/@tiptap/extension-text-align/dist/index.js";
12
+ import { Typography as j } from "../../../node_modules/@tiptap/extension-typography/dist/index.js";
13
+ import { Selection as F, Placeholder as V } from "../../../node_modules/@tiptap/extensions/dist/index.js";
14
+ import { StarterKit as D } from "@tiptap/starter-kit";
15
15
  /* empty css */
16
16
  /* empty css */
17
17
  /* empty css */
18
- import { HorizontalRule as D } from "../../tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.js";
18
+ import { HorizontalRule as K } from "../../tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.js";
19
19
  /* empty css */
20
20
  /* empty css */
21
- import { ImageUploadNode as K } from "../../tiptap-node/image-upload-node/image-upload-node-extension.js";
21
+ import { ImageUploadNode as O } from "../../tiptap-node/image-upload-node/image-upload-node-extension.js";
22
22
  /* empty css */
23
23
  /* empty css */
24
- import { ArrowLeftIcon as O } from "../../tiptap-icons/arrow-left-icon.js";
25
- import { HighlighterIcon as _ } from "../../tiptap-icons/highlighter-icon.js";
26
- import { LinkIcon as q } from "../../tiptap-icons/link-icon.js";
27
- import { useCursorVisibility as G } from "../../../hooks/use-cursor-visibility.js";
28
- import { useIsMobile as W } from "../../../hooks/use-mobile.js";
29
- import { useWindowSize as X } from "../../../hooks/use-window-size.js";
30
- import { handleImageUpload as Z, MAX_FILE_SIZE as $ } from "../../../lib/tiptap-utils.js";
24
+ import { ArrowLeftIcon as _ } from "../../tiptap-icons/arrow-left-icon.js";
25
+ import { HighlighterIcon as q } from "../../tiptap-icons/highlighter-icon.js";
26
+ import { LinkIcon as G } from "../../tiptap-icons/link-icon.js";
27
+ import { useCursorVisibility as W } from "../../../hooks/use-cursor-visibility.js";
28
+ import { useIsMobile as X } from "../../../hooks/use-mobile.js";
29
+ import { useWindowSize as Z } from "../../../hooks/use-window-size.js";
30
+ import { handleImageUpload as $, MAX_FILE_SIZE as J } from "../../../lib/tiptap-utils.js";
31
31
  /* empty css */
32
- import { InsertTableButton as J } from "../../tiptap-ui/insert-table-button/insert-table-button.js";
33
- import Q from "../../tiptap-ui/table-actions-toolbar/table-actions-toolbar.js";
34
- import { useTiptapEditor as Y } from "../../../hooks/use-tiptap-editor.js";
35
- import { TableKit as tt } from "../../../node_modules/@tiptap/extension-table/dist/index.js";
36
- import { Toolbar as ot, ToolbarGroup as m, ToolbarSeparator as a } from "../../tiptap-ui-primitive/toolbar/toolbar.js";
32
+ import { InsertTableButton as Q } from "../../tiptap-ui/insert-table-button/insert-table-button.js";
33
+ import Y from "../../tiptap-ui/table-actions-toolbar/table-actions-toolbar.js";
34
+ import { useTiptapEditor as oo } from "../../../hooks/use-tiptap-editor.js";
35
+ import { TableKit as to } from "../../../node_modules/@tiptap/extension-table/dist/index.js";
36
+ import { Toolbar as ro, ToolbarGroup as n, ToolbarSeparator as l } from "../../tiptap-ui-primitive/toolbar/toolbar.js";
37
37
  import { UndoRedoButton as T } from "../../tiptap-ui/undo-redo-button/undo-redo-button.js";
38
- import { HeadingDropdownMenu as rt } from "../../tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.js";
39
- import { ListDropdownMenu as et } from "../../tiptap-ui/list-dropdown-menu/list-dropdown-menu.js";
40
- import { BlockquoteButton as it } from "../../tiptap-ui/blockquote-button/blockquote-button.js";
41
- import { CodeBlockButton as nt } from "../../tiptap-ui/code-block-button/code-block-button.js";
42
- import { MarkButton as l } from "../../tiptap-ui/mark-button/mark-button.js";
43
- import { ColorHighlightPopover as lt, ColorHighlightPopoverButton as mt, ColorHighlightPopoverContent as at } from "../../tiptap-ui/color-highlight-popover/color-highlight-popover.js";
44
- import { LinkPopover as pt, LinkButton as ct, LinkContent as st } from "../../tiptap-ui/link-popover/link-popover.js";
38
+ import { HeadingDropdownMenu as eo } from "../../tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.js";
39
+ import { ListDropdownMenu as io } from "../../tiptap-ui/list-dropdown-menu/list-dropdown-menu.js";
40
+ import { BlockquoteButton as no } from "../../tiptap-ui/blockquote-button/blockquote-button.js";
41
+ import { CodeBlockButton as lo } from "../../tiptap-ui/code-block-button/code-block-button.js";
42
+ import { MarkButton as i } from "../../tiptap-ui/mark-button/mark-button.js";
43
+ import { ColorHighlightPopover as mo, ColorHighlightPopoverButton as ao, ColorHighlightPopoverContent as po } from "../../tiptap-ui/color-highlight-popover/color-highlight-popover.js";
44
+ import { LinkPopover as co, LinkButton as so, LinkContent as uo } from "../../tiptap-ui/link-popover/link-popover.js";
45
45
  import { TextAlignButton as d } from "../../tiptap-ui/text-align-button/text-align-button.js";
46
- import { Button as ut } from "../../tiptap-ui-primitive/button/button.js";
47
- const ft = ({
48
- onHighlighterClick: n,
49
- onLinkClick: r,
50
- isMobile: i
46
+ import { Button as fo } from "../../tiptap-ui-primitive/button/button.js";
47
+ const go = ({
48
+ onHighlighterClick: a,
49
+ onLinkClick: m,
50
+ isMobile: t
51
51
  }) => {
52
- const { editor: p } = Y();
52
+ const { editor: p } = oo();
53
53
  return /* @__PURE__ */ e(y, { children: [
54
- /* @__PURE__ */ e(m, { children: [
55
- /* @__PURE__ */ t(T, { action: "undo" }),
56
- /* @__PURE__ */ t(T, { action: "redo" })
54
+ /* @__PURE__ */ e(n, { children: [
55
+ /* @__PURE__ */ o(T, { action: "undo" }),
56
+ /* @__PURE__ */ o(T, { action: "redo" })
57
57
  ] }),
58
- /* @__PURE__ */ t(a, {}),
59
- /* @__PURE__ */ e(m, { children: [
60
- /* @__PURE__ */ t(rt, { levels: [1, 2, 3, 4], portal: i }),
61
- /* @__PURE__ */ t(
62
- et,
58
+ /* @__PURE__ */ o(l, {}),
59
+ /* @__PURE__ */ e(n, { children: [
60
+ /* @__PURE__ */ o(eo, { levels: [1, 2, 3, 4], portal: t }),
61
+ /* @__PURE__ */ o(
62
+ io,
63
63
  {
64
64
  types: ["bulletList", "orderedList", "taskList"],
65
- portal: i
65
+ portal: t
66
66
  }
67
67
  ),
68
- /* @__PURE__ */ t(it, {}),
69
- /* @__PURE__ */ t(nt, {})
68
+ /* @__PURE__ */ o(no, {}),
69
+ /* @__PURE__ */ o(lo, {})
70
70
  ] }),
71
- /* @__PURE__ */ t(a, {}),
72
- /* @__PURE__ */ e(m, { children: [
73
- /* @__PURE__ */ t(l, { type: "bold" }),
74
- /* @__PURE__ */ t(l, { type: "italic" }),
75
- /* @__PURE__ */ t(l, { type: "strike" }),
76
- /* @__PURE__ */ t(l, { type: "code" }),
77
- /* @__PURE__ */ t(l, { type: "underline" }),
78
- i ? /* @__PURE__ */ t(mt, { onClick: n }) : /* @__PURE__ */ t(lt, {}),
79
- i ? /* @__PURE__ */ t(ct, { onClick: r }) : /* @__PURE__ */ t(pt, {})
71
+ /* @__PURE__ */ o(l, {}),
72
+ /* @__PURE__ */ e(n, { children: [
73
+ /* @__PURE__ */ o(i, { type: "bold" }),
74
+ /* @__PURE__ */ o(i, { type: "italic" }),
75
+ /* @__PURE__ */ o(i, { type: "strike" }),
76
+ /* @__PURE__ */ o(i, { type: "code" }),
77
+ /* @__PURE__ */ o(i, { type: "underline" }),
78
+ t ? /* @__PURE__ */ o(ao, { onClick: a }) : /* @__PURE__ */ o(mo, {}),
79
+ t ? /* @__PURE__ */ o(so, { onClick: m }) : /* @__PURE__ */ o(co, {})
80
80
  ] }),
81
- /* @__PURE__ */ t(a, {}),
82
- /* @__PURE__ */ e(m, { children: [
83
- /* @__PURE__ */ t(l, { type: "superscript" }),
84
- /* @__PURE__ */ t(l, { type: "subscript" })
81
+ /* @__PURE__ */ o(l, {}),
82
+ /* @__PURE__ */ e(n, { children: [
83
+ /* @__PURE__ */ o(i, { type: "superscript" }),
84
+ /* @__PURE__ */ o(i, { type: "subscript" })
85
85
  ] }),
86
- /* @__PURE__ */ t(a, {}),
87
- /* @__PURE__ */ e(m, { children: [
88
- /* @__PURE__ */ t(d, { align: "left" }),
89
- /* @__PURE__ */ t(d, { align: "center" }),
90
- /* @__PURE__ */ t(d, { align: "right" }),
91
- /* @__PURE__ */ t(d, { align: "justify" })
86
+ /* @__PURE__ */ o(l, {}),
87
+ /* @__PURE__ */ e(n, { children: [
88
+ /* @__PURE__ */ o(d, { align: "left" }),
89
+ /* @__PURE__ */ o(d, { align: "center" }),
90
+ /* @__PURE__ */ o(d, { align: "right" }),
91
+ /* @__PURE__ */ o(d, { align: "justify" })
92
92
  ] }),
93
- /* @__PURE__ */ t(a, {}),
94
- /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(J, { onClick: () => {
93
+ /* @__PURE__ */ o(l, {}),
94
+ /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(Q, { onClick: () => {
95
95
  p && p.chain().focus().insertTable({ rows: 3, cols: 3 }).run();
96
96
  } }) }),
97
- i && /* @__PURE__ */ t(a, {})
97
+ t && /* @__PURE__ */ o(l, {})
98
98
  ] });
99
- }, dt = ({
100
- type: n,
101
- onBack: r
99
+ }, ho = ({
100
+ type: a,
101
+ onBack: m
102
102
  }) => /* @__PURE__ */ e(y, { children: [
103
- /* @__PURE__ */ t(m, { children: /* @__PURE__ */ e(ut, { "data-style": "ghost", onClick: r, children: [
104
- /* @__PURE__ */ t(O, { className: "tiptap-button-icon" }),
105
- n === "highlighter" ? /* @__PURE__ */ t(_, { className: "tiptap-button-icon" }) : /* @__PURE__ */ t(q, { className: "tiptap-button-icon" })
103
+ /* @__PURE__ */ o(n, { children: /* @__PURE__ */ e(fo, { "data-style": "ghost", onClick: m, children: [
104
+ /* @__PURE__ */ o(_, { className: "tiptap-button-icon" }),
105
+ a === "highlighter" ? /* @__PURE__ */ o(q, { className: "tiptap-button-icon" }) : /* @__PURE__ */ o(G, { className: "tiptap-button-icon" })
106
106
  ] }) }),
107
- /* @__PURE__ */ t(a, {}),
108
- n === "highlighter" ? /* @__PURE__ */ t(at, {}) : /* @__PURE__ */ t(st, {})
109
- ] });
110
- function mo({
111
- themeMode: n,
112
- content: r,
113
- onContentChange: i,
114
- placeholder: p = "",
115
- ref: b
116
- }) {
117
- const c = W(), { height: L } = X(), [s, u] = S(
118
- "main"
119
- ), k = C(null), g = C(!1), o = H({
120
- immediatelyRender: !0,
121
- shouldRerenderOnTransaction: !1,
122
- editorProps: {
123
- attributes: {
124
- autocomplete: "off",
125
- autocorrect: "off",
126
- autocapitalize: "off",
127
- "aria-label": "Main content area, start typing to enter text.",
128
- class: "simple-editor"
129
- }
130
- },
131
- extensions: [
132
- V.configure({
133
- horizontalRule: !1,
134
- link: {
135
- openOnClick: !1,
136
- enableClickSelection: !0
137
- }
138
- }),
139
- D,
140
- N.configure({ types: ["heading", "paragraph"] }),
141
- R,
142
- M.configure({ nested: !0 }),
143
- w.configure({ multicolor: !0 }),
144
- P,
145
- A,
146
- z,
147
- U,
148
- j,
149
- K.configure({
150
- accept: "image/*",
151
- maxSize: $,
152
- limit: 3,
153
- upload: Z,
154
- onError: (f) => console.error("Upload failed:", f)
155
- }),
156
- tt.configure({
157
- table: {
158
- resizable: !0
107
+ /* @__PURE__ */ o(l, {}),
108
+ a === "highlighter" ? /* @__PURE__ */ o(po, {}) : /* @__PURE__ */ o(uo, {})
109
+ ] }), pt = v(
110
+ function({
111
+ themeMode: m,
112
+ content: t,
113
+ onContentChange: p,
114
+ placeholder: b = ""
115
+ }, L) {
116
+ const c = X(), { height: I } = Z(), [s, u] = x("main"), k = C(null), g = C(!1), r = E({
117
+ immediatelyRender: !0,
118
+ shouldRerenderOnTransaction: !1,
119
+ editorProps: {
120
+ attributes: {
121
+ autocomplete: "off",
122
+ autocorrect: "off",
123
+ autocapitalize: "off",
124
+ "aria-label": "Main content area, start typing to enter text.",
125
+ class: "simple-editor"
159
126
  }
160
- }),
161
- F.configure({
162
- placeholder: p
163
- })
164
- ],
165
- content: r,
166
- onUpdate: ({ editor: f }) => {
167
- if (!g.current && i) {
168
- const B = f.getHTML();
169
- i(B);
170
- }
171
- }
172
- }), I = G({
173
- editor: o,
174
- overlayHeight: k.current?.getBoundingClientRect().height ?? 0
175
- });
176
- return h(() => {
177
- !c && s !== "main" && u("main");
178
- }, [c, s]), h(() => {
179
- o && r !== void 0 && o.getHTML() !== r && (g.current = !0, o.commands.setContent(r, { emitUpdate: !1 }), g.current = !1);
180
- }, [r, o]), h(() => {
181
- document.documentElement.classList.toggle("dark", n === "dark");
182
- }, [n]), x(
183
- b,
184
- () => ({
185
- getEditor: () => o
186
- }),
187
- [o]
188
- ), o ? /* @__PURE__ */ t("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ e(v.Provider, { value: { editor: o }, children: [
189
- /* @__PURE__ */ t(
190
- ot,
191
- {
192
- ref: k,
193
- style: {
194
- ...c ? {
195
- bottom: `calc(100% - ${L - I.y}px)`
196
- } : {}
197
- },
198
- children: s === "main" ? /* @__PURE__ */ t(
199
- ft,
200
- {
201
- onHighlighterClick: () => u("highlighter"),
202
- onLinkClick: () => u("link"),
203
- isMobile: c
127
+ },
128
+ extensions: [
129
+ D.configure({
130
+ horizontalRule: !1,
131
+ link: {
132
+ openOnClick: !1,
133
+ enableClickSelection: !0
204
134
  }
205
- ) : /* @__PURE__ */ t(
206
- dt,
207
- {
208
- type: s === "highlighter" ? "highlighter" : "link",
209
- onBack: () => u("main")
135
+ }),
136
+ K,
137
+ A.configure({ types: ["heading", "paragraph"] }),
138
+ M,
139
+ U.configure({ nested: !0 }),
140
+ R.configure({ multicolor: !0 }),
141
+ P,
142
+ j,
143
+ N,
144
+ z,
145
+ F,
146
+ O.configure({
147
+ accept: "image/*",
148
+ maxSize: J,
149
+ limit: 3,
150
+ upload: $,
151
+ onError: (f) => console.error("Upload failed:", f)
152
+ }),
153
+ to.configure({
154
+ table: {
155
+ resizable: !0
210
156
  }
211
- )
212
- }
213
- ),
214
- /* @__PURE__ */ t(Q, {}),
215
- /* @__PURE__ */ t(
216
- E,
217
- {
218
- editor: o,
219
- role: "presentation",
220
- className: "simple-editor-content"
157
+ }),
158
+ V.configure({
159
+ placeholder: b
160
+ })
161
+ ],
162
+ content: t,
163
+ onUpdate: ({ editor: f }) => {
164
+ !g.current && p && p(f.getHTML());
221
165
  }
222
- )
223
- ] }) }) : null;
224
- }
166
+ }), B = W({
167
+ editor: r,
168
+ overlayHeight: k.current?.getBoundingClientRect().height ?? 0
169
+ });
170
+ return h(() => {
171
+ !c && s !== "main" && u("main");
172
+ }, [c, s]), h(() => {
173
+ r && t !== void 0 && r.getHTML() !== t && (g.current = !0, r.commands.setContent(t, { emitUpdate: !1 }), g.current = !1);
174
+ }, [t, r]), h(() => {
175
+ document.documentElement.classList.toggle("dark", m === "dark");
176
+ }, [m]), w(
177
+ L,
178
+ () => ({
179
+ getEditor: () => r
180
+ }),
181
+ [r]
182
+ ), r ? /* @__PURE__ */ o("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ e(H.Provider, { value: { editor: r }, children: [
183
+ /* @__PURE__ */ o(
184
+ ro,
185
+ {
186
+ ref: k,
187
+ style: {
188
+ ...c ? { bottom: `calc(100% - ${I - B.y}px)` } : {}
189
+ },
190
+ children: s === "main" ? /* @__PURE__ */ o(
191
+ go,
192
+ {
193
+ onHighlighterClick: () => u("highlighter"),
194
+ onLinkClick: () => u("link"),
195
+ isMobile: c
196
+ }
197
+ ) : /* @__PURE__ */ o(
198
+ ho,
199
+ {
200
+ type: s === "highlighter" ? "highlighter" : "link",
201
+ onBack: () => u("main")
202
+ }
203
+ )
204
+ }
205
+ ),
206
+ /* @__PURE__ */ o(Y, {}),
207
+ /* @__PURE__ */ o(
208
+ S,
209
+ {
210
+ editor: r,
211
+ role: "presentation",
212
+ className: "simple-editor-content"
213
+ }
214
+ )
215
+ ] }) }) : null;
216
+ }
217
+ );
225
218
  export {
226
- mo as SimpleEditor
219
+ pt as SimpleEditor
227
220
  };
@@ -1,16 +1,16 @@
1
1
  import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
- import { forwardRef as H, useRef as I, useMemo as y, useState as x } from "react";
2
+ import { forwardRef as H, useState as I, useRef as y, useMemo as x } from "react";
3
3
  import "@tiptap/react";
4
4
  import { useMenuNavigation as B } from "../../../hooks/use-menu-navigation.js";
5
5
  import { useIsMobile as P } from "../../../hooks/use-mobile.js";
6
6
  import { useTiptapEditor as R } from "../../../hooks/use-tiptap-editor.js";
7
7
  import { BanIcon as S } from "../../tiptap-icons/ban-icon.js";
8
8
  import { HighlighterIcon as N } from "../../tiptap-icons/highlighter-icon.js";
9
+ import { Popover as w, PopoverTrigger as M, PopoverContent as k } from "../../tiptap-ui-primitive/popover/popover.js";
9
10
  import { useColorHighlight as m, pickHighlightColorsByValue as f } from "../color-highlight-button/use-color-highlight.js";
10
- import { Card as w, CardBody as M, CardItemGroup as k } from "../../tiptap-ui-primitive/card/card.js";
11
+ import { Card as z, CardBody as O, CardItemGroup as j } from "../../tiptap-ui-primitive/card/card.js";
11
12
  import { Button as b, ButtonGroup as d } from "../../tiptap-ui-primitive/button/button.js";
12
- import { ColorHighlightButton as z } from "../color-highlight-button/color-highlight-button.js";
13
- import { Popover as O, PopoverTrigger as j, PopoverContent as E } from "../../tiptap-ui-primitive/popover/popover.js";
13
+ import { ColorHighlightButton as E } from "../color-highlight-button/color-highlight-button.js";
14
14
  import { Separator as G } from "../../tiptap-ui-primitive/separator/separator.js";
15
15
  const v = H(({ className: l, children: o, ...r }, a) => /* @__PURE__ */ t(
16
16
  b,
@@ -39,7 +39,7 @@ function T({
39
39
  "var(--tt-color-highlight-yellow)"
40
40
  ])
41
41
  }) {
42
- const { handleRemoveHighlight: r } = m({ editor: l }), a = P(), h = I(null), g = y(
42
+ const { handleRemoveHighlight: r } = m({ editor: l }), a = P(), h = y(null), g = x(
43
43
  () => [...o, { label: "Remove highlight", value: "none" }],
44
44
  [o]
45
45
  ), { selectedIndex: n } = B({
@@ -56,14 +56,14 @@ function T({
56
56
  autoSelectFirstItem: !1
57
57
  });
58
58
  return /* @__PURE__ */ t(
59
- w,
59
+ z,
60
60
  {
61
61
  ref: h,
62
62
  tabIndex: 0,
63
63
  style: a ? { boxShadow: "none", border: 0 } : {},
64
- children: /* @__PURE__ */ t(M, { style: a ? { padding: 0 } : {}, children: /* @__PURE__ */ u(k, { orientation: "horizontal", children: [
64
+ children: /* @__PURE__ */ t(O, { style: a ? { padding: 0 } : {}, children: /* @__PURE__ */ u(j, { orientation: "horizontal", children: [
65
65
  /* @__PURE__ */ t(d, { orientation: "horizontal", children: o.map((e, i) => /* @__PURE__ */ t(
66
- z,
66
+ E,
67
67
  {
68
68
  editor: l,
69
69
  highlightColor: e.value,
@@ -106,13 +106,13 @@ function Z({
106
106
  onApplied: a,
107
107
  ...h
108
108
  }) {
109
- const { editor: g } = R(l), [n, e] = x(!1), { isVisible: i, canColorHighlight: p, isActive: s, label: c, Icon: C } = m({
109
+ const { editor: g } = R(l), [n, e] = I(!1), { isVisible: i, canColorHighlight: p, isActive: s, label: c, Icon: C } = m({
110
110
  editor: g,
111
111
  hideWhenUnavailable: r,
112
112
  onApplied: a
113
113
  });
114
- return i ? /* @__PURE__ */ u(O, { open: n, onOpenChange: e, children: [
115
- /* @__PURE__ */ t(j, { asChild: !0, children: /* @__PURE__ */ t(
114
+ return i ? /* @__PURE__ */ u(w, { open: n, onOpenChange: e, children: [
115
+ /* @__PURE__ */ t(M, { asChild: !0, children: /* @__PURE__ */ t(
116
116
  v,
117
117
  {
118
118
  disabled: !p,
@@ -125,7 +125,7 @@ function Z({
125
125
  children: /* @__PURE__ */ t(C, { className: "tiptap-button-icon" })
126
126
  }
127
127
  ) }),
128
- /* @__PURE__ */ t(E, { "aria-label": "Highlight colors", children: /* @__PURE__ */ t(T, { editor: g, colors: o }) })
128
+ /* @__PURE__ */ t(k, { "aria-label": "Highlight colors", children: /* @__PURE__ */ t(T, { editor: g, colors: o }) })
129
129
  ] }) : null;
130
130
  }
131
131
  export {
@@ -4,7 +4,7 @@ import { ListIcon as u } from "../../tiptap-icons/list-icon.js";
4
4
  import { ListOrderedIcon as A } from "../../tiptap-icons/list-ordered-icon.js";
5
5
  import { ListTodoIcon as h } from "../../tiptap-icons/list-todo-icon.js";
6
6
  import { isNodeInSchema as T } from "../../../lib/tiptap-utils.js";
7
- import { canToggleList as I, isListActive as d, listIcons as E } from "../list-button/use-list.js";
7
+ import { listIcons as I, canToggleList as E, isListActive as d } from "../list-button/use-list.js";
8
8
  const S = [
9
9
  {
10
10
  label: "Bullet List",
@@ -23,7 +23,7 @@ const S = [
23
23
  }
24
24
  ];
25
25
  function U(t, i) {
26
- return !t || !t.isEditable ? !1 : i.some((e) => I(t, e));
26
+ return !t || !t.isEditable ? !1 : i.some((e) => E(t, e));
27
27
  }
28
28
  function O(t, i) {
29
29
  return !t || !t.isEditable ? !1 : i.some((e) => d(t, e));
@@ -70,7 +70,7 @@ function j(t) {
70
70
  types: e,
71
71
  filteredLists: l,
72
72
  label: "List",
73
- Icon: f ? E[f.type] : u
73
+ Icon: f ? I[f.type] : u
74
74
  };
75
75
  }
76
76
  export {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dooherceg/tiptap-controlled-editor-with-table",
3
3
  "private": false,
4
4
  "baseUrl": "./",
5
- "version": "0.0.8",
5
+ "version": "0.0.9",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",