@tempots/beatui 0.95.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.
Files changed (237) hide show
  1. package/dist/{ar-BVXPzVJB.cjs → ar-CuI1Jgt6.cjs} +1 -1
  2. package/dist/{ar-B4jDJwHQ.js → ar-DaKbK_t8.js} +87 -11
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +1 -1
  5. package/dist/{auth-divider-BPwKk8MW.js → auth-divider-BQIhr3-R.js} +99 -98
  6. package/dist/auth-divider-DvnUModP.cjs +1 -0
  7. package/dist/beatui.css +1628 -541
  8. package/dist/beatui.tailwind.css +1629 -542
  9. package/dist/better-auth/index.cjs.js +1 -1
  10. package/dist/better-auth/index.es.js +9 -9
  11. package/dist/codehighlight/index.cjs.js +22 -0
  12. package/dist/codehighlight/index.es.js +76 -0
  13. package/dist/colors-B-p6IzX9.cjs +1 -0
  14. package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
  15. package/dist/{de-Dd33yWzb.js → de-3MTPDS1i.js} +82 -6
  16. package/dist/{de-BdfPZskW.cjs → de-DthHehbh.cjs} +1 -1
  17. package/dist/{deep-merge-C8dSqIXI.js → deep-merge-BzIheQtH.js} +511 -517
  18. package/dist/deep-merge-EkjEgK0N.cjs +1 -0
  19. package/dist/{duration-input-IuFWywO5.cjs → duration-input-ClgYjeBa.cjs} +1 -1
  20. package/dist/{duration-input-DFZwkg6M.js → duration-input-DGzmIImj.js} +5 -5
  21. package/dist/{editor-toolbar-group-DiJFgGcI.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
  22. package/dist/{editor-toolbar-group-BCBfu8pG.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
  23. package/dist/es-B6GJLk9h.cjs +1 -0
  24. package/dist/{es-jHMT3_7O.js → es-DwMUvBeU.js} +94 -18
  25. package/dist/{fa-eX3_BAZR.js → fa-0rvQiKrJ.js} +87 -11
  26. package/dist/{fa-BXnP4pbN.cjs → fa-BwgP93iV.cjs} +1 -1
  27. package/dist/{fr-Bj-GjMJm.js → fr-B4i6NzLl.js} +86 -10
  28. package/dist/{fr-HJDhGjI2.cjs → fr-CQzk5zqY.cjs} +1 -1
  29. package/dist/{he-DYgmPPkG.js → he-C71n-hsn.js} +87 -11
  30. package/dist/{he-C6nEVZhN.cjs → he-DcxxvRfs.cjs} +1 -1
  31. package/dist/{hi-DMVSXAJt.cjs → hi-D-KHVWg4.cjs} +1 -1
  32. package/dist/{hi-CgYLonE9.js → hi-xmrXpeVU.js} +87 -11
  33. package/dist/index-B5MAsOC-.cjs +1 -0
  34. package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
  35. package/dist/index.cjs.js +4 -4
  36. package/dist/index.es.js +8055 -5285
  37. package/dist/input-container-BvEcp7FU.js +275 -0
  38. package/dist/input-container-Di1YvVB_.cjs +1 -0
  39. package/dist/{it-CO2BPqah.js → it-CDZTtOBC.js} +83 -7
  40. package/dist/{it-DhfVcjKb.cjs → it-D344Dutu.cjs} +1 -1
  41. package/dist/{ja-Bt6fGS_Q.cjs → ja-BNgnDZ27.cjs} +1 -1
  42. package/dist/{ja-BrzwjH8T.js → ja-Zz1LzidW.js} +91 -15
  43. package/dist/json-schema/index.cjs.js +1 -1
  44. package/dist/json-schema/index.es.js +261 -257
  45. package/dist/json-schema-display/index.cjs.js +1 -1
  46. package/dist/json-schema-display/index.es.js +2 -2
  47. package/dist/json-structure/index.cjs.js +1 -1
  48. package/dist/json-structure/index.es.js +132 -133
  49. package/dist/{ko-D-lJ4wYQ.js → ko-9laUsZDL.js} +90 -14
  50. package/dist/{ko-DfAaBGrz.cjs → ko-D-WJ9NK7.cjs} +1 -1
  51. package/dist/lexical/index.cjs.js +2 -39
  52. package/dist/lexical/index.es.js +2056 -20626
  53. package/dist/markdown/index.cjs.js +1 -1
  54. package/dist/markdown/index.es.js +41 -4
  55. package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
  56. package/dist/menu-B92oSDct.cjs +1 -0
  57. package/dist/modal-BT0jjDqX.cjs +1 -0
  58. package/dist/{modal-CwZuWiSK.js → modal-DBguyX-b.js} +9 -9
  59. package/dist/monaco/index.cjs.js +2 -2
  60. package/dist/monaco/index.es.js +7 -7
  61. package/dist/{nl-CNWBQjK5.cjs → nl-CrqUlFie.cjs} +1 -1
  62. package/dist/{nl-ClsworIe.js → nl-Dcll9fVA.js} +86 -10
  63. package/dist/{notice-D7hYFM5A.js → notice-E19wu9lA.js} +51 -51
  64. package/dist/notice-_9XhdrFw.cjs +1 -0
  65. package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
  66. package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
  67. package/dist/{pl-CqHTeu3-.cjs → pl-9UksIrvX.cjs} +1 -1
  68. package/dist/{pl-WTwLAxnV.js → pl-Dm9N9Gbr.js} +83 -7
  69. package/dist/prosemirror/index.cjs.js +3 -1
  70. package/dist/prosemirror/index.es.js +636 -4
  71. package/dist/{pt-CgkjJnsG.js → pt-CFi5cn0k.js} +88 -12
  72. package/dist/{pt-BQmsiqbo.cjs → pt-_kfdzwqi.cjs} +1 -1
  73. package/dist/{ru-CtgH7OY9.js → ru-CEhZUw8R.js} +91 -15
  74. package/dist/{ru-CG56A2To.cjs → ru-CW1WNNlr.cjs} +1 -1
  75. package/dist/stack-BLMteGTn.js +15 -0
  76. package/dist/stack-dwLevGa2.cjs +1 -0
  77. package/dist/tailwind/preset.cjs.js +1 -1
  78. package/dist/tailwind/preset.es.js +2 -2
  79. package/dist/tailwind/vite-plugin.cjs.js +1 -1
  80. package/dist/tailwind/vite-plugin.es.js +1 -1
  81. package/dist/text-input-DfqXolVe.js +55 -0
  82. package/dist/text-input-X_q01NsY.cjs +1 -0
  83. package/dist/toolbar-DY0ax2Qd.js +130 -0
  84. package/dist/toolbar-DoKdYXIL.cjs +1 -0
  85. package/dist/{tr-DE7_VtKu.cjs → tr-B6GIRegf.cjs} +1 -1
  86. package/dist/{tr-D1O1vEmr.js → tr-ZmnVDhLP.js} +81 -5
  87. package/dist/{translations-yu4gNqlP.js → translations-A4kR7CW8.js} +1 -1
  88. package/dist/{translations-DyCmyLE_.js → translations-B1_yyDUK.js} +207 -129
  89. package/dist/{translations-DBxIjvWR.cjs → translations-C81buKAw.cjs} +1 -1
  90. package/dist/translations-Dbx7L7Q1.cjs +1 -0
  91. package/dist/types/beatui-i18n/default.d.ts +71 -0
  92. package/dist/types/beatui-i18n/locales/en.d.ts +71 -0
  93. package/dist/types/beatui-i18n/translations.d.ts +71 -0
  94. package/dist/types/codehighlight/code-highlight.d.ts +21 -0
  95. package/dist/types/codehighlight/index.d.ts +14 -0
  96. package/dist/types/components/button/toggle-button.d.ts +4 -4
  97. package/dist/types/components/data/avatar.d.ts +3 -1
  98. package/dist/types/components/data/badge.d.ts +10 -18
  99. package/dist/types/components/data/column-filter-panel.d.ts +31 -0
  100. package/dist/types/components/data/column-filter.d.ts +110 -0
  101. package/dist/types/components/data/column-header-menu.d.ts +42 -0
  102. package/dist/types/components/data/data-source.d.ts +190 -0
  103. package/dist/types/components/data/data-table-body.d.ts +12 -0
  104. package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
  105. package/dist/types/components/data/data-table-context.d.ts +53 -0
  106. package/dist/types/components/data/data-table-header.d.ts +6 -0
  107. package/dist/types/components/data/data-table-resolve.d.ts +26 -0
  108. package/dist/types/components/data/data-table-types.d.ts +201 -0
  109. package/dist/types/components/data/data-table.d.ts +38 -0
  110. package/dist/types/components/data/data-toolbar.d.ts +44 -0
  111. package/dist/types/components/data/date-picker-shared.d.ts +55 -0
  112. package/dist/types/components/data/date-picker.d.ts +58 -0
  113. package/dist/types/components/data/date-range-picker.d.ts +56 -0
  114. package/dist/types/components/data/filter.d.ts +268 -0
  115. package/dist/types/components/data/index.d.ts +13 -4
  116. package/dist/types/components/data/indicator.d.ts +41 -0
  117. package/dist/types/components/data/progress-bar.d.ts +2 -2
  118. package/dist/types/components/data/selection-checkbox.d.ts +63 -0
  119. package/dist/types/components/data/skeleton.d.ts +1 -1
  120. package/dist/types/components/data/sortable-header.d.ts +55 -0
  121. package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
  122. package/dist/types/components/form/control/control.d.ts +9 -9
  123. package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
  124. package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
  125. package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
  126. package/dist/types/components/form/input/color-input.d.ts +1 -1
  127. package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
  128. package/dist/types/components/form/input/combobox-input.d.ts +5 -5
  129. package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
  130. package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
  131. package/dist/types/components/form/input/date-input.d.ts +4 -4
  132. package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
  133. package/dist/types/components/form/input/editable-text.d.ts +2 -2
  134. package/dist/types/components/form/input/email-input.d.ts +4 -4
  135. package/dist/types/components/form/input/index.d.ts +1 -0
  136. package/dist/types/components/form/input/input-container.d.ts +1 -1
  137. package/dist/types/components/form/input/input-options.d.ts +28 -1
  138. package/dist/types/components/form/input/mask-input.d.ts +8 -2
  139. package/dist/types/components/form/input/native-select.d.ts +3 -3
  140. package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
  141. package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
  142. package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
  143. package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
  144. package/dist/types/components/form/input/number-input.d.ts +3 -3
  145. package/dist/types/components/form/input/otp-input.d.ts +12 -12
  146. package/dist/types/components/form/input/rating-input.d.ts +7 -8
  147. package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
  148. package/dist/types/components/form/input/switch.d.ts +2 -2
  149. package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
  150. package/dist/types/components/form/input/uuid-input.d.ts +2 -2
  151. package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
  152. package/dist/types/components/layout/card.d.ts +66 -0
  153. package/dist/types/components/layout/collapse.d.ts +2 -2
  154. package/dist/types/components/layout/flex.d.ts +26 -0
  155. package/dist/types/components/layout/index.d.ts +1 -0
  156. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
  157. package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
  158. package/dist/types/components/misc/index.d.ts +1 -0
  159. package/dist/types/components/misc/loading-overlay.d.ts +29 -0
  160. package/dist/types/components/misc/notice.d.ts +4 -4
  161. package/dist/types/components/misc/notification-provider.d.ts +9 -3
  162. package/dist/types/components/misc/notification.d.ts +9 -9
  163. package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
  164. package/dist/types/components/navigation/menu.d.ts +6 -6
  165. package/dist/types/components/navigation/pagination.d.ts +17 -4
  166. package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
  167. package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
  168. package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
  169. package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
  170. package/dist/types/components/overlay/dialogs.d.ts +2 -2
  171. package/dist/types/components/overlay/modal.d.ts +9 -2
  172. package/dist/types/components/overlay/tooltip.d.ts +6 -6
  173. package/dist/types/components/theme/types.d.ts +15 -4
  174. package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
  175. package/dist/types/tokens/z-index.d.ts +18 -18
  176. package/dist/types/utils/use-animated-toggle.d.ts +12 -4
  177. package/dist/{ur-ZJgsSpG2.cjs → ur-CtFl_tz6.cjs} +1 -1
  178. package/dist/{ur-BcuB7IqE.js → ur-yYgj3NmT.js} +87 -11
  179. package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
  180. package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
  181. package/dist/use-form-CaW192gw.cjs +2 -0
  182. package/dist/{use-form-CfxvyTfd.js → use-form-Dn6v2tEh.js} +153 -152
  183. package/dist/utils-DmEuG3Np.cjs +1 -0
  184. package/dist/utils-vUtP6iPG.js +165 -0
  185. package/dist/{vi-D0rQ3dIx.js → vi-D5u4CLQO.js} +88 -12
  186. package/dist/{vi-BOgLRkuK.cjs → vi-DyCZSpsk.cjs} +1 -1
  187. package/dist/widget-customization-DgW1SXN6.cjs +1 -0
  188. package/dist/{widget-customization-CLZNGavL.js → widget-customization-Dkx7kNSe.js} +413 -398
  189. package/dist/{zh-DoYqiZO1.js → zh-B0kwMMer.js} +90 -14
  190. package/dist/{zh-BTZ8OZ4H.cjs → zh-C3ZxMQKb.cjs} +1 -1
  191. package/package.json +208 -37
  192. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
  193. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  194. package/dist/auth-divider-BgaQ8ifw.cjs +0 -1
  195. package/dist/colors-BI0YhONJ.cjs +0 -1
  196. package/dist/deep-merge-ChJQbUKq.cjs +0 -1
  197. package/dist/es-C8TpneCm.cjs +0 -1
  198. package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
  199. package/dist/hls.light.min-hEMf_E8u.js +0 -8311
  200. package/dist/index-1JaBwDB-.js +0 -921
  201. package/dist/index-CN10Cyqr.cjs +0 -1
  202. package/dist/index-CTcbhnPw.cjs +0 -4
  203. package/dist/index-DF7RFzD9.cjs +0 -1
  204. package/dist/index-D_zOXmU5.cjs +0 -36
  205. package/dist/index-DfPkCwdC.js +0 -2709
  206. package/dist/index-vowHNIPH.js +0 -14308
  207. package/dist/index-yOU4Ceaq.js +0 -68
  208. package/dist/index-zQ3IYJFH.cjs +0 -1
  209. package/dist/input-container-BWYHj0Iq.cjs +0 -1
  210. package/dist/input-container-DMoVdH6E.js +0 -263
  211. package/dist/menu-De_-sGeb.cjs +0 -1
  212. package/dist/modal-CiGmgsOI.cjs +0 -1
  213. package/dist/notice-CPZQuxcA.cjs +0 -1
  214. package/dist/oneof-branch-detection-BFxukD63.cjs +0 -8
  215. package/dist/oneof-branch-detection-izpPjBCR.js +0 -6290
  216. package/dist/stack-4VUGISn6.cjs +0 -1
  217. package/dist/stack-Bm-UZosx.js +0 -879
  218. package/dist/string-B9vVyfq3.cjs +0 -1
  219. package/dist/string-DYyMxBl-.js +0 -19
  220. package/dist/text-input-BLupB3cU.js +0 -45
  221. package/dist/text-input-M6WBhhVj.cjs +0 -1
  222. package/dist/timer-BJHOsuS6.cjs +0 -1
  223. package/dist/timer-Rd2sKnvH.js +0 -65
  224. package/dist/toolbar-Be1eU0qU.js +0 -118
  225. package/dist/toolbar-WWv5kcYG.cjs +0 -1
  226. package/dist/translations-OOsMRpX9.cjs +0 -1
  227. package/dist/types/components/data/calendar-shared.d.ts +0 -59
  228. package/dist/types/components/data/calendar.d.ts +0 -107
  229. package/dist/types/components/data/icon-badge.d.ts +0 -14
  230. package/dist/types/components/data/range-calendar.d.ts +0 -104
  231. package/dist/types/components/data/tag.d.ts +0 -51
  232. package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
  233. package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
  234. package/dist/use-form-ClA0ZRco.cjs +0 -2
  235. package/dist/utils-DEbsp9Q9.js +0 -129
  236. package/dist/utils-DIUEhA-Z.cjs +0 -1
  237. package/dist/widget-customization-DtEEo35Y.cjs +0 -1
@@ -1,6 +1,638 @@
1
- import { D as a, P as s, b as e } from "../index-vowHNIPH.js";
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
- a as DEFAULT_FEATURES,
4
- s as ProseMirrorMarkdownInput,
5
- e as ProseMirrorToolbar
635
+ Z as DEFAULT_FEATURES,
636
+ kt as ProseMirrorMarkdownInput,
637
+ Ne as ProseMirrorToolbar
6
638
  };