@revolist/ui 4.0.1-rc → 4.0.3-rc

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 (288) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +345 -262
  3. package/_chunks/calendar-xpZ0v3xf.js +258 -0
  4. package/_chunks/chart-frame-Cmc7xU1i.js +130 -0
  5. package/_chunks/choice-chips-CHQTUdLs.js +110 -0
  6. package/_chunks/clock-BOhPNlW3.js +4 -0
  7. package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-D8vyPfld.js} +41 -41
  8. package/_chunks/color-picker-CudqPYZo.js +138 -0
  9. package/_chunks/component-C_T2VN5u.js +863 -0
  10. package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
  11. package/_chunks/control-AHKXD5Eu.js +93 -0
  12. package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-uscKfAnV.js} +29 -29
  13. package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
  14. package/_chunks/{controls-NEL5tDaz.js → controls-DsNi8V8I.js} +229 -214
  15. package/_chunks/{date-control-CYCkb1aQ.js → date-control-DrVFX13g.js} +21 -21
  16. package/_chunks/date-time-qIhp5vaX.js +768 -0
  17. package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
  18. package/_chunks/dialog.parts-CKGkC5zP.js +134 -0
  19. package/_chunks/duration-CL68Em0o.js +272 -0
  20. package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
  21. package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-WDdtVDNA.js} +8 -8
  22. package/_chunks/field-context-D57PnBbH.js +5 -0
  23. package/_chunks/framework-mount--RTLIqE-.js +54 -0
  24. package/_chunks/history-controls-B3u3INEK.js +27 -0
  25. package/_chunks/hooks.module-CG3gN83z.js +157 -0
  26. package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
  27. package/_chunks/mount-DQ1cpppK.js +257 -0
  28. package/_chunks/native-control-C_yok8_-.js +605 -0
  29. package/_chunks/native.view-ByyZ1CT5.js +32 -0
  30. package/_chunks/{number-input-NnH57J4j.js → number-input-BKwA5FnM.js} +89 -89
  31. package/_chunks/picker-h1P5RUgp.js +122 -0
  32. package/_chunks/popup-CT2uD3go.js +367 -0
  33. package/_chunks/preact.module-BBM36DnO.js +290 -0
  34. package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-DZgmaic0.js} +10 -10
  35. package/_chunks/render-m5eMMwFR.js +83 -0
  36. package/_chunks/reorder-list-CSlqAGHw.js +59 -0
  37. package/_chunks/request-trail-DSlFix6i.js +618 -0
  38. package/_chunks/rich-text-CH7gIqOS.js +636 -0
  39. package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
  40. package/_form.scss +1 -1
  41. package/_vendor/preact/LICENSE +21 -0
  42. package/_vendor/preact/compat/src/index.d.ts +353 -0
  43. package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
  44. package/_vendor/preact/compat/src/suspense.d.ts +19 -0
  45. package/_vendor/preact/hooks/src/index.d.ts +145 -0
  46. package/_vendor/preact/src/dom.d.ts +2548 -0
  47. package/_vendor/preact/src/index.d.ts +373 -0
  48. package/_vendor/preact/src/jsx.d.ts +2958 -0
  49. package/activity-message.d.ts +1 -1
  50. package/activity-message.js +16 -16
  51. package/ai/_chat.scss +195 -0
  52. package/ai/_style.scss +105 -34
  53. package/ai/chat.d.ts +63 -0
  54. package/ai/components.d.ts +20 -4
  55. package/ai/index.d.ts +2 -0
  56. package/ai/index.js +3 -3
  57. package/ai/mount.d.ts +30 -1
  58. package/ai/prompt-history.d.ts +13 -0
  59. package/ai/request-trail.d.ts +1 -1
  60. package/ai/transcript.d.ts +25 -0
  61. package/ai/translation-context.d.ts +1 -1
  62. package/ai/translations.d.ts +1 -1
  63. package/alert.d.ts +2 -2
  64. package/angular/angular.js +0 -3
  65. package/assignee/field.d.ts +2 -2
  66. package/assignee/index.js +86 -87
  67. package/assignee/layout.d.ts +2 -2
  68. package/assignee/picker.d.ts +1 -1
  69. package/avatar/index.js +25 -25
  70. package/avatar/index.view.d.ts +1 -1
  71. package/brush-range/component.d.ts +1 -1
  72. package/brush-range/component.js +30 -30
  73. package/buttons/delete-button.d.ts +2 -1
  74. package/buttons/delete-button.js +1 -1
  75. package/buttons/remove-button.d.ts +1 -1
  76. package/buttons/remove-button.js +3 -3
  77. package/buttons/svg-button.d.ts +2 -1
  78. package/buttons/svg-button.js +35 -35
  79. package/calendar/_calendar.scss +7 -2
  80. package/calendar/calendar.d.ts +1 -1
  81. package/calendar/calendar.js +1 -1
  82. package/calendar/caption.d.ts +1 -1
  83. package/calendar/day.d.ts +1 -1
  84. package/calendar/day.js +4 -4
  85. package/calendar/header.d.ts +1 -1
  86. package/calendar/header.js +35 -35
  87. package/calendar/index.js +2 -2
  88. package/calendar/month-grid.d.ts +1 -1
  89. package/calendar/month-grid.js +37 -37
  90. package/calendar/picker.d.ts +1 -1
  91. package/calendar/types.d.ts +1 -1
  92. package/calendar/year-grid.d.ts +1 -1
  93. package/calendar/year-grid.js +12 -12
  94. package/checkbox/index.d.ts +2 -2
  95. package/checkbox/index.js +9 -9
  96. package/choice-chips/index.d.ts +1 -1
  97. package/choice-chips/index.js +1 -1
  98. package/color-palette/color-palette.d.ts +1 -1
  99. package/color-palette/color-palette.js +1 -1
  100. package/color-palette/color-picker.d.ts +1 -1
  101. package/color-palette/color-picker.js +2 -2
  102. package/component-catalog.d.ts +34 -23
  103. package/control-attributes.js +7 -7
  104. package/control-presentation.js +18 -18
  105. package/controls.d.ts +12 -10
  106. package/controls.js +3 -3
  107. package/core/editor-commit.d.ts +1 -1
  108. package/core/editor-popup.d.ts +1 -1
  109. package/core/editor-popup.js +1 -1
  110. package/date-time/date-control.d.ts +1 -1
  111. package/date-time/field.d.ts +2 -2
  112. package/date-time/index.js +1 -1
  113. package/date-time/picker.d.ts +1 -1
  114. package/date-time/style.scss +4 -4
  115. package/date-time/time-control.d.ts +1 -1
  116. package/date-time/time-selection.d.ts +1 -1
  117. package/date-time/types.d.ts +1 -1
  118. package/dialog/dialog-action-footer.view.d.ts +1 -1
  119. package/dialog/dialog.dom.js +52 -52
  120. package/dialog/dialog.parts.d.ts +18 -18
  121. package/dialog/dialog.parts.js +1 -1
  122. package/dialog/dialog.preact.d.ts +1 -1
  123. package/dialog/dialog.preact.js +6 -6
  124. package/distribution-chart/area-chart.d.ts +1 -1
  125. package/distribution-chart/area-chart.js +25 -25
  126. package/distribution-chart/bar-chart.d.ts +6 -3
  127. package/distribution-chart/bar-chart.js +10 -6
  128. package/distribution-chart/chart-frame.d.ts +3 -2
  129. package/distribution-chart/index.d.ts +1 -1
  130. package/distribution-chart/index.js +6 -6
  131. package/distribution-chart/line-chart.d.ts +1 -1
  132. package/distribution-chart/line-chart.js +9 -9
  133. package/distribution-chart/types.d.ts +1 -1
  134. package/dropdown/content.d.ts +3 -2
  135. package/dropdown/content.js +1 -141
  136. package/dropdown/control.d.ts +14 -0
  137. package/dropdown/control.js +1 -0
  138. package/dropdown/control.view.d.ts +6 -0
  139. package/dropdown/dropdown.service.d.ts +1 -1
  140. package/dropdown/dropdown.service.js +9 -9
  141. package/dropdown/dropdown.types.d.ts +4 -0
  142. package/dropdown/editor-dropdown.style.scss +37 -9
  143. package/dropdown/index.d.ts +1 -1
  144. package/dropdown/index.js +3 -4
  145. package/dropdown/lookup-field.d.ts +1 -1
  146. package/dropdown/lookup-field.js +41 -41
  147. package/dropdown/popup.d.ts +1 -1
  148. package/dropdown/popup.js +1 -140
  149. package/duration/controls.d.ts +1 -1
  150. package/duration/index.d.ts +2 -2
  151. package/duration/index.js +1 -1
  152. package/duration/style.scss +1 -1
  153. package/editor-actions.d.ts +1 -1
  154. package/editor-actions.js +21 -20
  155. package/editor-layout/index.d.ts +1 -1
  156. package/editor-layout/index.js +27 -27
  157. package/field-configurator.d.ts +1 -1
  158. package/field-configurator.js +93 -93
  159. package/field-reorder.hook.js +32 -32
  160. package/fieldset.d.ts +3 -0
  161. package/filter/filters/slider/preact.js +3 -3
  162. package/filter/filters/slider/single.d.ts +1 -1
  163. package/filter/filters/slider/single.js +23 -23
  164. package/filter-badge.d.ts +1 -1
  165. package/filter-badge.js +23 -22
  166. package/filter-controls.d.ts +1 -1
  167. package/filter-controls.js +30 -30
  168. package/form-controls/field-context.d.ts +5 -0
  169. package/form-controls/index.js +16 -21
  170. package/form-controls/index.view.d.ts +2 -4
  171. package/form-controls/presentation.d.ts +1 -1
  172. package/form-controls/presentation.js +59 -51
  173. package/formatting/comparison-preview.d.ts +1 -1
  174. package/formatting/control-tooltip.d.ts +1 -1
  175. package/formatting/icon-controls.d.ts +1 -1
  176. package/formatting/index.js +105 -100
  177. package/formatting/inspector-section.d.ts +1 -1
  178. package/formatting/typography-controls.d.ts +1 -1
  179. package/framework-mount.d.ts +1 -1
  180. package/framework.js +215 -207
  181. package/history-controls.d.ts +14 -0
  182. package/history-controls.js +1 -0
  183. package/icons/icon.d.ts +1 -1
  184. package/icons/icon.js +1 -1
  185. package/legend.d.ts +1 -1
  186. package/legend.js +12 -12
  187. package/masked-input/index.d.ts +1 -1
  188. package/masked-input/index.js +109 -109
  189. package/native-control.d.ts +14 -12
  190. package/native-control.js +3 -26
  191. package/native-styles.css +1 -1
  192. package/native.js +40 -39
  193. package/number-input/index.d.ts +1 -1
  194. package/number-input/index.js +1 -1
  195. package/package.json +18 -14
  196. package/pagination.d.ts +3 -0
  197. package/pagination.js +43 -33
  198. package/pdf-viewer/component.d.ts +1 -1
  199. package/pdf-viewer/controller.js +1 -1
  200. package/pdf-viewer/header.d.ts +1 -1
  201. package/pdf-viewer/index.js +13 -13
  202. package/pdf-viewer/search-bar.d.ts +1 -1
  203. package/pdf-viewer/status.d.ts +1 -1
  204. package/pdf-viewer/style.scss +3 -4
  205. package/pdf-viewer/toolbar.d.ts +1 -1
  206. package/pickers.d.ts +1 -1
  207. package/preact-mount.d.ts +1 -1
  208. package/preact-mount.js +1 -1
  209. package/preact.d.ts +2 -0
  210. package/preact.js +62 -62
  211. package/rating-choice.d.ts +1 -1
  212. package/rating-choice.js +1 -1
  213. package/react-adapter.d.ts +1 -1
  214. package/react-control.d.ts +0 -1
  215. package/react-control.js +2 -2
  216. package/react.d.ts +13 -3
  217. package/react.js +71 -88
  218. package/reorder-list.d.ts +1 -1
  219. package/reorder-list.js +1 -1
  220. package/resource-picker/resource-picker-avatar.d.ts +1 -1
  221. package/resource-picker/resource-picker-avatar.js +14 -14
  222. package/resource-picker/resource-picker-option.d.ts +1 -1
  223. package/resource-picker/resource-picker-option.js +28 -28
  224. package/resource-picker/resource-picker-popup.d.ts +1 -1
  225. package/resource-picker/resource-picker-popup.js +3 -3
  226. package/resource-picker/resource-picker.d.ts +1 -1
  227. package/resource-picker/resource-picker.js +88 -88
  228. package/resource-picker/resource-picker.scss +6 -3
  229. package/rich-text/engine.d.ts +16 -19
  230. package/rich-text/index.d.ts +7 -7
  231. package/rich-text/index.js +1 -1
  232. package/rich-text/model.d.ts +4 -3
  233. package/rich-text/render-model.d.ts +4 -5
  234. package/rich-text/style.scss +3 -12
  235. package/rich-text/toolbar.d.ts +7 -7
  236. package/rich-text/translations.d.ts +3 -15
  237. package/search-input/index.js +12 -12
  238. package/segmented-switch/index.d.ts +1 -1
  239. package/segmented-switch/index.js +1 -1
  240. package/select.d.ts +20 -0
  241. package/select.js +1 -0
  242. package/status-feedback/exit-snapshot.js +4 -4
  243. package/status-feedback/index.js +2 -2
  244. package/status-feedback/popover.js +10 -10
  245. package/status-feedback/render.d.ts +2 -2
  246. package/status-feedback/render.js +3 -44
  247. package/status-feedback/status-feedback.scss +7 -0
  248. package/status-feedback/types.d.ts +4 -0
  249. package/status-feedback/use-auto-dismiss.d.ts +3 -0
  250. package/styles/_compositions.scss +3 -1
  251. package/styles/_control.scss +12 -4
  252. package/styles/_primitives.scss +9 -8
  253. package/styles.css +1 -1
  254. package/surfaces.js +49 -49
  255. package/svelte/UiComponent.server.js +1 -48
  256. package/svelte/UiComponent.svelte +0 -21
  257. package/svelte.js +33 -68
  258. package/switch/index.js +15 -15
  259. package/time-grid.d.ts +1 -1
  260. package/time-grid.js +58 -58
  261. package/timeline-track/component.d.ts +5 -1
  262. package/timeline-track/index.js +91 -74
  263. package/timeline-track/model.d.ts +9 -0
  264. package/timeline-track/model.js +10 -1
  265. package/ui.css +1 -1
  266. package/vue-adapter.d.ts +1 -1
  267. package/vue.d.ts +138 -119
  268. package/vue.js +150 -174
  269. package/_chunks/calendar-BsDxCYhI.js +0 -248
  270. package/_chunks/chart-frame-BvxbmEU9.js +0 -126
  271. package/_chunks/choice-chips-0HfOnK_4.js +0 -110
  272. package/_chunks/color-picker-BRv-__AM.js +0 -138
  273. package/_chunks/component-D4PH5UZT.js +0 -859
  274. package/_chunks/date-time-DjucJmbc.js +0 -769
  275. package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
  276. package/_chunks/dropdown-CkGQBm1Q.js +0 -357
  277. package/_chunks/duration-BCaktcvz.js +0 -270
  278. package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
  279. package/_chunks/framework-mount-BKIOsvY-.js +0 -54
  280. package/_chunks/mount-0-8opf1j.js +0 -90
  281. package/_chunks/native.view-8q_nwQ7x.js +0 -32
  282. package/_chunks/picker-oazJ7sO_.js +0 -121
  283. package/_chunks/reorder-list-BV3kZXso.js +0 -59
  284. package/_chunks/request-trail-D0oVzdRd.js +0 -347
  285. package/_chunks/rich-text-2Rla349o.js +0 -477
  286. package/react-native-select.d.ts +0 -6
  287. package/rich-text/syntax.d.ts +0 -2
  288. package/vue-native-select.d.ts +0 -9
