@bridge-ui/vue 0.14.0 → 0.16.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 (195) hide show
  1. package/ai/AGENTS.md +1 -1
  2. package/ai/README.md +1 -1
  3. package/ai/llms.txt +3 -3
  4. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  5. package/ai/skills/bridge-ui-setup/SKILL.md +9 -8
  6. package/dist/Actions/Snackbar/BridgeSnackbarItem.vue_vue_type_script_setup_true_lang.js +42 -44
  7. package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +1 -1
  8. package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
  9. package/dist/Adapters/Icon/mockIconAdapter.d.ts +5 -0
  10. package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
  11. package/dist/Adapters/index.d.ts +0 -1
  12. package/dist/Adapters/index.js +1 -2
  13. package/dist/Components/Accordion/composables/useAccordion.js +1 -1
  14. package/dist/Components/ActionFooter/ActionFooter.vue_vue_type_script_setup_true_lang.js +3 -5
  15. package/dist/Components/ActionFooter/actionFooter.types.d.ts +7 -12
  16. package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +4 -4
  17. package/dist/Components/ActionFooter/composables/useActionFooter.js +3 -4
  18. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +2 -2
  19. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -3
  20. package/dist/Components/Autocomplete/composables/useAutocomplete.js +250 -258
  21. package/dist/Components/BaseField/composables/useBaseField.js +1 -0
  22. package/dist/Components/Chart/Chart.js +5 -0
  23. package/dist/Components/Chart/Chart.vue.d.ts +14 -0
  24. package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +52 -0
  25. package/dist/Components/Chart/chart.types.d.ts +126 -0
  26. package/dist/Components/Chart/chartInjectionKey.d.ts +94 -0
  27. package/dist/Components/Chart/chartInjectionKey.js +10 -0
  28. package/dist/Components/Chart/composables/useChart.d.ts +40 -0
  29. package/dist/Components/Chart/composables/useChart.js +344 -0
  30. package/dist/Components/Chart/echartsChart.d.ts +14 -0
  31. package/dist/Components/Chart/echartsChart.js +199 -0
  32. package/dist/Components/Chart/index.d.ts +4 -0
  33. package/dist/Components/Chart/index.js +4 -0
  34. package/dist/Components/ChartAxis/ChartAxis.js +5 -0
  35. package/dist/Components/ChartAxis/ChartAxis.vue.d.ts +7 -0
  36. package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +30 -0
  37. package/dist/Components/ChartAxis/chartAxis.types.d.ts +56 -0
  38. package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +5 -0
  39. package/dist/Components/ChartAxis/composables/useChartAxis.js +28 -0
  40. package/dist/Components/ChartAxis/index.d.ts +3 -0
  41. package/dist/Components/ChartAxis/index.js +3 -0
  42. package/dist/Components/ChartLegend/ChartLegend.js +5 -0
  43. package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +6 -0
  44. package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -0
  45. package/dist/Components/ChartLegend/chartLegend.types.d.ts +71 -0
  46. package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +16 -0
  47. package/dist/Components/ChartLegend/composables/useChartLegend.js +98 -0
  48. package/dist/Components/ChartLegend/index.d.ts +3 -0
  49. package/dist/Components/ChartLegend/index.js +3 -0
  50. package/dist/Components/ChartSeries/ChartSeries.js +5 -0
  51. package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +4 -0
  52. package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +24 -0
  53. package/dist/Components/ChartSeries/chartSeries.types.d.ts +37 -0
  54. package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +10 -0
  55. package/dist/Components/ChartSeries/composables/useChartSeries.js +29 -0
  56. package/dist/Components/ChartSeries/index.d.ts +3 -0
  57. package/dist/Components/ChartSeries/index.js +3 -0
  58. package/dist/Components/ChartTooltip/ChartTooltip.js +5 -0
  59. package/dist/Components/ChartTooltip/ChartTooltip.vue.d.ts +11 -0
  60. package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +25 -0
  61. package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +82 -0
  62. package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +15 -0
  63. package/dist/Components/ChartTooltip/composables/useChartTooltip.js +110 -0
  64. package/dist/Components/ChartTooltip/index.d.ts +3 -0
  65. package/dist/Components/ChartTooltip/index.js +3 -0
  66. package/dist/Components/Checkbox/composables/useCheckbox.js +1 -0
  67. package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
  68. package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -0
  69. package/dist/Components/ColorField/composables/useColorField.d.ts +2 -2
  70. package/dist/Components/ColorField/composables/useColorField.js +2 -0
  71. package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +5 -1
  72. package/dist/Components/ColorPicker/colorPicker.types.d.ts +8 -2
  73. package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +2 -2
  74. package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -0
  75. package/dist/Components/DataTable/DataTableCellContent.vue.d.ts +1 -5
  76. package/dist/Components/DataTable/DataTableCellContent.vue_vue_type_script_setup_true_lang.js +24 -25
  77. package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
  78. package/dist/Components/DataTable/composables/useDataTable.js +76 -74
  79. package/dist/Components/DataTable/composables/useDataTablePagination.js +1 -1
  80. package/dist/Components/DateField/DateField.vue.d.ts +2 -2
  81. package/dist/Components/DateField/composables/useDateField.d.ts +2 -2
  82. package/dist/Components/DateField/composables/useDateField.js +2 -0
  83. package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +2 -0
  84. package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
  85. package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +2 -2
  86. package/dist/Components/DateRangeField/composables/useDateRangeField.js +2 -0
  87. package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
  88. package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
  89. package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +2 -2
  90. package/dist/Components/DateTimeField/composables/useDateTimeField.js +2 -0
  91. package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +2 -0
  92. package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
  93. package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +2 -2
  94. package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.js +2 -0
  95. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
  96. package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
  97. package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +3 -4
  98. package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
  99. package/dist/Components/FileUpload/FileUpload.vue.d.ts +2 -2
  100. package/dist/Components/FormControl/composables/useFormControl.js +46 -45
  101. package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
  102. package/dist/Components/FormField/composables/useFormField.js +144 -143
  103. package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
  104. package/dist/Components/Listbox/Listbox.vue.d.ts +0 -1
  105. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +3 -2
  106. package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +5 -3
  107. package/dist/Components/Modal/Modal.vue.d.ts +1 -1
  108. package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +3 -4
  109. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  110. package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
  111. package/dist/Components/NumberField/composables/useNumberField.js +1 -0
  112. package/dist/Components/OtpField/composables/useOtpField.js +1 -0
  113. package/dist/Components/Pagination/composables/usePagination.js +1 -1
  114. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
  115. package/dist/Components/PasswordField/composables/usePasswordField.js +1 -0
  116. package/dist/Components/Radio/composables/useRadio.js +1 -0
  117. package/dist/Components/Rating/composables/useRating.js +1 -0
  118. package/dist/Components/RichTextEditor/RichTextEditor.vue.d.ts +1 -1
  119. package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +30 -26
  120. package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +4 -3
  121. package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +131 -135
  122. package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +1 -1
  123. package/dist/Components/RichTextEditor/tiptapEditor.d.ts +111 -0
  124. package/dist/Components/RichTextEditor/tiptapEditor.js +121 -0
  125. package/dist/Components/Select/Select.vue.d.ts +2 -2
  126. package/dist/Components/Select/composables/useSelect.d.ts +3 -3
  127. package/dist/Components/Select/composables/useSelect.js +149 -157
  128. package/dist/Components/Slider/composables/useSlider.js +1 -0
  129. package/dist/Components/Snackbar/Snackbar.vue.d.ts +1 -1
  130. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +6 -7
  131. package/dist/Components/Stepper/composables/useStepper.js +1 -1
  132. package/dist/Components/Switch/composables/useSwitch.js +1 -0
  133. package/dist/Components/Table/composables/useTableCell.d.ts +1 -1
  134. package/dist/Components/Tabs/composables/useTabs.d.ts +0 -156
  135. package/dist/Components/Tabs/composables/useTabs.js +1 -1
  136. package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
  137. package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
  138. package/dist/Components/Textarea/composables/useTextarea.js +1 -0
  139. package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
  140. package/dist/Components/TimeField/composables/useTimeField.d.ts +2 -2
  141. package/dist/Components/TimeField/composables/useTimeField.js +2 -0
  142. package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +2 -0
  143. package/dist/Components/TimePicker/composables/useTimePicker.js +1 -0
  144. package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
  145. package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +2 -2
  146. package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +2 -0
  147. package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
  148. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +1 -0
  149. package/dist/Components/ToggleGroup/composables/useToggleGroup.js +3 -3
  150. package/dist/Components/Tooltip/Tooltip.vue.d.ts +0 -1
  151. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +7 -5
  152. package/dist/Utils/index.d.ts +16 -6
  153. package/dist/Utils/index.js +39 -35
  154. package/dist/augments.d.ts +20 -2
  155. package/dist/index.d.ts +0 -3
  156. package/dist/index.js +180 -183
  157. package/dist/theme.css +10 -1
  158. package/docs/README.md +27 -13
  159. package/docs/components/ActionFooter.md +16 -14
  160. package/docs/components/BridgeUIProvider.md +95 -20
  161. package/docs/components/Chart.md +252 -0
  162. package/docs/components/ColorPicker.md +14 -13
  163. package/docs/components/I18n.md +6 -6
  164. package/docs/components/Icon.md +10 -10
  165. package/docs/components/RichTextEditor.md +2 -23
  166. package/package.json +8 -76
  167. package/dist/Adapters/Examples/date-date-fns.d.ts +0 -9
  168. package/dist/Adapters/Examples/date-date-fns.js +0 -151
  169. package/dist/Adapters/Examples/date-dayjs.d.ts +0 -19
  170. package/dist/Adapters/Examples/date-dayjs.js +0 -174
  171. package/dist/Adapters/Examples/date-luxon.d.ts +0 -7
  172. package/dist/Adapters/Examples/date-luxon.js +0 -164
  173. package/dist/Adapters/Examples/date-moment.d.ts +0 -19
  174. package/dist/Adapters/Examples/date-moment.js +0 -172
  175. package/dist/Adapters/Examples/i18n-dictionary.d.ts +0 -15
  176. package/dist/Adapters/Examples/i18n-dictionary.js +0 -97
  177. package/dist/Adapters/Examples/i18n-vue-i18n.d.ts +0 -7
  178. package/dist/Adapters/Examples/i18n-vue-i18n.js +0 -14
  179. package/dist/Adapters/Examples/icon-fontawesome.d.ts +0 -19
  180. package/dist/Adapters/Examples/icon-fontawesome.js +0 -82
  181. package/dist/Adapters/Examples/icon-heroicons.d.ts +0 -5
  182. package/dist/Adapters/Examples/icon-heroicons.js +0 -56
  183. package/dist/Adapters/Examples/icon-lucide.d.ts +0 -5
  184. package/dist/Adapters/Examples/icon-lucide.js +0 -56
  185. package/dist/Adapters/Examples/icon-phosphor.d.ts +0 -5
  186. package/dist/Adapters/Examples/icon-phosphor.js +0 -56
  187. package/dist/Adapters/Examples/icon-tabler.d.ts +0 -5
  188. package/dist/Adapters/Examples/icon-tabler.js +0 -56
  189. package/dist/Adapters/Examples/rich-text-tiptap.d.ts +0 -5
  190. package/dist/Adapters/Examples/rich-text-tiptap.js +0 -131
  191. package/dist/Adapters/RichText/index.d.ts +0 -1
  192. package/dist/Adapters/RichText/index.js +0 -2
  193. package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +0 -5
  194. package/dist/Adapters/RichText/useRichTextAdapter.d.ts +0 -12
  195. package/dist/Adapters/RichText/useRichTextAdapter.js +0 -13
