@kerebron/extension-basic-editor 0.2.0 → 0.4.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.
Files changed (197) hide show
  1. package/README.md +4 -2
  2. package/esm/editor/src/CoreEditor.d.ts +24 -9
  3. package/esm/editor/src/CoreEditor.d.ts.map +1 -1
  4. package/esm/editor/src/CoreEditor.js +125 -70
  5. package/esm/editor/src/DummyEditorView.d.ts +60 -0
  6. package/esm/editor/src/DummyEditorView.d.ts.map +1 -0
  7. package/esm/editor/src/DummyEditorView.js +277 -0
  8. package/esm/editor/src/Extension.d.ts +15 -10
  9. package/esm/editor/src/Extension.d.ts.map +1 -1
  10. package/esm/editor/src/Extension.js +23 -3
  11. package/esm/editor/src/ExtensionManager.d.ts +9 -9
  12. package/esm/editor/src/ExtensionManager.d.ts.map +1 -1
  13. package/esm/editor/src/ExtensionManager.js +81 -74
  14. package/esm/editor/src/Mark.d.ts +11 -6
  15. package/esm/editor/src/Mark.d.ts.map +1 -1
  16. package/esm/editor/src/Mark.js +19 -2
  17. package/esm/editor/src/Node.d.ts +18 -13
  18. package/esm/editor/src/Node.d.ts.map +1 -1
  19. package/esm/editor/src/Node.js +22 -5
  20. package/esm/editor/src/commands/CommandManager.d.ts +14 -11
  21. package/esm/editor/src/commands/CommandManager.d.ts.map +1 -1
  22. package/esm/editor/src/commands/CommandManager.js +64 -6
  23. package/esm/editor/src/commands/baseCommandFactories.d.ts +3 -0
  24. package/esm/editor/src/commands/baseCommandFactories.d.ts.map +1 -0
  25. package/esm/editor/src/commands/baseCommandFactories.js +836 -0
  26. package/esm/editor/src/commands/keyCommandFactories.d.ts +3 -0
  27. package/esm/editor/src/commands/keyCommandFactories.d.ts.map +1 -0
  28. package/esm/editor/src/commands/keyCommandFactories.js +10 -0
  29. package/esm/editor/src/commands/mod.d.ts +5 -47
  30. package/esm/editor/src/commands/mod.d.ts.map +1 -1
  31. package/esm/editor/src/commands/mod.js +14 -866
  32. package/esm/editor/src/commands/replaceCommandFactories.d.ts +3 -0
  33. package/esm/editor/src/commands/replaceCommandFactories.d.ts.map +1 -0
  34. package/esm/editor/src/commands/replaceCommandFactories.js +94 -0
  35. package/esm/editor/src/commands/types.d.ts +18 -0
  36. package/esm/editor/src/commands/types.d.ts.map +1 -0
  37. package/esm/editor/src/commands/types.js +1 -0
  38. package/esm/editor/src/mod.d.ts +3 -0
  39. package/esm/editor/src/mod.d.ts.map +1 -1
  40. package/esm/editor/src/mod.js +3 -0
  41. package/esm/editor/src/nodeToTreeString.d.ts +8 -2
  42. package/esm/editor/src/nodeToTreeString.d.ts.map +1 -1
  43. package/esm/editor/src/nodeToTreeString.js +47 -29
  44. package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts +6 -0
  45. package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts.map +1 -0
  46. package/esm/editor/src/plugins/TrackSelecionPlugin.js +24 -0
  47. package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +2 -2
  48. package/esm/editor/src/plugins/keymap/keymap.d.ts +11 -0
  49. package/esm/editor/src/plugins/keymap/keymap.d.ts.map +1 -0
  50. package/esm/editor/src/plugins/keymap/keymap.js +125 -0
  51. package/esm/editor/src/plugins/keymap/mod.d.ts +2 -0
  52. package/esm/editor/src/plugins/keymap/mod.d.ts.map +1 -0
  53. package/esm/editor/src/plugins/keymap/mod.js +1 -0
  54. package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +4 -0
  55. package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +1 -0
  56. package/esm/editor/src/plugins/keymap/w3c-keyname.js +124 -0
  57. package/esm/editor/src/types.d.ts +30 -7
  58. package/esm/editor/src/types.d.ts.map +1 -1
  59. package/esm/editor/src/ui.d.ts +15 -0
  60. package/esm/editor/src/ui.d.ts.map +1 -0
  61. package/esm/editor/src/ui.js +16 -0
  62. package/esm/editor/src/utilities/SmartOutput.d.ts +41 -0
  63. package/esm/editor/src/utilities/SmartOutput.d.ts.map +1 -0
  64. package/esm/editor/src/utilities/SmartOutput.js +228 -0
  65. package/esm/editor/src/utilities/createNodeFromContent.d.ts +4 -3
  66. package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +1 -1
  67. package/esm/editor/src/utilities/createNodeFromContent.js +4 -5
  68. package/esm/editor/src/utilities/getHtmlAttributes.d.ts +8 -3
  69. package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +1 -1
  70. package/esm/editor/src/utilities/getShadowRoot.d.ts +2 -0
  71. package/esm/editor/src/utilities/getShadowRoot.d.ts.map +1 -0
  72. package/esm/editor/src/utilities/getShadowRoot.js +16 -0
  73. package/esm/editor/src/utilities/mod.d.ts +3 -0
  74. package/esm/editor/src/utilities/mod.d.ts.map +1 -1
  75. package/esm/editor/src/utilities/mod.js +3 -0
  76. package/esm/editor/src/utilities/toRawTextResult.d.ts +3 -0
  77. package/esm/editor/src/utilities/toRawTextResult.d.ts.map +1 -0
  78. package/esm/editor/src/utilities/toRawTextResult.js +21 -0
  79. package/esm/extension-basic-editor/src/ExtensionBaseKeymap.d.ts +1 -2
  80. package/esm/extension-basic-editor/src/ExtensionBaseKeymap.d.ts.map +1 -1
  81. package/esm/extension-basic-editor/src/ExtensionBaseKeymap.js +40 -14
  82. package/esm/extension-basic-editor/src/ExtensionBasicCodeEditor.d.ts +11 -0
  83. package/esm/extension-basic-editor/src/ExtensionBasicCodeEditor.d.ts.map +1 -0
  84. package/esm/extension-basic-editor/src/ExtensionBasicCodeEditor.js +71 -0
  85. package/esm/extension-basic-editor/src/ExtensionBasicEditor.d.ts +23 -9
  86. package/esm/extension-basic-editor/src/ExtensionBasicEditor.d.ts.map +1 -1
  87. package/esm/extension-basic-editor/src/ExtensionBasicEditor.js +38 -8
  88. package/esm/extension-basic-editor/src/ExtensionDropcursor.d.ts +7 -0
  89. package/esm/extension-basic-editor/src/ExtensionDropcursor.d.ts.map +1 -1
  90. package/esm/extension-basic-editor/src/ExtensionDropcursor.js +211 -1
  91. package/esm/extension-basic-editor/src/ExtensionGapcursor.d.ts +21 -1
  92. package/esm/extension-basic-editor/src/ExtensionGapcursor.d.ts.map +1 -1
  93. package/esm/extension-basic-editor/src/ExtensionGapcursor.js +239 -1
  94. package/esm/extension-basic-editor/src/ExtensionHistory.d.ts +4 -3
  95. package/esm/extension-basic-editor/src/ExtensionHistory.d.ts.map +1 -1
  96. package/esm/extension-basic-editor/src/ExtensionHistory.js +29 -3
  97. package/esm/extension-basic-editor/src/ExtensionHtml.d.ts.map +1 -1
  98. package/esm/extension-basic-editor/src/ExtensionHtml.js +7 -4
  99. package/esm/extension-basic-editor/src/ExtensionMediaUpload.d.ts +24 -0
  100. package/esm/extension-basic-editor/src/ExtensionMediaUpload.d.ts.map +1 -0
  101. package/esm/extension-basic-editor/src/ExtensionMediaUpload.js +176 -0
  102. package/esm/extension-basic-editor/src/ExtensionSelection.d.ts +11 -0
  103. package/esm/extension-basic-editor/src/ExtensionSelection.d.ts.map +1 -0
  104. package/esm/extension-basic-editor/src/ExtensionSelection.js +237 -0
  105. package/esm/extension-basic-editor/src/MarkBookmark.d.ts.map +1 -1
  106. package/esm/extension-basic-editor/src/MarkChange.d.ts.map +1 -1
  107. package/esm/extension-basic-editor/src/MarkCode.d.ts +4 -7
  108. package/esm/extension-basic-editor/src/MarkCode.d.ts.map +1 -1
  109. package/esm/extension-basic-editor/src/MarkCode.js +2 -11
  110. package/esm/extension-basic-editor/src/MarkHighlight.d.ts +8 -0
  111. package/esm/extension-basic-editor/src/MarkHighlight.d.ts.map +1 -0
  112. package/esm/extension-basic-editor/src/MarkHighlight.js +43 -0
  113. package/esm/extension-basic-editor/src/MarkItalic.d.ts +4 -6
  114. package/esm/extension-basic-editor/src/MarkItalic.d.ts.map +1 -1
  115. package/esm/extension-basic-editor/src/MarkItalic.js +2 -11
  116. package/esm/extension-basic-editor/src/MarkLink.d.ts +1 -11
  117. package/esm/extension-basic-editor/src/MarkLink.d.ts.map +1 -1
  118. package/esm/extension-basic-editor/src/MarkLink.js +0 -32
  119. package/esm/extension-basic-editor/src/MarkStrike.d.ts +11 -0
  120. package/esm/extension-basic-editor/src/MarkStrike.d.ts.map +1 -0
  121. package/esm/extension-basic-editor/src/MarkStrike.js +39 -0
  122. package/esm/extension-basic-editor/src/MarkStrong.d.ts +4 -7
  123. package/esm/extension-basic-editor/src/MarkStrong.d.ts.map +1 -1
  124. package/esm/extension-basic-editor/src/MarkStrong.js +2 -11
  125. package/esm/extension-basic-editor/src/MarkTextColor.d.ts +8 -0
  126. package/esm/extension-basic-editor/src/MarkTextColor.d.ts.map +1 -0
  127. package/esm/extension-basic-editor/src/MarkTextColor.js +35 -0
  128. package/esm/extension-basic-editor/src/MarkUnderline.d.ts +3 -5
  129. package/esm/extension-basic-editor/src/MarkUnderline.d.ts.map +1 -1
  130. package/esm/extension-basic-editor/src/MarkUnderline.js +2 -11
  131. package/esm/extension-basic-editor/src/NodeAside.d.ts +0 -3
  132. package/esm/extension-basic-editor/src/NodeAside.d.ts.map +1 -1
  133. package/esm/extension-basic-editor/src/NodeAside.js +0 -8
  134. package/esm/extension-basic-editor/src/NodeBlockquote.d.ts +3 -6
  135. package/esm/extension-basic-editor/src/NodeBlockquote.d.ts.map +1 -1
  136. package/esm/extension-basic-editor/src/NodeBlockquote.js +2 -11
  137. package/esm/extension-basic-editor/src/NodeBulletList.d.ts +4 -7
  138. package/esm/extension-basic-editor/src/NodeBulletList.d.ts.map +1 -1
  139. package/esm/extension-basic-editor/src/NodeBulletList.js +2 -11
  140. package/esm/extension-basic-editor/src/NodeCodeBlock.d.ts +9 -0
  141. package/esm/extension-basic-editor/src/NodeCodeBlock.d.ts.map +1 -0
  142. package/esm/extension-basic-editor/src/NodeCodeBlock.js +58 -0
  143. package/esm/extension-basic-editor/src/NodeDefinitionDesc.d.ts +8 -0
  144. package/esm/extension-basic-editor/src/NodeDefinitionDesc.d.ts.map +1 -0
  145. package/esm/extension-basic-editor/src/NodeDefinitionDesc.js +29 -0
  146. package/esm/extension-basic-editor/src/NodeDefinitionList.d.ts +13 -0
  147. package/esm/extension-basic-editor/src/NodeDefinitionList.d.ts.map +1 -0
  148. package/esm/extension-basic-editor/src/NodeDefinitionList.js +41 -0
  149. package/esm/extension-basic-editor/src/NodeDefinitionTerm.d.ts +8 -0
  150. package/esm/extension-basic-editor/src/NodeDefinitionTerm.d.ts.map +1 -0
  151. package/esm/extension-basic-editor/src/NodeDefinitionTerm.js +29 -0
  152. package/esm/extension-basic-editor/src/NodeDocumentCode.d.ts +7 -0
  153. package/esm/extension-basic-editor/src/NodeDocumentCode.d.ts.map +1 -0
  154. package/esm/extension-basic-editor/src/NodeDocumentCode.js +37 -0
  155. package/esm/extension-basic-editor/src/NodeFrontmatter.d.ts +8 -0
  156. package/esm/extension-basic-editor/src/NodeFrontmatter.d.ts.map +1 -0
  157. package/esm/extension-basic-editor/src/NodeFrontmatter.js +29 -0
  158. package/esm/extension-basic-editor/src/NodeHardBreak.d.ts +5 -2
  159. package/esm/extension-basic-editor/src/NodeHardBreak.d.ts.map +1 -1
  160. package/esm/extension-basic-editor/src/NodeHardBreak.js +40 -53
  161. package/esm/extension-basic-editor/src/NodeHeading.d.ts +3 -14
  162. package/esm/extension-basic-editor/src/NodeHeading.d.ts.map +1 -1
  163. package/esm/extension-basic-editor/src/NodeHeading.js +2 -15
  164. package/esm/extension-basic-editor/src/NodeHorizontalRule.d.ts +4 -4
  165. package/esm/extension-basic-editor/src/NodeHorizontalRule.d.ts.map +1 -1
  166. package/esm/extension-basic-editor/src/NodeHorizontalRule.js +1 -2
  167. package/esm/extension-basic-editor/src/NodeListItem.d.ts +7 -5
  168. package/esm/extension-basic-editor/src/NodeListItem.d.ts.map +1 -1
  169. package/esm/extension-basic-editor/src/NodeListItem.js +10 -15
  170. package/esm/extension-basic-editor/src/NodeMath.d.ts +8 -0
  171. package/esm/extension-basic-editor/src/NodeMath.d.ts.map +1 -0
  172. package/esm/extension-basic-editor/src/NodeMath.js +112 -0
  173. package/esm/extension-basic-editor/src/NodeOrderedList.d.ts +3 -6
  174. package/esm/extension-basic-editor/src/NodeOrderedList.d.ts.map +1 -1
  175. package/esm/extension-basic-editor/src/NodeOrderedList.js +4 -14
  176. package/esm/extension-basic-editor/src/NodeParagraph.d.ts +2 -5
  177. package/esm/extension-basic-editor/src/NodeParagraph.d.ts.map +1 -1
  178. package/esm/extension-basic-editor/src/NodeParagraph.js +2 -11
  179. package/esm/extension-basic-editor/src/NodeTaskItem.d.ts +24 -0
  180. package/esm/extension-basic-editor/src/NodeTaskItem.d.ts.map +1 -0
  181. package/esm/extension-basic-editor/src/NodeTaskItem.js +153 -0
  182. package/esm/extension-basic-editor/src/NodeTaskList.d.ts +11 -0
  183. package/esm/extension-basic-editor/src/NodeTaskList.d.ts.map +1 -0
  184. package/esm/extension-basic-editor/src/NodeTaskList.js +38 -0
  185. package/esm/extension-basic-editor/src/NodeText.d.ts +0 -1
  186. package/esm/extension-basic-editor/src/NodeText.d.ts.map +1 -1
  187. package/esm/extension-basic-editor/src/NodeText.js +0 -6
  188. package/esm/extension-basic-editor/src/NodeVideo.d.ts +8 -0
  189. package/esm/extension-basic-editor/src/NodeVideo.d.ts.map +1 -0
  190. package/esm/extension-basic-editor/src/NodeVideo.js +58 -0
  191. package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.d.ts +24 -0
  192. package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.d.ts.map +1 -0
  193. package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.js +35 -0
  194. package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.d.ts +25 -0
  195. package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.d.ts.map +1 -0
  196. package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.js +96 -0
  197. package/package.json +29 -6