@@ -1,9 +1,9 @@
1
- import { Input as e } from "../native-control.js";
2
- import { EditorActions as t } from "../editor-actions.js";
3
- import { useId as n, useRef as r, useState as i } from "preact/hooks";
4
- import { jsx as a, jsxs as o } from "preact/jsx-runtime";
1
+ import { a as e, i as t, t as n } from "../_chunks/hooks.module-CG3gN83z.js";
2
+ import { t as r } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
3
+ import { n as i } from "../_chunks/native-control-C_yok8_-.js";
4
+ import { EditorActions as a } from "../editor-actions.js";
5
5
  //#region src/masked-input/model.ts
6
- function s(e) {
6
+ function o(e) {
7
7
  if (typeof e != "string") return;
8
8
  let t = [], n = Array.from(e);
9
9
  for (let e = 0; e < n.length; e++) {
@@ -15,14 +15,14 @@ function s(e) {
15
15
  }
16
16
  return t.some((e) => "token" in e) ? t : void 0;
17
17
  }
18
- function c(e, t) {
18
+ function s(e, t) {
19
19
  return e === "0" ? /^[0-9]$/.test(t) : e === "A" ? /^[A-Za-z]$/.test(t) : /^[A-Za-z0-9]$/.test(t);
20
20
  }
21
- function l(e, t) {
21
+ function c(e, t) {
22
22
  let n = "";
23
23
  for (let r = 0; r < e.length; r++) {
24
24
  let i = t[r];
25
- if (!i || ("literal" in i ? e[r] !== i.literal : !c(i.token, e[r]))) return {
25
+ if (!i || ("literal" in i ? e[r] !== i.literal : !s(i.token, e[r]))) return {
26
26
  complete: !1,
27
27
  prefix: !1,
28
28
  raw: n
@@ -35,14 +35,14 @@ function l(e, t) {
35
35
  raw: n
36
36
  };
37
37
  }
38
- function u(e, t) {
38
+ function l(e, t) {
39
39
  let n = (e) => ({
40
40
  valid: !1,
41
41
  value: null,
42
42
  raw: null,
43
43
  formatted: null,
44
44
  error: e
45
- }), r = s(t.mask);
45
+ }), r = o(t.mask);
46
46
  if (!r || t.store !== void 0 && t.store !== "raw" && t.store !== "formatted") return n("configuration");
47
47
  if (e == null || e === "") return t.required ? n("required") : {
48
48
  valid: !0,
@@ -51,9 +51,9 @@ function u(e, t) {
51
51
  formatted: null
52
52
  };
53
53
  if (typeof e != "string") return n("invalid");
54
- let i = Array.from(e), a = l(i, r.filter((e) => "token" in e)), o = l(i, r), c = a.complete ? a : o.complete ? o : void 0;
55
- if (!c) return n(a.prefix || o.prefix ? "incomplete" : "invalid");
56
- let u = c.raw, d = Array.from(u), f = 0, p = r.map((e) => "literal" in e ? e.literal : d[f++]).join("");
54
+ let i = Array.from(e), a = c(i, r.filter((e) => "token" in e)), s = c(i, r), l = a.complete ? a : s.complete ? s : void 0;
55
+ if (!l) return n(a.prefix || s.prefix ? "incomplete" : "invalid");
56
+ let u = l.raw, d = Array.from(u), f = 0, p = r.map((e) => "literal" in e ? e.literal : d[f++]).join("");
57
57
  return {
58
58
  valid: !0,
59
59
  raw: u,
@@ -61,24 +61,24 @@ function u(e, t) {
61
61
  value: t.store === "formatted" ? p : u
62
62
  };
63
63
  }
64
- function d(e, t) {
65
- let n = u(e, t);
64
+ function u(e, t) {
65
+ let n = l(e, t);
66
66
  return n.valid ? n.formatted ?? "" : e == null ? "" : String(e);
67
67
  }
68
68
  //#endregion
69
69
  //#region src/masked-input/edit.ts
70
- var f = "_";
71
- function p(e, t) {
70
+ var d = "_";
71
+ function f(e, t) {
72
72
  let n = t.filter((e) => "token" in e), r = Array.from(e), i = n.map(() => "");
73
73
  if (!r.length) return i;
74
74
  if (r.length === t.length) {
75
75
  let e = 0;
76
76
  if (t.every((t, n) => {
77
77
  let a = r[n];
78
- return "literal" in t ? a === t.literal : a !== f && !c(t.token, a) ? !1 : (i[e++] = a === f ? "" : a, !0);
78
+ return "literal" in t ? a === t.literal : a !== d && !s(t.token, a) ? !1 : (i[e++] = a === d ? "" : a, !0);
79
79
  })) return i;
80
80
  }
81
- if (r.length <= n.length && r.every((e, t) => "token" in n[t] && c(n[t].token, e))) return i.map((e, t) => r[t] ?? "");
81
+ if (r.length <= n.length && r.every((e, t) => "token" in n[t] && s(n[t].token, e))) return i.map((e, t) => r[t] ?? "");
82
82
  let a = 0;
83
83
  for (let e = 0; e < r.length; e++) {
84
84
  let n = t[e], o = r[e];
@@ -86,125 +86,125 @@ function p(e, t) {
86
86
  if ("literal" in n) {
87
87
  if (o !== n.literal) return;
88
88
  } else {
89
- if (o !== f && !c(n.token, o)) return;
90
- i[a++] = o === f ? "" : o;
89
+ if (o !== d && !s(n.token, o)) return;
90
+ i[a++] = o === d ? "" : o;
91
91
  }
92
92
  }
93
93
  return i;
94
94
  }
95
- function m(e, t) {
95
+ function p(e, t) {
96
96
  let n = "", r = 0, i = [], a = [];
97
- for (let o of t) "literal" in o ? n += o.literal : (i.push(n.length), n += e[r++] || f, a.push(n.length));
97
+ for (let o of t) "literal" in o ? n += o.literal : (i.push(n.length), n += e[r++] || d, a.push(n.length));
98
98
  return {
99
99
  value: n,
100
100
  starts: i,
101
101
  ends: a
102
102
  };
103
103
  }
104
- function h(e, t) {
105
- let n = s(t.mask);
104
+ function m(e, t) {
105
+ let n = o(t.mask);
106
106
  if (!n) return e;
107
- let r = p(e, n);
108
- return r ? m(r, n).value : e;
107
+ let r = f(e, n);
108
+ return r ? p(r, n).value : e;
109
109
  }
110
- function g(e, t) {
111
- let n = s(t.mask), r = n && p(e, n);
110
+ function h(e, t) {
111
+ let n = o(t.mask), r = n && f(e, n);
112
112
  if (!n || !r) return e.length;
113
- let i = m(r, n), a = r.indexOf("");
113
+ let i = p(r, n), a = r.indexOf("");
114
114
  return i.starts[a] ?? i.value.length;
115
115
  }
116
- function _(e, t) {
117
- let n = u("", t);
116
+ function g(e, t) {
117
+ let n = l("", t);
118
118
  if (n.error === "configuration") return n;
119
- let r = s(t.mask), i = p(e, r);
119
+ let r = o(t.mask), i = f(e, r);
120
120
  return i ? i.every((e) => !e) ? n : i.some((e) => !e) ? {
121
121
  valid: !1,
122
122
  value: null,
123
123
  raw: null,
124
124
  formatted: null,
125
125
  error: "incomplete"
126
- } : u(m(i, r).value, t) : u(e, t);
126
+ } : l(p(i, r).value, t) : l(e, t);
127
127
  }
128
- function v(e, t, n, r, i, a) {
129
- let o = {
128
+ function _(e, t, n, r, i, a) {
129
+ let c = {
130
130
  value: e,
131
131
  caret: t,
132
132
  accepted: !1
133
- }, l = s(a.mask);
134
- if (!l) return o;
135
- let u = p(e, l);
133
+ }, l = o(a.mask);
134
+ if (!l) return c;
135
+ let u = f(e, l);
136
136
  if (!u) {
137
- if (t !== 0 || n !== e.length) return o;
137
+ if (t !== 0 || n !== e.length) return c;
138
138
  u = l.filter((e) => "token" in e).map(() => "");
139
139
  }
140
- let d = m(u, l), f = d.ends.filter((e) => e <= t).length, h = d.starts.filter((e) => e < n).length, g = [...u];
141
- for (let e = f; e < h; e++) g[e] = "";
142
- let _ = f;
140
+ let d = p(u, l), m = d.ends.filter((e) => e <= t).length, h = d.starts.filter((e) => e < n).length, g = [...u];
141
+ for (let e = m; e < h; e++) g[e] = "";
142
+ let _ = m;
143
143
  if ([
144
144
  "deleteContentBackward",
145
145
  "deleteContentForward",
146
146
  "deleteByCut"
147
- ].includes(r)) t === n && r !== "deleteByCut" && (_ = r === "deleteContentBackward" ? Math.max(0, f - 1) : f, _ < g.length && (g[_] = ""));
147
+ ].includes(r)) t === n && r !== "deleteByCut" && (_ = r === "deleteContentBackward" ? Math.max(0, m - 1) : m, _ < g.length && (g[_] = ""));
148
148
  else if (r.startsWith("insert") && i !== null) {
149
- let e = l.flatMap((e, t) => "token" in e ? [t] : []), r = e[f] ?? l.length, a = l.slice(f === 0 ? 0 : r), s = a.filter((e) => "token" in e), u = Array.from(i), m;
150
- if (u.length <= s.length && u.every((e, t) => "token" in s[t] && c(s[t].token, e))) m = u;
149
+ let e = l.flatMap((e, t) => "token" in e ? [t] : []), r = e[m] ?? l.length, a = l.slice(m === 0 ? 0 : r), o = a.filter((e) => "token" in e), u = Array.from(i), p;
150
+ if (u.length <= o.length && u.every((e, t) => "token" in o[t] && s(o[t].token, e))) p = u;
151
151
  else {
152
- let o = l.slice(f ? e[f - 1] + 1 : 0, r).map((e) => "literal" in e ? e.literal : "").join("");
152
+ let o = l.slice(m ? e[m - 1] + 1 : 0, r).map((e) => "literal" in e ? e.literal : "").join("");
153
153
  if (t === n && i && o.includes(i)) return {
154
154
  value: d.value,
155
- caret: d.starts[f] ?? d.value.length,
155
+ caret: d.starts[m] ?? d.value.length,
156
156
  accepted: !0
157
157
  };
158
- let s = p(i, a);
158
+ let s = f(i, a);
159
159
  if (s) {
160
160
  let e = s.findLastIndex(Boolean) + 1;
161
- s.slice(0, e).every(Boolean) && (m = s.slice(0, e));
161
+ s.slice(0, e).every(Boolean) && (p = s.slice(0, e));
162
162
  }
163
163
  }
164
- if (!m || f + m.length > g.length) return o;
165
- m.forEach((e, t) => {
166
- g[f + t] = e;
167
- }), _ = f + m.length;
168
- } else return o;
169
- let v = m(g, l);
164
+ if (!p || m + p.length > g.length) return c;
165
+ p.forEach((e, t) => {
166
+ g[m + t] = e;
167
+ }), _ = m + p.length;
168
+ } else return c;
169
+ let v = p(g, l);
170
170
  return {
171
171
  value: v.value,
172
172
  caret: v.starts[_] ?? v.value.length,
173
173
  accepted: !0
174
174
  };
175
175
  }
176
- var y = /* @__PURE__ */ new WeakMap(), b = (e) => ({
176
+ var v = /* @__PURE__ */ new WeakMap(), y = (e) => ({
177
177
  value: e.value,
178
178
  start: e.selectionStart ?? 0,
179
179
  end: e.selectionEnd ?? 0
180
180
  });
181
- function x(e, t, n, r) {
182
- let i = v(e.value, e.selectionStart ?? 0, e.selectionEnd ?? e.value.length, t, n, r);
181
+ function b(e, t, n, r) {
182
+ let i = _(e.value, e.selectionStart ?? 0, e.selectionEnd ?? e.value.length, t, n, r);
183
183
  if (i.accepted) {
184
184
  if (i.value !== e.value) {
185
- let t = y.get(e);
185
+ let t = v.get(e);
186
186
  (!t || t.current !== e.value) && (t = {
187
187
  current: e.value,
188
188
  past: [],
189
189
  future: []
190
- }, y.set(e, t)), t.past.push(b(e)), t.past.length > 100 && t.past.shift(), t.future = [], t.current = i.value;
190
+ }, v.set(e, t)), t.past.push(y(e)), t.past.length > 100 && t.past.shift(), t.future = [], t.current = i.value;
191
191
  }
192
192
  e.value = i.value, e.setSelectionRange(i.caret, i.caret);
193
193
  }
194
194
  return i.accepted;
195
195
  }
196
- function S(e, t) {
197
- let n = h(e.value, t);
196
+ function x(e, t) {
197
+ let n = m(e.value, t);
198
198
  if (n === e.value) return;
199
- let r = s(t.mask), i = p(e.value, r);
199
+ let r = o(t.mask), i = f(e.value, r);
200
200
  if (!i) return;
201
- let a = m(i, r), o = (t) => {
202
- let i = p(e.value.slice(0, t), r)?.filter(Boolean).length ?? 0;
201
+ let a = p(i, r), s = (t) => {
202
+ let i = f(e.value.slice(0, t), r)?.filter(Boolean).length ?? 0;
203
203
  return a.starts[i] ?? n.length;
204
- }, c = o(e.selectionStart ?? e.value.length), l = o(e.selectionEnd ?? e.value.length);
204
+ }, c = s(e.selectionStart ?? e.value.length), l = s(e.selectionEnd ?? e.value.length);
205
205
  e.value = n, e.setSelectionRange(c, l);
206
206
  }
207
- function C(e, t, n) {
207
+ function S(e, t, n) {
208
208
  return t.isComposing || !t.cancelable || ![
209
209
  "insertText",
210
210
  "insertReplacementText",
@@ -212,91 +212,91 @@ function C(e, t, n) {
212
212
  "deleteContentBackward",
213
213
  "deleteContentForward",
214
214
  "deleteByCut"
215
- ].includes(t.inputType) || t.inputType.startsWith("insert") && t.data === null ? !1 : (t.preventDefault(), x(e, t.inputType, t.data, n), !0);
215
+ ].includes(t.inputType) || t.inputType.startsWith("insert") && t.data === null ? !1 : (t.preventDefault(), b(e, t.inputType, t.data, n), !0);
216
216
  }
217
- function w(e, t, n) {
218
- return t.clipboardData ? (t.preventDefault(), x(e, "insertFromPaste", t.clipboardData.getData("text/plain"), n), !0) : !1;
217
+ function C(e, t, n) {
218
+ return t.clipboardData ? (t.preventDefault(), b(e, "insertFromPaste", t.clipboardData.getData("text/plain"), n), !0) : !1;
219
219
  }
220
- function T(e, t) {
220
+ function w(e, t) {
221
221
  if (t.isComposing || !(t.ctrlKey || t.metaKey) || t.altKey) return !1;
222
222
  let n = t.key.toLowerCase();
223
223
  if (n !== "z" && n !== "y") return !1;
224
224
  t.preventDefault(), t.stopPropagation();
225
- let r = y.get(e);
225
+ let r = v.get(e);
226
226
  if (!r || r.current !== e.value) return !0;
227
227
  let i = n === "y" || t.shiftKey, a = (i ? r.future : r.past).pop();
228
- return a && ((i ? r.past : r.future).push(b(e)), r.current = e.value = a.value, e.setSelectionRange(a.start, a.end)), !0;
228
+ return a && ((i ? r.past : r.future).push(y(e)), r.current = e.value = a.value, e.setSelectionRange(a.start, a.end)), !0;
229
229
  }
230
230
  //#endregion
231
231
  //#region src/masked-input/index.tsx
232
- var E = {
232
+ var T = {
233
233
  required: "Enter a value.",
234
234
  invalid: "Use only the characters and separators specified by the mask.",
235
235
  incomplete: "Complete every position in the mask.",
236
236
  configuration: "Configure a mask with 0, A, or * positions and valid escapes.",
237
237
  preview: "Formatted value"
238
238
  };
239
- function D({ value: s, options: c, apply: l, cancel: u }) {
240
- let [d, f] = i(() => h(String(s ?? ""), c)), [p, m] = i(!1), [g, v] = i(!1), y = r(!1), b = n(), x = {
241
- ...E,
242
- ...c.text
243
- }, D = _(d, c), O = p || D.error === "invalid" || D.error === "configuration", k = () => {
244
- m(!0), !y.current && D.valid && l(D.value);
239
+ function E({ value: o, options: s, apply: c, cancel: l }) {
240
+ let [u, d] = t(() => m(String(o ?? ""), s)), [f, p] = t(!1), [h, _] = t(!1), v = n(!1), y = e(), b = {
241
+ ...T,
242
+ ...s.text
243
+ }, E = g(u, s), D = f || E.error === "invalid" || E.error === "configuration", O = () => {
244
+ p(!0), !v.current && E.valid && c(E.value);
245
245
  };
246
- return /* @__PURE__ */ o("div", {
246
+ return /* @__PURE__ */ r("div", {
247
247
  class: "rv-masked-draft",
248
248
  onKeyDown: (e) => {
249
- !y.current && e.target instanceof HTMLInputElement && T(e.target, e) ? f(e.target.value) : e.key === "Enter" && (e.ctrlKey || e.metaKey || e.target instanceof HTMLInputElement) && !e.isComposing && !y.current && (e.preventDefault(), k());
249
+ !v.current && e.target instanceof HTMLInputElement && w(e.target, e) ? d(e.target.value) : e.key === "Enter" && (e.ctrlKey || e.metaKey || e.target instanceof HTMLInputElement) && !e.isComposing && !v.current && (e.preventDefault(), O());
250
250
  },
251
251
  children: [
252
- /* @__PURE__ */ a(e, {
252
+ /* @__PURE__ */ r(i, {
253
253
  type: "text",
254
- value: d,
255
- "aria-label": c.label ?? "Masked identifier",
256
- "aria-invalid": O && !D.valid,
257
- "aria-describedby": `${b}-hint${O && D.error ? ` ${b}-error` : ""}`,
258
- required: c.required,
259
- placeholder: c.placeholder ?? c.mask,
254
+ value: u,
255
+ "aria-label": s.label ?? "Masked identifier",
256
+ "aria-invalid": D && !E.valid,
257
+ "aria-describedby": `${y}-hint${D && E.error ? ` ${y}-error` : ""}`,
258
+ required: s.required,
259
+ placeholder: s.placeholder ?? s.mask,
260
260
  onBeforeInput: (e) => {
261
- !y.current && C(e.currentTarget, e, c) && f(e.currentTarget.value);
261
+ !v.current && S(e.currentTarget, e, s) && d(e.currentTarget.value);
262
262
  },
263
263
  onPaste: (e) => {
264
- !y.current && w(e.currentTarget, e, c) && f(e.currentTarget.value);
264
+ !v.current && C(e.currentTarget, e, s) && d(e.currentTarget.value);
265
265
  },
266
266
  onInput: (e) => {
267
- y.current || S(e.currentTarget, c), f(e.currentTarget.value);
267
+ v.current || x(e.currentTarget, s), d(e.currentTarget.value);
268
268
  },
269
269
  onCompositionStart: () => {
270
- y.current = !0, v(!0);
270
+ v.current = !0, _(!0);
271
271
  },
272
272
  onCompositionEnd: (e) => {
273
- y.current = !1, v(!1), S(e.currentTarget, c), f(e.currentTarget.value);
273
+ v.current = !1, _(!1), x(e.currentTarget, s), d(e.currentTarget.value);
274
274
  }
275
275
  }),
276
- /* @__PURE__ */ o("span", {
277
- id: `${b}-hint`,
276
+ /* @__PURE__ */ r("span", {
277
+ id: `${y}-hint`,
278
278
  class: "rv-masked-draft__preview",
279
279
  children: [
280
- x.preview,
280
+ b.preview,
281
281
  ": ",
282
- /* @__PURE__ */ a("output", { children: D.formatted ?? c.mask })
282
+ /* @__PURE__ */ r("output", { children: E.formatted ?? s.mask })
283
283
  ]
284
284
  }),
285
- O && D.error && /* @__PURE__ */ a("span", {
286
- id: `${b}-error`,
285
+ D && E.error && /* @__PURE__ */ r("span", {
286
+ id: `${y}-error`,
287
287
  role: "alert",
288
288
  class: "rv-editor-error",
289
- children: x[D.error]
289
+ children: b[E.error]
290
290
  }),
291
- /* @__PURE__ */ a(t, {
292
- text: c.actions,
293
- disabled: !D.valid || g,
294
- apply: k,
295
- cancel: u,
296
- clear: c.required ? void 0 : () => f(h("", c))
291
+ /* @__PURE__ */ r(a, {
292
+ text: s.actions,
293
+ disabled: !E.valid || h,
294
+ apply: O,
295
+ cancel: l,
296
+ clear: s.required ? void 0 : () => d(m("", s))
297
297
  })
298
298
  ]
299
299
  });
300
300
  }
301
301
  //#endregion
302
- export { D as MaskedDraft, c as acceptsMaskToken, x as applyMaskedEdit, v as editMaskedInput, h as formatMaskedDraft, d as formatMaskedValue, C as handleMaskedBeforeInput, T as handleMaskedHistory, w as handleMaskedPaste, s as maskParts, g as maskedDraftCaret, S as normalizeMaskedInput, _ as parseMaskedDraft, u as parseMaskedInput };
302
+ export { E as MaskedDraft, s as acceptsMaskToken, b as applyMaskedEdit, _ as editMaskedInput, m as formatMaskedDraft, u as formatMaskedValue, S as handleMaskedBeforeInput, w as handleMaskedHistory, C as handleMaskedPaste, o as maskParts, h as maskedDraftCaret, x as normalizeMaskedInput, g as parseMaskedDraft, l as parseMaskedInput };
@@ -1,28 +1,30 @@
1
- import { h, JSX } from 'preact';
1
+ import { Select as SharedSelect } from './select';
2
+ import { h, JSX } from './_vendor/preact/src/index';
2
3
  type NativeAttributes<K extends keyof JSX.IntrinsicElements> = Omit<JSX.IntrinsicElements[K], 'class' | 'className' | 'ref'> & {
3
4
  class?: JSX.IntrinsicElements[K]['class'] | Record<string, boolean | undefined>;
4
5
  className?: JSX.IntrinsicElements[K]['className'];
5
6
  };
6
7
  /** Transparent adapters preserve native event signatures and DOM refs. */
7
- export declare const Input: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<NativeAttributes<"input">> & {
8
- ref?: import('preact').Ref<HTMLInputElement> | undefined;
8
+ export declare const Input: import('./_vendor/preact/src/index').FunctionalComponent<import('./_vendor/preact/compat/src/index').PropsWithoutRef<NativeAttributes<"input">> & {
9
+ ref?: import('./_vendor/preact/src/index').Ref<HTMLInputElement> | undefined;
9
10
  }>;
10
- export declare const Select: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<NativeAttributes<"select">> & {
11
- ref?: import('preact').Ref<HTMLSelectElement> | undefined;
11
+ export declare const TextArea: import('./_vendor/preact/src/index').FunctionalComponent<import('./_vendor/preact/compat/src/index').PropsWithoutRef<NativeAttributes<"textarea">> & {
12
+ ref?: import('./_vendor/preact/src/index').Ref<HTMLTextAreaElement> | undefined;
12
13
  }>;
13
- export declare const TextArea: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<NativeAttributes<"textarea">> & {
14
- ref?: import('preact').Ref<HTMLTextAreaElement> | undefined;
15
- }>;
16
- export declare const ButtonControl: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<Omit<h.JSX.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "class" | "ref"> & {
14
+ export declare const ButtonControl: import('./_vendor/preact/src/index').FunctionalComponent<import('./_vendor/preact/compat/src/index').PropsWithoutRef<Omit<h.JSX.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "ref" | "class"> & {
17
15
  class?: h.JSX.Signalish<string | undefined> | Record<string, boolean | undefined>;
18
16
  className?: h.JSX.Signalish<string | undefined>;
19
17
  } & {
20
18
  unstyled?: boolean;
21
19
  busy?: boolean;
20
+ rounded?: boolean;
22
21
  }> & {
23
- ref?: import('preact').Ref<HTMLButtonElement> | undefined;
22
+ ref?: import('./_vendor/preact/src/index').Ref<HTMLButtonElement> | undefined;
24
23
  }>;
25
- export declare const Summary: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<NativeAttributes<"summary">> & {
26
- ref?: import('preact').Ref<HTMLElement> | undefined;
24
+ export declare const Summary: import('./_vendor/preact/src/index').FunctionalComponent<import('./_vendor/preact/compat/src/index').PropsWithoutRef<NativeAttributes<"summary">> & {
25
+ ref?: import('./_vendor/preact/src/index').Ref<HTMLElement> | undefined;
27
26
  }>;
28
27
  export { nativeControlTag } from './control-presentation';
28
+ /** Selection uses the shared Dropdown rather than browser-native UI. */
29
+ export declare const Select: typeof SharedSelect;
30
+ export { Fieldset } from './fieldset';
package/native-control.js CHANGED
@@ -1,26 +1,3 @@
1
- import { nativeControlTag as e, registerControl as t, renderControl as n } from "./control-presentation.js";
2
- import { h as r } from "preact";
3
- import { forwardRef as i } from "preact/compat";
4
- //#region src/native-control.tsx
5
- function a(e, t, ...i) {
6
- let { onChange: a, ...o } = t, s = n(r, e, o, ...i);
7
- return a && !(e === "button" && t.busy) && Object.assign(s.props, { onChange: a }), s;
8
- }
9
- var o = t(i((e, t) => a("input", {
10
- ...e,
11
- ref: t
12
- })), "input"), s = t(i(({ children: e, ...t }, n) => a("select", {
13
- ...t,
14
- ref: n
15
- }, e)), "select"), c = t(i(({ children: e, ...t }, n) => a("textarea", {
16
- ...t,
17
- ref: n
18
- }, e)), "textarea"), l = t(i(({ children: e, ...t }, n) => a("button", {
19
- ...t,
20
- ref: n
21
- }, e)), "button"), u = t(i(({ children: e, ...t }, n) => a("summary", {
22
- ...t,
23
- ref: n
24
- }, e)), "summary");
25
- //#endregion
26
- export { l as ButtonControl, o as Input, s as Select, u as Summary, c as TextArea, e as nativeControlTag };
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./_chunks/native-control-C_yok8_-.js";
2
+ import { nativeControlTag as o } from "./control-presentation.js";
3
+ export { a as ButtonControl, r as Fieldset, n as Input, i as Select, t as Summary, e as TextArea, o as nativeControlTag };