@dooherceg/tiptap-controlled-editor-with-table 0.0.10 → 0.0.12
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/Combination-CO0ZtURs.js +1333 -0
- package/dist/assets/{components/tiptap-ui-primitive/badge/badge-colors.css → badge.css} +1 -1
- package/dist/assets/{components/tiptap-ui-primitive/button/button-colors.css → button.css} +1 -1
- package/dist/assets/simple-editor.css +1 -0
- package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.js +58 -6
- package/dist/components/tiptap-node/image-upload-node/image-upload-node.js +4 -5
- package/dist/components/tiptap-templates/simple/simple-editor.d.ts +1 -1
- package/dist/components/tiptap-templates/simple/simple-editor.js +1926 -158
- package/dist/components/tiptap-templates/simple/theme-toggle.js +7 -7
- package/dist/components/tiptap-ui/blockquote-button/blockquote-button.js +10 -10
- package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.js +5 -6
- package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.js +1 -1
- package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.js +19 -19
- package/dist/components/tiptap-ui/heading-button/heading-button.js +9 -9
- package/dist/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.js +37 -29
- package/dist/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.js +14 -13
- package/dist/components/tiptap-ui/image-upload-button/use-image-upload.js +16 -16
- package/dist/components/tiptap-ui/insert-table-button/insert-table-button.js +9 -9
- package/dist/components/tiptap-ui/link-popover/link-popover.js +13 -13
- package/dist/components/tiptap-ui/list-button/list-button.js +7 -7
- package/dist/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.js +24 -20
- package/dist/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.js +3 -2
- package/dist/components/tiptap-ui/table-actions-toolbar/table-actions-toolbar.js +28 -28
- package/dist/components/tiptap-ui-primitive/badge/badge.js +16 -19
- package/dist/components/tiptap-ui-primitive/button/button.js +19 -22
- package/dist/components/tiptap-ui-primitive/card/card.js +12 -13
- package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.js +1012 -39
- package/dist/components/tiptap-ui-primitive/input/input.js +6 -7
- package/dist/components/tiptap-ui-primitive/popover/popover.js +233 -24
- package/dist/components/tiptap-ui-primitive/separator/separator.js +8 -9
- package/dist/components/tiptap-ui-primitive/toolbar/toolbar.js +7 -8
- package/dist/components/tiptap-ui-primitive/tooltip/tooltip.js +1330 -84
- package/dist/floating-ui.react-dom-DgOuULHo.js +1334 -0
- package/dist/hooks/use-throttled-callback.js +108 -13
- package/dist/{node_modules/react-hotkeys-hook/packages/react-hotkeys-hook/dist/index.js → index-Bqw9S4qP.js} +55 -57
- package/package.json +1 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -8
- package/dist/_virtual/index.js +0 -7
- package/dist/assets/components/tiptap-node/blockquote-node/blockquote-node.css +0 -1
- package/dist/assets/components/tiptap-node/code-block-node/code-block-node.css +0 -1
- package/dist/assets/components/tiptap-node/heading-node/heading-node.css +0 -1
- package/dist/assets/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.css +0 -1
- package/dist/assets/components/tiptap-node/image-node/image-node.css +0 -1
- package/dist/assets/components/tiptap-node/list-node/list-node.css +0 -1
- package/dist/assets/components/tiptap-node/paragraph-node/paragraph-node.css +0 -1
- package/dist/assets/components/tiptap-templates/simple/simple-editor.css +0 -1
- package/dist/assets/components/tiptap-ui-primitive/badge/badge-group.css +0 -1
- package/dist/assets/components/tiptap-ui-primitive/badge/badge.css +0 -1
- package/dist/assets/components/tiptap-ui-primitive/button/button-group.css +0 -1
- package/dist/assets/components/tiptap-ui-primitive/button/button.css +0 -1
- package/dist/assets/styles/_keyframe-animations.css +0 -1
- package/dist/assets/styles/_variables.css +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -527
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -402
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -932
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +0 -185
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -208
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -136
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -24
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -48
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -29
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -53
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -10
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -127
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -221
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -136
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -13
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -636
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -239
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -219
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -36
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -183
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -10
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -27
- package/dist/node_modules/@tiptap/extension-highlight/dist/index.js +0 -84
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -57
- package/dist/node_modules/@tiptap/extension-image/dist/index.js +0 -128
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -713
- package/dist/node_modules/@tiptap/extension-subscript/dist/index.js +0 -40
- package/dist/node_modules/@tiptap/extension-superscript/dist/index.js +0 -40
- package/dist/node_modules/@tiptap/extension-table/dist/index.js +0 -380
- package/dist/node_modules/@tiptap/extension-text-align/dist/index.js +0 -46
- package/dist/node_modules/@tiptap/extension-typography/dist/index.js +0 -125
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -288
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -7
- package/dist/node_modules/lodash.throttle/index.js +0 -95
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -11
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -112
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -31
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -16
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -68
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -71
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -7
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -25
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -11
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -15
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -30
- package/dist/node_modules/tabbable/dist/index.esm.js +0 -197
- package/dist/node_modules/tslib/tslib.es6.js +0 -27
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -6
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -26
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -25
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -18
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -67
- /package/dist/assets/{components/tiptap-ui-primitive/card/card.css → card.css} +0 -0
- /package/dist/assets/{components/tiptap-ui/color-highlight-button/color-highlight-button.css → color-highlight-button.css} +0 -0
- /package/dist/assets/{components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.css → dropdown-menu.css} +0 -0
- /package/dist/assets/{components/tiptap-node/image-upload-node/image-upload-node.css → image-upload-node.css} +0 -0
- /package/dist/assets/{components/tiptap-ui-primitive/input/input.css → input.css} +0 -0
- /package/dist/assets/{components/tiptap-ui-primitive/popover/popover.css → popover.css} +0 -0
- /package/dist/assets/{components/tiptap-ui-primitive/separator/separator.css → separator.css} +0 -0
- /package/dist/assets/{components/tiptap-ui-primitive/toolbar/toolbar.css → toolbar.css} +0 -0
- /package/dist/assets/{components/tiptap-ui-primitive/tooltip/tooltip.css → tooltip.css} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Button as c } from "../../tiptap-ui-primitive/button/button.js";
|
|
3
|
+
import { MoonStarIcon as s } from "../../tiptap-icons/moon-star-icon.js";
|
|
4
|
+
import { SunIcon as m } from "../../tiptap-icons/sun-icon.js";
|
|
5
|
+
import { useState as i, useEffect as a } from "react";
|
|
6
6
|
function f() {
|
|
7
|
-
const [t, o] =
|
|
7
|
+
const [t, o] = i(!1);
|
|
8
8
|
return a(() => {
|
|
9
9
|
const e = window.matchMedia("(prefers-color-scheme: dark)"), n = () => o(e.matches);
|
|
10
10
|
return e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
@@ -14,12 +14,12 @@ function f() {
|
|
|
14
14
|
}, []), a(() => {
|
|
15
15
|
document.documentElement.classList.toggle("dark", t);
|
|
16
16
|
}, [t]), /* @__PURE__ */ r(
|
|
17
|
-
|
|
17
|
+
c,
|
|
18
18
|
{
|
|
19
19
|
onClick: () => o((e) => !e),
|
|
20
20
|
"aria-label": `Switch to ${t ? "light" : "dark"} mode`,
|
|
21
21
|
"data-style": "ghost",
|
|
22
|
-
children: t ? /* @__PURE__ */ r(
|
|
22
|
+
children: t ? /* @__PURE__ */ r(s, { className: "tiptap-button-icon" }) : /* @__PURE__ */ r(m, { className: "tiptap-button-icon" })
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as t, jsxs as T, Fragment as q } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y, useCallback as x } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useBlockquote as C, BLOCKQUOTE_SHORTCUT_KEY as K } from "./use-blockquote.js";
|
|
4
|
+
import { useTiptapEditor as E } from "../../../hooks/use-tiptap-editor.js";
|
|
5
|
+
import { parseShortcutKeys as N } from "../../../lib/tiptap-utils.js";
|
|
6
|
+
import { Button as O } from "../../tiptap-ui-primitive/button/button.js";
|
|
7
|
+
import { Badge as S } from "../../tiptap-ui-primitive/badge/badge.js";
|
|
8
8
|
function j({
|
|
9
|
-
shortcutKeys: o =
|
|
9
|
+
shortcutKeys: o = K
|
|
10
10
|
}) {
|
|
11
|
-
return /* @__PURE__ */ t(
|
|
11
|
+
return /* @__PURE__ */ t(S, { children: N({ shortcutKeys: o }) });
|
|
12
12
|
}
|
|
13
13
|
const v = y(
|
|
14
14
|
({
|
|
@@ -21,7 +21,7 @@ const v = y(
|
|
|
21
21
|
children: d,
|
|
22
22
|
...p
|
|
23
23
|
}, m) => {
|
|
24
|
-
const { editor: f } =
|
|
24
|
+
const { editor: f } = E(o), {
|
|
25
25
|
isVisible: b,
|
|
26
26
|
canToggle: a,
|
|
27
27
|
isActive: i,
|
|
@@ -29,7 +29,7 @@ const v = y(
|
|
|
29
29
|
label: B,
|
|
30
30
|
shortcutKeys: h,
|
|
31
31
|
Icon: g
|
|
32
|
-
} =
|
|
32
|
+
} = C({
|
|
33
33
|
editor: f,
|
|
34
34
|
hideWhenUnavailable: n,
|
|
35
35
|
onToggled: c
|
|
@@ -40,7 +40,7 @@ const v = y(
|
|
|
40
40
|
[l, r]
|
|
41
41
|
);
|
|
42
42
|
return b ? /* @__PURE__ */ t(
|
|
43
|
-
|
|
43
|
+
O,
|
|
44
44
|
{
|
|
45
45
|
type: "button",
|
|
46
46
|
"data-style": "ghost",
|
|
@@ -2,11 +2,10 @@ import { jsx as o, jsxs as S, Fragment as k } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as x, useCallback as I, useMemo as K } from "react";
|
|
3
3
|
import { parseShortcutKeys as N } from "../../../lib/tiptap-utils.js";
|
|
4
4
|
import { useTiptapEditor as O } from "../../../hooks/use-tiptap-editor.js";
|
|
5
|
-
import '../../../assets/components/tiptap-ui/color-highlight-button/color-highlight-button.css';/* empty css */
|
|
6
5
|
import { useColorHighlight as R, COLOR_HIGHLIGHT_SHORTCUT_KEY as _ } from "./use-color-highlight.js";
|
|
7
6
|
import { Button as j } from "../../tiptap-ui-primitive/button/button.js";
|
|
8
7
|
import { Badge as v } from "../../tiptap-ui-primitive/badge/badge.js";
|
|
9
|
-
function E({
|
|
8
|
+
import '../../../assets/color-highlight-button.css';function E({
|
|
10
9
|
shortcutKeys: e = _
|
|
11
10
|
}) {
|
|
12
11
|
return /* @__PURE__ */ o(v, { children: N({ shortcutKeys: e }) });
|
|
@@ -17,8 +16,8 @@ const G = x(
|
|
|
17
16
|
highlightColor: t,
|
|
18
17
|
text: r,
|
|
19
18
|
hideWhenUnavailable: h = !1,
|
|
20
|
-
mode:
|
|
21
|
-
onApplied:
|
|
19
|
+
mode: u = "mark",
|
|
20
|
+
onApplied: p,
|
|
22
21
|
showShortcut: m = !1,
|
|
23
22
|
onClick: i,
|
|
24
23
|
children: g,
|
|
@@ -37,8 +36,8 @@ const G = x(
|
|
|
37
36
|
highlightColor: t,
|
|
38
37
|
label: r || `Toggle highlight (${t})`,
|
|
39
38
|
hideWhenUnavailable: h,
|
|
40
|
-
mode:
|
|
41
|
-
onApplied:
|
|
39
|
+
mode: u,
|
|
40
|
+
onApplied: p
|
|
42
41
|
}), B = I(
|
|
43
42
|
(c) => {
|
|
44
43
|
i?.(c), !c.defaultPrevented && n();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@tiptap/react";
|
|
2
2
|
import { useState as C, useEffect as y, useCallback as f } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { f as M } from "../../../index-Bqw9S4qP.js";
|
|
4
4
|
import { useIsMobile as E } from "../../../hooks/use-mobile.js";
|
|
5
5
|
import { useTiptapEditor as w } from "../../../hooks/use-tiptap-editor.js";
|
|
6
6
|
import { isMarkInSchema as d, isNodeTypeSelected as B, isExtensionAvailable as v } from "../../../lib/tiptap-utils.js";
|
|
@@ -6,14 +6,14 @@ 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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { Button as m, ButtonGroup as d } from "../../tiptap-ui-primitive/button/button.js";
|
|
10
|
+
import { Popover as w, PopoverTrigger as M, PopoverContent as k } from "../../tiptap-ui-primitive/popover/popover.js";
|
|
11
|
+
import { Separator as z } from "../../tiptap-ui-primitive/separator/separator.js";
|
|
12
|
+
import { Card as O, CardBody as j, CardItemGroup as E } from "../../tiptap-ui-primitive/card/card.js";
|
|
13
|
+
import { ColorHighlightButton as G } from "../color-highlight-button/color-highlight-button.js";
|
|
14
|
+
import { useColorHighlight as f, pickHighlightColorsByValue as b } from "../color-highlight-button/use-color-highlight.js";
|
|
15
15
|
const v = H(({ className: l, children: o, ...r }, a) => /* @__PURE__ */ t(
|
|
16
|
-
|
|
16
|
+
m,
|
|
17
17
|
{
|
|
18
18
|
type: "button",
|
|
19
19
|
className: l,
|
|
@@ -31,7 +31,7 @@ const v = H(({ className: l, children: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
31
31
|
v.displayName = "ColorHighlightPopoverButton";
|
|
32
32
|
function T({
|
|
33
33
|
editor: l,
|
|
34
|
-
colors: o =
|
|
34
|
+
colors: o = b([
|
|
35
35
|
"var(--tt-color-highlight-green)",
|
|
36
36
|
"var(--tt-color-highlight-blue)",
|
|
37
37
|
"var(--tt-color-highlight-red)",
|
|
@@ -39,7 +39,7 @@ function T({
|
|
|
39
39
|
"var(--tt-color-highlight-yellow)"
|
|
40
40
|
])
|
|
41
41
|
}) {
|
|
42
|
-
const { handleRemoveHighlight: r } =
|
|
42
|
+
const { handleRemoveHighlight: r } = f({ editor: l }), a = P(), h = I(null), g = y(
|
|
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
|
-
|
|
59
|
+
O,
|
|
60
60
|
{
|
|
61
61
|
ref: h,
|
|
62
62
|
tabIndex: 0,
|
|
63
63
|
style: a ? { boxShadow: "none", border: 0 } : {},
|
|
64
|
-
children: /* @__PURE__ */ t(
|
|
64
|
+
children: /* @__PURE__ */ t(j, { style: a ? { padding: 0 } : {}, children: /* @__PURE__ */ u(E, { orientation: "horizontal", children: [
|
|
65
65
|
/* @__PURE__ */ t(d, { orientation: "horizontal", children: o.map((e, i) => /* @__PURE__ */ t(
|
|
66
|
-
|
|
66
|
+
G,
|
|
67
67
|
{
|
|
68
68
|
editor: l,
|
|
69
69
|
highlightColor: e.value,
|
|
@@ -74,9 +74,9 @@ function T({
|
|
|
74
74
|
},
|
|
75
75
|
e.value
|
|
76
76
|
)) }),
|
|
77
|
-
/* @__PURE__ */ t(
|
|
77
|
+
/* @__PURE__ */ t(z, {}),
|
|
78
78
|
/* @__PURE__ */ t(d, { orientation: "horizontal", children: /* @__PURE__ */ t(
|
|
79
|
-
|
|
79
|
+
m,
|
|
80
80
|
{
|
|
81
81
|
onClick: r,
|
|
82
82
|
"aria-label": "Remove highlight",
|
|
@@ -95,7 +95,7 @@ function T({
|
|
|
95
95
|
}
|
|
96
96
|
function Z({
|
|
97
97
|
editor: l,
|
|
98
|
-
colors: o =
|
|
98
|
+
colors: o = b([
|
|
99
99
|
"var(--tt-color-highlight-green)",
|
|
100
100
|
"var(--tt-color-highlight-blue)",
|
|
101
101
|
"var(--tt-color-highlight-red)",
|
|
@@ -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 } =
|
|
109
|
+
const { editor: g } = R(l), [n, e] = x(!1), { isVisible: i, canColorHighlight: p, isActive: s, label: c, Icon: C } = f({
|
|
110
110
|
editor: g,
|
|
111
111
|
hideWhenUnavailable: r,
|
|
112
112
|
onApplied: a
|
|
113
113
|
});
|
|
114
|
-
return i ? /* @__PURE__ */ u(
|
|
115
|
-
/* @__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(
|
|
128
|
+
/* @__PURE__ */ t(k, { "aria-label": "Highlight colors", children: /* @__PURE__ */ t(T, { editor: g, colors: o }) })
|
|
129
129
|
] }) : null;
|
|
130
130
|
}
|
|
131
131
|
export {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as t, jsxs as T, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as N, useCallback as S } from "react";
|
|
3
3
|
import { parseShortcutKeys as C } from "../../../lib/tiptap-utils.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useHeading as E, HEADING_SHORTCUT_KEYS as I } from "./use-heading.js";
|
|
5
|
+
import { Button as K } from "../../tiptap-ui-primitive/button/button.js";
|
|
6
|
+
import { Badge as j } from "../../tiptap-ui-primitive/badge/badge.js";
|
|
7
|
+
import { useTiptapEditor as k } from "../../../hooks/use-tiptap-editor.js";
|
|
8
8
|
function A({
|
|
9
9
|
level: a,
|
|
10
|
-
shortcutKeys: e =
|
|
10
|
+
shortcutKeys: e = I[a]
|
|
11
11
|
}) {
|
|
12
|
-
return /* @__PURE__ */ t(
|
|
12
|
+
return /* @__PURE__ */ t(j, { children: C({ shortcutKeys: e }) });
|
|
13
13
|
}
|
|
14
14
|
const R = N(
|
|
15
15
|
({
|
|
@@ -23,7 +23,7 @@ const R = N(
|
|
|
23
23
|
children: m,
|
|
24
24
|
...f
|
|
25
25
|
}, g) => {
|
|
26
|
-
const { editor: b } =
|
|
26
|
+
const { editor: b } = k(a), {
|
|
27
27
|
isVisible: h,
|
|
28
28
|
canToggle: i,
|
|
29
29
|
isActive: n,
|
|
@@ -31,7 +31,7 @@ const R = N(
|
|
|
31
31
|
label: d,
|
|
32
32
|
Icon: H,
|
|
33
33
|
shortcutKeys: y
|
|
34
|
-
} =
|
|
34
|
+
} = E({
|
|
35
35
|
editor: b,
|
|
36
36
|
level: e,
|
|
37
37
|
hideWhenUnavailable: c,
|
|
@@ -43,7 +43,7 @@ const R = N(
|
|
|
43
43
|
[s, r]
|
|
44
44
|
);
|
|
45
45
|
return h ? /* @__PURE__ */ t(
|
|
46
|
-
|
|
46
|
+
K,
|
|
47
47
|
{
|
|
48
48
|
type: "button",
|
|
49
49
|
"data-style": "ghost",
|
|
@@ -2,56 +2,64 @@ import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as b, useState as C, useCallback as D } from "react";
|
|
3
3
|
import { ChevronDownIcon as M } from "../../tiptap-icons/chevron-down-icon.js";
|
|
4
4
|
import { useTiptapEditor as x } from "../../../hooks/use-tiptap-editor.js";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import { HeadingButton as H } from "../heading-button/heading-button.js";
|
|
6
|
+
import "@tiptap/react";
|
|
7
|
+
import "prosemirror-state";
|
|
8
|
+
import "../../tiptap-icons/heading-one-icon.js";
|
|
9
|
+
import "../../tiptap-icons/heading-two-icon.js";
|
|
10
|
+
import "../../tiptap-icons/heading-three-icon.js";
|
|
11
|
+
import "../../tiptap-icons/heading-four-icon.js";
|
|
12
|
+
import "../../tiptap-icons/heading-five-icon.js";
|
|
13
|
+
import "../../tiptap-icons/heading-six-icon.js";
|
|
14
|
+
import { useHeadingDropdownMenu as I } from "./use-heading-dropdown-menu.js";
|
|
15
|
+
import { Button as y, ButtonGroup as B } from "../../tiptap-ui-primitive/button/button.js";
|
|
16
|
+
import { DropdownMenu as T, DropdownMenuTrigger as N, DropdownMenuContent as O, DropdownMenuItem as j } from "../../tiptap-ui-primitive/dropdown-menu/dropdown-menu.js";
|
|
9
17
|
import { Card as $, CardBody as k } from "../../tiptap-ui-primitive/card/card.js";
|
|
10
18
|
const A = b(
|
|
11
19
|
({
|
|
12
|
-
editor:
|
|
13
|
-
levels:
|
|
14
|
-
hideWhenUnavailable:
|
|
15
|
-
portal:
|
|
16
|
-
onOpenChange:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
const { editor:
|
|
20
|
-
editor:
|
|
21
|
-
levels:
|
|
22
|
-
hideWhenUnavailable:
|
|
20
|
+
editor: p,
|
|
21
|
+
levels: n = [1, 2, 3, 4, 5, 6],
|
|
22
|
+
hideWhenUnavailable: s = !1,
|
|
23
|
+
portal: m = !1,
|
|
24
|
+
onOpenChange: i,
|
|
25
|
+
...l
|
|
26
|
+
}, u) => {
|
|
27
|
+
const { editor: r } = x(p), [c, f] = C(!1), { isVisible: h, isActive: a, canToggle: e, Icon: g } = I({
|
|
28
|
+
editor: r,
|
|
29
|
+
levels: n,
|
|
30
|
+
hideWhenUnavailable: s
|
|
23
31
|
}), w = D(
|
|
24
32
|
(t) => {
|
|
25
|
-
!
|
|
33
|
+
!r || !e || (f(t), i?.(t));
|
|
26
34
|
},
|
|
27
|
-
[
|
|
35
|
+
[e, r, i]
|
|
28
36
|
);
|
|
29
|
-
return h ? /* @__PURE__ */ d(
|
|
30
|
-
/* @__PURE__ */ o(
|
|
31
|
-
|
|
37
|
+
return h ? /* @__PURE__ */ d(T, { modal: !0, open: c, onOpenChange: w, children: [
|
|
38
|
+
/* @__PURE__ */ o(N, { asChild: !0, children: /* @__PURE__ */ d(
|
|
39
|
+
y,
|
|
32
40
|
{
|
|
33
41
|
type: "button",
|
|
34
42
|
"data-style": "ghost",
|
|
35
|
-
"data-active-state":
|
|
43
|
+
"data-active-state": a ? "on" : "off",
|
|
36
44
|
role: "button",
|
|
37
45
|
tabIndex: -1,
|
|
38
|
-
disabled: !
|
|
39
|
-
"data-disabled": !
|
|
46
|
+
disabled: !e,
|
|
47
|
+
"data-disabled": !e,
|
|
40
48
|
"aria-label": "Format text as heading",
|
|
41
|
-
"aria-pressed":
|
|
49
|
+
"aria-pressed": a,
|
|
42
50
|
tooltip: "Heading",
|
|
43
|
-
...
|
|
44
|
-
ref:
|
|
51
|
+
...l,
|
|
52
|
+
ref: u,
|
|
45
53
|
children: [
|
|
46
54
|
/* @__PURE__ */ o(g, { className: "tiptap-button-icon" }),
|
|
47
55
|
/* @__PURE__ */ o(M, { className: "tiptap-button-dropdown-small" })
|
|
48
56
|
]
|
|
49
57
|
}
|
|
50
58
|
) }),
|
|
51
|
-
/* @__PURE__ */ o(
|
|
52
|
-
|
|
59
|
+
/* @__PURE__ */ o(O, { align: "start", portal: m, children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(B, { children: n.map((t) => /* @__PURE__ */ o(j, { asChild: !0, children: /* @__PURE__ */ o(
|
|
60
|
+
H,
|
|
53
61
|
{
|
|
54
|
-
editor:
|
|
62
|
+
editor: r,
|
|
55
63
|
level: t,
|
|
56
64
|
text: `Heading ${t}`,
|
|
57
65
|
showTooltip: !1
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { useState as f, useEffect as g } from "react";
|
|
2
2
|
import { useTiptapEditor as p } from "../../../hooks/use-tiptap-editor.js";
|
|
3
3
|
import { HeadingIcon as v } from "../../tiptap-icons/heading-icon.js";
|
|
4
|
+
import "../heading-button/heading-button.js";
|
|
4
5
|
import { isHeadingActive as a, canToggle as m, headingIcons as h, shouldShowButton as b } from "../heading-button/use-heading.js";
|
|
5
|
-
function H(
|
|
6
|
-
if (!(!
|
|
7
|
-
return
|
|
6
|
+
function H(i, n = [1, 2, 3, 4, 5, 6]) {
|
|
7
|
+
if (!(!i || !i.isEditable))
|
|
8
|
+
return n.find((t) => a(i, t));
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function A(i) {
|
|
10
11
|
const {
|
|
11
|
-
editor:
|
|
12
|
+
editor: n,
|
|
12
13
|
levels: t = [1, 2, 3, 4, 5, 6],
|
|
13
|
-
hideWhenUnavailable:
|
|
14
|
-
} =
|
|
14
|
+
hideWhenUnavailable: s = !1
|
|
15
|
+
} = i || {}, { editor: e } = p(n), [c, l] = f(!0), o = H(e, t), d = a(e), u = m(e);
|
|
15
16
|
return g(() => {
|
|
16
17
|
if (!e) return;
|
|
17
|
-
const
|
|
18
|
+
const r = () => {
|
|
18
19
|
l(
|
|
19
|
-
b({ editor: e, hideWhenUnavailable:
|
|
20
|
+
b({ editor: e, hideWhenUnavailable: s, level: t })
|
|
20
21
|
);
|
|
21
22
|
};
|
|
22
|
-
return
|
|
23
|
-
e.off("selectionUpdate",
|
|
23
|
+
return r(), e.on("selectionUpdate", r), () => {
|
|
24
|
+
e.off("selectionUpdate", r);
|
|
24
25
|
};
|
|
25
|
-
}, [e,
|
|
26
|
+
}, [e, s, t]), {
|
|
26
27
|
isVisible: c,
|
|
27
28
|
activeLevel: o,
|
|
28
29
|
isActive: d,
|
|
@@ -34,5 +35,5 @@ function U(n) {
|
|
|
34
35
|
}
|
|
35
36
|
export {
|
|
36
37
|
H as getActiveHeadingLevel,
|
|
37
|
-
|
|
38
|
+
A as useHeadingDropdownMenu
|
|
38
39
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useState as b, useEffect as I, useCallback as g } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { f as U } from "../../../index-Bqw9S4qP.js";
|
|
3
3
|
import "@tiptap/react";
|
|
4
4
|
import { useTiptapEditor as h } from "../../../hooks/use-tiptap-editor.js";
|
|
5
5
|
import { useIsMobile as E } from "../../../hooks/use-mobile.js";
|
|
6
6
|
import { isExtensionAvailable as c } from "../../../lib/tiptap-utils.js";
|
|
7
7
|
import { ImagePlusIcon as v } from "../../tiptap-icons/image-plus-icon.js";
|
|
8
|
-
const
|
|
8
|
+
const u = "mod+shift+i";
|
|
9
9
|
function a(e) {
|
|
10
10
|
return !e || !e.isEditable || !c(e, "imageUpload") ? !1 : e.can().insertContent({ type: "imageUpload" });
|
|
11
11
|
}
|
|
12
12
|
function A(e) {
|
|
13
13
|
return !e || !e.isEditable ? !1 : e.isActive("imageUpload");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function C(e) {
|
|
16
16
|
if (!e || !e.isEditable || !a(e)) return !1;
|
|
17
17
|
try {
|
|
18
18
|
return e.chain().focus().insertContent({
|
|
@@ -22,11 +22,11 @@ function y(e) {
|
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function y(e) {
|
|
26
26
|
const { editor: i, hideWhenUnavailable: s } = e;
|
|
27
27
|
return !i || !i.isEditable || !c(i, "imageUpload") ? !1 : s && !i.isActive("code") ? a(i) : !0;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function K(e) {
|
|
30
30
|
const {
|
|
31
31
|
editor: i,
|
|
32
32
|
hideWhenUnavailable: s = !1,
|
|
@@ -35,21 +35,21 @@ function D(e) {
|
|
|
35
35
|
I(() => {
|
|
36
36
|
if (!t) return;
|
|
37
37
|
const n = () => {
|
|
38
|
-
d(
|
|
38
|
+
d(y({ editor: t, hideWhenUnavailable: s }));
|
|
39
39
|
};
|
|
40
40
|
return n(), t.on("selectionUpdate", n), () => {
|
|
41
41
|
t.off("selectionUpdate", n);
|
|
42
42
|
};
|
|
43
43
|
}, [t, s]);
|
|
44
|
-
const
|
|
44
|
+
const f = g(() => {
|
|
45
45
|
if (!t) return !1;
|
|
46
|
-
const n =
|
|
46
|
+
const n = C(t);
|
|
47
47
|
return n && r?.(), n;
|
|
48
48
|
}, [t, r]);
|
|
49
49
|
return U(
|
|
50
|
-
|
|
50
|
+
u,
|
|
51
51
|
(n) => {
|
|
52
|
-
n.preventDefault(),
|
|
52
|
+
n.preventDefault(), f();
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
enabled: o && l,
|
|
@@ -59,18 +59,18 @@ function D(e) {
|
|
|
59
59
|
), {
|
|
60
60
|
isVisible: o,
|
|
61
61
|
isActive: p,
|
|
62
|
-
handleImage:
|
|
62
|
+
handleImage: f,
|
|
63
63
|
canInsert: l,
|
|
64
64
|
label: "Add image",
|
|
65
|
-
shortcutKeys:
|
|
65
|
+
shortcutKeys: u,
|
|
66
66
|
Icon: v
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
u as IMAGE_UPLOAD_SHORTCUT_KEY,
|
|
71
71
|
a as canInsertImage,
|
|
72
|
-
|
|
72
|
+
C as insertImage,
|
|
73
73
|
A as isImageActive,
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
y as shouldShowButton,
|
|
75
|
+
K as useImageUpload
|
|
76
76
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { TableIcon as p } from "../../tiptap-icons/table-icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const h =
|
|
8
|
-
const { editor: t } =
|
|
9
|
-
return
|
|
3
|
+
import { Button as f } from "../../tiptap-ui-primitive/button/button.js";
|
|
4
|
+
import { useTiptapEditor as d } from "../../../hooks/use-tiptap-editor.js";
|
|
5
|
+
import { forwardRef as c, useState as m, useEffect as b } from "react";
|
|
6
|
+
import { getTableNodeAndPos as u } from "../table-actions-toolbar/get-table-node-and-pos.js";
|
|
7
|
+
const h = c(({ ...e }, r) => {
|
|
8
|
+
const { editor: t } = d(), [a, o] = m(!1);
|
|
9
|
+
return b(() => {
|
|
10
10
|
if (!t) return;
|
|
11
11
|
const s = () => {
|
|
12
|
-
const i = t.isActive("table"), l =
|
|
12
|
+
const i = t.isActive("table"), l = u(t);
|
|
13
13
|
o(!!(i && l));
|
|
14
14
|
};
|
|
15
15
|
return t.on("selectionUpdate", s), () => {
|
|
16
16
|
t.off("selectionUpdate", s);
|
|
17
17
|
};
|
|
18
18
|
}, [t]), /* @__PURE__ */ n(
|
|
19
|
-
|
|
19
|
+
f,
|
|
20
20
|
{
|
|
21
21
|
type: "button",
|
|
22
22
|
"data-style": "ghost",
|
|
@@ -7,11 +7,11 @@ import { ExternalLinkIcon as F } from "../../tiptap-icons/external-link-icon.js"
|
|
|
7
7
|
import { LinkIcon as U } from "../../tiptap-icons/link-icon.js";
|
|
8
8
|
import { TrashIcon as V } from "../../tiptap-icons/trash-icon.js";
|
|
9
9
|
import { useLinkPopover as g } from "./use-link-popover.js";
|
|
10
|
-
import { InputGroup as q, Input as H } from "../../tiptap-ui-primitive/input/input.js";
|
|
11
10
|
import { Button as u, ButtonGroup as C } from "../../tiptap-ui-primitive/button/button.js";
|
|
12
|
-
import { Popover as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { Popover as q, PopoverTrigger as H, PopoverContent as J } from "../../tiptap-ui-primitive/popover/popover.js";
|
|
12
|
+
import { Separator as Q } from "../../tiptap-ui-primitive/separator/separator.js";
|
|
13
|
+
import { Card as W, CardBody as X, CardItemGroup as Y } from "../../tiptap-ui-primitive/card/card.js";
|
|
14
|
+
import { InputGroup as Z, Input as _ } from "../../tiptap-ui-primitive/input/input.js";
|
|
15
15
|
const v = L(
|
|
16
16
|
({ className: o, children: e, ...n }, r) => /* @__PURE__ */ t(
|
|
17
17
|
u,
|
|
@@ -42,20 +42,20 @@ const I = ({
|
|
|
42
42
|
a.key === "Enter" && (a.preventDefault(), n());
|
|
43
43
|
};
|
|
44
44
|
return /* @__PURE__ */ t(
|
|
45
|
-
|
|
45
|
+
W,
|
|
46
46
|
{
|
|
47
47
|
style: {
|
|
48
48
|
...d ? { boxShadow: "none", border: 0 } : {}
|
|
49
49
|
},
|
|
50
50
|
children: /* @__PURE__ */ t(
|
|
51
|
-
|
|
51
|
+
X,
|
|
52
52
|
{
|
|
53
53
|
style: {
|
|
54
54
|
...d ? { padding: 0 } : {}
|
|
55
55
|
},
|
|
56
|
-
children: /* @__PURE__ */ b(
|
|
57
|
-
/* @__PURE__ */ t(
|
|
58
|
-
|
|
56
|
+
children: /* @__PURE__ */ b(Y, { orientation: "horizontal", children: [
|
|
57
|
+
/* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(
|
|
58
|
+
_,
|
|
59
59
|
{
|
|
60
60
|
type: "url",
|
|
61
61
|
placeholder: "Paste a link...",
|
|
@@ -79,7 +79,7 @@ const I = ({
|
|
|
79
79
|
children: /* @__PURE__ */ t(R, { className: "tiptap-button-icon" })
|
|
80
80
|
}
|
|
81
81
|
) }),
|
|
82
|
-
/* @__PURE__ */ t(
|
|
82
|
+
/* @__PURE__ */ t(Q, {}),
|
|
83
83
|
/* @__PURE__ */ b(C, { orientation: "horizontal", children: [
|
|
84
84
|
/* @__PURE__ */ t(
|
|
85
85
|
u,
|
|
@@ -155,8 +155,8 @@ const I = ({
|
|
|
155
155
|
);
|
|
156
156
|
return j(() => {
|
|
157
157
|
p && l && c(!0);
|
|
158
|
-
}, [p, l]), w ? /* @__PURE__ */ b(
|
|
159
|
-
/* @__PURE__ */ t(
|
|
158
|
+
}, [p, l]), w ? /* @__PURE__ */ b(q, { open: f, onOpenChange: E, children: [
|
|
159
|
+
/* @__PURE__ */ t(H, { asChild: !0, children: /* @__PURE__ */ t(
|
|
160
160
|
v,
|
|
161
161
|
{
|
|
162
162
|
disabled: !k,
|
|
@@ -170,7 +170,7 @@ const I = ({
|
|
|
170
170
|
children: d ?? /* @__PURE__ */ t(D, { className: "tiptap-button-icon" })
|
|
171
171
|
}
|
|
172
172
|
) }),
|
|
173
|
-
/* @__PURE__ */ t(
|
|
173
|
+
/* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(
|
|
174
174
|
I,
|
|
175
175
|
{
|
|
176
176
|
url: N,
|
|
@@ -2,14 +2,14 @@ import { jsx as t, jsxs as S, Fragment as x } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as y, useCallback as C } from "react";
|
|
3
3
|
import { parseShortcutKeys as I } from "../../../lib/tiptap-utils.js";
|
|
4
4
|
import { useTiptapEditor as K } from "../../../hooks/use-tiptap-editor.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Button as N } from "../../tiptap-ui-primitive/button/button.js";
|
|
6
|
+
import { Badge as j } from "../../tiptap-ui-primitive/badge/badge.js";
|
|
7
|
+
import { useList as k, LIST_SHORTCUT_KEYS as v } from "./use-list.js";
|
|
8
8
|
function E({
|
|
9
9
|
type: o,
|
|
10
|
-
shortcutKeys: e =
|
|
10
|
+
shortcutKeys: e = v[o]
|
|
11
11
|
}) {
|
|
12
|
-
return /* @__PURE__ */ t(
|
|
12
|
+
return /* @__PURE__ */ t(j, { children: I({ shortcutKeys: e }) });
|
|
13
13
|
}
|
|
14
14
|
const R = y(
|
|
15
15
|
({
|
|
@@ -31,7 +31,7 @@ const R = y(
|
|
|
31
31
|
label: l,
|
|
32
32
|
shortcutKeys: T,
|
|
33
33
|
Icon: B
|
|
34
|
-
} =
|
|
34
|
+
} = k({
|
|
35
35
|
editor: h,
|
|
36
36
|
type: e,
|
|
37
37
|
hideWhenUnavailable: c,
|
|
@@ -43,7 +43,7 @@ const R = y(
|
|
|
43
43
|
[n, a]
|
|
44
44
|
);
|
|
45
45
|
return g ? /* @__PURE__ */ t(
|
|
46
|
-
|
|
46
|
+
N,
|
|
47
47
|
{
|
|
48
48
|
type: "button",
|
|
49
49
|
"data-style": "ghost",
|