@useinsider/guido 1.0.0-beta.e8ee5f5 → 1.0.0-beta.eb2a99e
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 +2 -26
- package/dist/@types/generic.d.ts +0 -33
- package/dist/components/Guido.vue.d.ts +3 -6
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +38 -60
- package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
- package/dist/components/organisms/header/MiddleSlot.vue2.js +17 -16
- package/dist/components/organisms/header/RightSlot.vue.js +8 -9
- package/dist/components/organisms/header/RightSlot.vue2.js +25 -27
- package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
- package/dist/components/organisms/header/ViewOptions.vue2.js +10 -30
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +16 -34
- package/dist/composables/useActionsApi.d.ts +1 -4
- package/dist/composables/useActionsApi.js +33 -74
- package/dist/composables/useExport.js +9 -10
- package/dist/composables/useGuidoActions.d.ts +2 -2
- package/dist/composables/useHtmlCompiler.js +8 -9
- package/dist/composables/useHttp.js +21 -23
- package/dist/composables/usePartner.d.ts +1 -1
- package/dist/composables/usePartner.js +14 -9
- package/dist/composables/useStripo.js +15 -25
- package/dist/composables/useToaster.d.ts +16 -1
- package/dist/composables/useToaster.js +30 -24
- package/dist/composables/useTranslations.js +2 -3
- package/dist/composables/useVersionHistoryApi.js +10 -11
- package/dist/enums/defaults.d.ts +1 -4
- package/dist/enums/defaults.js +6 -21
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -13
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -2
- package/dist/node_modules/lodash-es/_isMasked.js +2 -2
- package/dist/stores/editor.d.ts +0 -3
- package/dist/stores/editor.js +3 -6
- package/package.json +3 -3
- package/dist/@types/save-as-template.d.ts +0 -29
- package/dist/components/organisms/base/Toaster.vue.d.ts +0 -2
- package/dist/components/organisms/base/Toaster.vue.js +0 -17
- package/dist/components/organisms/base/Toaster.vue2.js +0 -15
- package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +0 -2
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +0 -19
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +0 -19
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -4
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -22
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -30
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -2
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -19
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -29
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -2
- 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 -31
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -2
- 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 -20
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -2
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -18
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -25
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -4
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +0 -19
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +0 -23
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -4
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -20
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -21
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -2
- 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 -22
- 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 -63
- 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/components/wrappers/WpModal.vue.d.ts +0 -65
- package/dist/components/wrappers/WpModal.vue.js +0 -27
- package/dist/components/wrappers/WpModal.vue2.js +0 -22
- package/dist/composables/useCodeEditorApi.d.ts +0 -4
- package/dist/composables/useCodeEditorApi.js +0 -11
- package/dist/composables/useConfig.d.ts +0 -4
- package/dist/composables/useConfig.js +0 -7
- package/dist/composables/useDebounce.d.ts +0 -4
- package/dist/composables/useDebounce.js +0 -12
- package/dist/composables/usePreviewMode.d.ts +0 -5
- package/dist/composables/usePreviewMode.js +0 -31
- package/dist/composables/useResponsivePreview.d.ts +0 -5
- package/dist/composables/useResponsivePreview.js +0 -86
- package/dist/composables/useValidation.d.ts +0 -56
- package/dist/composables/useValidation.js +0 -19
- package/dist/composables/validators/saveAsTemplate.d.ts +0 -31
- package/dist/composables/validators/saveAsTemplate.js +0 -24
- package/dist/enums/preview.d.ts +0 -13
- package/dist/enums/preview.js +0 -23
- package/dist/enums/toaster.d.ts +0 -5
- package/dist/enums/toaster.js +0 -4
- package/dist/mock/api/template-library.d.ts +0 -2
- package/dist/node_modules/@vueuse/shared/index.js +0 -45
- package/dist/node_modules/lodash-es/_Stack.js +0 -18
- package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/lodash-es/_apply.js +0 -16
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -19
- package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
- package/dist/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
- package/dist/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
- package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
- package/dist/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
- package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/lodash-es/_copyArray.js +0 -9
- package/dist/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
- package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
- package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
- package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_overRest.js +0 -15
- package/dist/node_modules/lodash-es/_safeGet.js +0 -7
- package/dist/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/lodash-es/_shortOut.js +0 -16
- package/dist/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/lodash-es/_stackSet.js +0 -17
- package/dist/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/dist/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
- package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/lodash-es/merge.js +0 -8
- package/dist/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
- package/dist/node_modules/valibot/dist/index.js +0 -190
- package/dist/node_modules/vue-demi/lib/index.js +0 -7
- package/dist/services/templateLibraryApi.d.ts +0 -7
- package/dist/services/templateLibraryApi.js +0 -87
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
- package/dist/stores/dynamic-content.d.ts +0 -27
- package/dist/stores/dynamic-content.js +0 -23
- package/dist/stores/preview.d.ts +0 -46
- package/dist/stores/preview.js +0 -53
- package/dist/stores/save-as-template.d.ts +0 -73
- package/dist/stores/save-as-template.js +0 -48
- package/dist/stores/toaster.d.ts +0 -18
- package/dist/stores/toaster.js +0 -27
- package/dist/utils/arrayUtil.d.ts +0 -1
- package/dist/utils/arrayUtil.js +0 -10
- package/dist/utils/base64.d.ts +0 -1
- package/dist/utils/base64.js +0 -7
- package/dist/utils/genericUtil.d.ts +0 -3
- package/dist/utils/genericUtil.js +0 -11
- package/dist/utils/templatePreparation.d.ts +0 -4
- package/dist/utils/templatePreparation.js +0 -33
- package/dist/utils/tooltipUtils.d.ts +0 -2
- package/dist/utils/tooltipUtils.js +0 -11
|
@@ -1,79 +1,38 @@
|
|
|
1
|
-
|
|
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
|
-
ampErrors: u,
|
|
29
|
-
displayConditions: d
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
...i
|
|
33
|
-
};
|
|
34
|
-
window.StripoEditorApi.actionsApi.compileEmail(m);
|
|
35
|
-
});
|
|
36
|
-
return {
|
|
37
|
-
getCompiledEmail: n,
|
|
38
|
-
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html: a, css: o, width: i, height: r, utmParams: m, syncModulesIds: s }) => t({
|
|
40
|
-
html: a,
|
|
41
|
-
css: o,
|
|
42
|
-
width: i,
|
|
43
|
-
height: r,
|
|
44
|
-
utmParams: m,
|
|
45
|
-
syncModulesIds: s
|
|
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
|
|
46
28
|
});
|
|
47
|
-
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
|
-
}),
|
|
49
|
-
activateCustomViewStyles: (t = !0) => {
|
|
50
|
-
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
51
29
|
},
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const {
|
|
55
|
-
html: e,
|
|
56
|
-
displayConditions: a,
|
|
57
|
-
ampHtml: o = "",
|
|
58
|
-
ampErrors: i = []
|
|
59
|
-
} = await n({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
|
-
return {
|
|
61
|
-
html: e,
|
|
62
|
-
ampHtml: o,
|
|
63
|
-
ampErrors: i,
|
|
64
|
-
displayConditions: a
|
|
65
|
-
};
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return l(e, "Error loading preview"), {
|
|
68
|
-
html: "",
|
|
69
|
-
ampHtml: "",
|
|
70
|
-
ampErrors: [],
|
|
71
|
-
displayConditions: []
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
30
|
+
...s
|
|
75
31
|
};
|
|
76
|
-
|
|
32
|
+
window.StripoEditorApi.actionsApi.compileEmail(o);
|
|
33
|
+
}), activateCustomViewStyles: (t = !0) => {
|
|
34
|
+
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
35
|
+
} });
|
|
77
36
|
export {
|
|
78
|
-
|
|
37
|
+
g as useActionsApi
|
|
79
38
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useHtmlCompiler as p } from "./useHtmlCompiler.js";
|
|
1
|
+
import { useActionsApi as l } from "./useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
|
|
4
3
|
import { useToaster as d } from "./useToaster.js";
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const h = () => {
|
|
5
|
+
const a = (s, o, r) => {
|
|
7
6
|
const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
|
|
8
7
|
e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
|
|
9
8
|
}, c = (s) => {
|
|
@@ -11,7 +10,7 @@ const H = () => {
|
|
|
11
10
|
return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
|
|
12
11
|
};
|
|
13
12
|
return { exportHtml: async (s = !0) => {
|
|
14
|
-
const { getCompiledEmail: o } =
|
|
13
|
+
const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
|
|
15
14
|
try {
|
|
16
15
|
const { html: t } = await o();
|
|
17
16
|
if (t) {
|
|
@@ -26,21 +25,21 @@ const H = () => {
|
|
|
26
25
|
executionTime: `${n.stats.executionTime.toFixed(2)}ms`
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
|
|
28
|
+
a(e, c("HTML"), "text/html");
|
|
30
29
|
} else
|
|
31
30
|
r({
|
|
32
|
-
type:
|
|
31
|
+
type: "error",
|
|
33
32
|
message: "No HTML content to download"
|
|
34
33
|
});
|
|
35
34
|
} catch (t) {
|
|
36
35
|
const e = t instanceof Error ? t.message : String(t);
|
|
37
36
|
r({
|
|
38
|
-
type:
|
|
37
|
+
type: "error",
|
|
39
38
|
message: `Error compiling email: ${e}`
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
} };
|
|
43
42
|
};
|
|
44
43
|
export {
|
|
45
|
-
|
|
44
|
+
h as useExport
|
|
46
45
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Template } from '@@/Types/stripo';
|
|
2
2
|
import type { InjectionKey } from 'vue';
|
|
3
3
|
export type BackHandler = () => void;
|
|
4
4
|
export type SaveStartHandler = () => void;
|
|
5
|
-
export type SaveCompleteHandler = (template: Omit<
|
|
5
|
+
export type SaveCompleteHandler = (template: Omit<Template, 'forceRecreate'>) => void;
|
|
6
6
|
export declare const BACK_KEY: InjectionKey<BackHandler>;
|
|
7
7
|
export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
|
|
8
8
|
export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
|
|
2
2
|
import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
...l.map((o, i) => ({
|
|
3
|
+
const a = () => {
|
|
4
|
+
const e = typeof window < "u" ? window.GuidoConfig : void 0, l = (e == null ? void 0 : e.htmlCompilerRules) || [], t = [
|
|
5
|
+
...!!(e != null && e.ignoreDefaultHtmlCompilerRules) ? [] : r,
|
|
6
|
+
...l.map((o, m) => ({
|
|
8
7
|
...o,
|
|
9
|
-
priority: o.priority + 1e3 +
|
|
8
|
+
priority: o.priority + 1e3 + m
|
|
10
9
|
// Ensure additional rules run after default rules
|
|
11
10
|
}))
|
|
12
|
-
],
|
|
13
|
-
return { compileHtml: (o) =>
|
|
11
|
+
], i = p(t);
|
|
12
|
+
return { compileHtml: (o) => i.compile(o) };
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
a as useHtmlCompiler
|
|
17
16
|
};
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
|
|
1
|
+
import { ref as p, computed as v } from "vue";
|
|
2
|
+
const j = (y = {}) => {
|
|
3
|
+
const h = p(!1), a = p(null), u = p(null), E = v(() => h.value), g = v(() => a.value !== null), T = {
|
|
5
4
|
baseURL: "",
|
|
6
5
|
timeout: 1e4,
|
|
7
6
|
retry: 0,
|
|
8
7
|
retryDelay: 1e3,
|
|
9
8
|
headers: {
|
|
10
|
-
"Content-Type": "application/json"
|
|
11
|
-
"X-CSRF-TOKEN": H()
|
|
9
|
+
"Content-Type": "application/json"
|
|
12
10
|
},
|
|
13
|
-
...
|
|
11
|
+
...y
|
|
14
12
|
}, w = (e, s) => {
|
|
15
13
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
16
14
|
return e;
|
|
17
|
-
const t = s ||
|
|
15
|
+
const t = s || T.baseURL || "";
|
|
18
16
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
19
17
|
}, P = (e) => new Promise((s, t) => {
|
|
20
18
|
setTimeout(() => {
|
|
@@ -24,20 +22,20 @@ const k = (b = {}) => {
|
|
|
24
22
|
setTimeout(s, e);
|
|
25
23
|
}), i = async (e, s, t, D = {}) => {
|
|
26
24
|
a.value = null, h.value = !0, u.value = new AbortController();
|
|
27
|
-
const n = { ...
|
|
25
|
+
const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
|
|
28
26
|
method: e,
|
|
29
27
|
headers: { ...n.headers },
|
|
30
28
|
signal: u.value.signal,
|
|
31
29
|
...n
|
|
32
30
|
};
|
|
33
31
|
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
|
|
34
|
-
const
|
|
32
|
+
const b = async (m = 0) => {
|
|
35
33
|
try {
|
|
36
34
|
const o = [fetch(L, c)];
|
|
37
35
|
n.timeout && o.push(P(n.timeout));
|
|
38
36
|
const r = await Promise.race(o);
|
|
39
37
|
if (!r.ok) {
|
|
40
|
-
const
|
|
38
|
+
const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
|
|
41
39
|
throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
|
|
42
40
|
}
|
|
43
41
|
let f;
|
|
@@ -51,36 +49,36 @@ const k = (b = {}) => {
|
|
|
51
49
|
} catch (o) {
|
|
52
50
|
const r = o instanceof Error && o.name === "AbortError";
|
|
53
51
|
if (m < (n.retry || 0) && !r)
|
|
54
|
-
return await x(n.retryDelay || 1e3),
|
|
52
|
+
return await x(n.retryDelay || 1e3), b(m + 1);
|
|
55
53
|
throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
|
|
56
54
|
}
|
|
57
55
|
};
|
|
58
56
|
try {
|
|
59
|
-
return await
|
|
57
|
+
return await b();
|
|
60
58
|
} finally {
|
|
61
59
|
h.value = !1, u.value = null;
|
|
62
60
|
}
|
|
63
|
-
},
|
|
61
|
+
}, $ = (e, s) => i("GET", e, void 0, s), C = (e, s, t) => i("POST", e, s, t), U = (e, s, t) => i("PUT", e, s, t), A = (e, s, t) => i("PATCH", e, s, t), R = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
|
|
64
62
|
u.value && u.value.abort(e);
|
|
65
63
|
}, q = () => {
|
|
66
64
|
a.value = null;
|
|
67
65
|
};
|
|
68
66
|
return {
|
|
69
67
|
// State
|
|
70
|
-
loading:
|
|
71
|
-
error:
|
|
72
|
-
hasError:
|
|
68
|
+
loading: E,
|
|
69
|
+
error: v(() => a.value),
|
|
70
|
+
hasError: g,
|
|
73
71
|
// Methods
|
|
74
72
|
request: i,
|
|
75
|
-
get:
|
|
76
|
-
post:
|
|
77
|
-
put:
|
|
78
|
-
patch:
|
|
79
|
-
delete:
|
|
73
|
+
get: $,
|
|
74
|
+
post: C,
|
|
75
|
+
put: U,
|
|
76
|
+
patch: A,
|
|
77
|
+
delete: R,
|
|
80
78
|
cancel: W,
|
|
81
79
|
clearError: q
|
|
82
80
|
};
|
|
83
81
|
};
|
|
84
82
|
export {
|
|
85
|
-
|
|
83
|
+
j as useHttp
|
|
86
84
|
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { DefaultProductType as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { DefaultProductType as o } from "../enums/defaults.js";
|
|
2
|
+
const p = () => {
|
|
3
|
+
const e = {
|
|
4
|
+
email: "newsletter"
|
|
5
|
+
};
|
|
6
|
+
return {
|
|
7
|
+
getPartnerName: () => window.location.hostname.split(".")[0] || "",
|
|
8
|
+
getProductType: () => {
|
|
9
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
|
|
10
|
+
return e[t] || t;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
9
14
|
export {
|
|
10
|
-
|
|
15
|
+
p as usePartner
|
|
11
16
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
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 E } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as S } from "../enums/displayConditions.js";
|
|
5
5
|
import y from "../extensions/DynamicContent/extension.js";
|
|
6
|
-
import { useStripoApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const i = h(), { html: t, css: s, forceRecreate: p } = e;
|
|
6
|
+
import { useStripoApi as C } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
8
|
+
const A = (a) => {
|
|
9
|
+
const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = C(), l = (e, r = []) => {
|
|
10
|
+
const i = w(), { html: t, css: s, forceRecreate: m } = e;
|
|
12
11
|
window.UIEditor.initEditor(
|
|
13
12
|
document.querySelector("#guido-editor"),
|
|
14
13
|
{
|
|
15
|
-
metadata:
|
|
14
|
+
metadata: a,
|
|
16
15
|
html: t,
|
|
17
16
|
css: s,
|
|
18
|
-
forceRecreate:
|
|
17
|
+
forceRecreate: m,
|
|
19
18
|
locale: "en",
|
|
20
19
|
undoButtonSelector: "#guido__undo-button",
|
|
21
20
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -31,25 +30,19 @@ const M = (d) => {
|
|
|
31
30
|
`,
|
|
32
31
|
conditionsEnabled: !0,
|
|
33
32
|
customConditionsEnabled: !0,
|
|
34
|
-
conditionCategories:
|
|
35
|
-
enableXSSSecurity: !0,
|
|
33
|
+
conditionCategories: S,
|
|
36
34
|
messageSettingsEnabled: !1,
|
|
37
35
|
editorFonts: {
|
|
38
36
|
showDefaultStandardFonts: !0,
|
|
39
37
|
showDefaultNotStandardFonts: !0,
|
|
40
38
|
customFonts: r
|
|
41
39
|
},
|
|
42
|
-
mergeTags: [
|
|
43
|
-
{
|
|
44
|
-
entries: w(d.preselectedDynamicContentList)
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
40
|
async onTokenRefreshRequest(o) {
|
|
48
41
|
try {
|
|
49
42
|
const n = await c();
|
|
50
43
|
o(n);
|
|
51
44
|
} catch (n) {
|
|
52
|
-
|
|
45
|
+
d(n, "Failed to refresh token");
|
|
53
46
|
}
|
|
54
47
|
},
|
|
55
48
|
onTemplateLoaded() {
|
|
@@ -57,7 +50,7 @@ const M = (d) => {
|
|
|
57
50
|
const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
|
|
58
51
|
o(), n();
|
|
59
52
|
} catch (o) {
|
|
60
|
-
|
|
53
|
+
d(o, "Failed to load custom interface appearance");
|
|
61
54
|
}
|
|
62
55
|
},
|
|
63
56
|
onCodeEditorVisibilityChanged(o) {
|
|
@@ -69,14 +62,11 @@ const M = (d) => {
|
|
|
69
62
|
onVersionHistoryVisibilityChanged(o) {
|
|
70
63
|
i.isVersionHistoryOpen = o;
|
|
71
64
|
},
|
|
72
|
-
onDataChanged() {
|
|
73
|
-
i.hasChanges = !0;
|
|
74
|
-
},
|
|
75
65
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
76
66
|
extensions: [y]
|
|
77
67
|
}
|
|
78
68
|
);
|
|
79
|
-
},
|
|
69
|
+
}, p = (e) => new Promise((r, i) => {
|
|
80
70
|
if (document.getElementById("UiEditorScript")) {
|
|
81
71
|
e(), r();
|
|
82
72
|
return;
|
|
@@ -90,12 +80,12 @@ const M = (d) => {
|
|
|
90
80
|
}, document.body.appendChild(t);
|
|
91
81
|
});
|
|
92
82
|
return { initPlugin: async (e) => {
|
|
93
|
-
await
|
|
83
|
+
await p(async () => {
|
|
94
84
|
const r = await u();
|
|
95
85
|
l(e, r);
|
|
96
86
|
});
|
|
97
87
|
} };
|
|
98
88
|
};
|
|
99
89
|
export {
|
|
100
|
-
|
|
90
|
+
A as useStripo
|
|
101
91
|
};
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
export type ToasterType = 'success' | 'error' | 'info' | 'warning';
|
|
2
|
+
export type ToasterOptions = {
|
|
3
|
+
type?: ToasterType;
|
|
4
|
+
message: string;
|
|
5
|
+
actionButton?: {
|
|
6
|
+
text: string;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
2
10
|
export declare const useToaster: () => {
|
|
11
|
+
isToasterVisible: import("vue").Ref<boolean>;
|
|
12
|
+
toasterMessage: import("vue").Ref<string>;
|
|
13
|
+
toasterType: import("vue").Ref<ToasterType>;
|
|
14
|
+
toasterActionButton: import("vue").Ref<({
|
|
15
|
+
text: string;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
} | undefined)[]>;
|
|
3
18
|
showToaster: (options?: ToasterOptions) => void;
|
|
4
19
|
hideToaster: () => void;
|
|
5
20
|
handleError: (error: unknown, context: string) => void;
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function r(e = { message: "" }) {
|
|
11
|
-
o(), t.hideToaster(), t.showToaster(e);
|
|
1
|
+
import { ref as o, watch as T } from "vue";
|
|
2
|
+
const v = () => {
|
|
3
|
+
const t = o(!1), s = o(""), c = o("success"), n = o([]);
|
|
4
|
+
let a = null;
|
|
5
|
+
function i() {
|
|
6
|
+
a && (clearTimeout(a), a = null);
|
|
7
|
+
}
|
|
8
|
+
function u() {
|
|
9
|
+
t.value = !1, n.value = [], s.value = "";
|
|
12
10
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
11
|
+
function l(e = { message: "" }) {
|
|
12
|
+
u(), s.value = e.message, c.value = e.type || "success", n.value = e.actionButton ? [e.actionButton] : [], t.value = !0;
|
|
15
13
|
}
|
|
16
|
-
function
|
|
14
|
+
function f(e, r) {
|
|
17
15
|
const m = e instanceof Error ? e.message : String(e);
|
|
18
|
-
|
|
16
|
+
l({
|
|
17
|
+
type: "error",
|
|
18
|
+
message: `${r}: ${m}`
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
|
-
return
|
|
21
|
-
() =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
return T([t, s], ([e, r]) => {
|
|
22
|
+
i(), e && r && (a = setTimeout(() => {
|
|
23
|
+
u();
|
|
24
|
+
}, 6e3));
|
|
25
|
+
}), {
|
|
26
|
+
isToasterVisible: t,
|
|
27
|
+
toasterMessage: s,
|
|
28
|
+
toasterType: c,
|
|
29
|
+
toasterActionButton: n,
|
|
30
|
+
showToaster: l,
|
|
31
|
+
hideToaster: u,
|
|
32
|
+
handleError: f
|
|
33
|
+
};
|
|
28
34
|
};
|
|
29
35
|
export {
|
|
30
|
-
|
|
36
|
+
v as useToaster
|
|
31
37
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import memoize from "../node_modules/lodash-es/memoize.js";
|
|
2
2
|
import { ref } from "vue";
|
|
3
|
-
import { useConfig } from "./useConfig.js";
|
|
4
3
|
const useTranslations = () => {
|
|
5
|
-
const
|
|
4
|
+
const translations = ref(eval(window.GuidoConfig.translationsPath)), trans = (n, t) => {
|
|
6
5
|
const r = translations.value[n];
|
|
7
6
|
return r ? t ? Object.entries(t).reduce(
|
|
8
|
-
(e, [o,
|
|
7
|
+
(e, [o, i]) => e.replace(new RegExp(`{${o}}`, "g"), String(i)),
|
|
9
8
|
r
|
|
10
9
|
) : r : (console.warn(`Translation key not found: ${n}`), n);
|
|
11
10
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const i = c(), { showToaster: s } = w(), n = (e) => {
|
|
1
|
+
import { useVersionHistoryStore as p } from "../stores/version-history.js";
|
|
2
|
+
import { useToaster as c } from "./useToaster.js";
|
|
3
|
+
const l = () => {
|
|
4
|
+
const i = p(), { showToaster: s } = c(), t = (e) => {
|
|
6
5
|
i.$reset(), i.updateState(e);
|
|
7
|
-
},
|
|
6
|
+
}, n = () => {
|
|
8
7
|
i.$reset();
|
|
9
8
|
};
|
|
10
9
|
return {
|
|
11
10
|
openVersionHistory: () => {
|
|
12
|
-
window.StripoEditorApi.versionHistoryApi.openVersionHistory(
|
|
11
|
+
window.StripoEditorApi.versionHistoryApi.openVersionHistory(t, n);
|
|
13
12
|
},
|
|
14
13
|
closeVersionHistory: () => {
|
|
15
14
|
window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
|
|
@@ -24,7 +23,7 @@ const S = () => {
|
|
|
24
23
|
window.StripoEditorApi.versionHistoryApi.previewVersion(e, (o) => {
|
|
25
24
|
const r = o instanceof Error ? o.message : String(o);
|
|
26
25
|
s({
|
|
27
|
-
type:
|
|
26
|
+
type: "error",
|
|
28
27
|
message: `Error compiling email: ${r}`
|
|
29
28
|
});
|
|
30
29
|
});
|
|
@@ -34,14 +33,14 @@ const S = () => {
|
|
|
34
33
|
e,
|
|
35
34
|
() => {
|
|
36
35
|
s({
|
|
37
|
-
type:
|
|
36
|
+
type: "success",
|
|
38
37
|
message: `${e} patch restored successfully.`
|
|
39
38
|
});
|
|
40
39
|
},
|
|
41
40
|
(o) => {
|
|
42
41
|
const r = o instanceof Error ? o.message : String(o);
|
|
43
42
|
s({
|
|
44
|
-
type:
|
|
43
|
+
type: "error",
|
|
45
44
|
message: `Error compiling email: ${r}`
|
|
46
45
|
});
|
|
47
46
|
}
|
|
@@ -50,5 +49,5 @@ const S = () => {
|
|
|
50
49
|
};
|
|
51
50
|
};
|
|
52
51
|
export {
|
|
53
|
-
|
|
52
|
+
l as useVersionHistoryApi
|
|
54
53
|
};
|
package/dist/enums/defaults.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { GuidoConfig } from '@@/Types/generic';
|
|
2
2
|
export declare const DefaultGuidoConfig: GuidoConfig;
|
|
3
|
-
export declare const DefaultProductType = "
|
|
3
|
+
export declare const DefaultProductType = "newsletter";
|
|
4
4
|
export declare const DefaultUsername = "Guido User";
|
|
5
|
-
export declare const DefaultMessageType = 1;
|
|
6
|
-
export declare const EditorType: number;
|
|
7
|
-
export declare const ProductIds: Record<string, number>;
|
package/dist/enums/defaults.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
translationsPath: "window.trans.en"
|
|
3
|
-
|
|
4
|
-
senderName: "",
|
|
5
|
-
subject: ""
|
|
6
|
-
},
|
|
7
|
-
features: {
|
|
8
|
-
dynamicContent: !0,
|
|
9
|
-
saveAsTemplate: !0,
|
|
10
|
-
versionHistory: !0
|
|
11
|
-
}
|
|
12
|
-
}, t = "email", s = "Guido User", a = 1, n = 2, o = {
|
|
13
|
-
email: 60,
|
|
14
|
-
architect: 49
|
|
15
|
-
};
|
|
1
|
+
const t = {
|
|
2
|
+
translationsPath: "window.trans.en"
|
|
3
|
+
}, e = "newsletter", n = "Guido User";
|
|
16
4
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
s as DefaultUsername,
|
|
21
|
-
n as EditorType,
|
|
22
|
-
o as ProductIds
|
|
5
|
+
t as DefaultGuidoConfig,
|
|
6
|
+
e as DefaultProductType,
|
|
7
|
+
n as DefaultUsername
|
|
23
8
|
};
|