@feedmepos/mf-brand-app-builder 0.5.22-dev.0 → 0.5.23-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.
- package/dist/{App-DSjCJtmn.js → App-BRIDkK5d.js} +5 -5
- package/dist/{AssetsSettings-e8FjbJ_2.js → AssetsSettings-DhprCc4v.js} +6 -6
- package/dist/{BaDivider-DWZv3fqi.js → BaDivider-Cp9gfB4r.js} +2 -2
- package/dist/{BrandkitView-YRlmRZnS.js → BrandkitView-DzLVTHjo.js} +2867 -2033
- package/dist/{BuilderView-BLM7vEZA.js → BuilderView-BwXnOIit.js} +460 -474
- package/dist/{ButtonGroup-D_HkX122.js → ButtonGroup-2ilMTPHH.js} +2 -2
- package/dist/{CircularProgress-h90pbjU3.js → CircularProgress-DdblYCtV.js} +4 -4
- package/dist/ColorPicker-RKWzhLBO.js +543 -0
- package/dist/{ColorPicker-I6CkNIxt.js → ColorPicker-dVFIiu94.js} +14 -14
- package/dist/{Icon.vue_vue_type_style_index_0_lang-CVCHCcWR.js → Icon.vue_vue_type_style_index_0_lang-BcRjQndc.js} +2 -2
- package/dist/{ImageUpload-CDR7v2YB.js → ImageUpload-OqPKnQQI.js} +9 -9
- package/dist/{LinkButton-DvF93Arq.js → LinkButton-De-YNclu.js} +4 -4
- package/dist/{ListRepeater-Dri1M_Xh.js → ListRepeater-DIlTKjtE.js} +2 -2
- package/dist/{ManagementSettings-CROYjeuM.js → ManagementSettings-Cz4HkNm1.js} +4 -4
- package/dist/ProjectView-ByxaVBFb.js +428 -0
- package/dist/{Select-BRYuMWoQ.js → Select-DQx6OfZx.js} +9 -9
- package/dist/{SettingsView-DHA7hXUx.js → SettingsView-uft0uKio.js} +2 -2
- package/dist/{StepperField-BeeZ_sl9.js → StepperField-nyaUK9ht.js} +2 -2
- package/dist/{Switch-8mmNQUDo.js → Switch-uc_zN-mb.js} +2 -2
- package/dist/{TextAlign-BOC8ekaH.js → TextAlign-BSp1Xi7F.js} +2 -2
- package/dist/{TextDecorators-BJC4umDR.js → TextDecorators-1C54q7us.js} +4 -4
- package/dist/{TextField-BiVH5rLX.js → TextField-DfBJB6vQ.js} +2 -2
- package/dist/{TextStyleList-CuPE80Py.js → TextStyleList-Bef3irUx.js} +3 -3
- package/dist/{app-OPl2Khtq.js → app-CY0-wVrG.js} +6513 -3895
- package/dist/app.js +1 -1
- package/dist/brand-core/src/brandkit.d.ts +5 -0
- package/dist/brand-core/src/entity.d.ts +89 -0
- package/dist/{components → client/components}/src/components/BranchList.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/ButtonList.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/CountrySwitcher.vue.d.ts +1 -1
- package/dist/client/components/src/components/Homepage.vue.d.ts +19 -0
- package/dist/{components → client/components}/src/components/ImageCarousel.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/ImageDisplay.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/Member/TransactionList.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/MemberCard.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/NavigationBar.vue.d.ts +4 -4
- package/dist/{components → client/components}/src/components/OrderHistoryCard.vue.d.ts +4 -3
- package/dist/{components → client/components}/src/components/OrderMethod.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/TextDisplay.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/atoms/Button.vue.d.ts +4 -4
- package/dist/{components → client/components}/src/components/atoms/CircularProgress.vue.d.ts +2 -2
- package/dist/{components → client/components}/src/components/atoms/Container.vue.d.ts +3 -3
- package/dist/{components → client/components}/src/components/atoms/Icon.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/components/atoms/LinkSlot.vue.d.ts +4 -4
- package/dist/{components → client/components}/src/views/OrderDetails.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/views/_Credit.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/views/_MemberProfile.vue.d.ts +4 -4
- package/dist/{components → client/components}/src/views/_Point.vue.d.ts +1 -1
- package/dist/{components → client/components}/src/views/_Referral.vue.d.ts +4 -4
- package/dist/{components → client/components}/src/views/_ReferralTutorial.vue.d.ts +4 -4
- package/dist/{merchant → client/merchant}/src/api/business/index.d.ts +41 -1
- package/dist/{merchant → client/merchant}/src/app.d.ts +2614 -0
- package/dist/{merchant → client/merchant}/src/components/atoms/BaButtonGroup.vue.d.ts +1 -1
- package/dist/{merchant → client/merchant}/src/components/brandkit/ColorSelection.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/editor/EditorFloatingToobar.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/editor/toolbar/EditorToolbar.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/editor/toolbar/PreviewQrCode.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/editor/toolbar/TemplatePicker.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/editor/toolbar/TemplateShareMenu.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/element-sidebar/ElementSidebar.vue.d.ts +2 -0
- package/dist/{merchant → client/merchant}/src/components/inputs/ColorPicker.vue.d.ts +1 -1
- package/dist/{merchant → client/merchant}/src/components/inputs/ImageUpload.vue.d.ts +1 -1
- package/dist/{merchant → client/merchant}/src/components/inputs/TextAlign.vue.d.ts +1 -1
- package/dist/{merchant → client/merchant}/src/components/inputs/TextDecorators.vue.d.ts +1 -1
- package/dist/{merchant → client/merchant}/src/components/inputs/TextStyleList.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inspector/Inspector.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/inspector/atoms/ConfigSection.vue.d.ts +12 -0
- package/dist/client/merchant/src/components/inspector/atoms/ConfigTab.vue.d.ts +18 -0
- package/dist/client/merchant/src/components/inspector/atoms/ConfigTabItem.vue.d.ts +13 -0
- package/dist/{merchant → client/merchant}/src/components/inspector/atoms/ConfigTabTitle.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/navigation-sidebar/NavigationSidebar.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/order-template/LayoutTemplateSection.vue.d.ts +14 -0
- package/dist/client/merchant/src/components/order-template/OrderTemplateEditorButton.vue.d.ts +10 -0
- package/dist/client/merchant/src/components/order-template/OrderTemplateEditorForm.vue.d.ts +14 -0
- package/dist/client/merchant/src/components/order-template/TemplateVersionHistory.vue.d.ts +18 -0
- package/dist/client/merchant/src/components/settings/AssetsSettings.vue.d.ts +2 -0
- package/dist/client/merchant/src/components/settings/ManagementSettings.vue.d.ts +2 -0
- package/dist/{merchant → client/merchant}/src/components/template/TemplatePreview.vue.d.ts +1 -1
- package/dist/{merchant → client/merchant}/src/stores/business/index.d.ts +217 -1
- package/dist/client/merchant/src/views/BrandkitView.vue.d.ts +2 -0
- package/dist/{merchant → client/merchant}/src/views/BuilderView.vue.d.ts +1 -1
- package/dist/client/merchant/src/views/ProjectView.vue.d.ts +2 -0
- package/dist/client/merchant/src/views/SettingsView.vue.d.ts +2 -0
- package/dist/dayjs.min-DnbY0e60.js +282 -0
- package/dist/{image-HDqbMgOR.js → image-D_Djf1PS.js} +1 -1
- package/dist/{index-V999lx_3.js → index-Bk6TOZrx.js} +2 -2
- package/dist/{index-BodukiEf.js → index-C1rSMuKA.js} +1 -1
- package/dist/index-C4vwWvn_.js +112 -0
- package/dist/index-D0LOMBBD.js +1822 -0
- package/dist/{main--RZvbXYz.js → main-DzMHu5qo.js} +3566 -3577
- package/dist/package.json +7 -4
- package/dist/style.css +1 -1
- package/dist/{v4-ANoOI1Qw.js → v4-CKwdnpQf.js} +8 -8
- package/dist/{vue-sonner-PX6Req0V.js → vue-sonner-CBFYmm8_.js} +129 -125
- package/package.json +7 -4
- package/dist/ColorPicker-CHzKbuCD.js +0 -543
- package/dist/ProjectView-Tb44Sm_z.js +0 -705
- package/dist/components/src/components/Homepage.vue.d.ts +0 -19
- package/dist/components/src/components/atoms/Divider.vue.d.ts +0 -2
- package/dist/index-CvbnxMT4.js +0 -1736
- package/dist/index-DbvZZQr6.js +0 -90
- package/dist/merchant/src/components/atoms/BaDivider.vue.d.ts +0 -2
- package/dist/merchant/src/components/editor/Editor.vue.d.ts +0 -2
- package/dist/merchant/src/components/editor/EditorFloatingToobar.vue.d.ts +0 -2
- package/dist/merchant/src/components/editor/toolbar/EditorToolbar.vue.d.ts +0 -2
- package/dist/merchant/src/components/element-sidebar/ElementSidebar.vue.d.ts +0 -2
- package/dist/merchant/src/components/inspector/Inspector.vue.d.ts +0 -2
- package/dist/merchant/src/components/inspector/atoms/ConfigSection.vue.d.ts +0 -12
- package/dist/merchant/src/components/inspector/atoms/ConfigTab.vue.d.ts +0 -18
- package/dist/merchant/src/components/inspector/atoms/ConfigTabItem.vue.d.ts +0 -13
- package/dist/merchant/src/components/navigation-sidebar/NavigationSidebar.vue.d.ts +0 -2
- package/dist/merchant/src/components/settings/AssetsSettings.vue.d.ts +0 -2
- package/dist/merchant/src/components/settings/ManagementSettings.vue.d.ts +0 -2
- package/dist/merchant/src/views/BrandkitView.vue.d.ts +0 -2
- package/dist/merchant/src/views/ProjectView.vue.d.ts +0 -2
- package/dist/merchant/src/views/SettingsView.vue.d.ts +0 -2
- /package/dist/{components → client/components}/src/components/Member/MemberAchievements.vue.d.ts +0 -0
- /package/dist/{components → client/components}/src/components/Member/MemberCards.vue.d.ts +0 -0
- /package/dist/{components → client/components}/src/components/Member/MemberSummary.vue.d.ts +0 -0
- /package/dist/{merchant/src/App.vue.d.ts → client/components/src/components/atoms/Divider.vue.d.ts} +0 -0
- /package/dist/{components → client/components}/src/components/atoms/OrderTypeChip.vue.d.ts +0 -0
- /package/dist/{components → client/components}/src/i18n.d.ts +0 -0
- /package/dist/{components → client/components}/src/main.d.ts +0 -0
- /package/dist/{components → client/components}/src/utils/date.d.ts +0 -0
- /package/dist/{components → client/components}/src/utils/image.d.ts +0 -0
- /package/dist/{merchant/src/Entry.vue.d.ts → client/merchant/src/App.vue.d.ts} +0 -0
- /package/dist/{merchant/src/components/editor/toolbar/PreviewQrCode.vue.d.ts → client/merchant/src/Entry.vue.d.ts} +0 -0
- /package/dist/{merchant → client/merchant}/src/api/image/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/api/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/api/template/index.d.ts +0 -0
- /package/dist/{merchant/src/components/editor/toolbar/TemplatePicker.vue.d.ts → client/merchant/src/components/atoms/BaDivider.vue.d.ts} +0 -0
- /package/dist/{merchant → client/merchant}/src/components/atoms/index.d.ts +0 -0
- /package/dist/{merchant/src/components/editor/toolbar/TemplateShareMenu.vue.d.ts → client/merchant/src/components/editor/Editor.vue.d.ts} +0 -0
- /package/dist/{merchant → client/merchant}/src/components/element-sidebar/all-elements.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/ButtonGroup.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/LinkBrandkitColor.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/LinkButton.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/ListRepeater.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/Select.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/StepperField.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/Switch.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/TextField.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/inputs/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/components/modals/TemplateSelectionModal.vue.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/composables/useNode/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/composables/useToast/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/config/defaultTemplateConfig.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/helpers/businessUrl.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/main.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/branch-list/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/branch-list/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/button-list/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/button-list/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/carousel/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/carousel/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/container/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/container/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/display-image/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/display-image/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/display-text/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/display-text/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/homepage/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/homepage/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-achievements/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-achievements/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-achievements/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-card/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-card/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-card/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-cards/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-cards/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-cards/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-history/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-history/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-history/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-profile/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-profile/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-referral/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-referral/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-referral-tutorial/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-referral-tutorial/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-summary/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-summary/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/member-summary/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/order-history-card/mock-data.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/order-history-card/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/order-history-card/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/order-method/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/order-method/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/props.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/node-configs/schema.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/plugin/formkit-i18n.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/plugin/formkit.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/plugin/i18n.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/router/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/router/shared.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/stores/editor/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/stores/template/index.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/utils/deep-to-raw.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/utils/image.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/utils/provider-keys.d.ts +0 -0
- /package/dist/{merchant → client/merchant}/src/views/views.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as c, computed as n, resolveComponent as s,
|
|
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
|
|
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 {
|
|
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
|
|
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) => (
|
|
20
|
+
return (t, u) => (o(), s("div", f, [
|
|
21
21
|
r("div", i, [
|
|
22
|
-
(
|
|
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,
|
|
2
|
-
import {
|
|
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"],
|
|
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
|
-
|
|
49
|
+
P(" Link with brandkit color ")
|
|
50
50
|
])),
|
|
51
51
|
default: d(() => [
|
|
52
52
|
r("div", L, [
|
|
53
|
-
(y(), C(B, null,
|
|
53
|
+
(y(), C(B, null, F(e, (n) => {
|
|
54
54
|
var g, _;
|
|
55
55
|
return r("div", N, [
|
|
56
56
|
r("div", {
|
|
57
|
-
onClick: (
|
|
58
|
-
class:
|
|
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",
|
|
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",
|
|
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
|
-
}),
|
|
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",
|
|
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",
|
|
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(
|
|
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
|
-
|
|
158
|
+
G as default
|
|
159
159
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as n,
|
|
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) => (
|
|
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
|
}
|