@@ -1,14 +1,14 @@
1
1
  import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
- import { useRichTextAdapter as t } from "../../../Adapters/RichText/useRichTextAdapter.js";
3
- import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as ee } from "../../../Utils/index.js";
2
+ import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
4
3
  import { formFieldBridgeKeys as i, useFormField as a } from "../../FormField/composables/useFormField.js";
5
- import { computed as o, onBeforeUnmount as s, ref as c, useAttrs as l, useSlots as u, watch as d } from "vue";
6
- import { DEFAULT_RICH_TEXT_TOOLS as f, RICH_TEXT_TOOL_ICONS as te, RICH_TEXT_TOOL_LABELS as p, richTextValuesEqual as ne } from "@bridge-ui/core/Adapters";
7
- import { get as m, isNil as h, omit as g } from "es-toolkit/compat";
4
+ import { mountTiptapEditor as ee } from "../tiptapEditor.js";
5
+ import { computed as o, onBeforeUnmount as s, ref as c, useAttrs as l, useSlots as te, watch as u } from "vue";
6
+ import { get as d, isNil as f, omit as ne } from "es-toolkit/compat";
7
+ import { DEFAULT_RICH_TEXT_TOOLS as p, RICH_TEXT_TOOL_ICONS as m, RICH_TEXT_TOOL_LABELS as h, richTextValuesEqual as g } from "@bridge-ui/core/Domain";
8
8
  import { richTextEditorSizeProps as _ } from "@bridge-ui/core/Tokens";
