@useinsider/guido 1.0.0-beta.637a8ae → 1.0.0-beta.63d99fe
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/@types/generic.d.ts +4 -5
- package/dist/@types/save-as-template.d.ts +11 -0
- package/dist/components/Guido.vue.d.ts +6 -1
- package/dist/components/Guido.vue.js +11 -11
- package/dist/components/Guido.vue2.js +58 -41
- package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -16
- package/dist/components/organisms/header/RightSlot.vue.js +3 -3
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/header/ViewOptions.vue.js +7 -7
- package/dist/components/organisms/header/ViewOptions.vue2.js +8 -10
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +58 -0
- package/dist/components/wrappers/{BaseModal.vue.d.ts → WpDrawer.vue.d.ts} +27 -40
- package/dist/components/wrappers/WpDrawer.vue.js +25 -0
- package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
- package/dist/composables/useActionsApi.d.ts +0 -2
- package/dist/composables/useActionsApi.js +36 -47
- package/dist/composables/useStripo.js +25 -15
- package/dist/composables/useValidation.d.ts +30 -0
- package/dist/composables/useValidation.js +19 -0
- package/dist/composables/validators/saveAsTemplate.d.ts +26 -0
- package/dist/composables/validators/saveAsTemplate.js +21 -0
- package/dist/enums/defaults.js +6 -10
- package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
- package/dist/guido.css +1 -1
- package/dist/mock/api/template-library.d.ts +2 -0
- package/dist/node_modules/valibot/dist/index.js +157 -0
- package/dist/stores/dynamic-content.d.ts +27 -0
- package/dist/stores/dynamic-content.js +23 -0
- package/dist/stores/editor.d.ts +2 -1
- package/dist/stores/editor.js +5 -4
- package/dist/stores/save-as-template.d.ts +25 -0
- package/dist/stores/save-as-template.js +44 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/genericUtil.d.ts +2 -0
- package/dist/utils/genericUtil.js +7 -0
- package/package.json +2 -1
- package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.d.ts +0 -15
- package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.js +0 -17
- package/dist/components/organisms/email-preview/EmailPreviewContainer.vue2.js +0 -32
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -16
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -19
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -37
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -17
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -57
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -16
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -39
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -15
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -15
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -19
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -19
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -23
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -27
- package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue.d.ts +0 -17
- package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue.js +0 -19
- package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue2.js +0 -26
- package/dist/components/wrappers/BaseModal.vue.js +0 -19
- package/dist/components/wrappers/BaseModal.vue2.js +0 -22
- package/dist/composables/useCodeEditorApi.d.ts +0 -5
- package/dist/composables/useCodeEditorApi.js +0 -17
- package/dist/composables/useDebounce.d.ts +0 -4
- package/dist/composables/useDebounce.js +0 -12
- package/dist/composables/useEmailResponsiveFit.d.ts +0 -5
- package/dist/composables/useEmailResponsiveFit.js +0 -72
- package/dist/composables/usePreviewMode.d.ts +0 -6
- package/dist/composables/usePreviewMode.js +0 -21
- package/dist/enums/gmailMobilePreview.d.ts +0 -7
- package/dist/enums/gmailMobilePreview.js +0 -17
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
- package/dist/stores/preview.d.ts +0 -56
- package/dist/stores/preview.js +0 -23
- /package/dist/components/organisms/{email-preview/amp/AmpToggle.vue.d.ts → save-as-template/SaveAsTemplateDrawer.vue.d.ts} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
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,7 +1,5 @@
|
|
|
1
|
-
import type { CompileEmailOptions } from '@@/Types/stripo';
|
|
2
1
|
import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
|
|
3
2
|
export declare const useActionsApi: () => {
|
|
4
3
|
getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
|
|
5
4
|
activateCustomViewStyles: (isActive?: boolean) => void;
|
|
6
|
-
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
7
5
|
};
|
|
@@ -1,49 +1,38 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
window.StripoEditorApi.actionsApi.activateCustomViewStyles(e);
|
|
37
|
-
}, getPreviewData: async (e) => {
|
|
38
|
-
const t = await i({ minimize: !1, resetDataSavedFlag: !1, ...e });
|
|
39
|
-
return {
|
|
40
|
-
html: t.html,
|
|
41
|
-
AMPHtml: t.AMPHtml ?? "",
|
|
42
|
-
AMPErrors: t.AMPErrors ?? [],
|
|
43
|
-
displayConditions: t.displayConditions
|
|
44
|
-
};
|
|
45
|
-
} };
|
|
46
|
-
};
|
|
1
|
+
const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
|
|
2
|
+
const s = { ...{
|
|
3
|
+
minimize: !0,
|
|
4
|
+
utmEntity: {
|
|
5
|
+
utmSource: "",
|
|
6
|
+
utmMedium: "",
|
|
7
|
+
utmCampaign: "",
|
|
8
|
+
utmContent: "",
|
|
9
|
+
utmTerm: "",
|
|
10
|
+
customUtms: [
|
|
11
|
+
{
|
|
12
|
+
name1: "val1",
|
|
13
|
+
name2: "val2"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
mergeTags: ["Tag1", "Tag2"],
|
|
18
|
+
forseAmp: !1,
|
|
19
|
+
resetDataSavedFlag: !1,
|
|
20
|
+
disableLineHeightsReplace: !0
|
|
21
|
+
}, ...t }, o = {
|
|
22
|
+
callback: (e, m, l, n, c) => {
|
|
23
|
+
e ? a(e) : i({
|
|
24
|
+
html: m,
|
|
25
|
+
ampHtml: l,
|
|
26
|
+
ampErrors: n,
|
|
27
|
+
displayConditions: c
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
...s
|
|
31
|
+
};
|
|
32
|
+
window.StripoEditorApi.actionsApi.compileEmail(o);
|
|
33
|
+
}), activateCustomViewStyles: (t = !0) => {
|
|
34
|
+
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
35
|
+
} });
|
|
47
36
|
export {
|
|
48
|
-
|
|
37
|
+
g as useActionsApi
|
|
49
38
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
2
|
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { displayConditions as
|
|
3
|
+
import { useToaster as S } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as C } from "../enums/displayConditions.js";
|
|
5
5
|
import y from "../extensions/DynamicContent/extension.js";
|
|
6
|
-
import { useStripoApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { useStripoApi as E } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as h } from "../stores/editor.js";
|
|
8
|
+
import { dynamicContentToMergeTags as w } from "../utils/genericUtil.js";
|
|
9
|
+
const M = (d) => {
|
|
10
|
+
const { handleError: a } = S(), { getToken: c, getCustomFonts: u } = E(), l = (e, r = []) => {
|
|
11
|
+
const i = h(), { html: t, css: s, forceRecreate: p } = e;
|
|
11
12
|
window.UIEditor.initEditor(
|
|
12
13
|
document.querySelector("#guido-editor"),
|
|
13
14
|
{
|
|
14
|
-
metadata:
|
|
15
|
+
metadata: d,
|
|
15
16
|
html: t,
|
|
16
17
|
css: s,
|
|
17
|
-
forceRecreate:
|
|
18
|
+
forceRecreate: p,
|
|
18
19
|
locale: "en",
|
|
19
20
|
undoButtonSelector: "#guido__undo-button",
|
|
20
21
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,19 +31,25 @@ const A = (a) => {
|
|
|
30
31
|
`,
|
|
31
32
|
conditionsEnabled: !0,
|
|
32
33
|
customConditionsEnabled: !0,
|
|
33
|
-
conditionCategories:
|
|
34
|
+
conditionCategories: C,
|
|
35
|
+
enableXSSSecurity: !0,
|
|
34
36
|
messageSettingsEnabled: !1,
|
|
35
37
|
editorFonts: {
|
|
36
38
|
showDefaultStandardFonts: !0,
|
|
37
39
|
showDefaultNotStandardFonts: !0,
|
|
38
40
|
customFonts: r
|
|
39
41
|
},
|
|
42
|
+
mergeTags: [
|
|
43
|
+
{
|
|
44
|
+
entries: w(d.preselectedDynamicContentList)
|
|
45
|
+
}
|
|
46
|
+
],
|
|
40
47
|
async onTokenRefreshRequest(o) {
|
|
41
48
|
try {
|
|
42
49
|
const n = await c();
|
|
43
50
|
o(n);
|
|
44
51
|
} catch (n) {
|
|
45
|
-
|
|
52
|
+
a(n, "Failed to refresh token");
|
|
46
53
|
}
|
|
47
54
|
},
|
|
48
55
|
onTemplateLoaded() {
|
|
@@ -50,7 +57,7 @@ const A = (a) => {
|
|
|
50
57
|
const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
|
|
51
58
|
o(), n();
|
|
52
59
|
} catch (o) {
|
|
53
|
-
|
|
60
|
+
a(o, "Failed to load custom interface appearance");
|
|
54
61
|
}
|
|
55
62
|
},
|
|
56
63
|
onCodeEditorVisibilityChanged(o) {
|
|
@@ -62,11 +69,14 @@ const A = (a) => {
|
|
|
62
69
|
onVersionHistoryVisibilityChanged(o) {
|
|
63
70
|
i.isVersionHistoryOpen = o;
|
|
64
71
|
},
|
|
72
|
+
onDataChanged() {
|
|
73
|
+
i.hasChanges = !0;
|
|
74
|
+
},
|
|
65
75
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
66
76
|
extensions: [y]
|
|
67
77
|
}
|
|
68
78
|
);
|
|
69
|
-
},
|
|
79
|
+
}, m = (e) => new Promise((r, i) => {
|
|
70
80
|
if (document.getElementById("UiEditorScript")) {
|
|
71
81
|
e(), r();
|
|
72
82
|
return;
|
|
@@ -80,12 +90,12 @@ const A = (a) => {
|
|
|
80
90
|
}, document.body.appendChild(t);
|
|
81
91
|
});
|
|
82
92
|
return { initPlugin: async (e) => {
|
|
83
|
-
await
|
|
93
|
+
await m(async () => {
|
|
84
94
|
const r = await u();
|
|
85
95
|
l(e, r);
|
|
86
96
|
});
|
|
87
97
|
} };
|
|
88
98
|
};
|
|
89
99
|
export {
|
|
90
|
-
|
|
100
|
+
M as useStripo
|
|
91
101
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|
package/dist/enums/defaults.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
translationsPath: "window.trans.en"
|
|
3
|
-
|
|
4
|
-
senderName: "Default Sender",
|
|
5
|
-
subject: "Default Subject"
|
|
6
|
-
}
|
|
7
|
-
}, t = "newsletter", a = "Guido User";
|
|
1
|
+
const t = {
|
|
2
|
+
translationsPath: "window.trans.en"
|
|
3
|
+
}, e = "newsletter", n = "Guido User";
|
|
8
4
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
t as DefaultGuidoConfig,
|
|
6
|
+
e as DefaultProductType,
|
|
7
|
+
n as DefaultUsername
|
|
12
8
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (i, t, e) =>
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var m = (i, t, e) => t in i ? o(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => m(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { dynamicContentToMergeTags as l } from "../../utils/genericUtil.js";
|
|
4
5
|
import { d as n } from "../../_virtual/index.js";
|
|
5
|
-
import { ExternalMergeTagsLibrary as
|
|
6
|
-
const a = "external-dynamic-content-ui-element",
|
|
7
|
-
class
|
|
6
|
+
import { ExternalMergeTagsLibrary as g } from "./dynamic-content-modal.js";
|
|
7
|
+
const a = "external-dynamic-content-ui-element", c = "button-add-dynamic-content";
|
|
8
|
+
class p extends n.UIElementTagRegistry {
|
|
8
9
|
registerUiElements(t) {
|
|
9
10
|
t[n.UIElementType.MERGETAGS] = a;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
class
|
|
13
|
+
class u extends n.UIElement {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
r(this, "mergeTagsButton", null);
|
|
@@ -33,13 +34,10 @@ class b extends n.UIElement {
|
|
|
33
34
|
this.openMergeTagLibrary();
|
|
34
35
|
}
|
|
35
36
|
openMergeTagLibrary() {
|
|
36
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
37
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new g()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
37
38
|
this.selectedDynamicContent,
|
|
38
39
|
(e) => {
|
|
39
|
-
this.api.onValueChanged(
|
|
40
|
-
label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
|
|
41
|
-
value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
|
|
42
|
-
});
|
|
40
|
+
this.api.onValueChanged(l([e])[0]);
|
|
43
41
|
}
|
|
44
42
|
);
|
|
45
43
|
}
|
|
@@ -49,7 +47,7 @@ class b extends n.UIElement {
|
|
|
49
47
|
<${n.UIElementType.BUTTON}
|
|
50
48
|
id="guido__btn-add-dynamic-content"
|
|
51
49
|
class="btn btn-primary"
|
|
52
|
-
${n.UEAttr.BUTTON.name}="${
|
|
50
|
+
${n.UEAttr.BUTTON.name}="${c}">
|
|
53
51
|
<${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
|
|
54
52
|
</${n.UIElementType.ICON}>
|
|
55
53
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -58,6 +56,6 @@ class b extends n.UIElement {
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
p as DynamicContentTagRegistry,
|
|
60
|
+
u as DynamicContentUiElementExtension
|
|
63
61
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-
|
|
1
|
+
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-ac2711fd],.guido-editor__container[data-v-ac2711fd]{width:100%;height:calc(100vh - 75px)}
|
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
};
|
package/dist/stores/editor.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
2
2
|
isCodeEditorOpen: boolean;
|
|
3
|
+
isSaveAsTemplateDrawerOpen: boolean;
|
|
3
4
|
isVersionHistoryOpen: boolean;
|
|
4
|
-
isPreviewModeOpen: boolean;
|
|
5
5
|
editorVisualMode: string;
|
|
6
|
+
hasChanges: boolean;
|
|
6
7
|
}, {}, {}>;
|
package/dist/stores/editor.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const o = e("editor", {
|
|
3
3
|
state: () => ({
|
|
4
4
|
isCodeEditorOpen: !1,
|
|
5
|
+
isSaveAsTemplateDrawerOpen: !1,
|
|
5
6
|
isVersionHistoryOpen: !1,
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
editorVisualMode: "desktop",
|
|
8
|
+
hasChanges: !1
|
|
8
9
|
})
|
|
9
10
|
});
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
o as useEditorStore
|
|
12
13
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 {};
|