@pie-lib/editable-html-tip-tap 2.1.1 → 2.1.2-next.0

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 (272) hide show
  1. package/dist/components/CharacterPicker.d.ts +31 -0
  2. package/dist/components/CharacterPicker.js +131 -0
  3. package/dist/components/EditableHtml.d.ts +11 -0
  4. package/dist/components/EditableHtml.js +291 -0
  5. package/dist/components/MenuBar.d.ts +11 -0
  6. package/dist/components/MenuBar.js +462 -0
  7. package/dist/components/TiptapContainer.d.ts +11 -0
  8. package/dist/components/TiptapContainer.js +154 -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 +91 -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 +32 -0
  23. package/dist/components/icons/TextAlign.d.ts +18 -0
  24. package/dist/components/icons/TextAlign.js +134 -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 +156 -0
  40. package/dist/components/respArea/ExplicitConstructedResponse.d.ts +20 -0
  41. package/dist/components/respArea/ExplicitConstructedResponse.js +83 -0
  42. package/dist/components/respArea/InlineDropdown.d.ts +18 -0
  43. package/dist/components/respArea/InlineDropdown.js +119 -0
  44. package/dist/components/respArea/MathTemplated.d.ts +19 -0
  45. package/dist/components/respArea/MathTemplated.js +97 -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 +115 -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 +220 -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 +65 -0
  76. package/dist/extensions/math.d.ts +15 -0
  77. package/dist/extensions/math.js +158 -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 +259 -0
  82. package/dist/index.d.ts +13 -0
  83. package/dist/index.js +7 -0
  84. package/dist/styles/editorContainerStyles.d.ts +134 -0
  85. package/dist/theme.d.ts +9 -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/package.json +51 -38
  91. package/CHANGELOG.json +0 -32
  92. package/CHANGELOG.md +0 -2532
  93. package/LICENSE.md +0 -5
  94. package/lib/components/CharacterPicker.js +0 -195
  95. package/lib/components/CharacterPicker.js.map +0 -1
  96. package/lib/components/EditableHtml.js +0 -375
  97. package/lib/components/EditableHtml.js.map +0 -1
  98. package/lib/components/MenuBar.js +0 -693
  99. package/lib/components/MenuBar.js.map +0 -1
  100. package/lib/components/TiptapContainer.js +0 -234
  101. package/lib/components/TiptapContainer.js.map +0 -1
  102. package/lib/components/characters/characterUtils.js +0 -378
  103. package/lib/components/characters/characterUtils.js.map +0 -1
  104. package/lib/components/characters/custom-popper.js +0 -44
  105. package/lib/components/characters/custom-popper.js.map +0 -1
  106. package/lib/components/common/done-button.js +0 -34
  107. package/lib/components/common/done-button.js.map +0 -1
  108. package/lib/components/common/toolbar-buttons.js +0 -144
  109. package/lib/components/common/toolbar-buttons.js.map +0 -1
  110. package/lib/components/icons/CssIcon.js +0 -25
  111. package/lib/components/icons/CssIcon.js.map +0 -1
  112. package/lib/components/icons/RespArea.js +0 -72
  113. package/lib/components/icons/RespArea.js.map +0 -1
  114. package/lib/components/icons/TableIcons.js +0 -53
  115. package/lib/components/icons/TableIcons.js.map +0 -1
  116. package/lib/components/icons/TextAlign.js +0 -157
  117. package/lib/components/icons/TextAlign.js.map +0 -1
  118. package/lib/components/image/AltDialog.js +0 -98
  119. package/lib/components/image/AltDialog.js.map +0 -1
  120. package/lib/components/image/ImageToolbar.js +0 -137
  121. package/lib/components/image/ImageToolbar.js.map +0 -1
  122. package/lib/components/image/InsertImageHandler.js +0 -135
  123. package/lib/components/image/InsertImageHandler.js.map +0 -1
  124. package/lib/components/media/MediaDialog.js +0 -594
  125. package/lib/components/media/MediaDialog.js.map +0 -1
  126. package/lib/components/media/MediaToolbar.js +0 -74
  127. package/lib/components/media/MediaToolbar.js.map +0 -1
  128. package/lib/components/media/MediaWrapper.js +0 -67
  129. package/lib/components/media/MediaWrapper.js.map +0 -1
  130. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -84
  131. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +0 -1
  132. package/lib/components/respArea/DragInTheBlank/choice.js +0 -250
  133. package/lib/components/respArea/DragInTheBlank/choice.js.map +0 -1
  134. package/lib/components/respArea/ExplicitConstructedResponse.js +0 -136
  135. package/lib/components/respArea/ExplicitConstructedResponse.js.map +0 -1
  136. package/lib/components/respArea/InlineDropdown.js +0 -165
  137. package/lib/components/respArea/InlineDropdown.js.map +0 -1
  138. package/lib/components/respArea/MathTemplated.js +0 -130
  139. package/lib/components/respArea/MathTemplated.js.map +0 -1
  140. package/lib/components/respArea/ToolbarIcon.js +0 -81
  141. package/lib/components/respArea/ToolbarIcon.js.map +0 -1
  142. package/lib/constants.js +0 -11
  143. package/lib/constants.js.map +0 -1
  144. package/lib/extensions/css.js +0 -217
  145. package/lib/extensions/css.js.map +0 -1
  146. package/lib/extensions/custom-toolbar-wrapper.js +0 -92
  147. package/lib/extensions/custom-toolbar-wrapper.js.map +0 -1
  148. package/lib/extensions/div-node.js +0 -83
  149. package/lib/extensions/div-node.js.map +0 -1
  150. package/lib/extensions/ensure-empty-root-div.js +0 -48
  151. package/lib/extensions/ensure-empty-root-div.js.map +0 -1
  152. package/lib/extensions/ensure-list-item-content-is-div.js +0 -64
  153. package/lib/extensions/ensure-list-item-content-is-div.js.map +0 -1
  154. package/lib/extensions/extended-list-item.js +0 -15
  155. package/lib/extensions/extended-list-item.js.map +0 -1
  156. package/lib/extensions/extended-table-cell.js +0 -22
  157. package/lib/extensions/extended-table-cell.js.map +0 -1
  158. package/lib/extensions/extended-table.js +0 -75
  159. package/lib/extensions/extended-table.js.map +0 -1
  160. package/lib/extensions/heading-paragraph.js +0 -61
  161. package/lib/extensions/heading-paragraph.js.map +0 -1
  162. package/lib/extensions/image-component.js +0 -348
  163. package/lib/extensions/image-component.js.map +0 -1
  164. package/lib/extensions/image.js +0 -134
  165. package/lib/extensions/image.js.map +0 -1
  166. package/lib/extensions/index.js +0 -46
  167. package/lib/extensions/index.js.map +0 -1
  168. package/lib/extensions/math.js +0 -343
  169. package/lib/extensions/math.js.map +0 -1
  170. package/lib/extensions/media.js +0 -243
  171. package/lib/extensions/media.js.map +0 -1
  172. package/lib/extensions/responseArea.js +0 -446
  173. package/lib/extensions/responseArea.js.map +0 -1
  174. package/lib/index.js +0 -30
  175. package/lib/index.js.map +0 -1
  176. package/lib/styles/editorContainerStyles.js +0 -137
  177. package/lib/styles/editorContainerStyles.js.map +0 -1
  178. package/lib/theme.js +0 -8
  179. package/lib/theme.js.map +0 -1
  180. package/lib/utils/helper.js +0 -73
  181. package/lib/utils/helper.js.map +0 -1
  182. package/lib/utils/size.js +0 -26
  183. package/lib/utils/size.js.map +0 -1
  184. package/src/__tests__/EditableHtml.test.jsx +0 -474
  185. package/src/__tests__/constants.test.js +0 -19
  186. package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
  187. package/src/__tests__/extensions.test.js +0 -208
  188. package/src/__tests__/index.test.jsx +0 -154
  189. package/src/__tests__/size-utils.test.js +0 -64
  190. package/src/__tests__/theme.test.js +0 -17
  191. package/src/components/CharacterPicker.jsx +0 -200
  192. package/src/components/EditableHtml.jsx +0 -438
  193. package/src/components/MenuBar.jsx +0 -549
  194. package/src/components/TiptapContainer.jsx +0 -219
  195. package/src/components/__tests__/AltDialog.test.jsx +0 -147
  196. package/src/components/__tests__/CharacterPicker.test.jsx +0 -219
  197. package/src/components/__tests__/CssIcon.test.jsx +0 -46
  198. package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
  199. package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -204
  200. package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
  201. package/src/components/__tests__/InlineDropdown.test.jsx +0 -380
  202. package/src/components/__tests__/InsertImageHandler.test.js +0 -161
  203. package/src/components/__tests__/MediaDialog.test.jsx +0 -293
  204. package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
  205. package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
  206. package/src/components/__tests__/MenuBar.test.jsx +0 -249
  207. package/src/components/__tests__/RespArea.test.jsx +0 -122
  208. package/src/components/__tests__/TableIcons.test.jsx +0 -149
  209. package/src/components/__tests__/TextAlign.test.jsx +0 -167
  210. package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
  211. package/src/components/__tests__/characterUtils.test.js +0 -166
  212. package/src/components/__tests__/choice.test.jsx +0 -171
  213. package/src/components/__tests__/custom-popper.test.jsx +0 -82
  214. package/src/components/__tests__/done-button.test.jsx +0 -54
  215. package/src/components/__tests__/toolbar-buttons.test.jsx +0 -234
  216. package/src/components/characters/characterUtils.js +0 -447
  217. package/src/components/characters/custom-popper.js +0 -38
  218. package/src/components/common/done-button.jsx +0 -27
  219. package/src/components/common/toolbar-buttons.jsx +0 -122
  220. package/src/components/icons/CssIcon.jsx +0 -15
  221. package/src/components/icons/RespArea.jsx +0 -71
  222. package/src/components/icons/TableIcons.jsx +0 -52
  223. package/src/components/icons/TextAlign.jsx +0 -114
  224. package/src/components/image/AltDialog.jsx +0 -82
  225. package/src/components/image/ImageToolbar.jsx +0 -99
  226. package/src/components/image/InsertImageHandler.js +0 -107
  227. package/src/components/media/MediaDialog.jsx +0 -596
  228. package/src/components/media/MediaToolbar.jsx +0 -49
  229. package/src/components/media/MediaWrapper.jsx +0 -39
  230. package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +0 -76
  231. package/src/components/respArea/DragInTheBlank/choice.jsx +0 -256
  232. package/src/components/respArea/ExplicitConstructedResponse.jsx +0 -135
  233. package/src/components/respArea/InlineDropdown.jsx +0 -167
  234. package/src/components/respArea/MathTemplated.jsx +0 -124
  235. package/src/components/respArea/ToolbarIcon.jsx +0 -66
  236. package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
  237. package/src/constants.js +0 -5
  238. package/src/extensions/__tests__/css.test.js +0 -196
  239. package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
  240. package/src/extensions/__tests__/divNode.test.js +0 -87
  241. package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
  242. package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
  243. package/src/extensions/__tests__/extended-list-item.test.js +0 -13
  244. package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
  245. package/src/extensions/__tests__/extended-table.test.js +0 -183
  246. package/src/extensions/__tests__/image-component.test.jsx +0 -345
  247. package/src/extensions/__tests__/image.test.js +0 -237
  248. package/src/extensions/__tests__/math.test.js +0 -459
  249. package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
  250. package/src/extensions/__tests__/media.test.js +0 -271
  251. package/src/extensions/__tests__/responseArea.test.js +0 -601
  252. package/src/extensions/css.js +0 -220
  253. package/src/extensions/custom-toolbar-wrapper.jsx +0 -78
  254. package/src/extensions/div-node.js +0 -86
  255. package/src/extensions/ensure-empty-root-div.js +0 -47
  256. package/src/extensions/ensure-list-item-content-is-div.js +0 -62
  257. package/src/extensions/extended-list-item.js +0 -10
  258. package/src/extensions/extended-table-cell.js +0 -19
  259. package/src/extensions/extended-table.js +0 -60
  260. package/src/extensions/heading-paragraph.js +0 -53
  261. package/src/extensions/image-component.jsx +0 -338
  262. package/src/extensions/image.js +0 -109
  263. package/src/extensions/index.js +0 -81
  264. package/src/extensions/math.js +0 -327
  265. package/src/extensions/media.js +0 -188
  266. package/src/extensions/responseArea.js +0 -401
  267. package/src/index.jsx +0 -5
  268. package/src/styles/editorContainerStyles.js +0 -145
  269. package/src/theme.js +0 -1
  270. package/src/utils/__tests__/helper.test.js +0 -126
  271. package/src/utils/helper.js +0 -69
  272. package/src/utils/size.js +0 -32
