@useinsider/guido 1.0.0-beta.63d99fe → 1.0.0-beta.67efae2
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/README.md +26 -2
- package/dist/@types/generic.d.ts +7 -4
- package/dist/components/Guido.vue.d.ts +1 -6
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +38 -58
- package/dist/components/organisms/header/RightSlot.vue.js +10 -9
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -24
- package/dist/composables/useConfig.d.ts +5 -0
- package/dist/composables/useConfig.js +11 -0
- package/dist/composables/useHtmlCompiler.js +9 -8
- package/dist/composables/useStripo.js +15 -25
- package/dist/composables/useTranslations.js +3 -2
- package/dist/enums/defaults.js +10 -5
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -13
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/stores/editor.d.ts +0 -2
- package/dist/stores/editor.js +3 -5
- package/package.json +1 -2
- package/dist/@types/save-as-template.d.ts +0 -11
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -2
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +0 -20
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +0 -58
- package/dist/components/wrappers/WpDrawer.vue.d.ts +0 -63
- package/dist/components/wrappers/WpDrawer.vue.js +0 -25
- package/dist/components/wrappers/WpDrawer.vue2.js +0 -23
- package/dist/composables/useValidation.d.ts +0 -30
- package/dist/composables/useValidation.js +0 -19
- package/dist/composables/validators/saveAsTemplate.d.ts +0 -26
- package/dist/composables/validators/saveAsTemplate.js +0 -21
- package/dist/mock/api/template-library.d.ts +0 -2
- package/dist/node_modules/valibot/dist/index.js +0 -157
- package/dist/stores/dynamic-content.d.ts +0 -27
- package/dist/stores/dynamic-content.js +0 -23
- package/dist/stores/save-as-template.d.ts +0 -25
- package/dist/stores/save-as-template.js +0 -44
- package/dist/utils/arrayUtil.d.ts +0 -1
- package/dist/utils/arrayUtil.js +0 -10
- package/dist/utils/genericUtil.d.ts +0 -2
- package/dist/utils/genericUtil.js +0 -7
package/dist/stores/editor.d.ts
CHANGED
package/dist/stores/editor.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const t = e("editor", {
|
|
3
3
|
state: () => ({
|
|
4
4
|
isCodeEditorOpen: !1,
|
|
5
|
-
isSaveAsTemplateDrawerOpen: !1,
|
|
6
5
|
isVersionHistoryOpen: !1,
|
|
7
|
-
editorVisualMode: "desktop"
|
|
8
|
-
hasChanges: !1
|
|
6
|
+
editorVisualMode: "desktop"
|
|
9
7
|
})
|
|
10
8
|
});
|
|
11
9
|
export {
|
|
12
|
-
|
|
10
|
+
t as useEditorStore
|
|
13
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.67efae2",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"@vuelidate/validators": "2.0.4",
|
|
36
36
|
"lodash-es": "4.17.21",
|
|
37
37
|
"pinia": "2.3.1",
|
|
38
|
-
"valibot": "1.1.0",
|
|
39
38
|
"vite": "6.3.5",
|
|
40
39
|
"vue": "2.7.14"
|
|
41
40
|
},
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import s from "./SaveAsTemplateDrawer.vue2.js";
|
|
2
|
-
import l from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var r = function() {
|
|
4
|
-
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
5
|
-
return e(t.WpDrawer, { attrs: { id: "save-as-template-modal", "description-status": "", "description-text": t.trans("newsletter.save-template-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.editorStore.isSaveAsTemplateDrawerOpen, "title-text": t.trans("products.save-template") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.saveTemplate } }, [e(t.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", name: "templateName", "character-counter-status": !1, "disabled-status": t.isSaving, "label-text": t.trans("products.template-name"), "placeholder-text": t.trans("newsletter.enter-template-name"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, "state-message": t.templateNameError, states: t.templateNameError ? "error" : "default", "tooltip-status": !1, value: t.saveAsTemplateStore.templateName }, on: { input: t.handleTemplateName } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
|
|
6
|
-
min: 1,
|
|
7
|
-
max: 25
|
|
8
|
-
}), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit": 25, options: t.saveAsTemplateStore.categories, "placeholder-text": t.trans("products.select-template-category"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, value: t.saveAsTemplateStore.selectedCategories }, on: { addOption: t.handleAddOption, change: t.handleCategoryChange, resetAllOptions: t.handleResetAllOptions, selectAllOptions: t.handleSelectAllOptions } })], 1);
|
|
9
|
-
}, o = [], n = /* @__PURE__ */ l(
|
|
10
|
-
s,
|
|
11
|
-
r,
|
|
12
|
-
o,
|
|
13
|
-
!1,
|
|
14
|
-
null,
|
|
15
|
-
null
|
|
16
|
-
);
|
|
17
|
-
const c = n.exports;
|
|
18
|
-
export {
|
|
19
|
-
c as default
|
|
20
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, ref as i, computed as _, toRef as h } from "vue";
|
|
2
|
-
import A from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
-
import { useTranslations as C } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { useTemplateNameValidator as b } from "../../../composables/validators/saveAsTemplate.js";
|
|
5
|
-
import { useEditorStore as w } from "../../../stores/editor.js";
|
|
6
|
-
import { useSaveAsTemplateStore as O } from "../../../stores/save-as-template.js";
|
|
7
|
-
import { InMultiSelect as B, InBasicTextInput as x } from "@useinsider/design-system-vue";
|
|
8
|
-
const z = /* @__PURE__ */ N({
|
|
9
|
-
__name: "SaveAsTemplateDrawer",
|
|
10
|
-
setup(D) {
|
|
11
|
-
const s = C(), o = w(), t = O(), a = i(!1), l = i(!1), u = _(() => ({
|
|
12
|
-
primaryButton: {
|
|
13
|
-
styling: "solid",
|
|
14
|
-
type: "primary",
|
|
15
|
-
labelText: s(a.value ? "newsletter.saving" : "products.save"),
|
|
16
|
-
loadingStatus: a.value,
|
|
17
|
-
disabledStatus: t.skeletonStatus
|
|
18
|
-
},
|
|
19
|
-
cancelOrBackButton: {
|
|
20
|
-
styling: "ghost",
|
|
21
|
-
type: "secondary",
|
|
22
|
-
labelText: s("products.cancel"),
|
|
23
|
-
disabledStatus: a.value
|
|
24
|
-
}
|
|
25
|
-
})), r = i(""), c = b(h(t, "templateName")), n = () => {
|
|
26
|
-
const e = c.validate();
|
|
27
|
-
return r.value = e.errorMessage, e.success;
|
|
28
|
-
}, m = () => {
|
|
29
|
-
o.isSaveAsTemplateDrawerOpen = !1;
|
|
30
|
-
}, d = (e) => {
|
|
31
|
-
t.templateName = e, r.value && n();
|
|
32
|
-
}, f = async (e) => {
|
|
33
|
-
l.value = !0, await t.createCategory(e), l.value = !1;
|
|
34
|
-
}, v = (e) => {
|
|
35
|
-
t.selectedCategories = [...e];
|
|
36
|
-
}, g = (e) => {
|
|
37
|
-
e && (t.selectedCategories = [...e]);
|
|
38
|
-
}, S = () => {
|
|
39
|
-
t.selectedCategories = [];
|
|
40
|
-
}, T = () => {
|
|
41
|
-
if (a.value = !0, !n()) {
|
|
42
|
-
a.value = !1;
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
setTimeout(() => {
|
|
46
|
-
console.debug("💾 Saved", t.getTemplateName), a.value = !1, m();
|
|
47
|
-
}, 3e3);
|
|
48
|
-
}, p = async () => {
|
|
49
|
-
t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1;
|
|
50
|
-
};
|
|
51
|
-
return o.$subscribe((e, { isSaveAsTemplateDrawerOpen: y }) => {
|
|
52
|
-
y && p();
|
|
53
|
-
}), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, isSaving: a, isAddingOption: l, footerButtonGroupOptions: u, templateNameError: r, nameValidator: c, validateTemplateName: n, closeModal: m, handleTemplateName: d, handleAddOption: f, handleCategoryChange: v, handleSelectAllOptions: g, handleResetAllOptions: S, saveTemplate: T, initializeDrawer: p, WpDrawer: A, InBasicTextInput: x, InMultiSelect: B };
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
export {
|
|
57
|
-
z as default
|
|
58
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
|
|
2
|
-
interface Props {
|
|
3
|
-
id: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
size?: string;
|
|
6
|
-
closeOnOutsideClick?: boolean;
|
|
7
|
-
descriptionStatus?: boolean;
|
|
8
|
-
descriptionText?: string;
|
|
9
|
-
footerButtonGroupOptions: FooterButtonGroupOptions;
|
|
10
|
-
status: boolean;
|
|
11
|
-
titleText: string;
|
|
12
|
-
}
|
|
13
|
-
declare var __VLS_12: {};
|
|
14
|
-
type __VLS_Slots = {} & {
|
|
15
|
-
default?: (props: typeof __VLS_12) => any;
|
|
16
|
-
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
18
|
-
className: string;
|
|
19
|
-
size: string;
|
|
20
|
-
closeOnOutsideClick: boolean;
|
|
21
|
-
descriptionStatus: boolean;
|
|
22
|
-
descriptionText: string;
|
|
23
|
-
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
24
|
-
cancelOrBackButtonEvent: () => void;
|
|
25
|
-
onCloseEvent: () => void;
|
|
26
|
-
primaryButtonEvent: () => void;
|
|
27
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
28
|
-
className: string;
|
|
29
|
-
size: string;
|
|
30
|
-
closeOnOutsideClick: boolean;
|
|
31
|
-
descriptionStatus: boolean;
|
|
32
|
-
descriptionText: string;
|
|
33
|
-
}>>>, {
|
|
34
|
-
className: string;
|
|
35
|
-
size: string;
|
|
36
|
-
closeOnOutsideClick: boolean;
|
|
37
|
-
descriptionStatus: boolean;
|
|
38
|
-
descriptionText: string;
|
|
39
|
-
}>;
|
|
40
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
41
|
-
export default _default;
|
|
42
|
-
type __VLS_WithDefaults<P, D> = {
|
|
43
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
44
|
-
default: D[K];
|
|
45
|
-
}> : P[K];
|
|
46
|
-
};
|
|
47
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
48
|
-
type __VLS_TypePropsToOption<T> = {
|
|
49
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
50
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
51
|
-
} : {
|
|
52
|
-
type: import('vue').PropType<T[K]>;
|
|
53
|
-
required: true;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
57
|
-
new (): {
|
|
58
|
-
$scopedSlots: S;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
type __VLS_PrettifyLocal<T> = {
|
|
62
|
-
[K in keyof T]: T[K];
|
|
63
|
-
} & {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import r from "./WpDrawer.vue2.js";
|
|
2
|
-
import s from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var i = function() {
|
|
4
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
5
|
-
return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
|
|
6
|
-
return e.emit("cancelOrBackButtonEvent");
|
|
7
|
-
}, onCloseEvent: function(o) {
|
|
8
|
-
return e.emit("onCloseEvent");
|
|
9
|
-
}, primaryButtonEvent: function(o) {
|
|
10
|
-
return e.emit("primaryButtonEvent");
|
|
11
|
-
} }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
|
|
12
|
-
return [n("div", [t._t("default")], 2)];
|
|
13
|
-
}, proxy: !0 }], null, !0) });
|
|
14
|
-
}, u = [], c = /* @__PURE__ */ s(
|
|
15
|
-
r,
|
|
16
|
-
i,
|
|
17
|
-
u,
|
|
18
|
-
!1,
|
|
19
|
-
null,
|
|
20
|
-
null
|
|
21
|
-
);
|
|
22
|
-
const f = c.exports;
|
|
23
|
-
export {
|
|
24
|
-
f as default
|
|
25
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { defineComponent as e } from "vue";
|
|
2
|
-
import { InDrawer as o } from "@useinsider/design-system-vue";
|
|
3
|
-
const r = /* @__PURE__ */ e({
|
|
4
|
-
__name: "WpDrawer",
|
|
5
|
-
props: {
|
|
6
|
-
id: null,
|
|
7
|
-
className: { default: "" },
|
|
8
|
-
size: { default: "small" },
|
|
9
|
-
closeOnOutsideClick: { type: Boolean, default: !0 },
|
|
10
|
-
descriptionStatus: { type: Boolean, default: !1 },
|
|
11
|
-
descriptionText: { default: "" },
|
|
12
|
-
footerButtonGroupOptions: null,
|
|
13
|
-
status: { type: Boolean },
|
|
14
|
-
titleText: null
|
|
15
|
-
},
|
|
16
|
-
emits: ["cancelOrBackButtonEvent", "onCloseEvent", "primaryButtonEvent"],
|
|
17
|
-
setup(n, { emit: t }) {
|
|
18
|
-
return { __sfc: !0, emit: t, InDrawer: o };
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
export {
|
|
22
|
-
r as default
|
|
23
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type BaseIssue, type BaseSchema } from 'valibot';
|
|
2
|
-
import { type Ref } from 'vue';
|
|
3
|
-
type Base = BaseSchema<unknown, unknown, BaseIssue<unknown>>;
|
|
4
|
-
type MaybeRefOrGetter<T> = T | Ref<T> | (() => T);
|
|
5
|
-
export declare function useValidation<const Schema extends Base = Base>(input: MaybeRefOrGetter<unknown>, schema: Schema): {
|
|
6
|
-
schema: Schema;
|
|
7
|
-
validate: () => {
|
|
8
|
-
error: import("valibot").InferIssue<Schema> | undefined;
|
|
9
|
-
errorMessage: string;
|
|
10
|
-
typed: true;
|
|
11
|
-
success: true;
|
|
12
|
-
output: import("valibot").InferOutput<Schema>;
|
|
13
|
-
issues: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
error: import("valibot").InferIssue<Schema> | undefined;
|
|
16
|
-
errorMessage: string;
|
|
17
|
-
typed: true;
|
|
18
|
-
success: false;
|
|
19
|
-
output: import("valibot").InferOutput<Schema>;
|
|
20
|
-
issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
|
|
21
|
-
} | {
|
|
22
|
-
error: import("valibot").InferIssue<Schema> | undefined;
|
|
23
|
-
errorMessage: string;
|
|
24
|
-
typed: false;
|
|
25
|
-
success: false;
|
|
26
|
-
output: unknown;
|
|
27
|
-
issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { safeParse as i } from "../node_modules/valibot/dist/index.js";
|
|
2
|
-
import { unref as u } from "vue";
|
|
3
|
-
function l(a, e) {
|
|
4
|
-
return {
|
|
5
|
-
schema: e,
|
|
6
|
-
validate: () => {
|
|
7
|
-
var s, t, o;
|
|
8
|
-
const r = i(e, u(a), { abortPipeEarly: !0 });
|
|
9
|
-
return {
|
|
10
|
-
...r,
|
|
11
|
-
error: (s = r.issues) == null ? void 0 : s[0],
|
|
12
|
-
errorMessage: ((o = (t = r.issues) == null ? void 0 : t[0]) == null ? void 0 : o.message) || ""
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
l as useValidation
|
|
19
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'vue';
|
|
2
|
-
export declare const useTemplateNameValidator: (name: Ref<string>) => {
|
|
3
|
-
schema: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, string>, import("valibot").MaxLengthAction<string, 255, string>]>;
|
|
4
|
-
validate: () => {
|
|
5
|
-
error: import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255> | undefined;
|
|
6
|
-
errorMessage: string;
|
|
7
|
-
typed: true;
|
|
8
|
-
success: true;
|
|
9
|
-
output: string;
|
|
10
|
-
issues: undefined;
|
|
11
|
-
} | {
|
|
12
|
-
error: import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255> | undefined;
|
|
13
|
-
errorMessage: string;
|
|
14
|
-
typed: true;
|
|
15
|
-
success: false;
|
|
16
|
-
output: string;
|
|
17
|
-
issues: [import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255>, ...(import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255>)[]];
|
|
18
|
-
} | {
|
|
19
|
-
error: import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255> | undefined;
|
|
20
|
-
errorMessage: string;
|
|
21
|
-
typed: false;
|
|
22
|
-
success: false;
|
|
23
|
-
output: unknown;
|
|
24
|
-
issues: [import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255>, ...(import("valibot").StringIssue | import("valibot").NonEmptyIssue<string> | import("valibot").MaxLengthIssue<string, 255>)[]];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { pipe as r, maxLength as i, nonEmpty as n, string as o } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
-
import { useTranslations as s } from "../useTranslations.js";
|
|
3
|
-
import { useValidation as m } from "../useValidation.js";
|
|
4
|
-
const u = (e) => {
|
|
5
|
-
const t = s(), a = 255;
|
|
6
|
-
return m(e, r(
|
|
7
|
-
o(),
|
|
8
|
-
n(t("whatsapp-business.template-name-required")),
|
|
9
|
-
i(
|
|
10
|
-
a,
|
|
11
|
-
t("validations.enter-up-to-x-characters", {
|
|
12
|
-
article: "a",
|
|
13
|
-
field: t("products.template-name"),
|
|
14
|
-
max: a
|
|
15
|
-
})
|
|
16
|
-
)
|
|
17
|
-
));
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
u as useTemplateNameValidator
|
|
21
|
-
};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
var a;
|
|
2
|
-
// @__NO_SIDE_EFFECTS__
|
|
3
|
-
function f(e) {
|
|
4
|
-
return {
|
|
5
|
-
lang: (e == null ? void 0 : e.lang) ?? (a == null ? void 0 : a.lang),
|
|
6
|
-
message: e == null ? void 0 : e.message,
|
|
7
|
-
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (a == null ? void 0 : a.abortEarly),
|
|
8
|
-
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (a == null ? void 0 : a.abortPipeEarly)
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
var p;
|
|
12
|
-
// @__NO_SIDE_EFFECTS__
|
|
13
|
-
function E(e) {
|
|
14
|
-
return p == null ? void 0 : p.get(e);
|
|
15
|
-
}
|
|
16
|
-
var y;
|
|
17
|
-
// @__NO_SIDE_EFFECTS__
|
|
18
|
-
function k(e) {
|
|
19
|
-
return y == null ? void 0 : y.get(e);
|
|
20
|
-
}
|
|
21
|
-
var m;
|
|
22
|
-
// @__NO_SIDE_EFFECTS__
|
|
23
|
-
function P(e, n) {
|
|
24
|
-
var s;
|
|
25
|
-
return (s = m == null ? void 0 : m.get(e)) == null ? void 0 : s.get(n);
|
|
26
|
-
}
|
|
27
|
-
// @__NO_SIDE_EFFECTS__
|
|
28
|
-
function $(e) {
|
|
29
|
-
var s, r;
|
|
30
|
-
const n = typeof e;
|
|
31
|
-
return n === "string" ? `"${e}"` : n === "number" || n === "bigint" || n === "boolean" ? `${e}` : n === "object" || n === "function" ? (e && ((r = (s = Object.getPrototypeOf(e)) == null ? void 0 : s.constructor) == null ? void 0 : r.name)) ?? "null" : n;
|
|
32
|
-
}
|
|
33
|
-
function c(e, n, s, r, u) {
|
|
34
|
-
const g = u && "input" in u ? u.input : s.value, t = (u == null ? void 0 : u.expected) ?? e.expects ?? null, v = (u == null ? void 0 : u.received) ?? /* @__PURE__ */ $(g), i = {
|
|
35
|
-
kind: e.kind,
|
|
36
|
-
type: e.type,
|
|
37
|
-
input: g,
|
|
38
|
-
expected: t,
|
|
39
|
-
received: v,
|
|
40
|
-
message: `Invalid ${n}: ${t ? `Expected ${t} but r` : "R"}eceived ${v}`,
|
|
41
|
-
requirement: e.requirement,
|
|
42
|
-
path: u == null ? void 0 : u.path,
|
|
43
|
-
issues: u == null ? void 0 : u.issues,
|
|
44
|
-
lang: r.lang,
|
|
45
|
-
abortEarly: r.abortEarly,
|
|
46
|
-
abortPipeEarly: r.abortPipeEarly
|
|
47
|
-
}, b = e.kind === "schema", l = (u == null ? void 0 : u.message) ?? e.message ?? /* @__PURE__ */ P(e.reference, i.lang) ?? (b ? /* @__PURE__ */ k(i.lang) : null) ?? r.message ?? /* @__PURE__ */ E(i.lang);
|
|
48
|
-
l !== void 0 && (i.message = typeof l == "function" ? (
|
|
49
|
-
// @ts-expect-error
|
|
50
|
-
l(i)
|
|
51
|
-
) : l), b && (s.typed = !1), s.issues ? s.issues.push(i) : s.issues = [i];
|
|
52
|
-
}
|
|
53
|
-
// @__NO_SIDE_EFFECTS__
|
|
54
|
-
function d(e) {
|
|
55
|
-
return {
|
|
56
|
-
version: 1,
|
|
57
|
-
vendor: "valibot",
|
|
58
|
-
validate(n) {
|
|
59
|
-
return e["~run"]({ value: n }, /* @__PURE__ */ f());
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
// @__NO_SIDE_EFFECTS__
|
|
64
|
-
function _(e, n) {
|
|
65
|
-
return {
|
|
66
|
-
kind: "validation",
|
|
67
|
-
type: "max_length",
|
|
68
|
-
reference: _,
|
|
69
|
-
async: !1,
|
|
70
|
-
expects: `<=${e}`,
|
|
71
|
-
requirement: e,
|
|
72
|
-
message: n,
|
|
73
|
-
"~run"(s, r) {
|
|
74
|
-
return s.typed && s.value.length > this.requirement && c(this, "length", s, r, {
|
|
75
|
-
received: `${s.value.length}`
|
|
76
|
-
}), s;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
// @__NO_SIDE_EFFECTS__
|
|
81
|
-
function x(e) {
|
|
82
|
-
return {
|
|
83
|
-
kind: "validation",
|
|
84
|
-
type: "non_empty",
|
|
85
|
-
reference: x,
|
|
86
|
-
async: !1,
|
|
87
|
-
expects: "!0",
|
|
88
|
-
message: e,
|
|
89
|
-
"~run"(n, s) {
|
|
90
|
-
return n.typed && n.value.length === 0 && c(this, "length", n, s, {
|
|
91
|
-
received: "0"
|
|
92
|
-
}), n;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
// @__NO_SIDE_EFFECTS__
|
|
97
|
-
function S(e) {
|
|
98
|
-
return {
|
|
99
|
-
kind: "schema",
|
|
100
|
-
type: "string",
|
|
101
|
-
reference: S,
|
|
102
|
-
expects: "string",
|
|
103
|
-
async: !1,
|
|
104
|
-
message: e,
|
|
105
|
-
get "~standard"() {
|
|
106
|
-
return /* @__PURE__ */ d(this);
|
|
107
|
-
},
|
|
108
|
-
"~run"(n, s) {
|
|
109
|
-
return typeof n.value == "string" ? n.typed = !0 : c(this, "type", n, s), n;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
// @__NO_SIDE_EFFECTS__
|
|
114
|
-
function M(...e) {
|
|
115
|
-
return {
|
|
116
|
-
...e[0],
|
|
117
|
-
pipe: e,
|
|
118
|
-
get "~standard"() {
|
|
119
|
-
return /* @__PURE__ */ d(this);
|
|
120
|
-
},
|
|
121
|
-
"~run"(n, s) {
|
|
122
|
-
for (const r of e)
|
|
123
|
-
if (r.kind !== "metadata") {
|
|
124
|
-
if (n.issues && (r.kind === "schema" || r.kind === "transformation")) {
|
|
125
|
-
n.typed = !1;
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
(!n.issues || !s.abortEarly && !s.abortPipeEarly) && (n = r["~run"](n, s));
|
|
129
|
-
}
|
|
130
|
-
return n;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
// @__NO_SIDE_EFFECTS__
|
|
135
|
-
function j(e, n, s) {
|
|
136
|
-
const r = e["~run"]({ value: n }, /* @__PURE__ */ f(s));
|
|
137
|
-
return {
|
|
138
|
-
typed: r.typed,
|
|
139
|
-
success: !r.issues,
|
|
140
|
-
output: r.value,
|
|
141
|
-
issues: r.issues
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
export {
|
|
145
|
-
c as _addIssue,
|
|
146
|
-
d as _getStandardProps,
|
|
147
|
-
$ as _stringify,
|
|
148
|
-
f as getGlobalConfig,
|
|
149
|
-
E as getGlobalMessage,
|
|
150
|
-
k as getSchemaMessage,
|
|
151
|
-
P as getSpecificMessage,
|
|
152
|
-
_ as maxLength,
|
|
153
|
-
x as nonEmpty,
|
|
154
|
-
M as pipe,
|
|
155
|
-
j as safeParse,
|
|
156
|
-
S as string
|
|
157
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dynamicContent", {
|
|
3
|
-
selectedDynamicContent: DynamicContent;
|
|
4
|
-
selectedDynamicContentList: DynamicContent[];
|
|
5
|
-
}, {
|
|
6
|
-
getSelectedDynamicContentList: (state: {
|
|
7
|
-
selectedDynamicContent: {
|
|
8
|
-
value: string;
|
|
9
|
-
text: string;
|
|
10
|
-
fallback?: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
selectedDynamicContentList: {
|
|
13
|
-
value: string;
|
|
14
|
-
text: string;
|
|
15
|
-
fallback?: string | undefined;
|
|
16
|
-
}[];
|
|
17
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
|
18
|
-
selectedDynamicContent: DynamicContent;
|
|
19
|
-
selectedDynamicContentList: DynamicContent[];
|
|
20
|
-
}>) => {
|
|
21
|
-
text: string;
|
|
22
|
-
value: string;
|
|
23
|
-
fallback: string | undefined;
|
|
24
|
-
}[];
|
|
25
|
-
}, {
|
|
26
|
-
setSelectedDynamicContent(dynamicContent: DynamicContent): void;
|
|
27
|
-
}>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
|
|
2
|
-
import { defineStore as a } from "pinia";
|
|
3
|
-
const s = a("dynamicContent", {
|
|
4
|
-
state: () => ({
|
|
5
|
-
selectedDynamicContent: { text: "", value: "", fallback: "" },
|
|
6
|
-
selectedDynamicContentList: []
|
|
7
|
-
}),
|
|
8
|
-
actions: {
|
|
9
|
-
setSelectedDynamicContent(e) {
|
|
10
|
-
this.selectedDynamicContent = e, this.selectedDynamicContentList.push(e);
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
getters: {
|
|
14
|
-
getSelectedDynamicContentList: (e) => n(e.selectedDynamicContentList).map((t) => ({
|
|
15
|
-
text: t.text,
|
|
16
|
-
value: t.value,
|
|
17
|
-
fallback: t.fallback
|
|
18
|
-
})) || []
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
export {
|
|
22
|
-
s as useDynamicContentStore
|
|
23
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { MappedCategory } from '@@/Types/save-as-template';
|
|
2
|
-
interface StoreState {
|
|
3
|
-
templateName: string;
|
|
4
|
-
categories: MappedCategory[];
|
|
5
|
-
selectedCategories: MappedCategory[];
|
|
6
|
-
skeletonStatus: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"saveAsTemplate", StoreState, {
|
|
9
|
-
getTemplateName: (state: {
|
|
10
|
-
templateName: string;
|
|
11
|
-
categories: {
|
|
12
|
-
value: string;
|
|
13
|
-
text: string;
|
|
14
|
-
}[];
|
|
15
|
-
selectedCategories: {
|
|
16
|
-
value: string;
|
|
17
|
-
text: string;
|
|
18
|
-
}[];
|
|
19
|
-
skeletonStatus: boolean;
|
|
20
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => string;
|
|
21
|
-
}, {
|
|
22
|
-
fetchCategories(): Promise<void>;
|
|
23
|
-
createCategory(category: string): Promise<void>;
|
|
24
|
-
}>;
|
|
25
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useHttp as s } from "../composables/useHttp.js";
|
|
2
|
-
import { useToaster as o } from "../composables/useToaster.js";
|
|
3
|
-
import { defineStore as i } from "pinia";
|
|
4
|
-
const c = () => ({
|
|
5
|
-
templateName: "",
|
|
6
|
-
categories: [],
|
|
7
|
-
selectedCategories: [],
|
|
8
|
-
skeletonStatus: !0
|
|
9
|
-
}), { get: l, post: m } = s(), { handleError: r } = o(), d = i("saveAsTemplate", {
|
|
10
|
-
state: () => c(),
|
|
11
|
-
getters: {
|
|
12
|
-
getTemplateName: (e) => e.templateName.trim()
|
|
13
|
-
},
|
|
14
|
-
actions: {
|
|
15
|
-
async fetchCategories() {
|
|
16
|
-
try {
|
|
17
|
-
const { data: e = [] } = await l("/newsletter/template-library/get-template-categories");
|
|
18
|
-
this.categories = e.map((t) => ({
|
|
19
|
-
value: t.id.toString(),
|
|
20
|
-
text: t.name
|
|
21
|
-
}));
|
|
22
|
-
} catch (e) {
|
|
23
|
-
r(e, "Failed to fetch template categories");
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
async createCategory(e) {
|
|
27
|
-
try {
|
|
28
|
-
const { data: { id: t } } = await m(
|
|
29
|
-
"/newsletter/template-library/create-category",
|
|
30
|
-
{ category: e }
|
|
31
|
-
), a = {
|
|
32
|
-
value: t.toString(),
|
|
33
|
-
text: e
|
|
34
|
-
};
|
|
35
|
-
this.categories.push(a), this.selectedCategories.push(a);
|
|
36
|
-
} catch (t) {
|
|
37
|
-
r(t, "Failed to create category");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
export {
|
|
43
|
-
d as useSaveAsTemplateStore
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const removeDuplicatesFromArray: <T>(arr?: T[]) => T[];
|