@useinsider/guido 1.0.0-beta.63d99fe → 1.0.0-beta.67efae2
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 +7 -4
- package/dist/components/Guido.vue.d.ts +1 -6
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +38 -58
- package/dist/components/organisms/header/RightSlot.vue.js +10 -9
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -24
- package/dist/composables/useConfig.d.ts +5 -0
- package/dist/composables/useConfig.js +11 -0
- package/dist/composables/useHtmlCompiler.js +9 -8
- package/dist/composables/useStripo.js +15 -25
- package/dist/composables/useTranslations.js +3 -2
- package/dist/enums/defaults.js +10 -5
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -13
- 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 +0 -2
- package/dist/stores/editor.js +3 -5
- package/package.json +1 -2
- package/dist/@types/save-as-template.d.ts +0 -11
- 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 -58
- 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 -30
- package/dist/composables/useValidation.js +0 -19
- package/dist/composables/validators/saveAsTemplate.d.ts +0 -26
- package/dist/composables/validators/saveAsTemplate.js +0 -21
- package/dist/mock/api/template-library.d.ts +0 -2
- package/dist/node_modules/valibot/dist/index.js +0 -157
- package/dist/stores/dynamic-content.d.ts +0 -27
- package/dist/stores/dynamic-content.js +0 -23
- package/dist/stores/save-as-template.d.ts +0 -25
- package/dist/stores/save-as-template.js +0 -44
- package/dist/utils/arrayUtil.d.ts +0 -1
- package/dist/utils/arrayUtil.js +0 -10
- package/dist/utils/genericUtil.d.ts +0 -2
- package/dist/utils/genericUtil.js +0 -7
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,15 +1,18 @@
|
|
|
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;
|
|
11
|
+
features?: Features;
|
|
6
12
|
};
|
|
7
13
|
export type DynamicContent = {
|
|
8
14
|
value: string;
|
|
9
15
|
text: string;
|
|
10
16
|
fallback?: string;
|
|
11
17
|
};
|
|
12
|
-
export
|
|
13
|
-
label: string;
|
|
14
|
-
value: string;
|
|
15
|
-
};
|
|
18
|
+
export {};
|
|
@@ -8,7 +8,6 @@ type __VLS_Props = {
|
|
|
8
8
|
username?: string;
|
|
9
9
|
html?: string;
|
|
10
10
|
css?: string;
|
|
11
|
-
preselectedDynamicContentList: DynamicContent[];
|
|
12
11
|
guidoConfig: GuidoConfig;
|
|
13
12
|
};
|
|
14
13
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
@@ -16,15 +15,11 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
16
15
|
insert: (data: DynamicContent) => void;
|
|
17
16
|
close: () => void;
|
|
18
17
|
};
|
|
19
|
-
hasChanges: import("vue").ComputedRef<boolean>;
|
|
20
18
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
21
19
|
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
22
20
|
back: () => void;
|
|
23
21
|
"save:start": () => void;
|
|
24
|
-
"save:complete": (
|
|
25
|
-
template: Omit<Template, "forceRecreate">;
|
|
26
|
-
dynamicContentList: DynamicContent[];
|
|
27
|
-
}) => void;
|
|
22
|
+
"save:complete": (template: Omit<Template, "forceRecreate">) => void;
|
|
28
23
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
29
24
|
export default _default;
|
|
30
25
|
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
|
|
3
|
+
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var s = function() {
|
|
5
5
|
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })
|
|
7
|
-
},
|
|
8
|
-
|
|
6
|
+
return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
|
|
7
|
+
}, _ = [], a = /* @__PURE__ */ i(
|
|
8
|
+
o,
|
|
9
9
|
s,
|
|
10
|
-
|
|
10
|
+
_,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"f8c4b3c5"
|
|
14
14
|
);
|
|
15
|
-
const f =
|
|
15
|
+
const f = a.exports;
|
|
16
16
|
export {
|
|
17
17
|
f as default
|
|
18
18
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
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
|
-
|
|
10
|
-
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
-
const O = /* @__PURE__ */ w({
|
|
1
|
+
import { defineComponent as h, onMounted as w } from "vue";
|
|
2
|
+
import { provideGuidoActions as D } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as E } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as S } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as _, DefaultGuidoConfig as G } from "../enums/defaults.js";
|
|
6
|
+
import I from "./organisms/header/HeaderWrapper.vue.js";
|
|
7
|
+
import { useStripoApi as k } from "../services/stripoApi.js";
|
|
8
|
+
import P from "../node_modules/lodash-es/merge.js";
|
|
9
|
+
const H = /* @__PURE__ */ h({
|
|
12
10
|
__name: "Guido",
|
|
13
11
|
props: {
|
|
14
12
|
templateId: null,
|
|
@@ -18,34 +16,23 @@ const O = /* @__PURE__ */ w({
|
|
|
18
16
|
username: null,
|
|
19
17
|
html: null,
|
|
20
18
|
css: null,
|
|
21
|
-
preselectedDynamicContentList: null,
|
|
22
19
|
guidoConfig: null
|
|
23
20
|
},
|
|
24
21
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
|
|
25
|
-
setup(
|
|
26
|
-
const o =
|
|
27
|
-
templateId:
|
|
28
|
-
userId:
|
|
29
|
-
guidoConfig:
|
|
30
|
-
html:
|
|
31
|
-
css:
|
|
32
|
-
partnerName:
|
|
33
|
-
productType:
|
|
34
|
-
username:
|
|
22
|
+
setup(C, { expose: b, emit: t }) {
|
|
23
|
+
const o = C, { getPartnerName: n, getProductType: a } = E(), {
|
|
24
|
+
templateId: c,
|
|
25
|
+
userId: r,
|
|
26
|
+
guidoConfig: s,
|
|
27
|
+
html: i = "",
|
|
28
|
+
css: l = "",
|
|
29
|
+
partnerName: d = n(),
|
|
30
|
+
productType: u = a(),
|
|
31
|
+
username: m = _
|
|
35
32
|
} = o;
|
|
36
|
-
window.GuidoConfig =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
const { initPlugin: f } = T({
|
|
41
|
-
emailId: m,
|
|
42
|
-
userId: d,
|
|
43
|
-
username: C,
|
|
44
|
-
partnerName: y,
|
|
45
|
-
productType: g,
|
|
46
|
-
preselectedDynamicContentList: c
|
|
47
|
-
}), { getDefaultTemplate: v } = x();
|
|
48
|
-
G({
|
|
33
|
+
window.GuidoConfig = P(G, s);
|
|
34
|
+
const { initPlugin: p } = S({ emailId: c, userId: r, username: m, partnerName: d, productType: u }), { getDefaultTemplate: g } = k();
|
|
35
|
+
D({
|
|
49
36
|
onBack: () => {
|
|
50
37
|
console.debug("guido:back"), t("back");
|
|
51
38
|
},
|
|
@@ -53,46 +40,39 @@ const O = /* @__PURE__ */ w({
|
|
|
53
40
|
console.debug("guido:save:start"), t("save:start");
|
|
54
41
|
},
|
|
55
42
|
onSaveComplete: (e) => {
|
|
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
|
-
});
|
|
43
|
+
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
63
44
|
}
|
|
64
45
|
});
|
|
65
|
-
const
|
|
66
|
-
console.debug("dynamic-content:close", e),
|
|
67
|
-
},
|
|
46
|
+
const f = (e) => {
|
|
47
|
+
console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
48
|
+
}, y = () => {
|
|
68
49
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
69
50
|
};
|
|
70
|
-
return
|
|
51
|
+
return w(async () => {
|
|
71
52
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
72
53
|
try {
|
|
73
54
|
let e = {
|
|
74
|
-
html:
|
|
75
|
-
css:
|
|
55
|
+
html: i,
|
|
56
|
+
css: l,
|
|
76
57
|
forceRecreate: !0
|
|
77
58
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
78
59
|
};
|
|
79
|
-
e.html || (e = await
|
|
60
|
+
e.html || (e = await g()), await p(e);
|
|
80
61
|
} catch (e) {
|
|
81
62
|
console.error("Failed to initialize Stripo editor:", e);
|
|
82
63
|
}
|
|
83
64
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
84
|
-
const
|
|
85
|
-
console.debug("dynamic-content:open",
|
|
65
|
+
const v = e;
|
|
66
|
+
console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
|
|
86
67
|
});
|
|
87
|
-
}),
|
|
68
|
+
}), b({
|
|
88
69
|
dynamicContent: {
|
|
89
|
-
insert:
|
|
90
|
-
close:
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
}), { __sfc: !0, dynamicContentStore: n, props: o, editorStore: s, hasChanges: a, preselectedDynamicContentList: c, getPartnerName: i, getProductType: r, templateId: m, userId: d, guidoConfig: l, html: u, css: p, partnerName: y, productType: g, username: C, emit: t, initPlugin: f, getDefaultTemplate: v, insertDynamicContent: D, closeDynamicContent: S, HeaderWrapper: A, SaveAsTemplateDrawer: N };
|
|
70
|
+
insert: f,
|
|
71
|
+
close: y
|
|
72
|
+
}
|
|
73
|
+
}), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: r, guidoConfig: s, html: i, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: g, insertDynamicContent: f, closeDynamicContent: y, HeaderWrapper: I };
|
|
94
74
|
}
|
|
95
75
|
});
|
|
96
76
|
export {
|
|
97
|
-
|
|
77
|
+
H as default
|
|
98
78
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
1
|
+
import n from "./RightSlot.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
|
+
var o, i;
|
|
4
5
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
5
|
-
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }
|
|
6
|
-
},
|
|
7
|
-
o,
|
|
6
|
+
return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }) : s._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 }, 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 } }) : s._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 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
|
|
7
|
+
}, l = [], d = /* @__PURE__ */ r(
|
|
8
8
|
n,
|
|
9
|
-
|
|
9
|
+
a,
|
|
10
|
+
l,
|
|
10
11
|
!1,
|
|
11
12
|
null,
|
|
12
13
|
null
|
|
13
14
|
);
|
|
14
|
-
const
|
|
15
|
+
const f = d.exports;
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
f as default
|
|
17
18
|
};
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { defineComponent as p } from "vue";
|
|
2
|
+
import { useActionsApi as c } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as l } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as f } from "../../../composables/useExport.js";
|
|
5
|
+
import { useSaveStart as u, useSaveComplete as d } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useVersionHistoryApi as S } from "../../../composables/useVersionHistoryApi.js";
|
|
7
|
+
import { useEditorStore as h } from "../../../stores/editor.js";
|
|
8
|
+
import { InButtonV2 as y } from "@useinsider/design-system-vue";
|
|
9
|
+
const F = /* @__PURE__ */ p({
|
|
9
10
|
__name: "RightSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const { exportHtml: a } =
|
|
12
|
-
return { __sfc: !0, exportHtml: a, getCompiledEmail:
|
|
13
|
-
if (
|
|
14
|
-
|
|
11
|
+
setup(_) {
|
|
12
|
+
const { config: m } = l(), { exportHtml: a } = f(), { getCompiledEmail: t } = c(), e = u(), r = d(), { openVersionHistory: s, closeVersionHistory: n } = S(), i = h();
|
|
13
|
+
return { __sfc: !0, config: m, exportHtml: a, getCompiledEmail: t, saveStart: e, saveComplete: r, openVersionHistory: s, closeVersionHistory: n, editorStore: i, handleVersionHistory: () => {
|
|
14
|
+
if (i.isVersionHistoryOpen) {
|
|
15
|
+
n();
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
}, handleSaveAs: () => {
|
|
19
|
-
e.isSaveAsTemplateDrawerOpen = !0;
|
|
18
|
+
s();
|
|
20
19
|
}, handleSave: async () => {
|
|
21
|
-
|
|
20
|
+
e();
|
|
22
21
|
try {
|
|
23
|
-
const { html:
|
|
24
|
-
|
|
25
|
-
html:
|
|
22
|
+
const { html: o } = await t();
|
|
23
|
+
r({
|
|
24
|
+
html: o || "",
|
|
26
25
|
css: ""
|
|
27
26
|
// CSS is embedded in HTML from Stripo
|
|
28
27
|
});
|
|
29
|
-
} catch (
|
|
30
|
-
console.error("Failed to get template data for save:",
|
|
28
|
+
} catch (o) {
|
|
29
|
+
console.error("Failed to get template data for save:", o);
|
|
31
30
|
}
|
|
32
|
-
}, InButtonV2:
|
|
31
|
+
}, InButtonV2: y };
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
F as default
|
|
37
36
|
};
|
|
@@ -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,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,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
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
translationsPath: "window.trans.en"
|
|
3
|
-
|
|
1
|
+
const e = {
|
|
2
|
+
translationsPath: "window.trans.en",
|
|
3
|
+
features: {
|
|
4
|
+
dynamicContent: !0,
|
|
5
|
+
saveAsTemplate: !0,
|
|
6
|
+
versionHistory: !0
|
|
7
|
+
}
|
|
8
|
+
}, t = "newsletter", n = "Guido User";
|
|
4
9
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
e as DefaultGuidoConfig,
|
|
11
|
+
t as DefaultProductType,
|
|
7
12
|
n as DefaultUsername
|
|
8
13
|
};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (i, t, e) =>
|
|
4
|
-
import { dynamicContentToMergeTags as l } from "../../utils/genericUtil.js";
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var o = (i, t, e) => t in i ? l(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => o(i, typeof t != "symbol" ? t + "" : t, e);
|
|
5
4
|
import { d as n } from "../../_virtual/index.js";
|
|
6
|
-
import { ExternalMergeTagsLibrary as
|
|
7
|
-
const a = "external-dynamic-content-ui-element",
|
|
8
|
-
class
|
|
5
|
+
import { ExternalMergeTagsLibrary as c } from "./dynamic-content-modal.js";
|
|
6
|
+
const a = "external-dynamic-content-ui-element", m = "button-add-dynamic-content";
|
|
7
|
+
class d extends n.UIElementTagRegistry {
|
|
9
8
|
registerUiElements(t) {
|
|
10
9
|
t[n.UIElementType.MERGETAGS] = a;
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
|
-
class
|
|
12
|
+
class b extends n.UIElement {
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments);
|
|
16
15
|
r(this, "mergeTagsButton", null);
|
|
@@ -34,10 +33,13 @@ class u extends n.UIElement {
|
|
|
34
33
|
this.openMergeTagLibrary();
|
|
35
34
|
}
|
|
36
35
|
openMergeTagLibrary() {
|
|
37
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
36
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new c()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
38
37
|
this.selectedDynamicContent,
|
|
39
38
|
(e) => {
|
|
40
|
-
this.api.onValueChanged(
|
|
39
|
+
this.api.onValueChanged({
|
|
40
|
+
label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
|
|
41
|
+
value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
|
|
42
|
+
});
|
|
41
43
|
}
|
|
42
44
|
);
|
|
43
45
|
}
|
|
@@ -47,7 +49,7 @@ class u extends n.UIElement {
|
|
|
47
49
|
<${n.UIElementType.BUTTON}
|
|
48
50
|
id="guido__btn-add-dynamic-content"
|
|
49
51
|
class="btn btn-primary"
|
|
50
|
-
${n.UEAttr.BUTTON.name}="${
|
|
52
|
+
${n.UEAttr.BUTTON.name}="${m}">
|
|
51
53
|
<${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
|
|
52
54
|
</${n.UIElementType.ICON}>
|
|
53
55
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -56,6 +58,6 @@ class u extends n.UIElement {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
d as DynamicContentTagRegistry,
|
|
62
|
+
b as DynamicContentUiElementExtension
|
|
61
63
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-
|
|
1
|
+
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-f8c4b3c5],.guido-editor__container[data-v-f8c4b3c5]{width:100%;height:calc(100vh - 75px)}
|
|
@@ -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
|
+
};
|