@clevertask/scribe 0.1.29 → 0.1.31
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/README.md +39 -53
- package/dist/BarMenu-Bm5IfWVV.js +302 -0
- package/dist/components/Menu/BarMenu.d.ts.map +1 -1
- package/dist/components/Menu/BarMenu.js +1 -2
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -1
- package/dist/components/Menu/LinkBubbleMenu.js +113 -103
- package/dist/components/Menu/LinkEditor.d.ts +0 -7
- package/dist/components/Menu/LinkEditor.d.ts.map +1 -1
- package/dist/components/Menu/LinkEditor.js +148 -157
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +3 -3
- package/dist/components/Menu/TableHeightSettings.js +3 -11
- package/dist/components/Menu/TableLayoutOptions.js +1 -5
- package/dist/components/Menu/linkBubbleMenuPlugin.d.ts.map +1 -1
- package/dist/components/Menu/linkBubbleMenuPlugin.js +9 -5
- package/dist/components/Scribe/extension/callout.js +7 -7
- package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
- package/dist/components/Scribe/extension/extension-link.js +1 -2
- package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/attributes.d.ts +0 -7
- package/dist/components/Scribe/extension/external-link-preview/attributes.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/attributes.js +26 -51
- package/dist/components/Scribe/extension/external-link-preview/commands.d.ts +5 -12
- package/dist/components/Scribe/extension/external-link-preview/commands.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/commands.js +56 -121
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts +4 -6
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/index.js +5 -41
- package/dist/components/Scribe/extension/external-link-preview/render-html.d.ts +1 -0
- package/dist/components/Scribe/extension/external-link-preview/render-html.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/render-html.js +17 -60
- package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +2 -2
- package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/serialization.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/serialization.js +29 -51
- package/dist/components/Scribe/extension/external-link-preview/types.d.ts +14 -17
- package/dist/components/Scribe/extension/external-link-preview/types.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +1 -2
- package/dist/components/Scribe/extension/resizable-table.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +10 -14
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
- package/dist/components/Scribe/extension/table-layout.js +1 -2
- package/dist/components/Scribe/extension/tableOfContents.js +1 -1
- package/dist/components/Scribe/index.d.ts +3 -9
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +7 -21
- package/dist/{dist-DnVcys79.js → dist-BoAzo5MN.js} +491 -598
- package/dist/{dist-CDJRm4fL.js → dist-BqlzKS-_.js} +9 -17
- package/dist/{dist-B0xwy1Q5.js → dist-SM4NoN4h.js} +174 -385
- package/dist/document-node-capabilities.js +1 -1
- package/dist/{extension-BPeoqfHR.js → extension-dz0CIf3r.js} +1 -1
- package/dist/extension-link-DxIXGCtV.js +931 -0
- package/dist/{html-to-markdown-DF93it73.js → html-to-markdown-DeRG9OPm.js} +1 -1
- package/dist/main.css +1 -141
- package/dist/main.js +2 -2
- package/dist/{markdown-to-html-BoK5O_j-.js → markdown-to-html-tCPjQ5u6.js} +23 -70
- package/dist/{menus-scgppp2C.js → menus-BKxcTUsl.js} +36 -118
- package/dist/{purify.es-q6CUdJQi.js → purify.es-CSWcs7f1.js} +1 -23
- package/dist/{schema-extensions-ITR9LEgX.js → schema-extensions-B9hR1VrD.js} +1335 -1360
- package/dist/schema-extensions.js +1 -2
- package/dist/schema.js +1 -1
- package/dist/{table-layout-iVolql5p.js → table-layout-ClqaGg1E.js} +36 -36
- package/dist/{tippy.esm-MjWnmeEn.js → tippy.esm-C8V6GlaF.js} +5 -17
- package/dist/utils/create-scribe-editor.d.ts +1 -1
- package/dist/utils/create-scribe-editor.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.js +1 -2
- package/dist/utils/html-to-markdown.js +1 -2
- package/dist/utils/index.js +4 -4
- package/dist/utils/markdown-to-html.js +1 -2
- package/package.json +10 -10
- package/dist/BarMenu-BC8XoC6e.js +0 -302
- package/dist/components/Menu/ExternalLinkDisplayOptions.d.ts +0 -13
- package/dist/components/Menu/ExternalLinkDisplayOptions.d.ts.map +0 -1
- package/dist/components/Menu/ExternalLinkDisplayOptions.js +0 -90
- package/dist/components/Scribe/extension/external-link-preview/node-view.d.ts +0 -3
- package/dist/components/Scribe/extension/external-link-preview/node-view.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/node-view.js +0 -97
- package/dist/components/Scribe/extension/external-link-preview/normalization.d.ts +0 -7
- package/dist/components/Scribe/extension/external-link-preview/normalization.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/normalization.js +0 -21
- package/dist/components/Scribe/extension/external-link-preview/paste.d.ts +0 -8
- package/dist/components/Scribe/extension/external-link-preview/paste.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/paste.js +0 -53
- package/dist/components/Scribe/extension/external-link-preview/policy.d.ts +0 -7
- package/dist/components/Scribe/extension/external-link-preview/policy.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/policy.js +0 -38
- package/dist/components/Scribe/extension/external-link-preview/resolver.d.ts +0 -23
- package/dist/components/Scribe/extension/external-link-preview/resolver.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/resolver.js +0 -118
- package/dist/extension-link-RvaqaDqr.js +0 -934
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeExternalLinkPreviewElement as e, normalizeExternalLinkPreviewsInTree as t } from "./components/Scribe/extension/external-link-preview/serialization.js";
|
|
2
|
-
import { t as n } from "./purify.es-
|
|
2
|
+
import { t as n } from "./purify.es-CSWcs7f1.js";
|
|
3
3
|
//#region node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.js
|
|
4
4
|
function r(e) {
|
|
5
5
|
for (var t = 1; t < arguments.length; t++) {
|
package/dist/main.css
CHANGED
|
@@ -114,152 +114,11 @@
|
|
|
114
114
|
text-underline-offset: 0.18em;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.scribe-content .tiptap [data-type="external-link-preview"] {
|
|
118
|
-
align-items: center;
|
|
119
|
-
display: inline-flex;
|
|
120
|
-
gap: 6px;
|
|
121
|
-
line-height: 1.35;
|
|
122
|
-
max-width: 100%;
|
|
123
|
-
position: relative;
|
|
124
|
-
vertical-align: middle;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-target] {
|
|
128
|
-
align-items: center;
|
|
129
|
-
background: var(--gray-2);
|
|
130
|
-
border: 1px solid var(--gray-6);
|
|
131
|
-
border-radius: 8px;
|
|
132
|
-
color: var(--gray-12);
|
|
133
|
-
display: inline-flex;
|
|
134
|
-
gap: 8px;
|
|
135
|
-
max-width: 100%;
|
|
136
|
-
min-width: 0;
|
|
137
|
-
padding: 5px 8px;
|
|
138
|
-
text-decoration: none;
|
|
139
|
-
transition:
|
|
140
|
-
background-color 0.15s ease,
|
|
141
|
-
border-color 0.15s ease;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-target]:hover {
|
|
145
|
-
background: var(--gray-3);
|
|
146
|
-
border-color: var(--gray-7);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-main] {
|
|
150
|
-
align-items: center;
|
|
151
|
-
display: flex;
|
|
152
|
-
gap: 8px;
|
|
153
|
-
min-width: 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-copy] {
|
|
157
|
-
display: flex;
|
|
158
|
-
flex: 1;
|
|
159
|
-
flex-direction: column;
|
|
160
|
-
min-width: 0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-title] {
|
|
164
|
-
font-size: 0.925rem;
|
|
165
|
-
font-weight: 500;
|
|
166
|
-
overflow: hidden;
|
|
167
|
-
text-overflow: ellipsis;
|
|
168
|
-
white-space: nowrap;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-site],
|
|
172
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-description] {
|
|
173
|
-
color: var(--gray-11);
|
|
174
|
-
font-size: 0.8rem;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-favicon],
|
|
178
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-favicon-fallback] {
|
|
179
|
-
align-items: center;
|
|
180
|
-
border-radius: 4px;
|
|
181
|
-
display: inline-flex;
|
|
182
|
-
flex: 0 0 18px;
|
|
183
|
-
height: 18px;
|
|
184
|
-
justify-content: center;
|
|
185
|
-
object-fit: contain;
|
|
186
|
-
overflow: hidden;
|
|
187
|
-
width: 18px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.scribe-content .tiptap .scribe-external-link-preview--compact [data-link-preview-site] {
|
|
191
|
-
display: none;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.scribe-content .tiptap .scribe-external-link-preview--card {
|
|
195
|
-
align-items: stretch;
|
|
196
|
-
display: flex;
|
|
197
|
-
flex-wrap: wrap;
|
|
198
|
-
margin: 0.4rem 0;
|
|
199
|
-
width: 100%;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-target] {
|
|
203
|
-
align-items: stretch;
|
|
204
|
-
display: flex;
|
|
205
|
-
flex: 1;
|
|
206
|
-
flex-basis: 100%;
|
|
207
|
-
min-height: 104px;
|
|
208
|
-
overflow: hidden;
|
|
209
|
-
padding: 0;
|
|
210
|
-
width: 100%;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-main] {
|
|
214
|
-
align-items: flex-start;
|
|
215
|
-
flex: 1;
|
|
216
|
-
order: 1;
|
|
217
|
-
padding: 14px;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-copy] {
|
|
221
|
-
gap: 4px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-title] {
|
|
225
|
-
font-size: 1rem;
|
|
226
|
-
font-weight: 600;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-description] {
|
|
230
|
-
display: -webkit-box;
|
|
231
|
-
overflow: hidden;
|
|
232
|
-
-webkit-box-orient: vertical;
|
|
233
|
-
-webkit-line-clamp: 2;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-image] {
|
|
237
|
-
align-self: stretch;
|
|
238
|
-
flex: 0 0 min(34%, 220px);
|
|
239
|
-
min-height: 104px;
|
|
240
|
-
object-fit: cover;
|
|
241
|
-
order: 2;
|
|
242
|
-
width: min(34%, 220px);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
117
|
.scribe-content .tiptap [data-type="external-link-preview"].ProseMirror-selectednode {
|
|
246
118
|
outline: 2px solid var(--accent-8);
|
|
247
119
|
outline-offset: 2px;
|
|
248
120
|
}
|
|
249
121
|
|
|
250
|
-
@media (max-width: 480px) {
|
|
251
|
-
.scribe-content .tiptap .scribe-external-link-preview--card [data-link-preview-image] {
|
|
252
|
-
flex-basis: 30%;
|
|
253
|
-
width: 30%;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
@media (pointer: coarse) {
|
|
258
|
-
.scribe-content .tiptap [data-type="external-link-preview"] [data-link-preview-target] {
|
|
259
|
-
min-height: 44px;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
122
|
.scribe-content .tiptap blockquote {
|
|
264
123
|
border-left: 3px solid var(--gray-6);
|
|
265
124
|
color: var(--gray-11);
|
|
@@ -556,6 +415,7 @@
|
|
|
556
415
|
|
|
557
416
|
.scribe-link-popover {
|
|
558
417
|
background: var(--color-panel-solid);
|
|
418
|
+
box-sizing: border-box;
|
|
559
419
|
border: 1px solid var(--gray-6);
|
|
560
420
|
border-radius: 12px;
|
|
561
421
|
box-shadow:
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, Callout as n, DEFAULT_CALLOUT_VARIANT as r, isCalloutVariant as i } from "./components/Scribe/extension/callout.js";
|
|
2
2
|
import { EXTERNAL_LINK_PREVIEW_DISPLAYS as a } from "./components/Scribe/extension/external-link-preview/types.js";
|
|
3
3
|
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as o } from "./components/Scribe/extension/external-link-preview/attributes.js";
|
|
4
|
-
import { t as s } from "./html-to-markdown-
|
|
5
|
-
import { t as c } from "./markdown-to-html-
|
|
4
|
+
import { t as s } from "./html-to-markdown-DeRG9OPm.js";
|
|
5
|
+
import { t as c } from "./markdown-to-html-tCPjQ5u6.js";
|
|
6
6
|
import { isInViewport as l } from "./utils/is-in-viewport.js";
|
|
7
7
|
import { convertLegacyMathDelimiters as u } from "./utils/convert-legacy-math-delimiters.js";
|
|
8
8
|
import { SuggestionItemType as d } from "./components/Scribe/extension/slashCommand/items.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeExternalLinkPreviewsInTree as e } from "./components/Scribe/extension/external-link-preview/serialization.js";
|
|
2
|
-
import { t } from "./purify.es-
|
|
3
|
-
//#region node_modules/.pnpm/marked@18.0
|
|
2
|
+
import { t } from "./purify.es-CSWcs7f1.js";
|
|
3
|
+
//#region node_modules/.pnpm/marked@18.1.0/node_modules/marked/lib/marked.esm.js
|
|
4
4
|
function n() {
|
|
5
5
|
return {
|
|
6
6
|
async: !1,
|
|
@@ -130,7 +130,7 @@ var c = ((e = "") => {
|
|
|
130
130
|
fences: a,
|
|
131
131
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
132
132
|
paragraph: s(v).replace("hr", p).replace("heading", " *#{1,6} *[^\n]").replace("lheading", _).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
133
|
-
}, le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, T = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, de = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, E = /[\p{P}\p{S}]/u, D = /[\s\p{P}\p{S}]/u, O = /[^\s\p{P}\p{S}]/u, fe = s(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, D).getRegex(), pe = /[\p{Pi}\p{Ps}"']/u, k = /(?!~)[\p{P}\p{S}]/u, me = /(?!~)[\s\p{P}\p{S}]/u, he = /(?:[^\s\p{P}\p{S}]|~)/u, ge = s(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", c ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), A = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _e = s(A, "u").replace(/punct/g, E).getRegex(), ve = s(A, "u").replace(/punct/g, k).getRegex(), ye = s(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, pe).replace(/punct/g, E).getRegex(), j = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", be = s(j, "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), xe = s(j, "gu").replace(/notPunctSpace/g, he).replace(/punctSpace/g, me).replace(/punct/g, k).getRegex(), Se = s("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), Ce = s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), we = s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), Te = s(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, E).getRegex(), Ee = s("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), De = s(/\\(punct)/, "gu").replace(/punct/g, E).getRegex(), Oe = s(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ke = s(x).replace("(?:-->|$)", "-->").getRegex(), Ae = s("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ke).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), M = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, N = s(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", M).getRegex(), je = s(/^!?\[(label)\]\(\
|
|
133
|
+
}, le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, T = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, de = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, E = /[\p{P}\p{S}]/u, D = /[\s\p{P}\p{S}]/u, O = /[^\s\p{P}\p{S}]/u, fe = s(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, D).getRegex(), pe = /[\p{Pi}\p{Ps}"']/u, k = /(?!~)[\p{P}\p{S}]/u, me = /(?!~)[\s\p{P}\p{S}]/u, he = /(?:[^\s\p{P}\p{S}]|~)/u, ge = s(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", c ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), A = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _e = s(A, "u").replace(/punct/g, E).getRegex(), ve = s(A, "u").replace(/punct/g, k).getRegex(), ye = s(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, pe).replace(/punct/g, E).getRegex(), j = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", be = s(j, "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), xe = s(j, "gu").replace(/notPunctSpace/g, he).replace(/punctSpace/g, me).replace(/punct/g, k).getRegex(), Se = s("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), Ce = s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), we = s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), Te = s(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, E).getRegex(), Ee = s("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, O).replace(/punctSpace/g, D).replace(/punct/g, E).getRegex(), De = s(/\\(punct)/, "gu").replace(/punct/g, E).getRegex(), Oe = s(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ke = s(x).replace("(?:-->|$)", "-->").getRegex(), Ae = s("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ke).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), M = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, N = s(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", M).getRegex(), je = s(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", N).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Me = s(/^!?\[(label)\]\[(ref)\]/).replace("label", N).replace("ref", y).getRegex(), Ne = s(/^!?\[(ref)\](?:\[\])?/).replace("ref", y).getRegex(), P = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Pe = s(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", M).getRegex(), Fe = s("reflink|nolink(?!\\()", "g").replace("reflink", s(/^!?\[(label)\]\[(ref)\]/).replace("label", Pe).replace("ref", P).getRegex()).replace("nolink", s(/^!?\[(ref)\](?:\[\])?/).replace("ref", P).getRegex()).getRegex(), F = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Ie = s(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), I = {
|
|
134
134
|
_backpedal: a,
|
|
135
135
|
anyPunctuation: De,
|
|
136
136
|
autolink: Oe,
|
|
@@ -243,7 +243,7 @@ function G(e) {
|
|
|
243
243
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
244
244
|
}
|
|
245
245
|
function He(e, t) {
|
|
246
|
-
if (e.indexOf(t[1]) === -1) return -1;
|
|
246
|
+
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
247
247
|
let n = 0;
|
|
248
248
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
249
249
|
else if (e[r] === t[0]) n++;
|
|
@@ -405,7 +405,6 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
405
405
|
if (u?.type === "list") {
|
|
406
406
|
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
|
|
407
407
|
i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
|
|
408
|
-
continue;
|
|
409
408
|
}
|
|
410
409
|
}
|
|
411
410
|
return {
|
|
@@ -511,6 +510,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
511
510
|
def(e) {
|
|
512
511
|
let t = this.rules.block.def.exec(e);
|
|
513
512
|
if (t) {
|
|
513
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && He(t[2], "()") !== -1) return;
|
|
514
514
|
let e = G(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
515
515
|
return {
|
|
516
516
|
type: "def",
|
|
@@ -602,6 +602,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
602
602
|
};
|
|
603
603
|
}
|
|
604
604
|
link(e) {
|
|
605
|
+
if (this.lexer.state.linkParenPossible === !1) return;
|
|
605
606
|
let t = this.rules.inline.link.exec(e);
|
|
606
607
|
if (t) {
|
|
607
608
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
@@ -793,6 +794,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
793
794
|
inLink: !1,
|
|
794
795
|
inRawBlock: !1,
|
|
795
796
|
linkEmitted: !1,
|
|
797
|
+
linkParenPossible: !0,
|
|
796
798
|
top: !0
|
|
797
799
|
};
|
|
798
800
|
let t = {
|
|
@@ -845,27 +847,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
845
847
|
n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.at(-1).src = n.text) : t.push(i);
|
|
846
848
|
continue;
|
|
847
849
|
}
|
|
848
|
-
if (i = this.tokenizer.fences(e)) {
|
|
849
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
850
|
-
continue;
|
|
851
|
-
}
|
|
852
|
-
if (i = this.tokenizer.heading(e)) {
|
|
853
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
854
|
-
continue;
|
|
855
|
-
}
|
|
856
|
-
if (i = this.tokenizer.hr(e)) {
|
|
857
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
858
|
-
continue;
|
|
859
|
-
}
|
|
860
|
-
if (i = this.tokenizer.blockquote(e)) {
|
|
861
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
862
|
-
continue;
|
|
863
|
-
}
|
|
864
|
-
if (i = this.tokenizer.list(e)) {
|
|
865
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
866
|
-
continue;
|
|
867
|
-
}
|
|
868
|
-
if (i = this.tokenizer.html(e)) {
|
|
850
|
+
if ((i = this.tokenizer.fences(e)) || (i = this.tokenizer.heading(e)) || (i = this.tokenizer.hr(e)) || (i = this.tokenizer.blockquote(e)) || (i = this.tokenizer.list(e)) || (i = this.tokenizer.html(e))) {
|
|
869
851
|
e = e.substring(i.raw.length), t.push(i);
|
|
870
852
|
continue;
|
|
871
853
|
}
|
|
@@ -878,11 +860,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
878
860
|
}, t.push(i));
|
|
879
861
|
continue;
|
|
880
862
|
}
|
|
881
|
-
if (i = this.tokenizer.table(e)) {
|
|
882
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
883
|
-
continue;
|
|
884
|
-
}
|
|
885
|
-
if (i = this.tokenizer.lheading(e)) {
|
|
863
|
+
if ((i = this.tokenizer.table(e)) || (i = this.tokenizer.lheading(e))) {
|
|
886
864
|
e = e.substring(i.raw.length), t.push(i);
|
|
887
865
|
continue;
|
|
888
866
|
}
|
|
@@ -896,15 +874,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
896
874
|
if (this.state.top && (i = this.tokenizer.paragraph(a))) {
|
|
897
875
|
let r = t.at(-1);
|
|
898
876
|
n && r?.type === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + i.raw, r.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(i), n = a.length !== e.length, e = e.substring(i.raw.length);
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
if (i = this.tokenizer.text(e)) {
|
|
877
|
+
} else if (i = this.tokenizer.text(e)) {
|
|
902
878
|
e = e.substring(i.raw.length);
|
|
903
879
|
let n = t.at(-1);
|
|
904
880
|
n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(i);
|
|
905
|
-
|
|
906
|
-
}
|
|
907
|
-
if (e) {
|
|
881
|
+
} else if (e) {
|
|
908
882
|
this.infiniteLoopError(e.charCodeAt(0));
|
|
909
883
|
break;
|
|
910
884
|
}
|
|
@@ -929,6 +903,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
929
903
|
}
|
|
930
904
|
inlineTokens(e, t = []) {
|
|
931
905
|
this.tokenizer.lexer = this;
|
|
906
|
+
let n = this.state.linkParenPossible;
|
|
907
|
+
this.state.linkParenPossible = n && e.includes(")");
|
|
908
|
+
try {
|
|
909
|
+
return this.#e(e, t);
|
|
910
|
+
} finally {
|
|
911
|
+
this.state.linkParenPossible = n;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
#e(e, t) {
|
|
932
915
|
let n = e;
|
|
933
916
|
if (this.tokens.links && e.includes("[")) {
|
|
934
917
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
@@ -956,15 +939,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
956
939
|
r || (i = ""), r = !1;
|
|
957
940
|
let o;
|
|
958
941
|
if (this.options.extensions?.inline?.some((n) => (o = n.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue;
|
|
959
|
-
if (o = this.tokenizer.escape(e)) {
|
|
960
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
961
|
-
continue;
|
|
962
|
-
}
|
|
963
|
-
if (o = this.tokenizer.tag(e)) {
|
|
964
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
965
|
-
continue;
|
|
966
|
-
}
|
|
967
|
-
if (o = this.tokenizer.link(e)) {
|
|
942
|
+
if ((o = this.tokenizer.escape(e)) || (o = this.tokenizer.tag(e)) || (o = this.tokenizer.link(e))) {
|
|
968
943
|
e = e.substring(o.raw.length), t.push(o);
|
|
969
944
|
continue;
|
|
970
945
|
}
|
|
@@ -974,27 +949,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
974
949
|
o.type === "text" && n?.type === "text" ? (n.raw += o.raw, n.text += o.text) : t.push(o);
|
|
975
950
|
continue;
|
|
976
951
|
}
|
|
977
|
-
if (o = this.tokenizer.emStrong(e, n, i)) {
|
|
978
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
979
|
-
continue;
|
|
980
|
-
}
|
|
981
|
-
if (o = this.tokenizer.codespan(e)) {
|
|
982
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
983
|
-
continue;
|
|
984
|
-
}
|
|
985
|
-
if (o = this.tokenizer.br(e)) {
|
|
986
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
987
|
-
continue;
|
|
988
|
-
}
|
|
989
|
-
if (o = this.tokenizer.del(e, n, i)) {
|
|
990
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
991
|
-
continue;
|
|
992
|
-
}
|
|
993
|
-
if (o = this.tokenizer.autolink(e)) {
|
|
994
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
995
|
-
continue;
|
|
996
|
-
}
|
|
997
|
-
if (!this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
952
|
+
if ((o = this.tokenizer.emStrong(e, n, i)) || (o = this.tokenizer.codespan(e)) || (o = this.tokenizer.br(e)) || (o = this.tokenizer.del(e, n, i)) || (o = this.tokenizer.autolink(e)) || !this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
998
953
|
e = e.substring(o.raw.length), t.push(o);
|
|
999
954
|
continue;
|
|
1000
955
|
}
|
|
@@ -1009,9 +964,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1009
964
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (i = o.raw.slice(-1)), r = !0;
|
|
1010
965
|
let n = t.at(-1);
|
|
1011
966
|
n?.type === "text" ? (n.raw += o.raw, n.text += o.text) : t.push(o);
|
|
1012
|
-
|
|
1013
|
-
}
|
|
1014
|
-
if (e) {
|
|
967
|
+
} else if (e) {
|
|
1015
968
|
this.infiniteLoopError(e.charCodeAt(0));
|
|
1016
969
|
break;
|
|
1017
970
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as e, E as t, F as n, U as r, n as i } from "./dist-BoAzo5MN.js";
|
|
2
2
|
import { a, c as o, i as s, l as c, n as l, o as u, s as d, t as f, u as p } from "./floating-ui.dom-CmJ6iBdh.js";
|
|
3
|
-
import {
|
|
3
|
+
import { r as m } from "./dist-SM4NoN4h.js";
|
|
4
4
|
import { NodeSelection as h, Plugin as g, PluginKey as _ } from "@tiptap/pm/state";
|
|
5
5
|
import { CellSelection as v } from "@tiptap/pm/tables";
|
|
6
6
|
import y, { useEffect as b, useLayoutEffect as x, useRef as S, useState as C } from "react";
|
|
@@ -17,22 +17,22 @@ var E = class {
|
|
|
17
17
|
}
|
|
18
18
|
get virtualElement() {
|
|
19
19
|
var e;
|
|
20
|
-
let { selection:
|
|
21
|
-
if (
|
|
20
|
+
let { selection: t } = this.editor.state, n = this.getReferencedVirtualElement?.call(this);
|
|
21
|
+
if (n) return n;
|
|
22
22
|
if (!((e = this.view) != null && (e = e.dom) != null && e.parentNode)) return;
|
|
23
|
-
let i =
|
|
23
|
+
let i = r(this.view, t.from, t.to), a = {
|
|
24
24
|
getBoundingClientRect: () => i,
|
|
25
25
|
getClientRects: () => [i]
|
|
26
26
|
};
|
|
27
|
-
if (
|
|
28
|
-
let e = this.view.nodeDOM(
|
|
29
|
-
|
|
27
|
+
if (t instanceof h) {
|
|
28
|
+
let e = this.view.nodeDOM(t.from), n = e.dataset.nodeViewWrapper ? e : e.querySelector("[data-node-view-wrapper]");
|
|
29
|
+
n && (e = n), e && (a = {
|
|
30
30
|
getBoundingClientRect: () => e.getBoundingClientRect(),
|
|
31
31
|
getClientRects: () => [e.getBoundingClientRect()]
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
if (
|
|
35
|
-
let { $anchorCell: e, $headCell:
|
|
34
|
+
if (t instanceof v) {
|
|
35
|
+
let { $anchorCell: e, $headCell: n } = t, r = e ? e.pos : n.pos, i = n ? n.pos : e.pos, o = this.view.nodeDOM(r), s = this.view.nodeDOM(i);
|
|
36
36
|
if (!o || !s) return;
|
|
37
37
|
let c = o === s ? o.getBoundingClientRect() : T(o.getBoundingClientRect(), s.getBoundingClientRect());
|
|
38
38
|
a = {
|
|
@@ -72,15 +72,7 @@ var E = class {
|
|
|
72
72
|
}, this.focusHandler = () => {
|
|
73
73
|
setTimeout(() => this.update(this.editor.view));
|
|
74
74
|
}, this.blurHandler = ({ event: e }) => {
|
|
75
|
-
|
|
76
|
-
this.destroy();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (this.preventHide) {
|
|
80
|
-
this.preventHide = !1;
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
e?.relatedTarget && this.element.parentNode?.contains(e.relatedTarget) || e?.relatedTarget !== this.editor.view.dom && this.hide();
|
|
75
|
+
this.editor.isDestroyed ? this.destroy() : this.preventHide ? this.preventHide = !1 : e?.relatedTarget && this.element.parentNode?.contains(e.relatedTarget) || e?.relatedTarget !== this.editor.view.dom && this.hide();
|
|
84
76
|
}, this.handleDebouncedUpdate = (e, t) => {
|
|
85
77
|
let n = !t?.selection.eq(e.state.selection), r = !t?.doc.eq(e.state.doc);
|
|
86
78
|
(n || r) && (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
|
|
@@ -88,13 +80,7 @@ var E = class {
|
|
|
88
80
|
}, this.updateDelay));
|
|
89
81
|
}, this.updateHandler = (e, t, n, r) => {
|
|
90
82
|
let { composing: i } = e;
|
|
91
|
-
|
|
92
|
-
if (!this.getShouldShow(r)) {
|
|
93
|
-
this.hide();
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
this.show(), this.updatePosition();
|
|
97
|
-
}
|
|
83
|
+
i || !t && !n || (this.getShouldShow(r) ? (this.show(), this.updatePosition()) : this.hide());
|
|
98
84
|
}, this.transactionHandler = ({ transaction: e }) => {
|
|
99
85
|
let t = e.getMeta(this.pluginKey);
|
|
100
86
|
t === "updatePosition" ? this.updatePosition() : t && typeof t == "object" && t.type === "updateOptions" ? this.updateOptions(t.options) : t === "hide" ? this.hide() : t === "show" && (this.updatePosition(), this.show());
|
|
@@ -111,13 +97,7 @@ var E = class {
|
|
|
111
97
|
strategy: this.floatingUIOptions.strategy,
|
|
112
98
|
middleware: this.middlewares
|
|
113
99
|
}).then(({ x: e, y: t, strategy: n, middlewareData: r }) => {
|
|
114
|
-
|
|
115
|
-
if (r.hide?.referenceHidden || r.hide?.escaped) {
|
|
116
|
-
this.element.style.visibility = "hidden";
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.element.style.visibility = "visible", this.element.style.width = "max-content", this.element.style.position = n, this.element.style.left = `${e}px`, this.element.style.top = `${t}px`, this.isVisible && this.floatingUIOptions.onUpdate && this.floatingUIOptions.onUpdate();
|
|
120
|
-
}
|
|
100
|
+
this.isVisible && !this.editor.isDestroyed && this.element.isConnected && (r.hide?.referenceHidden || r.hide?.escaped ? this.element.style.visibility = "hidden" : (this.element.style.visibility = "visible", this.element.style.width = "max-content", this.element.style.position = n, this.element.style.left = `${e}px`, this.element.style.top = `${t}px`, this.isVisible && this.floatingUIOptions.onUpdate && this.floatingUIOptions.onUpdate()));
|
|
121
101
|
});
|
|
122
102
|
}
|
|
123
103
|
update(e, t) {
|
|
@@ -143,7 +123,7 @@ var E = class {
|
|
|
143
123
|
}
|
|
144
124
|
show() {
|
|
145
125
|
var e;
|
|
146
|
-
this.isVisible
|
|
126
|
+
this.isVisible ||= (this.element.style.visibility = "visible", this.element.style.opacity = "1", (e = (typeof this.appendTo == "function" ? this.appendTo() : this.appendTo) ?? this.view.dom.parentElement) == null || e.appendChild(this.element), this.floatingUIOptions.onShow && this.floatingUIOptions.onShow(), !0);
|
|
147
127
|
}
|
|
148
128
|
hide() {
|
|
149
129
|
this.isVisible &&= (this.element.style.visibility = "hidden", this.element.style.opacity = "0", this.element.remove(), this.floatingUIOptions.onHide && this.floatingUIOptions.onHide(), !1);
|
|
@@ -194,8 +174,8 @@ i.create({
|
|
|
194
174
|
//#endregion
|
|
195
175
|
//#region node_modules/.pnpm/@tiptap+extension-floating-menu@3.31.4_@floating-ui+dom@1.8.0_@tiptap+core@3.31.4_@tiptap+pm@3.31.4__@tiptap+pm@3.31.4/node_modules/@tiptap/extension-floating-menu/dist/index.js
|
|
196
176
|
var O = class {
|
|
197
|
-
getTextContent(
|
|
198
|
-
return
|
|
177
|
+
getTextContent(n) {
|
|
178
|
+
return t(n, { textSerializers: e(this.editor.schema) });
|
|
199
179
|
}
|
|
200
180
|
get middlewares() {
|
|
201
181
|
let e = [];
|
|
@@ -218,23 +198,13 @@ var O = class {
|
|
|
218
198
|
inline: !1
|
|
219
199
|
}, this.updateHandler = (e, t, n, r) => {
|
|
220
200
|
let { composing: i } = e;
|
|
221
|
-
|
|
222
|
-
if (!this.getShouldShow(r)) {
|
|
223
|
-
this.hide();
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
this.updatePosition(), this.show();
|
|
227
|
-
}
|
|
201
|
+
i || !t && !n || (this.getShouldShow(r) ? (this.updatePosition(), this.show()) : this.hide());
|
|
228
202
|
}, this.mousedownHandler = () => {
|
|
229
203
|
this.preventHide = !0;
|
|
230
204
|
}, this.focusHandler = () => {
|
|
231
205
|
setTimeout(() => this.update(this.editor.view));
|
|
232
206
|
}, this.blurHandler = ({ event: e }) => {
|
|
233
|
-
|
|
234
|
-
this.preventHide = !1;
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
e?.relatedTarget && this.element.parentNode?.contains(e.relatedTarget) || e?.relatedTarget !== this.editor.view.dom && this.hide();
|
|
207
|
+
this.preventHide ? this.preventHide = !1 : e?.relatedTarget && this.element.parentNode?.contains(e.relatedTarget) || e?.relatedTarget !== this.editor.view.dom && this.hide();
|
|
238
208
|
}, this.transactionHandler = ({ transaction: e }) => {
|
|
239
209
|
let t = e.getMeta(this.pluginKey);
|
|
240
210
|
t === "updatePosition" ? this.updatePosition() : t && typeof t == "object" && t.type === "updateOptions" ? this.updateOptions(t.options) : t === "hide" ? this.hide() : t === "show" && (this.updatePosition(), this.show());
|
|
@@ -270,20 +240,16 @@ var O = class {
|
|
|
270
240
|
updatePosition() {
|
|
271
241
|
var e;
|
|
272
242
|
if (!((e = this.view) != null && (e = e.dom) != null && e.parentNode)) return;
|
|
273
|
-
let { selection:
|
|
243
|
+
let { selection: t } = this.editor.state, n = r(this.view, t.from, t.to);
|
|
274
244
|
s({
|
|
275
|
-
getBoundingClientRect: () =>
|
|
276
|
-
getClientRects: () => [
|
|
245
|
+
getBoundingClientRect: () => n,
|
|
246
|
+
getClientRects: () => [n]
|
|
277
247
|
}, this.element, {
|
|
278
248
|
placement: this.floatingUIOptions.placement,
|
|
279
249
|
strategy: this.floatingUIOptions.strategy,
|
|
280
250
|
middleware: this.middlewares
|
|
281
251
|
}).then(({ x: e, y: t, strategy: n, middlewareData: r }) => {
|
|
282
|
-
|
|
283
|
-
this.element.style.visibility = "hidden";
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
this.element.style.visibility = "visible", this.element.style.width = "max-content", this.element.style.position = n, this.element.style.left = `${e}px`, this.element.style.top = `${t}px`, this.isVisible && this.floatingUIOptions.onUpdate && this.floatingUIOptions.onUpdate();
|
|
252
|
+
r.hide?.referenceHidden || r.hide?.escaped ? this.element.style.visibility = "hidden" : (this.element.style.visibility = "visible", this.element.style.width = "max-content", this.element.style.position = n, this.element.style.left = `${e}px`, this.element.style.top = `${t}px`, this.isVisible && this.floatingUIOptions.onUpdate && this.floatingUIOptions.onUpdate());
|
|
287
253
|
});
|
|
288
254
|
}
|
|
289
255
|
update(e, t) {
|
|
@@ -292,7 +258,7 @@ var O = class {
|
|
|
292
258
|
}
|
|
293
259
|
show() {
|
|
294
260
|
var e;
|
|
295
|
-
this.isVisible
|
|
261
|
+
this.isVisible ||= (this.element.style.visibility = "visible", this.element.style.opacity = "1", (e = (typeof this.appendTo == "function" ? this.appendTo() : this.appendTo) ?? this.view.dom.parentElement) == null || e.appendChild(this.element), this.floatingUIOptions.onShow && this.floatingUIOptions.onShow(), !0);
|
|
296
262
|
}
|
|
297
263
|
hide() {
|
|
298
264
|
this.isVisible &&= (this.element.style.visibility = "hidden", this.element.style.opacity = "0", this.element.remove(), this.floatingUIOptions.onHide && this.floatingUIOptions.onHide(), !1);
|
|
@@ -417,11 +383,7 @@ function U(e) {
|
|
|
417
383
|
return P.has(e);
|
|
418
384
|
}
|
|
419
385
|
function W(e, t, n) {
|
|
420
|
-
|
|
421
|
-
e.tabIndex = Number(n);
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
e[t] = n;
|
|
386
|
+
t === "tabIndex" ? e.tabIndex = Number(n) : e[t] = n;
|
|
425
387
|
}
|
|
426
388
|
function G(e, t) {
|
|
427
389
|
if (t === "tabIndex") {
|
|
@@ -429,15 +391,7 @@ function G(e, t) {
|
|
|
429
391
|
return;
|
|
430
392
|
}
|
|
431
393
|
let n = e[t];
|
|
432
|
-
|
|
433
|
-
e[t] = !1;
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
if (typeof n == "number") {
|
|
437
|
-
e[t] = 0;
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
|
-
e[t] = "";
|
|
394
|
+
e[t] = typeof n == "boolean" ? !1 : typeof n == "number" ? 0 : "";
|
|
441
395
|
}
|
|
442
396
|
function K(e, t) {
|
|
443
397
|
return typeof t != "number" || t === 0 || e.startsWith("--") || N.has(e) ? String(t) : `${t}px`;
|
|
@@ -454,41 +408,17 @@ function Y(e, t, n) {
|
|
|
454
408
|
let i = t[r], a = n[r];
|
|
455
409
|
if (i === a) return;
|
|
456
410
|
let o = R(r);
|
|
457
|
-
|
|
458
|
-
U(r) && G(e, r), e.removeAttribute(o);
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
if (a === !0) {
|
|
462
|
-
U(r) && W(e, r, !0), e.setAttribute(o, "");
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
if (U(r)) {
|
|
466
|
-
W(e, r, a);
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
e.setAttribute(o, String(a));
|
|
411
|
+
a == null || a === !1 ? (U(r) && G(e, r), e.removeAttribute(o)) : a === !0 ? (U(r) && W(e, r, !0), e.setAttribute(o, "")) : U(r) ? W(e, r, a) : e.setAttribute(o, String(a));
|
|
470
412
|
});
|
|
471
413
|
}
|
|
472
414
|
function X(e, t, n) {
|
|
473
|
-
|
|
474
|
-
if (n) {
|
|
475
|
-
e.className = n;
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
e.removeAttribute("class");
|
|
479
|
-
}
|
|
415
|
+
t !== n && (n ? e.className = n : e.removeAttribute("class"));
|
|
480
416
|
}
|
|
481
417
|
function Z(e, t, n) {
|
|
482
418
|
let r = t ?? {}, i = n ?? {};
|
|
483
419
|
(/* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])).forEach((t) => {
|
|
484
420
|
let n = r[t], a = i[t];
|
|
485
|
-
|
|
486
|
-
if (a == null) {
|
|
487
|
-
q(e, t);
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
J(e, t, a);
|
|
491
|
-
}
|
|
421
|
+
n !== a && (a == null ? q(e, t) : J(e, t, a));
|
|
492
422
|
});
|
|
493
423
|
}
|
|
494
424
|
function Q(e, t, n) {
|
|
@@ -554,16 +484,10 @@ var te = y.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r
|
|
|
554
484
|
});
|
|
555
485
|
};
|
|
556
486
|
}, [h]), b(() => {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
h.view.dispatch(h.state.tr.setMeta(f, {
|
|
563
|
-
type: "updateOptions",
|
|
564
|
-
options: _.current
|
|
565
|
-
}));
|
|
566
|
-
}
|
|
487
|
+
v && h && !h.isDestroyed && (x.current ? x.current = !1 : h.view.dispatch(h.state.tr.setMeta(f, {
|
|
488
|
+
type: "updateOptions",
|
|
489
|
+
options: _.current
|
|
490
|
+
})));
|
|
567
491
|
}, [
|
|
568
492
|
v,
|
|
569
493
|
h,
|
|
@@ -610,16 +534,10 @@ y.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r, appendT
|
|
|
610
534
|
});
|
|
611
535
|
};
|
|
612
536
|
}, [p]), b(() => {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
618
|
-
p.view.dispatch(p.state.tr.setMeta(d, {
|
|
619
|
-
type: "updateOptions",
|
|
620
|
-
options: g.current
|
|
621
|
-
}));
|
|
622
|
-
}
|
|
537
|
+
_ && p && !p.isDestroyed && (y.current ? y.current = !1 : p.view.dispatch(p.state.tr.setMeta(d, {
|
|
538
|
+
type: "updateOptions",
|
|
539
|
+
options: g.current
|
|
540
|
+
})));
|
|
623
541
|
}, [
|
|
624
542
|
_,
|
|
625
543
|
p,
|