@useinsider/guido 3.30.0-beta.60cbdf2 → 3.30.0-beta.60f9fc0
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 +14 -0
- package/dist/components/Guido.vue.js +9 -9
- package/dist/components/Guido.vue2.js +153 -130
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.js +22 -0
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue2.js +30 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +4 -4
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +28 -28
- package/dist/composables/useAutoSave.js +13 -13
- package/dist/composables/useInvalidDynamicContentMarking.js +105 -0
- package/dist/composables/useStripo.js +39 -43
- package/dist/extensions/DynamicContent/dynamic-content.js +39 -57
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +18 -21
- package/dist/src/@types/generic.d.ts +11 -0
- package/dist/src/components/Guido.vue.d.ts +5 -1
- package/dist/src/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.d.ts +22 -0
- package/dist/src/composables/useInvalidDynamicContentMarking.d.ts +4 -0
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +0 -8
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/dynamic-content.d.ts +42 -1
- package/dist/src/stores/editor.d.ts +0 -6
- package/dist/src/utils/editorCanvas.d.ts +3 -0
- package/dist/static/styles/customEditorStyle.css.js +4 -0
- package/dist/stores/dynamic-content.js +19 -7
- package/dist/stores/editor.js +14 -15
- package/dist/utils/editorCanvas.js +18 -0
- package/package.json +1 -1
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-d21be5d5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-d21be5d5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-d21be5d5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}.invalid-dynamic-content-card[data-v-749d0533]{position:fixed;z-index:1000;max-width:280px;padding:12px 16px;border:1px solid #dc2a2a;border-radius:4px;background-color:#fff;box-shadow:0 2px 8px #00000029}.invalid-dynamic-content-card__title[data-v-749d0533]{margin:0 0 4px;font-weight:600;color:#dc2a2a}.invalid-dynamic-content-card__description[data-v-749d0533]{margin:0;color:#4a4a4a}.invalid-dynamic-content-card__action[data-v-749d0533]{margin-top:8px;padding:0;border:none;background:none;color:#0a2ecc;cursor:pointer}.invalid-dynamic-content-card__action[data-v-749d0533]:hover{text-decoration:underline}
|
package/dist/package.json.js
CHANGED
|
@@ -2,22 +2,19 @@ import { useHttp as m } from "../composables/useHttp.js";
|
|
|
2
2
|
import { useToaster as y } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as f } from "../enums/defaults.js";
|
|
4
4
|
import { useBlankTemplate as g } from "./blankTemplate.js";
|
|
5
|
-
const
|
|
5
|
+
const l = () => ({
|
|
6
6
|
id: 0,
|
|
7
7
|
stripoId: 0,
|
|
8
8
|
unsubscriptionPreferencePages: []
|
|
9
|
-
}),
|
|
10
|
-
const { get: s, post:
|
|
9
|
+
}), D = () => {
|
|
10
|
+
const { get: s, post: u } = m(), { handleError: r } = y(), { getBlankTemplate: n } = g();
|
|
11
11
|
return {
|
|
12
12
|
getToken: async () => {
|
|
13
|
-
var t;
|
|
14
13
|
try {
|
|
15
|
-
const { data:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
} catch (e) {
|
|
20
|
-
return r(e, "Failed to fetch token"), "";
|
|
14
|
+
const { data: t } = await s("/stripo/get-user-token");
|
|
15
|
+
return t.body.token;
|
|
16
|
+
} catch (t) {
|
|
17
|
+
return r(t, "Failed to fetch token"), "";
|
|
21
18
|
}
|
|
22
19
|
},
|
|
23
20
|
getCustomFonts: async () => {
|
|
@@ -33,13 +30,13 @@ const p = () => ({
|
|
|
33
30
|
},
|
|
34
31
|
getDefaultTemplate: async () => {
|
|
35
32
|
try {
|
|
36
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
37
|
-
if (!
|
|
38
|
-
return await
|
|
39
|
-
const d = `/stripo/default-template/${
|
|
40
|
-
return !
|
|
33
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), p = t.get("master"), o = e ? parseInt(e) : 0, i = o >= 1 && o <= f ? o : 0;
|
|
34
|
+
if (!i && !p)
|
|
35
|
+
return await n();
|
|
36
|
+
const d = `/stripo/default-template/${i}`, { data: c } = await s(d), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
37
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await n() : a;
|
|
41
38
|
} catch (t) {
|
|
42
|
-
return r(t, "Failed to fetch default template"),
|
|
39
|
+
return r(t, "Failed to fetch default template"), n();
|
|
43
40
|
}
|
|
44
41
|
},
|
|
45
42
|
getSyncModulesStatus: async () => {
|
|
@@ -52,7 +49,7 @@ const p = () => ({
|
|
|
52
49
|
},
|
|
53
50
|
updateSyncModule: async (t) => {
|
|
54
51
|
try {
|
|
55
|
-
return await
|
|
52
|
+
return await u(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
|
|
56
53
|
} catch (e) {
|
|
57
54
|
return r(e, "Failed to update sync module"), !1;
|
|
58
55
|
}
|
|
@@ -60,16 +57,16 @@ const p = () => ({
|
|
|
60
57
|
getSyncModule: async (t) => {
|
|
61
58
|
try {
|
|
62
59
|
const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
|
|
63
|
-
return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e :
|
|
60
|
+
return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e : l();
|
|
64
61
|
} catch (e) {
|
|
65
|
-
return r(e, "Failed to get sync module"),
|
|
62
|
+
return r(e, "Failed to get sync module"), l();
|
|
66
63
|
}
|
|
67
64
|
},
|
|
68
65
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
69
66
|
if (t.length === 0)
|
|
70
67
|
return !0;
|
|
71
68
|
try {
|
|
72
|
-
return await
|
|
69
|
+
return await u("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
|
|
73
70
|
} catch (e) {
|
|
74
71
|
return r(e, "Failed to set unsubscription preference pages"), !1;
|
|
75
72
|
}
|
|
@@ -77,5 +74,5 @@ const p = () => ({
|
|
|
77
74
|
};
|
|
78
75
|
};
|
|
79
76
|
export {
|
|
80
|
-
|
|
77
|
+
D as useStripoApi
|
|
81
78
|
};
|
|
@@ -13,6 +13,13 @@ export type BaseDynamicContent = {
|
|
|
13
13
|
export type DynamicContent = BaseDynamicContent & {
|
|
14
14
|
text: string;
|
|
15
15
|
};
|
|
16
|
+
export type InvalidDynamicContent = {
|
|
17
|
+
value: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
actionLabel: string;
|
|
21
|
+
actionAvailable: boolean;
|
|
22
|
+
};
|
|
16
23
|
/**
|
|
17
24
|
* A node in the partner-keyed dynamic-content tree (backend categorized-fields
|
|
18
25
|
* shape). Category nodes carry `children`/`select_items`; leaf nodes are the
|
|
@@ -54,6 +61,10 @@ export type DynamicContentEvent = {
|
|
|
54
61
|
attribute: DynamicContent;
|
|
55
62
|
position?: PositionData;
|
|
56
63
|
};
|
|
64
|
+
export type InvalidDynamicContentHoverEvent = {
|
|
65
|
+
entry: InvalidDynamicContent;
|
|
66
|
+
position: PositionData;
|
|
67
|
+
};
|
|
57
68
|
export type MergeTagClickEvent = {
|
|
58
69
|
position: PositionData;
|
|
59
70
|
element: HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent, GuidoConfigInput } from '@@/Types/config';
|
|
2
|
-
import type { PositionData } from '@@/Types/generic';
|
|
2
|
+
import type { InvalidDynamicContent, PositionData } from '@@/Types/generic';
|
|
3
3
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
/** Guido configuration object */
|
|
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
13
13
|
dynamicContent: {
|
|
14
14
|
insert: (data: DynamicContent) => void;
|
|
15
15
|
close: () => void;
|
|
16
|
+
setInvalid: (list: InvalidDynamicContent[]) => void;
|
|
16
17
|
};
|
|
17
18
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
19
|
saveSilent: () => Promise<{
|
|
@@ -50,6 +51,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
50
51
|
ready: () => void;
|
|
51
52
|
"onboarding:finished": () => void;
|
|
52
53
|
"test-email:click": () => void;
|
|
54
|
+
"dynamic-content:invalid-action": (detail: {
|
|
55
|
+
value: string;
|
|
56
|
+
}) => void;
|
|
53
57
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
54
58
|
ready: boolean;
|
|
55
59
|
}>>>, {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InvalidDynamicContent, PositionData } from '@@/Types/generic';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
entry: InvalidDynamicContent;
|
|
4
|
+
position: PositionData;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
7
|
+
"dynamic-content:invalid-action": (detail: {
|
|
8
|
+
value: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
mouseenter: () => void;
|
|
11
|
+
mouseleave: () => void;
|
|
12
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToOption<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -37,10 +37,6 @@ export declare class DynamicContentUiElementExtension extends UIElement {
|
|
|
37
37
|
* Workaround from Stripo intercepting click events - tracks mousedown events instead
|
|
38
38
|
*/
|
|
39
39
|
private _setupCoordinateTracking;
|
|
40
|
-
/**
|
|
41
|
-
* Gets the editor iframe element
|
|
42
|
-
*/
|
|
43
|
-
private _getEditorFrame;
|
|
44
40
|
/**
|
|
45
41
|
* Finds merge tag element in the element tree
|
|
46
42
|
*/
|
|
@@ -50,10 +46,6 @@ export declare class DynamicContentUiElementExtension extends UIElement {
|
|
|
50
46
|
* This ensures we always use the correct element's position even with rapid clicks
|
|
51
47
|
*/
|
|
52
48
|
private _getLastClickedPosition;
|
|
53
|
-
/**
|
|
54
|
-
* Calculates absolute position of element relative to page
|
|
55
|
-
*/
|
|
56
|
-
private _calculateAbsolutePosition;
|
|
57
49
|
/**
|
|
58
50
|
* Cleans up the coordinate tracking event listener
|
|
59
51
|
*/
|
package/dist/src/library.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { useGuidoEmailEditorStore } from './public/editorState';
|
|
|
6
6
|
export type { GuidoEmailEditorState } from './public/editorState';
|
|
7
7
|
export { prefetchGuidoRuntime } from './public/prefetchRuntime';
|
|
8
8
|
export type { StripoEventType } from './@types/events';
|
|
9
|
-
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
9
|
+
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, InvalidDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
1
|
+
import type { DynamicContent, InvalidDynamicContent } from '@@/Types/generic';
|
|
2
2
|
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
|
|
3
3
|
selectedDynamicContent: DynamicContent;
|
|
4
4
|
selectedDynamicContentList: DynamicContent[];
|
|
5
|
+
invalidDynamicContentList: InvalidDynamicContent[];
|
|
5
6
|
}, {
|
|
6
7
|
getSelectedDynamicContentList: (state: {
|
|
7
8
|
selectedDynamicContent: {
|
|
@@ -22,9 +23,17 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
22
23
|
} | undefined;
|
|
23
24
|
text: string;
|
|
24
25
|
}[];
|
|
26
|
+
invalidDynamicContentList: {
|
|
27
|
+
value: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
actionLabel: string;
|
|
31
|
+
actionAvailable: boolean;
|
|
32
|
+
}[];
|
|
25
33
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
26
34
|
selectedDynamicContent: DynamicContent;
|
|
27
35
|
selectedDynamicContentList: DynamicContent[];
|
|
36
|
+
invalidDynamicContentList: InvalidDynamicContent[];
|
|
28
37
|
}>) => {
|
|
29
38
|
text: string;
|
|
30
39
|
value: string;
|
|
@@ -34,6 +43,37 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
34
43
|
value: string;
|
|
35
44
|
} | undefined;
|
|
36
45
|
}[];
|
|
46
|
+
getInvalidDynamicContent: (state: {
|
|
47
|
+
selectedDynamicContent: {
|
|
48
|
+
value: string;
|
|
49
|
+
fallback?: string | undefined;
|
|
50
|
+
format?: {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
} | undefined;
|
|
54
|
+
text: string;
|
|
55
|
+
};
|
|
56
|
+
selectedDynamicContentList: {
|
|
57
|
+
value: string;
|
|
58
|
+
fallback?: string | undefined;
|
|
59
|
+
format?: {
|
|
60
|
+
key: string;
|
|
61
|
+
value: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
invalidDynamicContentList: {
|
|
66
|
+
value: string;
|
|
67
|
+
title: string;
|
|
68
|
+
description: string;
|
|
69
|
+
actionLabel: string;
|
|
70
|
+
actionAvailable: boolean;
|
|
71
|
+
}[];
|
|
72
|
+
} & import("pinia").PiniaCustomStateProperties<{
|
|
73
|
+
selectedDynamicContent: DynamicContent;
|
|
74
|
+
selectedDynamicContentList: DynamicContent[];
|
|
75
|
+
invalidDynamicContentList: InvalidDynamicContent[];
|
|
76
|
+
}>) => (value: string) => InvalidDynamicContent | undefined;
|
|
37
77
|
}, {
|
|
38
78
|
setSelectedDynamicContent(dynamicContent: DynamicContent): void;
|
|
39
79
|
/**
|
|
@@ -44,4 +84,5 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
44
84
|
* reactivity can't write a later mutation back into the host's catalog.
|
|
45
85
|
*/
|
|
46
86
|
registerDynamicContent(items: DynamicContent[]): void;
|
|
87
|
+
setInvalidDynamicContent(list: unknown): void;
|
|
47
88
|
}>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { ColorVisionDeficiency } from '@@/Types/api/accessibility-api';
|
|
2
|
-
type EditorReadiness = {
|
|
3
|
-
loadingStatus: boolean;
|
|
4
|
-
isStripoInitialized: boolean;
|
|
5
|
-
};
|
|
6
2
|
export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEditor", {
|
|
7
3
|
loadingStatus: boolean;
|
|
8
4
|
isCodeEditorOpen: boolean;
|
|
@@ -21,7 +17,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
21
17
|
syncModulesEnabled: boolean;
|
|
22
18
|
trackIdSessionFloor: number;
|
|
23
19
|
}, {
|
|
24
|
-
isEditorUnavailable: (state: EditorReadiness) => boolean;
|
|
25
20
|
isEditorToolbarVisible: (state: {
|
|
26
21
|
loadingStatus: boolean;
|
|
27
22
|
isCodeEditorOpen: boolean;
|
|
@@ -478,4 +473,3 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
478
473
|
trackIdSessionFloor: number;
|
|
479
474
|
}>) => boolean;
|
|
480
475
|
}, {}>;
|
|
481
|
-
export {};
|
|
@@ -9,6 +9,10 @@ const n = `.esd-x,
|
|
|
9
9
|
border-radius: 4px !important;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
merge-tag-selector {
|
|
13
|
+
--guido-dc-invalid-color: #dc2a2a;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
.ue-preview-control-wrapper ue-icon-component:not([disabled=true]):not(.stripo-static-icon):hover {
|
|
13
17
|
background: none;
|
|
14
18
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { removeDuplicatesFromArray as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { removeDuplicatesFromArray as i } from "../utils/arrayUtil.js";
|
|
2
|
+
import { isPlainObject as o } from "../utils/genericUtil.js";
|
|
3
|
+
import { defineStore as l } from "pinia";
|
|
4
|
+
const n = (t) => typeof t == "string" ? t : "", c = (t) => !o(t) || typeof t.value != "string" || t.value === "" ? null : {
|
|
5
|
+
value: t.value,
|
|
6
|
+
title: n(t.title),
|
|
7
|
+
description: n(t.description),
|
|
8
|
+
actionLabel: n(t.actionLabel),
|
|
9
|
+
actionAvailable: t.actionAvailable === !0
|
|
10
|
+
}, m = l("guidoDynamicContent", {
|
|
4
11
|
state: () => ({
|
|
5
12
|
selectedDynamicContent: { text: "", value: "" },
|
|
6
|
-
selectedDynamicContentList: []
|
|
13
|
+
selectedDynamicContentList: [],
|
|
14
|
+
invalidDynamicContentList: []
|
|
7
15
|
}),
|
|
8
16
|
actions: {
|
|
9
17
|
setSelectedDynamicContent(t) {
|
|
@@ -18,17 +26,21 @@ const c = a("guidoDynamicContent", {
|
|
|
18
26
|
*/
|
|
19
27
|
registerDynamicContent(t) {
|
|
20
28
|
this.selectedDynamicContentList.push(...t.map((e) => ({ ...e })));
|
|
29
|
+
},
|
|
30
|
+
setInvalidDynamicContent(t) {
|
|
31
|
+
this.invalidDynamicContentList = Array.isArray(t) ? t.map(c).filter((e) => e !== null) : [];
|
|
21
32
|
}
|
|
22
33
|
},
|
|
23
34
|
getters: {
|
|
24
|
-
getSelectedDynamicContentList: (t) =>
|
|
35
|
+
getSelectedDynamicContentList: (t) => i(t.selectedDynamicContentList).map((e) => ({
|
|
25
36
|
text: e.text,
|
|
26
37
|
value: e.value,
|
|
27
38
|
fallback: e.fallback,
|
|
28
39
|
format: e.format
|
|
29
|
-
}))
|
|
40
|
+
})),
|
|
41
|
+
getInvalidDynamicContent: (t) => (e) => t.invalidDynamicContentList.find((a) => a.value === e)
|
|
30
42
|
}
|
|
31
43
|
});
|
|
32
44
|
export {
|
|
33
|
-
|
|
45
|
+
m as useDynamicContentStore
|
|
34
46
|
};
|
package/dist/stores/editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
const
|
|
1
|
+
import { defineStore as e } from "pinia";
|
|
2
|
+
const o = e("guidoEditor", {
|
|
3
3
|
state: () => ({
|
|
4
4
|
loadingStatus: !0,
|
|
5
5
|
isCodeEditorOpen: !1,
|
|
@@ -24,26 +24,25 @@ const e = (i) => i.loadingStatus || !i.isStripoInitialized, n = s("guidoEditor",
|
|
|
24
24
|
trackIdSessionFloor: 0
|
|
25
25
|
}),
|
|
26
26
|
getters: {
|
|
27
|
-
isEditorUnavailable: e,
|
|
28
27
|
// Middle Slot
|
|
29
28
|
isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
|
|
30
|
-
isUndoButtonDisabled: (i) =>
|
|
31
|
-
isRedoButtonDisabled: (i) =>
|
|
32
|
-
isCodeEditorButtonDisabled: (i) =>
|
|
33
|
-
isPreviewButtonDisabled: (i) =>
|
|
34
|
-
isViewOptionsDisabled: (i) =>
|
|
29
|
+
isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
30
|
+
isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
31
|
+
isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
32
|
+
isPreviewButtonDisabled: (i) => i.loadingStatus,
|
|
33
|
+
isViewOptionsDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
35
34
|
// Right Slot
|
|
36
35
|
isNormalMode: (i) => !i.isVersionHistoryOpen && !i.isAccessibilityTestingOpen,
|
|
37
|
-
isVersionHistoryButtonDisabled: (i) =>
|
|
38
|
-
isExportButtonDisabled: (i) =>
|
|
39
|
-
isSaveAsButtonDisabled: (i) =>
|
|
40
|
-
isTestButtonDisabled: (i) =>
|
|
41
|
-
isSaveButtonDisabled: (i) =>
|
|
36
|
+
isVersionHistoryButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
37
|
+
isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
|
|
38
|
+
isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
|
|
39
|
+
isTestButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
|
|
40
|
+
isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
|
|
42
41
|
// Accessibility Test is absent on purpose: it only simulates, but its Apply / Auto-tune
|
|
43
42
|
// edit the document, so pausing autosave there would lose those fixes.
|
|
44
|
-
isInSaveableState: (i) => !
|
|
43
|
+
isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
|
|
45
44
|
}
|
|
46
45
|
});
|
|
47
46
|
export {
|
|
48
|
-
|
|
47
|
+
o as useEditorStore
|
|
49
48
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { findEditorShadowRoot as i } from "./editorShadowRoot.js";
|
|
2
|
+
const c = () => {
|
|
3
|
+
var e, n;
|
|
4
|
+
const t = (e = i()) == null ? void 0 : e.querySelector("iframe");
|
|
5
|
+
return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
|
|
6
|
+
}, d = (t, e) => {
|
|
7
|
+
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
8
|
+
return {
|
|
9
|
+
x: n.x + o.x,
|
|
10
|
+
y: n.y + o.y,
|
|
11
|
+
width: o.width,
|
|
12
|
+
height: o.height
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
d as getCanvasElementPosition,
|
|
17
|
+
c as getEditorCanvasFrame
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.30.0-beta.
|
|
3
|
+
"version": "3.30.0-beta.60f9fc0",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|