@pie-lib/editable-html-tip-tap 2.2.0-beta.9 → 3.0.0-next.20261002100925

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.
Files changed (235) hide show
  1. package/dist/components/CharacterPicker.d.ts +31 -0
  2. package/dist/components/CharacterPicker.js +141 -0
  3. package/dist/components/EditableHtml.d.ts +11 -0
  4. package/dist/components/EditableHtml.js +331 -0
  5. package/dist/components/MenuBar.d.ts +11 -0
  6. package/dist/components/MenuBar.js +531 -0
  7. package/dist/components/TiptapContainer.d.ts +11 -0
  8. package/dist/components/TiptapContainer.js +167 -0
  9. package/dist/components/characters/characterUtils.d.ts +35 -0
  10. package/dist/components/characters/characterUtils.js +465 -0
  11. package/dist/components/characters/custom-popper.d.ts +14 -0
  12. package/dist/components/characters/custom-popper.js +32 -0
  13. package/dist/components/common/done-button.d.ts +30 -0
  14. package/dist/components/common/done-button.js +26 -0
  15. package/dist/components/common/toolbar-buttons.d.ts +38 -0
  16. package/dist/components/common/toolbar-buttons.js +96 -0
  17. package/dist/components/icons/CssIcon.d.ts +11 -0
  18. package/dist/components/icons/CssIcon.js +14 -0
  19. package/dist/components/icons/RespArea.d.ts +26 -0
  20. package/dist/components/icons/RespArea.js +42 -0
  21. package/dist/components/icons/TableIcons.d.ts +14 -0
  22. package/dist/components/icons/TableIcons.js +34 -0
  23. package/dist/components/icons/TextAlign.d.ts +18 -0
  24. package/dist/components/icons/TextAlign.js +143 -0
  25. package/dist/components/image/AltDialog.d.ts +22 -0
  26. package/dist/components/image/AltDialog.js +61 -0
  27. package/dist/components/image/ImageToolbar.d.ts +24 -0
  28. package/dist/components/image/ImageToolbar.js +80 -0
  29. package/dist/components/image/InsertImageHandler.d.ts +33 -0
  30. package/dist/components/image/InsertImageHandler.js +65 -0
  31. package/dist/components/image/findImageNode.d.ts +3 -0
  32. package/dist/components/image/findImageNode.js +11 -0
  33. package/dist/components/media/MediaDialog.d.ts +43 -0
  34. package/dist/components/media/MediaDialog.js +389 -0
  35. package/dist/components/media/MediaToolbar.d.ts +19 -0
  36. package/dist/components/media/MediaToolbar.js +41 -0
  37. package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +23 -0
  38. package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +58 -0
  39. package/dist/components/respArea/DragInTheBlank/choice.d.ts +56 -0
  40. package/dist/components/respArea/DragInTheBlank/choice.js +157 -0
  41. package/dist/components/respArea/ExplicitConstructedResponse.d.ts +20 -0
  42. package/dist/components/respArea/ExplicitConstructedResponse.js +84 -0
  43. package/dist/components/respArea/InlineDropdown.d.ts +18 -0
  44. package/dist/components/respArea/InlineDropdown.js +126 -0
  45. package/dist/components/respArea/MathTemplated.d.ts +19 -0
  46. package/dist/components/respArea/MathTemplated.js +98 -0
  47. package/dist/components/respArea/ToolbarIcon.d.ts +14 -0
  48. package/dist/components/respArea/ToolbarIcon.js +17 -0
  49. package/dist/components/respArea/inlineDropdownUtils.d.ts +15 -0
  50. package/dist/components/respArea/inlineDropdownUtils.js +15 -0
  51. package/dist/constants.d.ts +13 -0
  52. package/dist/constants.js +4 -0
  53. package/dist/extensions/css.d.ts +11 -0
  54. package/dist/extensions/css.js +120 -0
  55. package/dist/extensions/custom-toolbar-wrapper.d.ts +11 -0
  56. package/dist/extensions/custom-toolbar-wrapper.js +61 -0
  57. package/dist/extensions/div-node.d.ts +10 -0
  58. package/dist/extensions/div-node.js +42 -0
  59. package/dist/extensions/ensure-empty-root-div.d.ts +14 -0
  60. package/dist/extensions/ensure-empty-root-div.js +24 -0
  61. package/dist/extensions/ensure-list-item-content-is-div.d.ts +15 -0
  62. package/dist/extensions/ensure-list-item-content-is-div.js +31 -0
  63. package/dist/extensions/extended-list-item.d.ts +13 -0
  64. package/dist/extensions/extended-list-item.js +5 -0
  65. package/dist/extensions/extended-table-cell.d.ts +10 -0
  66. package/dist/extensions/extended-table-cell.js +6 -0
  67. package/dist/extensions/extended-table.d.ts +17 -0
  68. package/dist/extensions/extended-table.js +34 -0
  69. package/dist/extensions/heading-paragraph.d.ts +17 -0
  70. package/dist/extensions/heading-paragraph.js +30 -0
  71. package/dist/extensions/image-component.d.ts +22 -0
  72. package/dist/extensions/image-component.js +223 -0
  73. package/dist/extensions/image.d.ts +10 -0
  74. package/dist/extensions/image.js +77 -0
  75. package/dist/extensions/index.d.ts +16 -0
  76. package/dist/extensions/index.js +64 -0
  77. package/dist/extensions/math.d.ts +15 -0
  78. package/dist/extensions/math.js +214 -0
  79. package/dist/extensions/media.d.ts +19 -0
  80. package/dist/extensions/media.js +149 -0
  81. package/dist/extensions/responseArea.d.ts +27 -0
  82. package/dist/extensions/responseArea.js +255 -0
  83. package/dist/index.d.ts +13 -0
  84. package/dist/index.js +7 -0
  85. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  86. package/dist/utils/helper.d.ts +9 -0
  87. package/dist/utils/helper.js +27 -0
  88. package/dist/utils/size.d.ts +9 -0
  89. package/dist/utils/size.js +14 -0
  90. package/dist/utils/toolbar.d.ts +10 -0
  91. package/dist/utils/toolbar.js +7 -0
  92. package/package.json +59 -43
  93. package/CHANGELOG.json +0 -32
  94. package/CHANGELOG.md +0 -2532
  95. package/lib/components/CharacterPicker.js +0 -226
  96. package/lib/components/CharacterPicker.js.map +0 -1
  97. package/lib/components/EditableHtml.js +0 -388
  98. package/lib/components/EditableHtml.js.map +0 -1
  99. package/lib/components/MenuBar.js +0 -702
  100. package/lib/components/MenuBar.js.map +0 -1
  101. package/lib/components/TiptapContainer.js +0 -242
  102. package/lib/components/TiptapContainer.js.map +0 -1
  103. package/lib/components/characters/characterUtils.js +0 -378
  104. package/lib/components/characters/characterUtils.js.map +0 -1
  105. package/lib/components/characters/custom-popper.js +0 -44
  106. package/lib/components/characters/custom-popper.js.map +0 -1
  107. package/lib/components/common/done-button.js +0 -34
  108. package/lib/components/common/done-button.js.map +0 -1
  109. package/lib/components/common/toolbar-buttons.js +0 -149
  110. package/lib/components/common/toolbar-buttons.js.map +0 -1
  111. package/lib/components/icons/CssIcon.js +0 -25
  112. package/lib/components/icons/CssIcon.js.map +0 -1
  113. package/lib/components/icons/RespArea.js +0 -72
  114. package/lib/components/icons/RespArea.js.map +0 -1
  115. package/lib/components/icons/TableIcons.js +0 -53
  116. package/lib/components/icons/TableIcons.js.map +0 -1
  117. package/lib/components/icons/TextAlign.js +0 -157
  118. package/lib/components/icons/TextAlign.js.map +0 -1
  119. package/lib/components/image/AltDialog.js +0 -98
  120. package/lib/components/image/AltDialog.js.map +0 -1
  121. package/lib/components/image/ImageToolbar.js +0 -137
  122. package/lib/components/image/ImageToolbar.js.map +0 -1
  123. package/lib/components/image/InsertImageHandler.js +0 -135
  124. package/lib/components/image/InsertImageHandler.js.map +0 -1
  125. package/lib/components/media/MediaDialog.js +0 -594
  126. package/lib/components/media/MediaDialog.js.map +0 -1
  127. package/lib/components/media/MediaToolbar.js +0 -74
  128. package/lib/components/media/MediaToolbar.js.map +0 -1
  129. package/lib/components/media/MediaWrapper.js +0 -67
  130. package/lib/components/media/MediaWrapper.js.map +0 -1
  131. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -84
  132. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +0 -1
  133. package/lib/components/respArea/DragInTheBlank/choice.js +0 -253
  134. package/lib/components/respArea/DragInTheBlank/choice.js.map +0 -1
  135. package/lib/components/respArea/ExplicitConstructedResponse.js +0 -137
  136. package/lib/components/respArea/ExplicitConstructedResponse.js.map +0 -1
  137. package/lib/components/respArea/InlineDropdown.js +0 -223
  138. package/lib/components/respArea/InlineDropdown.js.map +0 -1
  139. package/lib/components/respArea/MathTemplated.js +0 -130
  140. package/lib/components/respArea/MathTemplated.js.map +0 -1
  141. package/lib/components/respArea/ToolbarIcon.js +0 -81
  142. package/lib/components/respArea/ToolbarIcon.js.map +0 -1
  143. package/lib/components/respArea/inlineDropdownUtils.js +0 -67
  144. package/lib/components/respArea/inlineDropdownUtils.js.map +0 -1
  145. package/lib/constants.js +0 -11
  146. package/lib/constants.js.map +0 -1
  147. package/lib/extensions/css.js +0 -227
  148. package/lib/extensions/css.js.map +0 -1
  149. package/lib/extensions/custom-toolbar-wrapper.js +0 -92
  150. package/lib/extensions/custom-toolbar-wrapper.js.map +0 -1
  151. package/lib/extensions/div-node.js +0 -83
  152. package/lib/extensions/div-node.js.map +0 -1
  153. package/lib/extensions/ensure-empty-root-div.js +0 -48
  154. package/lib/extensions/ensure-empty-root-div.js.map +0 -1
  155. package/lib/extensions/ensure-list-item-content-is-div.js +0 -64
  156. package/lib/extensions/ensure-list-item-content-is-div.js.map +0 -1
  157. package/lib/extensions/extended-list-item.js +0 -15
  158. package/lib/extensions/extended-list-item.js.map +0 -1
  159. package/lib/extensions/extended-table-cell.js +0 -22
  160. package/lib/extensions/extended-table-cell.js.map +0 -1
  161. package/lib/extensions/extended-table.js +0 -75
  162. package/lib/extensions/extended-table.js.map +0 -1
  163. package/lib/extensions/heading-paragraph.js +0 -61
  164. package/lib/extensions/heading-paragraph.js.map +0 -1
  165. package/lib/extensions/image-component.js +0 -351
  166. package/lib/extensions/image-component.js.map +0 -1
  167. package/lib/extensions/image.js +0 -134
  168. package/lib/extensions/image.js.map +0 -1
  169. package/lib/extensions/index.js +0 -46
  170. package/lib/extensions/index.js.map +0 -1
  171. package/lib/extensions/math.js +0 -469
  172. package/lib/extensions/math.js.map +0 -1
  173. package/lib/extensions/media.js +0 -243
  174. package/lib/extensions/media.js.map +0 -1
  175. package/lib/extensions/responseArea.js +0 -452
  176. package/lib/extensions/responseArea.js.map +0 -1
  177. package/lib/index.js +0 -37
  178. package/lib/index.js.map +0 -1
  179. package/lib/styles/editorContainerStyles.js +0 -137
  180. package/lib/styles/editorContainerStyles.js.map +0 -1
  181. package/lib/theme.js +0 -8
  182. package/lib/theme.js.map +0 -1
  183. package/lib/utils/helper.js +0 -73
  184. package/lib/utils/helper.js.map +0 -1
  185. package/lib/utils/size.js +0 -26
  186. package/lib/utils/size.js.map +0 -1
  187. package/lib/utils/toolbar.js +0 -19
  188. package/lib/utils/toolbar.js.map +0 -1
  189. package/src/components/CharacterPicker.jsx +0 -237
  190. package/src/components/EditableHtml.jsx +0 -458
  191. package/src/components/MenuBar.jsx +0 -561
  192. package/src/components/TiptapContainer.jsx +0 -235
  193. package/src/components/characters/characterUtils.js +0 -447
  194. package/src/components/characters/custom-popper.js +0 -38
  195. package/src/components/common/done-button.jsx +0 -27
  196. package/src/components/common/toolbar-buttons.jsx +0 -127
  197. package/src/components/icons/CssIcon.jsx +0 -15
  198. package/src/components/icons/RespArea.jsx +0 -71
  199. package/src/components/icons/TableIcons.jsx +0 -52
  200. package/src/components/icons/TextAlign.jsx +0 -114
  201. package/src/components/image/AltDialog.jsx +0 -82
  202. package/src/components/image/ImageToolbar.jsx +0 -99
  203. package/src/components/image/InsertImageHandler.js +0 -107
  204. package/src/components/media/MediaDialog.jsx +0 -596
  205. package/src/components/media/MediaToolbar.jsx +0 -49
  206. package/src/components/media/MediaWrapper.jsx +0 -39
  207. package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +0 -76
  208. package/src/components/respArea/DragInTheBlank/choice.jsx +0 -259
  209. package/src/components/respArea/ExplicitConstructedResponse.jsx +0 -136
  210. package/src/components/respArea/InlineDropdown.jsx +0 -240
  211. package/src/components/respArea/MathTemplated.jsx +0 -124
  212. package/src/components/respArea/ToolbarIcon.jsx +0 -66
  213. package/src/components/respArea/inlineDropdownUtils.js +0 -79
  214. package/src/constants.js +0 -5
  215. package/src/extensions/css.js +0 -233
  216. package/src/extensions/custom-toolbar-wrapper.jsx +0 -78
  217. package/src/extensions/div-node.js +0 -86
  218. package/src/extensions/ensure-empty-root-div.js +0 -47
  219. package/src/extensions/ensure-list-item-content-is-div.js +0 -62
  220. package/src/extensions/extended-list-item.js +0 -10
  221. package/src/extensions/extended-table-cell.js +0 -19
  222. package/src/extensions/extended-table.js +0 -60
  223. package/src/extensions/heading-paragraph.js +0 -53
  224. package/src/extensions/image-component.jsx +0 -340
  225. package/src/extensions/image.js +0 -109
  226. package/src/extensions/index.js +0 -81
  227. package/src/extensions/math.js +0 -454
  228. package/src/extensions/media.js +0 -188
  229. package/src/extensions/responseArea.js +0 -407
  230. package/src/index.jsx +0 -5
  231. package/src/styles/editorContainerStyles.js +0 -145
  232. package/src/theme.js +0 -1
  233. package/src/utils/helper.js +0 -69
  234. package/src/utils/size.js +0 -32
  235. package/src/utils/toolbar.js +0 -15
