@tempots/beatui 0.94.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-CuI1Jgt6.cjs +1 -0
- package/dist/{ar-8Cko5i-Z.js → ar-DaKbK_t8.js} +88 -11
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BQIhr3-R.js} +99 -98
- package/dist/auth-divider-DvnUModP.cjs +1 -0
- package/dist/beatui.css +1628 -541
- package/dist/beatui.tailwind.css +1629 -542
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +9 -9
- package/dist/codehighlight/index.cjs.js +22 -0
- package/dist/codehighlight/index.es.js +76 -0
- package/dist/colors-B-p6IzX9.cjs +1 -0
- package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
- package/dist/{de-Bt-d2iKj.js → de-3MTPDS1i.js} +83 -6
- package/dist/de-DthHehbh.cjs +1 -0
- package/dist/{deep-merge-CoLO4id0.js → deep-merge-BzIheQtH.js} +511 -517
- package/dist/deep-merge-EkjEgK0N.cjs +1 -0
- package/dist/{duration-input-47x7nbGh.cjs → duration-input-ClgYjeBa.cjs} +1 -1
- package/dist/{duration-input-DrVonjKK.js → duration-input-DGzmIImj.js} +5 -5
- package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
- package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
- package/dist/es-B6GJLk9h.cjs +1 -0
- package/dist/{es-2llfNFX2.js → es-DwMUvBeU.js} +95 -18
- package/dist/{fa-CQVIBjKP.js → fa-0rvQiKrJ.js} +88 -11
- package/dist/fa-BwgP93iV.cjs +1 -0
- package/dist/{fr-CC3smTlW.js → fr-B4i6NzLl.js} +87 -10
- package/dist/fr-CQzk5zqY.cjs +1 -0
- package/dist/{he-CZilsN75.js → he-C71n-hsn.js} +88 -11
- package/dist/he-DcxxvRfs.cjs +1 -0
- package/dist/hi-D-KHVWg4.cjs +1 -0
- package/dist/{hi-CAZjwGv-.js → hi-xmrXpeVU.js} +88 -11
- package/dist/index-B5MAsOC-.cjs +1 -0
- package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +8055 -5285
- package/dist/input-container-BvEcp7FU.js +275 -0
- package/dist/input-container-Di1YvVB_.cjs +1 -0
- package/dist/{it-D6RXFIL6.js → it-CDZTtOBC.js} +84 -7
- package/dist/it-D344Dutu.cjs +1 -0
- package/dist/ja-BNgnDZ27.cjs +1 -0
- package/dist/{ja-D7zsz4Ij.js → ja-Zz1LzidW.js} +92 -15
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +261 -257
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +132 -133
- package/dist/{ko-taN2Npr4.js → ko-9laUsZDL.js} +91 -14
- package/dist/ko-D-WJ9NK7.cjs +1 -0
- package/dist/lexical/index.cjs.js +2 -39
- package/dist/lexical/index.es.js +2102 -20521
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +41 -4
- package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
- package/dist/menu-B92oSDct.cjs +1 -0
- package/dist/modal-BT0jjDqX.cjs +1 -0
- package/dist/{modal-ZitwUeXx.js → modal-DBguyX-b.js} +9 -9
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +7 -7
- package/dist/nl-CrqUlFie.cjs +1 -0
- package/dist/{nl-CRC6r4Q4.js → nl-Dcll9fVA.js} +87 -10
- package/dist/{notice-E_p2hg1G.js → notice-E19wu9lA.js} +51 -51
- package/dist/notice-_9XhdrFw.cjs +1 -0
- package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
- package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
- package/dist/pl-9UksIrvX.cjs +1 -0
- package/dist/{pl-C6qNs0Lq.js → pl-Dm9N9Gbr.js} +84 -7
- package/dist/prosemirror/index.cjs.js +3 -1
- package/dist/prosemirror/index.es.js +636 -4
- package/dist/{pt-CcWPLqBh.js → pt-CFi5cn0k.js} +89 -12
- package/dist/pt-_kfdzwqi.cjs +1 -0
- package/dist/{ru-Dt9-9m0E.js → ru-CEhZUw8R.js} +92 -15
- package/dist/ru-CW1WNNlr.cjs +1 -0
- package/dist/stack-BLMteGTn.js +15 -0
- package/dist/stack-dwLevGa2.cjs +1 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/text-input-DfqXolVe.js +55 -0
- package/dist/text-input-X_q01NsY.cjs +1 -0
- package/dist/toolbar-DY0ax2Qd.js +130 -0
- package/dist/toolbar-DoKdYXIL.cjs +1 -0
- package/dist/tr-B6GIRegf.cjs +1 -0
- package/dist/{tr-CDTWeRY0.js → tr-ZmnVDhLP.js} +83 -6
- package/dist/{translations-NBY7SubC.js → translations-A4kR7CW8.js} +1 -1
- package/dist/{translations-CiBhB2FV.js → translations-B1_yyDUK.js} +185 -106
- package/dist/{translations-BdCtLBZt.cjs → translations-C81buKAw.cjs} +1 -1
- package/dist/translations-Dbx7L7Q1.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +72 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +72 -0
- package/dist/types/beatui-i18n/translations.d.ts +72 -0
- package/dist/types/codehighlight/code-highlight.d.ts +21 -0
- package/dist/types/codehighlight/index.d.ts +14 -0
- package/dist/types/components/button/toggle-button.d.ts +4 -4
- package/dist/types/components/data/avatar.d.ts +3 -1
- package/dist/types/components/data/badge.d.ts +10 -18
- package/dist/types/components/data/column-filter-panel.d.ts +31 -0
- package/dist/types/components/data/column-filter.d.ts +110 -0
- package/dist/types/components/data/column-header-menu.d.ts +42 -0
- package/dist/types/components/data/data-source.d.ts +190 -0
- package/dist/types/components/data/data-table-body.d.ts +12 -0
- package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
- package/dist/types/components/data/data-table-context.d.ts +53 -0
- package/dist/types/components/data/data-table-header.d.ts +6 -0
- package/dist/types/components/data/data-table-resolve.d.ts +26 -0
- package/dist/types/components/data/data-table-types.d.ts +201 -0
- package/dist/types/components/data/data-table.d.ts +38 -0
- package/dist/types/components/data/data-toolbar.d.ts +44 -0
- package/dist/types/components/data/date-picker-shared.d.ts +55 -0
- package/dist/types/components/data/date-picker.d.ts +58 -0
- package/dist/types/components/data/date-range-picker.d.ts +56 -0
- package/dist/types/components/data/filter.d.ts +268 -0
- package/dist/types/components/data/index.d.ts +13 -4
- package/dist/types/components/data/indicator.d.ts +41 -0
- package/dist/types/components/data/progress-bar.d.ts +2 -2
- package/dist/types/components/data/selection-checkbox.d.ts +63 -0
- package/dist/types/components/data/skeleton.d.ts +1 -1
- package/dist/types/components/data/sortable-header.d.ts +55 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
- package/dist/types/components/form/control/control.d.ts +9 -9
- package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
- package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
- package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
- package/dist/types/components/form/input/combobox-input.d.ts +5 -5
- package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
- package/dist/types/components/form/input/date-input.d.ts +4 -4
- package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
- package/dist/types/components/form/input/editable-text.d.ts +2 -2
- package/dist/types/components/form/input/email-input.d.ts +4 -4
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +1 -1
- package/dist/types/components/form/input/input-options.d.ts +28 -1
- package/dist/types/components/form/input/mask-input.d.ts +8 -2
- package/dist/types/components/form/input/native-select.d.ts +3 -3
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
- package/dist/types/components/form/input/number-input.d.ts +3 -3
- package/dist/types/components/form/input/otp-input.d.ts +12 -12
- package/dist/types/components/form/input/rating-input.d.ts +7 -8
- package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/switch.d.ts +2 -2
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
- package/dist/types/components/form/input/uuid-input.d.ts +2 -2
- package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
- package/dist/types/components/layout/card.d.ts +66 -0
- package/dist/types/components/layout/collapse.d.ts +2 -2
- package/dist/types/components/layout/flex.d.ts +26 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +2 -1
- package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
- package/dist/types/components/misc/index.d.ts +1 -0
- package/dist/types/components/misc/loading-overlay.d.ts +29 -0
- package/dist/types/components/misc/notice.d.ts +4 -4
- package/dist/types/components/misc/notification-provider.d.ts +9 -3
- package/dist/types/components/misc/notification.d.ts +9 -9
- package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
- package/dist/types/components/navigation/menu.d.ts +6 -6
- package/dist/types/components/navigation/pagination.d.ts +17 -4
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
- package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
- package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
- package/dist/types/components/overlay/dialogs.d.ts +2 -2
- package/dist/types/components/overlay/modal.d.ts +9 -2
- package/dist/types/components/overlay/tooltip.d.ts +6 -6
- package/dist/types/components/theme/types.d.ts +15 -4
- package/dist/types/lexical/index.d.ts +2 -2
- package/dist/types/lexical/plugins/index.d.ts +1 -1
- package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
- package/dist/types/lexical/plugins/text.d.ts +5 -0
- package/dist/types/lexical/types.d.ts +126 -5
- package/dist/types/lexical-i18n/default.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
- package/dist/types/tokens/z-index.d.ts +18 -18
- package/dist/types/utils/use-animated-toggle.d.ts +12 -4
- package/dist/ur-CtFl_tz6.cjs +1 -0
- package/dist/{ur-CLrK5FPQ.js → ur-yYgj3NmT.js} +88 -11
- package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
- package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
- package/dist/use-form-CaW192gw.cjs +2 -0
- package/dist/{use-form-BQRVnIp9.js → use-form-Dn6v2tEh.js} +153 -152
- package/dist/utils-DmEuG3Np.cjs +1 -0
- package/dist/utils-vUtP6iPG.js +165 -0
- package/dist/{vi-B1_QDUQJ.js → vi-D5u4CLQO.js} +89 -12
- package/dist/vi-DyCZSpsk.cjs +1 -0
- package/dist/widget-customization-DgW1SXN6.cjs +1 -0
- package/dist/{widget-customization-C-fSx3RB.js → widget-customization-Dkx7kNSe.js} +413 -398
- package/dist/{zh-rDtQ92Pp.js → zh-B0kwMMer.js} +91 -14
- package/dist/zh-C3ZxMQKb.cjs +1 -0
- package/package.json +209 -38
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/ar-D2DjoXta.cjs +0 -1
- package/dist/auth-divider-C3E16pml.cjs +0 -1
- package/dist/colors-BI0YhONJ.cjs +0 -1
- package/dist/de-Cdf3432J.cjs +0 -1
- package/dist/deep-merge-Blrucd-E.cjs +0 -1
- package/dist/es-6fFPkKHL.cjs +0 -1
- package/dist/fa-GXyNzAXz.cjs +0 -1
- package/dist/fr-C6EYTwSH.cjs +0 -1
- package/dist/he-CJUgxvi8.cjs +0 -1
- package/dist/hi-DqIR4VtX.cjs +0 -1
- package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
- package/dist/hls.light.min-hEMf_E8u.js +0 -8311
- package/dist/index-1JaBwDB-.js +0 -921
- package/dist/index-B-cwxUsP.cjs +0 -1
- package/dist/index-BFzxpY7y.js +0 -68
- package/dist/index-BOC0cVoY.cjs +0 -36
- package/dist/index-CN10Cyqr.cjs +0 -1
- package/dist/index-CTcbhnPw.cjs +0 -4
- package/dist/index-DF7RFzD9.cjs +0 -1
- package/dist/index-DJ9YIJcG.js +0 -14308
- package/dist/index-DfPkCwdC.js +0 -2709
- package/dist/input-container-9r1F3KuX.js +0 -263
- package/dist/input-container-DiYEl_y8.cjs +0 -1
- package/dist/it-BvHsJ7fH.cjs +0 -1
- package/dist/ja-B2gP7OHY.cjs +0 -1
- package/dist/ko-BddhddIA.cjs +0 -1
- package/dist/menu-De_-sGeb.cjs +0 -1
- package/dist/modal-DUlqGUW7.cjs +0 -1
- package/dist/nl-COrtZUnH.cjs +0 -1
- package/dist/notice-DAVOTnfA.cjs +0 -1
- package/dist/oneof-branch-detection-D6Xa8qNR.cjs +0 -8
- package/dist/oneof-branch-detection-DCPwyutI.js +0 -6290
- package/dist/pl-BHI4zBgV.cjs +0 -1
- package/dist/pt-BGzC9MhU.cjs +0 -1
- package/dist/ru-CXeFbIPb.cjs +0 -1
- package/dist/stack-4VUGISn6.cjs +0 -1
- package/dist/stack-Bm-UZosx.js +0 -879
- package/dist/string-B9vVyfq3.cjs +0 -1
- package/dist/string-DYyMxBl-.js +0 -19
- package/dist/text-input-BgPx8BbG.js +0 -45
- package/dist/text-input-DUnhBUd6.cjs +0 -1
- package/dist/timer-BJHOsuS6.cjs +0 -1
- package/dist/timer-Rd2sKnvH.js +0 -65
- package/dist/toolbar-DKOh_gbA.js +0 -118
- package/dist/toolbar-Dkc2y1dI.cjs +0 -1
- package/dist/tr-CdOtQAtA.cjs +0 -1
- package/dist/translations-Cy9hoMGV.cjs +0 -1
- package/dist/types/components/data/calendar-shared.d.ts +0 -59
- package/dist/types/components/data/calendar.d.ts +0 -107
- package/dist/types/components/data/icon-badge.d.ts +0 -14
- package/dist/types/components/data/range-calendar.d.ts +0 -104
- package/dist/types/components/data/tag.d.ts +0 -51
- package/dist/ur-C7itXvnC.cjs +0 -1
- package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
- package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
- package/dist/use-form-DTyNw0kM.cjs +0 -2
- package/dist/utils-DEbsp9Q9.js +0 -129
- package/dist/utils-DIUEhA-Z.cjs +0 -1
- package/dist/vi-CQrUWB3y.cjs +0 -1
- package/dist/widget-customization-xEBfEPhQ.cjs +0 -1
- package/dist/zh-DWswYYTS.cjs +0 -1
|
@@ -1,6 +1,638 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { prop as U, Fragment as pe, OnDispose as x, Ensure as F, signal as z, Use as O, When as w, Repeat as fe, Value as p, computedOf as K, html as G, Task as ke, attr as g, WithElement as he } from "@tempots/dom";
|
|
2
|
+
import { a as be, T as ge, b as ye } from "../toolbar-DY0ax2Qd.js";
|
|
3
|
+
import { toggleMark as T, setBlockType as V, lift as $e, wrapIn as Me, baseKeymap as Le } from "prosemirror-commands";
|
|
4
|
+
import { E as b, a as S } from "../editor-toolbar-group-Crlu1QJw.js";
|
|
5
|
+
import { T as _e } from "../text-input-DfqXolVe.js";
|
|
6
|
+
import { B as Be } from "../translations-B1_yyDUK.js";
|
|
7
|
+
import { L as Se } from "../link-portal-Cr2l9f3k.js";
|
|
8
|
+
import { EditorState as J, Plugin as Te } from "prosemirror-state";
|
|
9
|
+
import { EditorView as Ee } from "prosemirror-view";
|
|
10
|
+
import { Schema as ve } from "prosemirror-model";
|
|
11
|
+
import { schema as qe } from "prosemirror-schema-basic";
|
|
12
|
+
import { defaultMarkdownSerializer as P, MarkdownParser as Ce, defaultMarkdownParser as D } from "prosemirror-markdown";
|
|
13
|
+
import Ie from "markdown-it";
|
|
14
|
+
import { history as Pe, redo as Q, undo as Ae } from "prosemirror-history";
|
|
15
|
+
import { keymap as A } from "prosemirror-keymap";
|
|
16
|
+
import { ticker as Re } from "@tempots/ui";
|
|
17
|
+
import { T as xe } from "../theme-kQZEeusG.js";
|
|
18
|
+
function ee(e, t) {
|
|
19
|
+
return te(e, t) != null;
|
|
20
|
+
}
|
|
21
|
+
function te(e, t) {
|
|
22
|
+
const { from: o, $from: r, to: l, empty: s } = e.selection;
|
|
23
|
+
if (!t) return null;
|
|
24
|
+
if (s) {
|
|
25
|
+
if (e.storedMarks) {
|
|
26
|
+
const m = e.storedMarks.find(
|
|
27
|
+
(y) => y.type.name === t.name
|
|
28
|
+
);
|
|
29
|
+
if (m != null) return m;
|
|
30
|
+
}
|
|
31
|
+
const n = r.marks().find((m) => m.type.name === t.name);
|
|
32
|
+
if (n != null) return n;
|
|
33
|
+
const a = r.nodeAfter;
|
|
34
|
+
if (a && a.marks) {
|
|
35
|
+
const m = a.marks.find((y) => y.type.name === t.name);
|
|
36
|
+
if (m != null) return m;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
let i = null;
|
|
41
|
+
return e.doc.nodesBetween(o, l, (c) => {
|
|
42
|
+
if (i != null) return !1;
|
|
43
|
+
if (c.marks) {
|
|
44
|
+
const n = c.marks.find((a) => a.type.name === t.name);
|
|
45
|
+
if (n != null)
|
|
46
|
+
return i = n, !1;
|
|
47
|
+
}
|
|
48
|
+
}), i;
|
|
49
|
+
}
|
|
50
|
+
function E(e, t, o) {
|
|
51
|
+
return e.map(() => {
|
|
52
|
+
const r = t.value, l = r.state.schema.marks[o];
|
|
53
|
+
return ee(r.state, l);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function Fe(e, t, o) {
|
|
57
|
+
const { $from: r } = e.selection;
|
|
58
|
+
for (let s = r.depth; s > 0; s--) {
|
|
59
|
+
const i = r.node(s);
|
|
60
|
+
if (i.type.name === t.name)
|
|
61
|
+
return o != null ? Object.keys(o).every((c) => i.attrs[c] === o[c]) : !0;
|
|
62
|
+
}
|
|
63
|
+
const l = e.doc.nodeAt(r.pos);
|
|
64
|
+
return l && l.type.name === t.name ? o != null ? Object.keys(o).every((s) => l.attrs[s] === o[s]) : !0 : !1;
|
|
65
|
+
}
|
|
66
|
+
function M(e, t, o, r) {
|
|
67
|
+
return e.map(() => {
|
|
68
|
+
const l = t.value, s = l.state.schema.nodes[o];
|
|
69
|
+
return s ? Fe(l.state, s, r) : !1;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function ze(e, t) {
|
|
73
|
+
const o = e.state.schema.marks.link;
|
|
74
|
+
if (o == null) return;
|
|
75
|
+
const { from: r, to: l } = e.state.selection, s = e.state.tr.addMark(
|
|
76
|
+
r,
|
|
77
|
+
l,
|
|
78
|
+
o.create({ href: t, title: null })
|
|
79
|
+
);
|
|
80
|
+
e.dispatch(s), e.focus();
|
|
81
|
+
}
|
|
82
|
+
function oe(e) {
|
|
83
|
+
const { state: t } = e, { $from: o, $to: r } = t.selection;
|
|
84
|
+
if (!ne(t)) return null;
|
|
85
|
+
let l = o.pos, s = r.pos;
|
|
86
|
+
const i = t.doc;
|
|
87
|
+
for (; l > 0 && i.resolve(l - 1).nodeAfter?.marks?.some((a) => a.type.name === "link"); )
|
|
88
|
+
l--;
|
|
89
|
+
for (; s < i.content.size && i.resolve(s).nodeAfter?.marks?.some((a) => a.type.name === "link"); )
|
|
90
|
+
s++;
|
|
91
|
+
return { start: l, end: s };
|
|
92
|
+
}
|
|
93
|
+
function Ve(e, t) {
|
|
94
|
+
const o = e.state.schema.marks.link;
|
|
95
|
+
if (o == null) return;
|
|
96
|
+
const r = oe(e);
|
|
97
|
+
if (r == null) return;
|
|
98
|
+
const { start: l, end: s } = r, i = e.state.tr.removeMark(l, s, o).addMark(l, s, o.create({ href: t, title: null }));
|
|
99
|
+
e.dispatch(i);
|
|
100
|
+
}
|
|
101
|
+
function De(e) {
|
|
102
|
+
const t = e.state.schema.marks.link;
|
|
103
|
+
if (t == null) return;
|
|
104
|
+
const o = oe(e);
|
|
105
|
+
if (o == null) return;
|
|
106
|
+
const { start: r, end: l } = o, s = e.state.tr.removeMark(r, l, t);
|
|
107
|
+
e.dispatch(s), e.focus();
|
|
108
|
+
}
|
|
109
|
+
function ne(e) {
|
|
110
|
+
return ee(e, e.schema.marks.link);
|
|
111
|
+
}
|
|
112
|
+
function He({
|
|
113
|
+
stateUpdate: e,
|
|
114
|
+
view: t,
|
|
115
|
+
isReadOnly: o,
|
|
116
|
+
label: r,
|
|
117
|
+
// linkDialogTitle,
|
|
118
|
+
linkUrlPlaceholder: l,
|
|
119
|
+
// linkDialogSave,
|
|
120
|
+
// linkDialogCancel,
|
|
121
|
+
// linkDialogRemoveLink,
|
|
122
|
+
size: s
|
|
123
|
+
}) {
|
|
124
|
+
const i = U(null);
|
|
125
|
+
i.on((n) => {
|
|
126
|
+
n != null && Ve(t.value, n);
|
|
127
|
+
});
|
|
128
|
+
const c = e.on(() => {
|
|
129
|
+
const n = te(
|
|
130
|
+
t.value.state,
|
|
131
|
+
t.value.state.schema.marks.link
|
|
132
|
+
);
|
|
133
|
+
n != null ? i.set(n.attrs.href ?? "") : i.set(null);
|
|
134
|
+
});
|
|
135
|
+
return pe(
|
|
136
|
+
x(c),
|
|
137
|
+
be(
|
|
138
|
+
{},
|
|
139
|
+
b({
|
|
140
|
+
display: z(!0),
|
|
141
|
+
active: E(e, t, "link"),
|
|
142
|
+
disabled: o,
|
|
143
|
+
label: r,
|
|
144
|
+
icon: "mdi:link-variant",
|
|
145
|
+
size: s,
|
|
146
|
+
onClick: () => {
|
|
147
|
+
const n = t.value.state;
|
|
148
|
+
ne(n) ? (De(t.value), i.set(null)) : (ze(t.value, ""), i.set(""));
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
F(
|
|
152
|
+
i,
|
|
153
|
+
(n) => _e({
|
|
154
|
+
value: n,
|
|
155
|
+
autofocus: !0,
|
|
156
|
+
onInput: (a) => i.set(a),
|
|
157
|
+
placeholder: l,
|
|
158
|
+
size: s
|
|
159
|
+
})
|
|
160
|
+
)
|
|
161
|
+
),
|
|
162
|
+
F(
|
|
163
|
+
i,
|
|
164
|
+
(n) => ge(
|
|
165
|
+
{
|
|
166
|
+
disabled: n.map((a) => a.trim() === ""),
|
|
167
|
+
variant: "text",
|
|
168
|
+
onClick: () => {
|
|
169
|
+
const a = i.value;
|
|
170
|
+
a && window.open(a, "_blank");
|
|
171
|
+
},
|
|
172
|
+
size: s
|
|
173
|
+
},
|
|
174
|
+
"go"
|
|
175
|
+
)
|
|
176
|
+
)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function Ne({
|
|
180
|
+
view: e,
|
|
181
|
+
stateUpdate: t,
|
|
182
|
+
features: o,
|
|
183
|
+
readOnly: r = z(!1),
|
|
184
|
+
size: l = "sm"
|
|
185
|
+
}) {
|
|
186
|
+
return F(
|
|
187
|
+
e,
|
|
188
|
+
(s) => O(Be, (i) => {
|
|
189
|
+
const c = i.$.prosemirror, n = s;
|
|
190
|
+
return ye(
|
|
191
|
+
{},
|
|
192
|
+
// Text formatting group
|
|
193
|
+
S(
|
|
194
|
+
{ display: [o.$.bold, o.$.italic, o.$.code] },
|
|
195
|
+
b({
|
|
196
|
+
active: E(t, n, "strong"),
|
|
197
|
+
display: o.$.bold,
|
|
198
|
+
onClick: () => R(n.value, "strong"),
|
|
199
|
+
disabled: r,
|
|
200
|
+
label: c.$.bold,
|
|
201
|
+
icon: "mdi:format-bold",
|
|
202
|
+
size: l
|
|
203
|
+
}),
|
|
204
|
+
b({
|
|
205
|
+
active: E(t, n, "em"),
|
|
206
|
+
display: o.$.italic,
|
|
207
|
+
onClick: () => R(n.value, "em"),
|
|
208
|
+
disabled: r,
|
|
209
|
+
label: c.$.italic,
|
|
210
|
+
icon: "mdi:format-italic",
|
|
211
|
+
size: l
|
|
212
|
+
}),
|
|
213
|
+
b({
|
|
214
|
+
active: E(t, n, "code"),
|
|
215
|
+
display: o.$.code,
|
|
216
|
+
onClick: () => R(n.value, "code"),
|
|
217
|
+
disabled: r,
|
|
218
|
+
label: c.$.code,
|
|
219
|
+
icon: "mdi:code-tags",
|
|
220
|
+
size: l
|
|
221
|
+
})
|
|
222
|
+
),
|
|
223
|
+
// Headings group
|
|
224
|
+
S(
|
|
225
|
+
{ display: [o.$.headings] },
|
|
226
|
+
fe(
|
|
227
|
+
o.$.headerLevels.map(
|
|
228
|
+
(a) => Math.min(Math.max(a, 1), 6)
|
|
229
|
+
),
|
|
230
|
+
({ counter: a }) => b({
|
|
231
|
+
active: M(t, n, "heading", {
|
|
232
|
+
level: a
|
|
233
|
+
}),
|
|
234
|
+
display: o.$.headings,
|
|
235
|
+
onClick: () => je(n.value, a),
|
|
236
|
+
disabled: r,
|
|
237
|
+
label: c.map((m) => m.heading(a)),
|
|
238
|
+
icon: `mdi:format-header-${a}`,
|
|
239
|
+
size: l
|
|
240
|
+
})
|
|
241
|
+
)
|
|
242
|
+
),
|
|
243
|
+
// Lists group
|
|
244
|
+
S(
|
|
245
|
+
{ display: [o.$.bulletList, o.$.orderedList] },
|
|
246
|
+
b({
|
|
247
|
+
active: M(t, n, "bullet_list"),
|
|
248
|
+
display: o.$.bulletList,
|
|
249
|
+
onClick: () => X(n.value, "bullet_list"),
|
|
250
|
+
disabled: r,
|
|
251
|
+
label: c.$.bulletList,
|
|
252
|
+
icon: "mdi:format-list-bulleted",
|
|
253
|
+
size: l
|
|
254
|
+
}),
|
|
255
|
+
b({
|
|
256
|
+
active: M(t, n, "ordered_list"),
|
|
257
|
+
display: o.$.orderedList,
|
|
258
|
+
onClick: () => X(n.value, "ordered_list"),
|
|
259
|
+
disabled: r,
|
|
260
|
+
label: c.$.orderedList,
|
|
261
|
+
icon: "mdi:format-list-numbered",
|
|
262
|
+
size: l
|
|
263
|
+
})
|
|
264
|
+
),
|
|
265
|
+
// Block formatting group
|
|
266
|
+
S(
|
|
267
|
+
{
|
|
268
|
+
display: [
|
|
269
|
+
o.$.blockquote,
|
|
270
|
+
o.$.codeBlock,
|
|
271
|
+
o.$.horizontalRule
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
b({
|
|
275
|
+
active: M(t, n, "blockquote"),
|
|
276
|
+
display: o.$.blockquote,
|
|
277
|
+
onClick: () => We(n.value),
|
|
278
|
+
disabled: r,
|
|
279
|
+
label: c.$.blockquote,
|
|
280
|
+
icon: "mdi:format-quote-close",
|
|
281
|
+
size: l
|
|
282
|
+
}),
|
|
283
|
+
b({
|
|
284
|
+
active: M(t, n, "code_block"),
|
|
285
|
+
display: o.$.codeBlock,
|
|
286
|
+
onClick: () => Ke(n.value),
|
|
287
|
+
disabled: r,
|
|
288
|
+
label: c.$.codeBlock,
|
|
289
|
+
icon: "mdi:code-braces",
|
|
290
|
+
size: l
|
|
291
|
+
}),
|
|
292
|
+
b({
|
|
293
|
+
active: z(!1),
|
|
294
|
+
display: o.$.horizontalRule,
|
|
295
|
+
onClick: () => Ge(n.value),
|
|
296
|
+
disabled: r,
|
|
297
|
+
label: c.$.horizontalRule,
|
|
298
|
+
icon: "mdi:minus",
|
|
299
|
+
size: l
|
|
300
|
+
})
|
|
301
|
+
),
|
|
302
|
+
w(
|
|
303
|
+
o.$.links,
|
|
304
|
+
() => He({
|
|
305
|
+
stateUpdate: t,
|
|
306
|
+
view: n,
|
|
307
|
+
isReadOnly: r,
|
|
308
|
+
label: c.$.link,
|
|
309
|
+
// linkDialogTitle: pmt.$.linkDialogTitle,
|
|
310
|
+
linkUrlPlaceholder: c.$.linkUrlPlaceholder,
|
|
311
|
+
// linkDialogSave: pmt.$.linkDialogSave,
|
|
312
|
+
// linkDialogCancel: pmt.$.linkDialogCancel,
|
|
313
|
+
// linkDialogRemoveLink: pmt.$.linkDialogRemoveLink,
|
|
314
|
+
size: l
|
|
315
|
+
})
|
|
316
|
+
)
|
|
317
|
+
);
|
|
318
|
+
})
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
function R(e, t) {
|
|
322
|
+
const o = e.state.schema.marks[t];
|
|
323
|
+
o != null && (T(o)(e.state, e.dispatch), e.focus());
|
|
324
|
+
}
|
|
325
|
+
function je(e, t) {
|
|
326
|
+
const o = e.state.schema.nodes.heading;
|
|
327
|
+
o != null && (V(o, { level: t })(e.state, e.dispatch), e.focus());
|
|
328
|
+
}
|
|
329
|
+
async function X(e, t) {
|
|
330
|
+
const { wrapInList: o, liftListItem: r } = await import("prosemirror-schema-list"), l = e.state.schema.nodes[t], s = e.state.schema.nodes.list_item;
|
|
331
|
+
if (l == null || s == null) return;
|
|
332
|
+
const { state: i } = e, { $from: c } = i.selection;
|
|
333
|
+
let n = null;
|
|
334
|
+
for (let a = c.depth; a > 0; a--) {
|
|
335
|
+
const m = c.node(a);
|
|
336
|
+
if (m.type.name === "bullet_list" || m.type.name === "ordered_list") {
|
|
337
|
+
n = m.type.name;
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
n === t ? r(s)(i, e.dispatch) : n != null ? r(s)(e.state, e.dispatch) && o(l)(e.state, e.dispatch) : o(l)(i, e.dispatch), e.focus();
|
|
342
|
+
}
|
|
343
|
+
function We(e) {
|
|
344
|
+
const t = e.state.schema.nodes.blockquote;
|
|
345
|
+
if (t == null) return;
|
|
346
|
+
const { state: o } = e, { $from: r } = o.selection;
|
|
347
|
+
let l = !1;
|
|
348
|
+
for (let s = r.depth; s > 0; s--)
|
|
349
|
+
if (r.node(s).type.name === "blockquote") {
|
|
350
|
+
l = !0;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
l ? $e(o, e.dispatch) : Me(t)(o, e.dispatch), e.focus();
|
|
354
|
+
}
|
|
355
|
+
function Ke(e) {
|
|
356
|
+
const t = e.state.schema.nodes.code_block, o = e.state.schema.nodes.paragraph;
|
|
357
|
+
if (t == null || o == null) return;
|
|
358
|
+
const { state: r } = e, { $from: l } = r.selection;
|
|
359
|
+
let s = !1;
|
|
360
|
+
for (let i = l.depth; i > 0; i--)
|
|
361
|
+
if (l.node(i).type.name === "code_block") {
|
|
362
|
+
s = !0;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
s ? V(o)(r, e.dispatch) : V(t)(r, e.dispatch), e.focus();
|
|
366
|
+
}
|
|
367
|
+
function Ge(e) {
|
|
368
|
+
const t = e.state.schema.nodes.horizontal_rule;
|
|
369
|
+
if (t != null) {
|
|
370
|
+
const o = e.state.tr.replaceSelectionWith(t.create());
|
|
371
|
+
e.dispatch(o), e.focus();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const Je = new Ce(
|
|
375
|
+
D.schema,
|
|
376
|
+
Ie("commonmark", { breaks: !0 }),
|
|
377
|
+
D.tokens
|
|
378
|
+
);
|
|
379
|
+
function Qe(e) {
|
|
380
|
+
return e.split(`
|
|
381
|
+
`).map((o, r, l) => o.trim() === "" && r < l.length - 1 ? " " : o).join(`
|
|
382
|
+
`);
|
|
383
|
+
}
|
|
384
|
+
function Y(e, t) {
|
|
385
|
+
const o = t ? Je : D;
|
|
386
|
+
let r = e ?? "";
|
|
387
|
+
return t && (r = Qe(r)), o.parse(r);
|
|
388
|
+
}
|
|
389
|
+
const Z = {
|
|
390
|
+
headings: !0,
|
|
391
|
+
bold: !0,
|
|
392
|
+
italic: !0,
|
|
393
|
+
code: !0,
|
|
394
|
+
links: !0,
|
|
395
|
+
bulletList: !0,
|
|
396
|
+
orderedList: !0,
|
|
397
|
+
blockquote: !0,
|
|
398
|
+
codeBlock: !0,
|
|
399
|
+
horizontalRule: !0,
|
|
400
|
+
hardBreak: !0,
|
|
401
|
+
headerLevels: 3
|
|
402
|
+
};
|
|
403
|
+
function Xe(e) {
|
|
404
|
+
return new Te({
|
|
405
|
+
view: () => ({
|
|
406
|
+
update: () => {
|
|
407
|
+
e();
|
|
408
|
+
}
|
|
409
|
+
}),
|
|
410
|
+
filterTransaction: () => (e(), !0)
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
const kt = (e) => {
|
|
414
|
+
const {
|
|
415
|
+
value: t,
|
|
416
|
+
onChange: o,
|
|
417
|
+
onInput: r,
|
|
418
|
+
onBlur: l,
|
|
419
|
+
class: s,
|
|
420
|
+
id: i,
|
|
421
|
+
name: c,
|
|
422
|
+
hasError: n,
|
|
423
|
+
disabled: a,
|
|
424
|
+
autofocus: m = !1,
|
|
425
|
+
readOnly: y = !1,
|
|
426
|
+
placeholder: H,
|
|
427
|
+
showToolbar: re = !1,
|
|
428
|
+
features: le,
|
|
429
|
+
preserveLineBreaks: N = !1
|
|
430
|
+
} = e, L = p.toSignal(y), v = p.toSignal(a ?? !1), se = p.toSignal(re), j = K(le ?? Z)((q) => ({
|
|
431
|
+
...Z,
|
|
432
|
+
...q
|
|
433
|
+
})), _ = U(null), W = Re();
|
|
434
|
+
return O(
|
|
435
|
+
xe,
|
|
436
|
+
({ appearance: q }) => G.div(
|
|
437
|
+
x(() => _.value?.destroy()),
|
|
438
|
+
(e.cssInjection ?? "none") === "none" ? null : ke(
|
|
439
|
+
() => import("../styles-url-hKxIOumK.js"),
|
|
440
|
+
({ default: u }) => Se({ id: "beatui-prosemirror-css", href: u })
|
|
441
|
+
),
|
|
442
|
+
g.class("bc-prosemirror-editor-container"),
|
|
443
|
+
g.class(s),
|
|
444
|
+
g.class(
|
|
445
|
+
p.map(
|
|
446
|
+
n ?? !1,
|
|
447
|
+
(u) => u ? "bc-input-container--error" : ""
|
|
448
|
+
)
|
|
449
|
+
),
|
|
450
|
+
g.id(i),
|
|
451
|
+
g.name(c),
|
|
452
|
+
// Optional toolbar
|
|
453
|
+
w(
|
|
454
|
+
K(
|
|
455
|
+
se,
|
|
456
|
+
_
|
|
457
|
+
)((u, f) => u && f != null),
|
|
458
|
+
() => Ne({
|
|
459
|
+
view: _,
|
|
460
|
+
stateUpdate: W,
|
|
461
|
+
features: j,
|
|
462
|
+
readOnly: L
|
|
463
|
+
})
|
|
464
|
+
),
|
|
465
|
+
// Editor mount point
|
|
466
|
+
G.div(
|
|
467
|
+
g.class("bc-prosemirror-editor"),
|
|
468
|
+
he((u) => {
|
|
469
|
+
const f = [];
|
|
470
|
+
return (() => {
|
|
471
|
+
try {
|
|
472
|
+
const $ = p.get(t) ?? "", C = p.get(L) ?? !1, ie = p.get(v) ?? !1, ae = p.get(j), I = Ze(
|
|
473
|
+
ve,
|
|
474
|
+
qe,
|
|
475
|
+
ae
|
|
476
|
+
), ce = Y($, N), de = Ye(I), ue = J.create({
|
|
477
|
+
doc: ce,
|
|
478
|
+
schema: I,
|
|
479
|
+
plugins: [
|
|
480
|
+
Pe(),
|
|
481
|
+
A({
|
|
482
|
+
"Mod-z": Ae,
|
|
483
|
+
"Mod-y": Q,
|
|
484
|
+
"Mod-Shift-z": Q
|
|
485
|
+
}),
|
|
486
|
+
A(de),
|
|
487
|
+
A(Le),
|
|
488
|
+
Xe(W.tick)
|
|
489
|
+
]
|
|
490
|
+
}), k = new Ee(u, {
|
|
491
|
+
state: ue,
|
|
492
|
+
editable: () => !C && !ie,
|
|
493
|
+
dispatchTransaction(d) {
|
|
494
|
+
const h = k.state.apply(d);
|
|
495
|
+
if (k.updateState(h), d.docChanged && r != null) {
|
|
496
|
+
const B = P.serialize(
|
|
497
|
+
h.doc
|
|
498
|
+
);
|
|
499
|
+
r(B);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
if (_.set(k), p.get(m) && k.focus(), H != null && f.push(
|
|
504
|
+
p.on(H, (d) => {
|
|
505
|
+
d != null && d !== "" ? u.setAttribute("data-placeholder", d) : u.removeAttribute("data-placeholder");
|
|
506
|
+
})
|
|
507
|
+
), f.push(
|
|
508
|
+
p.on(L, (d) => {
|
|
509
|
+
const h = p.get(v);
|
|
510
|
+
k.setProps({ editable: () => !d && !h });
|
|
511
|
+
})
|
|
512
|
+
), f.push(
|
|
513
|
+
p.on(v, (d) => {
|
|
514
|
+
const h = p.get(L);
|
|
515
|
+
k.setProps({ editable: () => !h && !d });
|
|
516
|
+
})
|
|
517
|
+
), f.push(
|
|
518
|
+
p.on(t, (d) => {
|
|
519
|
+
const h = P.serialize(
|
|
520
|
+
k.state.doc
|
|
521
|
+
);
|
|
522
|
+
if (d !== h) {
|
|
523
|
+
const B = Y(d, N);
|
|
524
|
+
if (B != null) {
|
|
525
|
+
const me = J.create({
|
|
526
|
+
doc: B,
|
|
527
|
+
schema: I,
|
|
528
|
+
plugins: k.state.plugins
|
|
529
|
+
});
|
|
530
|
+
k.updateState(me);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
})
|
|
534
|
+
), o != null) {
|
|
535
|
+
const d = () => {
|
|
536
|
+
const h = P.serialize(
|
|
537
|
+
k.state.doc
|
|
538
|
+
);
|
|
539
|
+
o(h);
|
|
540
|
+
};
|
|
541
|
+
u.addEventListener("blur", d, !0), f.push(
|
|
542
|
+
() => u.removeEventListener("blur", d, !0)
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
if (l != null) {
|
|
546
|
+
const d = () => {
|
|
547
|
+
l();
|
|
548
|
+
};
|
|
549
|
+
u.addEventListener("blur", d, !0), f.push(
|
|
550
|
+
() => u.removeEventListener("blur", d, !0)
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
f.push(
|
|
554
|
+
q.on((d) => {
|
|
555
|
+
d === "dark" ? u.classList.add("bc-prosemirror-editor--dark") : u.classList.remove("bc-prosemirror-editor--dark");
|
|
556
|
+
})
|
|
557
|
+
), f.push(() => k.destroy());
|
|
558
|
+
} catch ($) {
|
|
559
|
+
console.error(
|
|
560
|
+
"[BeatUI] Failed to initialize ProseMirror editor:",
|
|
561
|
+
$
|
|
562
|
+
);
|
|
563
|
+
const C = u;
|
|
564
|
+
C.textContent = "Failed to load ProseMirror Editor. Please ensure prosemirror packages are installed.";
|
|
565
|
+
}
|
|
566
|
+
})(), x(() => {
|
|
567
|
+
f.forEach(($) => $());
|
|
568
|
+
});
|
|
569
|
+
})
|
|
570
|
+
)
|
|
571
|
+
)
|
|
572
|
+
);
|
|
573
|
+
};
|
|
574
|
+
function Ye(e) {
|
|
575
|
+
const t = {}, o = e.marks.strong;
|
|
576
|
+
o != null && (t["Mod-b"] = (s, i) => T(o)(s, i));
|
|
577
|
+
const r = e.marks.em;
|
|
578
|
+
r != null && (t["Mod-i"] = (s, i) => T(r)(s, i));
|
|
579
|
+
const l = e.marks.code;
|
|
580
|
+
return l != null && (t["Mod-`"] = (s, i) => T(l)(s, i)), t;
|
|
581
|
+
}
|
|
582
|
+
function Ze(e, t, o) {
|
|
583
|
+
const r = {}, l = {}, s = t.spec.nodes.get("doc"), i = t.spec.nodes.get("text");
|
|
584
|
+
if (s == null || i == null)
|
|
585
|
+
throw new Error("Basic schema missing required doc or text nodes");
|
|
586
|
+
r.doc = { ...s, content: "block+" }, r.text = i;
|
|
587
|
+
const c = t.spec.nodes.get("paragraph");
|
|
588
|
+
if (c != null && (r.paragraph = { ...c, content: "inline*" }), o.headings) {
|
|
589
|
+
const n = t.spec.nodes.get("heading");
|
|
590
|
+
n != null && (r.heading = { ...n, content: "inline*" });
|
|
591
|
+
}
|
|
592
|
+
if (o.bulletList) {
|
|
593
|
+
const n = t.spec.nodes.get("bullet_list"), a = t.spec.nodes.get("list_item");
|
|
594
|
+
n != null && (r.bullet_list = { ...n, content: "list_item+" }), a != null && (r.list_item = { ...a, content: "paragraph block*" });
|
|
595
|
+
}
|
|
596
|
+
if (o.orderedList) {
|
|
597
|
+
const n = t.spec.nodes.get("ordered_list"), a = t.spec.nodes.get("list_item");
|
|
598
|
+
n != null && (r.ordered_list = { ...n, content: "list_item+" }), a != null && !r.list_item && (r.list_item = { ...a, content: "paragraph block*" });
|
|
599
|
+
}
|
|
600
|
+
if (o.blockquote) {
|
|
601
|
+
const n = t.spec.nodes.get("blockquote");
|
|
602
|
+
n != null && (r.blockquote = { ...n, content: "block+" });
|
|
603
|
+
}
|
|
604
|
+
if (o.codeBlock) {
|
|
605
|
+
const n = t.spec.nodes.get("code_block");
|
|
606
|
+
n != null && (r.code_block = n);
|
|
607
|
+
}
|
|
608
|
+
if (o.horizontalRule) {
|
|
609
|
+
const n = t.spec.nodes.get("horizontal_rule");
|
|
610
|
+
n != null && (r.horizontal_rule = n);
|
|
611
|
+
}
|
|
612
|
+
if (o.hardBreak) {
|
|
613
|
+
const n = t.spec.nodes.get("hard_break");
|
|
614
|
+
n != null && (r.hard_break = n);
|
|
615
|
+
}
|
|
616
|
+
if (o.bold) {
|
|
617
|
+
const n = t.spec.marks.get("strong");
|
|
618
|
+
n != null && (l.strong = n);
|
|
619
|
+
}
|
|
620
|
+
if (o.italic) {
|
|
621
|
+
const n = t.spec.marks.get("em");
|
|
622
|
+
n != null && (l.em = n);
|
|
623
|
+
}
|
|
624
|
+
if (o.code) {
|
|
625
|
+
const n = t.spec.marks.get("code");
|
|
626
|
+
n != null && (l.code = n);
|
|
627
|
+
}
|
|
628
|
+
if (o.links) {
|
|
629
|
+
const n = t.spec.marks.get("link");
|
|
630
|
+
n != null && (l.link = n);
|
|
631
|
+
}
|
|
632
|
+
return new e({ nodes: r, marks: l });
|
|
633
|
+
}
|
|
2
634
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
635
|
+
Z as DEFAULT_FEATURES,
|
|
636
|
+
kt as ProseMirrorMarkdownInput,
|
|
637
|
+
Ne as ProseMirrorToolbar
|
|
6
638
|
};
|