@feedmepos/mf-brand-app-builder 0.5.22-dev.1 → 0.5.24-dev.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 (100) hide show
  1. package/dist/{App-D5eO5srB.js → App-CoIlf_Tr.js} +5 -5
  2. package/dist/{AssetsSettings-D_E8q7eK.js → AssetsSettings-DhprCc4v.js} +6 -6
  3. package/dist/{BaDivider-DWZv3fqi.js → BaDivider-Cp9gfB4r.js} +2 -2
  4. package/dist/{BrandkitView-BlJhBYi6.js → BrandkitView-BHBErfbu.js} +3382 -2867
  5. package/dist/{BuilderView-Dfl1VhES.js → BuilderView-DY_Clqms.js} +427 -444
  6. package/dist/{ButtonGroup-D_HkX122.js → ButtonGroup-2ilMTPHH.js} +2 -2
  7. package/dist/{CircularProgress-h90pbjU3.js → CircularProgress-DdblYCtV.js} +4 -4
  8. package/dist/ColorPicker-RKWzhLBO.js +543 -0
  9. package/dist/{ColorPicker-I6CkNIxt.js → ColorPicker-dVFIiu94.js} +14 -14
  10. package/dist/{Icon.vue_vue_type_style_index_0_lang-CVCHCcWR.js → Icon.vue_vue_type_style_index_0_lang-BcRjQndc.js} +2 -2
  11. package/dist/{ImageUpload-FyvXrDKK.js → ImageUpload-B8OINKSx.js} +9 -9
  12. package/dist/{LinkButton-C9OU3Rcs.js → LinkButton-De-YNclu.js} +4 -4
  13. package/dist/{ListRepeater-BnVoFhhm.js → ListRepeater-rkz-trRq.js} +2 -2
  14. package/dist/{ManagementSettings-CtvF5d9C.js → ManagementSettings-Cz4HkNm1.js} +4 -4
  15. package/dist/ProjectView-ByxaVBFb.js +428 -0
  16. package/dist/{Select-BRYuMWoQ.js → Select-DQx6OfZx.js} +9 -9
  17. package/dist/{SettingsView-DHA7hXUx.js → SettingsView-uft0uKio.js} +2 -2
  18. package/dist/{StepperField-BeeZ_sl9.js → StepperField-nyaUK9ht.js} +2 -2
  19. package/dist/{Switch-8mmNQUDo.js → Switch-uc_zN-mb.js} +2 -2
  20. package/dist/{TextAlign-BOC8ekaH.js → TextAlign-BSp1Xi7F.js} +2 -2
  21. package/dist/{TextDecorators-BJC4umDR.js → TextDecorators-1C54q7us.js} +4 -4
  22. package/dist/{TextField-BiVH5rLX.js → TextField-DfBJB6vQ.js} +2 -2
  23. package/dist/{TextStyleList-CuPE80Py.js → TextStyleList-Bef3irUx.js} +3 -3
  24. package/dist/{app-CJ2VgCHp.js → app-pY4HD-TA.js} +6693 -3895
  25. package/dist/app.js +1 -1
  26. package/dist/brand-core/src/brandkit.d.ts +5 -0
  27. package/dist/brand-core/src/entity.d.ts +32 -15
  28. package/dist/client/components/src/components/BranchList.vue.d.ts +1 -1
  29. package/dist/client/components/src/components/ButtonList.vue.d.ts +1 -1
  30. package/dist/client/components/src/components/CountrySwitcher.vue.d.ts +1 -1
  31. package/dist/client/components/src/components/Homepage.vue.d.ts +3 -3
  32. package/dist/client/components/src/components/ImageCarousel.vue.d.ts +1 -1
  33. package/dist/client/components/src/components/ImageDisplay.vue.d.ts +1 -1
  34. package/dist/client/components/src/components/Member/TransactionList.vue.d.ts +1 -1
  35. package/dist/client/components/src/components/MemberCard.vue.d.ts +1 -1
  36. package/dist/client/components/src/components/NavigationBar.vue.d.ts +4 -4
  37. package/dist/client/components/src/components/OrderHistoryCard.vue.d.ts +4 -3
  38. package/dist/client/components/src/components/OrderMethod.vue.d.ts +1 -1
  39. package/dist/client/components/src/components/TextDisplay.vue.d.ts +1 -1
  40. package/dist/client/components/src/components/atoms/Button.vue.d.ts +4 -4
  41. package/dist/client/components/src/components/atoms/CircularProgress.vue.d.ts +2 -2
  42. package/dist/client/components/src/components/atoms/Container.vue.d.ts +3 -3
  43. package/dist/client/components/src/components/atoms/Divider.vue.d.ts +1 -1
  44. package/dist/client/components/src/components/atoms/Icon.vue.d.ts +1 -1
  45. package/dist/client/components/src/components/atoms/LinkSlot.vue.d.ts +4 -4
  46. package/dist/client/components/src/views/OrderDetails.vue.d.ts +1 -1
  47. package/dist/client/components/src/views/_Credit.vue.d.ts +1 -1
  48. package/dist/client/components/src/views/_MemberProfile.vue.d.ts +4 -4
  49. package/dist/client/components/src/views/_Point.vue.d.ts +1 -1
  50. package/dist/client/components/src/views/_Referral.vue.d.ts +4 -4
  51. package/dist/client/components/src/views/_ReferralTutorial.vue.d.ts +4 -4
  52. package/dist/client/merchant/src/api/business/index.d.ts +41 -1
  53. package/dist/client/merchant/src/app.d.ts +2794 -0
  54. package/dist/client/merchant/src/components/atoms/BaButtonGroup.vue.d.ts +1 -1
  55. package/dist/client/merchant/src/components/atoms/BaDivider.vue.d.ts +1 -1
  56. package/dist/client/merchant/src/components/brandkit/ColorOverrideDialog.vue.d.ts +26 -0
  57. package/dist/client/merchant/src/components/brandkit/ColorSelection.vue.d.ts +1 -1
  58. package/dist/client/merchant/src/components/editor/Editor.vue.d.ts +1 -1
  59. package/dist/client/merchant/src/components/editor/EditorFloatingToobar.vue.d.ts +1 -1
  60. package/dist/client/merchant/src/components/editor/toolbar/EditorToolbar.vue.d.ts +1 -1
  61. package/dist/client/merchant/src/components/element-sidebar/ElementSidebar.vue.d.ts +1 -1
  62. package/dist/client/merchant/src/components/inputs/ColorPicker.vue.d.ts +1 -1
  63. package/dist/client/merchant/src/components/inputs/ImageUpload.vue.d.ts +1 -1
  64. package/dist/client/merchant/src/components/inputs/TextAlign.vue.d.ts +1 -1
  65. package/dist/client/merchant/src/components/inputs/TextDecorators.vue.d.ts +1 -1
  66. package/dist/client/merchant/src/components/inputs/TextStyleList.vue.d.ts +1 -1
  67. package/dist/client/merchant/src/components/inspector/Inspector.vue.d.ts +1 -1
  68. package/dist/client/merchant/src/components/inspector/atoms/ConfigSection.vue.d.ts +3 -3
  69. package/dist/client/merchant/src/components/inspector/atoms/ConfigTab.vue.d.ts +3 -3
  70. package/dist/client/merchant/src/components/inspector/atoms/ConfigTabItem.vue.d.ts +3 -3
  71. package/dist/client/merchant/src/components/inspector/atoms/ConfigTabTitle.vue.d.ts +1 -1
  72. package/dist/client/merchant/src/components/navigation-sidebar/NavigationSidebar.vue.d.ts +1 -1
  73. package/dist/client/merchant/src/components/order-template/LayoutTemplateSection.vue.d.ts +3 -3
  74. package/dist/client/merchant/src/components/order-template/OrderTemplateEditorButton.vue.d.ts +1 -1
  75. package/dist/client/merchant/src/components/order-template/OrderTemplateEditorForm.vue.d.ts +1 -1
  76. package/dist/client/merchant/src/components/order-template/TemplateVersionHistory.vue.d.ts +18 -0
  77. package/dist/client/merchant/src/components/settings/AssetsSettings.vue.d.ts +1 -1
  78. package/dist/client/merchant/src/components/settings/ManagementSettings.vue.d.ts +1 -1
  79. package/dist/client/merchant/src/components/template/TemplatePreview.vue.d.ts +1 -1
  80. package/dist/client/merchant/src/stores/business/index.d.ts +469 -1
  81. package/dist/client/merchant/src/views/BrandkitView.vue.d.ts +1 -1
  82. package/dist/client/merchant/src/views/BuilderView.vue.d.ts +1 -1
  83. package/dist/client/merchant/src/views/ProjectView.vue.d.ts +1 -1
  84. package/dist/client/merchant/src/views/SettingsView.vue.d.ts +1 -1
  85. package/dist/dayjs.min-DnbY0e60.js +282 -0
  86. package/dist/{image-BtHlnsmY.js → image-D_Djf1PS.js} +1 -1
  87. package/dist/{index-ChMgx2Hq.js → index-Bk6TOZrx.js} +2 -2
  88. package/dist/{index-5BRydZO9.js → index-C1rSMuKA.js} +1 -1
  89. package/dist/index-C4vwWvn_.js +112 -0
  90. package/dist/index-D0LOMBBD.js +1822 -0
  91. package/dist/{main-8cObQmGm.js → main-CKhW2ogv.js} +3536 -3547
  92. package/dist/package.json +5 -4
  93. package/dist/style.css +1 -1
  94. package/dist/{v4-ANoOI1Qw.js → v4-CKwdnpQf.js} +8 -8
  95. package/dist/{vue-sonner-PX6Req0V.js → vue-sonner-CBFYmm8_.js} +129 -125
  96. package/package.json +5 -4
  97. package/dist/ColorPicker-CHzKbuCD.js +0 -543
  98. package/dist/ProjectView-Bq0vBJ3V.js +0 -705
  99. package/dist/index-BEAkOquM.js +0 -90
  100. package/dist/index-BXwbQwb-.js +0 -1736