@@ -0,0 +1,17 @@
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 };
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,15 @@
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 { e as HOLD_INLINE_DROPDOWN_TOOLBAR_INDEX, r as deleteInlineDropdownByIndex, t as findInlineDropdownPos, n as releaseInlineDropdownToolbarHold };
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,4 @@
1
+ //#region src/constants.ts
2
+ var e = "pie-toolbar";
3
+ //#endregion
4
+ export { e as PIE_TOOLBAR__CLASS };
@@ -0,0 +1,11 @@
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>;
@@ -0,0 +1,120 @@
1
+ import "react";
2
+ import { Mark as e, mergeAttributes as t } from "@tiptap/core";
3
+ import n from "react-dom";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import a from "@mui/material/List";
6
+ import o from "@mui/material/ListItem";
7
+ //#region src/extensions/css.tsx
8
+ var s = () => {
9
+ document.querySelectorAll(".insert-css-dialog").forEach((e) => e.remove());
10
+ }, c = ({ editor: e, callback: t, opts: c, selectedText: l, parentNode: u }) => {
11
+ let d = e.options.element, f = document.createElement("div"), { selection: p } = e.state;
12
+ s(), f.className = "insert-css-dialog";
13
+ let m = !1, h = (e) => {
14
+ if (m) {
15
+ let t = f.contains(e.target) || void 0, n = d.contains(e.target);
16
+ t || n || g();
17
+ } else m = !0;
18
+ }, g = () => {
19
+ t(void 0, !0), f.remove(), document.body.removeEventListener("click", h);
20
+ }, _ = (e) => {
21
+ t(e, !0), f.remove(), document.body.removeEventListener("click", h);
22
+ }, v = u?.attrs.class, y = (e) => {
23
+ let t = `<span class="${e}">${l}</span>`;
24
+ if (u) {
25
+ let e = "span";
26
+ u?.object === "inline" && (e = "span"), u?.object === "block" && (e = "div"), t = `<${e} class="${v}">${u.text.slice(0, p.$anchor.textOffset)}${t}${u.text.slice(p.$head.textOffset)}</${e}>`;
27
+ }
28
+ return t;
29
+ }, b = /* @__PURE__ */ i("div", {
30
+ style: {
31
+ background: "white",
32
+ height: 500,
33
+ padding: 20,
34
+ overflow: "hidden",
35
+ display: "flex",
36
+ flexFlow: "column"
37
+ },
38
+ children: [
39
+ /* @__PURE__ */ r("h2", { children: "Please choose a css class" }),
40
+ v && /* @__PURE__ */ i("div", { children: ["The current parent has this class ", v] }),
41
+ /* @__PURE__ */ r(a, {
42
+ component: "nav",
43
+ style: { overflow: "scroll" },
44
+ children: c.names.map((e, t) => /* @__PURE__ */ i(o, {
45
+ button: !0,
46
+ onClick: () => _(e),
47
+ children: [/* @__PURE__ */ r("div", {
48
+ style: { marginRight: 20 },
49
+ children: e
50
+ }), /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: y(e) } })]
51
+ }, `rule-${t}`))
52
+ })
53
+ ]
54
+ });
55
+ n.render(b, f, () => {
56
+ let t = e.view.nodeDOM(e.state.selection.from)?.parentNode;
57
+ if (t) {
58
+ let e = d.parentElement.parentElement.parentElement.getBoundingClientRect(), n = t.getBoundingClientRect();
59
+ d.parentElement.parentElement.parentElement.appendChild(f), f.style.maxWidth = "500px", f.style.position = "absolute", f.style.top = 0, f.style.zIndex = 99999;
60
+ let r = `${n.left + Math.abs(e.left) + t.offsetWidth + 10}px`, i = `${n.x}px`;
61
+ f.style.left = r;
62
+ let a = f.offsetWidth;
63
+ f.style.left = "unset", f.style.right = i;
64
+ let o = f.offsetWidth;
65
+ f.style.left = "unset", f.style.right = "unset", a >= o ? f.style.left = r : f.style.right = i, document.body.addEventListener("click", h);
66
+ }
67
+ });
68
+ }, l = e.create({
69
+ name: "cssmark",
70
+ addOptions() {
71
+ return { classes: [] };
72
+ },
73
+ addAttributes() {
74
+ return { class: {
75
+ default: null,
76
+ parseHTML: (e) => e.getAttribute("class"),
77
+ renderHTML: (e) => e.class ? { class: e.class } : {}
78
+ } };
79
+ },
80
+ parseHTML() {
81
+ return [{
82
+ tag: "span[class]",
83
+ getAttrs: (e) => {
84
+ let t = e.getAttribute("class") || "";
85
+ if (!t) return !1;
86
+ if ((this.options && this.options.classes || []).length > 0) {
87
+ let e = this.options.classes.find((e) => t.includes(e));
88
+ return e ? { class: e } : !1;
89
+ }
90
+ return { class: t };
91
+ }
92
+ }];
93
+ },
94
+ renderHTML({ HTMLAttributes: e }) {
95
+ return [
96
+ "span",
97
+ t(e),
98
+ 0
99
+ ];
100
+ },
101
+ addCommands() {
102
+ return {
103
+ setCSSClass: (e) => ({ commands: t }) => t.setMark(this.name, { class: e }),
104
+ unsetCSSClass: () => ({ commands: e }) => e.unsetMark(this.name),
105
+ openCSSClassDialog: () => ({ editor: e }) => {
106
+ c({
107
+ editor: e,
108
+ selectedText: e.state.doc.textBetween(e.state.selection.from, e.state.selection.to),
109
+ parentNode: e.state.selection.$from.nodeAfter,
110
+ opts: this.options.extraCSSRules,
111
+ callback: (t) => {
112
+ t && e.chain().focus().setCSSClass(t).run();
113
+ }
114
+ });
115
+ }
116
+ };
117
+ }
118
+ });
119
+ //#endregion
120
+ export { l as CSSMark, s as removeDialogs };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/custom-toolbar-wrapper.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
+ declare function CustomToolbarWrapper(props: any): React.JSX.Element;
11
+ export default CustomToolbarWrapper;
@@ -0,0 +1,61 @@
1
+ import { PIE_TOOLBAR__CLASS as e } from "../constants.js";
2
+ import { DoneButton as t } from "../components/common/done-button.js";
3
+ import "react";
4
+ import { styled as n } from "@mui/material/styles";
5
+ import r from "@mui/material/IconButton";
6
+ import i from "@mui/icons-material/Delete";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ //#region src/extensions/custom-toolbar-wrapper.tsx
9
+ var s = n("div", { shouldForwardProp: (e) => ![
10
+ "showDone",
11
+ "toolbarAlignment",
12
+ "isFocused",
13
+ "autoWidth",
14
+ "isHidden"
15
+ ].includes(e) })(({ showDone: e, toolbarAlignment: t, isFocused: n, autoWidth: r, isHidden: i }) => ({
16
+ position: "absolute",
17
+ zIndex: 10,
18
+ cursor: "pointer",
19
+ justifyContent: "space-between",
20
+ background: "var(--editable-html-toolbar-bg, #efefef)",
21
+ minWidth: e ? "280px" : "265px",
22
+ margin: "5px 0 0 0",
23
+ padding: "2px",
24
+ 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)",
25
+ boxSizing: "border-box",
26
+ display: "flex",
27
+ opacity: 1,
28
+ ...t === "right" && { right: 0 },
29
+ ...r ? { width: "auto" } : { width: "100%" },
30
+ ...i && { visibility: "hidden" }
31
+ })), c = n(r)({
32
+ width: "28px",
33
+ height: "28px",
34
+ padding: "4px",
35
+ verticalAlign: "top"
36
+ }), l = n("div")({ display: "flex" });
37
+ function u(n) {
38
+ let { children: r, deletable: u, toolbarOpts: d, autoWidth: f, isFocused: p, doneButtonRef: m, onDelete: h, showDone: g, onDone: _, style: v } = n, y = d.minWidth === void 0 ? {} : { minWidth: d.minWidth };
39
+ return /* @__PURE__ */ o(s, {
40
+ className: e,
41
+ showDone: g,
42
+ toolbarAlignment: d.alignment,
43
+ isFocused: d.alwaysVisible || p,
44
+ autoWidth: f,
45
+ isHidden: d.isHidden === !0,
46
+ style: {
47
+ ...y,
48
+ ...v
49
+ },
50
+ children: [r, /* @__PURE__ */ o(l, { children: [u && /* @__PURE__ */ a(c, {
51
+ "aria-label": "Delete",
52
+ onMouseDown: (e) => h?.(e),
53
+ children: /* @__PURE__ */ a(i, {})
54
+ }), g && /* @__PURE__ */ a(t, {
55
+ doneButtonRef: m,
56
+ onClick: _
57
+ })] })]
58
+ });
59
+ }
60
+ //#endregion
61
+ export { u as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/div-node.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 DivNode: Node<any, any>;
@@ -0,0 +1,42 @@
1
+ import { Node as e } from "@tiptap/core";
2
+ //#region src/extensions/div-node.tsx
3
+ var t = e.create({
4
+ name: "div",
5
+ group: "block",
6
+ content: "inline*",
7
+ parseHTML() {
8
+ return [{ tag: "div" }];
9
+ },
10
+ renderHTML({ HTMLAttributes: e }) {
11
+ return [
12
+ "div",
13
+ e,
14
+ 0
15
+ ];
16
+ },
17
+ addKeyboardShortcuts() {
18
+ let e = (e) => {
19
+ for (let t = e.depth; t >= 0; --t) if (e.node(t).type.name === "listItem") return !0;
20
+ return !1;
21
+ };
22
+ return {
23
+ Enter: () => {
24
+ let { state: t } = this.editor, { $from: n } = t.selection;
25
+ return n.parent.type.name !== "div" || e(n) ? !1 : this.editor.chain().focus().setNode("paragraph").splitBlock().run();
26
+ },
27
+ Backspace: () => {
28
+ let { state: e } = this.editor, { $from: t, empty: n } = e.selection;
29
+ if (t.parent.type.name !== "div" || !n) return !1;
30
+ let r = t.parent.textContent;
31
+ if (r.length === 0) return e.doc.childCount === 1;
32
+ if (r.length === 1 && t.parentOffset === 1) {
33
+ let { tr: n } = e;
34
+ return n.delete(t.pos - 1, t.pos), this.editor.view.dispatch(n), !0;
35
+ }
36
+ return !1;
37
+ }
38
+ };
39
+ }
40
+ });
41
+ //#endregion
42
+ export { t as DivNode };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/ensure-empty-root-div.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 { Extension } from '@tiptap/core';
10
+ /**
11
+ * After ProseMirror repairs an empty document, it often inserts a `paragraph`.
12
+ * We want a lone empty top-level block to be `div` (DivNode) so typing stays `<div>A</div>`.
13
+ */
14
+ export declare const EnsureEmptyRootIsDiv: Extension<any, any>;
@@ -0,0 +1,24 @@
1
+ import { Extension as e } from "@tiptap/core";
2
+ import { Plugin as t, PluginKey as n } from "@tiptap/pm/state";
3
+ //#region src/extensions/ensure-empty-root-div.tsx
4
+ var r = e.create({
5
+ name: "ensureEmptyRootIsDiv",
6
+ addProseMirrorPlugins() {
7
+ return [new t({
8
+ key: new n(this.name),
9
+ appendTransaction(e, t, n) {
10
+ if (!e.some((e) => e.docChanged)) return null;
11
+ let { doc: r } = n;
12
+ if (r.childCount !== 1) return null;
13
+ let i = r.firstChild;
14
+ if (i.type.name !== "paragraph" || i.content.size > 0) return null;
15
+ let a = n.schema.nodes.div;
16
+ if (!a) return null;
17
+ let o = i.nodeSize;
18
+ return n.tr.replaceWith(0, o, a.create());
19
+ }
20
+ })];
21
+ }
22
+ });
23
+ //#endregion
24
+ export { r as EnsureEmptyRootIsDiv };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/ensure-list-item-content-is-div.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 { Extension } from '@tiptap/core';
10
+ /**
11
+ * Some list operations preserve/create `paragraph` children in `listItem`.
12
+ * Normalize direct `listItem > paragraph` children into `div` so list content
13
+ * stays consistent with DivNode-based editing.
14
+ */
15
+ export declare const EnsureListItemContentIsDiv: Extension<any, any>;
@@ -0,0 +1,31 @@
1
+ import { Extension as e } from "@tiptap/core";
2
+ import { Plugin as t, PluginKey as n } from "@tiptap/pm/state";
3
+ //#region src/extensions/ensure-list-item-content-is-div.ts
4
+ var r = e.create({
5
+ name: "ensureListItemContentIsDiv",
6
+ addProseMirrorPlugins() {
7
+ return [new t({
8
+ key: new n(this.name),
9
+ appendTransaction(e, t, n) {
10
+ if (!e.some((e) => e.docChanged)) return null;
11
+ let { doc: r, schema: i } = n, a = i.nodes.div;
12
+ if (!a) return null;
13
+ let o = [];
14
+ if (r.descendants((e, t) => {
15
+ if (e.type.name !== "listItem") return;
16
+ let n = 1;
17
+ e.forEach((e) => {
18
+ e.type.name === "paragraph" && o.push({
19
+ pos: t + n,
20
+ attrs: e.attrs
21
+ }), n += e.nodeSize;
22
+ });
23
+ }), o.length === 0) return null;
24
+ let s = n.tr;
25
+ return o.sort((e, t) => t.pos - e.pos).forEach(({ pos: e, attrs: t }) => s.setNodeMarkup(e, a, t)), s;
26
+ }
27
+ })];
28
+ }
29
+ });
30
+ //#endregion
31
+ export { r as EnsureListItemContentIsDiv };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/extended-list-item.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
+ /**
10
+ * Default list items use `paragraph block*`, so empty/new items become `<p>`.
11
+ * Prefer `div` first to keep consistency with DivNode at root and table cells.
12
+ */
13
+ export declare const ExtendedListItem: import("@tiptap/core").Node<import("@tiptap/extension-list").ListItemOptions, any>;
@@ -0,0 +1,5 @@
1
+ import { ListItem as e } from "@tiptap/extension-list-item";
2
+ //#region src/extensions/extended-list-item.tsx
3
+ var t = e.extend({ content: "(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+" });
4
+ //#endregion
5
+ export { t as ExtendedListItem };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/extended-table-cell.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 ExtendedTableCell: import("@tiptap/core").Node<import("@tiptap/extension-table").TableCellOptions, any>;
10
+ export declare const ExtendedTableHeader: import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>;
@@ -0,0 +1,6 @@
1
+ import { TableCell as e } from "@tiptap/extension-table-cell";
2
+ import { TableHeader as t } from "@tiptap/extension-table-header";
3
+ //#region src/extensions/extended-table-cell.ts
4
+ var n = "(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+", r = e.extend({ content: n }), i = t.extend({ content: n });
5
+ //#endregion
6
+ export { r as ExtendedTableCell, i as ExtendedTableHeader };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/extended-table.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 { TableView } from '@tiptap/extension-table';
10
+ declare const applyPresentationToTableElement: (table: any, attrs: any) => void;
11
+ declare class ExtendedTableView extends TableView {
12
+ constructor(node: any, cellMinWidth: any, view: any);
13
+ update(node: any): boolean;
14
+ }
15
+ declare const ExtendedTable: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
16
+ export { applyPresentationToTableElement, ExtendedTableView };
17
+ export default ExtendedTable;
@@ -0,0 +1,34 @@
1
+ import { Table as e, TableView as t } from "@tiptap/extension-table";
2
+ //#region src/extensions/extended-table.tsx
3
+ var n = (e, t) => {
4
+ let n = t?.border != null && t.border !== "" ? t.border : "1";
5
+ e.setAttribute("border", n), e.style.setProperty("color", "var(--pie-text, black)"), e.style.setProperty("background-color", "var(--pie-background, rgba(255, 255, 255))");
6
+ }, r = class extends t {
7
+ constructor(e, t, r) {
8
+ super(e, t, r), n(this.table, e.attrs);
9
+ }
10
+ update(e) {
11
+ let t = super.update(e);
12
+ return t && n(this.table, e.attrs), t;
13
+ }
14
+ }, i = e.extend({
15
+ addOptions() {
16
+ return {
17
+ ...this.parent?.(),
18
+ resizable: !0,
19
+ handleWidth: 0,
20
+ View: r
21
+ };
22
+ },
23
+ addAttributes() {
24
+ return { border: { default: "1" } };
25
+ },
26
+ renderHTML(e) {
27
+ let t = this.parent(e), { border: n } = e.HTMLAttributes, r = `${t[1].style}${t[1].style.match(/.*; */) ? "" : ";"}`;
28
+ return t[1].style = `${r}
29
+ color: var(--pie-text, black);
30
+ background-color: var(--pie-background, rgba(255, 255, 255))`, t[1].border = n || "1", t;
31
+ }
32
+ });
33
+ //#endregion
34
+ export { r as ExtendedTableView, n as applyPresentationToTableElement, i as default };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/heading-paragraph.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
+ /**
11
+ * HeadingParagraph extension
12
+ *
13
+ * Renders as <p data-heading="heading1"> in the HTML output instead of <h3>.
14
+ * This provides semantic heading styling without using a native heading element,
15
+ * as required by PIE's accessibility conventions.
16
+ */
17
+ export declare const HeadingParagraph: Node<any, any>;
@@ -0,0 +1,30 @@
1
+ import { Node as e, mergeAttributes as t } from "@tiptap/core";
2
+ //#region src/extensions/heading-paragraph.tsx
3
+ var n = e.create({
4
+ name: "headingParagraph",
5
+ group: "block",
6
+ content: "inline*",
7
+ defining: !0,
8
+ addAttributes() {
9
+ return { "data-heading": {
10
+ default: "heading1",
11
+ parseHTML: (e) => e.getAttribute("data-heading"),
12
+ renderHTML: (e) => ({ "data-heading": e["data-heading"] })
13
+ } };
14
+ },
15
+ parseHTML() {
16
+ return [{ tag: "p[data-heading]" }];
17
+ },
18
+ renderHTML({ HTMLAttributes: e }) {
19
+ return [
20
+ "p",
21
+ t(e),
22
+ 0
23
+ ];
24
+ },
25
+ addCommands() {
26
+ return { toggleHeadingParagraph: () => ({ commands: e, editor: t }) => t.isActive("headingParagraph") ? e.setNode("paragraph") : e.setNode("headingParagraph", { "data-heading": "heading1" }) };
27
+ }
28
+ });
29
+ //#endregion
30
+ export { n as HeadingParagraph };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/extensions/image-component.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 function ImageComponent(props: any): React.JSX.Element;
12
+ declare namespace ImageComponent {
13
+ var propTypes: {
14
+ node: PropTypes.Validator<object>;
15
+ editor: PropTypes.Validator<object>;
16
+ attributes: PropTypes.Requireable<object>;
17
+ onFocus: PropTypes.Requireable<(...args: any[]) => any>;
18
+ maxImageWidth: PropTypes.Requireable<number>;
19
+ maxImageHeight: PropTypes.Requireable<number>;
20
+ };
21
+ }
22
+ export default ImageComponent;