@useinsider/guido 1.0.0-beta.cd820fb → 1.0.0-beta.cf41937
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -2
- package/dist/@types/generic.d.ts +18 -0
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +8 -10
- package/dist/components/organisms/header/MiddleSlot.vue.js +3 -3
- package/dist/components/organisms/header/MiddleSlot.vue2.js +12 -16
- package/dist/components/organisms/header/RightSlot.vue.js +9 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +26 -23
- package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/ViewOptions.vue2.js +30 -12
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
- package/dist/composables/useHtmlCompiler.js +9 -8
- package/dist/composables/useTranslations.js +3 -2
- package/dist/enums/defaults.js +5 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/stores/editor.d.ts +1 -0
- package/dist/stores/editor.js +3 -2
- package/dist/stores/preview.d.ts +2 -20
- package/dist/stores/preview.js +11 -7
- package/dist/utils/tooltipUtils.d.ts +2 -0
- package/dist/utils/tooltipUtils.js +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,11 @@ export default {
|
|
|
57
57
|
translationsPath: 'window.trans.en',
|
|
58
58
|
htmlCompilerRules: [],
|
|
59
59
|
ignoreDefaultHtmlCompilerRules: false,
|
|
60
|
+
features: {
|
|
61
|
+
dynamicContent: true,
|
|
62
|
+
saveAsTemplate: true,
|
|
63
|
+
versionHistory: true
|
|
64
|
+
}
|
|
60
65
|
},
|
|
61
66
|
dynamicContentModalVisible: false
|
|
62
67
|
};
|
|
@@ -138,8 +143,13 @@ dynamicContent.close();
|
|
|
138
143
|
```typescript
|
|
139
144
|
interface GuidoConfig {
|
|
140
145
|
translationsPath: string;
|
|
141
|
-
htmlCompilerRules
|
|
142
|
-
ignoreDefaultHtmlCompilerRules
|
|
146
|
+
htmlCompilerRules?: CompilerRule[];
|
|
147
|
+
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
148
|
+
features: {
|
|
149
|
+
dynamicContent: boolean;
|
|
150
|
+
saveAsTemplate: boolean;
|
|
151
|
+
versionHistory: boolean;
|
|
152
|
+
};
|
|
143
153
|
}
|
|
144
154
|
```
|
|
145
155
|
|
|
@@ -148,6 +158,10 @@ interface GuidoConfig {
|
|
|
148
158
|
| `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
|
|
149
159
|
| `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
|
|
150
160
|
| `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
|
|
161
|
+
| `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
|
|
162
|
+
| `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
|
|
163
|
+
| `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
|
|
164
|
+
| `features.versionHistory` | `boolean` | `true` | Enable version history feature |
|
|
151
165
|
|
|
152
166
|
```typescript
|
|
153
167
|
interface DynamicContent {
|
|
@@ -255,6 +269,11 @@ Define complex transformation logic with a custom processor function.
|
|
|
255
269
|
```typescript
|
|
256
270
|
const guidoConfig = {
|
|
257
271
|
translationsPath: 'window.trans.en',
|
|
272
|
+
features: {
|
|
273
|
+
dynamicContent: true,
|
|
274
|
+
saveAsTemplate: true,
|
|
275
|
+
versionHistory: false // Disable version history
|
|
276
|
+
},
|
|
258
277
|
htmlCompilerRules: [
|
|
259
278
|
{
|
|
260
279
|
id: 'replace-domain',
|
|
@@ -283,6 +302,11 @@ const guidoConfig = {
|
|
|
283
302
|
```typescript
|
|
284
303
|
const guidoConfig = {
|
|
285
304
|
translationsPath: 'window.trans.en',
|
|
305
|
+
features: {
|
|
306
|
+
dynamicContent: true,
|
|
307
|
+
saveAsTemplate: true,
|
|
308
|
+
versionHistory: true
|
|
309
|
+
},
|
|
286
310
|
ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
|
|
287
311
|
htmlCompilerRules: [
|
|
288
312
|
// Only your custom rules will be applied
|
package/dist/@types/generic.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { CompilerRule } from './html-compiler';
|
|
2
|
+
type Features = {
|
|
3
|
+
dynamicContent?: boolean;
|
|
4
|
+
saveAsTemplate?: boolean;
|
|
5
|
+
versionHistory?: boolean;
|
|
6
|
+
};
|
|
2
7
|
export type GuidoConfig = {
|
|
3
8
|
translationsPath: string;
|
|
4
9
|
htmlCompilerRules?: CompilerRule[];
|
|
5
10
|
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
6
11
|
emailHeader: EmailHeader;
|
|
12
|
+
features?: Features;
|
|
7
13
|
};
|
|
8
14
|
export type DynamicContent = {
|
|
9
15
|
value: string;
|
|
@@ -14,7 +20,19 @@ export interface EmailHeader {
|
|
|
14
20
|
senderName: string;
|
|
15
21
|
subject: string;
|
|
16
22
|
}
|
|
23
|
+
export interface TooltipOptions {
|
|
24
|
+
id: string;
|
|
25
|
+
dynamicPosition: boolean;
|
|
26
|
+
staticPosition: 'top center' | 'top left' | 'top right' | 'bottom center' | 'bottom left' | 'bottom right' | 'right center' | 'right top' | 'right bottom' | 'left center' | 'left top' | 'left bottom';
|
|
27
|
+
iconStatus: boolean;
|
|
28
|
+
offset?: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
preventXss?: boolean;
|
|
33
|
+
}
|
|
17
34
|
export type MergeTag = {
|
|
18
35
|
label: string;
|
|
19
36
|
value: string;
|
|
20
37
|
};
|
|
38
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
4
|
+
var a = function() {
|
|
5
5
|
var i = this, e = i._self._c, r = i._self._setupProxy;
|
|
6
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" } })], 1);
|
|
7
|
-
},
|
|
7
|
+
}, s = [], n = /* @__PURE__ */ t(
|
|
8
8
|
o,
|
|
9
|
-
s,
|
|
10
9
|
a,
|
|
10
|
+
s,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"baabdaaa"
|
|
14
14
|
);
|
|
15
15
|
const c = n.exports;
|
|
16
16
|
export {
|
|
@@ -7,7 +7,8 @@ import A from "./organisms/header/HeaderWrapper.vue.js";
|
|
|
7
7
|
import { useStripoApi as N } from "../services/stripoApi.js";
|
|
8
8
|
import { useDynamicContentStore as x } from "../stores/dynamic-content.js";
|
|
9
9
|
import { usePreviewStore as W } from "../stores/preview.js";
|
|
10
|
-
|
|
10
|
+
import z from "../node_modules/lodash-es/merge.js";
|
|
11
|
+
const O = /* @__PURE__ */ L({
|
|
11
12
|
__name: "Guido",
|
|
12
13
|
props: {
|
|
13
14
|
templateId: null,
|
|
@@ -34,18 +35,15 @@ const q = /* @__PURE__ */ L({
|
|
|
34
35
|
productType: p = s(),
|
|
35
36
|
username: y = k
|
|
36
37
|
} = o;
|
|
37
|
-
window.GuidoConfig =
|
|
38
|
-
|
|
39
|
-
...m
|
|
40
|
-
};
|
|
41
|
-
const { initPlugin: C } = I({
|
|
38
|
+
window.GuidoConfig = z(T, m);
|
|
39
|
+
const { initPlugin: g } = I({
|
|
42
40
|
emailId: a,
|
|
43
41
|
userId: r,
|
|
44
42
|
username: y,
|
|
45
43
|
partnerName: u,
|
|
46
44
|
productType: p,
|
|
47
45
|
preselectedDynamicContentList: c
|
|
48
|
-
}), { getDefaultTemplate:
|
|
46
|
+
}), { getDefaultTemplate: C } = N();
|
|
49
47
|
_({
|
|
50
48
|
onBack: () => {
|
|
51
49
|
console.debug("guido:back"), t("back");
|
|
@@ -77,7 +75,7 @@ const q = /* @__PURE__ */ L({
|
|
|
77
75
|
forceRecreate: !0
|
|
78
76
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
79
77
|
};
|
|
80
|
-
e.html || (e = await
|
|
78
|
+
e.html || (e = await C()), await g(e), n.selectedDynamicContentList = c;
|
|
81
79
|
} catch (e) {
|
|
82
80
|
console.error("Failed to initialize Stripo editor:", e);
|
|
83
81
|
}
|
|
@@ -90,9 +88,9 @@ const q = /* @__PURE__ */ L({
|
|
|
90
88
|
insert: f,
|
|
91
89
|
close: v
|
|
92
90
|
}
|
|
93
|
-
}), { __sfc: !0, PreviewContainer: w, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, previewStore: h, templateId: a, userId: r, guidoConfig: m, html: d, css: l, partnerName: u, productType: p, username: y, emit: t, initPlugin:
|
|
91
|
+
}), { __sfc: !0, PreviewContainer: w, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, previewStore: h, templateId: a, userId: r, guidoConfig: m, html: d, css: l, partnerName: u, productType: p, username: y, emit: t, initPlugin: g, getDefaultTemplate: C, insertDynamicContent: f, closeDynamicContent: v, HeaderWrapper: A };
|
|
94
92
|
}
|
|
95
93
|
});
|
|
96
94
|
export {
|
|
97
|
-
|
|
95
|
+
O as default
|
|
98
96
|
};
|
|
@@ -2,8 +2,8 @@ import i from "./MiddleSlot.vue2.js";
|
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
4
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost",
|
|
6
|
-
}, r = [],
|
|
5
|
+
return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.previewStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), e(t.ViewOptions, { staticClass: "ml-3" }), t.previewStore.isPreviewModeOpen ? e(t.AmpToggle) : o._e()], 1);
|
|
6
|
+
}, r = [], l = /* @__PURE__ */ s(
|
|
7
7
|
i,
|
|
8
8
|
n,
|
|
9
9
|
r,
|
|
@@ -11,7 +11,7 @@ var n = function() {
|
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const u =
|
|
14
|
+
const u = l.exports;
|
|
15
15
|
export {
|
|
16
16
|
u as default
|
|
17
17
|
};
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, computed as s } from "vue";
|
|
2
2
|
import { usePreviewMode as l } from "../../../composables/usePreviewMode.js";
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import
|
|
5
|
-
import { useEditorStore as
|
|
3
|
+
import { useTranslations as d } from "../../../composables/useTranslations.js";
|
|
4
|
+
import w from "../email-preview/amp/AmpToggle.vue.js";
|
|
5
|
+
import { useEditorStore as c } from "../../../stores/editor.js";
|
|
6
6
|
import { usePreviewStore as f } from "../../../stores/preview.js";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import u from "./version-history/
|
|
7
|
+
import { getTooltipOptions as v } from "../../../utils/tooltipUtils.js";
|
|
8
|
+
import { InButtonV2 as a } from "@useinsider/design-system-vue";
|
|
9
|
+
import u from "./version-history/VersionHistory.vue.js";
|
|
10
|
+
import T from "./version-history/ViewOptions.vue.js";
|
|
10
11
|
import P from "./ViewOptions.vue.js";
|
|
11
|
-
const B = /* @__PURE__ */
|
|
12
|
+
const B = /* @__PURE__ */ m({
|
|
12
13
|
__name: "MiddleSlot",
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
return { __sfc: !0, editorStore:
|
|
16
|
-
id: `${n}-tooltip`,
|
|
17
|
-
dynamicPosition: !1,
|
|
18
|
-
staticPosition: "bottom center",
|
|
19
|
-
iconStatus: !1
|
|
20
|
-
}), handlePreviewToggle: () => o.isPreviewModeOpen ? i() : t(), AmpToggle: a, InButtonV2: w, VersionHistory: v, VersionHistoryViewOptions: u, ViewOptions: P };
|
|
14
|
+
setup(_) {
|
|
15
|
+
const t = c(), e = d(), o = f(), { openPreviewMode: r, closePreviewMode: i } = l(), n = s(() => o.isPreviewModeOpen ? e("newsletter.close-email-preview") : e("newsletter.email-preview")), p = s(() => t.isCodeEditorOpen ? e("newsletter.close-html-editor") : e("newsletter.html-editor"));
|
|
16
|
+
return { __sfc: !0, editorStore: t, trans: e, previewStore: o, openPreviewMode: r, closePreviewMode: i, previewTooltipText: n, codeEditorTooltipText: p, handlePreviewToggle: () => o.isPreviewModeOpen ? i() : r(), AmpToggle: w, getTooltipOptions: v, InButtonV2: a, VersionHistory: u, VersionHistoryViewOptions: T, ViewOptions: P };
|
|
21
17
|
}
|
|
22
18
|
});
|
|
23
19
|
export {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var s
|
|
5
|
-
|
|
6
|
-
},
|
|
7
|
-
|
|
1
|
+
import n from "./RightSlot.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
|
+
var s, i;
|
|
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") } }) : 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
9
|
a,
|
|
10
|
+
l,
|
|
10
11
|
!1,
|
|
11
12
|
null,
|
|
12
13
|
null
|
|
13
14
|
);
|
|
14
|
-
const c =
|
|
15
|
+
const c = p.exports;
|
|
15
16
|
export {
|
|
16
17
|
c as default
|
|
17
18
|
};
|
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { defineComponent as y, computed as a } from "vue";
|
|
2
|
+
import { useActionsApi as S } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as H } from "../../../composables/useConfig.js";
|
|
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({
|
|
10
13
|
__name: "RightSlot",
|
|
11
|
-
setup(
|
|
12
|
-
const {
|
|
14
|
+
setup(A) {
|
|
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 = () => {
|
|
13
16
|
if (o.isVersionHistoryOpen) {
|
|
14
|
-
|
|
17
|
+
m();
|
|
15
18
|
return;
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
+
n();
|
|
21
|
+
}, u = a(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), v = async () => {
|
|
22
|
+
s();
|
|
20
23
|
try {
|
|
21
|
-
const { html:
|
|
22
|
-
|
|
23
|
-
html:
|
|
24
|
+
const { html: e } = await r();
|
|
25
|
+
i({
|
|
26
|
+
html: e || "",
|
|
24
27
|
css: ""
|
|
25
28
|
// CSS is embedded in HTML from Stripo
|
|
26
29
|
});
|
|
27
|
-
} catch (
|
|
28
|
-
console.error("Failed to get template data for save:",
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.error("Failed to get template data for save:", e);
|
|
29
32
|
}
|
|
30
|
-
},
|
|
31
|
-
return { __sfc: !0, exportHtml:
|
|
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 };
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
export {
|
|
35
|
-
|
|
38
|
+
q as default
|
|
36
39
|
};
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as p } from "vue";
|
|
2
|
+
import { useTranslations as r } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useEditorStore as s } from "../../../stores/editor.js";
|
|
4
|
+
import { usePreviewStore as m } from "../../../stores/preview.js";
|
|
5
|
+
import { getTooltipOptions as t } from "../../../utils/tooltipUtils.js";
|
|
6
|
+
import { InSegments as l } from "@useinsider/design-system-vue";
|
|
7
|
+
const w = /* @__PURE__ */ p({
|
|
6
8
|
__name: "ViewOptions",
|
|
7
|
-
setup(
|
|
8
|
-
const e =
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
setup(a) {
|
|
10
|
+
const e = s(), o = r(), i = [
|
|
11
|
+
{
|
|
12
|
+
text: "",
|
|
13
|
+
icon: "line-desktop",
|
|
14
|
+
value: "desktop",
|
|
15
|
+
position: "bottom",
|
|
16
|
+
align: "center",
|
|
17
|
+
tooltipText: o("newsletter.desktop"),
|
|
18
|
+
tooltipOptions: t("guido__view-option-desktop")
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
text: "",
|
|
22
|
+
icon: "line-menu-mobileapp",
|
|
23
|
+
value: "mobile",
|
|
24
|
+
position: "bottom",
|
|
25
|
+
align: "center",
|
|
26
|
+
tooltipText: o("newsletter.mobile"),
|
|
27
|
+
tooltipOptions: t("guido__view-option-mobile")
|
|
28
|
+
}
|
|
29
|
+
], n = m();
|
|
30
|
+
return { __sfc: !0, editorStore: e, trans: o, segmentList: i, previewStore: n, InSegments: l };
|
|
13
31
|
}
|
|
14
32
|
});
|
|
15
33
|
export {
|
|
16
|
-
|
|
34
|
+
w as default
|
|
17
35
|
};
|
|
@@ -1,23 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as p } from "vue";
|
|
2
|
+
import { useTranslations as m } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { useVersionHistoryApi as l } from "../../../../composables/useVersionHistoryApi.js";
|
|
4
|
+
import { useVersionHistoryStore as a } from "../../../../stores/version-history.js";
|
|
5
|
+
import { getTooltipOptions as n } from "../../../../utils/tooltipUtils.js";
|
|
6
|
+
import { InSegments as c } from "@useinsider/design-system-vue";
|
|
7
|
+
const h = /* @__PURE__ */ p({
|
|
6
8
|
__name: "ViewOptions",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
setup(u) {
|
|
10
|
+
const t = a(), { switchToDesktopPreview: e, switchToMobilePreview: i } = l(), o = m(), r = [
|
|
11
|
+
{
|
|
12
|
+
text: "",
|
|
13
|
+
icon: "line-desktop",
|
|
14
|
+
value: "desktop",
|
|
15
|
+
position: "bottom",
|
|
16
|
+
align: "center",
|
|
17
|
+
tooltipText: o("newsletter.desktop"),
|
|
18
|
+
tooltipOptions: n("guido__version-history-view-option-desktop")
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
text: "",
|
|
22
|
+
icon: "line-menu-mobileapp",
|
|
23
|
+
value: "mobile",
|
|
24
|
+
position: "bottom",
|
|
25
|
+
align: "center",
|
|
26
|
+
tooltipText: o("newsletter.mobile"),
|
|
27
|
+
tooltipOptions: n("guido__version-history-view-option-mobile")
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
return { __sfc: !0, versionHistoryStore: t, switchToDesktopPreview: e, switchToMobilePreview: i, trans: o, segmentList: r, changeVisualMode: (s) => {
|
|
31
|
+
if (t.editorVisualMode = s, s === "mobile") {
|
|
32
|
+
i();
|
|
15
33
|
return;
|
|
16
34
|
}
|
|
17
|
-
|
|
18
|
-
}, InSegments:
|
|
35
|
+
e();
|
|
36
|
+
}, InSegments: c };
|
|
19
37
|
}
|
|
20
38
|
});
|
|
21
39
|
export {
|
|
22
|
-
|
|
40
|
+
h as default
|
|
23
41
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
|
|
2
2
|
import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { useConfig as s } from "./useConfig.js";
|
|
4
|
+
const R = () => {
|
|
5
|
+
const { config: e } = s(), l = e.htmlCompilerRules || [], t = [
|
|
6
|
+
...!!e.ignoreDefaultHtmlCompilerRules ? [] : r,
|
|
7
|
+
...l.map((o, i) => ({
|
|
7
8
|
...o,
|
|
8
|
-
priority: o.priority + 1e3 +
|
|
9
|
+
priority: o.priority + 1e3 + i
|
|
9
10
|
// Ensure additional rules run after default rules
|
|
10
11
|
}))
|
|
11
|
-
],
|
|
12
|
-
return { compileHtml: (o) =>
|
|
12
|
+
], m = p(t);
|
|
13
|
+
return { compileHtml: (o) => m.compile(o) };
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
R as useHtmlCompiler
|
|
16
17
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import memoize from "../node_modules/lodash-es/memoize.js";
|
|
2
2
|
import { ref } from "vue";
|
|
3
|
+
import { useConfig } from "./useConfig.js";
|
|
3
4
|
const useTranslations = () => {
|
|
4
|
-
const translations = ref(eval(
|
|
5
|
+
const { config } = useConfig(), translations = ref(eval(config.translationsPath)), trans = (n, t) => {
|
|
5
6
|
const r = translations.value[n];
|
|
6
7
|
return r ? t ? Object.entries(t).reduce(
|
|
7
|
-
(e, [o,
|
|
8
|
+
(e, [o, s]) => e.replace(new RegExp(`{${o}}`, "g"), String(s)),
|
|
8
9
|
r
|
|
9
10
|
) : r : (console.warn(`Translation key not found: ${n}`), n);
|
|
10
11
|
};
|
package/dist/enums/defaults.js
CHANGED
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-
|
|
1
|
+
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-aad05c54] .guido__view-option-selection-desktop svg,[data-v-aad05c54] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-aad05c54] .in-segments-wrapper__button_selected,[data-v-aad05c54] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-aad05c54] .in-tooltip-wrapper__icon{cursor:pointer}.guido-editor__wrapper[data-v-baabdaaa],.guido-editor__container[data-v-baabdaaa]{width:100%;height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import r from "./_ListCache.js";
|
|
2
|
+
import a from "./_stackClear.js";
|
|
3
|
+
import p from "./_stackDelete.js";
|
|
4
|
+
import s from "./_stackGet.js";
|
|
5
|
+
import i from "./_stackHas.js";
|
|
6
|
+
import m from "./_stackSet.js";
|
|
7
|
+
function t(o) {
|
|
8
|
+
var e = this.__data__ = new r(o);
|
|
9
|
+
this.size = e.size;
|
|
10
|
+
}
|
|
11
|
+
t.prototype.clear = a;
|
|
12
|
+
t.prototype.delete = p;
|
|
13
|
+
t.prototype.get = s;
|
|
14
|
+
t.prototype.has = i;
|
|
15
|
+
t.prototype.set = m;
|
|
16
|
+
export {
|
|
17
|
+
t as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function t(l, c, e) {
|
|
2
|
+
switch (e.length) {
|
|
3
|
+
case 0:
|
|
4
|
+
return l.call(c);
|
|
5
|
+
case 1:
|
|
6
|
+
return l.call(c, e[0]);
|
|
7
|
+
case 2:
|
|
8
|
+
return l.call(c, e[0], e[1]);
|
|
9
|
+
case 3:
|
|
10
|
+
return l.call(c, e[0], e[1], e[2]);
|
|
11
|
+
}
|
|
12
|
+
return l.apply(c, e);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
t as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import p from "./_baseTimes.js";
|
|
2
|
+
import g from "./isArguments.js";
|
|
3
|
+
import h from "./isArray.js";
|
|
4
|
+
import a from "./isBuffer.js";
|
|
5
|
+
import d from "./_isIndex.js";
|
|
6
|
+
import A from "./isTypedArray.js";
|
|
7
|
+
function c(i, b) {
|
|
8
|
+
var t = h(i), f = !t && g(i), s = !t && !f && a(i), o = !t && !f && !s && A(i), n = t || f || s || o, e = n ? p(i.length, String) : [], m = e.length;
|
|
9
|
+
for (var r in i)
|
|
10
|
+
n && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
11
|
+
(r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
12
|
+
s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
13
|
+
o && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
|
|
14
|
+
d(r, m)) || e.push(r);
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
c as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import t from "./_baseAssignValue.js";
|
|
2
|
+
import i from "./eq.js";
|
|
3
|
+
var s = Object.prototype, p = s.hasOwnProperty;
|
|
4
|
+
function l(r, a, o) {
|
|
5
|
+
var n = r[a];
|
|
6
|
+
(!(p.call(r, a) && i(n, o)) || o === void 0 && !(a in r)) && t(r, a, o);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
l as default
|
|
10
|
+
};
|