@useinsider/guido 3.12.0-beta.b73c720 → 3.12.0-beta.b94f28c
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 +16 -1
- package/dist/@types/config/schemas.js +24 -27
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +111 -103
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/composables/useAllowlist.js +50 -0
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendation.js +51 -82
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useSave.js +42 -23
- package/dist/composables/useStripo.js +72 -69
- package/dist/composables/useUserRole.js +12 -0
- package/dist/config/migrator/recommendationMigrator.js +4 -7
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +22 -28
- package/dist/enums/roles.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -12
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +109 -123
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +12 -12
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +102 -256
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +7 -7
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -24
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/allowlistApi.js +15 -0
- package/dist/services/recommendationApi.js +27 -65
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +10 -10
- package/dist/src/components/Guido.vue.d.ts +18 -2
- package/dist/src/composables/useAllowlist.d.ts +6 -0
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +0 -2
- package/dist/src/composables/useStripo.d.ts +3 -2
- package/dist/src/composables/useUserRole.d.ts +3 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -10
- package/dist/src/enums/roles.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -606
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -3
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/services/allowlistApi.d.ts +4 -0
- package/dist/src/services/recommendationApi.d.ts +1 -7
- package/dist/src/stores/config.d.ts +21 -19
- package/dist/src/utils/genericUtil.d.ts +0 -9
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/static/styles/base.css.js +0 -15
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/stores/config.js +21 -19
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/genericUtil.js +1 -10
- package/dist/utils/pairProductVariables.js +44 -43
- package/dist/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.js +1 -1
- package/dist/utils/templatePreparation.js +58 -62
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +0 -36
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +0 -244
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +0 -42
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +0 -18
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +0 -60
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +0 -19
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +0 -19
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +0 -22
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +0 -29
- package/dist/composables/useStrategyFilters.js +0 -16
- package/dist/enums/extensions/filteringV2.js +0 -8
- package/dist/enums/extensions/strategyDetail.js +0 -148
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -146
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +0 -97
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +0 -10
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +0 -43
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +0 -29
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +0 -40
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +0 -38
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +0 -51
- package/dist/src/composables/useStrategyFilters.d.ts +0 -24
- package/dist/src/enums/extensions/filteringV2.d.ts +0 -72
- package/dist/src/enums/extensions/strategyDetail.d.ts +0 -90
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -61
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +0 -50
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +0 -34
- /package/dist/src/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.d.ts +0 -0
package/README.md
CHANGED
|
@@ -150,7 +150,7 @@ const config: GuidoConfigInput = {
|
|
|
150
150
|
backButtonLabel?: string,
|
|
151
151
|
},
|
|
152
152
|
|
|
153
|
-
// Optional: Feature toggles
|
|
153
|
+
// Optional: Feature toggles (defaults apply once initialized — see `ready` prop below)
|
|
154
154
|
features?: {
|
|
155
155
|
dynamicContent?: boolean, // Default: true
|
|
156
156
|
saveAsTemplate?: boolean, // Default: true
|
|
@@ -161,6 +161,7 @@ const config: GuidoConfigInput = {
|
|
|
161
161
|
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
162
162
|
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
163
163
|
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
164
|
+
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
164
165
|
},
|
|
165
166
|
|
|
166
167
|
// Optional: Callbacks
|
|
@@ -182,6 +183,19 @@ const config: GuidoConfigInput = {
|
|
|
182
183
|
};
|
|
183
184
|
```
|
|
184
185
|
|
|
186
|
+
### `ready` prop
|
|
187
|
+
|
|
188
|
+
```vue
|
|
189
|
+
<Guido :config="config" :ready="isConfigLoaded" />
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Optional, defaults to `true` — existing call sites need no change. Pass `false` to mount
|
|
193
|
+
Guido *before* `config` is fetched: it preloads the ~8 MB editor runtime immediately and
|
|
194
|
+
defers config validation + editor init until `ready` flips to `true`.
|
|
195
|
+
|
|
196
|
+
`config` must be final at that flip (later mutations don't re-initialize), and the flip is
|
|
197
|
+
one-way. While `ready` is `false` every `features` toggle reads as disabled.
|
|
198
|
+
|
|
185
199
|
---
|
|
186
200
|
|
|
187
201
|
## Events
|
|
@@ -637,6 +651,7 @@ bun run lint
|
|
|
637
651
|
VITE_STRIPO_PLUGIN_ID=your_plugin_id
|
|
638
652
|
VITE_STRIPO_SECRET_KEY=your_secret_key
|
|
639
653
|
VITE_STRIPO_ROLE=your_role
|
|
654
|
+
VITE_STRIPO_USER=your_user
|
|
640
655
|
```
|
|
641
656
|
|
|
642
657
|
---
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
6
6
|
/** Transactional/system emails */
|
|
7
7
|
TRANSACTIONAL: 2
|
|
8
|
-
},
|
|
8
|
+
}, l = {
|
|
9
9
|
/** Standard email campaigns */
|
|
10
10
|
EMAIL: 60,
|
|
11
11
|
/** Architect journey builder */
|
|
@@ -38,16 +38,16 @@ const d = {
|
|
|
38
38
|
),
|
|
39
39
|
/** Product type identifier */
|
|
40
40
|
productType: e(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
r([
|
|
42
|
+
l.EMAIL,
|
|
43
|
+
l.ARCHITECT,
|
|
44
|
+
l.UNSUBSCRIBE_PAGES
|
|
45
45
|
]),
|
|
46
|
-
|
|
46
|
+
l.EMAIL
|
|
47
47
|
),
|
|
48
48
|
/** Message type (promotional or transactional) */
|
|
49
49
|
messageType: e(
|
|
50
|
-
|
|
50
|
+
r([d.PROMOTIONAL, d.TRANSACTIONAL]),
|
|
51
51
|
d.PROMOTIONAL
|
|
52
52
|
),
|
|
53
53
|
/** Display name for the current user */
|
|
@@ -76,10 +76,10 @@ const d = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})),
|
|
79
|
+
})), E = k(
|
|
80
80
|
t(),
|
|
81
|
-
|
|
82
|
-
),
|
|
81
|
+
C(c(S), [])
|
|
82
|
+
), P = g({
|
|
83
83
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
84
|
id: e(n()),
|
|
85
85
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
@@ -124,7 +124,7 @@ const d = {
|
|
|
124
124
|
isPriceMovedToNextLine: e(o()),
|
|
125
125
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
126
126
|
isPriceDeletedForZeroSale: e(o())
|
|
127
|
-
}),
|
|
127
|
+
}), D = a({
|
|
128
128
|
/**
|
|
129
129
|
* Legacy recommendation block configs keyed by block ID.
|
|
130
130
|
* Pass this when loading a template authored with the v1
|
|
@@ -132,7 +132,7 @@ const d = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
k(t(),
|
|
135
|
+
k(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), M = a({
|
|
@@ -151,7 +151,7 @@ const d = {
|
|
|
151
151
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
152
152
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
153
153
|
*/
|
|
154
|
-
dynamicContentList: e(
|
|
154
|
+
dynamicContentList: e(E, {}),
|
|
155
155
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
156
156
|
customFieldAttributes: e(c(t()), []),
|
|
157
157
|
/** Selected unsubscribe page IDs */
|
|
@@ -159,7 +159,7 @@ const d = {
|
|
|
159
159
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
160
160
|
forceRecreate: e(o(), !1),
|
|
161
161
|
/** Migration-only inputs (legacy block configs) */
|
|
162
|
-
migration: e(
|
|
162
|
+
migration: e(D, {})
|
|
163
163
|
}), N = a({
|
|
164
164
|
/** Sender display name */
|
|
165
165
|
senderName: e(t(), ""),
|
|
@@ -202,12 +202,9 @@ const d = {
|
|
|
202
202
|
liquidSyntax: e(o(), !1),
|
|
203
203
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
204
204
|
autosave: e(o(), !1),
|
|
205
|
-
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
*/
|
|
209
|
-
reusableRecommendationStrategy: e(o(), !1)
|
|
210
|
-
}), U = l([
|
|
205
|
+
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
206
|
+
allowlistEnabled: e(o(), !1)
|
|
207
|
+
}), U = r([
|
|
211
208
|
"amp-accordion",
|
|
212
209
|
"amp-carousel",
|
|
213
210
|
"amp-form-controls",
|
|
@@ -221,7 +218,7 @@ const d = {
|
|
|
221
218
|
"text-block",
|
|
222
219
|
"timer-block",
|
|
223
220
|
"video-block"
|
|
224
|
-
]), B =
|
|
221
|
+
]), B = r([
|
|
225
222
|
"dynamic-content",
|
|
226
223
|
"checkbox-block",
|
|
227
224
|
"radio-button-block",
|
|
@@ -278,7 +275,7 @@ const d = {
|
|
|
278
275
|
(u) => typeof u == "function",
|
|
279
276
|
"processor must be a function"
|
|
280
277
|
)
|
|
281
|
-
}), G =
|
|
278
|
+
}), G = R("type", [
|
|
282
279
|
H,
|
|
283
280
|
_,
|
|
284
281
|
j,
|
|
@@ -329,7 +326,7 @@ export {
|
|
|
329
326
|
B as CustomBlockTypeSchema,
|
|
330
327
|
q as CustomRuleSchema,
|
|
331
328
|
U as DefaultBlockTypeSchema,
|
|
332
|
-
|
|
329
|
+
E as DynamicContentListSchema,
|
|
333
330
|
S as DynamicContentNodeSchema,
|
|
334
331
|
v as DynamicContentSchema,
|
|
335
332
|
O as EditorSchema,
|
|
@@ -338,14 +335,14 @@ export {
|
|
|
338
335
|
F as FeaturesSchema,
|
|
339
336
|
K as GuidoConfigSchema,
|
|
340
337
|
A as IdentitySchema,
|
|
341
|
-
|
|
338
|
+
P as LegacyRecommendationConfigSchema,
|
|
342
339
|
d as MessageType,
|
|
343
340
|
L as PartnerSchema,
|
|
344
|
-
|
|
341
|
+
l as ProductType,
|
|
345
342
|
_ as RegexRuleSchema,
|
|
346
343
|
j as RemoveRuleSchema,
|
|
347
344
|
H as ReplaceRuleSchema,
|
|
348
|
-
|
|
345
|
+
D as TemplateMigrationSchema,
|
|
349
346
|
M as TemplateSchema,
|
|
350
347
|
x as UISchema
|
|
351
348
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, n = [], s = /* @__PURE__ */
|
|
10
|
-
|
|
9
|
+
}, n = [], s = /* @__PURE__ */ a(
|
|
10
|
+
i,
|
|
11
11
|
t,
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"5079a1c8"
|
|
16
16
|
);
|
|
17
17
|
const l = s.exports;
|
|
18
18
|
export {
|
|
@@ -1,141 +1,149 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
const Je = /* @__PURE__ */ X({
|
|
1
|
+
import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as X } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as Y } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as Z } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as I } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import oe from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import se from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ie from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as de } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as me } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ue } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as pe } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
26
|
+
const xe = /* @__PURE__ */ q({
|
|
28
27
|
__name: "Guido",
|
|
29
28
|
props: {
|
|
30
|
-
config: null
|
|
29
|
+
config: null,
|
|
30
|
+
ready: { type: Boolean, default: !0 }
|
|
31
31
|
},
|
|
32
32
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
33
|
+
setup(P, { expose: A, emit: n }) {
|
|
34
|
+
const i = P, W = M(
|
|
35
35
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
36
|
-
),
|
|
36
|
+
), x = M(
|
|
37
37
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
38
|
-
),
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
var
|
|
42
|
-
return (
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
defaultModulesFolderName: _
|
|
61
|
-
}, M = {
|
|
62
|
-
preselectedDynamicContentList: S,
|
|
63
|
-
onReady: () => {
|
|
64
|
-
console.debug("guido:ready"), n("ready");
|
|
65
|
-
}
|
|
66
|
-
}, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = ye(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
|
|
67
|
-
var e;
|
|
68
|
-
return !((e = c.ui) != null && e.showHeader);
|
|
38
|
+
), g = U(), l = U(), u = le(), S = fe(), o = me();
|
|
39
|
+
i.ready && o.init(i.config);
|
|
40
|
+
const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
|
|
41
|
+
var t;
|
|
42
|
+
return (t = g.value) == null ? void 0 : t.handleSave(!0);
|
|
43
|
+
}, b = (t) => {
|
|
44
|
+
d.loadingStatus = t;
|
|
45
|
+
};
|
|
46
|
+
j(), Q();
|
|
47
|
+
const p = () => {
|
|
48
|
+
var t, e;
|
|
49
|
+
return {
|
|
50
|
+
emailId: o.templateId,
|
|
51
|
+
userId: o.userId,
|
|
52
|
+
username: o.username,
|
|
53
|
+
partnerName: o.partnerName,
|
|
54
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
55
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
56
|
+
};
|
|
57
|
+
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
|
|
58
|
+
var t;
|
|
59
|
+
return !((t = o.ui) != null && t.showHeader);
|
|
69
60
|
});
|
|
70
|
-
|
|
61
|
+
J({
|
|
71
62
|
onBack: () => {
|
|
72
63
|
console.debug("guido:back"), n("back");
|
|
73
64
|
},
|
|
74
65
|
onSaveStart: () => {
|
|
75
66
|
console.debug("guido:save:start"), n("save:start");
|
|
76
67
|
},
|
|
77
|
-
onSaveComplete: (
|
|
78
|
-
const
|
|
79
|
-
console.debug("guido:save:complete",
|
|
68
|
+
onSaveComplete: (t) => {
|
|
69
|
+
const e = { ...t, metadata: p() };
|
|
70
|
+
console.debug("guido:save:complete", e), n("save:complete", e);
|
|
80
71
|
},
|
|
81
72
|
onTestEmailClick: () => {
|
|
82
73
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
83
74
|
}
|
|
84
75
|
});
|
|
85
|
-
const
|
|
86
|
-
console.debug("dynamic-content:close",
|
|
87
|
-
},
|
|
76
|
+
const L = (t) => {
|
|
77
|
+
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
78
|
+
}, R = () => {
|
|
88
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
89
80
|
};
|
|
90
|
-
|
|
91
|
-
n("on-change",
|
|
81
|
+
B(() => m.value, () => {
|
|
82
|
+
n("on-change", m.value);
|
|
92
83
|
});
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
console.debug("dynamic-content:open",
|
|
84
|
+
const f = (t) => {
|
|
85
|
+
const e = t, { attribute: s, position: c } = e.detail;
|
|
86
|
+
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
|
|
96
87
|
};
|
|
97
88
|
let a = null;
|
|
98
|
-
const
|
|
99
|
-
var
|
|
100
|
-
const
|
|
101
|
-
(
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var o, u;
|
|
105
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ce().$reset(), $().$reset(), m.templateId = v, we().$reset(), h();
|
|
106
|
-
const e = (o = p.value) == null ? void 0 : o.parentElement;
|
|
107
|
-
e && (a = new ResizeObserver(h), a.observe(e));
|
|
89
|
+
const y = () => {
|
|
90
|
+
var e;
|
|
91
|
+
const t = document.querySelector(ee);
|
|
92
|
+
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
93
|
+
}, v = async () => {
|
|
94
|
+
var t;
|
|
108
95
|
try {
|
|
109
|
-
|
|
110
|
-
const
|
|
96
|
+
o.initialized || o.init(i.config), d.templateId = o.templateId;
|
|
97
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
98
|
+
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
99
|
+
const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
|
|
111
100
|
let r = {
|
|
112
|
-
html:
|
|
113
|
-
css:
|
|
101
|
+
html: s && await I(s, F),
|
|
102
|
+
css: c
|
|
103
|
+
};
|
|
104
|
+
r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
|
|
105
|
+
const z = {
|
|
106
|
+
preselectedDynamicContentList: k,
|
|
107
|
+
onReady: () => {
|
|
108
|
+
console.debug("guido:ready"), n("ready");
|
|
109
|
+
}
|
|
114
110
|
};
|
|
115
|
-
|
|
116
|
-
} catch (
|
|
117
|
-
console.error("Failed to initialize Stripo editor:",
|
|
111
|
+
await E(r, p(), z), u.selectedDynamicContentList = k;
|
|
112
|
+
} catch (e) {
|
|
113
|
+
console.error("Failed to initialize Stripo editor:", e);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return K(async () => {
|
|
117
|
+
var e;
|
|
118
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
|
|
119
|
+
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
120
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
|
|
121
|
+
await v();
|
|
122
|
+
else {
|
|
123
|
+
const s = B(() => i.ready, (c) => {
|
|
124
|
+
c && (s(), v());
|
|
125
|
+
});
|
|
118
126
|
}
|
|
119
|
-
document.addEventListener("dynamic-content:open",
|
|
120
|
-
}),
|
|
121
|
-
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
127
|
+
document.addEventListener("dynamic-content:open", f);
|
|
128
|
+
}), V(() => {
|
|
129
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
122
130
|
try {
|
|
123
131
|
window.UIEditor.removeEditor();
|
|
124
132
|
} catch {
|
|
125
133
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
126
134
|
}
|
|
127
|
-
|
|
128
|
-
}),
|
|
135
|
+
o.reset();
|
|
136
|
+
}), A({
|
|
129
137
|
dynamicContent: {
|
|
130
|
-
insert:
|
|
131
|
-
close:
|
|
138
|
+
insert: L,
|
|
139
|
+
close: R
|
|
132
140
|
},
|
|
133
|
-
hasChanges:
|
|
134
|
-
saveSilent:
|
|
135
|
-
setLoading:
|
|
136
|
-
}), { __sfc: !0, PreviewContainer:
|
|
141
|
+
hasChanges: m,
|
|
142
|
+
saveSilent: h,
|
|
143
|
+
setLoading: b
|
|
144
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
|
|
137
145
|
}
|
|
138
146
|
});
|
|
139
147
|
export {
|
|
140
|
-
|
|
148
|
+
xe as default
|
|
141
149
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as
|
|
2
|
-
import { usePreviewInteractionGuard as
|
|
1
|
+
import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as d } from "vue";
|
|
2
|
+
import { usePreviewInteractionGuard as v } from "../../../../composables/usePreviewInteractionGuard.js";
|
|
3
3
|
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
4
4
|
import { usePreviewStore as w } from "../../../../stores/preview.js";
|
|
5
5
|
import I from "./DesktopBrowserHeader.vue.js";
|
|
6
6
|
const C = /* @__PURE__ */ u({
|
|
7
7
|
__name: "DesktopPreview",
|
|
8
|
-
setup(
|
|
9
|
-
const i = _(), {
|
|
8
|
+
setup(P) {
|
|
9
|
+
const i = _(), { guardPreviewInteractions: t } = v(), o = a(), r = a(!1), c = w();
|
|
10
10
|
let e = null;
|
|
11
11
|
const f = (m) => {
|
|
12
12
|
t(m.target);
|
|
13
|
-
},
|
|
13
|
+
}, n = () => {
|
|
14
14
|
o.value && (e = new ResizeObserver(() => {
|
|
15
|
-
}), e.observe(o.value),
|
|
16
|
-
|
|
15
|
+
}), e.observe(o.value), d(() => {
|
|
16
|
+
r.value = !0;
|
|
17
17
|
}));
|
|
18
18
|
}, s = () => {
|
|
19
19
|
e == null || e.disconnect();
|
|
20
20
|
};
|
|
21
|
-
return p(
|
|
21
|
+
return p(n), l(s), { __sfc: !0, trans: i, guardPreviewInteractions: t, containerRef: o, isContainerReady: r, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: n, cleanIframe: s, DesktopBrowserHeader: I };
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
export {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./ContentView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
4
|
+
var o = function() {
|
|
5
5
|
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
6
|
return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
|
|
7
7
|
return t.$emit("back-to-inbox");
|
|
8
8
|
} } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
|
|
9
|
-
},
|
|
9
|
+
}, i = [], r = /* @__PURE__ */ n(
|
|
10
10
|
e,
|
|
11
|
-
c,
|
|
12
11
|
o,
|
|
12
|
+
i,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"f255b2bb"
|
|
16
16
|
);
|
|
17
|
-
const d =
|
|
17
|
+
const d = r.exports;
|
|
18
18
|
export {
|
|
19
19
|
d as default
|
|
20
20
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as c, ref as a } from "vue";
|
|
2
2
|
import { usePreviewInteractionGuard as f } from "../../../../composables/usePreviewInteractionGuard.js";
|
|
3
3
|
import { useResponsivePreview as p } from "../../../../composables/useResponsivePreview.js";
|
|
4
4
|
import { useTranslations as u } from "../../../../composables/useTranslations.js";
|
|
5
5
|
import { usePreviewStore as v } from "../../../../stores/preview.js";
|
|
6
|
-
import { InIcons as
|
|
7
|
-
const
|
|
6
|
+
import { InIcons as d } from "@useinsider/design-system-vue";
|
|
7
|
+
const b = /* @__PURE__ */ c({
|
|
8
8
|
__name: "ContentView",
|
|
9
9
|
emits: ["back-to-inbox"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
10
|
+
setup(P) {
|
|
11
|
+
const m = u(), r = v(), t = a(), { setupResponsivePreview: n } = p(), { guardPreviewInteractions: s } = f(), i = (e) => {
|
|
12
12
|
["transform", "transform-origin", "height"].forEach((o) => {
|
|
13
13
|
e.documentElement.style.removeProperty(o);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
return { __sfc: !0, trans:
|
|
17
|
-
const e =
|
|
18
|
-
o && (n(e), s(e),
|
|
19
|
-
}, InIcons:
|
|
16
|
+
return { __sfc: !0, trans: m, previewStore: r, iframeRef: t, setupResponsivePreview: n, guardPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
|
|
17
|
+
const e = t.value, o = e == null ? void 0 : e.contentDocument;
|
|
18
|
+
o && (n(e), s(e), r.isAMPResponsive && i(o));
|
|
19
|
+
}, InIcons: d };
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
b as default
|
|
24
24
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useAllowlistApi as A } from "../services/allowlistApi.js";
|
|
2
|
+
import { base64EncodeWithSpecialChars as p } from "../utils/base64.js";
|
|
3
|
+
import { useTranslations as h } from "./useTranslations.js";
|
|
4
|
+
import { useUserRole as D } from "./useUserRole.js";
|
|
5
|
+
const f = /(?:https?:\/\/|www\.)[^\s"'<>()]+/gi, E = /"\/\//gi, i = {
|
|
6
|
+
MANAGE: "journey-builder.domain-allowlist-warning",
|
|
7
|
+
NON_MANAGE: "settings.allow-list-warning-not-admin-architect",
|
|
8
|
+
ADD_BUTTON: "settings.allow-list-warning-add-button"
|
|
9
|
+
}, w = /* @__PURE__ */ new Set(), O = (n) => `/settings?openAddModal=true&type=domain&values=${p(n)}#security`, M = () => {
|
|
10
|
+
const { checkDomain: n } = A(), { getIsManageUser: l } = D(), a = h(), d = (t, s) => {
|
|
11
|
+
const c = `${t || ""} ${s || ""}`.replace(E, "https://").match(f) || [], e = /* @__PURE__ */ new Set();
|
|
12
|
+
return c.forEach((r) => {
|
|
13
|
+
const g = /^https?:\/\//i.test(r) ? r : `https://${r}`;
|
|
14
|
+
try {
|
|
15
|
+
const { hostname: u } = new URL(g);
|
|
16
|
+
u && e.add(u.replace(/^www\./i, "").toLowerCase());
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
}), [...e];
|
|
20
|
+
}, m = async (t) => {
|
|
21
|
+
if (w.has(t))
|
|
22
|
+
return !0;
|
|
23
|
+
try {
|
|
24
|
+
const s = await n(t);
|
|
25
|
+
return s && w.add(t), s;
|
|
26
|
+
} catch (s) {
|
|
27
|
+
return console.error("[GUIDO_ALLOWLIST] isDomainAllowlisted failed", t, s), !0;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return { getBlockedDomains: async (t, s) => {
|
|
31
|
+
try {
|
|
32
|
+
const o = d(t, s);
|
|
33
|
+
return o.length ? (await Promise.all(
|
|
34
|
+
o.map(async (e) => ({ domain: e, allowlisted: await m(e) }))
|
|
35
|
+
)).filter((e) => !e.allowlisted).map((e) => e.domain) : [];
|
|
36
|
+
} catch (o) {
|
|
37
|
+
return console.error("[GUIDO_ALLOWLIST] getBlockedDomains failed", o), [];
|
|
38
|
+
}
|
|
39
|
+
}, resolveToast: async (t) => await l() ? {
|
|
40
|
+
message: a(i.MANAGE),
|
|
41
|
+
actionButton: {
|
|
42
|
+
text: a(i.ADD_BUTTON),
|
|
43
|
+
onClick: () => window.open(O(t.join(",")), "_blank")
|
|
44
|
+
}
|
|
45
|
+
} : { message: a(i.NON_MANAGE) } };
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
O as buildAllowlistSettingsUrl,
|
|
49
|
+
M as useAllowlist
|
|
50
|
+
};
|