9
- import { cn as v, mergeBridgeUILayeredClasses as re, splitComponentProps as y } from "@bridge-ui/core/Utils";
9
+ import { cn as v, mergeBridgeUILayeredClasses as y, splitComponentProps as b } from "@bridge-ui/core/Utils";
10
10
  //#region src/Components/RichTextEditor/composables/useRichTextEditor.ts
11
- var b = [
11
+ var re = [
12
12
  "tools",
13
13
  "format",
14
14
  "classes",
@@ -17,30 +17,31 @@ var b = [
17
17
  "placeholder",
18
18
  "defaultValue"
19
19
  ];
20
- function x(x, S, C, w) {
21
- let T = l(), E = u(), D = e(), O = t(), k = c(""), A = c(0), j = c(null), M = c(null), N = c(null), P = o(() => y({
22
- bridgeKeys: b,
20
+ function x(x, S, ie, C) {
21
+ let w = l(), T = te(), E = e(), D = c(""), O = c(0), k = c(null), A = c(null), j = c(null), M = o(() => b({
22
+ bridgeKeys: re,
23
23
  props: {
24
24
  ...x,
25
- ...T
25
+ ...w
26
26
  }
27
- })), F = o(() => P.value.componentProps), I = o(() => y({
27
+ })), N = o(() => M.value.componentProps), P = o(() => b({
28
28
  bridgeKeys: i,
29
- props: g(P.value.inheritedAttrs, ["class", "onUpdate:modelValue"])
30
- })), L = o(() => I.value.componentProps), R = o(() => I.value.inheritedAttrs), z = o(() => {
31
- let { content: e, toolbar: t, toolbarButton: n, ...r } = F.value.customProps ?? {};
29
+ props: ne(M.value.inheritedAttrs, ["class", "onUpdate:modelValue"])
30
+ })), F = o(() => P.value.componentProps), I = o(() => P.value.inheritedAttrs), L = o(() => {
31
+ let { content: e, toolbar: t, toolbarButton: n, ...r } = N.value.customProps ?? {};
32
32
  return r;
33
- }), B = o(() => F.value.customProps?.toolbarButton), V = o(() => ({
34
- tools: F.value.tools,
35
- format: F.value.format,
36
- classes: F.value.classes,
37
- size: L.value.size,
38
- color: L.value.color,
39
- rounded: L.value.rounded,
40
- variant: L.value.variant
41
- })), { merged: H, entry: U } = r({
33
+ }), R = o(() => N.value.customProps?.toolbarButton), z = o(() => ({
34
+ tools: N.value.tools,
35
+ format: N.value.format,
36
+ classes: N.value.classes,
37
+ size: F.value.size,
38
+ color: F.value.color,
39
+ rounded: F.value.rounded,
40
+ variant: F.value.variant
41
+ })), { merged: B, entry: V } = n({
42
+ chrome: "FormField",
42
43
  componentName: "RichTextEditor",
43
- props: () => V.value,
44
+ props: () => z.value,
44
45
  libDefaults: {
45
46
  size: "md",
46
47
  rounded: "md",
@@ -48,18 +49,18 @@ function x(x, S, C, w) {
48
49
  color: "primary",
49
50
  variant: "outline"
50
51
  }
51
- }), W = ee({
52
- entry: U,
53
- props: () => V.value
54
- }), G = o(() => H.value.format ?? "html"), K = o(() => [...F.value.tools ?? H.value.tools ?? f]), q = o(() => F.value.readOnly === !0 || L.value.readonly === !0), J = o(() => !(q.value || L.value.disabled === !0) && K.value.length > 0), Y = o(() => {
55
- let e = re(_, U.value?.tokens?.size);
56
- return m(e, L.value.size ?? H.value.size ?? "md");
57
- }), X = a(() => ({
58
- ...R.value,
59
- ...L.value,
60
- classes: W.value,
61
- customProps: z.value,
62
- readonly: q.value || L.value.readonly
52
+ }), H = r({
53
+ entry: V,
54
+ props: () => z.value
55
+ }), U = o(() => B.value.format ?? "html"), W = o(() => [...N.value.tools ?? B.value.tools ?? p]), G = o(() => N.value.readOnly === !0 || F.value.readonly === !0), K = o(() => !(G.value || F.value.disabled === !0) && W.value.length > 0), q = o(() => {
56
+ let e = y(_, V.value?.tokens?.size);
57
+ return d(e, F.value.size ?? B.value.size ?? "md");
58
+ }), J = a(() => ({
59
+ ...I.value,
60
+ ...F.value,
61
+ classes: H.value,
62
+ customProps: L.value,
63
+ readonly: G.value || F.value.readonly
63
64
  }), {
64
65
  size: "md",
65
66
  rounded: "md",
@@ -69,156 +70,151 @@ function x(x, S, C, w) {
69
70
  }, {
70
71
  control: () => "textarea",
71
72
  componentName: "RichTextEditor"
72
- }), ie = o(() => X.invalidated.value ? "error" : X.merged.value.color ?? "primary");
73
- function ae(e) {
74
- return !!(X.isDisabled.value || q.value || !(N.value?.can(e) ?? !0));
73
+ }), Y = o(() => J.merged.value.color ?? "primary"), ae = o(() => J.invalidated.value ? "error" : Y.value);
74
+ function oe(e) {
75
+ return !!(J.isDisabled.value || G.value || !(j.value?.can(e) ?? !0));
75
76
  }
76
- function Z() {
77
- A.value += 1;
77
+ function X() {
78
+ O.value += 1;
78
79
  }
79
- function Q() {
80
- k.value = "", M.value = null;
80
+ function Z() {
81
+ D.value = "", A.value = null;
81
82
  }
82
- function oe() {
83
- let e = k.value.trim();
84
- e.length !== 0 && (N.value?.run("link", { href: e }), Z(), Q());
83
+ function se() {
84
+ let e = D.value.trim();
85
+ e.length !== 0 && (j.value?.run("link", { href: e }), X(), Z());
85
86
  }
86
- function se(e, t) {
87
- let n = N.value;
88
- if (!h(n)) {
87
+ function Q(e, t) {
88
+ let n = j.value;
89
+ if (!f(n)) {
89
90
  if (e === "link") {
90
91
  if (n.isActive("link")) {
91
- n.run("link"), Z(), Q();
92
+ n.run("link"), X(), Z();
92
93
  return;
93
94
  }
94
95
  let e = t.currentTarget;
95
- e instanceof HTMLElement && (k.value = "", M.value = e);
96
+ e instanceof HTMLElement && (D.value = "", A.value = e);
96
97
  return;
97
98
  }
98
- n.run(e), Z();
99
+ n.run(e), X();
99
100
  }
100
101
  }
101
102
  let ce = o({
102
103
  get() {
103
- return !h(M.value);
104
+ return !f(A.value);
104
105
  },
105
106
  set(e) {
106
- e || Q();
107
+ e || Z();
107
108
  }
108
- }), le = o(() => k.value.trim().length > 0), ue = o(() => D("URL"));
109
- d(J, (e) => {
110
- e || Q();
109
+ }), le = o(() => D.value.trim().length > 0), ue = o(() => E("URL"));
110
+ u(K, (e) => {
111
+ e || Z();
111
112
  });
112
113
  function $() {
113
- N.value?.destroy(), N.value = null;
114
- let e = j.value;
115
- h(e) || (e.remove(), j.value = null);
114
+ j.value?.destroy(), j.value = null;
115
+ let e = k.value;
116
+ f(e) || (e.remove(), k.value = null);
116
117
  }
117
118
  function de() {
118
119
  $();
119
- let e = w.value, t = O.value;
120
- if (h(e)) return;
121
- if (h(t)) throw Error("[BridgeUI] RichTextEditor requires BridgeUIProvider global.richText. See packages/{react,vue}/Adapters/Examples/rich-text-tiptap.");
122
- let n = document.createElement("div");
123
- n.className = "flex min-h-0 min-w-0 w-full flex-1 flex-col outline-none", e.appendChild(n), j.value = n, N.value = t.mount({
124
- element: n,
125
- tools: K.value,
120
+ let e = C.value;
121
+ if (f(e)) return;
122
+ let t = document.createElement("div");
123
+ t.className = "flex min-h-0 min-w-0 w-full flex-1 flex-col outline-none", e.appendChild(t), k.value = t, j.value = ee({
124
+ element: t,
126
125
  value: S.value,
127
- format: G.value,
128
- readOnly: q.value,
129
- id: X.controlId.value,
130
- ariaReadonly: q.value,
131
- onSelectionChange: Z,
132
- disabled: X.isDisabled.value,
133
- placeholder: F.value.placeholder,
134
- ariaDisabled: X.isDisabled.value,
135
- ariaInvalid: X.invalidated.value,
136
- ariaDescribedBy: X.ariaDescribedBy.value,
126
+ format: U.value,
127
+ readOnly: G.value,
128
+ id: J.controlId.value,
129
+ ariaReadonly: G.value,
130
+ onSelectionChange: X,
131
+ disabled: J.isDisabled.value,
132
+ placeholder: N.value.placeholder,
133
+ ariaDisabled: J.isDisabled.value,
134
+ ariaInvalid: J.invalidated.value,
135
+ ariaDescribedBy: J.ariaDescribedBy.value,
137
136
  onChange: (e) => {
138
- S.value = e, C("update:modelValue", e);
137
+ S.value = e;
139
138
  }
140
139
  });
141
140
  }
142
- d([
143
- G,
144
- O,
145
- w
146
- ], () => {
141
+ u([U, C], () => {
147
142
  de();
148
- }, { flush: "post" }), d(() => S.value, (e) => {
149
- let t = N.value;
150
- h(t) || e === void 0 || ne(t.getValue(), e) || t.setValue(e);
151
- }), d(() => X.isDisabled.value, (e) => {
152
- N.value?.setDisabled(e);
153
- }), d(q, (e) => {
154
- N.value?.setReadOnly(e);
155
- }), d([
156
- q,
157
- () => F.value.placeholder,
158
- () => X.controlId.value,
159
- () => X.isDisabled.value,
160
- () => X.invalidated.value,
161
- () => X.ariaDescribedBy.value
143
+ }, { flush: "post" }), u(() => S.value, (e) => {
144
+ let t = j.value;
145
+ f(t) || e === void 0 || g(t.getValue(), e) || t.setValue(e);
146
+ }), u(() => J.isDisabled.value, (e) => {
147
+ j.value?.setDisabled(e);
148
+ }), u(G, (e) => {
149
+ j.value?.setReadOnly(e);
150
+ }), u([
151
+ G,
152
+ () => N.value.placeholder,
153
+ () => J.controlId.value,
154
+ () => J.isDisabled.value,
155
+ () => J.invalidated.value,
156
+ () => J.ariaDescribedBy.value
162
157
  ], () => {
163
- N.value?.setA11y({
164
- id: X.controlId.value,
165
- ariaReadonly: q.value,
166
- placeholder: F.value.placeholder,
167
- ariaDisabled: X.isDisabled.value,
168
- ariaInvalid: X.invalidated.value,
169
- ariaDescribedBy: X.ariaDescribedBy.value
158
+ j.value?.setA11y({
159
+ id: J.controlId.value,
160
+ ariaReadonly: G.value,
161
+ placeholder: N.value.placeholder,
162
+ ariaDisabled: J.isDisabled.value,
163
+ ariaInvalid: J.invalidated.value,
164
+ ariaDescribedBy: J.ariaDescribedBy.value
170
165
  });
171
166
  }), s(() => {
172
167
  $();
173
168
  });
174
- let fe = o(() => n(F.value.customProps?.toolbar, {
169
+ let fe = o(() => t(N.value.customProps?.toolbar, {
175
170
  role: "toolbar",
176
- "aria-label": D("Formatting")
171
+ "aria-label": E("Formatting")
177
172
  }, v({
178
- [Y.value?.toolbar ?? ""]: !0,
179
- [W.value.toolbar ?? ""]: !0
180
- }))), pe = o(() => n(F.value.customProps?.content, {}, v({
173
+ [q.value?.toolbar ?? ""]: !0,
174
+ [H.value.toolbar ?? ""]: !0
175
+ }))), pe = o(() => t(N.value.customProps?.content, {}, v({
181
176
  "min-w-0 flex-1": !0,
182
- [Y.value?.content ?? ""]: !0,
183
- [W.value.content ?? ""]: !0,
184
- [W.value.input ?? ""]: !0
177
+ [q.value?.content ?? ""]: !0,
178
+ [H.value.content ?? ""]: !0,
179
+ [H.value.input ?? ""]: !0
185
180
  })));
186
181
  function me(e) {
187
- A.value;
188
- let t = N.value, r = D(p[e]);
189
- return n(B.value, {
182
+ O.value;
183
+ let n = j.value, r = E(h[e]);
184
+ return t(R.value, {
190
185
  type: "button",
191
186
  density: "mini",
192
187
  variant: "flat",
193
188
  "aria-label": r,
194
- color: ie.value,
195
- icon: te[e],
196
- disabled: ae(e),
197
- size: X.merged.value.size ?? "md",
198
- selected: t?.isActive(e) ?? !1,
199
- rounded: X.merged.value.rounded ?? "md"
189
+ color: ae.value,
190
+ icon: m[e],
191
+ disabled: oe(e),
192
+ size: J.merged.value.size ?? "md",
193
+ selected: n?.isActive(e) ?? !1,
194
+ rounded: J.merged.value.rounded ?? "md"
200
195
  }, v({
201
- [Y.value?.toolbarButton ?? ""]: !0,
202
- [W.value.toolbarButton ?? ""]: !0
196
+ [q.value?.toolbarButton ?? ""]: !0,
197
+ [H.value.toolbarButton ?? ""]: !0
203
198
  }));
204
199
  }
205
200
  return {
206
- slots: E,
207
- tools: K,
208
- format: G,
209
- linkHref: k,
201
+ color: Y,
202
+ slots: T,
203
+ tools: W,
204
+ format: U,
205
+ linkHref: D,
210
206
  linkOpen: ce,
211
- formField: X,
212
- linkAnchor: M,
213
- isReadOnly: q,
207
+ formField: J,
208
+ linkAnchor: A,
209
+ isReadOnly: G,
214
210
  contentBind: pe,
215
- confirmLink: oe,
216
- onToolClick: se,
211
+ confirmLink: se,
212
+ onToolClick: Q,
217
213
  toolbarBind: fe,
218
- showToolbar: J,
214
+ showToolbar: K,
219
215
  linkUrlLabel: ue,
220
216
  canConfirmLink: le,
221
- closeLinkEditor: Q,
217
+ closeLinkEditor: Z,
222
218
  getToolbarButtonBind: me
223
219
  };
224
220
  }
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes, Slot } from 'vue';
2
- import { RichTextFormat, RichTextTool, RichTextValue } from '@bridge-ui/core/Adapters';
2
+ import { RichTextFormat, RichTextTool, RichTextValue } from '@bridge-ui/core/Domain';
3
3
  import { MergeHtmlProps } from '@bridge-ui/core/Utils';
4
4
  import { ButtonOwnProps } from '../Button/button.types';
5
5
  import { FormFieldClasses, FormFieldCustomProps, FormFieldOwnProps, FormFieldSlots } from '../FormField/formField.types';
@@ -0,0 +1,111 @@
1
+ import { RichTextA11yOptions, RichTextFormat, RichTextTool, RichTextToolPayload, RichTextValue } from '@bridge-ui/core/Domain';
2
+ /**
3
+ * Options for {@link mountTiptapEditor}.
4
+ */
5
+ export type TiptapMountOptions = {
6
+ /**
7
+ * `aria-describedby` on the editable root.
8
+ */
9
+ ariaDescribedBy?: string;
10
+ /**
11
+ * `aria-disabled` on the editable root.
12
+ */
13
+ ariaDisabled?: boolean;
14
+ /**
15
+ * `aria-invalid` on the editable root.
16
+ */
17
+ ariaInvalid?: boolean;
18
+ /**
19
+ * `aria-readonly` on the editable root.
20
+ */
21
+ ariaReadonly?: boolean;
22
+ /**
23
+ * Disable editing and command execution.
24
+ */
25
+ disabled?: boolean;
26
+ /**
27
+ * Host element the editor mounts into.
28
+ */
29
+ element: HTMLElement;
30
+ /**
31
+ * Document format for `value` / `onChange` / handle get/set.
32
+ */
33
+ format: RichTextFormat;
34
+ /**
35
+ * Optional `id` applied to the editable root (for FormField label association).
36
+ */
37
+ id?: string;
38
+ /**
39
+ * Called whenever the document changes.
40
+ */
41
+ onChange: (value: RichTextValue) => void;
42
+ /**
43
+ * Called when the selection changes (toolbar active state).
44
+ */
45
+ onSelectionChange?: () => void;
46
+ /**
47
+ * Empty-state hint in the content area.
48
+ */
49
+ placeholder?: string;
50
+ /**
51
+ * View-only surface; commands should no-op.
52
+ */
53
+ readOnly?: boolean;
54
+ /**
55
+ * Initial document for the mount `format`.
56
+ */
57
+ value?: RichTextValue;
58
+ };
59
+ /**
60
+ * Per-editor handle returned by {@link mountTiptapEditor}.
61
+ */
62
+ export type TiptapEditorHandle = {
63
+ /**
64
+ * Blurs the editable surface when supported.
65
+ */
66
+ blur: () => void;
67
+ /**
68
+ * Whether `tool` can run in the current selection / state.
69
+ */
70
+ can: (tool: RichTextTool) => boolean;
71
+ /**
72
+ * Tears down the editor instance.
73
+ */
74
+ destroy: () => void;
75
+ /**
76
+ * Focuses the editable surface.
77
+ */
78
+ focus: () => void;
79
+ /**
80
+ * Returns the current document in the mount `format`.
81
+ */
82
+ getValue: () => RichTextValue;
83
+ /**
84
+ * Whether `tool` is active in the current selection.
85
+ */
86
+ isActive: (tool: RichTextTool) => boolean;
87
+ /**
88
+ * Runs a toolbar command (toggle mark, set link, …).
89
+ */
90
+ run: (tool: RichTextTool, payload?: RichTextToolPayload) => void;
91
+ /**
92
+ * Updates a11y attributes and the empty-state placeholder after mount.
93
+ */
94
+ setA11y: (options: RichTextA11yOptions) => void;
95
+ /**
96
+ * Updates the disabled flag after mount.
97
+ */
98
+ setDisabled: (disabled: boolean) => void;
99
+ /**
100
+ * Updates the read-only flag after mount.
101
+ */
102
+ setReadOnly: (readOnly: boolean) => void;
103
+ /**
104
+ * Replaces the document. Must match the mount `format`.
105
+ */
106
+ setValue: (value: RichTextValue) => void;
107
+ };
108
+ /**
109
+ * Mounts a TipTap editor into `options.element` and returns a handle.
110
+ */
111
+ export declare function mountTiptapEditor(options: TiptapMountOptions): TiptapEditorHandle;
@@ -0,0 +1,121 @@
1
+ import { get as e, isNil as t, isString as n } from "es-toolkit/compat";
2
+ import { applyRichTextEditableA11y as r } from "@bridge-ui/core/Domain";
3
+ import { Editor as i } from "@tiptap/core";
4
+ import a from "@tiptap/extension-placeholder";
5
+ import o from "@tiptap/starter-kit";
6
+ //#region src/Components/RichTextEditor/tiptapEditor.ts
7
+ var s = "bridge-rich-text-editable";
8
+ function c(e, t) {
9
+ return t === "json" ? e.getJSON() : e.getHTML();
10
+ }
11
+ function l(e, n) {
12
+ let r = e.extensionManager.extensions.find((e) => e.name === "placeholder");
13
+ t(r) || r.options.placeholder === n || (r.options.placeholder = n, e.view.dispatch(e.state.tr));
14
+ }
15
+ var u = {
16
+ bold: (e) => e.isActive("bold"),
17
+ link: (e) => e.isActive("link"),
18
+ italic: (e) => e.isActive("italic"),
19
+ strike: (e) => e.isActive("strike"),
20
+ codeBlock: (e) => e.isActive("codeBlock"),
21
+ underline: (e) => e.isActive("underline"),
22
+ blockquote: (e) => e.isActive("blockquote"),
23
+ bulletList: (e) => e.isActive("bulletList"),
24
+ orderedList: (e) => e.isActive("orderedList"),
25
+ heading1: (e) => e.isActive("heading", { level: 1 }),
26
+ heading2: (e) => e.isActive("heading", { level: 2 }),
27
+ heading3: (e) => e.isActive("heading", { level: 3 })
28
+ }, d = {
29
+ link: () => !0,
30
+ bold: (e) => e.can().toggleBold(),
31
+ italic: (e) => e.can().toggleItalic(),
32
+ strike: (e) => e.can().toggleStrike(),
33
+ codeBlock: (e) => e.can().toggleCodeBlock(),
34
+ underline: (e) => e.can().toggleUnderline(),
35
+ blockquote: (e) => e.can().toggleBlockquote(),
36
+ bulletList: (e) => e.can().toggleBulletList(),
37
+ orderedList: (e) => e.can().toggleOrderedList(),
38
+ heading1: (e) => e.can().toggleHeading({ level: 1 }),
39
+ heading2: (e) => e.can().toggleHeading({ level: 2 }),
40
+ heading3: (e) => e.can().toggleHeading({ level: 3 })
41
+ }, f = {
42
+ bold: (e) => e.chain().focus().toggleBold().run(),
43
+ italic: (e) => e.chain().focus().toggleItalic().run(),
44
+ strike: (e) => e.chain().focus().toggleStrike().run(),
45
+ codeBlock: (e) => e.chain().focus().toggleCodeBlock().run(),
46
+ underline: (e) => e.chain().focus().toggleUnderline().run(),
47
+ blockquote: (e) => e.chain().focus().toggleBlockquote().run(),
48
+ bulletList: (e) => e.chain().focus().toggleBulletList().run(),
49
+ orderedList: (e) => e.chain().focus().toggleOrderedList().run(),
50
+ heading1: (e) => e.chain().focus().toggleHeading({ level: 1 }).run(),
51
+ heading2: (e) => e.chain().focus().toggleHeading({ level: 2 }).run(),
52
+ heading3: (e) => e.chain().focus().toggleHeading({ level: 3 }).run(),
53
+ link: (e, n) => {
54
+ if (!t(n?.href) && n.href.length > 0) {
55
+ e.chain().focus().extendMarkRange("link").setLink({ href: n.href }).run();
56
+ return;
57
+ }
58
+ e.isActive("link") && e.chain().focus().unsetLink().run();
59
+ }
60
+ };
61
+ function p(t, n) {
62
+ return e(u, n, () => !1)(t);
63
+ }
64
+ function m(t, n) {
65
+ return e(d, n, () => !1)(t);
66
+ }
67
+ function h(t, n, r) {
68
+ e(f, n, () => void 0)(t, r);
69
+ }
70
+ function g(e) {
71
+ let t = e.disabled === !0, u = e.readOnly === !0, d = !1, f = new i({
72
+ autofocus: !1,
73
+ element: e.element,
74
+ editable: !t && !u,
75
+ onSelectionUpdate: () => {
76
+ e.onSelectionChange?.();
77
+ },
78
+ editorProps: { attributes: { class: s } },
79
+ onUpdate: ({ editor: t }) => {
80
+ e.onChange(c(t, e.format));
81
+ },
82
+ content: e.value ?? (e.format === "json" ? {
83
+ type: "doc",
84
+ content: []
85
+ } : ""),
86
+ extensions: [o.configure({ link: { openOnClick: !1 } }), a.configure({ placeholder: e.placeholder ?? "" })]
87
+ });
88
+ return r(f.view.dom, e), {
89
+ getValue: () => c(f, e.format),
90
+ blur: () => {
91
+ d || f.commands.blur();
92
+ },
93
+ focus: () => {
94
+ d || f.commands.focus();
95
+ },
96
+ isActive: (e) => !d && p(f, e),
97
+ destroy: () => {
98
+ d || (d = !0, f.destroy());
99
+ },
100
+ can: (e) => d || t || u ? !1 : m(f, e),
101
+ setDisabled: (e) => {
102
+ d || (t = e, f.setEditable(!t && !u, !1));
103
+ },
104
+ setReadOnly: (e) => {
105
+ d || (u = e, f.setEditable(!t && !u, !1));
106
+ },
107
+ run: (e, n) => {
108
+ d || t || u || h(f, e, n);
109
+ },
110
+ setA11y: (e) => {
111
+ d || (r(f.view.dom, e), l(f, e.placeholder ?? ""));
112
+ },
113
+ setValue: (t) => {
114
+ if (d) return;
115
+ let r = e.format === "html" ? n(t) ? t : "" : t;
116
+ f.commands.setContent(r, { emitUpdate: !1 });
117
+ }
118
+ };
119
+ }
120
+ //#endregion
121
+ export { g as mountTiptapEditor };
@@ -11,8 +11,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
11
11
  apply: () => any;
12
12
  cancel: () => any;
13
13
  select: (option: import('@bridge-ui/core/Domain').ListboxOption) => any;
14
- close: () => any;
15
14
  change: (value: import('@bridge-ui/core/Domain').SelectModel) => any;
15
+ close: () => any;
16
16
  deselect: (option: import('@bridge-ui/core/Domain').ListboxOption) => any;
17
17
  open: () => any;
18
18
  "update:modelValue": (...args: unknown[]) => any;
@@ -22,8 +22,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
22
22
  onApply?: (() => any) | undefined;
23
23
  onCancel?: (() => any) | undefined;
24
24
  onSelect?: ((option: import('@bridge-ui/core/Domain').ListboxOption) => any) | undefined;
25
- onClose?: (() => any) | undefined;
26
25
  onChange?: ((value: import('@bridge-ui/core/Domain').SelectModel) => any) | undefined;
26
+ onClose?: (() => any) | undefined;
27
27
  onDeselect?: ((option: import('@bridge-ui/core/Domain').ListboxOption) => any) | undefined;
28
28
  onOpen?: (() => any) | undefined;
29
29
  "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
@@ -437,7 +437,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
437
437
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
438
438
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
439
439
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
440
- }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "disabled" | "endIcon" | "rounded" | "startIcon" | "variant" | "label" | "start" | "corner" | "required" | "description" | "errorMessage" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon">>>>;
440
+ }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "disabled" | "endIcon" | "rounded" | "startIcon" | "variant" | "label" | "start" | "required" | "corner" | "description" | "errorMessage" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon">>>>;
441
441
  isNotched: import('vue').ComputedRef<boolean>;
442
442
  isStacked: import('vue').ComputedRef<boolean>;
443
443
  startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -723,7 +723,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
723
723
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
724
724
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
725
725
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
726
- }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "disabled" | "endIcon" | "rounded" | "startIcon" | "variant" | "label" | "start" | "corner" | "required" | "description" | "errorMessage" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon">>>>>;
726
+ }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "disabled" | "endIcon" | "rounded" | "startIcon" | "variant" | "label" | "start" | "required" | "corner" | "description" | "errorMessage" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon">>>>>;
727
727
  handleApply: () => void;
728
728
  selectOption: (option: SelectOption) => void;
729
729
  handleCancel: () => void;
@@ -731,7 +731,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
731
731
  listboxProps: import('vue').ComputedRef<{
732
732
  anchorEl?: null | HTMLElement;
733
733
  classes?: import('../../Listbox').ListboxClasses;
734
- color: "info" | "error" | "success" | "warning" | "black" | "dark" | "primary" | "secondary";
734
+ color: "info" | "error" | "success" | "warning" | "dark" | "black" | "primary" | "secondary";
735
735
  customProps?: import('../../Listbox').ListboxCustomProps;
736
736
  disableAutoFocus: boolean;
737
737
  disableMaxHeight: boolean;