@pie-lib/editable-html-tip-tap 2.1.2-next.31 → 2.1.2-next.34
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/CHANGELOG.json +32 -0
- package/CHANGELOG.md +2532 -0
- package/LICENSE.md +5 -0
- package/lib/components/CharacterPicker.js +201 -0
- package/lib/components/CharacterPicker.js.map +1 -0
- package/lib/components/EditableHtml.js +376 -0
- package/lib/components/EditableHtml.js.map +1 -0
- package/lib/components/MenuBar.js +696 -0
- package/lib/components/MenuBar.js.map +1 -0
- package/lib/components/TiptapContainer.js +234 -0
- package/lib/components/TiptapContainer.js.map +1 -0
- package/lib/components/characters/characterUtils.js +378 -0
- package/lib/components/characters/characterUtils.js.map +1 -0
- package/lib/components/characters/custom-popper.js +44 -0
- package/lib/components/characters/custom-popper.js.map +1 -0
- package/lib/components/common/done-button.js +34 -0
- package/lib/components/common/done-button.js.map +1 -0
- package/lib/components/common/toolbar-buttons.js +144 -0
- package/lib/components/common/toolbar-buttons.js.map +1 -0
- package/lib/components/icons/CssIcon.js +25 -0
- package/lib/components/icons/CssIcon.js.map +1 -0
- package/lib/components/icons/RespArea.js +72 -0
- package/lib/components/icons/RespArea.js.map +1 -0
- package/lib/components/icons/TableIcons.js +53 -0
- package/lib/components/icons/TableIcons.js.map +1 -0
- package/lib/components/icons/TextAlign.js +157 -0
- package/lib/components/icons/TextAlign.js.map +1 -0
- package/lib/components/image/AltDialog.js +98 -0
- package/lib/components/image/AltDialog.js.map +1 -0
- package/lib/components/image/ImageToolbar.js +137 -0
- package/lib/components/image/ImageToolbar.js.map +1 -0
- package/lib/components/image/InsertImageHandler.js +135 -0
- package/lib/components/image/InsertImageHandler.js.map +1 -0
- package/lib/components/media/MediaDialog.js +594 -0
- package/lib/components/media/MediaDialog.js.map +1 -0
- package/lib/components/media/MediaToolbar.js +74 -0
- package/lib/components/media/MediaToolbar.js.map +1 -0
- package/lib/components/media/MediaWrapper.js +67 -0
- package/lib/components/media/MediaWrapper.js.map +1 -0
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +84 -0
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +1 -0
- package/lib/components/respArea/DragInTheBlank/choice.js +250 -0
- package/lib/components/respArea/DragInTheBlank/choice.js.map +1 -0
- package/lib/components/respArea/ExplicitConstructedResponse.js +136 -0
- package/lib/components/respArea/ExplicitConstructedResponse.js.map +1 -0
- package/lib/components/respArea/InlineDropdown.js +209 -0
- package/lib/components/respArea/InlineDropdown.js.map +1 -0
- package/lib/components/respArea/MathTemplated.js +130 -0
- package/lib/components/respArea/MathTemplated.js.map +1 -0
- package/lib/components/respArea/ToolbarIcon.js +81 -0
- package/lib/components/respArea/ToolbarIcon.js.map +1 -0
- package/lib/components/respArea/inlineDropdownUtils.js +67 -0
- package/lib/components/respArea/inlineDropdownUtils.js.map +1 -0
- package/lib/constants.js +11 -0
- package/lib/constants.js.map +1 -0
- package/lib/extensions/css.js +217 -0
- package/lib/extensions/css.js.map +1 -0
- package/lib/extensions/custom-toolbar-wrapper.js +92 -0
- package/lib/extensions/custom-toolbar-wrapper.js.map +1 -0
- package/lib/extensions/div-node.js +83 -0
- package/lib/extensions/div-node.js.map +1 -0
- package/lib/extensions/ensure-empty-root-div.js +48 -0
- package/lib/extensions/ensure-empty-root-div.js.map +1 -0
- package/lib/extensions/ensure-list-item-content-is-div.js +64 -0
- package/lib/extensions/ensure-list-item-content-is-div.js.map +1 -0
- package/lib/extensions/extended-list-item.js +15 -0
- package/lib/extensions/extended-list-item.js.map +1 -0
- package/lib/extensions/extended-table-cell.js +22 -0
- package/lib/extensions/extended-table-cell.js.map +1 -0
- package/lib/extensions/extended-table.js +75 -0
- package/lib/extensions/extended-table.js.map +1 -0
- package/lib/extensions/heading-paragraph.js +61 -0
- package/lib/extensions/heading-paragraph.js.map +1 -0
- package/lib/extensions/image-component.js +348 -0
- package/lib/extensions/image-component.js.map +1 -0
- package/lib/extensions/image.js +134 -0
- package/lib/extensions/image.js.map +1 -0
- package/lib/extensions/index.js +46 -0
- package/lib/extensions/index.js.map +1 -0
- package/lib/extensions/math.js +342 -0
- package/lib/extensions/math.js.map +1 -0
- package/lib/extensions/media.js +243 -0
- package/lib/extensions/media.js.map +1 -0
- package/lib/extensions/responseArea.js +446 -0
- package/lib/extensions/responseArea.js.map +1 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/editorContainerStyles.js +137 -0
- package/lib/styles/editorContainerStyles.js.map +1 -0
- package/lib/theme.js +8 -0
- package/lib/theme.js.map +1 -0
- package/lib/utils/helper.js +73 -0
- package/lib/utils/helper.js.map +1 -0
- package/lib/utils/size.js +26 -0
- package/lib/utils/size.js.map +1 -0
- package/package.json +24 -40
- package/src/__tests__/EditableHtml.test.jsx +554 -0
- package/src/__tests__/constants.test.js +19 -0
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +125 -0
- package/src/__tests__/extensions.test.js +208 -0
- package/src/__tests__/index.test.jsx +154 -0
- package/src/__tests__/size-utils.test.js +64 -0
- package/src/__tests__/theme.test.js +17 -0
- package/src/components/CharacterPicker.jsx +207 -0
- package/src/components/EditableHtml.jsx +440 -0
- package/src/components/MenuBar.jsx +554 -0
- package/src/components/TiptapContainer.jsx +219 -0
- package/src/components/__tests__/AltDialog.test.jsx +147 -0
- package/src/components/__tests__/CharacterPicker.test.jsx +261 -0
- package/src/components/__tests__/CssIcon.test.jsx +46 -0
- package/src/components/__tests__/DragInTheBlank.test.jsx +255 -0
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +204 -0
- package/src/components/__tests__/ImageToolbar.test.jsx +128 -0
- package/src/components/__tests__/InlineDropdown.test.jsx +388 -0
- package/src/components/__tests__/InsertImageHandler.test.js +161 -0
- package/src/components/__tests__/MediaDialog.test.jsx +293 -0
- package/src/components/__tests__/MediaToolbar.test.jsx +74 -0
- package/src/components/__tests__/MediaWrapper.test.jsx +81 -0
- package/src/components/__tests__/MenuBar.test.jsx +250 -0
- package/src/components/__tests__/RespArea.test.jsx +122 -0
- package/src/components/__tests__/TableIcons.test.jsx +149 -0
- package/src/components/__tests__/TextAlign.test.jsx +167 -0
- package/src/components/__tests__/TiptapContainer.test.jsx +138 -0
- package/src/components/__tests__/characterUtils.test.js +166 -0
- package/src/components/__tests__/choice.test.jsx +171 -0
- package/src/components/__tests__/custom-popper.test.jsx +82 -0
- package/src/components/__tests__/done-button.test.jsx +54 -0
- package/src/components/__tests__/toolbar-buttons.test.jsx +234 -0
- package/src/components/characters/characterUtils.js +447 -0
- package/src/components/characters/custom-popper.js +38 -0
- package/src/components/common/done-button.jsx +27 -0
- package/src/components/common/toolbar-buttons.jsx +122 -0
- package/src/components/icons/CssIcon.jsx +15 -0
- package/src/components/icons/RespArea.jsx +71 -0
- package/src/components/icons/TableIcons.jsx +52 -0
- package/src/components/icons/TextAlign.jsx +114 -0
- package/src/components/image/AltDialog.jsx +82 -0
- package/src/components/image/ImageToolbar.jsx +99 -0
- package/src/components/image/InsertImageHandler.js +107 -0
- package/src/components/media/MediaDialog.jsx +596 -0
- package/src/components/media/MediaToolbar.jsx +49 -0
- package/src/components/media/MediaWrapper.jsx +39 -0
- package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +76 -0
- package/src/components/respArea/DragInTheBlank/choice.jsx +256 -0
- package/src/components/respArea/ExplicitConstructedResponse.jsx +135 -0
- package/src/components/respArea/InlineDropdown.jsx +220 -0
- package/src/components/respArea/MathTemplated.jsx +124 -0
- package/src/components/respArea/ToolbarIcon.jsx +66 -0
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +210 -0
- package/src/components/respArea/inlineDropdownUtils.js +79 -0
- package/src/constants.js +5 -0
- package/src/extensions/__tests__/css.test.js +196 -0
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +180 -0
- package/src/extensions/__tests__/divNode.test.js +87 -0
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +57 -0
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +44 -0
- package/src/extensions/__tests__/extended-list-item.test.js +13 -0
- package/src/extensions/__tests__/extended-table-cell.test.js +22 -0
- package/src/extensions/__tests__/extended-table.test.js +183 -0
- package/src/extensions/__tests__/image-component.test.jsx +345 -0
- package/src/extensions/__tests__/image.test.js +237 -0
- package/src/extensions/__tests__/math.test.js +603 -0
- package/src/extensions/__tests__/media-node-view.test.jsx +298 -0
- package/src/extensions/__tests__/media.test.js +271 -0
- package/src/extensions/__tests__/responseArea.test.js +601 -0
- package/src/extensions/css.js +220 -0
- package/src/extensions/custom-toolbar-wrapper.jsx +78 -0
- package/src/extensions/div-node.js +86 -0
- package/src/extensions/ensure-empty-root-div.js +47 -0
- package/src/extensions/ensure-list-item-content-is-div.js +62 -0
- package/src/extensions/extended-list-item.js +10 -0
- package/src/extensions/extended-table-cell.js +19 -0
- package/src/extensions/extended-table.js +60 -0
- package/src/extensions/heading-paragraph.js +53 -0
- package/src/extensions/image-component.jsx +338 -0
- package/src/extensions/image.js +109 -0
- package/src/extensions/index.js +81 -0
- package/src/extensions/math.js +326 -0
- package/src/extensions/media.js +188 -0
- package/src/extensions/responseArea.js +401 -0
- package/src/index.jsx +5 -0
- package/src/styles/editorContainerStyles.js +145 -0
- package/src/theme.js +1 -0
- package/src/utils/__tests__/helper.test.js +126 -0
- package/src/utils/helper.js +69 -0
- package/src/utils/size.js +32 -0
- package/dist/components/CharacterPicker.d.ts +0 -31
- package/dist/components/CharacterPicker.js +0 -131
- package/dist/components/EditableHtml.d.ts +0 -11
- package/dist/components/EditableHtml.js +0 -291
- package/dist/components/MenuBar.d.ts +0 -11
- package/dist/components/MenuBar.js +0 -462
- package/dist/components/TiptapContainer.d.ts +0 -11
- package/dist/components/TiptapContainer.js +0 -154
- package/dist/components/characters/characterUtils.d.ts +0 -35
- package/dist/components/characters/characterUtils.js +0 -465
- package/dist/components/characters/custom-popper.d.ts +0 -14
- package/dist/components/characters/custom-popper.js +0 -32
- package/dist/components/common/done-button.d.ts +0 -30
- package/dist/components/common/done-button.js +0 -26
- package/dist/components/common/toolbar-buttons.d.ts +0 -38
- package/dist/components/common/toolbar-buttons.js +0 -91
- package/dist/components/icons/CssIcon.d.ts +0 -11
- package/dist/components/icons/CssIcon.js +0 -14
- package/dist/components/icons/RespArea.d.ts +0 -26
- package/dist/components/icons/RespArea.js +0 -42
- package/dist/components/icons/TableIcons.d.ts +0 -14
- package/dist/components/icons/TableIcons.js +0 -32
- package/dist/components/icons/TextAlign.d.ts +0 -18
- package/dist/components/icons/TextAlign.js +0 -134
- package/dist/components/image/AltDialog.d.ts +0 -22
- package/dist/components/image/AltDialog.js +0 -61
- package/dist/components/image/ImageToolbar.d.ts +0 -24
- package/dist/components/image/ImageToolbar.js +0 -80
- package/dist/components/image/InsertImageHandler.d.ts +0 -32
- package/dist/components/image/InsertImageHandler.js +0 -53
- package/dist/components/media/MediaDialog.d.ts +0 -43
- package/dist/components/media/MediaDialog.js +0 -389
- package/dist/components/media/MediaToolbar.d.ts +0 -19
- package/dist/components/media/MediaToolbar.js +0 -41
- package/dist/components/media/MediaWrapper.d.ts +0 -19
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +0 -23
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -58
- package/dist/components/respArea/DragInTheBlank/choice.d.ts +0 -56
- package/dist/components/respArea/DragInTheBlank/choice.js +0 -156
- package/dist/components/respArea/ExplicitConstructedResponse.d.ts +0 -20
- package/dist/components/respArea/ExplicitConstructedResponse.js +0 -83
- package/dist/components/respArea/InlineDropdown.d.ts +0 -18
- package/dist/components/respArea/InlineDropdown.js +0 -119
- package/dist/components/respArea/MathTemplated.d.ts +0 -19
- package/dist/components/respArea/MathTemplated.js +0 -97
- package/dist/components/respArea/ToolbarIcon.d.ts +0 -14
- package/dist/components/respArea/ToolbarIcon.js +0 -17
- package/dist/components/respArea/inlineDropdownUtils.d.ts +0 -15
- package/dist/components/respArea/inlineDropdownUtils.js +0 -15
- package/dist/constants.d.ts +0 -13
- package/dist/constants.js +0 -4
- package/dist/extensions/css.d.ts +0 -11
- package/dist/extensions/css.js +0 -115
- package/dist/extensions/custom-toolbar-wrapper.d.ts +0 -11
- package/dist/extensions/custom-toolbar-wrapper.js +0 -61
- package/dist/extensions/div-node.d.ts +0 -10
- package/dist/extensions/div-node.js +0 -42
- package/dist/extensions/ensure-empty-root-div.d.ts +0 -14
- package/dist/extensions/ensure-empty-root-div.js +0 -24
- package/dist/extensions/ensure-list-item-content-is-div.d.ts +0 -15
- package/dist/extensions/ensure-list-item-content-is-div.js +0 -31
- package/dist/extensions/extended-list-item.d.ts +0 -13
- package/dist/extensions/extended-list-item.js +0 -5
- package/dist/extensions/extended-table-cell.d.ts +0 -10
- package/dist/extensions/extended-table-cell.js +0 -6
- package/dist/extensions/extended-table.d.ts +0 -17
- package/dist/extensions/extended-table.js +0 -34
- package/dist/extensions/heading-paragraph.d.ts +0 -17
- package/dist/extensions/heading-paragraph.js +0 -30
- package/dist/extensions/image-component.d.ts +0 -22
- package/dist/extensions/image-component.js +0 -220
- package/dist/extensions/image.d.ts +0 -10
- package/dist/extensions/image.js +0 -68
- package/dist/extensions/index.d.ts +0 -16
- package/dist/extensions/index.js +0 -64
- package/dist/extensions/math.d.ts +0 -15
- package/dist/extensions/math.js +0 -158
- package/dist/extensions/media.d.ts +0 -19
- package/dist/extensions/media.js +0 -149
- package/dist/extensions/responseArea.d.ts +0 -27
- package/dist/extensions/responseArea.js +0 -259
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -7
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/styles/editorContainerStyles.d.ts +0 -134
- package/dist/theme.d.ts +0 -9
- package/dist/utils/helper.d.ts +0 -9
- package/dist/utils/helper.js +0 -27
- package/dist/utils/size.d.ts +0 -9
- package/dist/utils/size.js +0 -14
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import e from "../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import { GripIcon as t } from "../../icons/RespArea.js";
|
|
3
|
-
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
4
|
-
import { styled as a } from "@mui/material/styles";
|
|
5
|
-
import o from "prop-types";
|
|
6
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
import { useDraggable as l, useDroppable as u } from "@dnd-kit/core";
|
|
8
|
-
import { color as d } from "@pie-lib/render-ui";
|
|
9
|
-
import { renderMath as f } from "@pie-element/shared-math-rendering-mathjax";
|
|
10
|
-
//#region src/components/respArea/DragInTheBlank/choice.tsx
|
|
11
|
-
var p = a("span")(({ theme: e }) => ({
|
|
12
|
-
border: `solid 0px ${e.palette.primary.main}`,
|
|
13
|
-
"& mjx-frac": { fontSize: "120% !important" }
|
|
14
|
-
}));
|
|
15
|
-
function m({ n: e, children: a, isDragging: o, isOver: l, dragItem: u, value: p, selected: m }) {
|
|
16
|
-
let [h, g] = i(null), _ = r(null), v = (e) => {
|
|
17
|
-
_.current && (_.current.contains(e.target) ? _.current.classList.add("selected") : _.current.classList.remove("selected"));
|
|
18
|
-
};
|
|
19
|
-
n(() => (document.addEventListener("click", v), () => {
|
|
20
|
-
document.removeEventListener("click", v);
|
|
21
|
-
}), []), n(() => {
|
|
22
|
-
_.current && typeof f == "function" && f(_.current);
|
|
23
|
-
}, [
|
|
24
|
-
p?.value,
|
|
25
|
-
l,
|
|
26
|
-
u?.value?.value
|
|
27
|
-
]), n(() => {
|
|
28
|
-
if (l && _.current && !h) {
|
|
29
|
-
let e = _.current;
|
|
30
|
-
g({
|
|
31
|
-
width: e.offsetWidth,
|
|
32
|
-
height: e.offsetHeight
|
|
33
|
-
});
|
|
34
|
-
} else !l && h && g(null);
|
|
35
|
-
}, [l, h]);
|
|
36
|
-
let y = u && l ? u.value.value : p.value || "\xA0", b = o ? "\xA0" : y, x = b !== "\xA0", S = u && l, C = m ? `2px solid ${d.primaryDark()}` : S ? `1px solid ${d.defaults.BORDER_DARK}` : `1px solid ${d.defaults.BORDER_LIGHT}`;
|
|
37
|
-
return /* @__PURE__ */ c("div", {
|
|
38
|
-
ref: _,
|
|
39
|
-
className: m ? "selected" : void 0,
|
|
40
|
-
style: {
|
|
41
|
-
display: "inline-flex",
|
|
42
|
-
minWidth: "178px",
|
|
43
|
-
minHeight: "36px",
|
|
44
|
-
background: S ? `${d.defaults.BORDER_LIGHT}` : `${d.defaults.WHITE}`,
|
|
45
|
-
border: C,
|
|
46
|
-
boxSizing: "border-box",
|
|
47
|
-
borderRadius: "3px",
|
|
48
|
-
overflow: "hidden",
|
|
49
|
-
position: "relative",
|
|
50
|
-
padding: "8px 8px 8px 35px",
|
|
51
|
-
width: h ? h.width : void 0,
|
|
52
|
-
height: h ? h.height : void 0,
|
|
53
|
-
touchAction: "none"
|
|
54
|
-
},
|
|
55
|
-
"data-key": e.index,
|
|
56
|
-
contentEditable: !1,
|
|
57
|
-
children: [
|
|
58
|
-
x && /* @__PURE__ */ s(t, {
|
|
59
|
-
style: {
|
|
60
|
-
position: "absolute",
|
|
61
|
-
top: "6px",
|
|
62
|
-
left: "15px",
|
|
63
|
-
color: "#9B9B9B"
|
|
64
|
-
},
|
|
65
|
-
contentEditable: !1
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ s("span", { dangerouslySetInnerHTML: { __html: b } }),
|
|
68
|
-
a
|
|
69
|
-
]
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
m.propTypes = {
|
|
73
|
-
n: o.object,
|
|
74
|
-
children: o.node,
|
|
75
|
-
isDragging: o.bool,
|
|
76
|
-
isOver: o.bool,
|
|
77
|
-
dragItem: o.object,
|
|
78
|
-
value: o.object,
|
|
79
|
-
selected: o.bool
|
|
80
|
-
};
|
|
81
|
-
function h({ value: t, disabled: n, instanceId: r, children: i, n: a, onChange: o, removeResponse: c, duplicates: d, pos: f, selected: h }) {
|
|
82
|
-
let { attributes: g, listeners: _, setNodeRef: v, isDragging: y } = l({
|
|
83
|
-
id: `drag-${a.index}`,
|
|
84
|
-
disabled: n || !t?.value,
|
|
85
|
-
data: {
|
|
86
|
-
id: `drag-${a.index}`,
|
|
87
|
-
value: t,
|
|
88
|
-
instanceId: r,
|
|
89
|
-
n: a,
|
|
90
|
-
pos: f,
|
|
91
|
-
opts: { duplicates: d },
|
|
92
|
-
type: "drag-in-the-blank-placed-choice",
|
|
93
|
-
fromChoice: !t,
|
|
94
|
-
onRemove: (e) => c(e),
|
|
95
|
-
onDrop: (e, t) => {
|
|
96
|
-
t?.type === "drag-in-the-blank-drop-choice" && (o(e), !d && e.fromChoice && c(e));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}), { setNodeRef: b, isOver: x, active: S } = u({
|
|
100
|
-
id: `drop-${a.index}`,
|
|
101
|
-
data: {
|
|
102
|
-
type: "drag-in-the-blank-drop-choice",
|
|
103
|
-
accepts: ["drag-in-the-blank-choice", "drag-in-the-blank-placed-choice"],
|
|
104
|
-
instanceId: r,
|
|
105
|
-
value: t,
|
|
106
|
-
id: `drop-${a.index}`,
|
|
107
|
-
pos: f,
|
|
108
|
-
n: a,
|
|
109
|
-
opts: { duplicates: d },
|
|
110
|
-
onDrop: (e, t) => {
|
|
111
|
-
if (t?.type === "drag-in-the-blank-drop-choice" && e.value.id !== t.value.id) {
|
|
112
|
-
if (e.type === "drag-in-the-blank-choice") {
|
|
113
|
-
o(e), !d && e.fromChoice && c(e);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
e.type === "drag-in-the-blank-placed-choice" && (c(t), o(e), setTimeout(() => c(e), 10));
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}), C = (e) => {
|
|
121
|
-
v(e), b(e);
|
|
122
|
-
}, w = /* @__PURE__ */ s(m, {
|
|
123
|
-
n: a,
|
|
124
|
-
isDragging: y,
|
|
125
|
-
isOver: x,
|
|
126
|
-
dragItem: S?.data?.current,
|
|
127
|
-
value: t,
|
|
128
|
-
selected: h,
|
|
129
|
-
children: i
|
|
130
|
-
}), T = t ? /* @__PURE__ */ s("span", {
|
|
131
|
-
ref: C,
|
|
132
|
-
...g,
|
|
133
|
-
..._,
|
|
134
|
-
children: w
|
|
135
|
-
}) : /* @__PURE__ */ s("span", {
|
|
136
|
-
ref: b,
|
|
137
|
-
children: w
|
|
138
|
-
});
|
|
139
|
-
return /* @__PURE__ */ s(p, {
|
|
140
|
-
className: e(x && "over"),
|
|
141
|
-
children: T
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
h.propTypes = {
|
|
145
|
-
value: o.object,
|
|
146
|
-
disabled: o.bool,
|
|
147
|
-
instanceId: o.string,
|
|
148
|
-
children: o.node,
|
|
149
|
-
n: o.object.isRequired,
|
|
150
|
-
onChange: o.func.isRequired,
|
|
151
|
-
removeResponse: o.func.isRequired,
|
|
152
|
-
duplicates: o.bool,
|
|
153
|
-
selected: o.bool
|
|
154
|
-
};
|
|
155
|
-
//#endregion
|
|
156
|
-
export { h as default };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/components/respArea/ExplicitConstructedResponse.jsx
|
|
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 PropTypes from 'prop-types';
|
|
11
|
-
declare const ExplicitConstructedResponse: {
|
|
12
|
-
(props: any): React.JSX.Element;
|
|
13
|
-
propTypes: {
|
|
14
|
-
attributes: PropTypes.Requireable<object>;
|
|
15
|
-
error: PropTypes.Requireable<any>;
|
|
16
|
-
value: PropTypes.Requireable<string>;
|
|
17
|
-
isFocused: PropTypes.Requireable<boolean>;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export default ExplicitConstructedResponse;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import e from "../../extensions/custom-toolbar-wrapper.js";
|
|
2
|
-
import t, { useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
-
import { NodeViewWrapper as a } from "@tiptap/react";
|
|
4
|
-
import o from "react-dom";
|
|
5
|
-
import s from "prop-types";
|
|
6
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/respArea/ExplicitConstructedResponse.tsx
|
|
8
|
-
var u = (s) => {
|
|
9
|
-
let { editor: u, node: d, getPos: f, options: p, selected: m } = s, { attrs: h } = d, { value: g } = h, { respAreaToolbar: _, error: v } = p, y = f(), [b, x] = i(!1), S = _([d, y], u, () => {}), C = r(null), w;
|
|
10
|
-
if (v) {
|
|
11
|
-
let e = v(), t = parseInt(h.index, 10);
|
|
12
|
-
w = !!e?.[t]?.[0];
|
|
13
|
-
}
|
|
14
|
-
return n(() => {
|
|
15
|
-
let { selection: e } = u.state, t = e.from + d.nodeSize === e.to;
|
|
16
|
-
m ? t && x(m) : x(m);
|
|
17
|
-
}, [
|
|
18
|
-
u,
|
|
19
|
-
d,
|
|
20
|
-
m
|
|
21
|
-
]), n(() => {
|
|
22
|
-
let e = (e) => {
|
|
23
|
-
!(e.target.closest(".insert-character-dialog") || e.target.closest("[data-toolbar-for]")) && C.current && !C.current.contains(e.target) && !e.target.closest("[data-inline-node]") && x(!1);
|
|
24
|
-
};
|
|
25
|
-
return b ? document.addEventListener("mousedown", e) : document.removeEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
26
|
-
}, [b]), /* @__PURE__ */ l(a, {
|
|
27
|
-
className: "drag-in-the-blank",
|
|
28
|
-
"data-selected": m,
|
|
29
|
-
style: {
|
|
30
|
-
display: "inline-flex",
|
|
31
|
-
minHeight: "55px",
|
|
32
|
-
position: "relative",
|
|
33
|
-
cursor: "pointer"
|
|
34
|
-
},
|
|
35
|
-
children: [/* @__PURE__ */ c("div", {
|
|
36
|
-
...h,
|
|
37
|
-
style: {
|
|
38
|
-
display: "inline-flex",
|
|
39
|
-
width: "100%",
|
|
40
|
-
minHeight: "46px",
|
|
41
|
-
height: "46px",
|
|
42
|
-
backgroundColor: "#FFF",
|
|
43
|
-
border: `1px solid ${w ? "red" : "#C0C3CF"}`,
|
|
44
|
-
boxSizing: "border-box",
|
|
45
|
-
borderRadius: "4px",
|
|
46
|
-
overflow: "hidden",
|
|
47
|
-
padding: "12px 21px",
|
|
48
|
-
margin: "0 4px",
|
|
49
|
-
minWidth: "178px",
|
|
50
|
-
visibility: b ? "hidden" : "visible"
|
|
51
|
-
},
|
|
52
|
-
onClick: () => x(!0),
|
|
53
|
-
dangerouslySetInnerHTML: { __html: g || "<div> </div>" }
|
|
54
|
-
}), b && /* @__PURE__ */ l(t.Fragment, { children: [/* @__PURE__ */ c("div", {
|
|
55
|
-
ref: C,
|
|
56
|
-
className: "absolute z-50 bg-white shadow-lg rounded p-2",
|
|
57
|
-
style: { zIndex: 1 },
|
|
58
|
-
children: /* @__PURE__ */ c(S, {})
|
|
59
|
-
}), u._tiptapContainerEl && o.createPortal(/* @__PURE__ */ c(e, {
|
|
60
|
-
deletable: !0,
|
|
61
|
-
toolbarOpts: { minWidth: "auto" },
|
|
62
|
-
autoWidth: !0,
|
|
63
|
-
style: {
|
|
64
|
-
top: -40,
|
|
65
|
-
left: 0,
|
|
66
|
-
right: 0
|
|
67
|
-
},
|
|
68
|
-
onDelete: () => {
|
|
69
|
-
let { tr: e } = u.state;
|
|
70
|
-
e.delete(y, y + d.nodeSize), u._toolbarOpened = !1, u.view.dispatch(e), x(!1), u.commands.focus();
|
|
71
|
-
},
|
|
72
|
-
showDone: !1
|
|
73
|
-
}), u._tiptapContainerEl)] })]
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
u.propTypes = {
|
|
77
|
-
attributes: s.object,
|
|
78
|
-
error: s.any,
|
|
79
|
-
value: s.string,
|
|
80
|
-
isFocused: s.bool
|
|
81
|
-
};
|
|
82
|
-
//#endregion
|
|
83
|
-
export { u as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/components/respArea/InlineDropdown.jsx
|
|
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 PropTypes from 'prop-types';
|
|
11
|
-
declare const InlineDropdown: {
|
|
12
|
-
(props: any): React.JSX.Element;
|
|
13
|
-
propTypes: {
|
|
14
|
-
attributes: PropTypes.Requireable<object>;
|
|
15
|
-
selectedItem: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default InlineDropdown;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import e from "../../extensions/custom-toolbar-wrapper.js";
|
|
2
|
-
import { Chevron as t } from "../icons/RespArea.js";
|
|
3
|
-
import n, { useEffect as r, useRef as i, useState as a } from "react";
|
|
4
|
-
import { NodeViewWrapper as o } from "@tiptap/react";
|
|
5
|
-
import { NodeSelection as s } from "prosemirror-state";
|
|
6
|
-
import c from "react-dom";
|
|
7
|
-
import l from "prop-types";
|
|
8
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/respArea/InlineDropdown.tsx
|
|
10
|
-
var f = (l) => {
|
|
11
|
-
let { editor: f, node: p, getPos: m, options: h, selected: g } = l, { attrs: _ } = p, { value: v, error: y } = _, b = v || "<div> </div>", x = m(), S = i(null), C = i(null), w = i(!1), T = () => f._holdInlineDropdownToolbarIndex != null && String(f._holdInlineDropdownToolbarIndex) === String(p.attrs.index), [E, D] = a(!1), [O, k] = a({
|
|
12
|
-
top: 0,
|
|
13
|
-
left: 0
|
|
14
|
-
}), A = () => {
|
|
15
|
-
T() || D(!1);
|
|
16
|
-
}, j = h.respAreaToolbar([p, x], f, A), M = () => {
|
|
17
|
-
let { tr: e } = f.state, t = e.doc.nodeAt(x);
|
|
18
|
-
if (!t) return;
|
|
19
|
-
let { selection: n } = e;
|
|
20
|
-
n.from === x && n.to === x + t.nodeSize || (e.setSelection(s.create(e.doc, x)), f.view.dispatch(e));
|
|
21
|
-
}, N = () => {
|
|
22
|
-
w.current || (h.onToolbarCloseRequest ? (w.current = !0, h.onToolbarCloseRequest([p, x], f, () => {
|
|
23
|
-
w.current = !1, delete f._holdInlineDropdownToolbarIndex, A();
|
|
24
|
-
}, () => {
|
|
25
|
-
w.current = !1, delete f._holdInlineDropdownToolbarIndex, D(!0), setTimeout(M, 0);
|
|
26
|
-
})) : A());
|
|
27
|
-
};
|
|
28
|
-
return r(() => {
|
|
29
|
-
let { selection: e } = f.state, t = e.from + p.nodeSize === e.to;
|
|
30
|
-
g ? t && D(!0) : E && N();
|
|
31
|
-
}, [
|
|
32
|
-
f,
|
|
33
|
-
p,
|
|
34
|
-
g
|
|
35
|
-
]), r(() => {
|
|
36
|
-
let e = document.body.getBoundingClientRect(), { from: t } = f.state.selection, n = f.view.coordsAtPos(t);
|
|
37
|
-
k({
|
|
38
|
-
top: n.top + Math.abs(e.top) + 40,
|
|
39
|
-
left: n.left
|
|
40
|
-
});
|
|
41
|
-
let r = (e) => {
|
|
42
|
-
let t = e.target.closest("[data-toolbar-for]");
|
|
43
|
-
!e.target.closest("[data-inline-dropdown-toolbar]") && (!t || t.dataset.toolbarFor !== C.current?.instanceId) && !f._toolbarOpened && S.current && !S.current.contains(e.target) && !e.target.closest("[data-inline-node]") && N();
|
|
44
|
-
};
|
|
45
|
-
return E ? document.addEventListener("mousedown", r) : document.removeEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
|
|
46
|
-
}, [E]), /* @__PURE__ */ d(o, {
|
|
47
|
-
className: "inline-dropdown",
|
|
48
|
-
"data-selected": g,
|
|
49
|
-
style: {
|
|
50
|
-
display: "inline-flex",
|
|
51
|
-
height: "50px",
|
|
52
|
-
cursor: "pointer"
|
|
53
|
-
},
|
|
54
|
-
children: [/* @__PURE__ */ d("div", {
|
|
55
|
-
style: {
|
|
56
|
-
display: "inline-flex",
|
|
57
|
-
minWidth: "178px",
|
|
58
|
-
height: "36px",
|
|
59
|
-
background: "#FFF",
|
|
60
|
-
border: "1px solid #C0C3CF",
|
|
61
|
-
boxSizing: "border-box",
|
|
62
|
-
borderRadius: "3px",
|
|
63
|
-
margin: "0 2px",
|
|
64
|
-
position: "relative",
|
|
65
|
-
alignItems: "center"
|
|
66
|
-
},
|
|
67
|
-
onClick: () => D(!0),
|
|
68
|
-
children: [/* @__PURE__ */ u("div", {
|
|
69
|
-
style: {
|
|
70
|
-
flex: 1,
|
|
71
|
-
overflow: "hidden",
|
|
72
|
-
padding: "0 25px 0 8px",
|
|
73
|
-
whiteSpace: "nowrap",
|
|
74
|
-
textOverflow: "ellipsis"
|
|
75
|
-
},
|
|
76
|
-
children: /* @__PURE__ */ u("span", {
|
|
77
|
-
style: {
|
|
78
|
-
display: "inline-block",
|
|
79
|
-
verticalAlign: "middle"
|
|
80
|
-
},
|
|
81
|
-
dangerouslySetInnerHTML: { __html: b }
|
|
82
|
-
})
|
|
83
|
-
}), /* @__PURE__ */ u(t, {
|
|
84
|
-
direction: "down",
|
|
85
|
-
style: {
|
|
86
|
-
position: "absolute",
|
|
87
|
-
top: "5px",
|
|
88
|
-
right: "5px"
|
|
89
|
-
}
|
|
90
|
-
})]
|
|
91
|
-
}), E && /* @__PURE__ */ d(n.Fragment, { children: [c.createPortal(/* @__PURE__ */ u("div", {
|
|
92
|
-
ref: S,
|
|
93
|
-
style: { zIndex: 1 },
|
|
94
|
-
children: /* @__PURE__ */ u(j, { editorCallback: (e) => {
|
|
95
|
-
C.current = e;
|
|
96
|
-
} })
|
|
97
|
-
}), document.body), f._tiptapContainerEl && c.createPortal(/* @__PURE__ */ u(e, {
|
|
98
|
-
deletable: !0,
|
|
99
|
-
toolbarOpts: { minWidth: "auto" },
|
|
100
|
-
autoWidth: !0,
|
|
101
|
-
style: {
|
|
102
|
-
top: -40,
|
|
103
|
-
left: 0,
|
|
104
|
-
right: 0
|
|
105
|
-
},
|
|
106
|
-
onDelete: () => {
|
|
107
|
-
let { tr: e } = f.state;
|
|
108
|
-
e.delete(x, x + p.nodeSize), f._toolbarOpened = !1, delete f._holdInlineDropdownToolbarIndex, f.view.dispatch(e), D(!1), f.commands.focus();
|
|
109
|
-
},
|
|
110
|
-
showDone: !1
|
|
111
|
-
}), f._tiptapContainerEl)] })]
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
f.propTypes = {
|
|
115
|
-
attributes: l.object,
|
|
116
|
-
selectedItem: l.oneOfType([l.string, l.object])
|
|
117
|
-
};
|
|
118
|
-
//#endregion
|
|
119
|
-
export { f as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/components/respArea/MathTemplated.jsx
|
|
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 PropTypes from 'prop-types';
|
|
11
|
-
declare const MathTemplated: {
|
|
12
|
-
(props: any): React.JSX.Element;
|
|
13
|
-
propTypes: {
|
|
14
|
-
attributes: PropTypes.Requireable<object>;
|
|
15
|
-
value: PropTypes.Requireable<string>;
|
|
16
|
-
keyToDisplay: PropTypes.Requireable<string>;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default MathTemplated;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import { NodeViewWrapper as e } from "@tiptap/react";
|
|
3
|
-
import { styled as t } from "@mui/material/styles";
|
|
4
|
-
import n from "prop-types";
|
|
5
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
-
import { mq as a } from "@pie-lib/math-input";
|
|
7
|
-
//#region src/components/respArea/MathTemplated.tsx
|
|
8
|
-
var o = t("span")(() => ({
|
|
9
|
-
display: "inline-flex",
|
|
10
|
-
border: "1px solid #C0C3CF",
|
|
11
|
-
margin: "1px 5px",
|
|
12
|
-
cursor: "pointer",
|
|
13
|
-
alignItems: "center",
|
|
14
|
-
justifyContent: "center",
|
|
15
|
-
minWidth: "50px",
|
|
16
|
-
minHeight: "36px",
|
|
17
|
-
height: "fit-content"
|
|
18
|
-
})), s = t("div")(({ theme: e }) => ({
|
|
19
|
-
background: e.palette.grey.A100,
|
|
20
|
-
color: e.palette.grey.A700,
|
|
21
|
-
display: "inline-flex",
|
|
22
|
-
borderRight: "2px solid #C0C3CF",
|
|
23
|
-
boxSizing: "border-box",
|
|
24
|
-
overflow: "hidden",
|
|
25
|
-
fontSize: "12px",
|
|
26
|
-
minHeight: "36px",
|
|
27
|
-
height: "100%",
|
|
28
|
-
alignItems: "center",
|
|
29
|
-
fontFamily: "Symbola, Times New Roman, serif",
|
|
30
|
-
padding: "0 2px"
|
|
31
|
-
})), c = t("div")(() => ({
|
|
32
|
-
flex: 8,
|
|
33
|
-
color: "var(--pie-text, black)",
|
|
34
|
-
padding: "4px !important",
|
|
35
|
-
display: "flex",
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
justifyContent: "center",
|
|
38
|
-
backgroundColor: "var(--pie-background, rgba(255, 255, 255, 0))",
|
|
39
|
-
"& > .mq-math-mode sup.mq-nthroot": {
|
|
40
|
-
fontSize: "70% !important",
|
|
41
|
-
verticalAlign: "1em !important"
|
|
42
|
-
},
|
|
43
|
-
"& > .mq-math-mode .mq-sqrt-stem": {
|
|
44
|
-
borderTop: "0.07em solid",
|
|
45
|
-
marginLeft: "-1.5px",
|
|
46
|
-
marginTop: "-2px !important",
|
|
47
|
-
paddingTop: "5px !important"
|
|
48
|
-
},
|
|
49
|
-
"& .mq-overarrow-inner": {
|
|
50
|
-
paddingTop: "0 !important",
|
|
51
|
-
border: "none !important"
|
|
52
|
-
},
|
|
53
|
-
"& .mq-overarrow.mq-arrow-both": {
|
|
54
|
-
marginTop: "0px",
|
|
55
|
-
minWidth: "1.23em",
|
|
56
|
-
"& *": { lineHeight: "1 !important" },
|
|
57
|
-
"&:before": {
|
|
58
|
-
top: "-0.4em",
|
|
59
|
-
left: "-1px"
|
|
60
|
-
},
|
|
61
|
-
"&:after": {
|
|
62
|
-
top: "0px !important",
|
|
63
|
-
position: "absolute !important",
|
|
64
|
-
right: "-2px"
|
|
65
|
-
},
|
|
66
|
-
"&.mq-empty:after": { top: "-0.45em" }
|
|
67
|
-
},
|
|
68
|
-
"& .mq-overarrow.mq-arrow-right": { "&:before": {
|
|
69
|
-
top: "-0.4em",
|
|
70
|
-
right: "-1px"
|
|
71
|
-
} },
|
|
72
|
-
"& .mq-overarrow-inner-right": { display: "none !important" },
|
|
73
|
-
"& .mq-overarrow-inner-left": { display: "none !important" }
|
|
74
|
-
})), l = (t) => {
|
|
75
|
-
let { node: n, options: l, selected: u } = t, { attrs: d } = n, { value: f, index: p } = d, m = `R ${parseInt(p) + 1}`;
|
|
76
|
-
return /* @__PURE__ */ r(e, {
|
|
77
|
-
className: "math-templated",
|
|
78
|
-
"data-selected": u,
|
|
79
|
-
style: {
|
|
80
|
-
display: "inline-flex",
|
|
81
|
-
minHeight: "36px",
|
|
82
|
-
minWidth: "50px",
|
|
83
|
-
cursor: "pointer"
|
|
84
|
-
},
|
|
85
|
-
children: /* @__PURE__ */ i(o, {
|
|
86
|
-
...d,
|
|
87
|
-
children: [/* @__PURE__ */ r(s, { children: m }), /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(a.Static, { latex: f }) })]
|
|
88
|
-
})
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
l.propTypes = {
|
|
92
|
-
attributes: n.object,
|
|
93
|
-
value: n.string,
|
|
94
|
-
keyToDisplay: n.string
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
export { l as default };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/components/respArea/ToolbarIcon.jsx
|
|
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
|
-
export declare const Chevron: (props: any) => React.JSX.Element;
|
|
11
|
-
export declare const GripIcon: ({ style }: {
|
|
12
|
-
style: any;
|
|
13
|
-
}) => React.JSX.Element;
|
|
14
|
-
export declare const ToolbarIcon: () => React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import { styled as e } from "@mui/material/styles";
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/respArea/ToolbarIcon.tsx
|
|
5
|
-
var n = e("div")(({ theme: e }) => ({
|
|
6
|
-
fontFamily: "Cerebri Sans !important",
|
|
7
|
-
fontSize: e.typography.fontSize,
|
|
8
|
-
fontWeight: "bold",
|
|
9
|
-
lineHeight: "14px",
|
|
10
|
-
position: "relative",
|
|
11
|
-
top: "7px",
|
|
12
|
-
width: "110px",
|
|
13
|
-
height: "28px",
|
|
14
|
-
whiteSpace: "nowrap"
|
|
15
|
-
})), r = () => /* @__PURE__ */ t(n, { children: "+ Response Area" });
|
|
16
|
-
//#endregion
|
|
17
|
-
export { r as ToolbarIcon };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/components/respArea/inlineDropdownUtils.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 HOLD_INLINE_DROPDOWN_TOOLBAR_INDEX = "_holdInlineDropdownToolbarIndex";
|
|
10
|
-
export declare const findInlineDropdownPos: (editor: any, index: any) => null;
|
|
11
|
-
export declare const holdInlineDropdownToolbar: (editor: any, index: any) => void;
|
|
12
|
-
export declare const releaseInlineDropdownToolbarHold: (editor: any) => void;
|
|
13
|
-
export declare const isInlineDropdownToolbarHeld: (editor: any, index: any) => boolean;
|
|
14
|
-
export declare const selectInlineDropdownNode: (editor: any, index: any, fallbackPos: any) => any;
|
|
15
|
-
export declare const deleteInlineDropdownByIndex: (editor: any, index: any, fallbackPos: any) => boolean;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "prosemirror-state";
|
|
2
|
-
//#region src/components/respArea/inlineDropdownUtils.ts
|
|
3
|
-
var e = "_holdInlineDropdownToolbarIndex", t = (e, t) => {
|
|
4
|
-
let n = null;
|
|
5
|
-
return e.state.doc.descendants((e, r) => e.type?.name === "inline_dropdown" && String(e.attrs?.index) === String(t) ? (n = r, !1) : !0), n;
|
|
6
|
-
}, n = (t) => {
|
|
7
|
-
delete t[e];
|
|
8
|
-
}, r = (e, r, i) => {
|
|
9
|
-
let a = t(e, r) ?? i;
|
|
10
|
-
if (a == null) return n(e), !1;
|
|
11
|
-
let { tr: o } = e.state, s = o.doc.nodeAt(a);
|
|
12
|
-
return s ? (o.delete(a, a + s.nodeSize), e.view.dispatch(o), n(e), !0) : (n(e), !1);
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { r as deleteInlineDropdownByIndex };
|
package/dist/constants.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/constants.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 PIE_TOOLBAR__CLASS = "pie-toolbar";
|
|
10
|
-
declare const _default: {
|
|
11
|
-
PIE_TOOLBAR__CLASS: string;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
package/dist/constants.js
DELETED
package/dist/extensions/css.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/css.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 { Mark } from '@tiptap/core';
|
|
10
|
-
export declare const removeDialogs: () => void;
|
|
11
|
-
export declare const CSSMark: Mark<any, any>;
|