@@ -1,5 +1,243 @@
1
- import { gapCursor } from 'prosemirror-gapcursor';
1
+ import { NodeSelection, Plugin, Selection, TextSelection, } from 'prosemirror-state';
2
+ import { Fragment, Slice } from 'prosemirror-model';
3
+ import { Decoration, DecorationSet } from 'prosemirror-view';
2
4
  import { Extension } from '../../editor/src/mod.js';
5
+ import { keydownHandler } from '../../editor/src/plugins/keymap/mod.js';
6
+ /// Gap cursor selections are represented using this class. Its
7
+ /// `$anchor` and `$head` properties both point at the cursor position.
8
+ export class GapCursor extends Selection {
9
+ /// Create a gap cursor.
10
+ constructor($pos) {
11
+ super($pos, $pos);
12
+ this.visible = false;
13
+ }
14
+ map(doc, mapping) {
15
+ let $pos = doc.resolve(mapping.map(this.head));
16
+ return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
17
+ }
18
+ content() {
19
+ return Slice.empty;
20
+ }
21
+ eq(other) {
22
+ return other instanceof GapCursor && other.head == this.head;
23
+ }
24
+ toJSON() {
25
+ return { type: 'gapcursor', pos: this.head };
26
+ }
27
+ /// @internal
28
+ static fromJSONToGapCursor(doc, json) {
29
+ if (typeof json.pos != 'number') {
30
+ throw new RangeError('Invalid input for GapCursor.fromJSON');
31
+ }
32
+ return new GapCursor(doc.resolve(json.pos));
33
+ }
34
+ /// @internal
35
+ getBookmark() {
36
+ return new GapBookmark(this.anchor);
37
+ }
38
+ /// @internal
39
+ static valid($pos) {
40
+ let parent = $pos.parent;
41
+ if (parent.isTextblock || !closedBefore($pos) || !closedAfter($pos)) {
42
+ return false;
43
+ }
44
+ let override = parent.type.spec.allowGapCursor;
45
+ if (override != null)
46
+ return override;
47
+ let deflt = parent.contentMatchAt($pos.index()).defaultType;
48
+ return deflt && deflt.isTextblock;
49
+ }
50
+ /// @internal
51
+ static findGapCursorFrom($pos, dir, mustMove = false) {
52
+ search: for (;;) {
53
+ if (!mustMove && GapCursor.valid($pos))
54
+ return $pos;
55
+ let pos = $pos.pos, next = null;
56
+ // Scan up from this position
57
+ for (let d = $pos.depth;; d--) {
58
+ let parent = $pos.node(d);
59
+ if (dir > 0 ? $pos.indexAfter(d) < parent.childCount : $pos.index(d) > 0) {
60
+ next = parent.child(dir > 0 ? $pos.indexAfter(d) : $pos.index(d) - 1);
61
+ break;
62
+ }
63
+ else if (d == 0) {
64
+ return null;
65
+ }
66
+ pos += dir;
67
+ let $cur = $pos.doc.resolve(pos);
68
+ if (GapCursor.valid($cur))
69
+ return $cur;
70
+ }
71
+ // And then down into the next node
72
+ for (;;) {
73
+ let inside = dir > 0 ? next.firstChild : next.lastChild;
74
+ if (!inside) {
75
+ if (next.isAtom && !next.isText && !NodeSelection.isSelectable(next)) {
76
+ $pos = $pos.doc.resolve(pos + next.nodeSize * dir);
77
+ mustMove = false;
78
+ continue search;
79
+ }
80
+ break;
81
+ }
82
+ next = inside;
83
+ pos += dir;
84
+ let $cur = $pos.doc.resolve(pos);
85
+ if (GapCursor.valid($cur))
86
+ return $cur;
87
+ }
88
+ return null;
89
+ }
90
+ }
91
+ }
92
+ Selection.jsonID('gapcursor', GapCursor);
93
+ class GapBookmark {
94
+ constructor(pos) {
95
+ Object.defineProperty(this, "pos", {
96
+ enumerable: true,
97
+ configurable: true,
98
+ writable: true,
99
+ value: pos
100
+ });
101
+ }
102
+ map(mapping) {
103
+ return new GapBookmark(mapping.map(this.pos));
104
+ }
105
+ resolve(doc) {
106
+ let $pos = doc.resolve(this.pos);
107
+ return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
108
+ }
109
+ }
110
+ function closedBefore($pos) {
111
+ for (let d = $pos.depth; d >= 0; d--) {
112
+ let index = $pos.index(d), parent = $pos.node(d);
113
+ // At the start of this parent, look at next one
114
+ if (index == 0) {
115
+ if (parent.type.spec.isolating)
116
+ return true;
117
+ continue;
118
+ }
119
+ // See if the node before (or its first ancestor) is closed
120
+ for (let before = parent.child(index - 1);; before = before.lastChild) {
121
+ if ((before.childCount == 0 && !before.inlineContent) || before.isAtom ||
122
+ before.type.spec.isolating)
123
+ return true;
124
+ if (before.inlineContent)
125
+ return false;
126
+ }
127
+ }
128
+ // Hit start of document
129
+ return true;
130
+ }
131
+ function closedAfter($pos) {
132
+ for (let d = $pos.depth; d >= 0; d--) {
133
+ let index = $pos.indexAfter(d), parent = $pos.node(d);
134
+ if (index == parent.childCount) {
135
+ if (parent.type.spec.isolating)
136
+ return true;
137
+ continue;
138
+ }
139
+ for (let after = parent.child(index);; after = after.firstChild) {
140
+ if ((after.childCount == 0 && !after.inlineContent) || after.isAtom ||
141
+ after.type.spec.isolating)
142
+ return true;
143
+ if (after.inlineContent)
144
+ return false;
145
+ }
146
+ }
147
+ return true;
148
+ }
149
+ /// Create a gap cursor plugin. When enabled, this will capture clicks
150
+ /// near and arrow-key-motion past places that don't have a normally
151
+ /// selectable position nearby, and create a gap cursor selection for
152
+ /// them. The cursor is drawn as an element with class
153
+ /// `kb-gapcursor`. You can either include
154
+ /// `style/gapcursor.css` from the package's directory or add your own
155
+ /// styles to make it visible.
156
+ function gapCursor() {
157
+ return new Plugin({
158
+ props: {
159
+ decorations: drawGapCursor,
160
+ createSelectionBetween(_view, $anchor, $head) {
161
+ return $anchor.pos == $head.pos && GapCursor.valid($head)
162
+ ? new GapCursor($head)
163
+ : null;
164
+ },
165
+ handleClick,
166
+ handleKeyDown,
167
+ handleDOMEvents: { beforeinput: beforeinput },
168
+ },
169
+ });
170
+ }
171
+ const handleKeyDown = keydownHandler({
172
+ 'ArrowLeft': arrow('horiz', -1),
173
+ 'ArrowRight': arrow('horiz', 1),
174
+ 'ArrowUp': arrow('vert', -1),
175
+ 'ArrowDown': arrow('vert', 1),
176
+ });
177
+ function arrow(axis, dir) {
178
+ const dirStr = axis == 'vert'
179
+ ? (dir > 0 ? 'down' : 'up')
180
+ : (dir > 0 ? 'right' : 'left');
181
+ return function (state, dispatch, view) {
182
+ let sel = state.selection;
183
+ let $start = dir > 0 ? sel.$to : sel.$from, mustMove = sel.empty;
184
+ if (sel instanceof TextSelection) {
185
+ if (!view.endOfTextblock(dirStr) || $start.depth == 0)
186
+ return false;
187
+ mustMove = false;
188
+ $start = state.doc.resolve(dir > 0 ? $start.after() : $start.before());
189
+ }
190
+ let $found = GapCursor.findGapCursorFrom($start, dir, mustMove);
191
+ if (!$found)
192
+ return false;
193
+ if (dispatch)
194
+ dispatch(state.tr.setSelection(new GapCursor($found)));
195
+ return true;
196
+ };
197
+ }
198
+ function handleClick(view, pos, event) {
199
+ if (!view || !view.editable)
200
+ return false;
201
+ let $pos = view.state.doc.resolve(pos);
202
+ if (!GapCursor.valid($pos))
203
+ return false;
204
+ let clickPos = view.posAtCoords({ left: event.clientX, top: event.clientY });
205
+ if (clickPos && clickPos.inside > -1 &&
206
+ NodeSelection.isSelectable(view.state.doc.nodeAt(clickPos.inside)))
207
+ return false;
208
+ view.dispatch(view.state.tr.setSelection(new GapCursor($pos)));
209
+ return true;
210
+ }
211
+ // This is a hack that, when a composition starts while a gap cursor
212
+ // is active, quickly creates an inline context for the composition to
213
+ // happen in, to avoid it being aborted by the DOM selection being
214
+ // moved into a valid position.
215
+ function beforeinput(view, event) {
216
+ if (event.inputType != 'insertCompositionText' ||
217
+ !(view.state.selection instanceof GapCursor))
218
+ return false;
219
+ let { $from } = view.state.selection;
220
+ let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
221
+ if (!insert)
222
+ return false;
223
+ let frag = Fragment.empty;
224
+ for (let i = insert.length - 1; i >= 0; i--) {
225
+ frag = Fragment.from(insert[i].createAndFill(null, frag));
226
+ }
227
+ let tr = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
228
+ tr.setSelection(TextSelection.near(tr.doc.resolve($from.pos + 1)));
229
+ view.dispatch(tr);
230
+ return false;
231
+ }
232
+ function drawGapCursor(state) {
233
+ if (!(state.selection instanceof GapCursor))
234
+ return null;
235
+ let node = document.createElement('div');
236
+ node.className = 'kb-gapcursor';
237
+ return DecorationSet.create(state.doc, [
238
+ Decoration.widget(state.selection.head, node, { key: 'gapcursor' }),
239
+ ]);
240
+ }
3
241
  export class ExtensionGapcursor extends Extension {
4
242
  constructor() {
5
243
  super(...arguments);
@@ -1,13 +1,14 @@
1
- import { Plugin } from 'prosemirror-state';
1
+ import { Command, Plugin } from 'prosemirror-state';
2
2
  import { type CoreEditor, Extension } from '../../editor/src/mod.js';
3
- import { type Commands, type CommandShortcuts } from '../../editor/src/commands/mod.js';
3
+ import { type CommandFactories, type CommandShortcuts } from '../../editor/src/commands/mod.js';
4
+ export declare const undoInputRule: Command;
4
5
  export declare class ExtensionHistory extends Extension {
5
6
  name: string;
6
7
  options: {
7
8
  depth: number;
8
9
  newGroupDelay: number;
9
10
  };
10
- getCommands(editor: CoreEditor): Partial<Commands>;
11
+ getCommandFactories(editor: CoreEditor): Partial<CommandFactories>;
11
12
  getKeyboardShortcuts(): Partial<CommandShortcuts>;
12
13
  getProseMirrorPlugins(): Plugin[];
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionHistory.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionHistory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAE1C,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,IAAI,SAAa;IAEjB,OAAO;;;MAGL;IAEO,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQlD,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAiBjD,qBAAqB,IAAI,MAAM,EAAE;CAK3C"}
1
+ {"version":3,"file":"ExtensionHistory.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionHistory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAI1C,eAAO,MAAM,aAAa,EAAE,OA4B3B,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,IAAI,SAAa;IAEjB,OAAO;;;MAGL;IAEO,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAQlE,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAkBjD,qBAAqB,IAAI,MAAM,EAAE;CAK3C"}
@@ -1,6 +1,31 @@
1
1
  import { history, redo, undo } from 'prosemirror-history';
2
- import { undoInputRule } from 'prosemirror-inputrules';
3
2
  import { Extension } from '../../editor/src/mod.js';
3
+ /// This is a command that will undo an input rule, if applying such a
4
+ /// rule was the last thing that the user did.
5
+ export const undoInputRule = (state, dispatch) => {
6
+ let plugins = state.plugins;
7
+ for (let i = 0; i < plugins.length; i++) {
8
+ let plugin = plugins[i], undoable;
9
+ if (plugin.spec.isInputRules && (undoable = plugin.getState(state))) {
10
+ if (dispatch) {
11
+ let tr = state.tr, toUndo = undoable.transform;
12
+ for (let j = toUndo.steps.length - 1; j >= 0; j--) {
13
+ tr.step(toUndo.steps[j].invert(toUndo.docs[j]));
14
+ }
15
+ if (undoable.text) {
16
+ let marks = tr.doc.resolve(undoable.from).marks();
17
+ tr.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks));
18
+ }
19
+ else {
20
+ tr.delete(undoable.from, undoable.to);
21
+ }
22
+ dispatch(tr);
23
+ }
24
+ return true;
25
+ }
26
+ }
27
+ return false;
28
+ };
4
29
  export class ExtensionHistory extends Extension {
5
30
  constructor() {
6
31
  super(...arguments);
@@ -20,7 +45,7 @@ export class ExtensionHistory extends Extension {
20
45
  }
21
46
  });
22
47
  }
