@pie-lib/editable-html-tip-tap 2.1.2-next.3 → 2.1.2-next.31
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/components/CharacterPicker.d.ts +31 -0
- package/dist/components/CharacterPicker.js +131 -0
- package/dist/components/EditableHtml.d.ts +11 -0
- package/dist/components/EditableHtml.js +291 -0
- package/dist/components/MenuBar.d.ts +11 -0
- package/dist/components/MenuBar.js +462 -0
- package/dist/components/TiptapContainer.d.ts +11 -0
- package/dist/components/TiptapContainer.js +154 -0
- package/dist/components/characters/characterUtils.d.ts +35 -0
- package/dist/components/characters/characterUtils.js +465 -0
- package/dist/components/characters/custom-popper.d.ts +14 -0
- package/dist/components/characters/custom-popper.js +32 -0
- package/dist/components/common/done-button.d.ts +30 -0
- package/dist/components/common/done-button.js +26 -0
- package/dist/components/common/toolbar-buttons.d.ts +38 -0
- package/dist/components/common/toolbar-buttons.js +91 -0
- package/dist/components/icons/CssIcon.d.ts +11 -0
- package/dist/components/icons/CssIcon.js +14 -0
- package/dist/components/icons/RespArea.d.ts +26 -0
- package/dist/components/icons/RespArea.js +42 -0
- package/dist/components/icons/TableIcons.d.ts +14 -0
- package/dist/components/icons/TableIcons.js +32 -0
- package/dist/components/icons/TextAlign.d.ts +18 -0
- package/dist/components/icons/TextAlign.js +134 -0
- package/dist/components/image/AltDialog.d.ts +22 -0
- package/dist/components/image/AltDialog.js +61 -0
- package/dist/components/image/ImageToolbar.d.ts +24 -0
- package/dist/components/image/ImageToolbar.js +80 -0
- package/dist/components/image/InsertImageHandler.d.ts +32 -0
- package/dist/components/image/InsertImageHandler.js +53 -0
- package/dist/components/media/MediaDialog.d.ts +43 -0
- package/dist/components/media/MediaDialog.js +389 -0
- package/dist/components/media/MediaToolbar.d.ts +19 -0
- package/dist/components/media/MediaToolbar.js +41 -0
- package/dist/components/media/MediaWrapper.d.ts +19 -0
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +23 -0
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +58 -0
- package/dist/components/respArea/DragInTheBlank/choice.d.ts +56 -0
- package/dist/components/respArea/DragInTheBlank/choice.js +156 -0
- package/dist/components/respArea/ExplicitConstructedResponse.d.ts +20 -0
- package/dist/components/respArea/ExplicitConstructedResponse.js +83 -0
- package/dist/components/respArea/InlineDropdown.d.ts +18 -0
- package/dist/components/respArea/InlineDropdown.js +119 -0
- package/dist/components/respArea/MathTemplated.d.ts +19 -0
- package/dist/components/respArea/MathTemplated.js +97 -0
- package/dist/components/respArea/ToolbarIcon.d.ts +14 -0
- package/dist/components/respArea/ToolbarIcon.js +17 -0
- package/dist/components/respArea/inlineDropdownUtils.d.ts +15 -0
- package/dist/components/respArea/inlineDropdownUtils.js +15 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.js +4 -0
- package/dist/extensions/css.d.ts +11 -0
- package/dist/extensions/css.js +115 -0
- package/dist/extensions/custom-toolbar-wrapper.d.ts +11 -0
- package/dist/extensions/custom-toolbar-wrapper.js +61 -0
- package/dist/extensions/div-node.d.ts +10 -0
- package/dist/extensions/div-node.js +42 -0
- package/dist/extensions/ensure-empty-root-div.d.ts +14 -0
- package/dist/extensions/ensure-empty-root-div.js +24 -0
- package/dist/extensions/ensure-list-item-content-is-div.d.ts +15 -0
- package/dist/extensions/ensure-list-item-content-is-div.js +31 -0
- package/dist/extensions/extended-list-item.d.ts +13 -0
- package/dist/extensions/extended-list-item.js +5 -0
- package/dist/extensions/extended-table-cell.d.ts +10 -0
- package/dist/extensions/extended-table-cell.js +6 -0
- package/dist/extensions/extended-table.d.ts +17 -0
- package/dist/extensions/extended-table.js +34 -0
- package/dist/extensions/heading-paragraph.d.ts +17 -0
- package/dist/extensions/heading-paragraph.js +30 -0
- package/dist/extensions/image-component.d.ts +22 -0
- package/dist/extensions/image-component.js +220 -0
- package/dist/extensions/image.d.ts +10 -0
- package/dist/extensions/image.js +68 -0
- package/dist/extensions/index.d.ts +16 -0
- package/dist/extensions/index.js +64 -0
- package/dist/extensions/math.d.ts +15 -0
- package/dist/extensions/math.js +158 -0
- package/dist/extensions/media.d.ts +19 -0
- package/dist/extensions/media.js +149 -0
- package/dist/extensions/responseArea.d.ts +27 -0
- package/dist/extensions/responseArea.js +259 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +7 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/styles/editorContainerStyles.d.ts +134 -0
- package/dist/theme.d.ts +9 -0
- package/dist/utils/helper.d.ts +9 -0
- package/dist/utils/helper.js +27 -0
- package/dist/utils/size.d.ts +9 -0
- package/dist/utils/size.js +14 -0
- package/package.json +56 -40
- package/CHANGELOG.json +0 -32
- package/CHANGELOG.md +0 -2532
- package/LICENSE.md +0 -5
- package/lib/components/CharacterPicker.js +0 -195
- package/lib/components/CharacterPicker.js.map +0 -1
- package/lib/components/EditableHtml.js +0 -375
- package/lib/components/EditableHtml.js.map +0 -1
- package/lib/components/MenuBar.js +0 -693
- package/lib/components/MenuBar.js.map +0 -1
- package/lib/components/TiptapContainer.js +0 -234
- package/lib/components/TiptapContainer.js.map +0 -1
- package/lib/components/characters/characterUtils.js +0 -378
- package/lib/components/characters/characterUtils.js.map +0 -1
- package/lib/components/characters/custom-popper.js +0 -44
- package/lib/components/characters/custom-popper.js.map +0 -1
- package/lib/components/common/done-button.js +0 -34
- package/lib/components/common/done-button.js.map +0 -1
- package/lib/components/common/toolbar-buttons.js +0 -144
- package/lib/components/common/toolbar-buttons.js.map +0 -1
- package/lib/components/icons/CssIcon.js +0 -25
- package/lib/components/icons/CssIcon.js.map +0 -1
- package/lib/components/icons/RespArea.js +0 -72
- package/lib/components/icons/RespArea.js.map +0 -1
- package/lib/components/icons/TableIcons.js +0 -53
- package/lib/components/icons/TableIcons.js.map +0 -1
- package/lib/components/icons/TextAlign.js +0 -157
- package/lib/components/icons/TextAlign.js.map +0 -1
- package/lib/components/image/AltDialog.js +0 -98
- package/lib/components/image/AltDialog.js.map +0 -1
- package/lib/components/image/ImageToolbar.js +0 -137
- package/lib/components/image/ImageToolbar.js.map +0 -1
- package/lib/components/image/InsertImageHandler.js +0 -135
- package/lib/components/image/InsertImageHandler.js.map +0 -1
- package/lib/components/media/MediaDialog.js +0 -594
- package/lib/components/media/MediaDialog.js.map +0 -1
- package/lib/components/media/MediaToolbar.js +0 -74
- package/lib/components/media/MediaToolbar.js.map +0 -1
- package/lib/components/media/MediaWrapper.js +0 -67
- package/lib/components/media/MediaWrapper.js.map +0 -1
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -84
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +0 -1
- package/lib/components/respArea/DragInTheBlank/choice.js +0 -250
- package/lib/components/respArea/DragInTheBlank/choice.js.map +0 -1
- package/lib/components/respArea/ExplicitConstructedResponse.js +0 -136
- package/lib/components/respArea/ExplicitConstructedResponse.js.map +0 -1
- package/lib/components/respArea/InlineDropdown.js +0 -165
- package/lib/components/respArea/InlineDropdown.js.map +0 -1
- package/lib/components/respArea/MathTemplated.js +0 -130
- package/lib/components/respArea/MathTemplated.js.map +0 -1
- package/lib/components/respArea/ToolbarIcon.js +0 -81
- package/lib/components/respArea/ToolbarIcon.js.map +0 -1
- package/lib/constants.js +0 -11
- package/lib/constants.js.map +0 -1
- package/lib/extensions/css.js +0 -217
- package/lib/extensions/css.js.map +0 -1
- package/lib/extensions/custom-toolbar-wrapper.js +0 -92
- package/lib/extensions/custom-toolbar-wrapper.js.map +0 -1
- package/lib/extensions/div-node.js +0 -83
- package/lib/extensions/div-node.js.map +0 -1
- package/lib/extensions/ensure-empty-root-div.js +0 -48
- package/lib/extensions/ensure-empty-root-div.js.map +0 -1
- package/lib/extensions/ensure-list-item-content-is-div.js +0 -64
- package/lib/extensions/ensure-list-item-content-is-div.js.map +0 -1
- package/lib/extensions/extended-list-item.js +0 -15
- package/lib/extensions/extended-list-item.js.map +0 -1
- package/lib/extensions/extended-table-cell.js +0 -22
- package/lib/extensions/extended-table-cell.js.map +0 -1
- package/lib/extensions/extended-table.js +0 -75
- package/lib/extensions/extended-table.js.map +0 -1
- package/lib/extensions/heading-paragraph.js +0 -61
- package/lib/extensions/heading-paragraph.js.map +0 -1
- package/lib/extensions/image-component.js +0 -348
- package/lib/extensions/image-component.js.map +0 -1
- package/lib/extensions/image.js +0 -134
- package/lib/extensions/image.js.map +0 -1
- package/lib/extensions/index.js +0 -46
- package/lib/extensions/index.js.map +0 -1
- package/lib/extensions/math.js +0 -343
- package/lib/extensions/math.js.map +0 -1
- package/lib/extensions/media.js +0 -243
- package/lib/extensions/media.js.map +0 -1
- package/lib/extensions/responseArea.js +0 -446
- package/lib/extensions/responseArea.js.map +0 -1
- package/lib/index.js +0 -30
- package/lib/index.js.map +0 -1
- package/lib/styles/editorContainerStyles.js +0 -137
- package/lib/styles/editorContainerStyles.js.map +0 -1
- package/lib/theme.js +0 -8
- package/lib/theme.js.map +0 -1
- package/lib/utils/helper.js +0 -73
- package/lib/utils/helper.js.map +0 -1
- package/lib/utils/size.js +0 -26
- package/lib/utils/size.js.map +0 -1
- package/src/__tests__/EditableHtml.test.jsx +0 -474
- package/src/__tests__/constants.test.js +0 -19
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
- package/src/__tests__/extensions.test.js +0 -208
- package/src/__tests__/index.test.jsx +0 -154
- package/src/__tests__/size-utils.test.js +0 -64
- package/src/__tests__/theme.test.js +0 -17
- package/src/components/CharacterPicker.jsx +0 -200
- package/src/components/EditableHtml.jsx +0 -438
- package/src/components/MenuBar.jsx +0 -549
- package/src/components/TiptapContainer.jsx +0 -219
- package/src/components/__tests__/AltDialog.test.jsx +0 -147
- package/src/components/__tests__/CharacterPicker.test.jsx +0 -219
- package/src/components/__tests__/CssIcon.test.jsx +0 -46
- package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -204
- package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
- package/src/components/__tests__/InlineDropdown.test.jsx +0 -380
- package/src/components/__tests__/InsertImageHandler.test.js +0 -161
- package/src/components/__tests__/MediaDialog.test.jsx +0 -293
- package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
- package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
- package/src/components/__tests__/MenuBar.test.jsx +0 -249
- package/src/components/__tests__/RespArea.test.jsx +0 -122
- package/src/components/__tests__/TableIcons.test.jsx +0 -149
- package/src/components/__tests__/TextAlign.test.jsx +0 -167
- package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
- package/src/components/__tests__/characterUtils.test.js +0 -166
- package/src/components/__tests__/choice.test.jsx +0 -171
- package/src/components/__tests__/custom-popper.test.jsx +0 -82
- package/src/components/__tests__/done-button.test.jsx +0 -54
- package/src/components/__tests__/toolbar-buttons.test.jsx +0 -234
- package/src/components/characters/characterUtils.js +0 -447
- package/src/components/characters/custom-popper.js +0 -38
- package/src/components/common/done-button.jsx +0 -27
- package/src/components/common/toolbar-buttons.jsx +0 -122
- package/src/components/icons/CssIcon.jsx +0 -15
- package/src/components/icons/RespArea.jsx +0 -71
- package/src/components/icons/TableIcons.jsx +0 -52
- package/src/components/icons/TextAlign.jsx +0 -114
- package/src/components/image/AltDialog.jsx +0 -82
- package/src/components/image/ImageToolbar.jsx +0 -99
- package/src/components/image/InsertImageHandler.js +0 -107
- package/src/components/media/MediaDialog.jsx +0 -596
- package/src/components/media/MediaToolbar.jsx +0 -49
- package/src/components/media/MediaWrapper.jsx +0 -39
- package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +0 -76
- package/src/components/respArea/DragInTheBlank/choice.jsx +0 -256
- package/src/components/respArea/ExplicitConstructedResponse.jsx +0 -135
- package/src/components/respArea/InlineDropdown.jsx +0 -167
- package/src/components/respArea/MathTemplated.jsx +0 -124
- package/src/components/respArea/ToolbarIcon.jsx +0 -66
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
- package/src/constants.js +0 -5
- package/src/extensions/__tests__/css.test.js +0 -196
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
- package/src/extensions/__tests__/divNode.test.js +0 -87
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
- package/src/extensions/__tests__/extended-list-item.test.js +0 -13
- package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
- package/src/extensions/__tests__/extended-table.test.js +0 -183
- package/src/extensions/__tests__/image-component.test.jsx +0 -345
- package/src/extensions/__tests__/image.test.js +0 -237
- package/src/extensions/__tests__/math.test.js +0 -459
- package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
- package/src/extensions/__tests__/media.test.js +0 -271
- package/src/extensions/__tests__/responseArea.test.js +0 -601
- package/src/extensions/css.js +0 -220
- package/src/extensions/custom-toolbar-wrapper.jsx +0 -78
- package/src/extensions/div-node.js +0 -86
- package/src/extensions/ensure-empty-root-div.js +0 -47
- package/src/extensions/ensure-list-item-content-is-div.js +0 -62
- package/src/extensions/extended-list-item.js +0 -10
- package/src/extensions/extended-table-cell.js +0 -19
- package/src/extensions/extended-table.js +0 -60
- package/src/extensions/heading-paragraph.js +0 -53
- package/src/extensions/image-component.jsx +0 -338
- package/src/extensions/image.js +0 -109
- package/src/extensions/index.js +0 -81
- package/src/extensions/math.js +0 -327
- package/src/extensions/media.js +0 -188
- package/src/extensions/responseArea.js +0 -401
- package/src/index.jsx +0 -5
- package/src/styles/editorContainerStyles.js +0 -145
- package/src/theme.js +0 -1
- package/src/utils/__tests__/helper.test.js +0 -126
- package/src/utils/helper.js +0 -69
- package/src/utils/size.js +0 -32
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import e from "./custom-toolbar-wrapper.js";
|
|
2
|
+
import t from "../components/image/InsertImageHandler.js";
|
|
3
|
+
import n from "../components/image/ImageToolbar.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { isEqual as c } from "@pie-element/shared-lodash";
|
|
6
|
+
import { NodeViewWrapper as l } from "@tiptap/react";
|
|
7
|
+
import { styled as u } from "@mui/material/styles";
|
|
8
|
+
import d from "react-dom";
|
|
9
|
+
import f from "prop-types";
|
|
10
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
import h from "debug";
|
|
12
|
+
import g from "@mui/material/LinearProgress";
|
|
13
|
+
//#region src/extensions/image-component.tsx
|
|
14
|
+
h("@pie-lib:editable-html:plugins:image:component");
|
|
15
|
+
var _ = u(g, { shouldForwardProp: (e) => e !== "hideProgress" })(({ hideProgress: e }) => ({
|
|
16
|
+
position: "absolute",
|
|
17
|
+
left: "0",
|
|
18
|
+
width: "fit-content",
|
|
19
|
+
top: "0%",
|
|
20
|
+
transition: "opacity 200ms linear",
|
|
21
|
+
...e && { opacity: 0 }
|
|
22
|
+
})), v = u("div", { shouldForwardProp: (e) => ![
|
|
23
|
+
"active",
|
|
24
|
+
"loading",
|
|
25
|
+
"pendingDelete"
|
|
26
|
+
].includes(e) })(({ loading: e, pendingDelete: t }) => ({
|
|
27
|
+
position: "relative",
|
|
28
|
+
display: "flex",
|
|
29
|
+
transition: "opacity 200ms linear",
|
|
30
|
+
...e && { opacity: .3 },
|
|
31
|
+
...t && { opacity: .3 }
|
|
32
|
+
})), y = u("div")(({ theme: e }) => ({
|
|
33
|
+
position: "relative",
|
|
34
|
+
width: "fit-content",
|
|
35
|
+
display: "flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
"&&:hover > .resize": { display: "block" }
|
|
38
|
+
})), b = u("img", { shouldForwardProp: (e) => e !== "active" })(({ theme: e, active: t }) => ({ border: t ? `solid 1px ${e.palette.primary.main}` : "solid 1px transparent" })), x = u("div")(({ theme: e }) => ({
|
|
39
|
+
backgroundColor: e.palette.primary.main,
|
|
40
|
+
cursor: "col-resize",
|
|
41
|
+
height: "35px",
|
|
42
|
+
width: "5px",
|
|
43
|
+
borderRadius: 8,
|
|
44
|
+
marginLeft: "5px",
|
|
45
|
+
marginRight: "10px",
|
|
46
|
+
display: "none"
|
|
47
|
+
})), S = (e) => e ? `${e}px` : "calc(20px)";
|
|
48
|
+
function C(u) {
|
|
49
|
+
let { node: f, editor: h, attributes: g, onFocus: C, getPos: w, selected: T, options: E, maxImageWidth: D = 700, maxImageHeight: O = 900 } = u, { alt: k } = f.attrs, A = w(), j = h.state.selection.from, M = h.state.selection.to, N = a(() => j + f.nodeSize === M, [
|
|
50
|
+
j,
|
|
51
|
+
M,
|
|
52
|
+
f.nodeSize
|
|
53
|
+
]), [P, F] = s(!1), I = o(f), L = o(null), R = o(null), z = o(null), B = r((e) => {
|
|
54
|
+
let t = e / L.current.naturalWidth * 4;
|
|
55
|
+
return parseInt(t.toFixed(0) * 25, 10);
|
|
56
|
+
}, []), V = r(() => {
|
|
57
|
+
let e = I.current.attrs.nodeKey, t = null;
|
|
58
|
+
return h.state.doc.descendants((n, r) => {
|
|
59
|
+
if (t !== null) return !1;
|
|
60
|
+
if (n.type.name === "imageUploadNode" && n.attrs.nodeKey === e) return t = r, !1;
|
|
61
|
+
}), t;
|
|
62
|
+
}, [h]), H = r((e) => {
|
|
63
|
+
let t = V();
|
|
64
|
+
if (t === null) return;
|
|
65
|
+
let n = h.state.doc.nodeAt(t);
|
|
66
|
+
n && h.view.dispatch(h.state.tr.setNodeMarkup(t, void 0, {
|
|
67
|
+
...n.attrs,
|
|
68
|
+
...e
|
|
69
|
+
}));
|
|
70
|
+
}, [h, V]), U = r(() => {
|
|
71
|
+
if (!f.attrs.width || !L.current) return;
|
|
72
|
+
let e = B(f.attrs.width);
|
|
73
|
+
f.attrs.resizePercent !== e && H({ resizePercent: e });
|
|
74
|
+
}, [
|
|
75
|
+
f.attrs.width,
|
|
76
|
+
f.attrs.resizePercent,
|
|
77
|
+
B,
|
|
78
|
+
H
|
|
79
|
+
]);
|
|
80
|
+
i(() => {
|
|
81
|
+
I.current = {
|
|
82
|
+
...f,
|
|
83
|
+
pos: A
|
|
84
|
+
};
|
|
85
|
+
}, [f, A]), i(() => {
|
|
86
|
+
T ? N && (!String(f.attrs?.src ?? "").trim() && E.imageHandling?.insertImageRequested && E.imageHandling.insertImageRequested(h, [f, A], (e) => new t(h, [f, A], e)), F(T)) : F(T);
|
|
87
|
+
}, [N, T]), i(() => {
|
|
88
|
+
U();
|
|
89
|
+
let e = R.current;
|
|
90
|
+
return e && e.addEventListener("mousedown", Y, !1), () => {
|
|
91
|
+
e && e.removeEventListener("mousedown", Y, !1);
|
|
92
|
+
};
|
|
93
|
+
}, []), i(() => {
|
|
94
|
+
U();
|
|
95
|
+
});
|
|
96
|
+
let W = r(() => {
|
|
97
|
+
let e = L.current;
|
|
98
|
+
if (e && (!e.style.width || e.style.width === "calc(20px)")) {
|
|
99
|
+
let t = Math.min(e.naturalWidth, D), n = Math.min(e.naturalHeight, O);
|
|
100
|
+
e.style.width = `${t}px`, e.style.height = `${n}px`;
|
|
101
|
+
let r = {
|
|
102
|
+
width: t,
|
|
103
|
+
height: n
|
|
104
|
+
};
|
|
105
|
+
c(r, {
|
|
106
|
+
width: f.attrs.width,
|
|
107
|
+
height: f.attrs.height
|
|
108
|
+
}) || H(r);
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
f.attrs.width,
|
|
112
|
+
f.attrs.height,
|
|
113
|
+
D,
|
|
114
|
+
O,
|
|
115
|
+
H
|
|
116
|
+
]), G = (e, t, n = !0, r) => {
|
|
117
|
+
if (n) {
|
|
118
|
+
let n = e.width / e.height;
|
|
119
|
+
return r === "height" ? {
|
|
120
|
+
width: t.height * n,
|
|
121
|
+
height: t.height
|
|
122
|
+
} : {
|
|
123
|
+
width: t.width,
|
|
124
|
+
height: t.width / n
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return t;
|
|
128
|
+
}, K = r((e) => {
|
|
129
|
+
let t = L.current;
|
|
130
|
+
if (!t) return;
|
|
131
|
+
let n = e.target.getBoundingClientRect(), r = G({
|
|
132
|
+
width: t.naturalWidth,
|
|
133
|
+
height: t.naturalHeight
|
|
134
|
+
}, {
|
|
135
|
+
width: e.clientX - n.left,
|
|
136
|
+
height: e.clientY - n.top
|
|
137
|
+
});
|
|
138
|
+
r.width > 50 && r.height > 50 && r.width <= 700 && r.height <= 900 && (t.style.width = `${r.width}px`, t.style.height = `${r.height}px`, H({
|
|
139
|
+
width: r.width,
|
|
140
|
+
height: r.height
|
|
141
|
+
}));
|
|
142
|
+
}, [h, H]), q = r((e) => {
|
|
143
|
+
H(e);
|
|
144
|
+
}, [h, H]), J = r(() => {
|
|
145
|
+
window.removeEventListener("mousemove", K), window.removeEventListener("mouseup", J);
|
|
146
|
+
}, [K]), Y = r(() => {
|
|
147
|
+
window.addEventListener("mousemove", K), window.addEventListener("mouseup", J);
|
|
148
|
+
}, [K, J]), X = {
|
|
149
|
+
width: S(f.attrs.width),
|
|
150
|
+
height: S(f.attrs.height),
|
|
151
|
+
objectFit: "contain"
|
|
152
|
+
}, Z = {
|
|
153
|
+
left: "flex-start",
|
|
154
|
+
center: "center",
|
|
155
|
+
right: "flex-end"
|
|
156
|
+
}[f.attrs.alignment] || "flex-start";
|
|
157
|
+
return /* @__PURE__ */ m(l, { children: [/* @__PURE__ */ m(v, {
|
|
158
|
+
onFocus: C,
|
|
159
|
+
loading: !f.attrs.loaded,
|
|
160
|
+
pendingDelete: f.attrs.deleteStatus === "pending",
|
|
161
|
+
style: { justifyContent: Z },
|
|
162
|
+
children: [/* @__PURE__ */ p(_, {
|
|
163
|
+
mode: "determinate",
|
|
164
|
+
value: f.attrs.percent || 0,
|
|
165
|
+
hideProgress: f.attrs.loaded
|
|
166
|
+
}), /* @__PURE__ */ m(y, {
|
|
167
|
+
onDragStart: (e) => e.preventDefault(),
|
|
168
|
+
children: [/* @__PURE__ */ p(b, {
|
|
169
|
+
...g,
|
|
170
|
+
active: T && f.attrs.loaded,
|
|
171
|
+
draggable: !1,
|
|
172
|
+
ref: L,
|
|
173
|
+
src: f.attrs.src,
|
|
174
|
+
style: X,
|
|
175
|
+
onLoad: W,
|
|
176
|
+
alt: f.attrs.alt
|
|
177
|
+
}), /* @__PURE__ */ p(x, {
|
|
178
|
+
ref: R,
|
|
179
|
+
className: "resize"
|
|
180
|
+
})]
|
|
181
|
+
})]
|
|
182
|
+
}), P && h._tiptapContainerEl && d.createPortal(/* @__PURE__ */ p("div", {
|
|
183
|
+
ref: z,
|
|
184
|
+
style: {
|
|
185
|
+
zIndex: 20,
|
|
186
|
+
background: "var(--editable-html-toolbar-bg, #efefef)",
|
|
187
|
+
boxShadow: "0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)",
|
|
188
|
+
width: "100%"
|
|
189
|
+
},
|
|
190
|
+
children: /* @__PURE__ */ p(e, {
|
|
191
|
+
showDone: !0,
|
|
192
|
+
deletable: !0,
|
|
193
|
+
toolbarOpts: E.toolbarOpts || {},
|
|
194
|
+
onDelete: () => {
|
|
195
|
+
let e = V();
|
|
196
|
+
e !== null && (E.imageHandling?.onDelete?.(I.current), h.view.dispatch(h.state.tr.delete(e, e + h.state.doc.nodeAt(e).nodeSize)), F(!1), h.commands.focus());
|
|
197
|
+
},
|
|
198
|
+
onDone: () => {
|
|
199
|
+
F(!1), E.imageHandling?.onDone?.(h), h.commands.focus("end");
|
|
200
|
+
},
|
|
201
|
+
children: /* @__PURE__ */ p(n, {
|
|
202
|
+
disableImageAlignmentButtons: E.imageHandling?.disableImageAlignmentButtons,
|
|
203
|
+
alt: f.attrs.alt,
|
|
204
|
+
imageLoaded: f.attrs.loaded,
|
|
205
|
+
alignment: f.attrs.alignment || "left",
|
|
206
|
+
onChange: q
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
}), h._tiptapContainerEl)] });
|
|
210
|
+
}
|
|
211
|
+
C.propTypes = {
|
|
212
|
+
node: f.object.isRequired,
|
|
213
|
+
editor: f.object.isRequired,
|
|
214
|
+
attributes: f.object,
|
|
215
|
+
onFocus: f.func,
|
|
216
|
+
maxImageWidth: f.number,
|
|
217
|
+
maxImageHeight: f.number
|
|
218
|
+
};
|
|
219
|
+
//#endregion
|
|
220
|
+
export { C as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/image.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import { Node } from '@tiptap/core';
|
|
10
|
+
export declare const ImageUploadNode: Node<any, any>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import e from "./image-component.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { ReactNodeViewRenderer as t } from "@tiptap/react";
|
|
4
|
+
import { Node as n, mergeAttributes as r } from "@tiptap/core";
|
|
5
|
+
import { Plugin as i } from "@tiptap/pm/state";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/extensions/image.tsx
|
|
8
|
+
var o = n.create({
|
|
9
|
+
name: "imageUploadNode",
|
|
10
|
+
group: "block",
|
|
11
|
+
atom: !0,
|
|
12
|
+
selectable: !0,
|
|
13
|
+
draggable: !0,
|
|
14
|
+
addAttributes() {
|
|
15
|
+
return {
|
|
16
|
+
nodeKey: { default: null },
|
|
17
|
+
loaded: { default: !1 },
|
|
18
|
+
deleteStatus: { default: null },
|
|
19
|
+
alignment: { default: null },
|
|
20
|
+
percent: { default: null },
|
|
21
|
+
width: { default: null },
|
|
22
|
+
height: { default: null },
|
|
23
|
+
src: { default: null },
|
|
24
|
+
alt: { default: null }
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
parseHTML() {
|
|
28
|
+
return [{ tag: "img[data-type=\"image-upload-node\"]" }];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
31
|
+
return ["img", r(e, { "data-type": "image-upload-node" })];
|
|
32
|
+
},
|
|
33
|
+
addNodeView() {
|
|
34
|
+
return t((t) => /* @__PURE__ */ a(e, {
|
|
35
|
+
...t,
|
|
36
|
+
options: this.options
|
|
37
|
+
}));
|
|
38
|
+
},
|
|
39
|
+
addCommands() {
|
|
40
|
+
return { setImageUploadNode: () => ({ commands: e }) => e.insertContent({
|
|
41
|
+
type: this.name,
|
|
42
|
+
attrs: { nodeKey: `img-${Date.now()}-${Math.random().toString(36).slice(2)}` }
|
|
43
|
+
}) };
|
|
44
|
+
},
|
|
45
|
+
addProseMirrorPlugins() {
|
|
46
|
+
let e = this.editor;
|
|
47
|
+
return [new i({ props: { handlePaste(t, n) {
|
|
48
|
+
let r = Array.from(n.clipboardData?.items || []).find((e) => e.kind === "file" && e.type.startsWith("image/"));
|
|
49
|
+
if (!r) return !1;
|
|
50
|
+
let i = r.getAsFile();
|
|
51
|
+
if (!i) return !1;
|
|
52
|
+
let a = new FileReader();
|
|
53
|
+
return a.onload = () => {
|
|
54
|
+
let t = a.result;
|
|
55
|
+
typeof t == "string" && e.commands.insertContent({
|
|
56
|
+
type: "imageUploadNode",
|
|
57
|
+
attrs: {
|
|
58
|
+
src: t,
|
|
59
|
+
loaded: !0,
|
|
60
|
+
nodeKey: `img-${Date.now()}-${Math.random().toString(36).slice(2)}`
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}, a.readAsDataURL(i), !0;
|
|
64
|
+
} } })];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { o as ImageUploadNode };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/index.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ALL_PLUGINS: string[];
|
|
10
|
+
export declare const PLUGINS_MAP: {
|
|
11
|
+
'text-align': string;
|
|
12
|
+
'bulleted-list': string;
|
|
13
|
+
'numbered-list': string;
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_PLUGINS: string[];
|
|
16
|
+
export declare const buildExtensions: (activeExtensions: any, customExtensions: any, opts: any) => any[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { compact as e, isEmpty as t } from "@pie-element/shared-lodash";
|
|
2
|
+
import n from "debug";
|
|
3
|
+
//#region src/extensions/index.tsx
|
|
4
|
+
var r = n("@pie-lib:editable-html:plugins"), i = [
|
|
5
|
+
"bold",
|
|
6
|
+
"html",
|
|
7
|
+
"extraCSSRules",
|
|
8
|
+
"italic",
|
|
9
|
+
"underline",
|
|
10
|
+
"strikethrough",
|
|
11
|
+
"bulleted-list",
|
|
12
|
+
"numbered-list",
|
|
13
|
+
"image",
|
|
14
|
+
"math",
|
|
15
|
+
"languageCharacters",
|
|
16
|
+
"text-align",
|
|
17
|
+
"blockquote",
|
|
18
|
+
"h3",
|
|
19
|
+
"table",
|
|
20
|
+
"video",
|
|
21
|
+
"audio",
|
|
22
|
+
"responseArea",
|
|
23
|
+
"redo",
|
|
24
|
+
"undo",
|
|
25
|
+
"superscript",
|
|
26
|
+
"subscript"
|
|
27
|
+
], a = {
|
|
28
|
+
"text-align": "textAlign",
|
|
29
|
+
"bulleted-list": "ul_list",
|
|
30
|
+
"numbered-list": "ol_list"
|
|
31
|
+
}, o = i.filter((e) => ![
|
|
32
|
+
"responseArea",
|
|
33
|
+
"h3",
|
|
34
|
+
"blockquote"
|
|
35
|
+
].includes(e)), s = (n, i, a) => {
|
|
36
|
+
r("[buildPlugins] opts: ", a), n ||= o;
|
|
37
|
+
let s = (e, t = !0) => n.includes(e) && t && e, c = a.image && a.image.delete, l = a.math, u = a.responseArea && a.responseArea.type, d = !t(a.extraCSSRules), f = a?.languageCharacters || [];
|
|
38
|
+
return e([
|
|
39
|
+
s("table"),
|
|
40
|
+
s("bold"),
|
|
41
|
+
s("italic"),
|
|
42
|
+
s("strikethrough"),
|
|
43
|
+
s("underline"),
|
|
44
|
+
s("superscript"),
|
|
45
|
+
s("subscript"),
|
|
46
|
+
s("image", !!c),
|
|
47
|
+
s("video"),
|
|
48
|
+
s("audio"),
|
|
49
|
+
s("math", !!l),
|
|
50
|
+
...f.map((e) => s("languageCharacters", e)),
|
|
51
|
+
s("text-align"),
|
|
52
|
+
s("blockquote"),
|
|
53
|
+
s("h3"),
|
|
54
|
+
s("bulleted-list"),
|
|
55
|
+
s("numbered-list"),
|
|
56
|
+
s("undo"),
|
|
57
|
+
s("redo"),
|
|
58
|
+
s("responseArea", !!u),
|
|
59
|
+
s("css", !!d),
|
|
60
|
+
s("html", !!a.html)
|
|
61
|
+
]);
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { i as ALL_PLUGINS, o as DEFAULT_PLUGINS, a as PLUGINS_MAP, s as buildExtensions };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/math.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Node } from '@tiptap/core';
|
|
11
|
+
import { Plugin } from 'prosemirror-state';
|
|
12
|
+
export declare const EnsureTextAfterMathPlugin: (mathNodeName: any) => Plugin<any>;
|
|
13
|
+
export declare const ZeroWidthSpaceHandlingPlugin: Plugin<any>;
|
|
14
|
+
export declare const MathNode: Node<any, any>;
|
|
15
|
+
export declare const MathNodeView: (props: any) => React.JSX.Element;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
import { NodeViewWrapper as r, ReactNodeViewRenderer as i } from "@tiptap/react";
|
|
3
|
+
import { Node as a } from "@tiptap/core";
|
|
4
|
+
import { NodeSelection as o, Plugin as s, PluginKey as c, TextSelection as l } from "prosemirror-state";
|
|
5
|
+
import u from "react-dom";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { wrapMath as p } from "@pie-element/shared-math-rendering-mathjax";
|
|
8
|
+
import { MathPreview as m, MathToolbar as h } from "@pie-lib/math-toolbar";
|
|
9
|
+
//#region src/extensions/math.tsx
|
|
10
|
+
var g = new c("ensureTextAfterMath"), _ = (e = []) => e.map((e) => ({
|
|
11
|
+
name: e,
|
|
12
|
+
latex: e,
|
|
13
|
+
write: e,
|
|
14
|
+
label: e
|
|
15
|
+
})), v = (e) => new s({
|
|
16
|
+
key: g,
|
|
17
|
+
appendTransaction: (t, n, r) => {
|
|
18
|
+
if (!t.some((e) => e.docChanged)) return null;
|
|
19
|
+
let i = r.tr, a = !1;
|
|
20
|
+
return r.doc.descendants((t, n) => {
|
|
21
|
+
if (t.type.name === e) {
|
|
22
|
+
let e = n + t.nodeSize, o = r.doc.nodeAt(e);
|
|
23
|
+
(!o || o.type.name !== "text") && (i.insert(e, r.schema.text("")), a = !0);
|
|
24
|
+
}
|
|
25
|
+
}), a ? i : null;
|
|
26
|
+
}
|
|
27
|
+
}), y = new s({
|
|
28
|
+
key: new c("zeroWidthSpaceHandling"),
|
|
29
|
+
props: { handleKeyDown(e, t) {
|
|
30
|
+
let { state: n, dispatch: r } = e, { selection: i, doc: a } = n, { from: s, empty: c } = i;
|
|
31
|
+
if (c && t.key === "Backspace" && s > 0 && a.textBetween(s - 1, s, "", "") === "") return r(n.tr.delete(s - 2, s)), !0;
|
|
32
|
+
if (c && t.key === "ArrowLeft" && s > 0 && a.textBetween(s - 1, s, "", "") === "") {
|
|
33
|
+
let e = s - 1, t = n.doc.resolve(e - 1), i = t.nodeAfter || t.nodeBefore;
|
|
34
|
+
if (i) {
|
|
35
|
+
let t = e - i.nodeSize, a = n.doc.resolve(t);
|
|
36
|
+
return r(n.tr.setSelection(o.create(n.doc, a.pos))), !0;
|
|
37
|
+
} else return r(n.tr.setSelection(l.create(n.doc, s - 2))), !0;
|
|
38
|
+
}
|
|
39
|
+
return !1;
|
|
40
|
+
} }
|
|
41
|
+
}), b = a.create({
|
|
42
|
+
name: "math",
|
|
43
|
+
group: "inline",
|
|
44
|
+
inline: !0,
|
|
45
|
+
atom: !0,
|
|
46
|
+
addAttributes() {
|
|
47
|
+
return {
|
|
48
|
+
latex: { default: "" },
|
|
49
|
+
wrapper: { default: null },
|
|
50
|
+
html: { default: null }
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
addProseMirrorPlugins() {
|
|
54
|
+
return [v(this.name), y];
|
|
55
|
+
},
|
|
56
|
+
parseHTML() {
|
|
57
|
+
return [{
|
|
58
|
+
tag: "span[data-latex]",
|
|
59
|
+
getAttrs: (e) => ({ latex: e.getAttribute("data-raw") || e.textContent })
|
|
60
|
+
}, {
|
|
61
|
+
tag: "span[data-type=\"mathml\"]",
|
|
62
|
+
getAttrs: (e) => ({ html: e.innerHTML })
|
|
63
|
+
}];
|
|
64
|
+
},
|
|
65
|
+
addCommands() {
|
|
66
|
+
return { insertMath: (e = "") => ({ tr: t, editor: n, dispatch: r }) => {
|
|
67
|
+
let { state: i } = n.view, a = i.schema.nodes.math.create({ latex: e }), { selection: s } = i, c = s.$from.pos;
|
|
68
|
+
if (t.insert(c, a), a?.type?.name === this.name) {
|
|
69
|
+
let e = o.create(t.doc, s.$from.pos);
|
|
70
|
+
t.setSelection(e);
|
|
71
|
+
}
|
|
72
|
+
return r(t), !0;
|
|
73
|
+
} };
|
|
74
|
+
},
|
|
75
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
76
|
+
return e.html ? ["span", {
|
|
77
|
+
"data-type": "mathml",
|
|
78
|
+
dangerouslySetInnerHTML: { __html: e.html }
|
|
79
|
+
}] : [
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
"data-latex": "",
|
|
83
|
+
"data-raw": e.latex
|
|
84
|
+
},
|
|
85
|
+
p(e.latex, e.wrapper)
|
|
86
|
+
];
|
|
87
|
+
},
|
|
88
|
+
addNodeView() {
|
|
89
|
+
return i((e) => /* @__PURE__ */ d(x, {
|
|
90
|
+
...e,
|
|
91
|
+
options: this.options
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
}), x = (i) => {
|
|
95
|
+
let { node: a, updateAttributes: o, editor: s, selected: c, options: p } = i, [g, v] = n(c), y = t(null), [b, x] = n({
|
|
96
|
+
top: 0,
|
|
97
|
+
left: 0
|
|
98
|
+
}), { math: S = {} } = p || {}, { keypadMode: C, controlledKeypadMode: w = !0, customKeys: T = [], keyPadCharacterRef: E, setKeypadInteraction: D } = S, O = a.attrs.latex || "", k = (e) => {
|
|
99
|
+
o({ latex: e });
|
|
100
|
+
}, A = (e) => {
|
|
101
|
+
o({ latex: e }), v(!1), s._toolbarOpened = !1;
|
|
102
|
+
let { selection: t, tr: n, doc: r } = s.state, i = l.create(r, t.from + 1);
|
|
103
|
+
n.setSelection(i), s.view.dispatch(n), s.commands.focus();
|
|
104
|
+
};
|
|
105
|
+
return e(() => {
|
|
106
|
+
c && v(!0);
|
|
107
|
+
}, [c]), e(() => {
|
|
108
|
+
s._toolbarOpened = !!g;
|
|
109
|
+
}, [g]), e(() => {
|
|
110
|
+
let { from: e } = s.state.selection;
|
|
111
|
+
x({
|
|
112
|
+
top: 40,
|
|
113
|
+
left: s.view.coordsAtPos(e).left
|
|
114
|
+
});
|
|
115
|
+
let t = (e) => {
|
|
116
|
+
let t = e?.target, n = (document.querySelectorAll?.("[id^=\"equation-editor-select\"][id*=\"listbox\"], [aria-labelledby=\"equation-editor-label\"][role=\"listbox\"]") || []).length > 0, r = !!(t?.id && t.id.includes("equation-editor-select")) || !!t?.closest?.("[id*=\"equation-editor-select\"]"), i = !!t?.closest?.(".math-node");
|
|
117
|
+
y.current && !y.current.contains(t) && !t?.closest?.("[data-inline-node]") && !n && !r && !i && (v(!1), A(a.attrs.latex));
|
|
118
|
+
};
|
|
119
|
+
return g ? document.addEventListener("click", t) : document.removeEventListener("click", t), () => document.removeEventListener("click", t);
|
|
120
|
+
}, [s, g]), /* @__PURE__ */ f(r, {
|
|
121
|
+
className: "math-node",
|
|
122
|
+
style: {
|
|
123
|
+
display: "inline-flex",
|
|
124
|
+
cursor: "pointer",
|
|
125
|
+
margin: "0 4px"
|
|
126
|
+
},
|
|
127
|
+
"data-selected": c,
|
|
128
|
+
children: [/* @__PURE__ */ d("div", {
|
|
129
|
+
onClick: () => v(!0),
|
|
130
|
+
contentEditable: !1,
|
|
131
|
+
children: /* @__PURE__ */ d(m, { latex: O })
|
|
132
|
+
}), g && u.createPortal(/* @__PURE__ */ d("div", {
|
|
133
|
+
ref: y,
|
|
134
|
+
"data-toolbar-for": s.instanceId,
|
|
135
|
+
style: {
|
|
136
|
+
position: "absolute",
|
|
137
|
+
top: `${b.top}px`,
|
|
138
|
+
left: `${b.left}px`,
|
|
139
|
+
zIndex: 20,
|
|
140
|
+
background: "var(--editable-html-toolbar-bg, #efefef)",
|
|
141
|
+
boxShadow: "0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)"
|
|
142
|
+
},
|
|
143
|
+
children: /* @__PURE__ */ d(h, {
|
|
144
|
+
latex: O,
|
|
145
|
+
autoFocus: !0,
|
|
146
|
+
onChange: k,
|
|
147
|
+
onDone: A,
|
|
148
|
+
keypadMode: C,
|
|
149
|
+
controlledKeypadMode: w,
|
|
150
|
+
additionalKeys: _(T),
|
|
151
|
+
keyPadCharacterRef: E,
|
|
152
|
+
setKeypadInteraction: D
|
|
153
|
+
})
|
|
154
|
+
}), s?._tiptapContainerEl || document.body)]
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
export { b as MathNode };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/media.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Node } from '@tiptap/core';
|
|
11
|
+
export declare const Media: Node<any, any>;
|
|
12
|
+
export declare const insertDialog: (props: any) => void;
|
|
13
|
+
export default function MediaNodeView({ editor, node, updateAttributes, deleteNode, options }: {
|
|
14
|
+
editor: any;
|
|
15
|
+
node: any;
|
|
16
|
+
updateAttributes: any;
|
|
17
|
+
deleteNode: any;
|
|
18
|
+
options: any;
|
|
19
|
+
}): React.JSX.Element;
|