@kopexa/tiptap 1.0.0 → 2.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/dist/{chunk-AASYBJDX.mjs → chunk-2SI7MRAE.mjs} +1 -1
- package/dist/{chunk-6W7J7PHZ.mjs → chunk-B2DHYFSH.mjs} +6 -7
- package/dist/{chunk-RQPJU4UB.mjs → chunk-B7WJOQ3X.mjs} +1 -1
- package/dist/{chunk-ACWAVTTK.mjs → chunk-BEV5U2DK.mjs} +6 -6
- package/dist/{chunk-TGQP45HH.mjs → chunk-EHY2NAW7.mjs} +1 -3
- package/dist/{chunk-O5P45H3I.mjs → chunk-GYIYX2JH.mjs} +1 -1
- package/dist/{chunk-QCULSZRZ.mjs → chunk-IOB3REX6.mjs} +1 -3
- package/dist/{chunk-ILPDDC4W.mjs → chunk-IQERE7KP.mjs} +1 -4
- package/dist/{chunk-6SS62RYU.mjs → chunk-JNL4KY45.mjs} +1 -3
- package/dist/{chunk-R2RRQUU5.mjs → chunk-LHXRE26G.mjs} +2 -2
- package/dist/{chunk-F2HHFSM4.mjs → chunk-LNVWG34E.mjs} +1 -4
- package/dist/chunk-NUCXXNTA.mjs +131 -0
- package/dist/{chunk-GLQRF7PR.mjs → chunk-OEVR5N7X.mjs} +2 -10
- package/dist/{chunk-YYHNT322.mjs → chunk-OZWCQMRA.mjs} +27 -19
- package/dist/{chunk-OX2A52WL.mjs → chunk-Q7DFJ5NI.mjs} +2 -4
- package/dist/{chunk-ODBSAQ5V.mjs → chunk-QF3YHPWM.mjs} +2 -4
- package/dist/{chunk-R5AMMJTQ.mjs → chunk-REJEJXOZ.mjs} +3 -3
- package/dist/chunk-TZQQ6C2Q.mjs +101 -0
- package/dist/{chunk-KI3YOPAA.mjs → chunk-UJ4BNZ63.mjs} +1 -4
- package/dist/{chunk-4LAWYE7B.mjs → chunk-V6TAZMQN.mjs} +2 -4
- package/dist/{chunk-QP2LCU5N.mjs → chunk-VX3HSJ76.mjs} +2 -2
- package/dist/{chunk-WCBSINO5.mjs → chunk-W2FLOOJ6.mjs} +1 -1
- package/dist/{chunk-JHMEXFB3.mjs → chunk-WHJ4B43N.mjs} +1 -1
- package/dist/{chunk-YD56B5SG.mjs → chunk-WPRDVMPN.mjs} +19 -18
- package/dist/{chunk-44V2Y6IU.mjs → chunk-XL5FS7LN.mjs} +3 -3
- package/dist/{chunk-ZSYXHD7D.mjs → chunk-YJAHZXLG.mjs} +1 -4
- package/dist/{chunk-T7LL5ZSR.mjs → chunk-ZVTJ6XD7.mjs} +1 -3
- package/dist/{chunk-I7WKP3OM.mjs → chunk-ZZ4OU46C.mjs} +6 -6
- package/dist/context/editor-context.d.mts +4 -4
- package/dist/context/editor-context.d.ts +4 -4
- package/dist/context/editor-context.js +5 -5
- package/dist/context/editor-context.mjs +5 -6
- package/dist/extensions/link/index.mjs +0 -1
- package/dist/extensions/selection/index.mjs +0 -1
- package/dist/extensions/trailing-node/index.mjs +0 -1
- package/dist/extensions/ui-state/index.mjs +0 -1
- package/dist/hooks/use-create-editor.d.mts +16 -5
- package/dist/hooks/use-create-editor.d.ts +16 -5
- package/dist/hooks/use-create-editor.js +84 -1062
- package/dist/hooks/use-create-editor.mjs +5 -18
- package/dist/hooks/use-cursor-visibility.mjs +0 -1
- package/dist/hooks/use-floating-element.mjs +0 -1
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -1
- package/dist/hooks/use-menu-navigation.mjs +0 -1
- package/dist/hooks/use-tiptap-editor.mjs +0 -1
- package/dist/hooks/use-ui-editor-state.mjs +0 -1
- package/dist/hooks/use-window-size.mjs +0 -1
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +483 -1584
- package/dist/index.mjs +39 -60
- package/dist/presets/basic/editor-header.js +112 -167
- package/dist/presets/basic/editor-header.mjs +25 -25
- package/dist/presets/basic/index.d.mts +6 -3
- package/dist/presets/basic/index.d.ts +6 -3
- package/dist/presets/basic/index.js +386 -1468
- package/dist/presets/basic/index.mjs +32 -46
- package/dist/ui/blockquote-button/blockquote-button.js +12 -67
- package/dist/ui/blockquote-button/blockquote-button.mjs +2 -4
- package/dist/ui/blockquote-button/index.js +12 -67
- package/dist/ui/blockquote-button/index.mjs +2 -4
- package/dist/ui/blockquote-button/use-blockquote.js +12 -65
- package/dist/ui/blockquote-button/use-blockquote.mjs +1 -3
- package/dist/ui/codeblock-button/code-block-button.js +13 -76
- package/dist/ui/codeblock-button/code-block-button.mjs +2 -4
- package/dist/ui/codeblock-button/index.js +13 -76
- package/dist/ui/codeblock-button/index.mjs +2 -4
- package/dist/ui/codeblock-button/use-code-block.js +12 -65
- package/dist/ui/codeblock-button/use-code-block.mjs +1 -3
- package/dist/ui/color-highlight-button/color-highlight-button.js +3 -23
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +2 -4
- package/dist/ui/color-highlight-button/index.js +3 -23
- package/dist/ui/color-highlight-button/index.mjs +2 -4
- package/dist/ui/color-highlight-button/use-color-highlight.js +3 -21
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +1 -3
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +4 -24
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +3 -5
- package/dist/ui/color-highlight-popover/index.js +4 -24
- package/dist/ui/color-highlight-popover/index.mjs +3 -5
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +2 -18
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +1 -3
- package/dist/ui/heading-button/index.js +2 -9
- package/dist/ui/heading-button/index.mjs +1 -3
- package/dist/ui/heading-button/utils.mjs +0 -1
- package/dist/ui/heading-dropdown-menu/index.js +4 -10
- package/dist/ui/heading-dropdown-menu/index.mjs +2 -4
- package/dist/ui/link-popover/index.js +2 -6
- package/dist/ui/link-popover/index.mjs +3 -4
- package/dist/ui/link-popover/link-popover.js +2 -6
- package/dist/ui/link-popover/link-popover.mjs +3 -4
- package/dist/ui/link-popover/use-link-popover.js +2 -6
- package/dist/ui/link-popover/use-link-popover.mjs +2 -3
- package/dist/ui/list-button/index.js +2 -9
- package/dist/ui/list-button/index.mjs +1 -3
- package/dist/ui/list-dropdown-menu/index.js +4 -10
- package/dist/ui/list-dropdown-menu/index.mjs +2 -4
- package/dist/ui/mark-button/index.js +3 -21
- package/dist/ui/mark-button/index.mjs +1 -3
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -1
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -1
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -1
- package/dist/ui/slash-dropdown-menu/index.js +27 -129
- package/dist/ui/slash-dropdown-menu/index.mjs +3 -5
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +27 -129
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +3 -5
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +23 -116
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +2 -4
- package/dist/ui/suggestion-menu/index.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -1
- package/dist/ui/table-button/index.js +4 -24
- package/dist/ui/table-button/index.mjs +2 -4
- package/dist/ui/table-button/use-table.js +3 -21
- package/dist/ui/table-button/use-table.mjs +1 -3
- package/dist/ui/text-align-button/index.js +3 -32
- package/dist/ui/text-align-button/index.mjs +2 -4
- package/dist/ui/text-align-button/text-align-button.js +3 -32
- package/dist/ui/text-align-button/text-align-button.mjs +2 -4
- package/dist/ui/text-align-button/use-text-align.js +3 -30
- package/dist/ui/text-align-button/use-text-align.mjs +1 -3
- package/dist/ui/undo-redo-button/index.js +2 -18
- package/dist/ui/undo-redo-button/index.mjs +2 -4
- package/dist/ui/undo-redo-button/undo-redo-button.js +2 -18
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +2 -4
- package/dist/ui/undo-redo-button/use-undo-redo.js +2 -16
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +1 -3
- package/dist/utils/index.d.mts +1 -101
- package/dist/utils/index.d.ts +1 -101
- package/dist/utils/index.js +0 -166
- package/dist/utils/index.mjs +1 -28
- package/dist/utils/safe-parse.mjs +0 -1
- package/package.json +36 -30
- package/dist/chunk-4HTILXJM.mjs +0 -104
- package/dist/chunk-4IIGLBTD.mjs +0 -81
- package/dist/chunk-574UV65T.mjs +0 -111
- package/dist/chunk-7HC7D256.mjs +0 -91
- package/dist/chunk-AC22DSDA.mjs +0 -540
- package/dist/chunk-AGOMESFC.mjs +0 -1
- package/dist/chunk-BXPGSCTT.mjs +0 -39
- package/dist/chunk-C6M3CDOK.mjs +0 -254
- package/dist/chunk-EN3J5AMF.mjs +0 -12
- package/dist/chunk-HYDS6H67.mjs +0 -58
- package/dist/chunk-KRLE4MMD.mjs +0 -116
- package/dist/chunk-LKOQAQPZ.mjs +0 -13
- package/dist/chunk-LXZ53XU7.mjs +0 -1
- package/dist/chunk-T6P7CS4F.mjs +0 -42
- package/dist/chunk-TVFWG7IC.mjs +0 -43
- package/dist/chunk-VULWMVYS.mjs +0 -11
- package/dist/chunk-WKV76XOR.mjs +0 -8
- package/dist/extensions/table/index.d.mts +0 -8
- package/dist/extensions/table/index.d.ts +0 -8
- package/dist/extensions/table/index.js +0 -1044
- package/dist/extensions/table/index.mjs +0 -33
- package/dist/extensions/table/kit.d.mts +0 -30
- package/dist/extensions/table/kit.d.ts +0 -30
- package/dist/extensions/table/kit.js +0 -1034
- package/dist/extensions/table/kit.mjs +0 -20
- package/dist/extensions/table/table/icons.d.mts +0 -13
- package/dist/extensions/table/table/icons.d.ts +0 -13
- package/dist/extensions/table/table/icons.js +0 -81
- package/dist/extensions/table/table/icons.mjs +0 -8
- package/dist/extensions/table/table/index.d.mts +0 -3
- package/dist/extensions/table/table/index.d.ts +0 -3
- package/dist/extensions/table/table/index.js +0 -818
- package/dist/extensions/table/table/index.mjs +0 -16
- package/dist/extensions/table/table/table-controls.d.mts +0 -10
- package/dist/extensions/table/table/table-controls.d.ts +0 -10
- package/dist/extensions/table/table/table-controls.js +0 -129
- package/dist/extensions/table/table/table-controls.mjs +0 -8
- package/dist/extensions/table/table/table-view.d.mts +0 -43
- package/dist/extensions/table/table/table-view.d.ts +0 -43
- package/dist/extensions/table/table/table-view.js +0 -610
- package/dist/extensions/table/table/table-view.mjs +0 -12
- package/dist/extensions/table/table/table.d.mts +0 -17
- package/dist/extensions/table/table/table.d.ts +0 -17
- package/dist/extensions/table/table/table.js +0 -816
- package/dist/extensions/table/table/table.mjs +0 -15
- package/dist/extensions/table/table/utilities/col-style.d.mts +0 -3
- package/dist/extensions/table/table/utilities/col-style.d.ts +0 -3
- package/dist/extensions/table/table/utilities/col-style.js +0 -36
- package/dist/extensions/table/table/utilities/col-style.mjs +0 -8
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.d.mts +0 -5
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.d.ts +0 -5
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.js +0 -66
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.mjs +0 -40
- package/dist/extensions/table/table/utilities/get-table-node-types.d.mts +0 -7
- package/dist/extensions/table/table/utilities/get-table-node-types.d.ts +0 -7
- package/dist/extensions/table/table/utilities/get-table-node-types.js +0 -44
- package/dist/extensions/table/table/utilities/get-table-node-types.mjs +0 -21
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.d.mts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.d.ts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.js +0 -80
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.mjs +0 -9
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.d.mts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.d.ts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.js +0 -79
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.mjs +0 -9
- package/dist/extensions/table/table/utilities/is-cell-selection.d.mts +0 -5
- package/dist/extensions/table/table/utilities/is-cell-selection.d.ts +0 -5
- package/dist/extensions/table/table/utilities/is-cell-selection.js +0 -34
- package/dist/extensions/table/table/utilities/is-cell-selection.mjs +0 -8
- package/dist/extensions/table/table-cell.d.mts +0 -8
- package/dist/extensions/table/table-cell.d.ts +0 -8
- package/dist/extensions/table/table-cell.js +0 -139
- package/dist/extensions/table/table-cell.mjs +0 -8
- package/dist/extensions/table/table-header.d.mts +0 -6
- package/dist/extensions/table/table-header.d.ts +0 -6
- package/dist/extensions/table/table-header.js +0 -104
- package/dist/extensions/table/table-header.mjs +0 -8
- package/dist/extensions/table/table-row.d.mts +0 -6
- package/dist/extensions/table/table-row.d.ts +0 -6
- package/dist/extensions/table/table-row.js +0 -35
- package/dist/extensions/table/table-row.mjs +0 -8
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SlashDropdownMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QF3YHPWM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useScrollToHash
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JNL4KY45.mjs";
|
|
8
8
|
import {
|
|
9
9
|
EditorHeader
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OZWCQMRA.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useUiEditorState
|
|
13
13
|
} from "./chunk-BXJYNSWQ.mjs";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-R5AMMJTQ.mjs";
|
|
15
|
+
EditorUIProvider
|
|
16
|
+
} from "./chunk-REJEJXOZ.mjs";
|
|
18
17
|
import {
|
|
19
18
|
useCreateEditor
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NUCXXNTA.mjs";
|
|
21
20
|
|
|
22
21
|
// src/presets/basic/index.tsx
|
|
23
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
editorBasic,
|
|
24
|
+
editorSpinner
|
|
25
|
+
} from "@kopexa/theme";
|
|
24
26
|
import {
|
|
25
27
|
EditorContent,
|
|
26
28
|
EditorContext
|
|
@@ -28,23 +30,22 @@ import {
|
|
|
28
30
|
import { useContext } from "react";
|
|
29
31
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
32
|
var BasicEditor = ({
|
|
33
|
+
variant,
|
|
31
34
|
content,
|
|
32
|
-
|
|
33
|
-
onChange,
|
|
34
|
-
locale
|
|
35
|
+
...options
|
|
35
36
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
37
|
+
const editor = useCreateEditor({ content, ...options });
|
|
38
|
+
const styles = editorBasic({ variant });
|
|
38
39
|
if (!editor) {
|
|
39
40
|
return /* @__PURE__ */ jsx(LoadingSpinner, {});
|
|
40
41
|
}
|
|
41
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
+
return /* @__PURE__ */ jsx(EditorUIProvider, { value: { styles }, children: /* @__PURE__ */ jsx("div", { className: styles.root(), "data-slot": "editor", children: /* @__PURE__ */ jsxs(EditorContext.Provider, { value: { editor }, children: [
|
|
42
43
|
/* @__PURE__ */ jsx(EditorHeader, { editor }),
|
|
43
|
-
/* @__PURE__ */ jsx(EditorContentArea, {})
|
|
44
|
-
] }) });
|
|
44
|
+
/* @__PURE__ */ jsx(EditorContentArea, { variant })
|
|
45
|
+
] }) }) });
|
|
45
46
|
};
|
|
46
|
-
var EditorContentArea = () => {
|
|
47
|
-
const
|
|
47
|
+
var EditorContentArea = ({ variant }) => {
|
|
48
|
+
const styles = editorBasic({ variant });
|
|
48
49
|
const { editor } = useContext(EditorContext);
|
|
49
50
|
const { isDragging } = useUiEditorState(editor);
|
|
50
51
|
useScrollToHash();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
ColorHighlightButton
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B7WJOQ3X.mjs";
|
|
5
5
|
import {
|
|
6
6
|
pickHighlightColorsByValue,
|
|
7
7
|
useColorHighlight
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UJ4BNZ63.mjs";
|
|
9
9
|
import {
|
|
10
10
|
useMenuNavigation
|
|
11
11
|
} from "./chunk-42HKGCOO.mjs";
|
|
@@ -120,7 +120,7 @@ function ColorHighlightPopover({
|
|
|
120
120
|
}) {
|
|
121
121
|
const { editor } = useTiptapEditor(providedEditor);
|
|
122
122
|
const [isOpen, setIsOpen] = useState(false);
|
|
123
|
-
const { isVisible, canColorHighlight, isActive, label
|
|
123
|
+
const { isVisible, canColorHighlight, isActive, label } = useColorHighlight({
|
|
124
124
|
editor,
|
|
125
125
|
hideWhenUnavailable,
|
|
126
126
|
onApplied
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
isNodeInSchema,
|
|
4
|
-
isNodeTypeSelected
|
|
5
|
-
} from "./chunk-C6M3CDOK.mjs";
|
|
6
2
|
import {
|
|
7
3
|
useTiptapEditor
|
|
8
4
|
} from "./chunk-P55PLOHR.mjs";
|
|
9
5
|
|
|
10
6
|
// src/ui/table-button/use-table.ts
|
|
7
|
+
import { isNodeInSchema, isNodeTypeSelected } from "@kopexa/editor-utils";
|
|
11
8
|
import { TableIcon } from "@kopexa/icons";
|
|
12
9
|
import { isNodeSelection } from "@tiptap/react";
|
|
13
10
|
import { useCallback, useEffect, useState } from "react";
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
isNodeTypeSelected
|
|
4
|
-
} from "./chunk-C6M3CDOK.mjs";
|
|
5
2
|
import {
|
|
6
3
|
useTiptapEditor
|
|
7
4
|
} from "./chunk-P55PLOHR.mjs";
|
|
8
5
|
|
|
9
6
|
// src/ui/undo-redo-button/use-undo-redo.ts
|
|
7
|
+
import { isNodeTypeSelected } from "@kopexa/editor-utils";
|
|
10
8
|
import { RedoIcon, UndoIcon } from "@kopexa/icons";
|
|
11
9
|
import { useCallback, useEffect, useState } from "react";
|
|
12
10
|
var UNDO_REDO_SHORTCUT_KEYS = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
findNodePosition,
|
|
4
|
-
isNodeInSchema,
|
|
5
|
-
isNodeTypeSelected,
|
|
6
|
-
isValidPosition
|
|
7
|
-
} from "./chunk-C6M3CDOK.mjs";
|
|
8
2
|
import {
|
|
9
3
|
useTiptapEditor
|
|
10
4
|
} from "./chunk-P55PLOHR.mjs";
|
|
11
5
|
|
|
12
6
|
// src/ui/blockquote-button/use-blockquote.ts
|
|
7
|
+
import {
|
|
8
|
+
findNodePosition,
|
|
9
|
+
isNodeInSchema,
|
|
10
|
+
isNodeTypeSelected,
|
|
11
|
+
isValidPosition
|
|
12
|
+
} from "@kopexa/editor-utils";
|
|
13
13
|
import { BlockquoteIcon } from "@kopexa/icons";
|
|
14
14
|
import { NodeSelection, TextSelection } from "@tiptap/pm/state";
|
|
15
15
|
import * as React from "react";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { editorBasic } from '@kopexa/theme';
|
|
3
3
|
|
|
4
|
-
type
|
|
4
|
+
type EditorUIContextType = {
|
|
5
5
|
styles: ReturnType<typeof editorBasic>;
|
|
6
6
|
};
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
7
|
+
declare const EditorUIProvider: React.Provider<EditorUIContextType>;
|
|
8
|
+
declare const useEditorUIContext: () => EditorUIContextType;
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { EditorUIProvider, useEditorUIContext };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { editorBasic } from '@kopexa/theme';
|
|
3
3
|
|
|
4
|
-
type
|
|
4
|
+
type EditorUIContextType = {
|
|
5
5
|
styles: ReturnType<typeof editorBasic>;
|
|
6
6
|
};
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
7
|
+
declare const EditorUIProvider: React.Provider<EditorUIContextType>;
|
|
8
|
+
declare const useEditorUIContext: () => EditorUIContextType;
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { EditorUIProvider, useEditorUIContext };
|
|
@@ -21,14 +21,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
// src/context/editor-context.ts
|
|
22
22
|
var editor_context_exports = {};
|
|
23
23
|
__export(editor_context_exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
EditorUIProvider: () => EditorUIProvider,
|
|
25
|
+
useEditorUIContext: () => useEditorUIContext
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(editor_context_exports);
|
|
28
28
|
var import_react_utils = require("@kopexa/react-utils");
|
|
29
|
-
var [
|
|
29
|
+
var [EditorUIProvider, useEditorUIContext] = (0, import_react_utils.createContext)();
|
|
30
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
31
|
0 && (module.exports = {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
EditorUIProvider,
|
|
33
|
+
useEditorUIContext
|
|
34
34
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-WKV76XOR.mjs";
|
|
3
|
+
EditorUIProvider,
|
|
4
|
+
useEditorUIContext
|
|
5
|
+
} from "../chunk-REJEJXOZ.mjs";
|
|
7
6
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
EditorUIProvider,
|
|
8
|
+
useEditorUIContext
|
|
10
9
|
};
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ControlResolver } from '@kopexa/extension-controlref';
|
|
3
|
+
import { Extensions, UseEditorOptions, JSONContent } from '@tiptap/react';
|
|
3
4
|
|
|
4
5
|
type Omitted = "editorProps";
|
|
5
|
-
type UseCreateEditorOptions = Omit<UseEditorOptions, Omitted> & {
|
|
6
|
-
placeholder?: string;
|
|
6
|
+
type UseCreateEditorOptions = Omit<UseEditorOptions, Omitted> & GetExtensionsOptions & {
|
|
7
7
|
onChange?: (content: JSONContent) => void;
|
|
8
8
|
};
|
|
9
|
-
declare const useCreateEditor: ({ content, editable, placeholder, onChange, ...options }: UseCreateEditorOptions) => _tiptap_core.Editor;
|
|
9
|
+
declare const useCreateEditor: ({ content, editable, placeholder, onChange, controlResolver, ...options }: UseCreateEditorOptions) => _tiptap_core.Editor;
|
|
10
|
+
type GetExtensionsOptions = {
|
|
11
|
+
editable?: boolean;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
controlResolver?: ControlResolver;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* getExtensions returns all kopexa used extensions for our editor.
|
|
17
|
+
* this export is important, and should be used in every editor instance even
|
|
18
|
+
* the collaborative one, to ensure that all extensions are registered correctly.
|
|
19
|
+
*/
|
|
20
|
+
declare function getExtensions({ editable, placeholder, controlResolver, }: GetExtensionsOptions): Extensions;
|
|
10
21
|
|
|
11
|
-
export { type UseCreateEditorOptions, useCreateEditor };
|
|
22
|
+
export { type GetExtensionsOptions, type UseCreateEditorOptions, getExtensions, useCreateEditor };
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ControlResolver } from '@kopexa/extension-controlref';
|
|
3
|
+
import { Extensions, UseEditorOptions, JSONContent } from '@tiptap/react';
|
|
3
4
|
|
|
4
5
|
type Omitted = "editorProps";
|
|
5
|
-
type UseCreateEditorOptions = Omit<UseEditorOptions, Omitted> & {
|
|
6
|
-
placeholder?: string;
|
|
6
|
+
type UseCreateEditorOptions = Omit<UseEditorOptions, Omitted> & GetExtensionsOptions & {
|
|
7
7
|
onChange?: (content: JSONContent) => void;
|
|
8
8
|
};
|
|
9
|
-
declare const useCreateEditor: ({ content, editable, placeholder, onChange, ...options }: UseCreateEditorOptions) => _tiptap_core.Editor;
|
|
9
|
+
declare const useCreateEditor: ({ content, editable, placeholder, onChange, controlResolver, ...options }: UseCreateEditorOptions) => _tiptap_core.Editor;
|
|
10
|
+
type GetExtensionsOptions = {
|
|
11
|
+
editable?: boolean;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
controlResolver?: ControlResolver;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* getExtensions returns all kopexa used extensions for our editor.
|
|
17
|
+
* this export is important, and should be used in every editor instance even
|
|
18
|
+
* the collaborative one, to ensure that all extensions are registered correctly.
|
|
19
|
+
*/
|
|
20
|
+
declare function getExtensions({ editable, placeholder, controlResolver, }: GetExtensionsOptions): Extensions;
|
|
10
21
|
|
|
11
|
-
export { type UseCreateEditorOptions, useCreateEditor };
|
|
22
|
+
export { type GetExtensionsOptions, type UseCreateEditorOptions, getExtensions, useCreateEditor };
|