@pie-lib/editable-html-tip-tap 2.1.19 → 2.1.20-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -130
- package/lib/components/EditableHtml.js +0 -56
- package/lib/components/EditableHtml.js.map +1 -1
- package/lib/components/MenuBar.js +12 -81
- package/lib/components/MenuBar.js.map +1 -1
- package/lib/components/TiptapContainer.js +2 -2
- package/lib/components/TiptapContainer.js.map +1 -1
- package/lib/components/common/toolbar-buttons.js +5 -6
- package/lib/components/common/toolbar-buttons.js.map +1 -1
- package/lib/components/icons/TableIcons.js +1 -3
- package/lib/components/icons/TableIcons.js.map +1 -1
- package/lib/components/icons/TextAlign.js +5 -14
- package/lib/components/icons/TextAlign.js.map +1 -1
- package/lib/components/respArea/MathTemplated.js +8 -14
- package/lib/components/respArea/MathTemplated.js.map +1 -1
- package/lib/extensions/math.js +37 -19
- package/lib/extensions/math.js.map +1 -1
- package/lib/styles/editorContainerStyles.js +2 -2
- package/lib/styles/editorContainerStyles.js.map +1 -1
- package/package.json +9 -9
- package/src/components/EditableHtml.jsx +0 -52
- package/src/components/MenuBar.jsx +9 -91
- package/src/components/TiptapContainer.jsx +2 -2
- package/src/components/common/toolbar-buttons.jsx +4 -6
- package/src/components/icons/TableIcons.jsx +1 -9
- package/src/components/icons/TextAlign.jsx +5 -39
- package/src/components/respArea/MathTemplated.jsx +6 -13
- package/src/extensions/math.js +19 -11
- package/src/styles/editorContainerStyles.js +2 -2
- package/LICENSE.md +0 -5
- package/src/__tests__/EditableHtml.test.jsx +0 -668
- package/src/__tests__/constants.test.js +0 -19
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
- package/src/__tests__/editor-attributes.test.jsx +0 -77
- package/src/__tests__/extensions.test.js +0 -208
- package/src/__tests__/index.test.jsx +0 -154
- package/src/__tests__/size-utils.test.js +0 -64
- package/src/__tests__/spellcheck.test.jsx +0 -63
- package/src/__tests__/theme.test.js +0 -17
- package/src/components/__tests__/AltDialog.test.jsx +0 -147
- package/src/components/__tests__/CharacterPicker.test.jsx +0 -270
- package/src/components/__tests__/CssIcon.test.jsx +0 -46
- package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -209
- package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
- package/src/components/__tests__/InlineDropdown.test.jsx +0 -557
- package/src/components/__tests__/InsertImageHandler.test.js +0 -161
- package/src/components/__tests__/MediaDialog.test.jsx +0 -293
- package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
- package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
- package/src/components/__tests__/MenuBar.test.jsx +0 -338
- package/src/components/__tests__/RespArea.test.jsx +0 -122
- package/src/components/__tests__/TableIcons.test.jsx +0 -149
- package/src/components/__tests__/TextAlign.test.jsx +0 -167
- package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
- package/src/components/__tests__/characterUtils.test.js +0 -166
- package/src/components/__tests__/choice.test.jsx +0 -171
- package/src/components/__tests__/custom-popper.test.jsx +0 -82
- package/src/components/__tests__/done-button.test.jsx +0 -54
- package/src/components/__tests__/toolbar-buttons.test.jsx +0 -247
- package/src/components/respArea/DragInTheBlank/__tests__/choice.test.jsx +0 -72
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
- package/src/extensions/__tests__/css.test.js +0 -196
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
- package/src/extensions/__tests__/divNode.test.js +0 -87
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
- package/src/extensions/__tests__/extended-list-item.test.js +0 -13
- package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
- package/src/extensions/__tests__/extended-table.test.js +0 -183
- package/src/extensions/__tests__/image-component.test.jsx +0 -346
- package/src/extensions/__tests__/image.test.js +0 -237
- package/src/extensions/__tests__/math.test.js +0 -898
- package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
- package/src/extensions/__tests__/media.test.js +0 -271
- package/src/extensions/__tests__/responseArea.test.js +0 -655
- package/src/utils/__tests__/helper.test.js +0 -126
- package/src/utils/__tests__/toolbar.test.js +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -3,136 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [2.1.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.18...@pie-lib/editable-html-tip-tap@2.1.19) (2026-09-22)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @pie-lib/editable-html-tip-tap
|
|
9
|
-
|
|
10
|
-
## [2.1.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.17...@pie-lib/editable-html-tip-tap@2.1.18) (2026-09-16)
|
|
11
|
-
|
|
12
|
-
### Bug Fixes
|
|
13
|
-
|
|
14
|
-
- **editable-html-tip-tap:** put the bottom toolbar in normal flow DNAFORM-2093 ([3a48c25](https://github.com/pie-framework/pie-lib/commit/3a48c251807e94b4a8683166e7c5ed8cbc4b3249))
|
|
15
|
-
- **editable-html-tip-tap:** restore role=textbox and add data-pie-editor PIE-1015 PIE-1016 ([e9064f4](https://github.com/pie-framework/pie-lib/commit/e9064f480511665499a7a17e80ae7407e59f53ef))
|
|
16
|
-
|
|
17
|
-
## [2.1.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.16...@pie-lib/editable-html-tip-tap@2.1.17) (2026-09-03)
|
|
18
|
-
|
|
19
|
-
### Bug Fixes
|
|
20
|
-
|
|
21
|
-
- **editable-html-tip-tap:** honor the spellCheck prop PIE-978 ([f3e5b64](https://github.com/pie-framework/pie-lib/commit/f3e5b6429ff301191e0e8e110b969a150dacee7c))
|
|
22
|
-
- **editable-html-tip-tap:** stop auto-linking typed and pasted URLs PIE-980 ([6481811](https://github.com/pie-framework/pie-lib/commit/6481811bd80a5731d79fe52fa3668f483b407511))
|
|
23
|
-
|
|
24
|
-
## [2.1.16](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.15...@pie-lib/editable-html-tip-tap@2.1.16) (2026-09-02)
|
|
25
|
-
|
|
26
|
-
### Bug Fixes
|
|
27
|
-
|
|
28
|
-
- **deps:** align versions with pie-elements-ng and upgrade [@visx](https://github.com/visx) to v4 PIE-926 ([16c5ff0](https://github.com/pie-framework/pie-lib/commit/16c5ff093a36fea98a46d5e2b37f95d9ec03025c))
|
|
29
|
-
|
|
30
|
-
## [2.1.15](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.14...@pie-lib/editable-html-tip-tap@2.1.15) (2026-08-26)
|
|
31
|
-
|
|
32
|
-
### Bug Fixes
|
|
33
|
-
|
|
34
|
-
- **theming:** color authored table borders with --pie-\* tokens PIE-860 ([b285407](https://github.com/pie-framework/pie-lib/commit/b285407235a31d77d75757a1b784fd476fa3e8a0))
|
|
35
|
-
|
|
36
|
-
## [2.1.14](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.13...@pie-lib/editable-html-tip-tap@2.1.14) (2026-08-21)
|
|
37
|
-
|
|
38
|
-
### Bug Fixes
|
|
39
|
-
|
|
40
|
-
- **theming:** move the grey palette reads onto --pie-\* tokens PIE-856 ([9bbaf10](https://github.com/pie-framework/pie-lib/commit/9bbaf10ab25a050e4d1b727f84c7ad9fdc952f6a)), closes [#C0C3](https://github.com/pie-framework/pie-lib/issues/C0C3)
|
|
41
|
-
|
|
42
|
-
## [2.1.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.12...@pie-lib/editable-html-tip-tap@2.1.13) (2026-08-18)
|
|
43
|
-
|
|
44
|
-
### Bug Fixes
|
|
45
|
-
|
|
46
|
-
- **editable-html-tip-tap:** give toolbar buttons accessible names PIE-708 ([8cf0065](https://github.com/pie-framework/pie-lib/commit/8cf0065ba7ba684c5d51bcdee3cce8166b1cd8bc))
|
|
47
|
-
|
|
48
|
-
## [2.1.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.11...@pie-lib/editable-html-tip-tap@2.1.12) (2026-08-13)
|
|
49
|
-
|
|
50
|
-
**Note:** Version bump only for package @pie-lib/editable-html-tip-tap
|
|
51
|
-
|
|
52
|
-
## [2.1.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.10...@pie-lib/editable-html-tip-tap@2.1.11) (2026-07-31)
|
|
53
|
-
|
|
54
|
-
### Bug Fixes
|
|
55
|
-
|
|
56
|
-
- add tests for handling node insertion PIE-581 ([47a8f89](https://github.com/pie-framework/pie-lib/commit/47a8f89717eb1acedcbbddfe618f4f040a1021d5))
|
|
57
|
-
- **editable-html-tip-tap:** gets a normal TextSelection after insertion PIE-581 ([3e95183](https://github.com/pie-framework/pie-lib/commit/3e95183c47bede6d9d6e301ff44466ce24371a2c))
|
|
58
|
-
- **editable-html:** update placeholder visibility and disable image tools when editor is disabled PIE-787 ([fb0c7aa](https://github.com/pie-framework/pie-lib/commit/fb0c7aaddffa21896fabeb6b677cc0ca85fc7bc9))
|
|
59
|
-
- made sure the numbers near the fraction have the same font size as the fraction [PIE-755] ([1c6d035](https://github.com/pie-framework/pie-lib/commit/1c6d03581470303e750cb14e5edcd08ba2eaf617))
|
|
60
|
-
|
|
61
|
-
## [2.1.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.9...@pie-lib/editable-html-tip-tap@2.1.10) (2026-07-08)
|
|
62
|
-
|
|
63
|
-
### Bug Fixes
|
|
64
|
-
|
|
65
|
-
- **editable-html-tip-tap:** handle cursor position based on node instead of the stale editor position PIE-698 ([fd562cc](https://github.com/pie-framework/pie-lib/commit/fd562cc0c211c204eba579d5cfd957efa2edf346))
|
|
66
|
-
- made sure math is rendered on response render [PIE-706] ([1cb50ba](https://github.com/pie-framework/pie-lib/commit/1cb50ba6908db9599f177a88aa012b75637ac23e))
|
|
67
|
-
- made sure the inline dropdown toolbar closed triggers an onDone [PIE-702] ([c77afed](https://github.com/pie-framework/pie-lib/commit/c77afed2d64126990af95522c9467fb600358832))
|
|
68
|
-
|
|
69
|
-
## [2.1.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.8...@pie-lib/editable-html-tip-tap@2.1.9) (2026-07-01)
|
|
70
|
-
|
|
71
|
-
### Bug Fixes
|
|
72
|
-
|
|
73
|
-
- **editable-html-tip-tap:** prevent toolbar closing when clicking the page scrollbar inline-dropdown PIE-575 ([8a93fb5](https://github.com/pie-framework/pie-lib/commit/8a93fb53e3920e9deb642005d6053ac4f9397bec))
|
|
74
|
-
- **editable-html-tip-tap:** use strict greater-than for scrollbar viewport check inlinedropdown PIE-575 ([1b38e20](https://github.com/pie-framework/pie-lib/commit/1b38e20965ee0b3dd7ffe84e7af625865987a4d9))
|
|
75
|
-
- **editable-html:** copy font styles and append character limit element to document body PIE-674 ([84e2d40](https://github.com/pie-framework/pie-lib/commit/84e2d40d74cc89f8c36d61737de1e4b93c0dd084))
|
|
76
|
-
|
|
77
|
-
## [2.1.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.7...@pie-lib/editable-html-tip-tap@2.1.8) (2026-06-25)
|
|
78
|
-
|
|
79
|
-
### Bug Fixes
|
|
80
|
-
|
|
81
|
-
- add test for math node selection PIE-699 ([cd4dc89](https://github.com/pie-framework/pie-lib/commit/cd4dc8939f7b8313a80290176806467ef9a928ec))
|
|
82
|
-
- add test for math node selection PIE-699 ([af3b72c](https://github.com/pie-framework/pie-lib/commit/af3b72cb60c2ec31f6c9a1a6063e25af3439fd3c))
|
|
83
|
-
- **editable-html:** preserve existing spans on load and prevent unnecessary updates PIE-665 ([41be4e3](https://github.com/pie-framework/pie-lib/commit/41be4e3f317e6fc23ddae7e3c8c65ff5a6253a0d))
|
|
84
|
-
- math editor saves on close and focuses when switching node [PIE-695][PIE-697] ([54beb75](https://github.com/pie-framework/pie-lib/commit/54beb75afe197d157623bb7feec92796a196091a))
|
|
85
|
-
- place math toolbar inside viewport and move it accordingly when window resizes [PIE-656] ([0f43d5a](https://github.com/pie-framework/pie-lib/commit/0f43d5ae119d4e52263593180fb009821d9e5211))
|
|
86
|
-
- prevent toolbar from opening on text selection and Cmd+A PIE-699 ([f740299](https://github.com/pie-framework/pie-lib/commit/f7402995deaf7687a4dd0f3d8f97b57a77c11d2b))
|
|
87
|
-
|
|
88
|
-
## [2.1.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.6...@pie-lib/editable-html-tip-tap@2.1.7) (2026-06-19)
|
|
89
|
-
|
|
90
|
-
### Bug Fixes
|
|
91
|
-
|
|
92
|
-
- **editable-html:** append character limit element to document body for accurate width calculation PIE-674 ([9885176](https://github.com/pie-framework/pie-lib/commit/988517666b51636b56751caf65e8c19732db4add))
|
|
93
|
-
- **editable-html:** keep the element appended to rootRef.current so it inherits the editor's actual font and font-size (document.body would use the wrong font and yield inaccurate widths) PIE-674 ([16bb5fc](https://github.com/pie-framework/pie-lib/commit/16bb5fcb9c9ffa8a302f0e2c645a03b91b40192a))
|
|
94
|
-
- explicitly set SVG icon size to 24x24 in StyledMenuBarRoot ([0444e2e](https://github.com/pie-framework/pie-lib/commit/0444e2ec1947d62a1787ae3d66047bd02f048157))
|
|
95
|
-
- when requestClose is called, latest node version is used [PIE-705] ([f1718dd](https://github.com/pie-framework/pie-lib/commit/f1718dd45010380bbe5b319a79627c2be889269d))
|
|
96
|
-
|
|
97
|
-
## [2.1.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.5...@pie-lib/editable-html-tip-tap@2.1.6) (2026-06-17)
|
|
98
|
-
|
|
99
|
-
### Bug Fixes
|
|
100
|
-
|
|
101
|
-
- **editable-html-tip-tap:** explicitly set SVG icon in toolbar button size to 24x24 for consistency ([22166de](https://github.com/pie-framework/pie-lib/commit/22166deb41adb5f1c88b111667e4e304348d4d51))
|
|
102
|
-
- **editable-html-tip-tap:** improve popover positioning and update event handling PIE-670 ([ee89ea1](https://github.com/pie-framework/pie-lib/commit/ee89ea1cf8bd0679d62bb9daeb12f8907dded221))
|
|
103
|
-
- made sure inline dropdown toolbar is rendered inside the editor [PIE-683] ([bf33caa](https://github.com/pie-framework/pie-lib/commit/bf33caa3f328541351b24b479b09d7bb2029dda3))
|
|
104
|
-
- open math in custom toolbars, higher zIndex for character picker, math deletion, math selection, math and character position [PIE-656][PIE-657][PIE-658][PIE-659] ([92e4d66](https://github.com/pie-framework/pie-lib/commit/92e4d66cc5aff8e63363b43df1a5d39f89a7a1a5))
|
|
105
|
-
|
|
106
|
-
## [2.1.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.4...@pie-lib/editable-html-tip-tap@2.1.5) (2026-06-12)
|
|
107
|
-
|
|
108
|
-
### Bug Fixes
|
|
109
|
-
|
|
110
|
-
- clicking on a different math node closes current modal [PIE-603] ([6244aaf](https://github.com/pie-framework/pie-lib/commit/6244aaf509da1196e91803aabae0ca531d17f458))
|
|
111
|
-
- **editable-html-tip-tap:** rename button class to 'toolbarButton' PIE-662 ([58ebb5d](https://github.com/pie-framework/pie-lib/commit/58ebb5de67db7019118d7e6707a9bf5a27b6d913))
|
|
112
|
-
- made sure editor state subscribes to toolbarOpened and reacts to its changes [PIE-604] ([c9f6466](https://github.com/pie-framework/pie-lib/commit/c9f64667cda45b4eb6a6746cdae1cbb9976bbb74))
|
|
113
|
-
|
|
114
|
-
## [2.1.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.3...@pie-lib/editable-html-tip-tap@2.1.4) (2026-06-03)
|
|
115
|
-
|
|
116
|
-
### Bug Fixes
|
|
117
|
-
|
|
118
|
-
- place math editor at the correct position, close math editor if unfocused [PIE-602] ([92d104e](https://github.com/pie-framework/pie-lib/commit/92d104e5c2d51336e103920b1ba559d6b2c79d81))
|
|
119
|
-
|
|
120
|
-
## [2.1.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.2...@pie-lib/editable-html-tip-tap@2.1.3) (2026-06-01)
|
|
121
|
-
|
|
122
|
-
### Bug Fixes
|
|
123
|
-
|
|
124
|
-
- **deps:** align all @tiptap/\* to 3.20.0 to dedupe prosemirror downstream ([79f59f6](https://github.com/pie-framework/pie-lib/commit/79f59f6fb853c2fb200fefc17bc69e6f5bb7c010))
|
|
125
|
-
- **deps:** align tiptap and react-transition-group versions to dedupe prosemirror PIE-624 ([3ab7737](https://github.com/pie-framework/pie-lib/commit/3ab7737d896ec48091630c221f8be1f9f5a98d8e))
|
|
126
|
-
- **editable-html-tip-tap:** hanlde new props request close, keep track of last active resp are PIE-574 ([a120f8b](https://github.com/pie-framework/pie-lib/commit/a120f8b28d3871fe7bf59eaf0ec25cbe783c1f7f))
|
|
127
|
-
- handled onChange properly [PIE-509][PIE-562][PIE-563] ([c2009ef](https://github.com/pie-framework/pie-lib/commit/c2009ef30c8f9e268f0d39bf18e16e4a90695071))
|
|
128
|
-
|
|
129
|
-
## [2.1.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.1...@pie-lib/editable-html-tip-tap@2.1.2) (2026-05-21)
|
|
130
|
-
|
|
131
|
-
### Bug Fixes
|
|
132
|
-
|
|
133
|
-
- made sure characterpicker positioning is not changing on each typed character [PIE-511][PIE-561][PIE-562][PIE-563] ([127f409](https://github.com/pie-framework/pie-lib/commit/127f409767e51f43479ae8e44be635db92f77eb5))
|
|
134
|
-
- made sure separateParagraphs works [PIE-522] ([9088942](https://github.com/pie-framework/pie-lib/commit/90889424e08c0588861834c0ba020b63718f8bd8))
|
|
135
|
-
|
|
136
6
|
## [2.1.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html-tip-tap@2.1.0...@pie-lib/editable-html-tip-tap@2.1.1) (2026-05-15)
|
|
137
7
|
|
|
138
8
|
### Bug Fixes
|
|
@@ -77,27 +77,6 @@ var cssVariables = {
|
|
|
77
77
|
'--red-light': '#ffebe5',
|
|
78
78
|
'--shadow': "0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)"
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
// Attributes PIE puts on the editor's contenteditable element.
|
|
82
|
-
//
|
|
83
|
-
// ProseMirror rebuilds the element's attribute set from editorProps.attributes on every view
|
|
84
|
-
// update and removes anything no longer listed, and Tiptap merges its own role="textbox" only in
|
|
85
|
-
// createView - not into editor.options, which is what setOptions re-pushes. So every attribute we
|
|
86
|
-
// want to survive has to be listed here. See PIE-1015.
|
|
87
|
-
var editorAttributes = function editorAttributes(spellCheckEnabled) {
|
|
88
|
-
return {
|
|
89
|
-
// Tiptap's own attribute, re-declared so it survives setOptions. setEditable alone re-pushes
|
|
90
|
-
// editorProps on every mount, which is what removed it in 2.1.17.
|
|
91
|
-
role: 'textbox',
|
|
92
|
-
// PIE-owned hook for external consumers - see PIE-1016. Query [data-pie-editor], or
|
|
93
|
-
// [data-pie-editor][contenteditable="true"] to skip read-only renders.
|
|
94
|
-
'data-pie-editor': 'true',
|
|
95
|
-
// Without these the browser spellchecks the editor regardless of the spellCheck prop.
|
|
96
|
-
spellcheck: spellCheckEnabled ? 'true' : 'false',
|
|
97
|
-
autocorrect: spellCheckEnabled ? 'on' : 'off',
|
|
98
|
-
autocapitalize: spellCheckEnabled ? 'on' : 'off'
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
80
|
var EditableHtml = exports.EditableHtml = function EditableHtml(props) {
|
|
102
81
|
var _props$pluginProps;
|
|
103
82
|
var _ref = props.pluginProps || {},
|
|
@@ -177,13 +156,6 @@ var EditableHtml = exports.EditableHtml = function EditableHtml(props) {
|
|
|
177
156
|
trailingNode: {
|
|
178
157
|
node: 'paragraph',
|
|
179
158
|
notAfter: ['paragraph', 'div']
|
|
180
|
-
},
|
|
181
|
-
// StarterKit bundles the link extension, which turns anything that looks like a URL into
|
|
182
|
-
// a hyperlink as it is typed or pasted. See PIE-980 - we don't want that in any editor.
|
|
183
|
-
// The mark itself stays registered so links already in the markup keep round-tripping.
|
|
184
|
-
link: {
|
|
185
|
-
autolink: false,
|
|
186
|
-
linkOnPaste: false
|
|
187
159
|
}
|
|
188
160
|
}), _extendedListItem.ExtendedListItem, _divNode.DivNode, _headingParagraph.HeadingParagraph, _ensureEmptyRootDiv.EnsureEmptyRootIsDiv, _ensureListItemContentIsDiv.EnsureListItemContentIsDiv, _extensionPlaceholder["default"].configure({
|
|
189
161
|
placeholder: props.placeholder,
|
|
@@ -262,16 +234,10 @@ var EditableHtml = exports.EditableHtml = function EditableHtml(props) {
|
|
|
262
234
|
}), _css.CSSMark.configure({
|
|
263
235
|
extraCSSRules: props.extraCSSRules
|
|
264
236
|
})];
|
|
265
|
-
|
|
266
|
-
// Callers that don't pass spellCheck keep the browser default (on), as they did with the
|
|
267
|
-
// slate-based editor. Players that have to default to off - extended-text-entry, see
|
|
268
|
-
// PIE-978 - resolve that in their controller and pass an explicit false.
|
|
269
|
-
var spellCheckEnabled = props.spellCheck !== false;
|
|
270
237
|
var editor = (0, _react2.useEditor)({
|
|
271
238
|
extensions: extensions,
|
|
272
239
|
immediatelyRender: false,
|
|
273
240
|
editorProps: {
|
|
274
|
-
attributes: editorAttributes(spellCheckEnabled),
|
|
275
241
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
276
242
|
if (props.onKeyDown) {
|
|
277
243
|
return props.onKeyDown(event);
|
|
@@ -308,28 +274,6 @@ var EditableHtml = exports.EditableHtml = function EditableHtml(props) {
|
|
|
308
274
|
(0, _react.useEffect)(function () {
|
|
309
275
|
editor === null || editor === void 0 || editor.setEditable(!props.disabled);
|
|
310
276
|
}, [props.disabled, editor]);
|
|
311
|
-
|
|
312
|
-
// useEditor only re-applies options on its own when it is called with an empty dependency
|
|
313
|
-
// array, and this call site depends on charactersLimit, so a spellCheck change on a mounted
|
|
314
|
-
// editor has to be pushed in. The rest of editorProps stays as the editor already has it, and
|
|
315
|
-
// the attributes are merged rather than replaced so an attribute contributed by Tiptap or an
|
|
316
|
-
// extension can't be dropped the way role="textbox" was - see PIE-1015.
|
|
317
|
-
(0, _react.useEffect)(function () {
|
|
318
|
-
var _editor$options, _currentEditorProps$a;
|
|
319
|
-
if (!editor) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
var currentEditorProps = (_editor$options = editor.options) === null || _editor$options === void 0 ? void 0 : _editor$options.editorProps;
|
|
323
|
-
var attributes = _objectSpread(_objectSpread({}, currentEditorProps === null || currentEditorProps === void 0 ? void 0 : currentEditorProps.attributes), editorAttributes(spellCheckEnabled));
|
|
324
|
-
if ((currentEditorProps === null || currentEditorProps === void 0 || (_currentEditorProps$a = currentEditorProps.attributes) === null || _currentEditorProps$a === void 0 ? void 0 : _currentEditorProps$a.spellcheck) === attributes.spellcheck) {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
editor.setOptions({
|
|
328
|
-
editorProps: _objectSpread(_objectSpread({}, currentEditorProps), {}, {
|
|
329
|
-
attributes: attributes
|
|
330
|
-
})
|
|
331
|
-
});
|
|
332
|
-
}, [spellCheckEnabled, editor]);
|
|
333
277
|
(0, _react.useEffect)(function () {
|
|
334
278
|
if (!editor) {
|
|
335
279
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableHtml.js","names":["_react","_interopRequireWildcard","require","_debounce","_interopRequireDefault","_react2","_styles","_starterKit","_extensionTextStyle","_extensionCharacterCount","_extensionSuperscript","_extensionSubscript","_extensionTextAlign","_extensionImage","_extensionPlaceholder","_helper","_extendedTable","_extendedTableCell","_divNode","_ensureEmptyRootDiv","_ensureListItemContentIsDiv","_extensionTableRow","_responseArea","_math","_image","_media","_css","_extendedListItem","_headingParagraph","_TiptapContainer","_size","_extensions","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defaultToolbarOpts","position","alignment","alwaysVisible","showDone","doneOn","defaultResponseAreaProps","options","respAreaToolbar","onHandleAreaChange","DEFAULT_ACTIVE_PLUGINS","cssVariables","editorAttributes","spellCheckEnabled","role","spellcheck","autocorrect","autocapitalize","EditableHtml","exports","props","_props$pluginProps","_ref","pluginProps","showParagraphs","separateParagraphs","_useState","useState","_useState2","_slicedToArray2","pendingImages","setPendingImages","_useState3","_useState4","scheduled","setScheduled","toolbarOpts","removePendingImage","useCallback","imagePos","prev","next","img","pos","toolbarOptsToUse","commitEditorContent","editor","html","getHTML","markup","_props$onChange","onChange","_props$onDone","onDone","responseAreaPropsToUse","useMemo","responseAreaProps","onInlineDropdownToolbarClose","activePluginsToUse","_ref3","_ref2","customPlugins","otherPluginProps","_objectWithoutProperties2","filteredActivePlugins","activePlugins","pluginName","nameToUse","PLUGINS_MAP","pluginInfo","disabled","buildExtensions","math","textAlign","extraCSSRules","image","imageSupport","toolbar","table","responseArea","type","languageCharacters","languageCharactersProps","keyPadCharacterRef","setKeypadInteraction","media","extensions","TextAlign","configure","types","alignments","TextStyleKit","CharacterCount","limit","charactersLimit","StarterKit","trailingNode","node","notAfter","link","autolink","linkOnPaste","ExtendedListItem","DivNode","HeadingParagraph","EnsureEmptyRootIsDiv","EnsureListItemContentIsDiv","Placeholder","placeholder","showOnlyWhenEditable","showOnlyCurrent","includeChildren","ExtendedTable","TableRow","ExtendedTableHeader","ExtendedTableCell","ResponseAreaExtension","ExplicitConstructedResponseNode","DragInTheBlankNode","InlineDropdownNode","MathTemplatedNode","MathNode","SubScript","SuperScript","Image","ImageUploadNode","imageHandling","disableImageAlignmentButtons","_props$onDone2","onDelete","src","attrs","insertImageRequested","imageInfo","getHandler","_imageInfo","addedImage","onFinish","result","_cb","cb","callback","handler","focusHandler","debounce","detach","window","removeEventListener","_insertingImage","addEventListener","add","concat","_toConsumableArray2","maxImageWidth","maxImageHeight","Media","uploadSoundSupport","CSSMark","spellCheck","useEditor","immediatelyRender","editorProps","attributes","handleKeyDown","view","event","onKeyDown","editable","content","normalizeInitialMarkup","onUpdate","_ref4","transaction","isDone","_props$onChange2","onBlur","_ref5","otherToolbarOpened","_toolbarOpened","isActive","schema","useEffect","editorRef","setEditable","_editor$options","_currentEditorProps$a","currentEditorProps","setOptions","nextMarkup","commands","setContent","emitUpdate","entries","_ref6","_ref7","key","value","document","documentElement","style","setProperty","editorState","useEditorState","selector","ctx","_ctx$editor","isFocused","sizeStyle","minWidth","width","maxWidth","minHeight","height","maxHeight","valueToSize","createElement","_extends2","StyledEditorContent","showParagraph","separateParagraph","styled","EditorContent","shouldForwardProp","prop","includes","_ref8","display","outline","flex","padding","margin","left","top","color","pointerEvents","whiteSpace","fontSize","marginBottom","_default"],"sources":["../../src/components/EditableHtml.jsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport debounce from 'lodash-es/debounce';\nimport { EditorContent, useEditor, useEditorState } from '@tiptap/react';\nimport { styled } from '@mui/material/styles';\nimport StarterKit from '@tiptap/starter-kit';\nimport { TextStyleKit } from '@tiptap/extension-text-style';\nimport { CharacterCount } from '@tiptap/extension-character-count';\nimport SuperScript from '@tiptap/extension-superscript';\nimport SubScript from '@tiptap/extension-subscript';\nimport TextAlign from '@tiptap/extension-text-align';\nimport Image from '@tiptap/extension-image';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { normalizeInitialMarkup } from '../utils/helper';\n\nimport ExtendedTable from '../extensions/extended-table';\nimport { ExtendedTableCell, ExtendedTableHeader } from '../extensions/extended-table-cell';\nimport { DivNode } from '../extensions/div-node';\nimport { EnsureEmptyRootIsDiv } from '../extensions/ensure-empty-root-div';\nimport { EnsureListItemContentIsDiv } from '../extensions/ensure-list-item-content-is-div';\nimport { TableRow } from '@tiptap/extension-table-row';\nimport {\n DragInTheBlankNode,\n ExplicitConstructedResponseNode,\n InlineDropdownNode,\n MathTemplatedNode,\n ResponseAreaExtension,\n} from '../extensions/responseArea';\nimport { MathNode } from '../extensions/math';\nimport { ImageUploadNode } from '../extensions/image';\nimport { Media } from '../extensions/media';\nimport { CSSMark } from '../extensions/css';\nimport { ExtendedListItem } from '../extensions/extended-list-item';\nimport { HeadingParagraph } from '../extensions/heading-paragraph';\n\nimport EditorContainer from './TiptapContainer';\nimport { valueToSize } from '../utils/size';\nimport { buildExtensions, PLUGINS_MAP } from '../extensions';\n\nconst defaultToolbarOpts = {\n position: 'bottom',\n alignment: 'left',\n alwaysVisible: false,\n showDone: true,\n doneOn: 'blur',\n};\n\nconst defaultResponseAreaProps = {\n options: {},\n respAreaToolbar: () => {},\n onHandleAreaChange: () => {},\n};\n\nconst DEFAULT_ACTIVE_PLUGINS = [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'code',\n 'bulleted-list',\n 'numbered-list',\n 'image',\n 'math',\n 'languageCharacters',\n 'text-align',\n 'table',\n 'video',\n 'audio',\n 'responseArea',\n 'superscript',\n 'subscript',\n 'css',\n 'h3',\n 'undo',\n 'redo',\n];\n\nconst cssVariables = {\n '--white': '#fff',\n '--black': '#2e2b29',\n '--black-contrast': '#110f0e',\n '--gray-1': 'rgba(61, 37, 20, .05)',\n '--gray-2': 'rgba(61, 37, 20, .08)',\n '--gray-3': 'rgba(61, 37, 20, .12)',\n '--gray-4': 'rgba(53, 38, 28, .3)',\n '--gray-5': 'rgba(28, 25, 23, .6)',\n '--green': '#22c55e',\n '--purple': '#6a00f5',\n '--purple-contrast': '#5800cc',\n '--purple-light': 'rgba(88, 5, 255, .05)',\n '--yellow-contrast': '#facc15',\n '--yellow': 'rgba(250, 204, 21, .4)',\n '--yellow-light': '#fffae5',\n '--red': '#ff5c33',\n '--red-light': '#ffebe5',\n '--shadow': `0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`,\n};\n\n// Attributes PIE puts on the editor's contenteditable element.\n//\n// ProseMirror rebuilds the element's attribute set from editorProps.attributes on every view\n// update and removes anything no longer listed, and Tiptap merges its own role=\"textbox\" only in\n// createView - not into editor.options, which is what setOptions re-pushes. So every attribute we\n// want to survive has to be listed here. See PIE-1015.\nconst editorAttributes = (spellCheckEnabled) => ({\n // Tiptap's own attribute, re-declared so it survives setOptions. setEditable alone re-pushes\n // editorProps on every mount, which is what removed it in 2.1.17.\n role: 'textbox',\n // PIE-owned hook for external consumers - see PIE-1016. Query [data-pie-editor], or\n // [data-pie-editor][contenteditable=\"true\"] to skip read-only renders.\n 'data-pie-editor': 'true',\n // Without these the browser spellchecks the editor regardless of the spellCheck prop.\n spellcheck: spellCheckEnabled ? 'true' : 'false',\n autocorrect: spellCheckEnabled ? 'on' : 'off',\n autocapitalize: spellCheckEnabled ? 'on' : 'off',\n});\n\nexport const EditableHtml = (props) => {\n const { showParagraphs, separateParagraphs } = props.pluginProps || {};\n const [pendingImages, setPendingImages] = useState([]);\n const [scheduled, setScheduled] = useState(false);\n const { toolbarOpts } = props;\n\n const removePendingImage = useCallback(\n (imagePos) => {\n setPendingImages((prev) => {\n const next = prev.filter((img) => img.pos !== imagePos);\n if (next.length === 0) {\n setScheduled(false);\n }\n return next;\n });\n },\n [setPendingImages],\n );\n\n const toolbarOptsToUse = {\n ...defaultToolbarOpts,\n ...toolbarOpts,\n };\n\n const commitEditorContent = useCallback(\n (editor) => {\n const html = editor.getHTML();\n\n if (props.markup !== html) {\n props.onChange?.(html);\n }\n\n if (toolbarOptsToUse.doneOn === 'blur') {\n props.onDone?.(html);\n }\n },\n [props.markup, props.onChange, props.onDone, toolbarOptsToUse.doneOn],\n );\n\n const responseAreaPropsToUse = useMemo(\n () => ({\n ...defaultResponseAreaProps,\n ...props.responseAreaProps,\n onInlineDropdownToolbarClose: commitEditorContent,\n }),\n [props.responseAreaProps, commitEditorContent],\n );\n\n const activePluginsToUse = useMemo(() => {\n let { customPlugins, ...otherPluginProps } = props.pluginProps || {};\n\n customPlugins = customPlugins || [];\n\n const filteredActivePlugins = (props.activePlugins || DEFAULT_ACTIVE_PLUGINS)?.filter((pluginName) => {\n const nameToUse = PLUGINS_MAP[pluginName] || pluginName;\n const pluginInfo = otherPluginProps[nameToUse] || {};\n\n return !pluginInfo || !pluginInfo.disabled;\n });\n\n return buildExtensions(filteredActivePlugins, customPlugins, {\n math: {},\n textAlign: props.textAlign,\n html: {},\n extraCSSRules: props.extraCSSRules || {},\n image: {\n ...props.imageSupport,\n },\n toolbar: {},\n table: {},\n responseArea: {\n type: responseAreaPropsToUse.type,\n },\n languageCharacters: props.languageCharactersProps,\n keyPadCharacterRef: {},\n setKeypadInteraction: {},\n media: {},\n });\n }, [props, responseAreaPropsToUse.type]);\n\n const extensions = [\n TextAlign.configure({\n types: ['heading', 'paragraph', 'div', 'headingParagraph', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'td', 'th'],\n alignments: ['left', 'right', 'center', 'justify'],\n }),\n TextStyleKit,\n CharacterCount.configure({\n limit: props.charactersLimit || 1000000,\n }),\n StarterKit.configure({\n trailingNode: {\n node: 'paragraph',\n notAfter: ['paragraph', 'div'],\n },\n // StarterKit bundles the link extension, which turns anything that looks like a URL into\n // a hyperlink as it is typed or pasted. See PIE-980 - we don't want that in any editor.\n // The mark itself stays registered so links already in the markup keep round-tripping.\n link: {\n autolink: false,\n linkOnPaste: false,\n },\n }),\n ExtendedListItem,\n DivNode,\n HeadingParagraph,\n EnsureEmptyRootIsDiv,\n EnsureListItemContentIsDiv,\n Placeholder.configure({\n placeholder: props.placeholder,\n // show placeholder even when editor is focused\n showOnlyWhenEditable: true,\n showOnlyCurrent: false, // show on all empty nodes, not only the current one\n includeChildren: true,\n }),\n ExtendedTable,\n TableRow,\n ExtendedTableHeader,\n ExtendedTableCell,\n ResponseAreaExtension.configure(responseAreaPropsToUse),\n ExplicitConstructedResponseNode.configure(responseAreaPropsToUse),\n DragInTheBlankNode.configure(responseAreaPropsToUse),\n InlineDropdownNode.configure(responseAreaPropsToUse),\n MathTemplatedNode.configure(responseAreaPropsToUse),\n MathNode.configure({\n toolbarOpts: toolbarOptsToUse,\n math: props.pluginProps?.math || {},\n }),\n SubScript,\n SuperScript,\n Image,\n ImageUploadNode.configure({\n toolbarOpts: toolbarOptsToUse,\n imageHandling: {\n disableImageAlignmentButtons: props.disableImageAlignmentButtons,\n onDone: (editor) => props.onDone?.(editor.getHTML()),\n onDelete:\n props.imageSupport &&\n props.imageSupport.delete &&\n ((node) => {\n const { src } = node.attrs;\n\n props.imageSupport.delete(src, (e) => {\n removePendingImage(node.pos);\n });\n }),\n insertImageRequested:\n props.imageSupport &&\n ((editor, imageInfo, getHandler) => {\n const [addedImage, pos] = imageInfo;\n\n const onFinish = (result) => {\n let cb;\n\n if (scheduled && result) {\n // finish editing only on success\n cb = props.onChange;\n }\n\n removePendingImage(pos);\n cb?.(editor.getHTML());\n };\n\n const callback = () => {\n /**\n * The handler is the object through which the outer context\n * communicates file upload events like: fileChosen, cancel, progress\n */\n const handler = getHandler(onFinish);\n\n // If the user closes the file picker without choosing a file, the window regains\n // focus while _insertingImage is still true — drop the stale pending entry.\n const focusHandler = debounce(() => {\n const detach = () => window.removeEventListener('focus', focusHandler);\n\n if (!editor._insertingImage) {\n detach();\n return;\n }\n\n removePendingImage(pos);\n editor._insertingImage = false;\n detach();\n }, 500);\n\n window.addEventListener('focus', focusHandler);\n\n props.imageSupport.add(handler);\n };\n\n editor._insertingImage = true;\n setPendingImages((prev) => [...prev, addedImage]);\n callback();\n }),\n maxImageWidth: props.maxImageWidth,\n maxImageHeight: props.maxImageHeight,\n },\n limit: 3,\n }),\n Media.configure({\n uploadSoundSupport: props.uploadSoundSupport,\n }),\n CSSMark.configure({\n extraCSSRules: props.extraCSSRules,\n }),\n ];\n\n // Callers that don't pass spellCheck keep the browser default (on), as they did with the\n // slate-based editor. Players that have to default to off - extended-text-entry, see\n // PIE-978 - resolve that in their controller and pass an explicit false.\n const spellCheckEnabled = props.spellCheck !== false;\n\n const editor = useEditor(\n {\n extensions,\n immediatelyRender: false,\n editorProps: {\n attributes: editorAttributes(spellCheckEnabled),\n handleKeyDown(view, event) {\n if (props.onKeyDown) {\n return props.onKeyDown(event);\n }\n\n // Return false to let default behavior continue\n return false;\n },\n },\n editable: !props.disabled,\n content: normalizeInitialMarkup(props.markup),\n onUpdate: ({ editor, transaction }) => {\n if (transaction.isDone) {\n props.onChange?.(editor.getHTML());\n }\n },\n onBlur: ({ editor }) => {\n const otherToolbarOpened =\n editor._insertingImage ||\n editor._toolbarOpened ||\n editor.isActive('inline_dropdown') ||\n editor.isActive('explicit_constructed_response');\n\n if (otherToolbarOpened || !editor.schema) {\n return;\n }\n\n commitEditorContent(editor);\n },\n },\n [props.charactersLimit],\n );\n\n useEffect(() => {\n if (props.editorRef) {\n props.editorRef(editor);\n }\n }, [props.editorRef, editor]);\n\n useEffect(() => {\n editor?.setEditable(!props.disabled);\n }, [props.disabled, editor]);\n\n // useEditor only re-applies options on its own when it is called with an empty dependency\n // array, and this call site depends on charactersLimit, so a spellCheck change on a mounted\n // editor has to be pushed in. The rest of editorProps stays as the editor already has it, and\n // the attributes are merged rather than replaced so an attribute contributed by Tiptap or an\n // extension can't be dropped the way role=\"textbox\" was - see PIE-1015.\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const currentEditorProps = editor.options?.editorProps;\n const attributes = { ...currentEditorProps?.attributes, ...editorAttributes(spellCheckEnabled) };\n\n if (currentEditorProps?.attributes?.spellcheck === attributes.spellcheck) {\n return;\n }\n\n editor.setOptions({ editorProps: { ...currentEditorProps, attributes } });\n }, [spellCheckEnabled, editor]);\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n const nextMarkup = normalizeInitialMarkup(props.markup);\n\n if (nextMarkup !== editor.getHTML()) {\n editor.commands.setContent(nextMarkup, { emitUpdate: false });\n }\n }, [props.markup, editor]);\n\n useEffect(() => {\n Object.entries(cssVariables).forEach(([key, value]) => {\n document.documentElement.style.setProperty(key, value);\n });\n }, []);\n\n const editorState = useEditorState({\n editor,\n selector: (ctx) => ({\n isFocused: ctx.editor?.isFocused,\n }),\n });\n\n const sizeStyle = useMemo(() => {\n const { minWidth, width, maxWidth, minHeight, height, maxHeight } = props;\n\n return {\n width: valueToSize(width),\n minWidth: valueToSize(minWidth),\n maxWidth: valueToSize(maxWidth),\n height: valueToSize(height),\n minHeight: valueToSize(minHeight),\n maxHeight: valueToSize(maxHeight),\n };\n }, [props]);\n\n return (\n <EditorContainer\n {...{\n ...props,\n activePlugins: activePluginsToUse,\n toolbarOpts: toolbarOptsToUse,\n }}\n editorState={editorState}\n editor={editor}\n >\n {editor && (\n <StyledEditorContent\n style={{\n minHeight: sizeStyle.minHeight,\n height: sizeStyle.height,\n maxHeight: sizeStyle.maxHeight,\n }}\n showParagraph={showParagraphs && !showParagraphs.disabled}\n separateParagraph={separateParagraphs && !separateParagraphs.disabled}\n editor={editor}\n />\n )}\n </EditorContainer>\n );\n};\n\nconst StyledEditorContent = styled(EditorContent, {\n shouldForwardProp: (prop) => !['showParagraph', 'separateParagraph'].includes(prop),\n})(({ showParagraph, separateParagraph }) => ({\n display: 'flex',\n outline: 'none !important',\n '& .ProseMirror': {\n flex: 1,\n padding: '5px',\n maxHeight: '500px',\n outline: 'none !important',\n position: 'initial',\n\n // reset default margins for all block paragraphs/divs in the editor\n '& > p, & > div': {\n margin: '0',\n },\n\n // Out of flow so the caret stays at the start of the block; in-flow ::before pushes the caret after the hint text.\n // :only-child ensures the placeholder is hidden whenever the editor has other content (images, upload nodes, etc.)\n // and covers the type+backspace edge case where Tiptap only adds is-empty (not is-editor-empty).\n '& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child': {\n position: 'relative',\n },\n '& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before': {\n content: 'attr(data-placeholder)',\n position: 'absolute',\n left: 0,\n top: 0,\n color: '#9CA3AF',\n pointerEvents: 'none',\n whiteSpace: 'pre-wrap',\n },\n\n ...(showParagraph && {\n '& > p:has(+ p)::after, & > div:has(+ div)::after': {\n display: 'block',\n content: '\"¶\"',\n fontSize: '1em',\n color: '#146EB3',\n },\n }),\n ...(separateParagraph && {\n '& > p:has(+ p)': {\n marginBottom: '1em',\n },\n }),\n },\n}));\n\nexport default EditableHtml;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,mBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,mBAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,eAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,qBAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAEA,IAAAc,cAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,QAAA,GAAAhB,OAAA;AACA,IAAAiB,mBAAA,GAAAjB,OAAA;AACA,IAAAkB,2BAAA,GAAAlB,OAAA;AACA,IAAAmB,kBAAA,GAAAnB,OAAA;AACA,IAAAoB,aAAA,GAAApB,OAAA;AAOA,IAAAqB,KAAA,GAAArB,OAAA;AACA,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AI,CAAC;EAAA;AACrF,CAAC,CAAC,CAAC,UAAAE,KAAA;EAAA,IAAGP,aAAa,GAAAO,KAAA,CAAbP,aAAa;IAAEC,iBAAiB,GAAAM,KAAA,CAAjBN,iBAAiB;EAAA,OAAQ;IAC5CO,OAAO,EAAE,MAAM;IACfC,OAAO,EAAE,iBAAiB;IAC1B,gBAAgB,EAAA1O,aAAA,CAAAA,aAAA;MACd2O,IAAI,EAAE,CAAC;MACPC,OAAO,EAAE,KAAK;MACdhB,SAAS,EAAE,OAAO;MAClBc,OAAO,EAAE,iBAAiB;MAC1BlO,QAAQ,EAAE,SAAS;MAEnB;MACA,gBAAgB,EAAE;QAChBqO,MAAM,EAAE;MACV,CAAC;MAED;MACA;MACA;MACA,wFAAwF,EAAE;QACxFrO,QAAQ,EAAE;MACZ,CAAC;MACD,wGAAwG,EAAE;QACxGuK,OAAO,EAAE,wBAAwB;QACjCvK,QAAQ,EAAE,UAAU;QACpBsO,IAAI,EAAE,CAAC;QACPC,GAAG,EAAE,CAAC;QACNC,KAAK,EAAE,SAAS;QAChBC,aAAa,EAAE,MAAM;QACrBC,UAAU,EAAE;MACd;IAAC,GAEGjB,aAAa,IAAI;MACnB,kDAAkD,EAAE;QAClDQ,OAAO,EAAE,OAAO;QAChB1D,OAAO,EAAE,KAAK;QACdoE,QAAQ,EAAE,KAAK;QACfH,KAAK,EAAE;MACT;IACF,CAAC,GACGd,iBAAiB,IAAI;MACvB,gBAAgB,EAAE;QAChBkB,YAAY,EAAE;MAChB;IACF,CAAC;EAEL,CAAC;AAAA,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAA3N,OAAA,cAEWD,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"EditableHtml.js","names":["_react","_interopRequireWildcard","require","_debounce","_interopRequireDefault","_react2","_styles","_starterKit","_extensionTextStyle","_extensionCharacterCount","_extensionSuperscript","_extensionSubscript","_extensionTextAlign","_extensionImage","_extensionPlaceholder","_helper","_extendedTable","_extendedTableCell","_divNode","_ensureEmptyRootDiv","_ensureListItemContentIsDiv","_extensionTableRow","_responseArea","_math","_image","_media","_css","_extendedListItem","_headingParagraph","_TiptapContainer","_size","_extensions","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defaultToolbarOpts","position","alignment","alwaysVisible","showDone","doneOn","defaultResponseAreaProps","options","respAreaToolbar","onHandleAreaChange","DEFAULT_ACTIVE_PLUGINS","cssVariables","EditableHtml","exports","props","_props$pluginProps","_ref","pluginProps","showParagraphs","separateParagraphs","_useState","useState","_useState2","_slicedToArray2","pendingImages","setPendingImages","_useState3","_useState4","scheduled","setScheduled","toolbarOpts","removePendingImage","useCallback","imagePos","prev","next","img","pos","toolbarOptsToUse","commitEditorContent","editor","html","getHTML","markup","_props$onChange","onChange","_props$onDone","onDone","responseAreaPropsToUse","useMemo","responseAreaProps","onInlineDropdownToolbarClose","activePluginsToUse","_ref3","_ref2","customPlugins","otherPluginProps","_objectWithoutProperties2","filteredActivePlugins","activePlugins","pluginName","nameToUse","PLUGINS_MAP","pluginInfo","disabled","buildExtensions","math","textAlign","extraCSSRules","image","imageSupport","toolbar","table","responseArea","type","languageCharacters","languageCharactersProps","keyPadCharacterRef","setKeypadInteraction","media","extensions","TextAlign","configure","types","alignments","TextStyleKit","CharacterCount","limit","charactersLimit","StarterKit","trailingNode","node","notAfter","ExtendedListItem","DivNode","HeadingParagraph","EnsureEmptyRootIsDiv","EnsureListItemContentIsDiv","Placeholder","placeholder","showOnlyWhenEditable","showOnlyCurrent","includeChildren","ExtendedTable","TableRow","ExtendedTableHeader","ExtendedTableCell","ResponseAreaExtension","ExplicitConstructedResponseNode","DragInTheBlankNode","InlineDropdownNode","MathTemplatedNode","MathNode","SubScript","SuperScript","Image","ImageUploadNode","imageHandling","disableImageAlignmentButtons","_props$onDone2","onDelete","src","attrs","insertImageRequested","imageInfo","getHandler","_imageInfo","addedImage","onFinish","result","_cb","cb","callback","handler","focusHandler","debounce","detach","window","removeEventListener","_insertingImage","addEventListener","add","concat","_toConsumableArray2","maxImageWidth","maxImageHeight","Media","uploadSoundSupport","CSSMark","useEditor","immediatelyRender","editorProps","handleKeyDown","view","event","onKeyDown","editable","content","normalizeInitialMarkup","onUpdate","_ref4","transaction","isDone","_props$onChange2","onBlur","_ref5","otherToolbarOpened","_toolbarOpened","isActive","schema","useEffect","editorRef","setEditable","nextMarkup","commands","setContent","emitUpdate","entries","_ref6","_ref7","key","value","document","documentElement","style","setProperty","editorState","useEditorState","selector","ctx","_ctx$editor","isFocused","sizeStyle","minWidth","width","maxWidth","minHeight","height","maxHeight","valueToSize","createElement","_extends2","StyledEditorContent","showParagraph","separateParagraph","styled","EditorContent","shouldForwardProp","prop","includes","_ref8","display","outline","flex","padding","margin","left","top","color","pointerEvents","whiteSpace","fontSize","marginBottom","_default"],"sources":["../../src/components/EditableHtml.jsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport debounce from 'lodash-es/debounce';\nimport { EditorContent, useEditor, useEditorState } from '@tiptap/react';\nimport { styled } from '@mui/material/styles';\nimport StarterKit from '@tiptap/starter-kit';\nimport { TextStyleKit } from '@tiptap/extension-text-style';\nimport { CharacterCount } from '@tiptap/extension-character-count';\nimport SuperScript from '@tiptap/extension-superscript';\nimport SubScript from '@tiptap/extension-subscript';\nimport TextAlign from '@tiptap/extension-text-align';\nimport Image from '@tiptap/extension-image';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { normalizeInitialMarkup } from '../utils/helper';\n\nimport ExtendedTable from '../extensions/extended-table';\nimport { ExtendedTableCell, ExtendedTableHeader } from '../extensions/extended-table-cell';\nimport { DivNode } from '../extensions/div-node';\nimport { EnsureEmptyRootIsDiv } from '../extensions/ensure-empty-root-div';\nimport { EnsureListItemContentIsDiv } from '../extensions/ensure-list-item-content-is-div';\nimport { TableRow } from '@tiptap/extension-table-row';\nimport {\n DragInTheBlankNode,\n ExplicitConstructedResponseNode,\n InlineDropdownNode,\n MathTemplatedNode,\n ResponseAreaExtension,\n} from '../extensions/responseArea';\nimport { MathNode } from '../extensions/math';\nimport { ImageUploadNode } from '../extensions/image';\nimport { Media } from '../extensions/media';\nimport { CSSMark } from '../extensions/css';\nimport { ExtendedListItem } from '../extensions/extended-list-item';\nimport { HeadingParagraph } from '../extensions/heading-paragraph';\n\nimport EditorContainer from './TiptapContainer';\nimport { valueToSize } from '../utils/size';\nimport { buildExtensions, PLUGINS_MAP } from '../extensions';\n\nconst defaultToolbarOpts = {\n position: 'bottom',\n alignment: 'left',\n alwaysVisible: false,\n showDone: true,\n doneOn: 'blur',\n};\n\nconst defaultResponseAreaProps = {\n options: {},\n respAreaToolbar: () => {},\n onHandleAreaChange: () => {},\n};\n\nconst DEFAULT_ACTIVE_PLUGINS = [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'code',\n 'bulleted-list',\n 'numbered-list',\n 'image',\n 'math',\n 'languageCharacters',\n 'text-align',\n 'table',\n 'video',\n 'audio',\n 'responseArea',\n 'superscript',\n 'subscript',\n 'css',\n 'h3',\n 'undo',\n 'redo',\n];\n\nconst cssVariables = {\n '--white': '#fff',\n '--black': '#2e2b29',\n '--black-contrast': '#110f0e',\n '--gray-1': 'rgba(61, 37, 20, .05)',\n '--gray-2': 'rgba(61, 37, 20, .08)',\n '--gray-3': 'rgba(61, 37, 20, .12)',\n '--gray-4': 'rgba(53, 38, 28, .3)',\n '--gray-5': 'rgba(28, 25, 23, .6)',\n '--green': '#22c55e',\n '--purple': '#6a00f5',\n '--purple-contrast': '#5800cc',\n '--purple-light': 'rgba(88, 5, 255, .05)',\n '--yellow-contrast': '#facc15',\n '--yellow': 'rgba(250, 204, 21, .4)',\n '--yellow-light': '#fffae5',\n '--red': '#ff5c33',\n '--red-light': '#ffebe5',\n '--shadow': `0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`,\n};\n\nexport const EditableHtml = (props) => {\n const { showParagraphs, separateParagraphs } = props.pluginProps || {};\n const [pendingImages, setPendingImages] = useState([]);\n const [scheduled, setScheduled] = useState(false);\n const { toolbarOpts } = props;\n\n const removePendingImage = useCallback(\n (imagePos) => {\n setPendingImages((prev) => {\n const next = prev.filter((img) => img.pos !== imagePos);\n if (next.length === 0) {\n setScheduled(false);\n }\n return next;\n });\n },\n [setPendingImages],\n );\n\n const toolbarOptsToUse = {\n ...defaultToolbarOpts,\n ...toolbarOpts,\n };\n\n const commitEditorContent = useCallback(\n (editor) => {\n const html = editor.getHTML();\n\n if (props.markup !== html) {\n props.onChange?.(html);\n }\n\n if (toolbarOptsToUse.doneOn === 'blur') {\n props.onDone?.(html);\n }\n },\n [props.markup, props.onChange, props.onDone, toolbarOptsToUse.doneOn],\n );\n\n const responseAreaPropsToUse = useMemo(\n () => ({\n ...defaultResponseAreaProps,\n ...props.responseAreaProps,\n onInlineDropdownToolbarClose: commitEditorContent,\n }),\n [props.responseAreaProps, commitEditorContent],\n );\n\n const activePluginsToUse = useMemo(() => {\n let { customPlugins, ...otherPluginProps } = props.pluginProps || {};\n\n customPlugins = customPlugins || [];\n\n const filteredActivePlugins = (props.activePlugins || DEFAULT_ACTIVE_PLUGINS)?.filter((pluginName) => {\n const nameToUse = PLUGINS_MAP[pluginName] || pluginName;\n const pluginInfo = otherPluginProps[nameToUse] || {};\n\n return !pluginInfo || !pluginInfo.disabled;\n });\n\n return buildExtensions(filteredActivePlugins, customPlugins, {\n math: {},\n textAlign: props.textAlign,\n html: {},\n extraCSSRules: props.extraCSSRules || {},\n image: {\n ...props.imageSupport,\n },\n toolbar: {},\n table: {},\n responseArea: {\n type: responseAreaPropsToUse.type,\n },\n languageCharacters: props.languageCharactersProps,\n keyPadCharacterRef: {},\n setKeypadInteraction: {},\n media: {},\n });\n }, [props, responseAreaPropsToUse.type]);\n\n const extensions = [\n TextAlign.configure({\n types: ['heading', 'paragraph', 'div', 'headingParagraph', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'td', 'th'],\n alignments: ['left', 'right', 'center', 'justify'],\n }),\n TextStyleKit,\n CharacterCount.configure({\n limit: props.charactersLimit || 1000000,\n }),\n StarterKit.configure({\n trailingNode: {\n node: 'paragraph',\n notAfter: ['paragraph', 'div'],\n },\n }),\n ExtendedListItem,\n DivNode,\n HeadingParagraph,\n EnsureEmptyRootIsDiv,\n EnsureListItemContentIsDiv,\n Placeholder.configure({\n placeholder: props.placeholder,\n // show placeholder even when editor is focused\n showOnlyWhenEditable: true,\n showOnlyCurrent: false, // show on all empty nodes, not only the current one\n includeChildren: true,\n }),\n ExtendedTable,\n TableRow,\n ExtendedTableHeader,\n ExtendedTableCell,\n ResponseAreaExtension.configure(responseAreaPropsToUse),\n ExplicitConstructedResponseNode.configure(responseAreaPropsToUse),\n DragInTheBlankNode.configure(responseAreaPropsToUse),\n InlineDropdownNode.configure(responseAreaPropsToUse),\n MathTemplatedNode.configure(responseAreaPropsToUse),\n MathNode.configure({\n toolbarOpts: toolbarOptsToUse,\n math: props.pluginProps?.math || {},\n }),\n SubScript,\n SuperScript,\n Image,\n ImageUploadNode.configure({\n toolbarOpts: toolbarOptsToUse,\n imageHandling: {\n disableImageAlignmentButtons: props.disableImageAlignmentButtons,\n onDone: (editor) => props.onDone?.(editor.getHTML()),\n onDelete:\n props.imageSupport &&\n props.imageSupport.delete &&\n ((node) => {\n const { src } = node.attrs;\n\n props.imageSupport.delete(src, (e) => {\n removePendingImage(node.pos);\n });\n }),\n insertImageRequested:\n props.imageSupport &&\n ((editor, imageInfo, getHandler) => {\n const [addedImage, pos] = imageInfo;\n\n const onFinish = (result) => {\n let cb;\n\n if (scheduled && result) {\n // finish editing only on success\n cb = props.onChange;\n }\n\n removePendingImage(pos);\n cb?.(editor.getHTML());\n };\n\n const callback = () => {\n /**\n * The handler is the object through which the outer context\n * communicates file upload events like: fileChosen, cancel, progress\n */\n const handler = getHandler(onFinish);\n\n // If the user closes the file picker without choosing a file, the window regains\n // focus while _insertingImage is still true — drop the stale pending entry.\n const focusHandler = debounce(() => {\n const detach = () => window.removeEventListener('focus', focusHandler);\n\n if (!editor._insertingImage) {\n detach();\n return;\n }\n\n removePendingImage(pos);\n editor._insertingImage = false;\n detach();\n }, 500);\n\n window.addEventListener('focus', focusHandler);\n\n props.imageSupport.add(handler);\n };\n\n editor._insertingImage = true;\n setPendingImages((prev) => [...prev, addedImage]);\n callback();\n }),\n maxImageWidth: props.maxImageWidth,\n maxImageHeight: props.maxImageHeight,\n },\n limit: 3,\n }),\n Media.configure({\n uploadSoundSupport: props.uploadSoundSupport,\n }),\n CSSMark.configure({\n extraCSSRules: props.extraCSSRules,\n }),\n ];\n\n const editor = useEditor(\n {\n extensions,\n immediatelyRender: false,\n editorProps: {\n handleKeyDown(view, event) {\n if (props.onKeyDown) {\n return props.onKeyDown(event);\n }\n\n // Return false to let default behavior continue\n return false;\n },\n },\n editable: !props.disabled,\n content: normalizeInitialMarkup(props.markup),\n onUpdate: ({ editor, transaction }) => {\n if (transaction.isDone) {\n props.onChange?.(editor.getHTML());\n }\n },\n onBlur: ({ editor }) => {\n const otherToolbarOpened =\n editor._insertingImage ||\n editor._toolbarOpened ||\n editor.isActive('inline_dropdown') ||\n editor.isActive('explicit_constructed_response');\n\n if (otherToolbarOpened || !editor.schema) {\n return;\n }\n\n commitEditorContent(editor);\n },\n },\n [props.charactersLimit],\n );\n\n useEffect(() => {\n if (props.editorRef) {\n props.editorRef(editor);\n }\n }, [props.editorRef, editor]);\n\n useEffect(() => {\n editor?.setEditable(!props.disabled);\n }, [props.disabled, editor]);\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n const nextMarkup = normalizeInitialMarkup(props.markup);\n\n if (nextMarkup !== editor.getHTML()) {\n editor.commands.setContent(nextMarkup, { emitUpdate: false });\n }\n }, [props.markup, editor]);\n\n useEffect(() => {\n Object.entries(cssVariables).forEach(([key, value]) => {\n document.documentElement.style.setProperty(key, value);\n });\n }, []);\n\n const editorState = useEditorState({\n editor,\n selector: (ctx) => ({\n isFocused: ctx.editor?.isFocused,\n }),\n });\n\n const sizeStyle = useMemo(() => {\n const { minWidth, width, maxWidth, minHeight, height, maxHeight } = props;\n\n return {\n width: valueToSize(width),\n minWidth: valueToSize(minWidth),\n maxWidth: valueToSize(maxWidth),\n height: valueToSize(height),\n minHeight: valueToSize(minHeight),\n maxHeight: valueToSize(maxHeight),\n };\n }, [props]);\n\n return (\n <EditorContainer\n {...{\n ...props,\n activePlugins: activePluginsToUse,\n toolbarOpts: toolbarOptsToUse,\n }}\n editorState={editorState}\n editor={editor}\n >\n {editor && (\n <StyledEditorContent\n style={{\n minHeight: sizeStyle.minHeight,\n height: sizeStyle.height,\n maxHeight: sizeStyle.maxHeight,\n }}\n showParagraph={showParagraphs && !showParagraphs.disabled}\n separateParagraph={separateParagraphs && !separateParagraphs.disabled}\n editor={editor}\n />\n )}\n </EditorContainer>\n );\n};\n\nconst StyledEditorContent = styled(EditorContent, {\n shouldForwardProp: (prop) => !['showParagraph', 'separateParagraph'].includes(prop),\n})(({ showParagraph, separateParagraph }) => ({\n display: 'flex',\n outline: 'none !important',\n '& .ProseMirror': {\n flex: 1,\n padding: '5px',\n maxHeight: '500px',\n outline: 'none !important',\n position: 'initial',\n\n // reset default margins for all block paragraphs/divs in the editor\n '& > p, & > div': {\n margin: '0',\n },\n\n // Out of flow so the caret stays at the start of the block; in-flow ::before pushes the caret after the hint text.\n // :only-child ensures the placeholder is hidden whenever the editor has other content (images, upload nodes, etc.)\n // and covers the type+backspace edge case where Tiptap only adds is-empty (not is-editor-empty).\n '& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child': {\n position: 'relative',\n },\n '& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before': {\n content: 'attr(data-placeholder)',\n position: 'absolute',\n left: 0,\n top: 0,\n color: '#9CA3AF',\n pointerEvents: 'none',\n whiteSpace: 'pre-wrap',\n },\n\n ...(showParagraph && {\n '& > p:has(+ p)::after, & > div:has(+ div)::after': {\n display: 'block',\n content: '\"¶\"',\n fontSize: '1em',\n color: '#146EB3',\n },\n }),\n ...(separateParagraph && {\n '& > p:has(+ p)': {\n marginBottom: '1em',\n },\n }),\n },\n}));\n\nexport default EditableHtml;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,mBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,mBAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,eAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,qBAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAEA,IAAAc,cAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,QAAA,GAAAhB,OAAA;AACA,IAAAiB,mBAAA,GAAAjB,OAAA;AACA,IAAAkB,2BAAA,GAAAlB,OAAA;AACA,IAAAmB,kBAAA,GAAAnB,OAAA;AACA,IAAAoB,aAAA,GAAApB,OAAA;AAOA,IAAAqB,KAAA,GAAArB,OAAA;AACA,IAAAsB,MAAA,GAAAtB,OAAA;AACA,IAAAuB,MAAA,GAAAvB,OAAA;AACA,IAAAwB,IAAA,GAAAxB,OAAA;AACA,IAA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