@burdenoff/microfe-support 2026.1031.1 → 2026.1109.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/dist/_virtual/_rolldown/runtime.js +6 -0
- package/dist/dev/main.d.ts +0 -0
- package/dist/generated/global-operations.d.ts +60 -60
- package/dist/node_modules/@tiptap/core/dist/index.js +949 -674
- package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +14 -3
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -3
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +4 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +76 -51
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +143 -127
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +3 -2
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +21 -11
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +8 -9
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +70 -49
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +108 -76
- package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +127 -113
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +1 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +21 -14
- package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +98 -105
- package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +37 -34
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +153 -101
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +742 -693
- package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +96 -17
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +55 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +53 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +53 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +45 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +11 -0
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
- package/dist/support/SupportAdminRoot.d.ts +2 -2
- package/dist/support/SupportAdminRoutes.d.ts +1 -1
- package/dist/support/SupportUserRoot.d.ts +2 -2
- package/dist/support/SupportUserRoutes.d.ts +1 -1
- package/dist/support/components/NotificationToast.d.ts +2 -2
- package/dist/support/components/PageLayout.d.ts +4 -4
- package/dist/support/components/RouteHelpers.d.ts +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.d.ts +1 -1
- package/dist/support/components/analytics/MetricCard.d.ts +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.d.ts +1 -1
- package/dist/support/components/analytics/SLAReport.d.ts +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.d.ts +1 -1
- package/dist/support/components/analytics/TopAgents.d.ts +1 -1
- package/dist/support/components/analytics/TrendChart.d.ts +1 -1
- package/dist/support/components/careers/BulkCandidateActionGuidance.d.ts +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.d.ts +7 -7
- package/dist/support/components/careers/BulkOperationFeedback.d.ts +8 -8
- package/dist/support/components/careers/BulkSelectionSummary.d.ts +2 -2
- package/dist/support/components/careers/RichTextEditor.d.ts +1 -2
- package/dist/support/components/careers/RichTextEditor.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.d.ts +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.d.ts +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.d.ts +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.d.ts +1 -1
- package/dist/support/components/tickets/AttachmentList.d.ts +1 -1
- package/dist/support/components/tickets/MarkdownContent.d.ts +1 -1
- package/dist/support/components/tickets/MessageComposer.d.ts +1 -1
- package/dist/support/components/tickets/MessageThread.d.ts +2 -2
- package/dist/support/components/tickets/TicketDetailHeader.d.ts +2 -2
- package/dist/support/components/tickets/TicketHeader.d.ts +2 -2
- package/dist/support/components/tickets/TicketSidebar.d.ts +2 -2
- package/dist/support/components/tickets/TriagePanel.d.ts +2 -2
- package/dist/support/constants/pipeline.d.ts +0 -6
- package/dist/support/events/rybbit.d.ts +1 -1
- package/dist/support/hooks/useAnalyticsOperations.d.ts +10 -25
- package/dist/support/hooks/useAnalyticsOperations.js +40 -39
- package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
- package/dist/support/hooks/useAttachmentsFailedToast.d.ts +1 -1
- package/dist/support/hooks/useChatOperations.d.ts +2 -2
- package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +7 -13
- package/dist/support/hooks/useKnowledgeBaseOperations.js +84 -83
- package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
- package/dist/support/hooks/useRegisterFooter.d.ts +1 -1
- package/dist/support/hooks/useSettingsOperations.d.ts +7 -16
- package/dist/support/hooks/useSupportAttachments.d.ts +1 -1
- package/dist/support/hooks/useTicketListOperations.d.ts +3 -6
- package/dist/support/hooks/useTicketOperations.d.ts +5 -11
- package/dist/support/hooks/useTicketOperations.js +80 -79
- package/dist/support/hooks/useTicketOperations.js.map +1 -1
- package/dist/support/pages/AnalyticsPage.d.ts +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.d.ts +1 -1
- package/dist/support/pages/ArticleDetailUserPage.d.ts +1 -1
- package/dist/support/pages/ContactInquiriesPage.d.ts +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.d.ts +1 -1
- package/dist/support/pages/CreateArticlePage.d.ts +1 -1
- package/dist/support/pages/CreateTicketPage.d.ts +1 -1
- package/dist/support/pages/EditArticlePage.d.ts +1 -1
- package/dist/support/pages/InterviewersPage.d.ts +1 -1
- package/dist/support/pages/JobApplicationDetailPage.d.ts +1 -2
- package/dist/support/pages/JobApplicationsPage.d.ts +1 -1
- package/dist/support/pages/JobPostingDetailPage.d.ts +1 -1
- package/dist/support/pages/JobPostingsPage.d.ts +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.d.ts +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.d.ts +1 -1
- package/dist/support/pages/SettingsPage.d.ts +1 -1
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.d.ts +1 -1
- package/dist/support/pages/TicketDetailUserPage.d.ts +1 -1
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.d.ts +1 -1
- package/dist/support/providers/SupportProvider.d.ts +2 -2
- package/dist/support/store/supportStore.d.ts +2 -2
- package/dist/support/utils/bulkCandidateTargetQuery.d.ts +1 -1
- package/dist/support/utils/cn.d.ts +1 -1
- package/dist/support/utils/index.d.ts +1 -1
- package/dist/support/utils/markdown.d.ts +0 -1
- package/dist/support/utils/refetch.d.ts +12 -0
- package/dist/support/utils/refetch.js +7 -0
- package/dist/support/utils/refetch.js.map +1 -0
- package/dist/support/utils/ticketFilters.d.ts +2 -2
- package/dist/support/utils/uiTokens.d.ts +1 -1
- package/dist/test/dom.d.ts +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/package.json +65 -54
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Extension as e, Node as t, getNodeAtPosition as n, getNodeType as r, getPreviousBlockSibling as i, getRenderedAttributes as a, isAtEndOfNode as o, isAtStartOfNode as s, isNodeActive as c, mergeAttributes as l, parseIndentedBlocks as u, renderNestedMarkdownContent as d, wrappingInputRule as f } from "../../core/dist/index.js";
|
|
2
2
|
import { Fragment as p } from "../../../prosemirror-model/dist/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { joinTextblockBackward as m, joinTextblockForward as h } from "../../../prosemirror-commands/dist/index.js";
|
|
4
|
+
import { Plugin as g, TextSelection as _ } from "../../../prosemirror-state/dist/index.js";
|
|
4
5
|
// node_modules/@tiptap/extension-list/dist/index.js
|
|
5
|
-
var
|
|
6
|
-
for (var n in t) g(e, n, {
|
|
7
|
-
get: t[n],
|
|
8
|
-
enumerable: !0
|
|
9
|
-
});
|
|
10
|
-
}, ee = "listItem", v = "textStyle", y = /^\s*([-+*])\s$/, b = t.create({
|
|
6
|
+
var ee = "listItem", v = "textStyle", y = /^\s*([-+*])\s$/, b = t.create({
|
|
11
7
|
name: "bulletList",
|
|
12
8
|
addOptions() {
|
|
13
9
|
return {
|
|
@@ -220,17 +216,28 @@ function P(e, t, n = ". ") {
|
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
218
|
function se(e) {
|
|
219
|
+
return !e[0] || e[0].type === "paragraph" ? e : [{
|
|
220
|
+
type: "paragraph",
|
|
221
|
+
content: []
|
|
222
|
+
}, ...e];
|
|
223
|
+
}
|
|
224
|
+
function ce(e) {
|
|
225
|
+
let t = e.content?.[0];
|
|
226
|
+
return t?.type === "paragraph" && !t.content?.length;
|
|
227
|
+
}
|
|
228
|
+
var le = " ", F = 1, ue = (e) => (e?.level ?? F) > F;
|
|
229
|
+
function de(e) {
|
|
223
230
|
let t = e.tokens?.[0];
|
|
224
231
|
return !!(e.text && e.tokens?.length === 1 && t?.type === "list" && t.ordered && t.raw === e.text);
|
|
225
232
|
}
|
|
226
|
-
function
|
|
233
|
+
function fe(e, t) {
|
|
227
234
|
return t.tokenizeInline ? t.parseInline(t.tokenizeInline(e)) : t.parseInline([{
|
|
228
235
|
type: "text",
|
|
229
236
|
raw: e,
|
|
230
237
|
text: e
|
|
231
238
|
}]);
|
|
232
239
|
}
|
|
233
|
-
var
|
|
240
|
+
var I = t.create({
|
|
234
241
|
name: "listItem",
|
|
235
242
|
addOptions() {
|
|
236
243
|
return {
|
|
@@ -256,43 +263,54 @@ var F = t.create({
|
|
|
256
263
|
if (e.type !== "list_item") return [];
|
|
257
264
|
let n = t.parseBlockChildren ?? t.parseChildren, r = [];
|
|
258
265
|
if (e.tokens && e.tokens.length > 0) {
|
|
259
|
-
if (
|
|
266
|
+
if (de(e)) return {
|
|
260
267
|
type: "listItem",
|
|
261
268
|
content: [{
|
|
262
269
|
type: "paragraph",
|
|
263
|
-
content:
|
|
270
|
+
content: fe(e.text || "", t)
|
|
264
271
|
}]
|
|
265
272
|
};
|
|
273
|
+
let [i, ...a] = e.tokens;
|
|
274
|
+
if (i.type === "heading") return {
|
|
275
|
+
type: "listItem",
|
|
276
|
+
content: [{
|
|
277
|
+
type: "paragraph",
|
|
278
|
+
content: t.parseInline(i.tokens ?? [])
|
|
279
|
+
}, ...a.length > 0 ? n(a) : []]
|
|
280
|
+
};
|
|
266
281
|
if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
|
|
267
|
-
else {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
} else r = n(e.tokens);
|
|
278
|
-
}
|
|
282
|
+
else if (i.type === "text" && i.tokens && i.tokens.length > 0) {
|
|
283
|
+
if (r = [{
|
|
284
|
+
type: "paragraph",
|
|
285
|
+
content: t.parseInline(i.tokens)
|
|
286
|
+
}], e.tokens.length > 1) {
|
|
287
|
+
let t = n(e.tokens.slice(1));
|
|
288
|
+
r.push(...t);
|
|
289
|
+
}
|
|
290
|
+
} else r = n(e.tokens);
|
|
279
291
|
}
|
|
280
292
|
return r.length === 0 && (r = [{
|
|
281
293
|
type: "paragraph",
|
|
282
294
|
content: []
|
|
283
295
|
}]), {
|
|
284
296
|
type: "listItem",
|
|
285
|
-
content: r
|
|
297
|
+
content: se(r)
|
|
286
298
|
};
|
|
287
299
|
},
|
|
288
|
-
renderMarkdown: (e, t, n) =>
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
300
|
+
renderMarkdown: (e, t, n) => {
|
|
301
|
+
let r = (e) => {
|
|
302
|
+
if (e.parentType === "bulletList") return "- ";
|
|
303
|
+
if (e.parentType === "orderedList") {
|
|
304
|
+
var t, n;
|
|
305
|
+
let r = ((t = e.meta) == null || (t = t.parentAttrs) == null ? void 0 : t.start) || 1;
|
|
306
|
+
return P((n = e.meta) == null || (n = n.parentAttrs) == null ? void 0 : n.type, r - 1 + (e.index || 0), ". ");
|
|
307
|
+
}
|
|
308
|
+
return "- ";
|
|
309
|
+
}, i = d(e, t, r, n, { alignNestedToPrefix: n?.parentType === "orderedList" });
|
|
310
|
+
if (!ce(e) || !ue(n)) return i;
|
|
311
|
+
let a = r(n);
|
|
312
|
+
return `${a}${le}${i.slice(a.length)}`;
|
|
313
|
+
},
|
|
296
314
|
addExtensions() {
|
|
297
315
|
return [x(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
|
|
298
316
|
},
|
|
@@ -303,21 +321,7 @@ var F = t.create({
|
|
|
303
321
|
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
304
322
|
};
|
|
305
323
|
}
|
|
306
|
-
}),
|
|
307
|
-
_(I, {
|
|
308
|
-
findListItemPos: () => L,
|
|
309
|
-
getNextListDepth: () => R,
|
|
310
|
-
handleBackspace: () => B,
|
|
311
|
-
handleDelete: () => U,
|
|
312
|
-
handleTab: () => W,
|
|
313
|
-
hasListBefore: () => z,
|
|
314
|
-
hasListItemAfter: () => le,
|
|
315
|
-
hasListItemBefore: () => ue,
|
|
316
|
-
listItemHasSubList: () => de,
|
|
317
|
-
nextListIsDeeper: () => V,
|
|
318
|
-
nextListIsHigher: () => H
|
|
319
|
-
});
|
|
320
|
-
var L = (e, t) => {
|
|
324
|
+
}), L = (e, t) => {
|
|
321
325
|
let { $from: n } = t.selection, i = r(e, t.schema), a = null, o = n.depth, s = n.pos, c = null;
|
|
322
326
|
for (; o > 0 && c === null;) a = n.node(o), a.type === i ? c = o : (--o, --s);
|
|
323
327
|
return c === null ? null : {
|
|
@@ -329,13 +333,13 @@ var L = (e, t) => {
|
|
|
329
333
|
if (!r) return !1;
|
|
330
334
|
let [, i] = n(t, e, r.$pos.pos + 4);
|
|
331
335
|
return i;
|
|
332
|
-
},
|
|
336
|
+
}, pe = (e, t, n) => {
|
|
333
337
|
let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
|
|
334
338
|
return !(!a || !n.includes(a.type.name));
|
|
335
|
-
},
|
|
339
|
+
}, z = (e, t, n) => {
|
|
336
340
|
if (e.commands.undoInputRule()) return !0;
|
|
337
341
|
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
338
|
-
if (!c(e.state, t) &&
|
|
342
|
+
if (!c(e.state, t) && pe(e.state, t, n)) {
|
|
339
343
|
let { $anchor: n } = e.state.selection, r = e.state.doc.resolve(n.before() - 1), i = [];
|
|
340
344
|
r.node().descendants((e, n) => {
|
|
341
345
|
e.type.name === t && i.push({
|
|
@@ -346,25 +350,21 @@ var L = (e, t) => {
|
|
|
346
350
|
let a = i.at(-1);
|
|
347
351
|
if (!a) return !1;
|
|
348
352
|
let o = e.state.doc.resolve(r.start() + a.pos + 1);
|
|
349
|
-
return e.chain().
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
},
|
|
353
|
+
return e.chain().command(({ tr: e }) => {
|
|
354
|
+
let t = o.end();
|
|
355
|
+
return e.delete(n.before(), n.after()).insert(t, n.parent), e.setSelection(_.create(e.doc, t + 1)), !0;
|
|
356
|
+
}).command(({ state: e, dispatch: t }) => (m(e, t), !0)).run();
|
|
353
357
|
}
|
|
354
358
|
if (!c(e.state, t) || !s(e.state)) return !1;
|
|
355
359
|
let { $from: r } = e.state.selection, i = r.depth - 1;
|
|
356
360
|
return r.node(i).type !== e.schema.nodes[t] || r.index(i) !== 0 ? !1 : e.chain().liftListItem(t).run();
|
|
357
|
-
},
|
|
361
|
+
}, me = (e, t) => {
|
|
358
362
|
let n = R(e, t), r = L(e, t);
|
|
359
363
|
return !r || !n ? !1 : n > r.depth;
|
|
360
|
-
},
|
|
364
|
+
}, he = (e, t) => {
|
|
361
365
|
let n = R(e, t), r = L(e, t);
|
|
362
366
|
return !r || !n ? !1 : n < r.depth;
|
|
363
|
-
},
|
|
364
|
-
if (!c(e.state, t) || !o(e.state, t)) return !1;
|
|
365
|
-
let { selection: n } = e.state, { $from: r, $to: i } = n;
|
|
366
|
-
return !n.empty && r.sameParent(i) ? !1 : V(t, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(t).joinBackward().run() : H(t, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
367
|
-
}, W = (e, t, n) => {
|
|
367
|
+
}, B = (e, t) => !c(e.state, t) || !o(e.state, t) || !e.state.selection.empty ? !1 : me(t, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(t).joinBackward().run() : he(t, e.state) ? e.commands.command(({ state: e, dispatch: t }) => h(e, t)) : e.commands.joinItemForward(), ge = (e, t, n) => {
|
|
368
368
|
let { state: r } = e, { selection: a } = r;
|
|
369
369
|
if (!a.empty) return !1;
|
|
370
370
|
let { $from: o } = a;
|
|
@@ -376,20 +376,8 @@ var L = (e, t) => {
|
|
|
376
376
|
let u = o.parent;
|
|
377
377
|
if (!l.canReplace(l.childCount, l.childCount, p.from(u))) return !1;
|
|
378
378
|
let d = o.before(), f = o.after(), m = d - 2;
|
|
379
|
-
return e.commands.command(({ tr: e, dispatch: t }) => (t && (e.delete(d, f).insert(m, p.from(u)), e.setSelection(
|
|
380
|
-
},
|
|
381
|
-
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - n.parentOffset - 2);
|
|
382
|
-
return r.index() !== r.parent.childCount - 1 && r.nodeAfter?.type.name === e;
|
|
383
|
-
}, ue = (e, t) => {
|
|
384
|
-
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - 2);
|
|
385
|
-
return r.index() !== 0 && r.nodeBefore?.type.name === e;
|
|
386
|
-
}, de = (e, t, n) => {
|
|
387
|
-
if (!n) return !1;
|
|
388
|
-
let i = r(e, t.schema), a = !1;
|
|
389
|
-
return n.descendants((e) => {
|
|
390
|
-
e.type === i && (a = !0);
|
|
391
|
-
}), a;
|
|
392
|
-
}, G = e.create({
|
|
379
|
+
return e.commands.command(({ tr: e, dispatch: t }) => (t && (e.delete(d, f).insert(m, p.from(u)), e.setSelection(_.create(e.doc, m + 1)), e.scrollIntoView()), !0));
|
|
380
|
+
}, V = e.create({
|
|
393
381
|
name: "listKeymap",
|
|
394
382
|
addOptions() {
|
|
395
383
|
return { listTypes: [{
|
|
@@ -405,74 +393,74 @@ var L = (e, t) => {
|
|
|
405
393
|
Delete: ({ editor: e }) => {
|
|
406
394
|
let t = !1;
|
|
407
395
|
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
408
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
396
|
+
e.state.schema.nodes[n] !== void 0 && B(e, n) && (t = !0);
|
|
409
397
|
}), t;
|
|
410
398
|
},
|
|
411
399
|
"Mod-Delete": ({ editor: e }) => {
|
|
412
400
|
let t = !1;
|
|
413
401
|
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
414
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
402
|
+
e.state.schema.nodes[n] !== void 0 && B(e, n) && (t = !0);
|
|
415
403
|
}), t;
|
|
416
404
|
},
|
|
417
405
|
Backspace: ({ editor: e }) => {
|
|
418
406
|
let t = !1;
|
|
419
407
|
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
420
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
408
|
+
e.state.schema.nodes[n] !== void 0 && z(e, n, r) && (t = !0);
|
|
421
409
|
}), t;
|
|
422
410
|
},
|
|
423
411
|
"Mod-Backspace": ({ editor: e }) => {
|
|
424
412
|
let t = !1;
|
|
425
413
|
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
426
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
414
|
+
e.state.schema.nodes[n] !== void 0 && z(e, n, r) && (t = !0);
|
|
427
415
|
}), t;
|
|
428
416
|
},
|
|
429
417
|
Tab: ({ editor: e }) => {
|
|
430
|
-
for (let { itemName: t, wrapperNames: n } of this.options.listTypes) if (e.state.schema.nodes[t] !== void 0 &&
|
|
418
|
+
for (let { itemName: t, wrapperNames: n } of this.options.listTypes) if (e.state.schema.nodes[t] !== void 0 && ge(e, t, n)) return !0;
|
|
431
419
|
return !1;
|
|
432
420
|
}
|
|
433
421
|
};
|
|
434
422
|
}
|
|
435
|
-
}),
|
|
423
|
+
}), H = RegExp(`^(\\s*)(${w})([.)])\\s+(.*)$`), _e = /^\s/, U = {
|
|
436
424
|
heading: /^#{1,6}(?:\s|$)/,
|
|
437
425
|
bulletItem: /^[-+*]\s+/,
|
|
438
426
|
codeFence: /^(?:```|~~~)/,
|
|
439
427
|
blockMath: /^\$\$/,
|
|
440
428
|
thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
|
|
441
429
|
};
|
|
442
|
-
function
|
|
443
|
-
return
|
|
430
|
+
function ve(e) {
|
|
431
|
+
return H.test(e.trimStart());
|
|
444
432
|
}
|
|
445
|
-
function
|
|
433
|
+
function ye(e) {
|
|
446
434
|
let t = e.trimStart();
|
|
447
|
-
return
|
|
435
|
+
return U.bulletItem.test(t) || ve(t) || U.heading.test(t) || U.thematicBreak.test(t) && !t.startsWith("-") || /^>\s?/.test(t) || U.codeFence.test(t) || U.blockMath.test(t);
|
|
448
436
|
}
|
|
449
|
-
function
|
|
450
|
-
return Object.values(
|
|
437
|
+
function be(e) {
|
|
438
|
+
return Object.values(U).some((t) => t.test(e));
|
|
451
439
|
}
|
|
452
|
-
function
|
|
440
|
+
function xe(e) {
|
|
453
441
|
let t = [], n = [], r = !1;
|
|
454
442
|
return e.forEach((e) => {
|
|
455
|
-
r ? n.push(e) : e.trim() === "" || t.length > 0 &&
|
|
443
|
+
r ? n.push(e) : e.trim() === "" || t.length > 0 && ye(e) ? (r = !0, n.push(e)) : t.push(e);
|
|
456
444
|
}), {
|
|
457
445
|
paragraphLines: t,
|
|
458
446
|
blockLines: n
|
|
459
447
|
};
|
|
460
448
|
}
|
|
461
|
-
function
|
|
449
|
+
function W(e) {
|
|
462
450
|
let t = [], n = 0, r = 0;
|
|
463
451
|
for (; n < e.length;) {
|
|
464
|
-
let i = e[n], a = i.match(
|
|
452
|
+
let i = e[n], a = i.match(H);
|
|
465
453
|
if (!a) break;
|
|
466
454
|
let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? k(s) : void 0, p = isNaN(d) ? A(s) : d, m = [l], h = n + 1, g = [i], _ = !1;
|
|
467
455
|
for (; h < e.length;) {
|
|
468
456
|
let t = e[h];
|
|
469
|
-
if (t.match(
|
|
457
|
+
if (t.match(H)) break;
|
|
470
458
|
if (t.trim() === "") g.push(t), m.push(""), _ = !0, h += 1;
|
|
471
|
-
else if (t.match(
|
|
459
|
+
else if (t.match(_e)) {
|
|
472
460
|
let e = t.length - t.trimStart().length, n = u + s.length + 1;
|
|
473
461
|
g.push(t), m.push(t.slice(Math.min(e, n))), h += 1;
|
|
474
462
|
} else {
|
|
475
|
-
if (_ ||
|
|
463
|
+
if (_ || be(t)) break;
|
|
476
464
|
g.push(t), m.push(t), h += 1;
|
|
477
465
|
}
|
|
478
466
|
}
|
|
@@ -487,13 +475,13 @@ function _e(e) {
|
|
|
487
475
|
}
|
|
488
476
|
return [t, r];
|
|
489
477
|
}
|
|
490
|
-
var
|
|
491
|
-
function
|
|
478
|
+
var Se = RegExp(`^(${w})([.)])\\s+(.+)$`);
|
|
479
|
+
function G(e) {
|
|
492
480
|
let t = e.split("\n").filter((e) => e.trim().length > 0);
|
|
493
481
|
if (t.length === 0) return null;
|
|
494
482
|
let n = [];
|
|
495
483
|
for (let e of t) {
|
|
496
|
-
let t = e.trim().match(
|
|
484
|
+
let t = e.trim().match(Se);
|
|
497
485
|
if (!t) return null;
|
|
498
486
|
n.push({
|
|
499
487
|
marker: t[1],
|
|
@@ -515,12 +503,12 @@ function J(e) {
|
|
|
515
503
|
}))
|
|
516
504
|
} : null;
|
|
517
505
|
}
|
|
518
|
-
function
|
|
506
|
+
function K(e, t, n) {
|
|
519
507
|
let r = [], i = 0;
|
|
520
508
|
for (; i < e.length;) {
|
|
521
509
|
let a = e[i];
|
|
522
510
|
if (a.indent === t) {
|
|
523
|
-
let { paragraphLines: o, blockLines: s } =
|
|
511
|
+
let { paragraphLines: o, blockLines: s } = xe(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
524
512
|
c && l.push({
|
|
525
513
|
type: "paragraph",
|
|
526
514
|
raw: c,
|
|
@@ -534,7 +522,7 @@ function Y(e, t, n) {
|
|
|
534
522
|
let d = i + 1, f = [];
|
|
535
523
|
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
536
524
|
if (f.length > 0) {
|
|
537
|
-
let e =
|
|
525
|
+
let e = K(f, Math.min(...f.map((e) => e.indent)), n);
|
|
538
526
|
l.push({
|
|
539
527
|
type: "list",
|
|
540
528
|
ordered: !0,
|
|
@@ -553,7 +541,7 @@ function Y(e, t, n) {
|
|
|
553
541
|
}
|
|
554
542
|
return r;
|
|
555
543
|
}
|
|
556
|
-
function
|
|
544
|
+
function Ce(e, t) {
|
|
557
545
|
return e.map((e) => {
|
|
558
546
|
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
559
547
|
let n = [];
|
|
@@ -575,8 +563,33 @@ function ye(e, t) {
|
|
|
575
563
|
};
|
|
576
564
|
});
|
|
577
565
|
}
|
|
578
|
-
var
|
|
579
|
-
function
|
|
566
|
+
var we = 64;
|
|
567
|
+
function q(e, t) {
|
|
568
|
+
let n = [], r = 0;
|
|
569
|
+
for (; n.length < t;) {
|
|
570
|
+
let t = e.indexOf("\n", r);
|
|
571
|
+
if (t === -1) return n.push(e.slice(r)), n;
|
|
572
|
+
n.push(e.slice(r, t)), r = t + 1;
|
|
573
|
+
}
|
|
574
|
+
return n;
|
|
575
|
+
}
|
|
576
|
+
function Te(e) {
|
|
577
|
+
let t = e.indexOf("\n"), n = t === -1 ? e : e.slice(0, t);
|
|
578
|
+
if (!H.test(n)) return [
|
|
579
|
+
[],
|
|
580
|
+
0,
|
|
581
|
+
[]
|
|
582
|
+
];
|
|
583
|
+
let r = we, i = q(e, r), a = W(i);
|
|
584
|
+
for (; a[1] === i.length && i.length === r;) r *= 2, i = q(e, r), a = W(i);
|
|
585
|
+
return [
|
|
586
|
+
a[0],
|
|
587
|
+
a[1],
|
|
588
|
+
i
|
|
589
|
+
];
|
|
590
|
+
}
|
|
591
|
+
var Ee = "listItem", J = "textStyle", Y = /^(\d+)\.\s$/;
|
|
592
|
+
function X(e) {
|
|
580
593
|
let t = e.match(/list-style-type\s*:\s*([^;]+)/i);
|
|
581
594
|
if (!t) return null;
|
|
582
595
|
switch (t[1].trim().toLowerCase()) {
|
|
@@ -589,7 +602,7 @@ function Q(e) {
|
|
|
589
602
|
default: return null;
|
|
590
603
|
}
|
|
591
604
|
}
|
|
592
|
-
var
|
|
605
|
+
var Z = t.create({
|
|
593
606
|
name: "orderedList",
|
|
594
607
|
addOptions() {
|
|
595
608
|
return {
|
|
@@ -616,14 +629,14 @@ var xe = t.create({
|
|
|
616
629
|
if (t) return t;
|
|
617
630
|
let n = e.getAttribute("style");
|
|
618
631
|
if (n) {
|
|
619
|
-
let e =
|
|
632
|
+
let e = X(n);
|
|
620
633
|
if (e) return e;
|
|
621
634
|
}
|
|
622
635
|
let r = e.querySelector("li");
|
|
623
636
|
if (r) {
|
|
624
637
|
let e = r.getAttribute("style");
|
|
625
638
|
if (e) {
|
|
626
|
-
let t =
|
|
639
|
+
let t = X(e);
|
|
627
640
|
if (t) return t;
|
|
628
641
|
}
|
|
629
642
|
}
|
|
@@ -646,7 +659,7 @@ var xe = t.create({
|
|
|
646
659
|
markdownTokenName: "list",
|
|
647
660
|
parseMarkdown: (e, t) => {
|
|
648
661
|
if (e.type !== "list" || !e.ordered) return [];
|
|
649
|
-
let n = e.start || 1, r = e.typeMarker, i = e.items ?
|
|
662
|
+
let n = e.start || 1, r = e.typeMarker, i = e.items ? Ce(e.items, t) : [], a = {};
|
|
650
663
|
return n !== 1 && (a.start = n), r && (a.type = r), Object.keys(a).length > 0 ? {
|
|
651
664
|
type: "orderedList",
|
|
652
665
|
attrs: a,
|
|
@@ -662,32 +675,32 @@ var xe = t.create({
|
|
|
662
675
|
level: "block",
|
|
663
676
|
start: () => -1,
|
|
664
677
|
tokenize: (e, t, n) => {
|
|
665
|
-
let r
|
|
666
|
-
if (
|
|
667
|
-
let o =
|
|
678
|
+
let [r, i, a] = Te(e);
|
|
679
|
+
if (r.length === 0) return;
|
|
680
|
+
let o = K(r, r[0].indent, n);
|
|
668
681
|
if (o.length !== 0) return {
|
|
669
682
|
type: "list",
|
|
670
683
|
ordered: !0,
|
|
671
|
-
start:
|
|
672
|
-
typeMarker:
|
|
684
|
+
start: r[0]?.number || 1,
|
|
685
|
+
typeMarker: r[0]?.type,
|
|
673
686
|
items: o,
|
|
674
|
-
raw:
|
|
687
|
+
raw: a.slice(0, i).join("\n")
|
|
675
688
|
};
|
|
676
689
|
}
|
|
677
690
|
},
|
|
678
691
|
markdownOptions: { indentsContent: !0 },
|
|
679
692
|
addCommands() {
|
|
680
|
-
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
693
|
+
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ee, this.editor.getAttributes(J)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
681
694
|
},
|
|
682
695
|
addKeyboardShortcuts() {
|
|
683
696
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
684
697
|
},
|
|
685
698
|
addProseMirrorPlugins() {
|
|
686
|
-
return [new
|
|
699
|
+
return [new g({ props: { handlePaste: (e, t) => {
|
|
687
700
|
if ((t.clipboardData?.getData("text/html"))?.trim()) return !1;
|
|
688
701
|
let n = t.clipboardData?.getData("text/plain");
|
|
689
702
|
if (!n) return !1;
|
|
690
|
-
let r =
|
|
703
|
+
let r = G(n);
|
|
691
704
|
if (!r) return !1;
|
|
692
705
|
try {
|
|
693
706
|
let t = e.state.schema.nodeFromJSON(r), n = e.state.tr.replaceSelectionWith(t);
|
|
@@ -699,25 +712,28 @@ var xe = t.create({
|
|
|
699
712
|
},
|
|
700
713
|
addInputRules() {
|
|
701
714
|
let e = (e, t) => (!t.attrs.type || t.attrs.type === "1") && t.childCount + t.attrs.start === +e[1], t = f({
|
|
702
|
-
find:
|
|
715
|
+
find: Y,
|
|
703
716
|
type: this.type,
|
|
704
717
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
705
718
|
joinPredicate: e
|
|
706
719
|
});
|
|
707
720
|
return (this.options.keepMarks || this.options.keepAttributes) && (t = f({
|
|
708
|
-
find:
|
|
721
|
+
find: Y,
|
|
709
722
|
type: this.type,
|
|
710
723
|
keepMarks: this.options.keepMarks,
|
|
711
724
|
keepAttributes: this.options.keepAttributes,
|
|
712
725
|
getAttributes: (e) => ({
|
|
713
726
|
start: +e[1],
|
|
714
|
-
...this.editor.getAttributes(
|
|
727
|
+
...this.editor.getAttributes(J)
|
|
715
728
|
}),
|
|
716
729
|
joinPredicate: e,
|
|
717
730
|
editor: this.editor
|
|
718
731
|
})), [t];
|
|
719
732
|
}
|
|
720
|
-
}),
|
|
733
|
+
}), Q = /^\s*(\[([( |x])?\])\s$/, De = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0", Oe = (e, t, n) => {
|
|
734
|
+
var r;
|
|
735
|
+
return (n == null || (r = n.checkboxLabel) == null ? void 0 : r.call(n, e, t)) || `Task item checkbox for ${e.textContent || "empty task item"}`;
|
|
736
|
+
}, $ = t.create({
|
|
721
737
|
name: "taskItem",
|
|
722
738
|
addOptions() {
|
|
723
739
|
return {
|
|
@@ -774,7 +790,7 @@ var xe = t.create({
|
|
|
774
790
|
},
|
|
775
791
|
renderMarkdown: (e, t) => {
|
|
776
792
|
let n = `- [${e.attrs?.checked ? "x" : " "}] `;
|
|
777
|
-
return d(e, t, n);
|
|
793
|
+
return d(e, t, n, void 0, { indentMainContent: !0 });
|
|
778
794
|
},
|
|
779
795
|
addExtensions() {
|
|
780
796
|
return this.options.nested ? [x(this.name, [this.options.taskListTypeName])] : [];
|
|
@@ -792,9 +808,9 @@ var xe = t.create({
|
|
|
792
808
|
addNodeView() {
|
|
793
809
|
return ({ node: e, HTMLAttributes: t, getPos: n, editor: r }) => {
|
|
794
810
|
let i = document.createElement("li"), o = document.createElement("label"), s = document.createElement("span"), c = document.createElement("input"), l = document.createElement("div");
|
|
795
|
-
s.style.cssText =
|
|
811
|
+
s.style.cssText = De;
|
|
796
812
|
let u = (e) => {
|
|
797
|
-
let t =
|
|
813
|
+
let t = Oe(e, e.attrs.checked, this.options.a11y);
|
|
798
814
|
c.setAttribute("aria-label", t), s.textContent = t;
|
|
799
815
|
};
|
|
800
816
|
u(e), o.contentEditable = "false", c.type = "checkbox", c.addEventListener("mousedown", (e) => e.preventDefault()), c.addEventListener("change", (t) => {
|
|
@@ -836,12 +852,12 @@ var xe = t.create({
|
|
|
836
852
|
},
|
|
837
853
|
addInputRules() {
|
|
838
854
|
return [f({
|
|
839
|
-
find:
|
|
855
|
+
find: Q,
|
|
840
856
|
type: this.type,
|
|
841
857
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
842
858
|
})];
|
|
843
859
|
}
|
|
844
|
-
}),
|
|
860
|
+
}), ke = t.create({
|
|
845
861
|
name: "taskList",
|
|
846
862
|
addOptions() {
|
|
847
863
|
return {
|
|
@@ -943,9 +959,9 @@ e.create({
|
|
|
943
959
|
name: "listKit",
|
|
944
960
|
addExtensions() {
|
|
945
961
|
let e = [];
|
|
946
|
-
return this.options.bulletList !== !1 && e.push(b.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(
|
|
962
|
+
return this.options.bulletList !== !1 && e.push(b.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(I.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(V.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Z.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push($.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(ke.configure(this.options.taskList)), e;
|
|
947
963
|
}
|
|
948
964
|
});
|
|
949
|
-
export { b as BulletList,
|
|
965
|
+
export { b as BulletList, I as ListItem, V as ListKeymap, w as ORDERED_LIST_MARKER_PATTERN, Z as OrderedList, $ as TaskItem, ke as TaskList, j as areOrderedListMarkersSequential, N as buildOrderedListAttrsFromMarker, y as bulletListInputRegex, k as detectMarkerType, P as getListMarker, Q as inputRegex, A as markerToStart, Y as orderedListInputRegex, M as parseListMarker, G as parsePlainTextOrderedListPaste, T as toRoman, E as toRomanUpper };
|
|
950
966
|
|
|
951
967
|
//# sourceMappingURL=index.js.map
|