@useinsider/guido 1.0.0-beta.3012b2b → 1.0.0-beta.301d25a
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 +0 -11
- package/dist/@types/generic.d.ts +0 -7
- package/dist/components/Guido.vue.d.ts +6 -5
- package/dist/components/Guido.vue.js +11 -11
- package/dist/components/Guido.vue2.js +54 -59
- package/dist/components/organisms/header/RightSlot.vue.js +5 -5
- package/dist/components/organisms/header/RightSlot.vue2.js +28 -26
- package/dist/components/wrappers/WpModal.vue.d.ts +2 -2
- package/dist/composables/useActionsApi.d.ts +1 -2
- package/dist/composables/useActionsApi.js +36 -51
- package/dist/composables/useGuidoActions.d.ts +2 -2
- 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 +29 -32
- package/dist/enums/defaults.d.ts +1 -4
- package/dist/enums/defaults.js +3 -10
- 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/_baseCreate.js +2 -2
- package/dist/node_modules/lodash-es/_defineProperty.js +2 -2
- package/dist/node_modules/lodash-es/_isMasked.js +2 -2
- package/dist/node_modules/lodash-es/_nodeUtil.js +2 -2
- package/dist/node_modules/lodash-es/isArguments.js +2 -2
- package/dist/static/styles/components/wide-panel.css.js +0 -4
- package/dist/stores/editor.d.ts +0 -2
- package/dist/stores/editor.js +3 -5
- package/dist/utils/genericUtil.d.ts +0 -1
- package/dist/utils/genericUtil.js +3 -7
- package/package.json +3 -3
- package/dist/@types/save-as-template.d.ts +0 -29
- 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/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/mock/api/template-library.d.ts +0 -2
- package/dist/node_modules/@vueuse/shared/index.js +0 -45
- 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/styles/customEditorStyle.css.js +0 -18
- package/dist/stores/save-as-template.d.ts +0 -73
- package/dist/stores/save-as-template.js +0 -48
- package/dist/utils/base64.d.ts +0 -1
- package/dist/utils/base64.js +0 -7
- package/dist/utils/templatePreparation.d.ts +0 -4
- package/dist/utils/templatePreparation.js +0 -33
package/README.md
CHANGED
|
@@ -145,16 +145,6 @@ interface GuidoConfig {
|
|
|
145
145
|
translationsPath: string;
|
|
146
146
|
htmlCompilerRules?: CompilerRule[];
|
|
147
147
|
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
148
|
-
useHeader: boolean
|
|
149
|
-
emailHeader: {
|
|
150
|
-
senderName: string;
|
|
151
|
-
subject: string;
|
|
152
|
-
};
|
|
153
|
-
partner: {
|
|
154
|
-
partnerName: string;
|
|
155
|
-
productType: number;
|
|
156
|
-
messageType: number;
|
|
157
|
-
};
|
|
158
148
|
features: {
|
|
159
149
|
dynamicContent: boolean;
|
|
160
150
|
saveAsTemplate: boolean;
|
|
@@ -168,7 +158,6 @@ interface GuidoConfig {
|
|
|
168
158
|
| `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
|
|
169
159
|
| `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
|
|
170
160
|
| `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
|
|
171
|
-
| `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
|
|
172
161
|
| `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
|
|
173
162
|
| `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
|
|
174
163
|
| `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
|
package/dist/@types/generic.d.ts
CHANGED
|
@@ -4,18 +4,11 @@ type Features = {
|
|
|
4
4
|
saveAsTemplate?: boolean;
|
|
5
5
|
versionHistory?: boolean;
|
|
6
6
|
};
|
|
7
|
-
type Partner = {
|
|
8
|
-
partnerName: string;
|
|
9
|
-
productType: number;
|
|
10
|
-
messageType: number;
|
|
11
|
-
};
|
|
12
7
|
export type GuidoConfig = {
|
|
13
8
|
translationsPath: string;
|
|
14
9
|
htmlCompilerRules?: CompilerRule[];
|
|
15
10
|
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
16
|
-
useHeader?: boolean;
|
|
17
11
|
emailHeader: EmailHeader;
|
|
18
|
-
partner?: Partner;
|
|
19
12
|
features?: Features;
|
|
20
13
|
};
|
|
21
14
|
export type DynamicContent = {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Template } from '@@/Types/stripo';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
templateId: string;
|
|
5
5
|
userId: string;
|
|
6
|
-
messageType?: number;
|
|
7
6
|
partnerName?: string;
|
|
8
|
-
productType?:
|
|
7
|
+
productType?: string;
|
|
9
8
|
username?: string;
|
|
10
9
|
html?: string;
|
|
11
10
|
css?: string;
|
|
@@ -17,12 +16,14 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
17
16
|
insert: (data: DynamicContent) => void;
|
|
18
17
|
close: () => void;
|
|
19
18
|
};
|
|
20
|
-
hasChanges: import("vue").ComputedRef<boolean>;
|
|
21
19
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
22
20
|
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
23
21
|
back: () => void;
|
|
24
22
|
"save:start": () => void;
|
|
25
|
-
"save:complete": (data:
|
|
23
|
+
"save:complete": (data: {
|
|
24
|
+
template: Omit<Template, "forceRecreate">;
|
|
25
|
+
dynamicContentList: DynamicContent[];
|
|
26
|
+
}) => void;
|
|
26
27
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
27
28
|
export default _default;
|
|
28
29
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
|
|
3
|
+
import t from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
|
+
var i = this, e = i._self._c, r = i._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.Toaster)], 1);
|
|
7
|
+
}, a = [], n = /* @__PURE__ */ t(
|
|
8
|
+
o,
|
|
9
|
+
s,
|
|
9
10
|
a,
|
|
10
|
-
t,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"09c28ccc"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const v = n.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
v as default
|
|
18
18
|
};
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { DefaultUsername as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
import q from "../node_modules/lodash-es/merge.js";
|
|
14
|
-
const se = /* @__PURE__ */ I({
|
|
1
|
+
import { defineComponent as L, defineAsyncComponent as E, onMounted as P } from "vue";
|
|
2
|
+
import { provideGuidoActions as _ } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as G } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as I } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as T, DefaultGuidoConfig as k } from "../enums/defaults.js";
|
|
6
|
+
import A from "./organisms/base/Toaster.vue.js";
|
|
7
|
+
import N from "./organisms/header/HeaderWrapper.vue.js";
|
|
8
|
+
import { useStripoApi as x } from "../services/stripoApi.js";
|
|
9
|
+
import { useDynamicContentStore as W } from "../stores/dynamic-content.js";
|
|
10
|
+
import { usePreviewStore as z } from "../stores/preview.js";
|
|
11
|
+
import B from "../node_modules/lodash-es/merge.js";
|
|
12
|
+
const V = /* @__PURE__ */ L({
|
|
15
13
|
__name: "Guido",
|
|
16
14
|
props: {
|
|
17
15
|
templateId: null,
|
|
18
16
|
userId: null,
|
|
19
|
-
messageType: null,
|
|
20
17
|
partnerName: null,
|
|
21
18
|
productType: null,
|
|
22
19
|
username: null,
|
|
@@ -26,34 +23,29 @@ const se = /* @__PURE__ */ I({
|
|
|
26
23
|
guidoConfig: null
|
|
27
24
|
},
|
|
28
25
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
|
|
29
|
-
setup(
|
|
30
|
-
const o =
|
|
26
|
+
setup(S, { expose: b, emit: t }) {
|
|
27
|
+
const o = S, w = E(
|
|
31
28
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
32
|
-
), n =
|
|
33
|
-
templateId:
|
|
34
|
-
userId:
|
|
35
|
-
guidoConfig:
|
|
36
|
-
html:
|
|
37
|
-
css:
|
|
38
|
-
partnerName:
|
|
39
|
-
productType:
|
|
40
|
-
|
|
41
|
-
username: C = x
|
|
29
|
+
), n = W(), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: s } = G(), h = z(), {
|
|
30
|
+
templateId: r,
|
|
31
|
+
userId: a,
|
|
32
|
+
guidoConfig: m,
|
|
33
|
+
html: d = "",
|
|
34
|
+
css: l = "",
|
|
35
|
+
partnerName: u = i(),
|
|
36
|
+
productType: p = s(),
|
|
37
|
+
username: y = T
|
|
42
38
|
} = o;
|
|
43
|
-
window.GuidoConfig =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
productType: i,
|
|
54
|
-
preselectedDynamicContentList: r
|
|
55
|
-
}), { getDefaultTemplate: w } = H();
|
|
56
|
-
A({
|
|
39
|
+
window.GuidoConfig = B(k, m);
|
|
40
|
+
const { initPlugin: f } = I({
|
|
41
|
+
emailId: r,
|
|
42
|
+
userId: a,
|
|
43
|
+
username: y,
|
|
44
|
+
partnerName: u,
|
|
45
|
+
productType: p,
|
|
46
|
+
preselectedDynamicContentList: c
|
|
47
|
+
}), { getDefaultTemplate: g } = x();
|
|
48
|
+
_({
|
|
57
49
|
onBack: () => {
|
|
58
50
|
console.debug("guido:back"), t("back");
|
|
59
51
|
},
|
|
@@ -61,42 +53,45 @@ const se = /* @__PURE__ */ I({
|
|
|
61
53
|
console.debug("guido:save:start"), t("save:start");
|
|
62
54
|
},
|
|
63
55
|
onSaveComplete: (e) => {
|
|
64
|
-
console.debug("guido:save:complete",
|
|
56
|
+
console.debug("guido:save:complete", {
|
|
57
|
+
template: e,
|
|
58
|
+
dynamicContentList: n.getSelectedDynamicContentList
|
|
59
|
+
}), t("save:complete", {
|
|
60
|
+
template: e,
|
|
61
|
+
dynamicContentList: n.getSelectedDynamicContentList
|
|
62
|
+
});
|
|
65
63
|
}
|
|
66
64
|
});
|
|
67
|
-
const
|
|
65
|
+
const C = (e) => {
|
|
68
66
|
console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
69
|
-
},
|
|
67
|
+
}, v = () => {
|
|
70
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
71
69
|
};
|
|
72
|
-
return
|
|
70
|
+
return P(async () => {
|
|
73
71
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
74
72
|
try {
|
|
75
73
|
let e = {
|
|
76
|
-
html:
|
|
77
|
-
css:
|
|
74
|
+
html: d,
|
|
75
|
+
css: l,
|
|
78
76
|
forceRecreate: !0
|
|
79
77
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
80
78
|
};
|
|
81
|
-
e.html || (e = await
|
|
79
|
+
e.html || (e = await g()), await f(e), n.selectedDynamicContentList = c;
|
|
82
80
|
} catch (e) {
|
|
83
81
|
console.error("Failed to initialize Stripo editor:", e);
|
|
84
82
|
}
|
|
85
83
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
86
|
-
const
|
|
87
|
-
console.debug("dynamic-content:open",
|
|
84
|
+
const D = e;
|
|
85
|
+
console.debug("dynamic-content:open", D.detail), t("dynamic-content:open", D.detail);
|
|
88
86
|
});
|
|
89
|
-
}),
|
|
90
|
-
window.UIEditor.removeEditor();
|
|
91
|
-
}), E({
|
|
87
|
+
}), b({
|
|
92
88
|
dynamicContent: {
|
|
93
|
-
insert:
|
|
94
|
-
close:
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
}), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: c, hasChanges: a, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, previewStore: G, templateId: l, userId: u, guidoConfig: p, html: f, css: g, partnerName: s, productType: i, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, Toaster: z, HeaderWrapper: B, SaveAsTemplateDrawer: F };
|
|
89
|
+
insert: C,
|
|
90
|
+
close: v
|
|
91
|
+
}
|
|
92
|
+
}), { __sfc: !0, PreviewContainer: w, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, previewStore: h, templateId: r, userId: a, guidoConfig: m, html: d, css: l, partnerName: u, productType: p, username: y, emit: t, initPlugin: f, getDefaultTemplate: g, insertDynamicContent: C, closeDynamicContent: v, Toaster: A, HeaderWrapper: N };
|
|
98
93
|
}
|
|
99
94
|
});
|
|
100
95
|
export {
|
|
101
|
-
|
|
96
|
+
V as default
|
|
102
97
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import n from "./RightSlot.vue2.js";
|
|
2
|
-
import
|
|
3
|
-
var
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
4
|
var s, i;
|
|
5
5
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), (i = t.config.features) != null && i.saveAsTemplate ? 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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }
|
|
7
|
-
},
|
|
6
|
+
return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), (i = t.config.features) != null && i.saveAsTemplate ? 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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.isSaveButtonDisabled }, on: { click: t.handleSave } })], 1);
|
|
7
|
+
}, l = [], p = /* @__PURE__ */ r(
|
|
8
8
|
n,
|
|
9
|
+
a,
|
|
9
10
|
l,
|
|
10
|
-
r,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
13
|
null
|
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import { defineComponent as y, computed as
|
|
1
|
+
import { defineComponent as y, computed as a } from "vue";
|
|
2
|
+
import { useActionsApi as S } from "../../../composables/useActionsApi.js";
|
|
2
3
|
import { useConfig as H } from "../../../composables/useConfig.js";
|
|
3
|
-
import { useExport as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { useVersionHistoryApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
import { usePreviewStore as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const z = /* @__PURE__ */ y({
|
|
4
|
+
import { useExport as h } from "../../../composables/useExport.js";
|
|
5
|
+
import { useSaveStart as V, useSaveComplete as _ } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useTranslations as g } from "../../../composables/useTranslations.js";
|
|
7
|
+
import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
|
|
8
|
+
import { useEditorStore as C } from "../../../stores/editor.js";
|
|
9
|
+
import { usePreviewStore as O } from "../../../stores/preview.js";
|
|
10
|
+
import { getTooltipOptions as x } from "../../../utils/tooltipUtils.js";
|
|
11
|
+
import { InButtonV2 as T } from "@useinsider/design-system-vue";
|
|
12
|
+
const q = /* @__PURE__ */ y({
|
|
13
13
|
__name: "RightSlot",
|
|
14
14
|
setup(A) {
|
|
15
|
-
const { config:
|
|
16
|
-
if (
|
|
17
|
-
|
|
15
|
+
const { config: c } = H(), { exportHtml: l } = h(), { getCompiledEmail: r } = S(), s = V(), i = _(), { openVersionHistory: n, closeVersionHistory: m } = w(), o = C(), t = g(), p = O(), f = () => {
|
|
16
|
+
if (o.isVersionHistoryOpen) {
|
|
17
|
+
m();
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
}, u = p(() => e.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), v = async () => {
|
|
24
|
-
r();
|
|
20
|
+
n();
|
|
21
|
+
}, u = a(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), v = async () => {
|
|
22
|
+
s();
|
|
25
23
|
try {
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
const { html: e } = await r();
|
|
25
|
+
i({
|
|
26
|
+
html: e || "",
|
|
27
|
+
css: ""
|
|
28
|
+
// CSS is embedded in HTML from Stripo
|
|
29
|
+
});
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.error("Failed to get template data for save:", e);
|
|
30
32
|
}
|
|
31
|
-
},
|
|
32
|
-
return { __sfc: !0, config:
|
|
33
|
+
}, d = a(() => o.isVersionHistoryOpen || p.isPreviewModeOpen);
|
|
34
|
+
return { __sfc: !0, config: c, exportHtml: l, getCompiledEmail: r, saveStart: s, saveComplete: i, openVersionHistory: n, closeVersionHistory: m, editorStore: o, trans: t, previewStore: p, handleVersionHistory: f, versionHistoryTooltipText: u, handleSave: v, isSaveButtonDisabled: d, getTooltipOptions: x, InButtonV2: T };
|
|
33
35
|
}
|
|
34
36
|
});
|
|
35
37
|
export {
|
|
36
|
-
|
|
38
|
+
q as default
|
|
37
39
|
};
|
|
@@ -32,11 +32,11 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
32
32
|
closeOnOutsideClick: boolean;
|
|
33
33
|
footerStatus: boolean;
|
|
34
34
|
}>>>, {
|
|
35
|
-
description: string;
|
|
36
35
|
size: "small" | "medium" | "large";
|
|
37
|
-
|
|
36
|
+
description: string;
|
|
38
37
|
footerButtonOptions: FooterButtonGroup;
|
|
39
38
|
closeButtonStatus: boolean;
|
|
39
|
+
closeOnOutsideClick: boolean;
|
|
40
40
|
footerStatus: boolean;
|
|
41
41
|
}>;
|
|
42
42
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { CompileEmailOptions } from '@@/Types/actions-api';
|
|
2
|
-
import { GetCompiledEmailOptions, CompiledEmailResult
|
|
2
|
+
import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
|
|
3
3
|
export declare const useActionsApi: () => {
|
|
4
4
|
getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
|
|
5
|
-
getTemplateData: () => Promise<TemplateData>;
|
|
6
5
|
activateCustomViewStyles: (isActive?: boolean) => void;
|
|
7
6
|
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
8
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useToaster as
|
|
2
|
-
const
|
|
3
|
-
const { handleError:
|
|
1
|
+
import { useToaster as d } from "./useToaster.js";
|
|
2
|
+
const E = () => {
|
|
3
|
+
const { handleError: m } = d(), s = (t = {}) => new Promise((e, a) => {
|
|
4
4
|
const i = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
@@ -20,60 +20,45 @@ const A = () => {
|
|
|
20
20
|
forseAmp: !1,
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
|
-
}, ...t },
|
|
24
|
-
callback: (
|
|
25
|
-
|
|
26
|
-
html:
|
|
27
|
-
ampHtml:
|
|
28
|
-
ampErrors:
|
|
29
|
-
displayConditions:
|
|
23
|
+
}, ...t }, n = {
|
|
24
|
+
callback: (r, l, c, p, u) => {
|
|
25
|
+
r ? a(r) : e({
|
|
26
|
+
html: l,
|
|
27
|
+
ampHtml: c,
|
|
28
|
+
ampErrors: p,
|
|
29
|
+
displayConditions: u
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
32
|
...i
|
|
33
33
|
};
|
|
34
|
-
window.StripoEditorApi.actionsApi.compileEmail(
|
|
34
|
+
window.StripoEditorApi.actionsApi.compileEmail(n);
|
|
35
35
|
});
|
|
36
|
-
return {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
}
|
|
36
|
+
return { getCompiledEmail: s, activateCustomViewStyles: (t = !0) => {
|
|
37
|
+
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
38
|
+
}, getPreviewData: async (t) => {
|
|
39
|
+
try {
|
|
40
|
+
const {
|
|
41
|
+
html: e,
|
|
42
|
+
displayConditions: a,
|
|
43
|
+
ampHtml: o = "",
|
|
44
|
+
ampErrors: i = []
|
|
45
|
+
} = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
46
|
+
return {
|
|
47
|
+
html: e,
|
|
48
|
+
ampHtml: o,
|
|
49
|
+
ampErrors: i,
|
|
50
|
+
displayConditions: a
|
|
51
|
+
};
|
|
52
|
+
} catch (e) {
|
|
53
|
+
return m(e, "Error loading preview"), {
|
|
54
|
+
html: "",
|
|
55
|
+
ampHtml: "",
|
|
56
|
+
ampErrors: [],
|
|
57
|
+
displayConditions: []
|
|
58
|
+
};
|
|
74
59
|
}
|
|
75
|
-
};
|
|
60
|
+
} };
|
|
76
61
|
};
|
|
77
62
|
export {
|
|
78
|
-
|
|
63
|
+
E as useActionsApi
|
|
79
64
|
};
|
|
@@ -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,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
|
};
|