@@ -1,446 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ResponseAreaExtension = exports.MathTemplatedNode = exports.InlineDropdownNode = exports.ExplicitConstructedResponseNode = exports.DragInTheBlankNode = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _prosemirrorState = require("prosemirror-state");
11
- var _core = require("@tiptap/core");
12
- var _react2 = require("@tiptap/react");
13
- var _ExplicitConstructedResponse = _interopRequireDefault(require("../components/respArea/ExplicitConstructedResponse"));
14
- var _DragInTheBlank = _interopRequireDefault(require("../components/respArea/DragInTheBlank/DragInTheBlank"));
15
- var _InlineDropdown = _interopRequireDefault(require("../components/respArea/InlineDropdown"));
16
- var _MathTemplated = _interopRequireDefault(require("../components/respArea/MathTemplated"));
17
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- var lastIndexMap = {};
20
- var normalizeType = function normalizeType(type) {
21
- return String(type || '').replace(/-/g, '_');
22
- };
23
- var getAttrIndex = function getAttrIndex(node) {
24
- return node && node.attrs && node.attrs.index != null ? String(node.attrs.index) : null;
25
- };
26
- var collectNodesOfType = function collectNodesOfType(doc, typeName) {
27
- var results = [];
28
- doc.descendants(function (node, pos) {
29
- if (node.type && node.type.name === typeName) {
30
- var index = getAttrIndex(node);
31
- if (index != null) results.push({
32
- index: index,
33
- pos: pos,
34
- node: node
35
- });
36
- }
37
- return true;
38
- });
39
- return results;
40
- };
41
- var countNodesOfType = function countNodesOfType(doc, typeName) {
42
- var count = 0;
43
- doc.descendants(function (node) {
44
- if (node.type && node.type.name === typeName) count += 1;
45
- return true;
46
- });
47
- return count;
48
- };
49
- var getDefaultNode = function getDefaultNode(_ref) {
50
- var schema = _ref.schema,
51
- typeName = _ref.typeName,
52
- index = _ref.index;
53
- var nodeType = schema.nodes[typeName];
54
- if (!nodeType) return null;
55
-
56
- // mirror your Slate "getDefaultElement(opts, newIndex)"
57
- // customize attrs as needed:
58
- return nodeType.create({
59
- index: String(index),
60
- id: String(index),
61
- value: ''
62
- });
63
- };
64
-
65
- // Find a good cursor position *after* an inserted node.
66
- var selectionAfterPos = function selectionAfterPos(doc, pos) {
67
- var $pos = doc.resolve(Math.min(pos, doc.content.size));
68
- return _prosemirrorState.TextSelection.near($pos, 1);
69
- };
70
- var ResponseAreaExtension = exports.ResponseAreaExtension = _core.Extension.create({
71
- name: 'responseArea',
72
- addOptions: function addOptions() {
73
- return {
74
- maxResponseAreas: null,
75
- error: null,
76
- options: null,
77
- respAreaToolbar: null,
78
- onHandleAreaChange: null
79
- };
80
- },
81
- addProseMirrorPlugins: function addProseMirrorPlugins() {
82
- var _this = this;
83
- if (!this.options.type) {
84
- return [];
85
- }
86
- var typeName = normalizeType(this.options.type);
87
- var key = new _prosemirrorState.PluginKey("response-area-watcher:".concat(typeName));
88
- return [new _prosemirrorState.Plugin({
89
- key: key,
90
- view: function view(_view) {
91
- // Lazy init lastIndexMap[typeName]
92
- if (lastIndexMap[typeName] === undefined) {
93
- lastIndexMap[typeName] = 0;
94
- _view.state.doc.descendants(function (node) {
95
- if (node.type && node.type.name === typeName) {
96
- var idx = getAttrIndex(node);
97
- if (idx != null) {
98
- var n = parseInt(idx, 10);
99
- if (!Number.isNaN(n) && n > lastIndexMap[typeName]) {
100
- lastIndexMap[typeName] = n;
101
- }
102
- }
103
- }
104
- return true;
105
- });
106
- }
107
- return {
108
- update: function update(view, prevState) {
109
- var state = view.state;
110
- if (prevState.doc.eq(state.doc)) return;
111
- var currentList = collectNodesOfType(state.doc, typeName);
112
- var oldList = collectNodesOfType(prevState.doc, typeName);
113
- if (_this.options.toolbar) {
114
- _this.options.toolbar.disabled = currentList.length >= _this.options.maxResponseAreas;
115
- }
116
-
117
- // Removed elements (same logic as Slate)
118
- if (oldList.length > currentList.length) {
119
- var currentIndexSet = new Set(currentList.map(function (x) {
120
- return x.index;
121
- }));
122
- var removed = oldList.filter(function (x) {
123
- return !currentIndexSet.has(x.index);
124
- });
125
- if (removed.length && typeof _this.options.onHandleAreaChange === 'function') {
126
- _this.options.onHandleAreaChange(removed);
127
- }
128
- }
129
- }
130
- };
131
- }
132
- })];
133
- },
134
- addCommands: function addCommands() {
135
- var _this2 = this;
136
- return {
137
- insertResponseArea: function insertResponseArea(type) {
138
- return function (_ref2) {
139
- var tr = _ref2.tr,
140
- state = _ref2.state,
141
- dispatch = _ref2.dispatch,
142
- commands = _ref2.commands;
143
- var typeName = normalizeType(type);
144
-
145
- // --- Slate: currentRespAreaList + max check ---
146
- var currentCount = countNodesOfType(state.doc, typeName);
147
- if (currentCount >= _this2.options.maxResponseAreas) {
148
- return false;
149
- }
150
-
151
- // --- Slate: indexing logic (kept identical) ---
152
- if (lastIndexMap[typeName] === undefined) {
153
- lastIndexMap[typeName] = 0;
154
- }
155
- var prevIndex = lastIndexMap[typeName];
156
- var newIndex = prevIndex + 1;
157
-
158
- // Slate increments map even if newIndex === 0
159
- lastIndexMap[typeName] += 1;
160
- var newInline = getDefaultNode({
161
- schema: state.schema,
162
- typeName: typeName,
163
- index: newIndex
164
- });
165
- if (!newInline) {
166
- return false;
167
- }
168
-
169
- // --- Insert logic ---
170
- var selection = state.selection;
171
- var insertPos = selection.from;
172
-
173
- // If we're in a NodeSelection, insert before/after is ambiguous;
174
- // We'll insert at its "from" (like your current code).
175
- // If insertion fails, we fallback to end of doc.
176
- var tryInsertAt = function tryInsertAt(pos) {
177
- try {
178
- tr.insert(pos, newInline);
179
- return pos;
180
- } catch (e) {
181
- return null;
182
- }
183
- };
184
- var usedPos = tryInsertAt(insertPos);
185
-
186
- // Slate branch: "markup empty and there's no focus"
187
- // ProseMirror doesn't expose "no focus" the same way, so the closest
188
- // equivalent fallback is inserting at end of document.
189
- if (usedPos == null) {
190
- usedPos = tryInsertAt(tr.doc.content.size);
191
- }
192
- if (usedPos == null) {
193
- return false;
194
- }
195
-
196
- // Optionally select the node you just inserted (like your original command)
197
- // tr.setSelection(NodeSelection.create(tr.doc, usedPos))
198
-
199
- // --- Cursor move behavior for certain types (Slate: moveFocusTo next text) ---
200
- if (['math_templated', 'inline_dropdown', 'explicit_constructed_response'].includes(typeName)) {
201
- tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, usedPos));
202
- } else {
203
- var after = usedPos + newInline.nodeSize;
204
- tr.setSelection(selectionAfterPos(tr.doc, after));
205
- }
206
- if (dispatch) {
207
- commands.focus();
208
- dispatch(tr);
209
- }
210
- return true;
211
- };
212
- },
213
- refreshResponseArea: function refreshResponseArea() {
214
- return function (_ref3) {
215
- var tr = _ref3.tr,
216
- state = _ref3.state,
217
- commands = _ref3.commands,
218
- dispatch = _ref3.dispatch;
219
- var selection = state.selection;
220
- var node = selection.$from.nodeAfter;
221
- var nodePos = selection.from;
222
- tr.setNodeMarkup(nodePos, undefined, _objectSpread(_objectSpread({}, node === null || node === void 0 ? void 0 : node.attrs), {}, {
223
- updated: "".concat(Date.now())
224
- }));
225
- tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, nodePos));
226
- if (dispatch) {
227
- commands.focus();
228
- dispatch(tr);
229
- }
230
- return true;
231
- };
232
- }
233
- };
234
- }
235
- });
236
-
237
- /**
238
- * ExplicitConstructedResponse Node
239
- */
240
- var ExplicitConstructedResponseNode = exports.ExplicitConstructedResponseNode = _react2.Node.create({
241
- name: 'explicit_constructed_response',
242
- group: 'inline',
243
- inline: true,
244
- atom: true,
245
- addAttributes: function addAttributes() {
246
- return {
247
- index: {
248
- "default": null
249
- },
250
- value: {
251
- "default": ''
252
- },
253
- updated: {
254
- "default": ''
255
- }
256
- };
257
- },
258
- parseHTML: function parseHTML() {
259
- return [{
260
- tag: 'span[data-type="explicit_constructed_response"]',
261
- getAttrs: function getAttrs(el) {
262
- return {
263
- index: el.dataset.index,
264
- value: el.dataset.value
265
- };
266
- }
267
- }];
268
- },
269
- renderHTML: function renderHTML(_ref4) {
270
- var HTMLAttributes = _ref4.HTMLAttributes;
271
- return ['span', {
272
- 'data-type': 'explicit_constructed_response',
273
- 'data-index': HTMLAttributes.index,
274
- 'data-value': HTMLAttributes.value
275
- }];
276
- },
277
- addNodeView: function addNodeView() {
278
- var _this3 = this;
279
- return (0, _react2.ReactNodeViewRenderer)(function (props) {
280
- return /*#__PURE__*/_react["default"].createElement(_ExplicitConstructedResponse["default"], _objectSpread(_objectSpread({}, props), {}, {
281
- options: _this3.options
282
- }));
283
- });
284
- }
285
- });
286
-
287
- /**
288
- * MathTemplated Node
289
- */
290
- var MathTemplatedNode = exports.MathTemplatedNode = _react2.Node.create({
291
- name: 'math_templated',
292
- group: 'inline',
293
- inline: true,
294
- atom: true,
295
- addAttributes: function addAttributes() {
296
- return {
297
- index: {
298
- "default": null
299
- },
300
- value: {
301
- "default": ''
302
- },
303
- updated: {
304
- "default": ''
305
- }
306
- };
307
- },
308
- parseHTML: function parseHTML() {
309
- return [{
310
- tag: 'span[data-type="math_templated"]',
311
- getAttrs: function getAttrs(el) {
312
- return {
313
- index: el.dataset.index,
314
- value: el.dataset.value
315
- };
316
- }
317
- }];
318
- },
319
- renderHTML: function renderHTML(_ref5) {
320
- var HTMLAttributes = _ref5.HTMLAttributes;
321
- return ['span', {
322
- 'data-type': 'math_templated',
323
- 'data-index': HTMLAttributes.index,
324
- 'data-value': HTMLAttributes.value
325
- }];
326
- },
327
- addNodeView: function addNodeView() {
328
- var _this4 = this;
329
- return (0, _react2.ReactNodeViewRenderer)(function (props) {
330
- return /*#__PURE__*/_react["default"].createElement(_MathTemplated["default"], _objectSpread(_objectSpread({}, props), {}, {
331
- options: _this4.options
332
- }));
333
- });
334
- }
335
- });
336
-
337
- /**
338
- * DragInTheBlank Node
339
- */
340
- var DragInTheBlankNode = exports.DragInTheBlankNode = _react2.Node.create({
341
- name: 'drag_in_the_blank',
342
- group: 'inline',
343
- inline: true,
344
- atom: true,
345
- addAttributes: function addAttributes() {
346
- return {
347
- index: {
348
- "default": null
349
- },
350
- id: {
351
- "default": null
352
- },
353
- value: {
354
- "default": ''
355
- },
356
- inTable: {
357
- "default": null
358
- },
359
- updated: {
360
- "default": ''
361
- }
362
- };
363
- },
364
- parseHTML: function parseHTML() {
365
- return [{
366
- tag: 'span[data-type="drag_in_the_blank"]',
367
- getAttrs: function getAttrs(el) {
368
- return {
369
- index: el.dataset.index,
370
- id: el.dataset.id,
371
- value: el.dataset.value,
372
- inTable: el.dataset.inTable
373
- };
374
- }
375
- }];
376
- },
377
- renderHTML: function renderHTML(_ref6) {
378
- var HTMLAttributes = _ref6.HTMLAttributes;
379
- return ['span', {
380
- 'data-type': 'drag_in_the_blank',
381
- 'data-index': HTMLAttributes.index,
382
- 'data-id': HTMLAttributes.id,
383
- 'data-value': HTMLAttributes.value,
384
- 'data-in-table': HTMLAttributes.inTable
385
- }];
386
- },
387
- addNodeView: function addNodeView() {
388
- var _this5 = this;
389
- return (0, _react2.ReactNodeViewRenderer)(function (props) {
390
- return /*#__PURE__*/_react["default"].createElement(_DragInTheBlank["default"], _objectSpread(_objectSpread({}, props), {}, {
391
- options: _this5.options
392
- }));
393
- });
394
- }
395
- });
396
-
397
- /**
398
- * InlineDropdown Node
399
- */
400
- var InlineDropdownNode = exports.InlineDropdownNode = _react2.Node.create({
401
- name: 'inline_dropdown',
402
- group: 'inline',
403
- inline: true,
404
- atom: true,
405
- addAttributes: function addAttributes() {
406
- return {
407
- index: {
408
- "default": null
409
- },
410
- value: {
411
- "default": ''
412
- },
413
- updated: {
414
- "default": ''
415
- }
416
- };
417
- },
418
- parseHTML: function parseHTML() {
419
- return [{
420
- tag: 'span[data-type="inline_dropdown"]',
421
- getAttrs: function getAttrs(el) {
422
- return {
423
- index: el.dataset.index,
424
- value: el.dataset.value
425
- };
426
- }
427
- }];
428
- },
429
- renderHTML: function renderHTML(_ref7) {
430
- var HTMLAttributes = _ref7.HTMLAttributes;
431
- return ['span', {
432
- 'data-type': 'inline_dropdown',
433
- 'data-index': HTMLAttributes.index,
434
- 'data-value': HTMLAttributes.value
435
- }];
436
- },
437
- addNodeView: function addNodeView() {
438
- var _this6 = this;
439
- return (0, _react2.ReactNodeViewRenderer)(function (props) {
440
- return /*#__PURE__*/_react["default"].createElement(_InlineDropdown["default"], _objectSpread(_objectSpread({}, props), {}, {
441
- options: _this6.options
442
- }));
443
- });
444
- }
445
- });
446
- //# sourceMappingURL=responseArea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responseArea.js","names":["_react","_interopRequireDefault","require","_prosemirrorState","_core","_react2","_ExplicitConstructedResponse","_DragInTheBlank","_InlineDropdown","_MathTemplated","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","lastIndexMap","normalizeType","type","String","replace","getAttrIndex","node","attrs","index","collectNodesOfType","doc","typeName","results","descendants","pos","name","countNodesOfType","count","getDefaultNode","_ref","schema","nodeType","nodes","create","id","value","selectionAfterPos","$pos","resolve","Math","min","content","size","TextSelection","near","ResponseAreaExtension","exports","Extension","addOptions","maxResponseAreas","error","options","respAreaToolbar","onHandleAreaChange","addProseMirrorPlugins","_this","key","PluginKey","concat","Plugin","view","undefined","state","idx","n","parseInt","Number","isNaN","update","prevState","eq","currentList","oldList","toolbar","disabled","currentIndexSet","Set","map","x","removed","has","addCommands","_this2","insertResponseArea","_ref2","tr","dispatch","commands","currentCount","prevIndex","newIndex","newInline","selection","insertPos","from","tryInsertAt","insert","usedPos","includes","setSelection","NodeSelection","after","nodeSize","focus","refreshResponseArea","_ref3","$from","nodeAfter","nodePos","setNodeMarkup","updated","Date","now","ExplicitConstructedResponseNode","Node","group","inline","atom","addAttributes","parseHTML","tag","getAttrs","el","dataset","renderHTML","_ref4","HTMLAttributes","addNodeView","_this3","ReactNodeViewRenderer","props","createElement","MathTemplatedNode","_ref5","_this4","DragInTheBlankNode","inTable","_ref6","_this5","InlineDropdownNode","_ref7","_this6"],"sources":["../../src/extensions/responseArea.js"],"sourcesContent":["import React from 'react';\nimport { NodeSelection, Plugin, PluginKey, TextSelection } from 'prosemirror-state';\nimport { Extension } from '@tiptap/core';\nimport { Node, ReactNodeViewRenderer } from '@tiptap/react';\nimport ExplicitConstructedResponse from '../components/respArea/ExplicitConstructedResponse';\nimport DragInTheBlank from '../components/respArea/DragInTheBlank/DragInTheBlank';\nimport InlineDropdown from '../components/respArea/InlineDropdown';\nimport MathTemplated from '../components/respArea/MathTemplated';\n\nconst lastIndexMap = {};\n\nconst normalizeType = (type) => String(type || '').replace(/-/g, '_');\n\nconst getAttrIndex = (node) => (node && node.attrs && node.attrs.index != null ? String(node.attrs.index) : null);\n\nconst collectNodesOfType = (doc, typeName) => {\n const results = [];\n\n doc.descendants((node, pos) => {\n if (node.type && node.type.name === typeName) {\n const index = getAttrIndex(node);\n if (index != null) results.push({ index, pos, node });\n }\n return true;\n });\n\n return results;\n};\n\nconst countNodesOfType = (doc, typeName) => {\n let count = 0;\n doc.descendants((node) => {\n if (node.type && node.type.name === typeName) count += 1;\n return true;\n });\n return count;\n};\n\nconst getDefaultNode = ({ schema, typeName, index }) => {\n const nodeType = schema.nodes[typeName];\n if (!nodeType) return null;\n\n // mirror your Slate \"getDefaultElement(opts, newIndex)\"\n // customize attrs as needed:\n return nodeType.create({\n index: String(index),\n id: String(index),\n value: '',\n });\n};\n\n// Find a good cursor position *after* an inserted node.\nconst selectionAfterPos = (doc, pos) => {\n const $pos = doc.resolve(Math.min(pos, doc.content.size));\n return TextSelection.near($pos, 1);\n};\n\nexport const ResponseAreaExtension = Extension.create({\n name: 'responseArea',\n\n addOptions() {\n return {\n maxResponseAreas: null,\n error: null,\n options: null,\n respAreaToolbar: null,\n onHandleAreaChange: null,\n };\n },\n\n addProseMirrorPlugins() {\n if (!this.options.type) {\n return [];\n }\n\n const typeName = normalizeType(this.options.type);\n const key = new PluginKey(`response-area-watcher:${typeName}`);\n\n return [\n new Plugin({\n key,\n\n view: (view) => {\n // Lazy init lastIndexMap[typeName]\n if (lastIndexMap[typeName] === undefined) {\n lastIndexMap[typeName] = 0;\n\n view.state.doc.descendants((node) => {\n if (node.type && node.type.name === typeName) {\n const idx = getAttrIndex(node);\n if (idx != null) {\n const n = parseInt(idx, 10);\n if (!Number.isNaN(n) && n > lastIndexMap[typeName]) {\n lastIndexMap[typeName] = n;\n }\n }\n }\n return true;\n });\n }\n\n return {\n update: (view, prevState) => {\n const state = view.state;\n if (prevState.doc.eq(state.doc)) return;\n\n const currentList = collectNodesOfType(state.doc, typeName);\n const oldList = collectNodesOfType(prevState.doc, typeName);\n\n if (this.options.toolbar) {\n this.options.toolbar.disabled = currentList.length >= this.options.maxResponseAreas;\n }\n\n // Removed elements (same logic as Slate)\n if (oldList.length > currentList.length) {\n const currentIndexSet = new Set(currentList.map((x) => x.index));\n\n const removed = oldList.filter((x) => !currentIndexSet.has(x.index));\n\n if (removed.length && typeof this.options.onHandleAreaChange === 'function') {\n this.options.onHandleAreaChange(removed);\n }\n }\n },\n };\n },\n }),\n ];\n },\n\n addCommands() {\n return {\n insertResponseArea:\n (type) =>\n ({ tr, state, dispatch, commands }) => {\n const typeName = normalizeType(type);\n\n // --- Slate: currentRespAreaList + max check ---\n const currentCount = countNodesOfType(state.doc, typeName);\n if (currentCount >= this.options.maxResponseAreas) {\n return false;\n }\n\n // --- Slate: indexing logic (kept identical) ---\n if (lastIndexMap[typeName] === undefined) {\n lastIndexMap[typeName] = 0;\n }\n\n const prevIndex = lastIndexMap[typeName];\n const newIndex = prevIndex + 1;\n\n // Slate increments map even if newIndex === 0\n lastIndexMap[typeName] += 1;\n\n const newInline = getDefaultNode({\n schema: state.schema,\n typeName,\n index: newIndex,\n });\n\n if (!newInline) {\n return false;\n }\n\n // --- Insert logic ---\n const { selection } = state;\n let insertPos = selection.from;\n\n // If we're in a NodeSelection, insert before/after is ambiguous;\n // We'll insert at its \"from\" (like your current code).\n // If insertion fails, we fallback to end of doc.\n const tryInsertAt = (pos) => {\n try {\n tr.insert(pos, newInline);\n return pos;\n } catch (e) {\n return null;\n }\n };\n\n let usedPos = tryInsertAt(insertPos);\n\n // Slate branch: \"markup empty and there's no focus\"\n // ProseMirror doesn't expose \"no focus\" the same way, so the closest\n // equivalent fallback is inserting at end of document.\n if (usedPos == null) {\n usedPos = tryInsertAt(tr.doc.content.size);\n }\n\n if (usedPos == null) {\n return false;\n }\n\n // Optionally select the node you just inserted (like your original command)\n // tr.setSelection(NodeSelection.create(tr.doc, usedPos))\n\n // --- Cursor move behavior for certain types (Slate: moveFocusTo next text) ---\n if (['math_templated', 'inline_dropdown', 'explicit_constructed_response'].includes(typeName)) {\n tr.setSelection(NodeSelection.create(tr.doc, usedPos));\n } else {\n const after = usedPos + newInline.nodeSize;\n tr.setSelection(selectionAfterPos(tr.doc, after));\n }\n\n if (dispatch) {\n commands.focus();\n dispatch(tr);\n }\n\n return true;\n },\n refreshResponseArea:\n () =>\n ({ tr, state, commands, dispatch }) => {\n const { selection } = state;\n const node = selection.$from.nodeAfter;\n const nodePos = selection.from;\n\n tr.setNodeMarkup(nodePos, undefined, { ...node?.attrs, updated: `${Date.now()}` });\n tr.setSelection(NodeSelection.create(tr.doc, nodePos));\n\n if (dispatch) {\n commands.focus();\n dispatch(tr);\n }\n\n return true;\n },\n };\n },\n});\n\n/**\n * ExplicitConstructedResponse Node\n */\nexport const ExplicitConstructedResponseNode = Node.create({\n name: 'explicit_constructed_response',\n group: 'inline',\n inline: true,\n atom: true,\n addAttributes() {\n return {\n index: { default: null },\n value: { default: '' },\n updated: { default: '' },\n };\n },\n parseHTML() {\n return [\n {\n tag: 'span[data-type=\"explicit_constructed_response\"]',\n getAttrs: (el) => ({\n index: el.dataset.index,\n value: el.dataset.value,\n }),\n },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\n 'span',\n {\n 'data-type': 'explicit_constructed_response',\n 'data-index': HTMLAttributes.index,\n 'data-value': HTMLAttributes.value,\n },\n ];\n },\n addNodeView() {\n return ReactNodeViewRenderer((props) => <ExplicitConstructedResponse {...{ ...props, options: this.options }} />);\n },\n});\n\n/**\n * MathTemplated Node\n */\nexport const MathTemplatedNode = Node.create({\n name: 'math_templated',\n group: 'inline',\n inline: true,\n atom: true,\n addAttributes() {\n return {\n index: { default: null },\n value: { default: '' },\n updated: { default: '' },\n };\n },\n parseHTML() {\n return [\n {\n tag: 'span[data-type=\"math_templated\"]',\n getAttrs: (el) => ({\n index: el.dataset.index,\n value: el.dataset.value,\n }),\n },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\n 'span',\n {\n 'data-type': 'math_templated',\n 'data-index': HTMLAttributes.index,\n 'data-value': HTMLAttributes.value,\n },\n ];\n },\n addNodeView() {\n return ReactNodeViewRenderer((props) => <MathTemplated {...{ ...props, options: this.options }} />);\n },\n});\n\n/**\n * DragInTheBlank Node\n */\nexport const DragInTheBlankNode = Node.create({\n name: 'drag_in_the_blank',\n group: 'inline',\n inline: true,\n atom: true,\n addAttributes() {\n return {\n index: { default: null },\n id: { default: null },\n value: { default: '' },\n inTable: { default: null },\n updated: { default: '' },\n };\n },\n parseHTML() {\n return [\n {\n tag: 'span[data-type=\"drag_in_the_blank\"]',\n getAttrs: (el) => ({\n index: el.dataset.index,\n id: el.dataset.id,\n value: el.dataset.value,\n inTable: el.dataset.inTable,\n }),\n },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\n 'span',\n {\n 'data-type': 'drag_in_the_blank',\n 'data-index': HTMLAttributes.index,\n 'data-id': HTMLAttributes.id,\n 'data-value': HTMLAttributes.value,\n 'data-in-table': HTMLAttributes.inTable,\n },\n ];\n },\n addNodeView() {\n return ReactNodeViewRenderer((props) => <DragInTheBlank {...{ ...props, options: this.options }} />);\n },\n});\n\n/**\n * InlineDropdown Node\n */\nexport const InlineDropdownNode = Node.create({\n name: 'inline_dropdown',\n group: 'inline',\n inline: true,\n atom: true,\n addAttributes() {\n return {\n index: { default: null },\n value: { default: '' },\n updated: { default: '' },\n };\n },\n parseHTML() {\n return [\n {\n tag: 'span[data-type=\"inline_dropdown\"]',\n getAttrs: (el) => ({\n index: el.dataset.index,\n value: el.dataset.value,\n }),\n },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\n 'span',\n {\n 'data-type': 'inline_dropdown',\n 'data-index': HTMLAttributes.index,\n 'data-value': HTMLAttributes.value,\n },\n ];\n },\n addNodeView() {\n return ReactNodeViewRenderer((props) => <InlineDropdown {...{ ...props, options: this.options }} />);\n },\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA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,KAAK;UACvBiB,KAAK,EAAEuF,EAAE,CAACC,OAAO,CAACxF;QACpB,CAAC;MAAA;IACH,CAAC,CACF;EACH,CAAC;EACDyF,UAAU,WAAVA,UAAUA,CAAAgB,KAAA,EAAqB;IAAA,IAAlBd,cAAc,GAAAc,KAAA,CAAdd,cAAc;IACzB,OAAO,CACL,MAAM,EACN;MACE,WAAW,EAAE,iBAAiB;MAC9B,YAAY,EAAEA,cAAc,CAAC5G,KAAK;MAClC,YAAY,EAAE4G,cAAc,CAAC3F;IAC/B,CAAC,CACF;EACH,CAAC;EACD4F,WAAW,WAAXA,WAAWA,CAAA,EAAG;IAAA,IAAAc,MAAA;IACZ,OAAO,IAAAZ,6BAAqB,EAAC,UAACC,KAAK;MAAA,oBAAKvJ,MAAA,YAAAwJ,aAAA,CAAChJ,eAAA,WAAc,EAAAe,aAAA,CAAAA,aAAA,KAAUgI,KAAK;QAAE/E,OAAO,EAAE0F,MAAI,CAAC1F;MAAO,EAAK,CAAC;IAAA,EAAC;EACtG;AACF,CAAC,CAAC","ignoreList":[]}
package/lib/index.js DELETED
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _typeof = require("@babel/runtime/helpers/typeof");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "ALL_PLUGINS", {
8
- enumerable: true,
9
- get: function get() {
10
- return _extensions.ALL_PLUGINS;
11
- }
12
- });
13
- Object.defineProperty(exports, "DEFAULT_PLUGINS", {
14
- enumerable: true,
15
- get: function get() {
16
- return _extensions.DEFAULT_PLUGINS;
17
- }
18
- });
19
- Object.defineProperty(exports, "EditableHtml", {
20
- enumerable: true,
21
- get: function get() {
22
- return _EditableHtml.EditableHtml;
23
- }
24
- });
25
- exports["default"] = void 0;
26
- var _EditableHtml = _interopRequireWildcard(require("./components/EditableHtml"));
27
- var _extensions = require("./extensions");
28
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
29
- var _default = exports["default"] = _EditableHtml["default"];
30
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_EditableHtml","_interopRequireWildcard","require","_extensions","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_default","exports","StyledEditor"],"sources":["../src/index.jsx"],"sourcesContent":["import StyledEditor, { EditableHtml } from './components/EditableHtml';\nimport { ALL_PLUGINS, DEFAULT_PLUGINS } from './extensions';\n\nexport { EditableHtml, ALL_PLUGINS, DEFAULT_PLUGINS };\nexport default StyledEditor;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA4D,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,wBAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,IAAAC,CAAA,CAAAM,EAAA,IAAAd,CAAA,CAAAc,EAAA,WAAAN,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,IAAAmB,QAAA,GAAAC,OAAA,cAG7CC,wBAAY","ignoreList":[]}
@@ -1,137 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _renderUi = require("@pie-lib/render-ui");
8
- var styles = function styles(theme) {
9
- return {
10
- root: {
11
- position: 'relative',
12
- padding: '0px',
13
- border: '1px solid #ccc',
14
- borderRadius: '4px',
15
- cursor: 'text',
16
- '& [data-slate-editor="true"]': {
17
- wordBreak: 'break-word',
18
- overflow: 'visible',
19
- maxHeight: '500px',
20
- // needed in order to be able to put the focus before a void element when it is the first one in the editor
21
- padding: '5px'
22
- },
23
- '&:first-child': {
24
- marginTop: 0
25
- },
26
- '& ul, & ol': {
27
- padding: '0 1rem',
28
- margin: '1.25rem 1rem 1.25rem 0.4rem'
29
- },
30
- '& ul li p, & ol li p': {
31
- marginTop: '0.25em',
32
- marginBottom: '0.25em'
33
- },
34
- '& h1, & h2, & h3, & h4, & h5, & h6': {
35
- lineHeight: 1.1,
36
- marginTop: '2.5rem',
37
- textWrap: 'pretty'
38
- },
39
- '& h1, & h2': {
40
- marginTop: '3.5rem',
41
- marginBottom: '1.5rem'
42
- },
43
- '& h1': {
44
- fontSize: '1.4rem'
45
- },
46
- '& h2': {
47
- fontSize: '1.2rem'
48
- },
49
- '& h3': {
50
- fontSize: '1.1rem'
51
- },
52
- '& h4, & h5, & h6': {
53
- fontSize: '1rem'
54
- },
55
- '& code': {
56
- backgroundColor: 'var(--purple-light)',
57
- borderRadius: '0.4rem',
58
- color: 'var(--black)',
59
- fontSize: '0.85rem',
60
- padding: '0.25em 0.3em'
61
- },
62
- '& pre': {
63
- background: 'var(--black)',
64
- borderRadius: '0.5rem',
65
- color: 'var(--white)',
66
- fontFamily: '\'JetBrainsMono\', monospace',
67
- margin: '1.5rem 0',
68
- padding: '0.75rem 1rem',
69
- '& code': {
70
- background: 'none',
71
- color: 'inherit',
72
- fontSize: '0.8rem',
73
- padding: 0
74
- }
75
- },
76
- '& blockquote': {
77
- background: '#f9f9f9',
78
- borderLeft: '5px solid #ccc',
79
- margin: '1.5em 10px',
80
- padding: '.5em 10px'
81
- },
82
- '& hr': {
83
- border: 'none',
84
- borderTop: '1px solid var(--gray-2)',
85
- margin: '2rem 0'
86
- },
87
- '& table': {
88
- tableLayout: 'fixed',
89
- width: '100%',
90
- borderCollapse: 'collapse',
91
- color: _renderUi.color.text(),
92
- backgroundColor: _renderUi.color.background()
93
- },
94
- '& table:not([border="1"]) tr': {
95
- borderTop: '1px solid #dfe2e5'
96
- },
97
- '& td, th': {
98
- padding: '.6em 1em',
99
- textAlign: 'center'
100
- },
101
- '& table:not([border="1"]) td, th': {
102
- border: '1px solid #dfe2e5'
103
- }
104
- },
105
- children: {
106
- padding: '10px 16px'
107
- },
108
- editorHolder: {
109
- position: 'relative',
110
- padding: '0px',
111
- overflowY: 'auto',
112
- color: _renderUi.color.text(),
113
- backgroundColor: _renderUi.color.background()
114
- },
115
- disabledScrollbar: {
116
- '&::-webkit-scrollbar': {
117
- display: 'none'
118
- },
119
- scrollbarWidth: 'none',
120
- '-ms-overflow-style': 'none'
121
- },
122
- error: {
123
- border: "2px solid ".concat(theme.palette.error.main, " !important")
124
- },
125
- noBorder: {
126
- border: 'none'
127
- },
128
- noPadding: {
129
- padding: 0
130
- },
131
- toolbarOnTop: {
132
- marginTop: '45px'
133
- }
134
- };
135
- };
136
- var _default = exports["default"] = styles;
137
- //# sourceMappingURL=editorContainerStyles.js.map