23
- getCommands(editor) {
48
+ getCommandFactories(editor) {
24
49
  return {
25
50
  'undo': () => undo,
26
51
  'redo': () => redo,
@@ -28,8 +53,9 @@ export class ExtensionHistory extends Extension {
28
53
  };
29
54
  }
30
55
  getKeyboardShortcuts() {
56
+ // https://stackoverflow.com/a/73619128
31
57
  const mac = typeof navigator != 'undefined'
32
- ? /Mac|iP(hone|[oa]d)/.test(navigator.platform)
58
+ ? /Mac|iP(hone|[oa]d)/.test(navigator?.platform)
33
59
  : false;
34
60
  const shortcuts = {
35
61
  'Backspace': 'undoInputRule',
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionHtml.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionHtml.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,IAAI,EACJ,KAAK,YAAY,EACjB,MAAM,EACP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAErF,MAAM,MAAM,4BAA4B,GAAG;IACzC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAWR;AAqBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAQ5D;AA+BD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,IAAI,CAgBN;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,QAAQ,CAiBV;AAED,qBAAa,aAAc,SAAQ,SAAS;IAC1C,IAAI,SAAU;IAEL,aAAa,CACpB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;CAa7B"}
1
+ {"version":3,"file":"ExtensionHtml.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionHtml.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,IAAI,EACJ,KAAK,YAAY,EACjB,MAAM,EACP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAErF,MAAM,MAAM,4BAA4B,GAAG;IACzC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAaR;AAqBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAQ5D;AA+BD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,IAAI,CAgBN;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,QAAQ,CAiBV;AAED,qBAAa,aAAc,SAAQ,SAAS;IAC1C,IAAI,SAAU;IAEL,aAAa,CACpB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;CAe7B"}
@@ -1,7 +1,8 @@
1
1
  import { DOMParser, DOMSerializer, Schema, } from 'prosemirror-model';
2
2
  import { Extension } from '../../editor/src/mod.js';
3
3
  export function getHTMLFromFragment(fragment, schema) {
4
- const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
4
+ const document = globalThis.document;
5
+ const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment, { document });
5
6
  const temporaryDocument = document.implementation.createHTMLDocument();
6
7
  const container = temporaryDocument.createElement('div');
7
8
  container.appendChild(documentFragment);
@@ -93,10 +94,12 @@ export class ExtensionHtml extends Extension {
93
94
  const config = this.config;
94
95
  return {
95
96
  'text/html': {
96
- fromDoc(document) {
97
- return getHTMLFromFragment(document.content, editor.schema);
97
+ fromDoc: async (document) => {
98
+ const html = getHTMLFromFragment(document.content, editor.schema);
99
+ return new TextEncoder().encode(html);
98
100
  },
99
- toDoc(html) {
101
+ toDoc: async (buffer) => {
102
+ const html = new TextDecoder().decode(buffer);
100
103
  return createNodeFromHTML(html, editor.schema);
101
104
  },
102
105
  },
@@ -0,0 +1,24 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { Extension } from '../../editor/src/mod.js';
3
+ export interface MediaUploadOptions {
4
+ /** Maximum file size in bytes (default: 10MB for images) */
5
+ maxFileSize?: number;
6
+ /** Maximum file size for videos (default: 50MB) */
7
+ maxVideoFileSize?: number;
8
+ /** Allowed image MIME types */
9
+ allowedImageTypes?: string[];
10
+ /** Allowed video MIME types */
11
+ allowedVideoTypes?: string[];
12
+ /** Use object URLs for videos instead of base64 (default: true) */
13
+ useObjectURLForVideos?: boolean;
14
+ /** Custom upload handler. Returns the URL of uploaded media. */
15
+ uploadHandler?: (file: File) => Promise<string>;
16
+ }
17
+ /** Extension that adds media upload support via drag & drop and paste */
18
+ export declare class ExtensionMediaUpload extends Extension {
19
+ protected config: Partial<MediaUploadOptions>;
20
+ name: string;
21
+ constructor(config?: Partial<MediaUploadOptions>);
22
+ getProseMirrorPlugins(): Plugin[];
23
+ }
24
+ //# sourceMappingURL=ExtensionMediaUpload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionMediaUpload.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionMediaUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,+BAA+B;IAC/B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B,+BAA+B;IAC/B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B,mEAAmE;IACnE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,gEAAgE;IAChE,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACjD;AA+ND,yEAAyE;AACzE,qBAAa,oBAAqB,SAAQ,SAAS;cAGlB,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC;IAFlE,IAAI,SAAiB;gBAEU,MAAM,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAI9D,qBAAqB,IAAI,MAAM,EAAE;CAG3C"}
@@ -0,0 +1,176 @@
1
+ import { Plugin, PluginKey } from 'prosemirror-state';
2
+ import { Extension } from '../../editor/src/mod.js';
3
+ const mediaUploadKey = new PluginKey('mediaUpload');
4
+ /** Convert a File to a base64 data URL */
5
+ function fileToDataURL(file) {
6
+ return new Promise((resolve, reject) => {
7
+ const reader = new FileReader();
8
+ reader.onload = () => resolve(reader.result);
9
+ reader.onerror = reject;
10
+ reader.readAsDataURL(file);
11
+ });
12
+ }
13
+ /** Convert a File to an object URL (better for videos) */
14
+ function fileToObjectURL(file) {
15
+ return URL.createObjectURL(file);
16
+ }
17
+ /** Check if a file is an image */
18
+ function isImage(file, allowedTypes) {
19
+ return allowedTypes.some((type) => file.type.match(type));
20
+ }
21
+ /** Check if a file is a video */
22
+ function isVideo(file, allowedTypes) {
23
+ return allowedTypes.some((type) => file.type.match(type));
24
+ }
25
+ /** Insert an image into the editor at the given position */
26
+ function insertImage(view, pos, src, alt, title) {
27
+ const { schema } = view.state;
28
+ const imageType = schema.nodes.image;
29
+ if (!imageType) {
30
+ console.warn('Image node type not found in schema');
31
+ return;
32
+ }
33
+ const node = imageType.create({ src, alt, title });
34
+ const transaction = view.state.tr.insert(pos, node);
35
+ view.dispatch(transaction);
36
+ }
37
+ /** Insert a video into the editor at the given position */
38
+ function insertVideo(view, pos, src, title, width, height) {
39
+ const { schema } = view.state;
40
+ const videoType = schema.nodes.video;
41
+ if (!videoType) {
42
+ console.warn('Video node type not found in schema');
43
+ return;
44
+ }
45
+ const node = videoType.create({ src, title, width, height, controls: true });
46
+ const transaction = view.state.tr.insert(pos, node);
47
+ view.dispatch(transaction);
48
+ }
49
+ /** Handle media files (images and videos) from drop or paste events */
50
+ async function handleMediaFiles(view, files, pos, options) {
51
+ const { maxFileSize = 10 * 1024 * 1024, // 10MB for images
52
+ maxVideoFileSize = 50 * 1024 * 1024, // 50MB for videos
53
+ allowedImageTypes = ['^image/'], allowedVideoTypes = ['^video/'], uploadHandler, } = options;
54
+ for (const file of files) {
55
+ const isImageFile = isImage(file, allowedImageTypes);
56
+ const isVideoFile = isVideo(file, allowedVideoTypes);
57
+ // Skip if not an image or video
58
+ if (!isImageFile && !isVideoFile) {
59
+ continue;
60
+ }
61
+ // Check file size
62
+ const sizeLimit = isVideoFile ? maxVideoFileSize : maxFileSize;
63
+ if (file.size > sizeLimit) {
64
+ console.warn(`${isVideoFile ? 'Video' : 'Image'} file "${file.name}" is too large (${(file.size / 1024 / 1024).toFixed(2)}MB). Maximum size is ${(sizeLimit / 1024 / 1024).toFixed(2)}MB.`);
65
+ continue;
66
+ }
67
+ try {
68
+ // Upload or convert to data URL
69
+ console.log(`Processing ${isVideoFile ? 'video' : 'image'}: ${file.name} (${(file.size / 1024 / 1024).toFixed(2)}MB, ${file.type})`);
70
+ let src;
71
+ if (uploadHandler) {
72
+ src = await uploadHandler(file);
73
+ }
74
+ else if (isVideoFile && options.useObjectURLForVideos !== false) {
75
+ // Use object URL for videos (better performance, doesn't bloat the document)
76
+ src = fileToObjectURL(file);
77
+ console.log('Using object URL for video:', src);
78
+ }
79
+ else {
80
+ // Use base64 data URL
81
+ src = await fileToDataURL(file);
82
+ console.log(`${isVideoFile ? 'Video' : 'Image'} converted to data URL, length: ${src.length} characters`);
83
+ }
84
+ // Insert the media
85
+ if (isVideoFile) {
86
+ insertVideo(view, pos, src, file.name);
87
+ console.log('Video inserted into editor');
88
+ }
89
+ else {
90
+ insertImage(view, pos, src, file.name);
91
+ console.log('Image inserted into editor');
92
+ }
93
+ // Increment position for next media
94
+ pos += 1;
95
+ }
96
+ catch (error) {
97
+ console.error(`Failed to process ${isVideoFile ? 'video' : 'image'} "${file.name}":`, error);
98
+ }
99
+ }
100
+ }
101
+ /** Create the media upload plugin */
102
+ function createMediaUploadPlugin(options = {}) {
103
+ return new Plugin({
104
+ key: mediaUploadKey,
105
+ props: {
106
+ /** Handle file drops */
107
+ handleDrop(view, event, slice, moved) {
108
+ // If content was moved from within the editor, let the default handler deal with it
109
+ if (moved)
110
+ return false;
111
+ const files = Array.from(event.dataTransfer?.files || []);
112
+ if (files.length === 0)
113
+ return false;
114
+ // Check if any files are images or videos
115
+ const { allowedImageTypes = ['^image/'], allowedVideoTypes = ['^video/'], } = options;
116
+ const hasMedia = files.some((file) => isImage(file, allowedImageTypes) || isVideo(file, allowedVideoTypes));
117
+ if (!hasMedia)
118
+ return false;
119
+ // Prevent default drop behavior
120
+ event.preventDefault();
121
+ // Get drop position
122
+ const coords = { left: event.clientX, top: event.clientY };
123
+ const pos = view.posAtCoords(coords);
124
+ if (!pos)
125
+ return false;
126
+ // Handle the media files
127
+ handleMediaFiles(view, files, pos.pos, options);
128
+ return true;
129
+ },
130
+ /** Handle paste events with images (videos typically don't paste) */
131
+ handlePaste(view, event, slice) {
132
+ const items = Array.from(event.clipboardData?.items || []);
133
+ const imageItems = items.filter((item) => item.type.startsWith('image/'));
134
+ if (imageItems.length === 0)
135
+ return false;
136
+ // Prevent default paste behavior
137
+ event.preventDefault();
138
+ // Convert clipboard items to files
139
+ const files = [];
140
+ for (const item of imageItems) {
141
+ const file = item.getAsFile();
142
+ if (file)
143
+ files.push(file);
144
+ }
145
+ if (files.length === 0)
146
+ return false;
147
+ // Get current cursor position
148
+ const { from } = view.state.selection;
149
+ // Handle the image files
150
+ handleMediaFiles(view, files, from, options);
151
+ return true;
152
+ },
153
+ },
154
+ });
155
+ }
156
+ /** Extension that adds media upload support via drag & drop and paste */
157
+ export class ExtensionMediaUpload extends Extension {
158
+ constructor(config = {}) {
159
+ super(config);
160
+ Object.defineProperty(this, "config", {
161
+ enumerable: true,
162
+ configurable: true,
163
+ writable: true,
164
+ value: config
165
+ });
166
+ Object.defineProperty(this, "name", {
167
+ enumerable: true,
168
+ configurable: true,
169
+ writable: true,
170
+ value: 'mediaUpload'
171
+ });
172
+ }
173
+ getProseMirrorPlugins() {
174
+ return [createMediaUploadPlugin(this.config)];
175
+ }
176
+ }
@@ -0,0 +1,11 @@
1
+ import { Node } from 'prosemirror-model';
2
+ import { type CoreEditor, Extension } from '../../editor/src/mod.js';
3
+ import type { CommandFactories } from '../../editor/src/commands/mod.js';
4
+ export declare class ExtensionSelection extends Extension {
5
+ name: string;
6
+ extractSelection(): Node;
7
+ replaceSelection(otherDoc: Node): void;
8
+ appendSelection(otherDoc: Node): void;
9
+ getCommandFactories(editor: CoreEditor): Partial<CommandFactories>;
10
+ }
11
+ //# sourceMappingURL=ExtensionSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionSelection.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAIL,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,kCAAkC,CAAC;AAuS1C,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C,IAAI,SAAe;IAEnB,gBAAgB,IAAI,IAAI;IAaxB,gBAAgB,CAAC,QAAQ,EAAE,IAAI;IAuB/B,eAAe,CAAC,QAAQ,EAAE,IAAI;IAmBrB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAO5E"}