@useinsider/guido 1.0.0-beta.35d2ac4 → 1.0.0-beta.3bcd23c
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 +24 -384
- package/dist/@types/generic.d.ts +0 -8
- package/dist/components/Guido.vue.d.ts +3 -13
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +34 -63
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +8 -10
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -17
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +14 -28
- package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
- package/dist/composables/useActionsApi.d.ts +0 -2
- package/dist/composables/useActionsApi.js +36 -47
- package/dist/composables/useExport.d.ts +1 -1
- package/dist/composables/useExport.js +20 -35
- package/dist/composables/useStripo.js +14 -15
- package/dist/composables/useTemplates.d.ts +5 -0
- package/dist/composables/useTemplates.js +27 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +13 -13
- package/dist/extensions/DynamicContent/dynamic-content.js +10 -10
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.d.ts +1 -2
- package/dist/services/stripoApi.js +7 -27
- package/dist/static/templates/default/index.html.js +5 -0
- package/dist/static/templates/default/style.css.js +119 -0
- package/dist/stores/editor.d.ts +0 -4
- package/dist/stores/editor.js +3 -7
- package/package.json +2 -2
- package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +0 -16
- package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +0 -21
- package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +0 -30
- package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +0 -16
- package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
- package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -43
- package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +0 -16
- package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
- package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -33
- package/dist/components/organisms/design-preview/EmailView.vue.d.ts +0 -18
- package/dist/components/organisms/design-preview/EmailView.vue.js +0 -19
- package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
- package/dist/components/organisms/design-preview/InboxView.vue.d.ts +0 -17
- package/dist/components/organisms/design-preview/InboxView.vue.js +0 -19
- package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
- package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +0 -17
- package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
- package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -23
- package/dist/components/organisms/header/AmpToggle.vue.d.ts +0 -2
- package/dist/components/organisms/header/AmpToggle.vue.js +0 -17
- package/dist/components/organisms/header/AmpToggle.vue2.js +0 -48
- package/dist/composables/useDebounce.d.ts +0 -4
- package/dist/composables/useDebounce.js +0 -12
- package/dist/composables/useGuidoActions.d.ts +0 -46
- package/dist/composables/useGuidoActions.js +0 -37
- package/dist/composables/useHtmlCompiler.d.ts +0 -4
- package/dist/composables/useHtmlCompiler.js +0 -16
- package/dist/composables/useMobileGmailFit.d.ts +0 -5
- package/dist/composables/useMobileGmailFit.js +0 -69
- package/dist/composables/useProvideInject.d.ts +0 -14
- package/dist/composables/useProvideInject.js +0 -17
- package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
- package/dist/config/compiler/htmlCompilerRules.js +0 -145
- package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
- package/dist/enums/emailPreview.d.ts +0 -3
- package/dist/enums/emailPreview.js +0 -6
- package/dist/enums/gmailMobilePreview.d.ts +0 -7
- package/dist/enums/gmailMobilePreview.js +0 -17
- package/dist/inbox-mockup.svg +0 -39
- package/dist/mock/api/default-template.d.ts +0 -2
- package/dist/phone-mockup.svg +0 -31
- package/dist/utils/htmlCompiler.d.ts +0 -12
- package/dist/utils/htmlCompiler.js +0 -70
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const c = /* @__PURE__ */ r({
|
|
1
|
+
import { defineComponent as t } from "vue";
|
|
2
|
+
import { useEditorStore as o } from "../../../stores/editor.js";
|
|
3
|
+
import { InButtonV2 as r } from "@useinsider/design-system-vue";
|
|
4
|
+
import e from "./version-history/RestoreButton.vue.js";
|
|
5
|
+
const _ = /* @__PURE__ */ t({
|
|
7
6
|
__name: "LeftSlot",
|
|
8
|
-
setup(
|
|
9
|
-
|
|
10
|
-
return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
|
|
7
|
+
setup(m) {
|
|
8
|
+
return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
|
|
11
9
|
}
|
|
12
10
|
});
|
|
13
11
|
export {
|
|
14
|
-
|
|
12
|
+
_ as default
|
|
15
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import s from "./MiddleSlot.vue2.js";
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
|
-
var
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ?
|
|
4
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
5
|
+
return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
|
|
6
6
|
}, l = [], r = /* @__PURE__ */ i(
|
|
7
7
|
s,
|
|
8
8
|
n,
|
|
@@ -11,7 +11,7 @@ var n = function() {
|
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const p = r.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
p as default
|
|
17
17
|
};
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { useEditorStore as
|
|
4
|
-
import { InButtonV2 as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
const T = /* @__PURE__ */ s({
|
|
1
|
+
import { defineComponent as r } from "vue";
|
|
2
|
+
import { useTranslations as s } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useEditorStore as n } from "../../../stores/editor.js";
|
|
4
|
+
import { InButtonV2 as e } from "@useinsider/design-system-vue";
|
|
5
|
+
import m from "./version-history/VersionHistory.vue.js";
|
|
6
|
+
import p from "./version-history/ViewOptions.vue.js";
|
|
7
|
+
import f from "./ViewOptions.vue.js";
|
|
8
|
+
const y = /* @__PURE__ */ r({
|
|
10
9
|
__name: "MiddleSlot",
|
|
11
|
-
setup(
|
|
12
|
-
const o =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return { __sfc: !0, editorStore: o, trans: t, handlePreviewClick: e, isPreviewModeOpen: i, getTooltipOptions: (r) => ({
|
|
16
|
-
id: `${r}-tooltip`,
|
|
10
|
+
setup(a) {
|
|
11
|
+
const o = n(), t = s();
|
|
12
|
+
return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
|
|
13
|
+
id: `${i}-tooltip`,
|
|
17
14
|
dynamicPosition: !1,
|
|
18
15
|
staticPosition: "bottom center",
|
|
19
16
|
iconStatus: !1
|
|
20
|
-
}), InButtonV2:
|
|
17
|
+
}), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
|
|
21
18
|
}
|
|
22
19
|
});
|
|
23
20
|
export {
|
|
24
|
-
|
|
21
|
+
y as default
|
|
25
22
|
};
|
|
@@ -2,7 +2,7 @@ import o from "./RightSlot.vue2.js";
|
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
4
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
5
|
-
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "
|
|
5
|
+
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
|
|
6
6
|
}, r = [], a = /* @__PURE__ */ i(
|
|
7
7
|
o,
|
|
8
8
|
n,
|
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { InButtonV2 as S } from "@useinsider/design-system-vue";
|
|
8
|
-
const E = /* @__PURE__ */ m({
|
|
1
|
+
import { defineComponent as s } from "vue";
|
|
2
|
+
import { useExport as i } from "../../../composables/useExport.js";
|
|
3
|
+
import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
|
|
4
|
+
import { useEditorStore as p } from "../../../stores/editor.js";
|
|
5
|
+
import { InButtonV2 as m } from "@useinsider/design-system-vue";
|
|
6
|
+
const d = /* @__PURE__ */ s({
|
|
9
7
|
__name: "RightSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const { exportHtml:
|
|
12
|
-
return { __sfc: !0, exportHtml:
|
|
13
|
-
if (
|
|
14
|
-
|
|
8
|
+
setup(f) {
|
|
9
|
+
const { exportHtml: e } = i(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
|
|
10
|
+
return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
|
|
11
|
+
if (t.isVersionHistoryOpen) {
|
|
12
|
+
r();
|
|
15
13
|
return;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
e();
|
|
20
|
-
try {
|
|
21
|
-
const { html: o } = await t();
|
|
22
|
-
r({
|
|
23
|
-
html: o || "",
|
|
24
|
-
css: ""
|
|
25
|
-
// CSS is embedded in HTML from Stripo
|
|
26
|
-
});
|
|
27
|
-
} catch (o) {
|
|
28
|
-
console.error("Failed to get template data for save:", o);
|
|
29
|
-
}
|
|
30
|
-
}, InButtonV2: S };
|
|
15
|
+
o();
|
|
16
|
+
}, InButtonV2: m };
|
|
31
17
|
}
|
|
32
18
|
});
|
|
33
19
|
export {
|
|
34
|
-
|
|
20
|
+
d as default
|
|
35
21
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import r from "./ViewOptions.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
5
|
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
6
|
-
return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "",
|
|
7
|
-
},
|
|
6
|
+
return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
|
|
7
|
+
}, i = [], _ = /* @__PURE__ */ s(
|
|
8
8
|
r,
|
|
9
|
-
s,
|
|
10
9
|
n,
|
|
10
|
+
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"0fff376c"
|
|
14
14
|
);
|
|
15
15
|
const l = _.exports;
|
|
16
16
|
export {
|
|
@@ -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 a({ minimize: !1, resetDataSavedFlag: !1, ...e });
|
|
39
|
-
return {
|
|
40
|
-
html: t.html,
|
|
41
|
-
ampHtml: t.ampHtml ?? "",
|
|
42
|
-
ampErrors: t.ampErrors ?? null,
|
|
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,45 +1,30 @@
|
|
|
1
1
|
import { useActionsApi as l } from "./useActionsApi.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
|
|
2
|
+
import { useToaster as m } from "./useToaster.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const a = (r, t, e) => {
|
|
5
|
+
const n = new Blob([r], { type: e }), s = URL.createObjectURL(n), o = document.createElement("a");
|
|
6
|
+
o.href = s, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(s);
|
|
7
|
+
}, c = (r) => {
|
|
8
|
+
const t = /* @__PURE__ */ new Date(), e = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), s = t.getFullYear(), o = String(t.getHours()).padStart(2, "0"), i = String(t.getMinutes()).padStart(2, "0");
|
|
9
|
+
return `${r}_${e}-${n}-${s}_${o}-${i}.html`;
|
|
11
10
|
};
|
|
12
|
-
return { exportHtml: async (
|
|
13
|
-
const { getCompiledEmail:
|
|
11
|
+
return { exportHtml: async () => {
|
|
12
|
+
const { getCompiledEmail: r } = l(), { showToaster: t } = m();
|
|
14
13
|
try {
|
|
15
|
-
const { html:
|
|
16
|
-
|
|
17
|
-
let e = t;
|
|
18
|
-
if (s) {
|
|
19
|
-
const n = i(t);
|
|
20
|
-
e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
|
|
21
|
-
originalSize: n.stats.originalSize,
|
|
22
|
-
compiledSize: n.stats.compiledSize,
|
|
23
|
-
reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
|
|
24
|
-
appliedRules: n.appliedRules,
|
|
25
|
-
executionTime: `${n.stats.executionTime.toFixed(2)}ms`
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
a(e, c("HTML"), "text/html");
|
|
29
|
-
} else
|
|
30
|
-
r({
|
|
31
|
-
type: "error",
|
|
32
|
-
message: "No HTML content to download"
|
|
33
|
-
});
|
|
34
|
-
} catch (t) {
|
|
35
|
-
const e = t instanceof Error ? t.message : String(t);
|
|
36
|
-
r({
|
|
14
|
+
const { html: e } = await r();
|
|
15
|
+
e ? a(e, c("HTML"), "text/html") : t({
|
|
37
16
|
type: "error",
|
|
38
|
-
message:
|
|
17
|
+
message: "No HTML content to download"
|
|
18
|
+
});
|
|
19
|
+
} catch (e) {
|
|
20
|
+
const n = e instanceof Error ? e.message : String(e);
|
|
21
|
+
t({
|
|
22
|
+
type: "error",
|
|
23
|
+
message: `Error compiling email: ${n}`
|
|
39
24
|
});
|
|
40
25
|
}
|
|
41
26
|
} };
|
|
42
27
|
};
|
|
43
28
|
export {
|
|
44
|
-
|
|
29
|
+
u as useExport
|
|
45
30
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useCustomInterfaceAppearance as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { displayConditions as
|
|
5
|
-
import
|
|
6
|
-
import { useStripoApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
const
|
|
9
|
-
const { handleError: d } =
|
|
10
|
-
const i =
|
|
1
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
2
|
+
import { useCustomInterfaceAppearance as g } from "./useCustomInterfaceAppearance.js";
|
|
3
|
+
import { useToaster as f } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as E } from "../enums/displayConditions.js";
|
|
5
|
+
import S from "../extensions/DynamicContent/extension.js";
|
|
6
|
+
import { useStripoApi as y } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
8
|
+
const x = (a) => {
|
|
9
|
+
const { handleError: d } = f(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
|
|
10
|
+
const i = C(), { html: t, css: s } = e;
|
|
11
11
|
window.UIEditor.initEditor(
|
|
12
12
|
document.querySelector("#guido-editor"),
|
|
13
13
|
{
|
|
14
14
|
metadata: a,
|
|
15
15
|
html: t,
|
|
16
16
|
css: s,
|
|
17
|
-
forceRecreate: m,
|
|
18
17
|
locale: "en",
|
|
19
18
|
undoButtonSelector: "#guido__undo-button",
|
|
20
19
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,7 +29,7 @@ const A = (a) => {
|
|
|
30
29
|
`,
|
|
31
30
|
conditionsEnabled: !0,
|
|
32
31
|
customConditionsEnabled: !0,
|
|
33
|
-
conditionCategories:
|
|
32
|
+
conditionCategories: E,
|
|
34
33
|
messageSettingsEnabled: !1,
|
|
35
34
|
editorFonts: {
|
|
36
35
|
showDefaultStandardFonts: !0,
|
|
@@ -47,7 +46,7 @@ const A = (a) => {
|
|
|
47
46
|
},
|
|
48
47
|
onTemplateLoaded() {
|
|
49
48
|
try {
|
|
50
|
-
const { importCss: o } =
|
|
49
|
+
const { importCss: o } = g(), { activateCustomViewStyles: n } = m();
|
|
51
50
|
o(), n();
|
|
52
51
|
} catch (o) {
|
|
53
52
|
d(o, "Failed to load custom interface appearance");
|
|
@@ -63,7 +62,7 @@ const A = (a) => {
|
|
|
63
62
|
i.isVersionHistoryOpen = o;
|
|
64
63
|
},
|
|
65
64
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
66
|
-
extensions: [
|
|
65
|
+
extensions: [S]
|
|
67
66
|
}
|
|
68
67
|
);
|
|
69
68
|
}, p = (e) => new Promise((r, i) => {
|
|
@@ -87,5 +86,5 @@ const A = (a) => {
|
|
|
87
86
|
} };
|
|
88
87
|
};
|
|
89
88
|
export {
|
|
90
|
-
|
|
89
|
+
x as useStripo
|
|
91
90
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const s = () => {
|
|
2
|
+
const t = async () => {
|
|
3
|
+
const [e, a] = await Promise.all([
|
|
4
|
+
// eslint-disable-next-line import/extensions
|
|
5
|
+
import("../static/templates/default/index.html.js"),
|
|
6
|
+
import("../static/templates/default/style.css.js")
|
|
7
|
+
]);
|
|
8
|
+
return {
|
|
9
|
+
html: e.default,
|
|
10
|
+
css: a.default
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
getDefaultTemplate: t,
|
|
15
|
+
getTemplate: async (e) => {
|
|
16
|
+
switch (e) {
|
|
17
|
+
case "default":
|
|
18
|
+
return t();
|
|
19
|
+
default:
|
|
20
|
+
return t();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
s as useTemplates
|
|
27
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
|
-
var d = (
|
|
3
|
-
var a = (
|
|
4
|
-
class
|
|
2
|
+
var d = (e, t, n) => t in e ? i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var a = (e, t, n) => d(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
class u {
|
|
5
5
|
constructor() {
|
|
6
6
|
a(this, "selectedDynamicContent", null);
|
|
7
7
|
a(this, "dataSelectCallback", () => {
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
openMergeTagsLibrary(
|
|
11
|
-
this.dataSelectCallback = n, this.selectedDynamicContent =
|
|
12
|
-
const
|
|
10
|
+
openMergeTagsLibrary(t, n) {
|
|
11
|
+
this.dataSelectCallback = n, this.selectedDynamicContent = t;
|
|
12
|
+
const o = new CustomEvent("dynamic-content:open", {
|
|
13
13
|
detail: {
|
|
14
|
-
attribute:
|
|
14
|
+
attribute: t
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
document.dispatchEvent(
|
|
18
|
-
const
|
|
19
|
-
const c =
|
|
20
|
-
this.selectedDynamicContent = c
|
|
17
|
+
document.dispatchEvent(o);
|
|
18
|
+
const l = (s) => {
|
|
19
|
+
const c = s.detail;
|
|
20
|
+
this.selectedDynamicContent = c || null, c && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", l);
|
|
21
21
|
};
|
|
22
|
-
document.addEventListener("dynamic-content:close",
|
|
22
|
+
document.addEventListener("dynamic-content:close", l);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
u as ExternalMergeTagsLibrary
|
|
27
27
|
};
|
|
@@ -2,14 +2,14 @@ var l = Object.defineProperty;
|
|
|
2
2
|
var o = (i, t, e) => t in i ? l(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var r = (i, t, e) => o(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { d as n } from "../../_virtual/index.js";
|
|
5
|
-
import { ExternalMergeTagsLibrary as
|
|
6
|
-
const a = "external-dynamic-content-ui-element",
|
|
7
|
-
class
|
|
5
|
+
import { ExternalMergeTagsLibrary as m } from "./dynamic-content-modal.js";
|
|
6
|
+
const a = "external-dynamic-content-ui-element", g = "button-add-dynamic-content";
|
|
7
|
+
class y extends n.UIElementTagRegistry {
|
|
8
8
|
registerUiElements(t) {
|
|
9
9
|
t[n.UIElementType.MERGETAGS] = a;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class E extends n.UIElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
r(this, "mergeTagsButton", null);
|
|
@@ -33,12 +33,12 @@ class b extends n.UIElement {
|
|
|
33
33
|
this.openMergeTagLibrary();
|
|
34
34
|
}
|
|
35
35
|
openMergeTagLibrary() {
|
|
36
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
36
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new m()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
37
37
|
this.selectedDynamicContent,
|
|
38
38
|
(e) => {
|
|
39
39
|
this.api.onValueChanged({
|
|
40
|
-
label: e.
|
|
41
|
-
value: e.
|
|
40
|
+
label: e.text,
|
|
41
|
+
value: e.value
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
);
|
|
@@ -49,7 +49,7 @@ class b extends n.UIElement {
|
|
|
49
49
|
<${n.UIElementType.BUTTON}
|
|
50
50
|
id="guido__btn-add-dynamic-content"
|
|
51
51
|
class="btn btn-primary"
|
|
52
|
-
${n.UEAttr.BUTTON.name}="${
|
|
52
|
+
${n.UEAttr.BUTTON.name}="${g}">
|
|
53
53
|
<${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
|
|
54
54
|
</${n.UIElementType.ICON}>
|
|
55
55
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -58,6 +58,6 @@ class b extends n.UIElement {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
y as DynamicContentTagRegistry,
|
|
62
|
+
E as DynamicContentUiElementExtension
|
|
63
63
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +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-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-67f97212],.guido-editor__container[data-v-67f97212]{width:100%;height:calc(100vh - 75px)}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { CustomFont
|
|
1
|
+
import type { CustomFont } from '@@/Types/stripo';
|
|
2
2
|
export declare const useStripoApi: () => {
|
|
3
3
|
getToken: () => Promise<string>;
|
|
4
4
|
getCustomFonts: () => Promise<(CustomFont & {
|
|
5
5
|
active: boolean;
|
|
6
6
|
})[]>;
|
|
7
|
-
getDefaultTemplate: () => Promise<Template>;
|
|
8
7
|
};
|
|
@@ -1,45 +1,25 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
1
|
+
import { useHttp as s } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as n } from "../composables/useToaster.js";
|
|
3
3
|
const m = () => {
|
|
4
|
-
const { get:
|
|
4
|
+
const { get: o } = s(), { handleError: r } = n();
|
|
5
5
|
return {
|
|
6
6
|
getToken: async () => {
|
|
7
7
|
try {
|
|
8
|
-
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await
|
|
8
|
+
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await o(`/stripo/get-user-token?test=${t}`);
|
|
9
9
|
return e.body.token;
|
|
10
10
|
} catch (t) {
|
|
11
|
-
return
|
|
11
|
+
return r(t, "Failed to fetch token"), "";
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
getCustomFonts: async () => {
|
|
15
15
|
try {
|
|
16
|
-
const { data: t = [] } = await
|
|
16
|
+
const { data: t = [] } = await o("/stripo/get-partner-custom-fonts");
|
|
17
17
|
return t.map((e) => ({
|
|
18
18
|
...e,
|
|
19
19
|
active: !0
|
|
20
20
|
}));
|
|
21
21
|
} catch (t) {
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
getDefaultTemplate: async () => {
|
|
26
|
-
const t = {
|
|
27
|
-
html: "",
|
|
28
|
-
css: "",
|
|
29
|
-
forceRecreate: !0
|
|
30
|
-
};
|
|
31
|
-
try {
|
|
32
|
-
const { data: e } = await r("/stripo/default-template");
|
|
33
|
-
try {
|
|
34
|
-
return {
|
|
35
|
-
...JSON.parse(e),
|
|
36
|
-
forceRecreate: !0
|
|
37
|
-
};
|
|
38
|
-
} catch {
|
|
39
|
-
return t;
|
|
40
|
-
}
|
|
41
|
-
} catch (e) {
|
|
42
|
-
return o(e, "Failed to fetch default template"), t;
|
|
22
|
+
return r(t, "Failed to fetch custom fonts"), [];
|
|
43
23
|
}
|
|
44
24
|
}
|
|
45
25
|
};
|