@pie-lib/editable-html-tip-tap 2.2.0-beta.8 → 3.0.0-next.35

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 (282) 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 +330 -0
  5. package/dist/components/MenuBar.d.ts +11 -0
  6. package/dist/components/MenuBar.js +528 -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 +32 -0
  30. package/dist/components/image/InsertImageHandler.js +53 -0
  31. package/dist/components/media/MediaDialog.d.ts +43 -0
  32. package/dist/components/media/MediaDialog.js +389 -0
  33. package/dist/components/media/MediaToolbar.d.ts +19 -0
  34. package/dist/components/media/MediaToolbar.js +41 -0
  35. package/dist/components/media/MediaWrapper.d.ts +19 -0
  36. package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +23 -0
  37. package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +58 -0
  38. package/dist/components/respArea/DragInTheBlank/choice.d.ts +56 -0
  39. package/dist/components/respArea/DragInTheBlank/choice.js +157 -0
  40. package/dist/components/respArea/ExplicitConstructedResponse.d.ts +20 -0
  41. package/dist/components/respArea/ExplicitConstructedResponse.js +84 -0
  42. package/dist/components/respArea/InlineDropdown.d.ts +18 -0
  43. package/dist/components/respArea/InlineDropdown.js +126 -0
  44. package/dist/components/respArea/MathTemplated.d.ts +19 -0
  45. package/dist/components/respArea/MathTemplated.js +98 -0
  46. package/dist/components/respArea/ToolbarIcon.d.ts +14 -0
  47. package/dist/components/respArea/ToolbarIcon.js +17 -0
  48. package/dist/components/respArea/inlineDropdownUtils.d.ts +15 -0
  49. package/dist/components/respArea/inlineDropdownUtils.js +15 -0
  50. package/dist/constants.d.ts +13 -0
  51. package/dist/constants.js +4 -0
  52. package/dist/extensions/css.d.ts +11 -0
  53. package/dist/extensions/css.js +120 -0
  54. package/dist/extensions/custom-toolbar-wrapper.d.ts +11 -0
  55. package/dist/extensions/custom-toolbar-wrapper.js +61 -0
  56. package/dist/extensions/div-node.d.ts +10 -0
  57. package/dist/extensions/div-node.js +42 -0
  58. package/dist/extensions/ensure-empty-root-div.d.ts +14 -0
  59. package/dist/extensions/ensure-empty-root-div.js +24 -0
  60. package/dist/extensions/ensure-list-item-content-is-div.d.ts +15 -0
  61. package/dist/extensions/ensure-list-item-content-is-div.js +31 -0
  62. package/dist/extensions/extended-list-item.d.ts +13 -0
  63. package/dist/extensions/extended-list-item.js +5 -0
  64. package/dist/extensions/extended-table-cell.d.ts +10 -0
  65. package/dist/extensions/extended-table-cell.js +6 -0
  66. package/dist/extensions/extended-table.d.ts +17 -0
  67. package/dist/extensions/extended-table.js +34 -0
  68. package/dist/extensions/heading-paragraph.d.ts +17 -0
  69. package/dist/extensions/heading-paragraph.js +30 -0
  70. package/dist/extensions/image-component.d.ts +22 -0
  71. package/dist/extensions/image-component.js +225 -0
  72. package/dist/extensions/image.d.ts +10 -0
  73. package/dist/extensions/image.js +68 -0
  74. package/dist/extensions/index.d.ts +16 -0
  75. package/dist/extensions/index.js +64 -0
  76. package/dist/extensions/math.d.ts +15 -0
  77. package/dist/extensions/math.js +213 -0
  78. package/dist/extensions/media.d.ts +19 -0
  79. package/dist/extensions/media.js +149 -0
  80. package/dist/extensions/responseArea.d.ts +27 -0
  81. package/dist/extensions/responseArea.js +255 -0
  82. package/dist/index.d.ts +13 -0
  83. package/dist/index.js +7 -0
  84. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  85. package/dist/styles/editorContainerStyles.d.ts +134 -0
  86. package/dist/theme.d.ts +9 -0
  87. package/dist/utils/helper.d.ts +9 -0
  88. package/dist/utils/helper.js +27 -0
  89. package/dist/utils/size.d.ts +9 -0
  90. package/dist/utils/size.js +14 -0
  91. package/dist/utils/toolbar.d.ts +10 -0
  92. package/dist/utils/toolbar.js +7 -0
  93. package/package.json +43 -29
  94. package/CHANGELOG.json +0 -32
  95. package/CHANGELOG.md +0 -2532
  96. package/lib/components/CharacterPicker.js +0 -226
  97. package/lib/components/CharacterPicker.js.map +0 -1
  98. package/lib/components/EditableHtml.js +0 -388
  99. package/lib/components/EditableHtml.js.map +0 -1
  100. package/lib/components/MenuBar.js +0 -702
  101. package/lib/components/MenuBar.js.map +0 -1
  102. package/lib/components/TiptapContainer.js +0 -242
  103. package/lib/components/TiptapContainer.js.map +0 -1
  104. package/lib/components/characters/characterUtils.js +0 -378
  105. package/lib/components/characters/characterUtils.js.map +0 -1
  106. package/lib/components/characters/custom-popper.js +0 -44
  107. package/lib/components/characters/custom-popper.js.map +0 -1
  108. package/lib/components/common/done-button.js +0 -34
  109. package/lib/components/common/done-button.js.map +0 -1
  110. package/lib/components/common/toolbar-buttons.js +0 -149
  111. package/lib/components/common/toolbar-buttons.js.map +0 -1
  112. package/lib/components/icons/CssIcon.js +0 -25
  113. package/lib/components/icons/CssIcon.js.map +0 -1
  114. package/lib/components/icons/RespArea.js +0 -72
  115. package/lib/components/icons/RespArea.js.map +0 -1
  116. package/lib/components/icons/TableIcons.js +0 -53
  117. package/lib/components/icons/TableIcons.js.map +0 -1
  118. package/lib/components/icons/TextAlign.js +0 -157
  119. package/lib/components/icons/TextAlign.js.map +0 -1
  120. package/lib/components/image/AltDialog.js +0 -98
  121. package/lib/components/image/AltDialog.js.map +0 -1
  122. package/lib/components/image/ImageToolbar.js +0 -137
  123. package/lib/components/image/ImageToolbar.js.map +0 -1
  124. package/lib/components/image/InsertImageHandler.js +0 -135
  125. package/lib/components/image/InsertImageHandler.js.map +0 -1
  126. package/lib/components/media/MediaDialog.js +0 -594
  127. package/lib/components/media/MediaDialog.js.map +0 -1
  128. package/lib/components/media/MediaToolbar.js +0 -74
  129. package/lib/components/media/MediaToolbar.js.map +0 -1
  130. package/lib/components/media/MediaWrapper.js +0 -67
  131. package/lib/components/media/MediaWrapper.js.map +0 -1
  132. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -84
  133. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +0 -1
  134. package/lib/components/respArea/DragInTheBlank/choice.js +0 -253
  135. package/lib/components/respArea/DragInTheBlank/choice.js.map +0 -1
  136. package/lib/components/respArea/ExplicitConstructedResponse.js +0 -137
  137. package/lib/components/respArea/ExplicitConstructedResponse.js.map +0 -1
  138. package/lib/components/respArea/InlineDropdown.js +0 -223
  139. package/lib/components/respArea/InlineDropdown.js.map +0 -1
  140. package/lib/components/respArea/MathTemplated.js +0 -130
  141. package/lib/components/respArea/MathTemplated.js.map +0 -1
  142. package/lib/components/respArea/ToolbarIcon.js +0 -81
  143. package/lib/components/respArea/ToolbarIcon.js.map +0 -1
  144. package/lib/components/respArea/inlineDropdownUtils.js +0 -67
  145. package/lib/components/respArea/inlineDropdownUtils.js.map +0 -1
  146. package/lib/constants.js +0 -11
  147. package/lib/constants.js.map +0 -1
  148. package/lib/extensions/css.js +0 -227
  149. package/lib/extensions/css.js.map +0 -1
  150. package/lib/extensions/custom-toolbar-wrapper.js +0 -92
  151. package/lib/extensions/custom-toolbar-wrapper.js.map +0 -1
  152. package/lib/extensions/div-node.js +0 -83
  153. package/lib/extensions/div-node.js.map +0 -1
  154. package/lib/extensions/ensure-empty-root-div.js +0 -48
  155. package/lib/extensions/ensure-empty-root-div.js.map +0 -1
  156. package/lib/extensions/ensure-list-item-content-is-div.js +0 -64
  157. package/lib/extensions/ensure-list-item-content-is-div.js.map +0 -1
  158. package/lib/extensions/extended-list-item.js +0 -15
  159. package/lib/extensions/extended-list-item.js.map +0 -1
  160. package/lib/extensions/extended-table-cell.js +0 -22
  161. package/lib/extensions/extended-table-cell.js.map +0 -1
  162. package/lib/extensions/extended-table.js +0 -75
  163. package/lib/extensions/extended-table.js.map +0 -1
  164. package/lib/extensions/heading-paragraph.js +0 -61
  165. package/lib/extensions/heading-paragraph.js.map +0 -1
  166. package/lib/extensions/image-component.js +0 -351
  167. package/lib/extensions/image-component.js.map +0 -1
  168. package/lib/extensions/image.js +0 -134
  169. package/lib/extensions/image.js.map +0 -1
  170. package/lib/extensions/index.js +0 -46
  171. package/lib/extensions/index.js.map +0 -1
  172. package/lib/extensions/math.js +0 -469
  173. package/lib/extensions/math.js.map +0 -1
  174. package/lib/extensions/media.js +0 -243
  175. package/lib/extensions/media.js.map +0 -1
  176. package/lib/extensions/responseArea.js +0 -452
  177. package/lib/extensions/responseArea.js.map +0 -1
  178. package/lib/index.js +0 -37
  179. package/lib/index.js.map +0 -1
  180. package/lib/styles/editorContainerStyles.js +0 -137
  181. package/lib/styles/editorContainerStyles.js.map +0 -1
  182. package/lib/theme.js +0 -8
  183. package/lib/theme.js.map +0 -1
  184. package/lib/utils/helper.js +0 -73
  185. package/lib/utils/helper.js.map +0 -1
  186. package/lib/utils/size.js +0 -26
  187. package/lib/utils/size.js.map +0 -1
  188. package/lib/utils/toolbar.js +0 -19
  189. package/lib/utils/toolbar.js.map +0 -1
  190. package/src/__tests__/EditableHtml.test.jsx +0 -588
  191. package/src/__tests__/constants.test.js +0 -19
  192. package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
  193. package/src/__tests__/extensions.test.js +0 -208
  194. package/src/__tests__/index.test.jsx +0 -154
  195. package/src/__tests__/size-utils.test.js +0 -64
  196. package/src/__tests__/theme.test.js +0 -17
  197. package/src/components/CharacterPicker.jsx +0 -237
  198. package/src/components/EditableHtml.jsx +0 -458
  199. package/src/components/MenuBar.jsx +0 -561
  200. package/src/components/TiptapContainer.jsx +0 -235
  201. package/src/components/__tests__/AltDialog.test.jsx +0 -147
  202. package/src/components/__tests__/CharacterPicker.test.jsx +0 -270
  203. package/src/components/__tests__/CssIcon.test.jsx +0 -46
  204. package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
  205. package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -209
  206. package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
  207. package/src/components/__tests__/InlineDropdown.test.jsx +0 -557
  208. package/src/components/__tests__/InsertImageHandler.test.js +0 -161
  209. package/src/components/__tests__/MediaDialog.test.jsx +0 -293
  210. package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
  211. package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
  212. package/src/components/__tests__/MenuBar.test.jsx +0 -250
  213. package/src/components/__tests__/RespArea.test.jsx +0 -122
  214. package/src/components/__tests__/TableIcons.test.jsx +0 -149
  215. package/src/components/__tests__/TextAlign.test.jsx +0 -167
  216. package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
  217. package/src/components/__tests__/characterUtils.test.js +0 -166
  218. package/src/components/__tests__/choice.test.jsx +0 -171
  219. package/src/components/__tests__/custom-popper.test.jsx +0 -82
  220. package/src/components/__tests__/done-button.test.jsx +0 -54
  221. package/src/components/__tests__/toolbar-buttons.test.jsx +0 -234
  222. package/src/components/characters/characterUtils.js +0 -447
  223. package/src/components/characters/custom-popper.js +0 -38
  224. package/src/components/common/done-button.jsx +0 -27
  225. package/src/components/common/toolbar-buttons.jsx +0 -127
  226. package/src/components/icons/CssIcon.jsx +0 -15
  227. package/src/components/icons/RespArea.jsx +0 -71
  228. package/src/components/icons/TableIcons.jsx +0 -52
  229. package/src/components/icons/TextAlign.jsx +0 -114
  230. package/src/components/image/AltDialog.jsx +0 -82
  231. package/src/components/image/ImageToolbar.jsx +0 -99
  232. package/src/components/image/InsertImageHandler.js +0 -107
  233. package/src/components/media/MediaDialog.jsx +0 -596
  234. package/src/components/media/MediaToolbar.jsx +0 -49
  235. package/src/components/media/MediaWrapper.jsx +0 -39
  236. package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +0 -76
  237. package/src/components/respArea/DragInTheBlank/__tests__/choice.test.jsx +0 -72
  238. package/src/components/respArea/DragInTheBlank/choice.jsx +0 -259
  239. package/src/components/respArea/ExplicitConstructedResponse.jsx +0 -136
  240. package/src/components/respArea/InlineDropdown.jsx +0 -240
  241. package/src/components/respArea/MathTemplated.jsx +0 -124
  242. package/src/components/respArea/ToolbarIcon.jsx +0 -66
  243. package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
  244. package/src/components/respArea/inlineDropdownUtils.js +0 -79
  245. package/src/constants.js +0 -5
  246. package/src/extensions/__tests__/css.test.js +0 -196
  247. package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
  248. package/src/extensions/__tests__/divNode.test.js +0 -87
  249. package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
  250. package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
  251. package/src/extensions/__tests__/extended-list-item.test.js +0 -13
  252. package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
  253. package/src/extensions/__tests__/extended-table.test.js +0 -183
  254. package/src/extensions/__tests__/image-component.test.jsx +0 -346
  255. package/src/extensions/__tests__/image.test.js +0 -237
  256. package/src/extensions/__tests__/math.test.js +0 -900
  257. package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
  258. package/src/extensions/__tests__/media.test.js +0 -271
  259. package/src/extensions/__tests__/responseArea.test.js +0 -655
  260. package/src/extensions/css.js +0 -233
  261. package/src/extensions/custom-toolbar-wrapper.jsx +0 -78
  262. package/src/extensions/div-node.js +0 -86
  263. package/src/extensions/ensure-empty-root-div.js +0 -47
  264. package/src/extensions/ensure-list-item-content-is-div.js +0 -62
  265. package/src/extensions/extended-list-item.js +0 -10
  266. package/src/extensions/extended-table-cell.js +0 -19
  267. package/src/extensions/extended-table.js +0 -60
  268. package/src/extensions/heading-paragraph.js +0 -53
  269. package/src/extensions/image-component.jsx +0 -340
  270. package/src/extensions/image.js +0 -109
  271. package/src/extensions/index.js +0 -81
  272. package/src/extensions/math.js +0 -454
  273. package/src/extensions/media.js +0 -188
  274. package/src/extensions/responseArea.js +0 -407
  275. package/src/index.jsx +0 -5
  276. package/src/styles/editorContainerStyles.js +0 -145
  277. package/src/theme.js +0 -1
  278. package/src/utils/__tests__/helper.test.js +0 -126
  279. package/src/utils/__tests__/toolbar.test.js +0 -43
  280. package/src/utils/helper.js +0 -69
  281. package/src/utils/size.js +0 -32
  282. package/src/utils/toolbar.js +0 -15