@@ -1,4 +1,4 @@
1
- import { defineComponent as c, computed as n, resolveComponent as s, openBlock as m, createBlock as d } from "vue";
1
+ import { defineComponent as c, computed as n, resolveComponent as s, createBlock as m, openBlock as d } from "vue";
2
2
  import { useI18n as i } from "@feedmepos/mf-common";
3
3
  const x = /* @__PURE__ */ c({
4
4
  __name: "ButtonGroup",
@@ -16,7 +16,7 @@ const x = /* @__PURE__ */ c({
16
16
  ));
17
17
  return (e, v) => {
18
18
  const a = s("FmButtonGroup");
19
- return m(), d(a, {
19
+ return d(), m(a, {
20
20
  "model-value": p.value,
21
21
  "onUpdate:modelValue": r,
22
22
  items: o.value
@@ -1,8 +1,8 @@
1
- import { openBlock as s, createElementBlock as o, defineComponent as l, createElementVNode as r } from "vue";
1
+ import { createElementBlock as s, openBlock as o, defineComponent as l, createElementVNode as r } from "vue";
2
2
  import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  const a = {}, _ = { class: "border-b border-fm-color-neutral-gray-100" };
4
4
  function d(e, t) {
5
- return s(), o("div", _);
5
+ return o(), s("div", _);
6
6
  }
7
7
  const g = /* @__PURE__ */ n(a, [["render", d]]), f = { class: "relative" }, i = { class: "h-[18px] w-[18px] flex items-center justify-center" }, p = {
8
8
  class: "absolute h-full left-0 top-0 w-full text-fm-color-primary",
@@ -17,9 +17,9 @@ const x = /* @__PURE__ */ l({
17
17
  color: { default: "primary" }
18
18
  },
19
19
  setup(e) {
20
- return (t, u) => (s(), o("div", f, [
20
+ return (t, u) => (o(), s("div", f, [
21
21
  r("div", i, [
22
- (s(), o("svg", p, [
22
+ (o(), s("svg", p, [
23
23
  r("circle", {
24
24
  class: "spinner",
25
25
  "stroke-width": c[t.size],
@@ -0,0 +1,543 @@
1
+ import { defineComponent as ue, useTemplateRef as he, ref as pe, reactive as fe, computed as O, watch as ve, onMounted as de, onBeforeUnmount as me, createElementBlock as w, openBlock as x, normalizeStyle as R, unref as be, createElementVNode as h, createCommentVNode as J, renderSlot as N, createTextVNode as Q, Fragment as ge, renderList as we, toDisplayString as xe } from "vue";
2
+ function A(e, t, a) {
3
+ return Math.max(t, Math.min(e, a));
4
+ }
5
+ function ye(e, t) {
6
+ if (typeof e == "string" || typeof t == "string")
7
+ return e === t;
8
+ for (const a in e)
9
+ if (e[a] !== t[a])
10
+ return !1;
11
+ return !0;
12
+ }
13
+ function F(e) {
14
+ const t = [], a = e.length > 5 ? 2 : 1;
15
+ for (let o = 1; o < e.length; o += a) {
16
+ const l = e.substring(o, o + a).repeat(a % 2 + 1), f = parseInt(l, 16);
17
+ t.push(o === 3 * a + 1 ? f / 255 : f);
18
+ }
19
+ return t.length === 3 && t.push(1), {
20
+ r: t[0],
21
+ g: t[1],
22
+ b: t[2],
23
+ a: t[3]
24
+ };
25
+ }
26
+ function te(e) {
27
+ const t = e.l / 100, a = t + e.s / 100 * Math.min(t, 1 - t), o = a === 0 ? 0 : 200 * (1 - t / a);
28
+ return {
29
+ h: e.h,
30
+ s: o,
31
+ v: a * 100,
32
+ a: e.a
33
+ };
34
+ }
35
+ function L(e) {
36
+ let t = e.h % 360;
37
+ t < 0 && (t += 360);
38
+ const a = e.s / 100, o = e.l / 100;
39
+ return {
40
+ r: B(0, t, a, o) * 255,
41
+ g: B(8, t, a, o) * 255,
42
+ b: B(4, t, a, o) * 255,
43
+ a: e.a
44
+ };
45
+ }
46
+ function B(e, t, a, o) {
47
+ const l = (e + t / 30) % 12, f = a * Math.min(o, 1 - o);
48
+ return o - f * Math.max(-1, Math.min(l - 3, 9 - l, 1));
49
+ }
50
+ function ne(e) {
51
+ const t = e.s / 100, a = e.v / 100, o = a * (1 - t / 2);
52
+ return {
53
+ h: e.h,
54
+ s: o === 0 || o === 1 ? 0 : (a - o) / Math.min(o, 1 - o) * 100,
55
+ l: o * 100,
56
+ a: e.a
57
+ };
58
+ }
59
+ function re(e) {
60
+ return {
61
+ h: e.h,
62
+ w: e.v * (100 - e.s) / 100,
63
+ b: 100 - e.v,
64
+ a: e.a
65
+ };
66
+ }
67
+ function C(e) {
68
+ return L(ne(e));
69
+ }
70
+ function y(e) {
71
+ const t = e.w / 100, a = e.b / 100;
72
+ let o, l;
73
+ const f = t + a;
74
+ return f >= 1 ? (o = 0, l = t / f) : (l = 1 - a, o = (1 - t / l) * 100), {
75
+ h: e.h,
76
+ s: o,
77
+ v: l * 100,
78
+ a: e.a
79
+ };
80
+ }
81
+ function S(e) {
82
+ const { r: t, g: a, b: o, a: l } = e, f = Math.min(t, a, o), v = Math.max(t, a, o), p = v - f, u = (v + f) / 2;
83
+ let c = 0;
84
+ p !== 0 && (v === t ? c = (a - o) / p + (a < o ? 6 : 0) : v === a ? c = (o - t) / p + 2 : v === o && (c = (t - a) / p + 4), c *= 60);
85
+ let I = 0;
86
+ return u !== 0 && u !== 255 && (I = (v - u) / Math.min(u, 255 - u)), {
87
+ h: c,
88
+ s: I * 100,
89
+ l: u / 255 * 100,
90
+ a: l
91
+ };
92
+ }
93
+ function E(e) {
94
+ return "#" + Object.values(e).map((t, a) => Math.round(a === 3 ? t * 255 : t).toString(16).padStart(2, "0")).join("");
95
+ }
96
+ function k(e) {
97
+ return re(te(S(e)));
98
+ }
99
+ const $e = {
100
+ hex: {
101
+ hex: (e) => e,
102
+ hsl: (e) => S(F(e)),
103
+ hsv: (e) => y(k(F(e))),
104
+ hwb: (e) => k(F(e)),
105
+ rgb: F
106
+ },
107
+ hsl: {
108
+ hex: (e) => E(L(e)),
109
+ hsl: (e) => e,
110
+ hsv: te,
111
+ hwb: (e) => k(L(e)),
112
+ rgb: L
113
+ },
114
+ hsv: {
115
+ hex: (e) => E(C(e)),
116
+ hsl: ne,
117
+ hsv: (e) => e,
118
+ hwb: re,
119
+ rgb: C
120
+ },
121
+ hwb: {
122
+ hex: (e) => E(C(y(e))),
123
+ hsl: (e) => S(C(y(e))),
124
+ hsv: y,
125
+ hwb: (e) => e,
126
+ rgb: (e) => C(y(e))
127
+ },
128
+ rgb: {
129
+ hex: E,
130
+ hsl: S,
131
+ hsv: (e) => y(k(e)),
132
+ hwb: k,
133
+ rgb: (e) => e
134
+ }
135
+ };
136
+ function Ne(e, t, a) {
137
+ return $e[e][t](a);
138
+ }
139
+ function Ce(e, t) {
140
+ const a = e.toFixed(t);
141
+ return a.includes(".") ? a.replace(/\.?0+$/, "") : a;
142
+ }
143
+ const ke = {
144
+ deg: 1,
145
+ grad: 0.9,
146
+ rad: 180 / Math.PI,
147
+ turn: 360
148
+ }, T = {
149
+ from(e) {
150
+ return e.endsWith("%") ? $.from(e, { referenceValue: 1 }) : b.from(e, { min: 0, max: 1 });
151
+ },
152
+ to(e) {
153
+ return b.to(e);
154
+ }
155
+ }, Z = {
156
+ from(e) {
157
+ const t = e.match(/deg|g?rad|turn$/);
158
+ if (t === null)
159
+ return b.from(e);
160
+ const a = t[0];
161
+ return b.from(e.slice(0, -a.length)) * ke[a];
162
+ },
163
+ to(e) {
164
+ return b.to(e);
165
+ }
166
+ }, b = {
167
+ from(e, { min: t = Number.NEGATIVE_INFINITY, max: a = Number.POSITIVE_INFINITY } = {}) {
168
+ return e.endsWith(".") ? NaN : A(Number(e), t, a);
169
+ },
170
+ to(e) {
171
+ return Ce(e, 2);
172
+ }
173
+ }, $ = {
174
+ from(e, { referenceValue: t = 100, min: a = 0, max: o = 100 } = {}) {
175
+ return e.endsWith("%") ? b.from(e.slice(0, -1), { min: a, max: o }) * t / 100 : NaN;
176
+ },
177
+ to(e) {
178
+ return b.to(e) + "%";
179
+ }
180
+ }, P = {
181
+ from(e) {
182
+ return e.endsWith("%") ? $.from(e, { referenceValue: 255 }) : b.from(e, { min: 0, max: 255 });
183
+ },
184
+ to(e) {
185
+ return b.to(e);
186
+ }
187
+ }, Ae = {
188
+ hsl: {
189
+ h: Z,
190
+ s: $,
191
+ l: $
192
+ },
193
+ hwb: {
194
+ h: Z,
195
+ w: $,
196
+ b: $
197
+ },
198
+ rgb: {
199
+ r: P,
200
+ g: P,
201
+ b: P
202
+ }
203
+ };
204
+ function j(e, t) {
205
+ return Ae[e][t];
206
+ }
207
+ function K({ format: e, color: t }, a) {
208
+ if (e === "hex")
209
+ return a && [5, 9].includes(t.length) ? t.substring(0, t.length - (t.length - 1) / 4) : t;
210
+ const o = Object.entries(t).slice(0, a ? 3 : 4).map(([l, f]) => {
211
+ const v = l === "a" ? T : j(e, l);
212
+ return (l === "a" ? "/ " : "") + v.to(f);
213
+ });
214
+ return `${e}(${o.join(" ")})`;
215
+ }
216
+ function ae(e) {
217
+ return /^#(?:(?:[A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(e);
218
+ }
219
+ function Ie(e) {
220
+ return "r" in e ? "rgb" : "w" in e ? "hwb" : "v" in e ? "hsv" : "s" in e ? "hsl" : null;
221
+ }
222
+ const ee = {
223
+ hsl: ["h", "s", "l", "a"],
224
+ hwb: ["h", "w", "b", "a"],
225
+ rgb: ["r", "g", "b", "a"]
226
+ };
227
+ function Me(e) {
228
+ if (typeof e != "string") {
229
+ const p = Ie(e);
230
+ return p === null ? null : { format: p, color: e };
231
+ }
232
+ if (e.startsWith("#"))
233
+ return ae(e) ? { format: "hex", color: e } : null;
234
+ if (!e.includes("(")) {
235
+ const p = document.createElement("canvas").getContext("2d");
236
+ p.fillStyle = e;
237
+ const u = p.fillStyle;
238
+ return u === "#000000" && e !== "black" ? null : { format: "hex", color: u };
239
+ }
240
+ const [t, a] = e.split("("), o = t.substring(0, 3);
241
+ if (!(o in ee))
242
+ return null;
243
+ const l = a.replace(/[,/)]/g, " ").replace(/\s+/g, " ").trim().split(" ");
244
+ l.length === 3 && l.push("1");
245
+ const f = ee[o], v = Object.fromEntries(f.map((p, u) => {
246
+ const c = p === "a" ? T : j(o, p);
247
+ return [
248
+ p,
249
+ c.from(l[u])
250
+ ];
251
+ }));
252
+ return { format: o, color: v };
253
+ }
254
+ function Fe(e, t, a) {
255
+ const o = e.getBoundingClientRect(), l = t - o.left, f = a - o.top;
256
+ return {
257
+ x: o.width === 0 ? 0 : A(l / o.width * 100, 0, 100),
258
+ y: o.height === 0 ? 0 : A((1 - f / o.height) * 100, 0, 100)
259
+ };
260
+ }
261
+ const Ee = { class: "vacp-range-input-group" }, Le = ["for"], Se = { class: "vacp-range-input-label-text vacp-range-input-label-text--hue" }, Te = ["id", "value"], je = ["for"], Ve = { class: "vacp-range-input-label-text vacp-range-input-label-text--alpha" }, ze = ["id", "value"], De = { class: "vacp-actions" }, Oe = { class: "vacp-color-inputs" }, Re = { class: "vacp-color-input-group" }, Be = ["for"], Pe = ["id", "value"], Ke = ["id", "for", "onInput"], He = { class: "vacp-color-input-label-text" }, We = ["id", "value", "onInput"], _e = /* @__PURE__ */ ue({
262
+ __name: "ColorPicker",
263
+ props: {
264
+ color: { default: "#ffffffff" },
265
+ copy: { type: Function, default: void 0 },
266
+ id: { default: "color-picker" },
267
+ visibleFormats: { default: () => ["hex", "hsl", "hwb", "rgb"] },
268
+ defaultFormat: { default: "hsl" },
269
+ alphaChannel: { default: "show" }
270
+ },
271
+ emits: ["color-change", "color-copy"],
272
+ setup(e, { expose: t, emit: a }) {
273
+ const o = ["hex", "hsl", "hsv", "hwb", "rgb"], l = e, f = a;
274
+ t({
275
+ copyColor: X,
276
+ switchFormat: H
277
+ });
278
+ const v = he("colorSpaceRef");
279
+ let p = !1;
280
+ const u = pe(l.visibleFormats.includes(l.defaultFormat) ? l.defaultFormat : l.visibleFormats[0]), c = fe({
281
+ hex: "#ffffffff",
282
+ hsl: { h: 0, s: 0, l: 100, a: 1 },
283
+ hsv: { h: 0, s: 0, v: 100, a: 1 },
284
+ hwb: { h: 0, w: 100, b: 0, a: 1 },
285
+ rgb: { r: 255, g: 255, b: 255, a: 1 }
286
+ }), I = O(function() {
287
+ const r = u.value, n = c[r];
288
+ return r.split("").map((i) => {
289
+ const s = n[i];
290
+ return {
291
+ value: j(r, i).to(s),
292
+ channel: i,
293
+ label: i.toUpperCase()
294
+ };
295
+ }).concat(l.alphaChannel === "show" ? [{
296
+ value: T.to(n.a),
297
+ channel: "a",
298
+ label: "Alpha"
299
+ }] : []);
300
+ }), oe = O(function() {
301
+ return l.alphaChannel === "hide" && [5, 9].includes(c.hex.length) ? c.hex.substring(0, c.hex.length - (c.hex.length - 1) / 4) : c.hex;
302
+ }), V = O(function() {
303
+ return c.hsv;
304
+ });
305
+ ve(() => l.color, Y), de(function() {
306
+ document.addEventListener("pointermove", z, { passive: !1 }), document.addEventListener("touchmove", D, { passive: !1 }), document.addEventListener("pointerup", M), document.addEventListener("touchend", M), Y(l.color);
307
+ }), me(function() {
308
+ document.removeEventListener("pointermove", z), document.removeEventListener("touchmove", D), document.removeEventListener("pointerup", M), document.removeEventListener("touchend", M);
309
+ });
310
+ function H() {
311
+ const r = (l.visibleFormats.findIndex((n) => n === u.value) + 1) % l.visibleFormats.length;
312
+ u.value = l.visibleFormats[r];
313
+ }
314
+ function le(r) {
315
+ p = !0, z(r);
316
+ }
317
+ function se(r) {
318
+ p = !0, D(r);
319
+ }
320
+ function M() {
321
+ p = !1;
322
+ }
323
+ function z(r) {
324
+ r.buttons !== 1 || !p || !(v.value instanceof HTMLElement) || W(v.value, r.clientX, r.clientY);
325
+ }
326
+ function D(r) {
327
+ if (!p || !(v.value instanceof HTMLElement))
328
+ return;
329
+ r.preventDefault();
330
+ const n = r.touches[0];
331
+ W(v.value, n.clientX, n.clientY);
332
+ }
333
+ function W(r, n, i) {
334
+ const s = Fe(r, n, i), d = Object.assign({}, c.hsv);
335
+ d.s = s.x, d.v = s.y, g("hsv", d);
336
+ }
337
+ function ie(r) {
338
+ if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(r.key))
339
+ return;
340
+ r.preventDefault();
341
+ const n = ["ArrowLeft", "ArrowDown"].includes(r.key) ? -1 : 1, i = ["ArrowLeft", "ArrowRight"].includes(r.key) ? "s" : "v", s = r.shiftKey ? 10 : 1, d = c.hsv[i] + n * s, m = Object.assign({}, c.hsv);
342
+ m[i] = A(d, 0, 100), g("hsv", m);
343
+ }
344
+ function Y(r) {
345
+ const n = Me(r);
346
+ n !== null && g(n.format, n.color);
347
+ }
348
+ function _(r, n) {
349
+ const i = r.currentTarget, s = Object.assign({}, c.hsv);
350
+ s[n] = Number(i.value), g("hsv", s);
351
+ }
352
+ function ce(r) {
353
+ const n = r.target;
354
+ ae(n.value) && g("hex", n.value);
355
+ }
356
+ function U(r, n) {
357
+ const i = r.target, s = u.value, d = Object.assign({}, c[s]), m = (n === "a" ? T : j(s, n)).from(i.value);
358
+ Number.isNaN(m) || (d[n] = m, g(s, d));
359
+ }
360
+ function g(r, n) {
361
+ let i = n;
362
+ if (l.alphaChannel === "hide")
363
+ if (typeof n != "string")
364
+ n.a = 1, i = n;
365
+ else if ([5, 9].includes(n.length)) {
366
+ const s = (n.length - 1) / 4;
367
+ i = n.substring(0, n.length - s) + "f".repeat(s);
368
+ } else [4, 7].includes(n.length) && (i = n + "f".repeat((n.length - 1) / 3));
369
+ if (!ye(c[r], i)) {
370
+ c[r] = i;
371
+ for (const s of o)
372
+ s !== r && (c[s] = Ne(r, s, i));
373
+ f("color-change", G());
374
+ }
375
+ }
376
+ async function X() {
377
+ const r = c[u.value], n = l.alphaChannel === "hide", i = K({ color: r, format: u.value }, n);
378
+ await (l.copy ? l.copy : (s) => window.navigator.clipboard.writeText(s))(i), f("color-copy", G());
379
+ }
380
+ function G() {
381
+ const r = l.alphaChannel === "hide", n = K({ color: c[u.value], format: u.value }, r);
382
+ return {
383
+ colors: c,
384
+ cssColor: n
385
+ };
386
+ }
387
+ function q(r) {
388
+ if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(r.key) || !r.shiftKey)
389
+ return;
390
+ const n = r.currentTarget, i = Number(n.step), s = ["ArrowLeft", "ArrowDown"].includes(r.key) ? -1 : 1, d = Number(n.value) + s * i * 10, m = A(d, Number(n.min), Number(n.max));
391
+ n.value = String(m - s * i);
392
+ }
393
+ return (r, n) => (x(), w("div", {
394
+ class: "vacp-color-picker",
395
+ style: R(`--vacp-color: ${be(K)({ format: "hsl", color: c.hsl }, !0)}`)
396
+ }, [
397
+ h("div", {
398
+ ref: "colorSpaceRef",
399
+ class: "vacp-color-space",
400
+ style: R(`position: relative; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); background-color: hsl(${V.value.h} 100% 50%)`),
401
+ onPointerdown: le,
402
+ onTouchstart: se
403
+ }, [
404
+ h("div", {
405
+ ref: "thumb",
406
+ class: "vacp-color-space-thumb",
407
+ tabindex: "0",
408
+ "aria-label": "Color space thumb",
409
+ style: R(`box-sizing: border-box; position: absolute; left: ${V.value.s}%; bottom: ${V.value.v}%;`),
410
+ onKeydown: ie
411
+ }, null, 36)
412
+ ], 36),
413
+ h("div", Ee, [
414
+ h("label", {
415
+ class: "vacp-range-input-label vacp-range-input-label--hue",
416
+ for: `${r.id}-hue-slider`
417
+ }, [
418
+ h("span", Se, [
419
+ N(r.$slots, "hue-range-input-label", {}, () => [
420
+ n[2] || (n[2] = Q("Hue", -1))
421
+ ])
422
+ ]),
423
+ h("input", {
424
+ id: `${r.id}-hue-slider`,
425
+ class: "vacp-range-input vacp-range-input--hue",
426
+ value: c.hsv.h,
427
+ type: "range",
428
+ min: "0",
429
+ max: "360",
430
+ step: "1",
431
+ onKeydownPassive: q,
432
+ onInput: n[0] || (n[0] = (i) => _(i, "h"))
433
+ }, null, 40, Te)
434
+ ], 8, Le),
435
+ r.alphaChannel === "show" ? (x(), w("label", {
436
+ key: 0,
437
+ class: "vacp-range-input-label vacp-range-input-label--alpha",
438
+ for: `${r.id}-alpha-slider`
439
+ }, [
440
+ h("span", Ve, [
441
+ N(r.$slots, "alpha-range-input-label", {}, () => [
442
+ n[3] || (n[3] = Q("Alpha", -1))
443
+ ])
444
+ ]),
445
+ h("input", {
446
+ id: `${r.id}-alpha-slider`,
447
+ class: "vacp-range-input vacp-range-input--alpha",
448
+ value: c.hsv.a,
449
+ type: "range",
450
+ min: "0",
451
+ max: "1",
452
+ step: "0.01",
453
+ onKeydownPassive: q,
454
+ onInput: n[1] || (n[1] = (i) => _(i, "a"))
455
+ }, null, 40, ze)
456
+ ], 8, je)) : J("", !0)
457
+ ]),
458
+ h("div", De, [
459
+ h("button", {
460
+ class: "vacp-copy-button",
461
+ type: "button",
462
+ onClick: X
463
+ }, [
464
+ N(r.$slots, "copy-button", {}, () => [
465
+ n[4] || (n[4] = h("span", { class: "vacp-visually-hidden" }, "Copy color", -1)),
466
+ n[5] || (n[5] = h("svg", {
467
+ class: "vacp-icon",
468
+ xmlns: "http://www.w3.org/2000/svg",
469
+ "aria-hidden": "true",
470
+ width: "24",
471
+ height: "24",
472
+ viewBox: "0 0 32 32"
473
+ }, [
474
+ h("path", {
475
+ d: "M25.313 28v-18.688h-14.625v18.688h14.625zM25.313 6.688c1.438 0 2.688 1.188 2.688 2.625v18.688c0 1.438-1.25 2.688-2.688 2.688h-14.625c-1.438 0-2.688-1.25-2.688-2.688v-18.688c0-1.438 1.25-2.625 2.688-2.625h14.625zM21.313 1.313v2.688h-16v18.688h-2.625v-18.688c0-1.438 1.188-2.688 2.625-2.688h16z",
476
+ fill: "currentColor"
477
+ })
478
+ ], -1))
479
+ ])
480
+ ]),
481
+ N(r.$slots, "actions")
482
+ ]),
483
+ h("div", Oe, [
484
+ h("div", Re, [
485
+ u.value === "hex" ? (x(), w("label", {
486
+ key: 0,
487
+ class: "vacp-color-input-label",
488
+ for: `${r.id}-color-hex`
489
+ }, [
490
+ n[6] || (n[6] = h("span", { class: "vacp-color-input-label-text" }, " Hex ", -1)),
491
+ h("input", {
492
+ id: `${r.id}-color-hex`,
493
+ class: "vacp-color-input",
494
+ type: "text",
495
+ value: oe.value,
496
+ onInput: ce
497
+ }, null, 40, Pe)
498
+ ], 8, Be)) : (x(!0), w(ge, { key: 1 }, we(I.value, ({ value: i, channel: s, label: d }) => (x(), w("label", {
499
+ id: `${r.id}-color-${u.value}-${s}-label`,
500
+ key: `${r.id}-color-${u.value}-${s}-label`,
501
+ class: "vacp-color-input-label",
502
+ for: `${r.id}-color-${u.value}-${s}`,
503
+ onInput: (m) => U(m, s)
504
+ }, [
505
+ h("span", He, xe(d), 1),
506
+ h("input", {
507
+ id: `${r.id}-color-${u.value}-${s}`,
508
+ class: "vacp-color-input",
509
+ type: "text",
510
+ value: i,
511
+ onInput: (m) => U(m, s)
512
+ }, null, 40, We)
513
+ ], 40, Ke))), 128))
514
+ ]),
515
+ r.visibleFormats.length > 1 ? (x(), w("button", {
516
+ key: 0,
517
+ class: "vacp-format-switch-button",
518
+ type: "button",
519
+ onClick: H
520
+ }, [
521
+ N(r.$slots, "format-switch-button", {}, () => [
522
+ n[7] || (n[7] = h("span", { class: "vacp-visually-hidden" }, "Switch format", -1)),
523
+ n[8] || (n[8] = h("svg", {
524
+ class: "vacp-icon",
525
+ "aria-hidden": "true",
526
+ xmlns: "http://www.w3.org/2000/svg",
527
+ width: "16",
528
+ height: "15"
529
+ }, [
530
+ h("path", {
531
+ d: "M8 15l5-5-1-1-4 2-4-2-1 1zm4-9l1-1-5-5-5 5 1 1 4-2z",
532
+ fill: "currentColor"
533
+ })
534
+ ], -1))
535
+ ])
536
+ ])) : J("", !0)
537
+ ])
538
+ ], 4));
539
+ }
540
+ });
541
+ export {
542
+ _e as B
543
+ };
@@ -1,6 +1,6 @@
1
- import { defineComponent as x, ref as b, watch as w, resolveComponent as m, openBlock as y, createBlock as h, withCtx as d, createVNode as i, createTextVNode as F, createElementVNode as r, createElementBlock as C, Fragment as B, renderList as V, normalizeClass as $, normalizeStyle as k, toDisplayString as P, computed as S, unref as D } from "vue";
2
- import { K as E } from "./ColorPicker-CHzKbuCD.js";
3
- const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-wrap pb-24" }, N = { class: "flex flex-col items-center" }, z = ["onClick"], K = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary text-center" }, R = { class: "w-full flex gap-8 justify-end items-center" }, T = /* @__PURE__ */ x({
1
+ import { defineComponent as x, ref as b, watch as w, resolveComponent as m, createBlock as h, openBlock as y, withCtx as d, createElementVNode as r, createVNode as i, createElementBlock as C, Fragment as B, renderList as F, normalizeClass as V, normalizeStyle as k, toDisplayString as $, createTextVNode as P, computed as S, unref as D } from "vue";
2
+ import { B as E } from "./ColorPicker-RKWzhLBO.js";
3
+ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-wrap pb-24" }, N = { class: "flex flex-col items-center" }, z = ["onClick"], R = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary text-center" }, T = { class: "w-full flex gap-8 justify-end items-center" }, U = /* @__PURE__ */ x({
4
4
  __name: "LinkBrandkitColor",
5
5
  props: {
6
6
  color: {}
@@ -46,16 +46,16 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
46
46
  })
47
47
  ]),
48
48
  "dialog-header": d(() => t[3] || (t[3] = [
49
- F(" Link with brandkit color ")
49
+ P(" Link with brandkit color ")
50
50
  ])),
51
51
  default: d(() => [
52
52
  r("div", L, [
53
- (y(), C(B, null, V(e, (n) => {
53
+ (y(), C(B, null, F(e, (n) => {
54
54
  var g, _;
55
55
  return r("div", N, [
56
56
  r("div", {
57
- onClick: (q) => a.value = n,
58
- class: $(["p-[2px] border-1 rounded-sm", {
57
+ onClick: (I) => a.value = n,
58
+ class: V(["p-[2px] border-1 rounded-sm", {
59
59
  "border-fm-color-primary": (g = a.value) == null ? void 0 : g.includes(n),
60
60
  "border-fm-color-neutral-gray-200": !((_ = a.value) != null && _.includes(n))
61
61
  }])
@@ -65,13 +65,13 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
65
65
  style: k({ backgroundColor: `var(${n})` })
66
66
  }, null, 4)
67
67
  ], 10, z),
68
- r("div", K, P(n.replace("--brand-color-", "").replace(/-/g, " ")), 1)
68
+ r("div", R, $(n.replace("--brand-color-", "").replace(/-/g, " ")), 1)
69
69
  ]);
70
70
  }), 64))
71
71
  ])
72
72
  ]),
73
73
  "dialog-footer": d(() => [
74
- r("div", R, [
74
+ r("div", T, [
75
75
  i(u, {
76
76
  variant: "secondary",
77
77
  label: "Close",
@@ -87,7 +87,7 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
87
87
  }, 8, ["modelValue"]);
88
88
  };
89
89
  }
90
- }), U = { class: "flex items-center gap-8" }, j = { class: "shadow-lg rounded-lg p-8" }, A = /* @__PURE__ */ x({
90
+ }), j = { class: "flex items-center gap-8" }, q = { class: "shadow-lg rounded-lg p-8" }, G = /* @__PURE__ */ x({
91
91
  __name: "ColorPicker",
92
92
  props: {
93
93
  context: {}
@@ -108,7 +108,7 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
108
108
  });
109
109
  return (e, o) => {
110
110
  const t = m("FmButton"), u = m("FmPopover");
111
- return y(), C("div", U, [
111
+ return y(), C("div", j, [
112
112
  i(u, null, {
113
113
  "popover-button": d(() => [
114
114
  r("div", {
@@ -124,7 +124,7 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
124
124
  ], 512)
125
125
  ]),
126
126
  default: d(() => [
127
- r("div", j, [
127
+ r("div", q, [
128
128
  i(D(E), {
129
129
  copy: s,
130
130
  onColorCopy: o[0] || (o[0] = (c) => s(c.cssColor)),
@@ -146,7 +146,7 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
146
146
  ]),
147
147
  _: 1
148
148
  }),
149
- i(T, {
149
+ i(U, {
150
150
  color: l.context._value || "#ffffff00",
151
151
  onUpdate: o[2] || (o[2] = (c) => a(c))
152
152
  }, null, 8, ["color"])
@@ -155,5 +155,5 @@ const L = { class: "grid grid-cols-4 place-items-center items-start gap-16 flex-
155
155
  }
156
156
  });
157
157
  export {
158
- A as default
158
+ G as default
159
159
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as n, openBlock as o, createElementBlock as l, normalizeClass as a, toDisplayString as r } from "vue";
1
+ import { defineComponent as n, createElementBlock as o, openBlock as l, normalizeClass as a, toDisplayString as r } from "vue";
2
2
  const i = /* @__PURE__ */ n({
3
3
  __name: "Icon",
4
4
  props: {
@@ -6,7 +6,7 @@ const i = /* @__PURE__ */ n({
6
6
  filled: { type: Boolean, default: !1 }
7
7
  },
8
8
  setup(s) {
9
- return (e, t) => (o(), l("span", {
9
+ return (e, t) => (l(), o("span", {
10
10
  class: a(["material-symbols-rounded", `icon-${e.filled ? "filled" : "rounded"}`])
11
11
  }, r(e.name), 3));
12
12
  }