@@ -0,0 +1,96 @@
1
+ import e from "react";
2
+ import { styled as t } from "@mui/material/styles";
3
+ import n from "prop-types";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { color as i } from "@pie-lib/render-ui";
6
+ import a from "debug";
7
+ //#region src/components/common/toolbar-buttons.tsx
8
+ var o = t("button", { shouldForwardProp: (e) => ![
9
+ "active",
10
+ "disabled",
11
+ "extraStyles"
12
+ ].includes(e) })(({ active: e, disabled: t }) => ({
13
+ color: e ? i.text() : i.disabled(),
14
+ display: "inline-flex",
15
+ padding: "2px",
16
+ background: "none",
17
+ border: "none",
18
+ cursor: t ? "not-allowed" : "pointer",
19
+ "& svg": {
20
+ width: "24px",
21
+ height: "24px"
22
+ },
23
+ "&:hover": { color: t ? i.disabled() : i.text() },
24
+ "&:focus": { outline: `2px solid ${i.buttonFocusOutline()}` },
25
+ ...t && { opacity: .7 }
26
+ })), s = a("pie-elements:editable-html:raw-button");
27
+ (class extends e.Component {
28
+ static propTypes = {
29
+ onClick: n.func.isRequired,
30
+ children: n.oneOfType([n.arrayOf(n.node), n.node]).isRequired,
31
+ active: n.bool,
32
+ disabled: n.bool,
33
+ extraStyles: n.object
34
+ };
35
+ constructor(e) {
36
+ super(e);
37
+ }
38
+ onClick = (e) => {
39
+ s("[onClick]"), e.preventDefault();
40
+ let { onClick: t } = this.props;
41
+ t(e);
42
+ };
43
+ onKeyDown = (e) => {
44
+ if (e.key === "Enter" || e.key === " ") {
45
+ s("[onKeyDown]"), e.preventDefault();
46
+ let { onClick: t } = this.props;
47
+ t(e);
48
+ }
49
+ };
50
+ render() {
51
+ let { active: e, children: t, disabled: n, extraStyles: i, ariaLabel: a } = this.props;
52
+ return /* @__PURE__ */ r(o, {
53
+ style: i,
54
+ active: e,
55
+ disabled: n,
56
+ onMouseDown: this.onClick,
57
+ onKeyDown: this.onKeyDown,
58
+ "aria-label": a,
59
+ "aria-pressed": e,
60
+ tabIndex: 0,
61
+ children: t
62
+ });
63
+ }
64
+ });
65
+ var c = class extends e.Component {
66
+ static propTypes = {
67
+ onToggle: n.func.isRequired,
68
+ mark: n.string,
69
+ label: n.string.isRequired,
70
+ children: n.oneOfType([n.arrayOf(n.node), n.node]).isRequired,
71
+ active: n.bool
72
+ };
73
+ constructor(e) {
74
+ super(e);
75
+ }
76
+ onToggle = (e) => {
77
+ e.preventDefault(), this.props.onToggle(this.props.mark);
78
+ };
79
+ onKeyDown = (e) => {
80
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.props.onToggle(this.props.mark));
81
+ };
82
+ render() {
83
+ let { children: e, active: t, label: n } = this.props;
84
+ return /* @__PURE__ */ r(o, {
85
+ active: t,
86
+ onMouseDown: this.onToggle,
87
+ "aria-pressed": t,
88
+ onKeyDown: this.onKeyDown,
89
+ "aria-label": n,
90
+ tabIndex: 0,
91
+ children: e
92
+ });
93
+ }
94
+ }, l = c;
95
+ //#endregion
96
+ export { l as MarkButton, c as RawMarkButton };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/icons/CssIcon.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 const CssIcon: () => React.JSX.Element;
11
+ export default CssIcon;
@@ -0,0 +1,14 @@
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/icons/CssIcon.tsx
5
+ var n = e("div")(({ theme: e }) => ({
6
+ fontFamily: "Cerebri Sans, Arial, sans-serif",
7
+ fontSize: e.typography.fontSize,
8
+ fontWeight: "bold",
9
+ lineHeight: "14px",
10
+ position: "relative",
11
+ whiteSpace: "nowrap"
12
+ })), r = () => /* @__PURE__ */ t(n, { children: "CSS" });
13
+ //#endregion
14
+ export { r as default };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/icons/RespArea.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
+ export declare const Chevron: {
12
+ (props: any): React.JSX.Element;
13
+ propTypes: {
14
+ direction: PropTypes.Requireable<string>;
15
+ style: PropTypes.Requireable<object>;
16
+ };
17
+ };
18
+ export declare const GripIcon: {
19
+ ({ style }: {
20
+ style: any;
21
+ }): React.JSX.Element;
22
+ propTypes: {
23
+ style: PropTypes.Requireable<object>;
24
+ };
25
+ };
26
+ export declare const ToolbarIcon: () => React.JSX.Element;
@@ -0,0 +1,42 @@
1
+ import "react";
2
+ import { styled as e } from "@mui/material/styles";
3
+ import t from "prop-types";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import i from "@mui/icons-material/ChevronRight";
6
+ import a from "@mui/icons-material/MoreVert";
7
+ //#region src/components/icons/RespArea.tsx
8
+ var o = (e) => {
9
+ switch (e) {
10
+ case "down": return 90;
11
+ case "up": return -90;
12
+ case "left": return 180;
13
+ default: return 0;
14
+ }
15
+ }, s = (e) => {
16
+ let { direction: t, style: r } = e;
17
+ return /* @__PURE__ */ n(i, { style: {
18
+ transform: `rotate(${o(t)}deg)`,
19
+ ...r
20
+ } });
21
+ };
22
+ s.propTypes = {
23
+ direction: t.string,
24
+ style: t.object
25
+ };
26
+ var c = ({ style: e }) => /* @__PURE__ */ r("span", {
27
+ style: e,
28
+ children: [/* @__PURE__ */ n(a, { style: { margin: "0 -16px" } }), /* @__PURE__ */ n(a, {})]
29
+ });
30
+ c.propTypes = { style: t.object }, e("div")(({ theme: e }) => ({
31
+ fontFamily: "Cerebri Sans !important",
32
+ fontSize: e.typography.fontSize,
33
+ fontWeight: "bold",
34
+ lineHeight: "14px",
35
+ position: "relative",
36
+ top: "7px",
37
+ width: "110px",
38
+ height: "28px",
39
+ whiteSpace: "nowrap"
40
+ }));
41
+ //#endregion
42
+ export { s as Chevron, c as GripIcon };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/icons/TableIcons.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 AddRow: (props: any) => React.JSX.Element;
11
+ export declare const RemoveRow: (props: any) => React.JSX.Element;
12
+ export declare const AddColumn: (props: any) => React.JSX.Element;
13
+ export declare const RemoveColumn: (props: any) => React.JSX.Element;
14
+ export declare const RemoveTable: (props: any) => React.JSX.Element;
@@ -0,0 +1,34 @@
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/icons/TableIcons.tsx
5
+ var n = e("path")({
6
+ fill: "grey",
7
+ "&:hover": { fill: "black" }
8
+ }), r = (e) => (n) => /* @__PURE__ */ t("svg", {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ version: "1.1",
11
+ width: "24",
12
+ height: "24",
13
+ viewBox: "0 0 24 24",
14
+ "aria-hidden": "true",
15
+ focusable: "false",
16
+ children: /* @__PURE__ */ t(e, { ...n })
17
+ }), i = r((e) => /* @__PURE__ */ t(n, {
18
+ ...e,
19
+ d: "M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z"
20
+ })), a = r((e) => /* @__PURE__ */ t(n, {
21
+ ...e,
22
+ d: "M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z"
23
+ })), o = r((e) => /* @__PURE__ */ t(n, {
24
+ ...e,
25
+ d: "M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z"
26
+ })), s = r((e) => /* @__PURE__ */ t(n, {
27
+ ...e,
28
+ d: "M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z"
29
+ })), c = r((e) => /* @__PURE__ */ t(n, {
30
+ ...e,
31
+ d: "M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z"
32
+ }));
33
+ //#endregion
34
+ export { o as AddColumn, i as AddRow, s as RemoveColumn, a as RemoveRow, c as RemoveTable };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/icons/TextAlign.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 AlignLeft: () => React.JSX.Element;
11
+ export declare const AlignRight: () => React.JSX.Element;
12
+ export declare const AlignCenter: () => React.JSX.Element;
13
+ export declare const AlignJustify: () => React.JSX.Element;
14
+ declare const _default: ({ editor, onChange }: {
15
+ editor: any;
16
+ onChange: any;
17
+ }) => React.JSX.Element;
18
+ export default _default;
@@ -0,0 +1,143 @@
1
+ import { useState as e } from "react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import r from "@mui/material/List";
4
+ import i from "@mui/material/ListItem";
5
+ import a from "@mui/material/Collapse";
6
+ //#region src/components/icons/TextAlign.tsx
7
+ var o = () => /* @__PURE__ */ t("svg", {
8
+ width: "20",
9
+ height: "20",
10
+ viewBox: "0 0 66 66",
11
+ fill: "none",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ "aria-hidden": "true",
14
+ focusable: "false",
15
+ children: /* @__PURE__ */ t("path", {
16
+ d: "M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z",
17
+ fill: "currentColor"
18
+ })
19
+ }), s = () => /* @__PURE__ */ t("svg", {
20
+ width: "20",
21
+ height: "20",
22
+ viewBox: "0 0 66 66",
23
+ fill: "none",
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ "aria-hidden": "true",
26
+ focusable: "false",
27
+ children: /* @__PURE__ */ t("path", {
28
+ d: "M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z",
29
+ fill: "currentColor"
30
+ })
31
+ }), c = () => /* @__PURE__ */ t("svg", {
32
+ width: "20",
33
+ height: "20",
34
+ viewBox: "0 0 66 66",
35
+ fill: "none",
36
+ xmlns: "http://www.w3.org/2000/svg",
37
+ "aria-hidden": "true",
38
+ focusable: "false",
39
+ children: /* @__PURE__ */ t("path", {
40
+ d: "M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z",
41
+ fill: "currentColor"
42
+ })
43
+ }), l = () => /* @__PURE__ */ t("svg", {
44
+ width: "20",
45
+ height: "20",
46
+ viewBox: "0 0 66 66",
47
+ fill: "none",
48
+ xmlns: "http://www.w3.org/2000/svg",
49
+ "aria-hidden": "true",
50
+ focusable: "false",
51
+ children: /* @__PURE__ */ t("path", {
52
+ d: "M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z",
53
+ fill: "currentColor"
54
+ })
55
+ }), u = ({ editor: u, onChange: d }) => {
56
+ let [f, p] = e(!1), m;
57
+ switch (!0) {
58
+ case u.isActive({ textAlign: "right" }):
59
+ m = /* @__PURE__ */ t(s, {});
60
+ break;
61
+ case u.isActive({ textAlign: "center" }):
62
+ m = /* @__PURE__ */ t(c, {});
63
+ break;
64
+ case u.isActive({ textAlign: "justify" }):
65
+ m = /* @__PURE__ */ t(l, {});
66
+ break;
67
+ default:
68
+ m = /* @__PURE__ */ t(o, {});
69
+ break;
70
+ }
71
+ let h = (e) => {
72
+ let t = e.currentTarget?.getAttribute("value");
73
+ t && u.commands.setTextAlign(t), p(!1);
74
+ };
75
+ return /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ n("div", {
76
+ style: {
77
+ display: "flex",
78
+ alignItems: "center"
79
+ },
80
+ onClick: (e) => {
81
+ e.preventDefault(), e.stopPropagation(), p(!f);
82
+ },
83
+ children: [m, /* @__PURE__ */ t("span", {
84
+ style: {
85
+ marginLeft: "5px",
86
+ fontSize: "8px"
87
+ },
88
+ "aria-hidden": "true",
89
+ children: "▼"
90
+ })]
91
+ }), /* @__PURE__ */ t(a, {
92
+ in: f,
93
+ timeout: "auto",
94
+ unmountOnExit: !0,
95
+ style: { position: "absolute" },
96
+ children: /* @__PURE__ */ n(r, {
97
+ component: "div",
98
+ disablePadding: !0,
99
+ style: {
100
+ background: "#fff",
101
+ display: "flex",
102
+ flexDirection: "row",
103
+ padding: 0
104
+ },
105
+ children: [
106
+ /* @__PURE__ */ t(i, {
107
+ button: !0,
108
+ type: "submit",
109
+ value: "left",
110
+ "aria-label": "Align text left",
111
+ onClick: h,
112
+ children: /* @__PURE__ */ t(o, {})
113
+ }),
114
+ /* @__PURE__ */ t(i, {
115
+ button: !0,
116
+ type: "submit",
117
+ value: "center",
118
+ "aria-label": "Align text center",
119
+ onClick: h,
120
+ children: /* @__PURE__ */ t(c, {})
121
+ }),
122
+ /* @__PURE__ */ t(i, {
123
+ button: !0,
124
+ type: "submit",
125
+ value: "right",
126
+ "aria-label": "Align text right",
127
+ onClick: h,
128
+ children: /* @__PURE__ */ t(s, {})
129
+ }),
130
+ /* @__PURE__ */ t(i, {
131
+ button: !0,
132
+ type: "submit",
133
+ value: "justify",
134
+ "aria-label": "Justify text",
135
+ onClick: h,
136
+ children: /* @__PURE__ */ t(l, {})
137
+ })
138
+ ]
139
+ })
140
+ })] });
141
+ };
142
+ //#endregion
143
+ export { c as AlignCenter, l as AlignJustify, o as AlignLeft, s as AlignRight, u as default };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/image/AltDialog.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
+ export declare class AltDialog extends React.Component {
12
+ static propTypes: {
13
+ onDone: PropTypes.Validator<(...args: any[]) => any>;
14
+ alt: PropTypes.Requireable<string>;
15
+ };
16
+ constructor(props: any);
17
+ closeDialog: any;
18
+ onDone: any;
19
+ handleOverflow: any;
20
+ render(): React.JSX.Element;
21
+ }
22
+ export default AltDialog;
@@ -0,0 +1,61 @@
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import i from "@mui/material/DialogContent";
5
+ import a from "@mui/icons-material/ArrowBackIos";
6
+ import o from "@mui/material/TextField";
7
+ import s from "@mui/material/DialogActions";
8
+ import c from "@mui/material/Button";
9
+ import l from "@mui/material/Dialog";
10
+ //#region src/components/image/AltDialog.tsx
11
+ var u = class extends e.Component {
12
+ static propTypes = {
13
+ onDone: t.func.isRequired,
14
+ alt: t.string
15
+ };
16
+ constructor(e) {
17
+ super(e);
18
+ let { alt: t } = e;
19
+ this.state = { value: t };
20
+ }
21
+ closeDialog = () => {
22
+ document.querySelectorAll("#text-dialog").forEach(function(e) {
23
+ return e.remove();
24
+ });
25
+ };
26
+ onDone = () => {
27
+ let { onDone: e } = this.props, { value: t } = this.state;
28
+ e(t), this.closeDialog();
29
+ };
30
+ handleOverflow = () => {
31
+ document.body.style.removeProperty("overflow");
32
+ };
33
+ render() {
34
+ let { value: e } = this.state;
35
+ return /* @__PURE__ */ r(l, {
36
+ open: !0,
37
+ disablePortal: !0,
38
+ onClose: this.closeDialog,
39
+ id: "text-dialog",
40
+ hideBackdrop: !0,
41
+ disableScrollLock: !0,
42
+ onEntered: this.handleOverflow,
43
+ children: [/* @__PURE__ */ n(i, { children: /* @__PURE__ */ r("div", {
44
+ style: { display: "flex" },
45
+ children: [/* @__PURE__ */ n(a, { style: { paddingTop: "6px" } }), /* @__PURE__ */ n(o, {
46
+ multiline: !0,
47
+ placeholder: "Enter an Alt Text description of this image",
48
+ helperText: "Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.",
49
+ value: e,
50
+ onChange: (e) => this.setState({ value: e.target.value }),
51
+ FormHelperTextProps: { style: { fontSize: 14 } }
52
+ })]
53
+ }) }), /* @__PURE__ */ n(s, { children: /* @__PURE__ */ n(c, {
54
+ onClick: this.onDone,
55
+ children: "Done"
56
+ }) })]
57
+ });
58
+ }
59
+ };
60
+ //#endregion
61
+ export { u as AltDialog, u as default };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/image/ImageToolbar.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 PropTypes from 'prop-types';
10
+ import React from 'react';
11
+ export declare class ImageToolbar extends React.Component {
12
+ static propTypes: {
13
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
14
+ alignment: PropTypes.Requireable<string>;
15
+ alt: PropTypes.Requireable<string>;
16
+ imageLoaded: PropTypes.Requireable<boolean>;
17
+ disableImageAlignmentButtons: PropTypes.Requireable<boolean>;
18
+ };
19
+ onAltTextDone: any;
20
+ onAlignmentClick: any;
21
+ renderDialog: any;
22
+ render(): React.JSX.Element;
23
+ }
24
+ export default ImageToolbar;
@@ -0,0 +1,80 @@
1
+ import { AltDialog as e } from "./AltDialog.js";
2
+ import { MarkButton as t } from "../common/toolbar-buttons.js";
3
+ import n from "react";
4
+ import { styled as r } from "@mui/material/styles";
5
+ import i from "react-dom";
6
+ import a from "prop-types";
7
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ import l from "debug";
9
+ //#region src/components/image/ImageToolbar.tsx
10
+ var u = l("@pie-lib:editable-html:plugins:image:image-toolbar"), d = r("div")(({ theme: e }) => ({
11
+ paddingLeft: e.spacing.unit,
12
+ display: "flex",
13
+ alignItems: "center"
14
+ })), f = r("span", { shouldForwardProp: (e) => !["disabled", "hasAlignmentButtons"].includes(e) })(({ disabled: e, hasAlignmentButtons: t }) => ({
15
+ ...e && { opacity: .5 },
16
+ ...t && {
17
+ borderLeft: "1px solid grey",
18
+ paddingLeft: 8,
19
+ marginLeft: 4
20
+ }
21
+ })), p = ({ alignment: e, active: n, onClick: r }) => /* @__PURE__ */ s(t, {
22
+ active: n,
23
+ onToggle: () => r(e),
24
+ label: e,
25
+ children: e
26
+ });
27
+ p.propTypes = {
28
+ alignment: a.string.isRequired,
29
+ active: a.bool.isRequired,
30
+ onClick: a.func.isRequired
31
+ };
32
+ var m = class extends n.Component {
33
+ static propTypes = {
34
+ onChange: a.func.isRequired,
35
+ alignment: a.string,
36
+ alt: a.string,
37
+ imageLoaded: a.bool,
38
+ disableImageAlignmentButtons: a.bool
39
+ };
40
+ onAltTextDone = (e) => {
41
+ u("[onAltTextDone]: alt:", e), this.props.onChange({ alt: e }, !0);
42
+ };
43
+ onAlignmentClick = (e) => {
44
+ u("[onAlignmentClick]: alignment:", e), this.props.onChange({ alignment: e });
45
+ };
46
+ renderDialog = () => {
47
+ let { alt: t } = this.props, n = document.createElement("div"), r = /* @__PURE__ */ s(e, {
48
+ alt: t,
49
+ onDone: this.onAltTextDone
50
+ });
51
+ i.render(r, n), document.body.appendChild(n);
52
+ };
53
+ render() {
54
+ let { alignment: e, imageLoaded: t, disableImageAlignmentButtons: n } = this.props;
55
+ return /* @__PURE__ */ c(d, { children: [!n && /* @__PURE__ */ c(o, { children: [
56
+ /* @__PURE__ */ s(p, {
57
+ alignment: "left",
58
+ active: e === "left",
59
+ onClick: this.onAlignmentClick
60
+ }),
61
+ /* @__PURE__ */ s(p, {
62
+ alignment: "center",
63
+ active: e === "center",
64
+ onClick: this.onAlignmentClick
65
+ }),
66
+ /* @__PURE__ */ s(p, {
67
+ alignment: "right",
68
+ active: e === "right",
69
+ onClick: this.onAlignmentClick
70
+ })
71
+ ] }), /* @__PURE__ */ s(f, {
72
+ disabled: !t,
73
+ hasAlignmentButtons: !n,
74
+ onMouseDown: (e) => t && this.renderDialog(e),
75
+ children: "Alt text"
76
+ })] });
77
+ }
78
+ };
79
+ //#endregion
80
+ export { m as ImageToolbar, m as default };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/editable-html-tip-tap/src/components/image/InsertImageHandler.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
+ * Handles user selection, insertion (or cancellation) of an image into the editor.
11
+ * @param {Block} placeholderBlock - a block that has been added to the editor as a place holder for the image
12
+ * @param {Function} onFinish - a function to call if uploading fails or succeeds
13
+ * @param {Function} getValue - a function to return the value of the editor
14
+ * @param {Function} onChange - callback to notify changes applied by the handler
15
+ * @param {Boolean} isPasted - a boolean that keeps track if the file is pasted
16
+ */
17
+ declare class InsertImageHandler {
18
+ constructor(editor: any, nodeInfo: any, onFinish: any, isPasted?: boolean);
19
+ cancel(): void;
20
+ updateNode(newAttrs: any): void;
21
+ deleteNode(): void;
22
+ done(err: any, src: any): void;
23
+ /**
24
+ * Notify handler that the user chose a file - will create a change with a preview in the editor.
25
+ *
26
+ * @param {File} file - the file that the user chose using a file input.
27
+ */
28
+ fileChosen(file: any): void;
29
+ progress(percent: any, bytes: any, total: any): void;
30
+ getChosenFile(): any;
31
+ }
32
+ export default InsertImageHandler;