@useinsider/guido 3.18.2-beta.6dbea61 → 3.18.2-beta.83b62a8
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 +20 -0
- package/dist/composables/useGuidoStateBridge.js +29 -24
- package/dist/composables/useStripo.js +7 -7
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +18 -12
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +18 -17
- package/dist/library.js +15 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +29 -28
- package/dist/package.json.js +1 -1
- package/dist/public/editorState.js +4 -0
- package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +12 -0
- package/dist/src/library.d.ts +2 -0
- package/dist/src/public/editorState.d.ts +14 -0
- package/dist/src/public/trackingIds.d.ts +6 -2
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/stores/guido-email-editor.d.ts +27 -27
- package/dist/stores/editor.js +4 -0
- package/dist/stores/guido-email-editor.js +0 -4
- package/dist/utils/templatePreparation.js +37 -36
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -561,6 +561,26 @@ import {
|
|
|
561
561
|
import '@useinsider/guido/style';
|
|
562
562
|
```
|
|
563
563
|
|
|
564
|
+
### Subpath entries
|
|
565
|
+
|
|
566
|
+
Two surfaces also ship as their own entry points. Importing one pulls in only its
|
|
567
|
+
own dependencies, so a consumer that needs the store or the tracking-id helpers
|
|
568
|
+
never loads the editor:
|
|
569
|
+
|
|
570
|
+
```typescript
|
|
571
|
+
// Live editor state, published by the editor into the host's shared Pinia instance.
|
|
572
|
+
// Store id `guidoEmailEditor` is the cross-app contract — read it, do not redeclare it.
|
|
573
|
+
import { useGuidoEmailEditorStore } from '@useinsider/guido/editor-state';
|
|
574
|
+
import type { GuidoEmailEditorState } from '@useinsider/guido/editor-state';
|
|
575
|
+
|
|
576
|
+
// Persistent link ids for the click heatmap.
|
|
577
|
+
import { assignTrackingIds, TRACK_ID_ATTRIBUTE } from '@useinsider/guido/tracking-ids';
|
|
578
|
+
import type { TrackingIdResult } from '@useinsider/guido/tracking-ids';
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
Both are re-exported from the root barrel as well; the subpath is what keeps the
|
|
582
|
+
editor out of the consumer's module graph.
|
|
583
|
+
|
|
564
584
|
---
|
|
565
585
|
|
|
566
586
|
## Constants
|
|
@@ -1,54 +1,59 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useEditorLock as
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useEditorLock as C } from "./useEditorLock.js";
|
|
3
3
|
import { useConfigStore as T } from "../stores/config.js";
|
|
4
4
|
import { useEditorStore as w } from "../stores/editor.js";
|
|
5
5
|
import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
|
|
6
|
-
import { watch as
|
|
7
|
-
const
|
|
8
|
-
const i = w(), u = y(),
|
|
9
|
-
let o = null,
|
|
10
|
-
const
|
|
6
|
+
import { watch as c, onUnmounted as z } from "vue";
|
|
7
|
+
const B = 500, G = () => {
|
|
8
|
+
const i = w(), u = y(), d = T(), { getTemplateData: l } = v(), { runExclusive: m, isEditorBusy: p } = C();
|
|
9
|
+
let o = null, n = !1;
|
|
10
|
+
const r = () => {
|
|
11
11
|
o && (clearTimeout(o), o = null);
|
|
12
|
-
},
|
|
13
|
-
|
|
12
|
+
}, a = (t) => {
|
|
13
|
+
r(), o = setTimeout(() => {
|
|
14
14
|
o = null, t();
|
|
15
|
-
},
|
|
15
|
+
}, B);
|
|
16
16
|
}, e = async () => {
|
|
17
|
-
var t,
|
|
18
|
-
if (!(
|
|
17
|
+
var t, s;
|
|
18
|
+
if (!(n || !i.isStripoInitialized)) {
|
|
19
19
|
if (p()) {
|
|
20
|
-
|
|
20
|
+
a(() => void e());
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
try {
|
|
24
|
-
const { html: E, css:
|
|
25
|
-
if (
|
|
24
|
+
const { html: E, css: I } = await m(l), b = ((s = (t = d.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
|
|
25
|
+
if (n)
|
|
26
26
|
return;
|
|
27
27
|
u.$patch({
|
|
28
28
|
html: E ?? "",
|
|
29
|
-
css:
|
|
30
|
-
templateId:
|
|
29
|
+
css: I ?? "",
|
|
30
|
+
templateId: b,
|
|
31
31
|
lastUpdatedAt: Date.now()
|
|
32
32
|
});
|
|
33
33
|
} catch {
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
}, f = () =>
|
|
36
|
+
}, f = () => a(() => void e()), h = c(
|
|
37
37
|
() => i.isStripoInitialized,
|
|
38
38
|
(t) => {
|
|
39
39
|
t && e();
|
|
40
40
|
},
|
|
41
41
|
{ immediate: !0 }
|
|
42
|
-
), S =
|
|
42
|
+
), S = c(
|
|
43
|
+
() => i.changeSeq,
|
|
44
|
+
() => {
|
|
45
|
+
i.isStripoInitialized && f();
|
|
46
|
+
}
|
|
47
|
+
), g = c(
|
|
43
48
|
() => i.hasChanges,
|
|
44
|
-
(t,
|
|
45
|
-
|
|
49
|
+
(t, s) => {
|
|
50
|
+
!t && s && i.isStripoInitialized && (r(), e());
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
z(() => {
|
|
54
|
+
n = !0, r(), h(), S(), g();
|
|
50
55
|
});
|
|
51
56
|
};
|
|
52
57
|
export {
|
|
53
|
-
|
|
58
|
+
G as useGuidoStateBridge
|
|
54
59
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as L } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as O } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useModuleRepair as j } from "./useModuleRepair.js";
|
|
@@ -17,7 +17,7 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
|
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
19
|
const Ce = () => {
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled: m } =
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = O(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = L(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
21
|
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
@@ -88,8 +88,8 @@ const Ce = () => {
|
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } =
|
|
92
|
-
t(), l(),
|
|
91
|
+
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = x(), { injectFullStory: q } = N();
|
|
92
|
+
t(), l(), q(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -106,7 +106,7 @@ const Ce = () => {
|
|
|
106
106
|
e.isVersionHistoryOpen = t;
|
|
107
107
|
},
|
|
108
108
|
onDataChanged() {
|
|
109
|
-
e.hasChanges = !0;
|
|
109
|
+
e.hasChanges = !0, e.changeSeq += 1;
|
|
110
110
|
},
|
|
111
111
|
onEvent: v,
|
|
112
112
|
onModuleAdd: F,
|
|
@@ -23,14 +23,14 @@ import { PricePlacementControl as E } from "./pricePlacement.js";
|
|
|
23
23
|
import { PRICE_PLACEMENT_CONTROL_ID as _t } from "./pricePlacement.js";
|
|
24
24
|
import { ProductCountControl as k } from "./productCount.js";
|
|
25
25
|
import { PRODUCT_COUNT_CONTROL_ID as Rt } from "./productCount.js";
|
|
26
|
-
import { ProductLayoutControl as
|
|
26
|
+
import { ProductLayoutControl as F } from "./productLayout.js";
|
|
27
27
|
import { PRODUCT_LAYOUT_CONTROL_ID as Tt } from "./productLayout.js";
|
|
28
|
-
import { ShuffleControl as
|
|
28
|
+
import { ShuffleControl as D } from "./shuffle.js";
|
|
29
29
|
import { SHUFFLE_CONTROL_ID as St } from "./shuffle.js";
|
|
30
30
|
import { StrategyControl as w } from "./strategy.js";
|
|
31
31
|
import { STRATEGY_CONTROL_ID as Lt } from "./strategy.js";
|
|
32
32
|
import { setCurrencyAttributes as A, getBlockElement as v, isPartnerManagedBlock as x, updateProductContentInPlace as B, regenerateProductRowsWithStyles as U } from "./utils.js";
|
|
33
|
-
import { adjustProductsToSize as kt, formatProductPrice as
|
|
33
|
+
import { adjustProductsToSize as kt, formatProductPrice as Ft, getCardComposition as Dt, getCurrentLayout as wt, getMainContainerTbody as At, regenerateMobileProductRows as vt, updatePricesInPlace as xt, updateSingleProductContent as Bt } from "./utils.js";
|
|
34
34
|
import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
35
35
|
const $ = "ui-elements-recommendation-block";
|
|
36
36
|
class at extends N {
|
|
@@ -39,8 +39,6 @@ class at extends N {
|
|
|
39
39
|
n(this, "store", R());
|
|
40
40
|
n(this, "storeUnsubscription", () => {
|
|
41
41
|
});
|
|
42
|
-
// blockId -> fingerprint of the node config as it looked at the last sync.
|
|
43
|
-
n(this, "syncedConfigs", /* @__PURE__ */ new Map());
|
|
44
42
|
// A config change waiting to reach the node config. Deferred so it can ride the
|
|
45
43
|
// re-render's single apply() — one user action must cost one undo press.
|
|
46
44
|
n(this, "pendingNodeConfigWrite", null);
|
|
@@ -120,7 +118,7 @@ class at extends N {
|
|
|
120
118
|
return this.rrsEnabled = p().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((e) => {
|
|
121
119
|
var o;
|
|
122
120
|
return (o = e == null ? void 0 : e.onDestroy) == null ? void 0 : o.call(e);
|
|
123
|
-
}), this.algorithmControl = new T(), this.localeControl = new L(), this.currencyControl = new P(), this.productCountControl = new k(), this.productLayoutControl = new
|
|
121
|
+
}), this.algorithmControl = new T(), this.localeControl = new L(), this.currencyControl = new P(), this.productCountControl = new k(), this.productLayoutControl = new F(), this.filtersControl = new S(), this.shuffleControl = new D(), this.pricePlacementControl = new E(), this.layoutOrientationControl = new O(), this.strategyControl = this.rrsEnabled ? new w() : null, this._subControls.forEach((e) => {
|
|
124
122
|
e && (e.api = this.api);
|
|
125
123
|
}), `
|
|
126
124
|
<div class="recommendation-controls-container">
|
|
@@ -200,11 +198,19 @@ class at extends N {
|
|
|
200
198
|
* fingerprint diff on this hook is the only way to notice (SD-149105).
|
|
201
199
|
* An unchanged fingerprint means the move came from us, so runtime store
|
|
202
200
|
* edits are never clobbered (SD-141049).
|
|
201
|
+
*
|
|
202
|
+
* The fingerprint is kept on the block's own store state so deleting the
|
|
203
|
+
* block drops it with the state it describes. A control-owned memo outlived
|
|
204
|
+
* that state and made a re-dropped saved module keep the defaults its wiped
|
|
205
|
+
* state was rebuilt with (SD-150347).
|
|
203
206
|
*/
|
|
204
207
|
_syncNodeConfigIfChanged(t) {
|
|
205
208
|
this.pendingNodeConfigWrite && this.pendingNodeConfigWrite.blockId !== t && this._flushPendingNodeConfig();
|
|
206
|
-
const e =
|
|
207
|
-
|
|
209
|
+
const e = this.store.blockStates[t];
|
|
210
|
+
if (!e)
|
|
211
|
+
return;
|
|
212
|
+
const o = JSON.stringify(c.getConfig(this.currentNode)), r = e.syncedConfigFingerprint;
|
|
213
|
+
e.syncedConfigFingerprint = o, r !== o && (this.pendingNodeConfigWrite || this._syncNodeConfigToStore());
|
|
208
214
|
}
|
|
209
215
|
_capturePendingNodeConfigWrite() {
|
|
210
216
|
const t = this.store.currentRecommendationId;
|
|
@@ -430,16 +436,16 @@ export {
|
|
|
430
436
|
Tt as PRODUCT_LAYOUT_CONTROL_ID,
|
|
431
437
|
E as PricePlacementControl,
|
|
432
438
|
k as ProductCountControl,
|
|
433
|
-
|
|
439
|
+
F as ProductLayoutControl,
|
|
434
440
|
at as RecommendationBlockControl,
|
|
435
441
|
St as SHUFFLE_CONTROL_ID,
|
|
436
442
|
Lt as STRATEGY_CONTROL_ID,
|
|
437
|
-
|
|
443
|
+
D as ShuffleControl,
|
|
438
444
|
w as StrategyControl,
|
|
439
445
|
kt as adjustProductsToSize,
|
|
440
|
-
|
|
446
|
+
Ft as formatProductPrice,
|
|
441
447
|
v as getBlockElement,
|
|
442
|
-
|
|
448
|
+
Dt as getCardComposition,
|
|
443
449
|
wt as getCurrentLayout,
|
|
444
450
|
At as getMainContainerTbody,
|
|
445
451
|
x as isPartnerManagedBlock,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRecommendationFeedSourceMaps as b, getOperatorOptions as G, PriceAttributes as v } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { useRecommendationApi as D } from "../../../../services/recommendationApi.js";
|
|
3
|
-
import { useConfigStore as
|
|
4
|
-
import { defineStore as
|
|
3
|
+
import { useConfigStore as F } from "../../../../stores/config.js";
|
|
4
|
+
import { defineStore as P } from "pinia";
|
|
5
5
|
import "../constants/selectors.js";
|
|
6
6
|
import { DEFAULT_MOBILE_CARDS_IN_ROW as _, DEFAULT_CARDS_IN_ROW as U } from "../constants/layout.js";
|
|
7
7
|
import { DEFAULT_NODE_CONFIG as N, EXCLUDED_ALGORITHM_IDS as L } from "../constants/defaultConfig.js";
|
|
@@ -12,7 +12,7 @@ import { sanitizeProductIds as A } from "../utils/productIds.js";
|
|
|
12
12
|
import { isFilterValid as B } from "../validation/filterSchema.js";
|
|
13
13
|
import { isConfigValid as M } from "../validation/requiredFields.js";
|
|
14
14
|
const u = D();
|
|
15
|
-
let f = null,
|
|
15
|
+
let f = null, g = null, h = null, S = null;
|
|
16
16
|
const p = /* @__PURE__ */ new Map();
|
|
17
17
|
function w() {
|
|
18
18
|
return {
|
|
@@ -56,7 +56,8 @@ function C() {
|
|
|
56
56
|
removeStrategyModalStatus: !1,
|
|
57
57
|
filterGroup: 1,
|
|
58
58
|
isInitialized: !1,
|
|
59
|
-
filterSnapshot: null
|
|
59
|
+
filterSnapshot: null,
|
|
60
|
+
syncedConfigFingerprint: null
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
const z = () => ({
|
|
@@ -71,7 +72,7 @@ const z = () => ({
|
|
|
71
72
|
blockStates: {},
|
|
72
73
|
currentRecommendationId: null,
|
|
73
74
|
configVersion: 0
|
|
74
|
-
}), Y =
|
|
75
|
+
}), Y = P("guidoRecommendationExtension", {
|
|
75
76
|
state: () => z(),
|
|
76
77
|
getters: {
|
|
77
78
|
// ====================================================================
|
|
@@ -241,7 +242,7 @@ const z = () => ({
|
|
|
241
242
|
const r = (o, c) => o === "." || o === "," || o === " " ? o : c, n = {
|
|
242
243
|
name: e.currencyCode,
|
|
243
244
|
value: e.currencyCode,
|
|
244
|
-
symbol: e.
|
|
245
|
+
symbol: e.currencySymbol,
|
|
245
246
|
alignment: e.currencyAlignment === "before" ? "0" : "1",
|
|
246
247
|
decimalCount: String(e.currencyDecimalCount),
|
|
247
248
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
@@ -412,18 +413,18 @@ const z = () => ({
|
|
|
412
413
|
},
|
|
413
414
|
async fetchRecommendationFilters() {
|
|
414
415
|
if (!Object.keys(this.filterList).length) {
|
|
415
|
-
if (
|
|
416
|
-
await
|
|
416
|
+
if (g) {
|
|
417
|
+
await g;
|
|
417
418
|
return;
|
|
418
419
|
}
|
|
419
|
-
|
|
420
|
+
g = (async () => {
|
|
420
421
|
const t = await u.fetchRecommendationFilters();
|
|
421
422
|
this.filterList = t;
|
|
422
423
|
})();
|
|
423
424
|
try {
|
|
424
|
-
await
|
|
425
|
+
await g;
|
|
425
426
|
} finally {
|
|
426
|
-
|
|
427
|
+
g = null;
|
|
427
428
|
}
|
|
428
429
|
}
|
|
429
430
|
},
|
|
@@ -505,21 +506,21 @@ const z = () => ({
|
|
|
505
506
|
// ====================================================================
|
|
506
507
|
async fetchRecommendationProducts() {
|
|
507
508
|
if (!(this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])) {
|
|
508
|
-
if (
|
|
509
|
-
await
|
|
509
|
+
if (h) {
|
|
510
|
+
await h;
|
|
510
511
|
return;
|
|
511
512
|
}
|
|
512
|
-
|
|
513
|
+
h = this._doFetchProducts();
|
|
513
514
|
try {
|
|
514
|
-
await
|
|
515
|
+
await h;
|
|
515
516
|
} finally {
|
|
516
|
-
|
|
517
|
+
h = null;
|
|
517
518
|
}
|
|
518
519
|
}
|
|
519
520
|
},
|
|
520
521
|
async _doFetchProducts() {
|
|
521
522
|
var d;
|
|
522
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n =
|
|
523
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = F();
|
|
523
524
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
524
525
|
await this._doFetchStrategyProducts(t);
|
|
525
526
|
return;
|
package/dist/library.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { MessageType as
|
|
1
|
+
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
+
import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { assignTrackingIds as
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
|
|
5
|
+
import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
|
|
6
|
+
import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
a as Guido,
|
|
9
|
+
t as MessageType,
|
|
10
|
+
d as ProductType,
|
|
11
|
+
u as assignTrackingIds,
|
|
12
|
+
s as getValidationErrors,
|
|
12
13
|
p as isValidConfig,
|
|
13
14
|
g as parseConfig,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
m as parseConfigSafe,
|
|
16
|
+
x as readTrackFloor,
|
|
17
|
+
T as readTrackSeq,
|
|
18
|
+
C as useGuidoEmailEditorStore,
|
|
19
|
+
n as validateConfig
|
|
18
20
|
};
|
|
@@ -21,7 +21,7 @@ ${s.map((o) => ` - ${o}`).join(`
|
|
|
21
21
|
* This validation runs only once per class type and results are cached.
|
|
22
22
|
*/
|
|
23
23
|
validateImplementation(t, r) {
|
|
24
|
-
var
|
|
24
|
+
var P;
|
|
25
25
|
const s = [], o = r.name, W = Object.getPrototypeOf(this);
|
|
26
26
|
t.forEach((u) => {
|
|
27
27
|
if (typeof this[u] != "function") {
|
|
@@ -29,7 +29,7 @@ ${s.map((o) => ` - ${o}`).join(`
|
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
W[u] === r.prototype[u] && s.push(`Method ${u}() must be implemented (currently using base class error-throwing implementation)`);
|
|
32
|
-
}), d.validatedClasses.add(r), s.length > 0 ? (d.validationErrors.set(r, s), console.error(`[${o} Validation] ${o} validation failed:`, s)) : typeof process < "u" && ((
|
|
32
|
+
}), d.validatedClasses.add(r), s.length > 0 ? (d.validationErrors.set(r, s), console.error(`[${o} Validation] ${o} validation failed:`, s)) : typeof process < "u" && ((P = process.env) == null ? void 0 : P.NODE_ENV) === "development" && console.log(`[${o} Validation] ✅ ${o} validated successfully`);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Lifecycle method for cleaning up resources (e.g., removing DOM artifacts from document.body).
|
|
@@ -41,9 +41,9 @@ ${s.map((o) => ` - ${o}`).join(`
|
|
|
41
41
|
};
|
|
42
42
|
v.validatedClasses = /* @__PURE__ */ new Set();
|
|
43
43
|
v.validationErrors = /* @__PURE__ */ new Map();
|
|
44
|
-
var i = v, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e))(z || {}),
|
|
44
|
+
var i = v, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e))(z || {}), y = class c extends i {
|
|
45
45
|
constructor() {
|
|
46
|
-
super(
|
|
46
|
+
super(c.REQUIRED_METHODS, c);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Determines if the block should be available for use in the editor.
|
|
@@ -221,10 +221,10 @@ var i = v, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAI
|
|
|
221
221
|
throw new Error("Method getDescription() must be implemented by the subclass");
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
|
-
|
|
225
|
-
var qe =
|
|
224
|
+
y.REQUIRED_METHODS = ["getId", "getTemplate", "getIcon", "getName", "getDescription"];
|
|
225
|
+
var qe = y, Z = class T extends i {
|
|
226
226
|
constructor() {
|
|
227
|
-
super(
|
|
227
|
+
super(T.REQUIRED_METHODS, T);
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* @deprecated - use {@link getPreviewInnerHtml} instead
|
|
@@ -339,12 +339,12 @@ var j = {
|
|
|
339
339
|
height: "height"
|
|
340
340
|
}, Je = {
|
|
341
341
|
BLOCK_IMAGE: j
|
|
342
|
-
}, U = "esd-block-button", w = "esd-block-text", K = "esd-block-image", J = "esd-structure", ee = "esd-block-video", te = "esd-block-social", re = "esd-block-banner", ae = "esd-block-timer", ne = "esd-block-menu", se = "esd-block-html", ie = "esd-block-spacer", le = "esd-container-frame", Ee = "esd-stripe", oe = "esd-amp-form", I = ((e) => (e.BUTTON = `.${U}`, e.TEXT = `.${w}`, e.IMAGE = `.${K}`, e.STRUCTURE = `.${J}`, e.VIDEO = `.${ee}`, e.SOCIAL = `.${te}`, e.BANNER = `.${re}`, e.TIMER = `.${ae}`, e.MENU = `.${ne}`, e.HTML = `.${se}`, e.SPACER = `.${ie}`, e.CONTAINER = `.${le}`, e.STRIPE = `.${Ee}`, e.FORM = `.${oe}`, e))(I || {}), de = /* @__PURE__ */ ((e) => (e.BLOCK_IMAGE = "BLOCK_IMAGE", e.BLOCK_TEXT = "BLOCK_TEXT", e.BLOCK_BUTTON = "BLOCK_BUTTON", e.BLOCK_SPACER = "BLOCK_SPACER", e.BLOCK_VIDEO = "BLOCK_VIDEO", e.BLOCK_SOCIAL = "BLOCK_SOCIAL", e.BLOCK_BANNER = "BLOCK_BANNER", e.BLOCK_TIMER = "BLOCK_TIMER", e.BLOCK_MENU = "BLOCK_MENU", e.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", e.BLOCK_HTML = "BLOCK_HTML", e.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", e.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", e.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", e.CONTAINER = "CONTAINER", e.FORM_CONTAINER = "FORM_CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e.EMPTY_CONTAINER = "EMPTY_CONTAINER", e.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", e.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", e.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", e))(de || {}), F = /* @__PURE__ */ ((e) => (e.ANCHOR_LINK_CONTAINER = "anchorLinkFormContainer", e.APPLY_CONDITION = "applyCondition", e.APPLY_CONDITION_SWITCHER = "applyConditionSwitcher", e.BACKGROUND_COLOR = "backgroundColor", e.BACKGROUND_IMAGE = "generalImageContainer", e.TEXT_COLOR = "textColor", e.TEXT_STYLE = "textStyle", e.TEXT_SIZE = "textSize", e.TEXT_LINE_SPACING = "textLineSpacing", e.TEXT_ALIGN = "textAlign", e.FIXED_HEIGHT_SWITCHER = "fixedHeightSwitcherForm", e.HIDDEN_NODE = "hiddenNode", e.SMART_BLOCK = "smartBlock", e.SYNCHRONIZED_MODULE = "synchronizedModuleForm", e.FONT_FAMILY = "generalFontFamilyForm", e.BLOCK_INTERNAL_INDENTS = "generalBlockInternalIndents", e.STRUCTURE_INTERNAL_INDENTS = "generalStructureInternalIndents", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.ADJUST_TO_WIDTH = "adjustToWidth", e.ALIGNMENT = "buttonAlignment", e.BORDER = "buttonBorder", e.BORDER_RADIUS = "buttonBorderRadius", e.COLOR = "buttonColor", e.BUTTON_BLOCK_BACKGROUND_COLOR = "buttonBlockBackgroundColor", e.EXTERNAL_INDENTS = "buttonExternalIndents", e.FIXED_HEIGHT = "buttonFixedHeightForm", e.FONT_COLOR = "buttonFontColor", e.FONT_FAMILY = "buttonFontFamily", e.FONT_SIZE = "buttonFontSize", e.FONT_WEIGHT = "buttonFontWeight", e.ICON = "buttonIconContainer", e.ICON_ALIGN = "buttonIconAlign", e.ICON_INDENT = "buttonIconIndent", e.ICON_WIDTH = "buttonIconWidth", e.IMAGE = "buttonImageForm", e.INTERNAL_INDENTS = "buttonInternalIndents", e.LINK = "buttonLink", e.MIME_TYPE = "buttonMimeTypeForm", e.SWITCHER_HOVERED_STYLES = "buttonSwitcherHoveredStylesForm", e.TEXT = "buttonText", e.TEXT_STYLE_AND_COLOR = "buttonTextStyleAndColorForm", e.HOVERED_BORDER_COLOR = "hoveredStyleBorderButtonForm", e.HOVERED_COLOR = "hoveredButtonColorForm", e.HOVERED_TEXT_COLOR = "hoveredButtonTextColorForm", e))(H || {}), k = /* @__PURE__ */ ((e) => (e.HIDDEN_NODE = "hiddenNodeText", e.PARAGRAPH_STYLE = "paragraphStyleForm", e.ALIGN = "textAlignmentForm", e.ANCHOR_CONTAINER = "textAnchorForm", e.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", e.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", e.FONT_COLOR = "textBlockFontColor", e.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", e.FONT_FAMILY = "textFontFamily", e.FONT_SIZE = "textBlockFontSize", e.FONT_WEIGHT = "textBlockFontWeight", e.DIRECTION = "textBlockDirectionForm", e.INSERT_FORM = "textBlockInsertForm", e.LINK_DATA = "textBlockLinkDataForm", e.FORMAT = "textBlockTextFormatForm", e.FIXED_HEIGHT = "textFixedHeightForm", e.INTERNAL_INDENTS = "textInternalIndents", e.LINE_HEIGHT = "textLineHeightForm", e.MIME_TYPE = "textMimeTypeForm", e.NO_LINE_WRAPS = "textNoLineWrapsForm", e))(k || {}),
|
|
342
|
+
}, U = "esd-block-button", w = "esd-block-text", K = "esd-block-image", J = "esd-structure", ee = "esd-block-video", te = "esd-block-social", re = "esd-block-banner", ae = "esd-block-timer", ne = "esd-block-menu", se = "esd-block-html", ie = "esd-block-spacer", le = "esd-container-frame", Ee = "esd-stripe", oe = "esd-amp-form", I = ((e) => (e.BUTTON = `.${U}`, e.TEXT = `.${w}`, e.IMAGE = `.${K}`, e.STRUCTURE = `.${J}`, e.VIDEO = `.${ee}`, e.SOCIAL = `.${te}`, e.BANNER = `.${re}`, e.TIMER = `.${ae}`, e.MENU = `.${ne}`, e.HTML = `.${se}`, e.SPACER = `.${ie}`, e.CONTAINER = `.${le}`, e.STRIPE = `.${Ee}`, e.FORM = `.${oe}`, e))(I || {}), de = /* @__PURE__ */ ((e) => (e.BLOCK_IMAGE = "BLOCK_IMAGE", e.BLOCK_TEXT = "BLOCK_TEXT", e.BLOCK_BUTTON = "BLOCK_BUTTON", e.BLOCK_SPACER = "BLOCK_SPACER", e.BLOCK_VIDEO = "BLOCK_VIDEO", e.BLOCK_SOCIAL = "BLOCK_SOCIAL", e.BLOCK_BANNER = "BLOCK_BANNER", e.BLOCK_TIMER = "BLOCK_TIMER", e.BLOCK_MENU = "BLOCK_MENU", e.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", e.BLOCK_HTML = "BLOCK_HTML", e.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", e.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", e.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", e.CONTAINER = "CONTAINER", e.FORM_CONTAINER = "FORM_CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e.EMPTY_CONTAINER = "EMPTY_CONTAINER", e.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", e.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", e.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", e))(de || {}), F = /* @__PURE__ */ ((e) => (e.ANCHOR_LINK_CONTAINER = "anchorLinkFormContainer", e.APPLY_CONDITION = "applyCondition", e.APPLY_CONDITION_SWITCHER = "applyConditionSwitcher", e.BACKGROUND_COLOR = "backgroundColor", e.BACKGROUND_IMAGE = "generalImageContainer", e.TEXT_COLOR = "textColor", e.TEXT_STYLE = "textStyle", e.TEXT_SIZE = "textSize", e.TEXT_LINE_SPACING = "textLineSpacing", e.TEXT_ALIGN = "textAlign", e.FIXED_HEIGHT_SWITCHER = "fixedHeightSwitcherForm", e.HIDDEN_NODE = "hiddenNode", e.SMART_BLOCK = "smartBlock", e.SYNCHRONIZED_MODULE = "synchronizedModuleForm", e.FONT_FAMILY = "generalFontFamilyForm", e.BLOCK_INTERNAL_INDENTS = "generalBlockInternalIndents", e.STRUCTURE_INTERNAL_INDENTS = "generalStructureInternalIndents", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.ADJUST_TO_WIDTH = "adjustToWidth", e.ALIGNMENT = "buttonAlignment", e.BORDER = "buttonBorder", e.BORDER_RADIUS = "buttonBorderRadius", e.COLOR = "buttonColor", e.BUTTON_BLOCK_BACKGROUND_COLOR = "buttonBlockBackgroundColor", e.EXTERNAL_INDENTS = "buttonExternalIndents", e.FIXED_HEIGHT = "buttonFixedHeightForm", e.FONT_COLOR = "buttonFontColor", e.FONT_FAMILY = "buttonFontFamily", e.FONT_SIZE = "buttonFontSize", e.FONT_WEIGHT = "buttonFontWeight", e.ICON = "buttonIconContainer", e.ICON_ALIGN = "buttonIconAlign", e.ICON_INDENT = "buttonIconIndent", e.ICON_WIDTH = "buttonIconWidth", e.IMAGE = "buttonImageForm", e.INTERNAL_INDENTS = "buttonInternalIndents", e.LINK = "buttonLink", e.MIME_TYPE = "buttonMimeTypeForm", e.SWITCHER_HOVERED_STYLES = "buttonSwitcherHoveredStylesForm", e.TEXT = "buttonText", e.TEXT_STYLE_AND_COLOR = "buttonTextStyleAndColorForm", e.HOVERED_BORDER_COLOR = "hoveredStyleBorderButtonForm", e.HOVERED_COLOR = "hoveredButtonColorForm", e.HOVERED_TEXT_COLOR = "hoveredButtonTextColorForm", e))(H || {}), k = /* @__PURE__ */ ((e) => (e.HIDDEN_NODE = "hiddenNodeText", e.PARAGRAPH_STYLE = "paragraphStyleForm", e.ALIGN = "textAlignmentForm", e.ANCHOR_CONTAINER = "textAnchorForm", e.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", e.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", e.FONT_COLOR = "textBlockFontColor", e.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", e.FONT_FAMILY = "textFontFamily", e.FONT_SIZE = "textBlockFontSize", e.FONT_WEIGHT = "textBlockFontWeight", e.DIRECTION = "textBlockDirectionForm", e.INSERT_FORM = "textBlockInsertForm", e.LETTER_SPACING = "textBlockLetterSpacing", e.LINK_DATA = "textBlockLinkDataForm", e.FORMAT = "textBlockTextFormatForm", e.FIXED_HEIGHT = "textFixedHeightForm", e.INTERNAL_INDENTS = "textInternalIndents", e.LINE_HEIGHT = "textLineHeightForm", e.MIME_TYPE = "textMimeTypeForm", e.NO_LINE_WRAPS = "textNoLineWrapsForm", e))(k || {}), X = /* @__PURE__ */ ((e) => (e.ALT_TEXT = "altText", e.LINK = "blockLink", e.ALIGNMENT = "imageAlignment", e.ANCHOR_LINK_CONTAINER = "imageAnchorLinkContainerForm", e.BORDER_RADIUS = "imageBorderRadiusForm", e.IMAGE = "imageImageForm", e.EXTERNAL_INDENTS = "imageExternalIndents", e.MIME_TYPE = "imageMimeTypeForm", e.RESPONSIVE = "imageResponsive", e.ROLLOVER_IMAGE = "imageRolloverImageForm", e.ROLLOVER_SWITCHER = "imageRolloverSwitcherForm", e.SIZE = "imageSizeContainer", e))(X || {}), ue = /* @__PURE__ */ ((e) => (e.BACKGROUND_COLOR = "containerBackgroundColorForm", e.BORDER_FORM = "containerBorderForm", e.BORDER_RADIUS = "containerBorderRadiusForm", e.EXTERNAL_INDENTS = "containerExternalIndentsForm", e.IMAGE_CONTAINER = "containerImageContainerForm", e.MIME_TYPE = "containerMimeTypeForm", e.DISPLAY_CONDITIONS = "displayConditions", e.HIDDEN_NODE = "containerHiddenNodeForm", e))(ue || {}), n = {
|
|
343
343
|
BLOCK_BUTTON: H,
|
|
344
344
|
BLOCK_TEXT: k,
|
|
345
|
-
BLOCK_IMAGE:
|
|
345
|
+
BLOCK_IMAGE: X,
|
|
346
346
|
GENERAL: F
|
|
347
|
-
}, Ie = /* @__PURE__ */ ((e) => (e.SAVE_AS_MODULE = "saveAsModule", e.IMPROVE_WITH_AI = "improveWithAI", e.MOVE = "move", e.COPY = "copy", e.REMOVE = "remove", e.CLEAR_CONTAINER = "clearContainer", e.EXTERNAL_DISPLAY_CONDITION = "externalDisplayCondition", e))(Ie || {}),
|
|
347
|
+
}, Ie = /* @__PURE__ */ ((e) => (e.SAVE_AS_MODULE = "saveAsModule", e.IMPROVE_WITH_AI = "improveWithAI", e.MOVE = "move", e.COPY = "copy", e.REMOVE = "remove", e.CLEAR_CONTAINER = "clearContainer", e.EXTERNAL_DISPLAY_CONDITION = "externalDisplayCondition", e))(Ie || {}), ce = /* @__PURE__ */ ((e) => (e.previewDeviceMode = "previewDeviceMode", e.panelPosition = "panelPosition", e.themeMode = "themeMode", e))(ce || {}), Te = /* @__PURE__ */ ((e) => (e.DESKTOP = "DESKTOP", e.MOBILE = "MOBILE", e))(Te || {}), be = /* @__PURE__ */ ((e) => (e.SETTINGS = "settings", e.STYLES = "styles", e.DATA = "data", e))(be || {}), a = {
|
|
348
348
|
name: "name",
|
|
349
349
|
disabled: "disabled"
|
|
350
350
|
}, he = {
|
|
@@ -369,18 +369,19 @@ var j = {
|
|
|
369
369
|
hint: "hint"
|
|
370
370
|
}, Le = {
|
|
371
371
|
...a,
|
|
372
|
-
type: "type"
|
|
372
|
+
type: "type",
|
|
373
|
+
icon: "icon"
|
|
373
374
|
}, _e = {
|
|
374
375
|
...a,
|
|
375
376
|
buttons: "buttons"
|
|
376
|
-
},
|
|
377
|
+
}, p = {
|
|
377
378
|
...a,
|
|
378
379
|
searchable: "searchable",
|
|
379
380
|
multiSelect: "multi-select",
|
|
380
381
|
placeholder: "placeholder",
|
|
381
382
|
items: "items"
|
|
382
383
|
}, Ce = {
|
|
383
|
-
...
|
|
384
|
+
...p,
|
|
384
385
|
addCustomFontOption: "add-custom-font-option"
|
|
385
386
|
}, Ae = {
|
|
386
387
|
...a,
|
|
@@ -422,10 +423,10 @@ var j = {
|
|
|
422
423
|
}, xe = {
|
|
423
424
|
...a,
|
|
424
425
|
controlId: "control-id"
|
|
425
|
-
},
|
|
426
|
+
}, Pe = {
|
|
426
427
|
...a,
|
|
427
428
|
expanded: "expanded"
|
|
428
|
-
},
|
|
429
|
+
}, ye = {
|
|
429
430
|
...a,
|
|
430
431
|
icon: "icon",
|
|
431
432
|
position: "position"
|
|
@@ -455,7 +456,7 @@ var j = {
|
|
|
455
456
|
LABEL: Re,
|
|
456
457
|
MESSAGE: Le,
|
|
457
458
|
RADIO_BUTTONS: _e,
|
|
458
|
-
SELECTPICKER:
|
|
459
|
+
SELECTPICKER: p,
|
|
459
460
|
FONT_FAMILY_SELECT: Ce,
|
|
460
461
|
SWITCHER: a,
|
|
461
462
|
TEXT: Me,
|
|
@@ -465,15 +466,15 @@ var j = {
|
|
|
465
466
|
SELECT_ITEM: Ae,
|
|
466
467
|
RADIO_ITEM: Se,
|
|
467
468
|
NESTED_CONTROL: xe,
|
|
468
|
-
EXPANDABLE:
|
|
469
|
-
ORDERABLE:
|
|
469
|
+
EXPANDABLE: Pe,
|
|
470
|
+
ORDERABLE: ye,
|
|
470
471
|
ORDERABLE_ITEM: Ue,
|
|
471
472
|
ORDERABLE_ICON: we,
|
|
472
473
|
REPEATABLE: Ke,
|
|
473
474
|
DRAGGABLE_BLOCK: Fe,
|
|
474
475
|
AMP_FORM_SERVICE_PICKER: He,
|
|
475
476
|
MULTIPLE_SELECT: ke
|
|
476
|
-
},
|
|
477
|
+
}, Xe = /* @__PURE__ */ ((e) => (e.BUTTON = "UE-BUTTON", e.CHECKBOX = "UE-CHECKBOX", e.CHECK_BUTTONS = "UE-CHECK-BUTTONS", e.COLOR = "UE-COLOR", e.COUNTER = "UE-COUNTER", e.DATEPICKER = "UE-DATEPICKER", e.LABEL = "UE-LABEL", e.MESSAGE = "UE-MESSAGE", e.RADIO_BUTTONS = "UE-RADIO-BUTTONS", e.SELECTPICKER = "UE-SELECT", e.SWITCHER = "UE-SWITCHER", e.TEXT = "UE-TEXT", e.RICH_TEXT = "UE-RICH-TEXT", e.TEXTAREA = "UE-TEXTAREA", e.CHECK_ITEM = "UE-CHECK-ITEM", e.RADIO_ITEM = "UE-RADIO-ITEM", e.SELECT_ITEM = "UE-SELECT-ITEM", e.ICON = "UE-ICON", e.MERGETAGS = "UE-MERGETAGS", e.FONT_FAMILY_SELECT = "UE-FONT-FAMILY-SELECT", e.NESTED_CONTROL = "UE-NESTED-CONTROL", e.EXPANDABLE = "UE-EXPANDABLE", e.EXPANDABLE_HEADER = "UE-EXPANDABLE_HEADER", e.EXPANDABLE_CONTENT = "UE-EXPANDABLE_CONTENT", e.ORDERABLE = "UE-ORDERABLE", e.ORDERABLE_ITEM = "UE-ORDERABLE-ITEM", e.ORDERABLE_ICON = "UE-ORDERABLE-ICON", e.REPEATABLE = "UE-REPEATABLE", e.DRAGGABLE_BLOCK = "UE-DRAGGABLE-BLOCK", e.AMP_FORM_SERVICE_PICKER = "UE-AMP-FORM-SERVICE-PICKER", e.MULTIPLE_SELECT = "UE-MULTIPLE_SELECT", e.SCROLLABLE = "UE-SCROLLABLE-CONTAINER", e.POPUP_PANEL = "UE-POPUP-PANEL", e))(Xe || {}), x = class {
|
|
477
478
|
/**
|
|
478
479
|
* @description returns map of nodes parent control operates on
|
|
479
480
|
*/
|
|
@@ -619,7 +620,7 @@ var j = {
|
|
|
619
620
|
}
|
|
620
621
|
};
|
|
621
622
|
G.REQUIRED_METHODS = ["getId", "getTemplate"];
|
|
622
|
-
var
|
|
623
|
+
var ct = G, pe = class m extends i {
|
|
623
624
|
constructor() {
|
|
624
625
|
super(m.REQUIRED_METHODS, m);
|
|
625
626
|
}
|
|
@@ -688,13 +689,13 @@ var Tt = G, Xe = class m extends i {
|
|
|
688
689
|
onDestroy() {
|
|
689
690
|
}
|
|
690
691
|
};
|
|
691
|
-
|
|
692
|
+
pe.REQUIRED_METHODS = ["getId", "getIcon", "getName", "getTemplate", "getTabIndex"];
|
|
692
693
|
var V = class extends x {
|
|
693
694
|
getTargetNodes(e) {
|
|
694
695
|
const t = e.querySelectorAll(I.IMAGE), r = e.asElement().hasClass(K) ? [e] : [];
|
|
695
696
|
return t.length ? t : r;
|
|
696
697
|
}
|
|
697
|
-
},
|
|
698
|
+
}, Tt = class extends V {
|
|
698
699
|
getParentControlId() {
|
|
699
700
|
return n.BLOCK_IMAGE.EXTERNAL_INDENTS;
|
|
700
701
|
}
|
|
@@ -1215,17 +1216,17 @@ export {
|
|
|
1215
1216
|
It as ButtonTextStyleAndFontColorBuiltInControl,
|
|
1216
1217
|
ue as ContainerControls,
|
|
1217
1218
|
Ie as ContextActionType,
|
|
1218
|
-
|
|
1219
|
-
|
|
1219
|
+
ct as Control,
|
|
1220
|
+
ce as EditorStatePropertyType,
|
|
1220
1221
|
Ve as Extension,
|
|
1221
1222
|
Nt as ExtensionBuilder,
|
|
1222
1223
|
F as GeneralControls,
|
|
1223
1224
|
Dt as IconsRegistry,
|
|
1224
|
-
|
|
1225
|
-
|
|
1225
|
+
X as ImageControls,
|
|
1226
|
+
Tt as ImageMarginsBuiltInControl,
|
|
1226
1227
|
bt as ImageSizeBuiltInControl,
|
|
1227
1228
|
St as ModificationDescription,
|
|
1228
|
-
|
|
1229
|
+
Te as PreviewDeviceMode,
|
|
1229
1230
|
ht as SettingsPanelRegistry,
|
|
1230
1231
|
mt as SettingsPanelTab,
|
|
1231
1232
|
be as SettingsTab,
|
|
@@ -1240,5 +1241,5 @@ export {
|
|
|
1240
1241
|
et as UEAttr,
|
|
1241
1242
|
Mt as UIElement,
|
|
1242
1243
|
Bt as UIElementTagRegistry,
|
|
1243
|
-
|
|
1244
|
+
Xe as UIElementType
|
|
1244
1245
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Outbound bridge — publishes the current editor's html/css to the shared
|
|
3
|
-
* Pinia store `guidoEmailEditor
|
|
4
|
-
*
|
|
3
|
+
* Pinia store `guidoEmailEditor`. cortex-fe reads it at chat-stream submit
|
|
4
|
+
* time and forwards it as `clientState.editor`, which is what enables
|
|
5
5
|
* sub-case 1.3 (refine an already-loaded template via the email-agent).
|
|
6
6
|
*
|
|
7
7
|
* The bridge writes on three triggers:
|
|
8
8
|
*
|
|
9
9
|
* 1. Stripo finishes initializing — first snapshot.
|
|
10
|
-
* 2.
|
|
11
|
-
* Stripo edit doesn't thrash the store.
|
|
10
|
+
* 2. Every document change, via the `changeSeq` counter — debounced 500 ms
|
|
11
|
+
* so a streaming Stripo edit doesn't thrash the store.
|
|
12
12
|
* 3. Editor `hasChanges` flips back to false (post-save / autosave) —
|
|
13
13
|
* immediate, since this is the canonical "saved" snapshot.
|
|
14
14
|
*
|
|
15
15
|
* `getTemplateData()` is a Stripo iframe call; it must not run before
|
|
16
16
|
* `isStripoInitialized` is true. The bridge guards against that.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The store is written even with no reader attached — it has zero overhead,
|
|
19
|
+
* and a late reader still finds consistent state.
|
|
20
|
+
*
|
|
21
|
+
* Readers are not optional any more, so treat the publish timing as part of
|
|
22
|
+
* the contract: the store ships as `@useinsider/guido/editor-state`, and
|
|
23
|
+
* email-fe imports it to scan the live html for its Array of Objects lock.
|
|
24
|
+
* Weakening a trigger here silently breaks that lock in the consumer.
|
|
21
25
|
*/
|
|
22
26
|
export declare const useGuidoStateBridge: () => void;
|
|
@@ -20,7 +20,6 @@ export * from './utils';
|
|
|
20
20
|
export declare class RecommendationBlockControl extends CommonControl {
|
|
21
21
|
private store;
|
|
22
22
|
private storeUnsubscription;
|
|
23
|
-
private syncedConfigs;
|
|
24
23
|
private pendingNodeConfigWrite;
|
|
25
24
|
private pendingConfigFlushTimer;
|
|
26
25
|
private algorithmControl;
|
|
@@ -64,6 +63,11 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
64
63
|
* fingerprint diff on this hook is the only way to notice (SD-149105).
|
|
65
64
|
* An unchanged fingerprint means the move came from us, so runtime store
|
|
66
65
|
* edits are never clobbered (SD-141049).
|
|
66
|
+
*
|
|
67
|
+
* The fingerprint is kept on the block's own store state so deleting the
|
|
68
|
+
* block drops it with the state it describes. A control-owned memo outlived
|
|
69
|
+
* that state and made a re-dropped saved module keep the defaults its wiped
|
|
70
|
+
* state was rebuilt with (SD-150347).
|
|
67
71
|
*/
|
|
68
72
|
private _syncNodeConfigIfChanged;
|
|
69
73
|
private _capturePendingNodeConfigWrite;
|
|
@@ -41,6 +41,16 @@ interface PerBlockState {
|
|
|
41
41
|
isInitialized: boolean;
|
|
42
42
|
/** Snapshot of filters taken when the drawer opens, used to revert on cancel */
|
|
43
43
|
filterSnapshot: Filter[] | null;
|
|
44
|
+
/**
|
|
45
|
+
* Fingerprint of the node config as this block's state last adopted it.
|
|
46
|
+
*
|
|
47
|
+
* Lives here, not on the control, because it is a claim ABOUT this state —
|
|
48
|
+
* "the store already holds that node config". Held on the control it
|
|
49
|
+
* outlived the state it described: `removeBlockState` tore the state down
|
|
50
|
+
* while the fingerprint survived, so re-dropping a saved module under the
|
|
51
|
+
* same id skipped the re-sync and kept the defaults (SD-150347).
|
|
52
|
+
*/
|
|
53
|
+
syncedConfigFingerprint: string | null;
|
|
44
54
|
}
|
|
45
55
|
/**
|
|
46
56
|
* Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
|
|
@@ -57,6 +67,8 @@ export interface PerBlockUrlConfig {
|
|
|
57
67
|
filters: Filter[];
|
|
58
68
|
shuffleProducts: boolean;
|
|
59
69
|
currencyCode: string;
|
|
70
|
+
/** The displayed symbol, which is not the code — a TRY block shows `₺`. */
|
|
71
|
+
currencySymbol: string;
|
|
60
72
|
currencyAlignment: 'before' | 'after';
|
|
61
73
|
currencyDecimalCount: number;
|
|
62
74
|
currencyDecimalSeparator: string;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ export { default as Guido } from './components/Guido.vue';
|
|
|
2
2
|
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, TemplateMigrationConfig, LegacyRecommendationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
|
|
3
3
|
export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidationErrors, MessageType, ProductType, } from './@types/config';
|
|
4
4
|
export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
|
|
5
|
+
export { useGuidoEmailEditorStore } from './public/editorState';
|
|
6
|
+
export type { GuidoEmailEditorState } from './public/editorState';
|
|
5
7
|
export type { StripoEventType } from './@types/events';
|
|
6
8
|
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published as `@useinsider/guido/editor-state` — the live editor snapshot Guido
|
|
3
|
+
* writes into the host's shared Pinia singleton.
|
|
4
|
+
*
|
|
5
|
+
* Importing from here pulls in nothing but pinia, so the editor never enters a
|
|
6
|
+
* consumer's module graph. Re-export surface only: this is the contract,
|
|
7
|
+
* `stores/guido-email-editor` is the implementation and stays free to move.
|
|
8
|
+
*
|
|
9
|
+
* Consumers read the store by importing it; the id `guidoEmailEditor` remains
|
|
10
|
+
* part of the contract for cortex-fe, which probes `pinia._s` at runtime instead
|
|
11
|
+
* of taking a build-time dependency on this package.
|
|
12
|
+
*/
|
|
13
|
+
export { useGuidoEmailEditorStore } from '../stores/guido-email-editor';
|
|
14
|
+
export type { GuidoEmailEditorState } from '../stores/guido-email-editor';
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Importing from here pulls in nothing else, so the editor never enters a
|
|
5
5
|
* consumer's module graph. Re-export surface only: this is the contract,
|
|
6
6
|
* `utils/linkTrackingIds` is the implementation and stays free to move.
|
|
7
|
+
*
|
|
8
|
+
* Relative, not the `@@/Utils/` alias: vue-tsc copies the specifier into the emitted
|
|
9
|
+
* .d.ts verbatim, and a consumer's TypeScript cannot resolve our alias table. A relative
|
|
10
|
+
* path resolves against dist/src/, so the published types actually load.
|
|
7
11
|
*/
|
|
8
|
-
export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '
|
|
9
|
-
export type { TrackingIdResult } from '
|
|
12
|
+
export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '../utils/linkTrackingIds';
|
|
13
|
+
export type { TrackingIdResult } from '../utils/linkTrackingIds';
|
|
@@ -6,6 +6,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
6
6
|
isPreviewModeOpen: boolean;
|
|
7
7
|
editorVisualMode: string;
|
|
8
8
|
hasChanges: boolean;
|
|
9
|
+
changeSeq: number;
|
|
9
10
|
isStripoInitialized: boolean;
|
|
10
11
|
templateId: string;
|
|
11
12
|
syncModulesEnabled: boolean;
|
|
@@ -19,6 +20,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
19
20
|
isPreviewModeOpen: boolean;
|
|
20
21
|
editorVisualMode: string;
|
|
21
22
|
hasChanges: boolean;
|
|
23
|
+
changeSeq: number;
|
|
22
24
|
isStripoInitialized: boolean;
|
|
23
25
|
templateId: string;
|
|
24
26
|
syncModulesEnabled: boolean;
|
|
@@ -31,6 +33,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
31
33
|
isPreviewModeOpen: boolean;
|
|
32
34
|
editorVisualMode: string;
|
|
33
35
|
hasChanges: boolean;
|
|
36
|
+
changeSeq: number;
|
|
34
37
|
isStripoInitialized: boolean;
|
|
35
38
|
templateId: string;
|
|
36
39
|
syncModulesEnabled: boolean;
|
|
@@ -44,6 +47,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
44
47
|
isPreviewModeOpen: boolean;
|
|
45
48
|
editorVisualMode: string;
|
|
46
49
|
hasChanges: boolean;
|
|
50
|
+
changeSeq: number;
|
|
47
51
|
isStripoInitialized: boolean;
|
|
48
52
|
templateId: string;
|
|
49
53
|
syncModulesEnabled: boolean;
|
|
@@ -56,6 +60,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
56
60
|
isPreviewModeOpen: boolean;
|
|
57
61
|
editorVisualMode: string;
|
|
58
62
|
hasChanges: boolean;
|
|
63
|
+
changeSeq: number;
|
|
59
64
|
isStripoInitialized: boolean;
|
|
60
65
|
templateId: string;
|
|
61
66
|
syncModulesEnabled: boolean;
|
|
@@ -69,6 +74,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
69
74
|
isPreviewModeOpen: boolean;
|
|
70
75
|
editorVisualMode: string;
|
|
71
76
|
hasChanges: boolean;
|
|
77
|
+
changeSeq: number;
|
|
72
78
|
isStripoInitialized: boolean;
|
|
73
79
|
templateId: string;
|
|
74
80
|
syncModulesEnabled: boolean;
|
|
@@ -81,6 +87,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
81
87
|
isPreviewModeOpen: boolean;
|
|
82
88
|
editorVisualMode: string;
|
|
83
89
|
hasChanges: boolean;
|
|
90
|
+
changeSeq: number;
|
|
84
91
|
isStripoInitialized: boolean;
|
|
85
92
|
templateId: string;
|
|
86
93
|
syncModulesEnabled: boolean;
|
|
@@ -94,6 +101,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
94
101
|
isPreviewModeOpen: boolean;
|
|
95
102
|
editorVisualMode: string;
|
|
96
103
|
hasChanges: boolean;
|
|
104
|
+
changeSeq: number;
|
|
97
105
|
isStripoInitialized: boolean;
|
|
98
106
|
templateId: string;
|
|
99
107
|
syncModulesEnabled: boolean;
|
|
@@ -106,6 +114,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
106
114
|
isPreviewModeOpen: boolean;
|
|
107
115
|
editorVisualMode: string;
|
|
108
116
|
hasChanges: boolean;
|
|
117
|
+
changeSeq: number;
|
|
109
118
|
isStripoInitialized: boolean;
|
|
110
119
|
templateId: string;
|
|
111
120
|
syncModulesEnabled: boolean;
|
|
@@ -119,6 +128,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
119
128
|
isPreviewModeOpen: boolean;
|
|
120
129
|
editorVisualMode: string;
|
|
121
130
|
hasChanges: boolean;
|
|
131
|
+
changeSeq: number;
|
|
122
132
|
isStripoInitialized: boolean;
|
|
123
133
|
templateId: string;
|
|
124
134
|
syncModulesEnabled: boolean;
|
|
@@ -131,6 +141,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
131
141
|
isPreviewModeOpen: boolean;
|
|
132
142
|
editorVisualMode: string;
|
|
133
143
|
hasChanges: boolean;
|
|
144
|
+
changeSeq: number;
|
|
134
145
|
isStripoInitialized: boolean;
|
|
135
146
|
templateId: string;
|
|
136
147
|
syncModulesEnabled: boolean;
|
|
@@ -144,6 +155,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
144
155
|
isPreviewModeOpen: boolean;
|
|
145
156
|
editorVisualMode: string;
|
|
146
157
|
hasChanges: boolean;
|
|
158
|
+
changeSeq: number;
|
|
147
159
|
isStripoInitialized: boolean;
|
|
148
160
|
templateId: string;
|
|
149
161
|
syncModulesEnabled: boolean;
|
|
@@ -156,6 +168,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
156
168
|
isPreviewModeOpen: boolean;
|
|
157
169
|
editorVisualMode: string;
|
|
158
170
|
hasChanges: boolean;
|
|
171
|
+
changeSeq: number;
|
|
159
172
|
isStripoInitialized: boolean;
|
|
160
173
|
templateId: string;
|
|
161
174
|
syncModulesEnabled: boolean;
|
|
@@ -169,6 +182,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
169
182
|
isPreviewModeOpen: boolean;
|
|
170
183
|
editorVisualMode: string;
|
|
171
184
|
hasChanges: boolean;
|
|
185
|
+
changeSeq: number;
|
|
172
186
|
isStripoInitialized: boolean;
|
|
173
187
|
templateId: string;
|
|
174
188
|
syncModulesEnabled: boolean;
|
|
@@ -181,6 +195,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
181
195
|
isPreviewModeOpen: boolean;
|
|
182
196
|
editorVisualMode: string;
|
|
183
197
|
hasChanges: boolean;
|
|
198
|
+
changeSeq: number;
|
|
184
199
|
isStripoInitialized: boolean;
|
|
185
200
|
templateId: string;
|
|
186
201
|
syncModulesEnabled: boolean;
|
|
@@ -194,6 +209,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
194
209
|
isPreviewModeOpen: boolean;
|
|
195
210
|
editorVisualMode: string;
|
|
196
211
|
hasChanges: boolean;
|
|
212
|
+
changeSeq: number;
|
|
197
213
|
isStripoInitialized: boolean;
|
|
198
214
|
templateId: string;
|
|
199
215
|
syncModulesEnabled: boolean;
|
|
@@ -206,6 +222,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
206
222
|
isPreviewModeOpen: boolean;
|
|
207
223
|
editorVisualMode: string;
|
|
208
224
|
hasChanges: boolean;
|
|
225
|
+
changeSeq: number;
|
|
209
226
|
isStripoInitialized: boolean;
|
|
210
227
|
templateId: string;
|
|
211
228
|
syncModulesEnabled: boolean;
|
|
@@ -219,6 +236,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
219
236
|
isPreviewModeOpen: boolean;
|
|
220
237
|
editorVisualMode: string;
|
|
221
238
|
hasChanges: boolean;
|
|
239
|
+
changeSeq: number;
|
|
222
240
|
isStripoInitialized: boolean;
|
|
223
241
|
templateId: string;
|
|
224
242
|
syncModulesEnabled: boolean;
|
|
@@ -231,6 +249,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
231
249
|
isPreviewModeOpen: boolean;
|
|
232
250
|
editorVisualMode: string;
|
|
233
251
|
hasChanges: boolean;
|
|
252
|
+
changeSeq: number;
|
|
234
253
|
isStripoInitialized: boolean;
|
|
235
254
|
templateId: string;
|
|
236
255
|
syncModulesEnabled: boolean;
|
|
@@ -244,6 +263,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
244
263
|
isPreviewModeOpen: boolean;
|
|
245
264
|
editorVisualMode: string;
|
|
246
265
|
hasChanges: boolean;
|
|
266
|
+
changeSeq: number;
|
|
247
267
|
isStripoInitialized: boolean;
|
|
248
268
|
templateId: string;
|
|
249
269
|
syncModulesEnabled: boolean;
|
|
@@ -256,6 +276,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
256
276
|
isPreviewModeOpen: boolean;
|
|
257
277
|
editorVisualMode: string;
|
|
258
278
|
hasChanges: boolean;
|
|
279
|
+
changeSeq: number;
|
|
259
280
|
isStripoInitialized: boolean;
|
|
260
281
|
templateId: string;
|
|
261
282
|
syncModulesEnabled: boolean;
|
|
@@ -269,6 +290,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
269
290
|
isPreviewModeOpen: boolean;
|
|
270
291
|
editorVisualMode: string;
|
|
271
292
|
hasChanges: boolean;
|
|
293
|
+
changeSeq: number;
|
|
272
294
|
isStripoInitialized: boolean;
|
|
273
295
|
templateId: string;
|
|
274
296
|
syncModulesEnabled: boolean;
|
|
@@ -281,6 +303,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
281
303
|
isPreviewModeOpen: boolean;
|
|
282
304
|
editorVisualMode: string;
|
|
283
305
|
hasChanges: boolean;
|
|
306
|
+
changeSeq: number;
|
|
284
307
|
isStripoInitialized: boolean;
|
|
285
308
|
templateId: string;
|
|
286
309
|
syncModulesEnabled: boolean;
|
|
@@ -294,6 +317,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
294
317
|
isPreviewModeOpen: boolean;
|
|
295
318
|
editorVisualMode: string;
|
|
296
319
|
hasChanges: boolean;
|
|
320
|
+
changeSeq: number;
|
|
297
321
|
isStripoInitialized: boolean;
|
|
298
322
|
templateId: string;
|
|
299
323
|
syncModulesEnabled: boolean;
|
|
@@ -306,6 +330,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
|
|
|
306
330
|
isPreviewModeOpen: boolean;
|
|
307
331
|
editorVisualMode: string;
|
|
308
332
|
hasChanges: boolean;
|
|
333
|
+
changeSeq: number;
|
|
309
334
|
isStripoInitialized: boolean;
|
|
310
335
|
templateId: string;
|
|
311
336
|
syncModulesEnabled: boolean;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* cortex-fe can pick up the current editor state and forward it as
|
|
4
|
-
* `clientState.editor` on the next chat-stream POST.
|
|
5
|
-
*
|
|
6
|
-
* State + getters only — `useGuidoStateBridge` writes via `$patch`, no actions
|
|
7
|
-
* live here (architecture invariant).
|
|
8
|
-
*
|
|
9
|
-
* Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it via
|
|
10
|
-
* `pinia._s.get('guidoEmailEditor')` at runtime. The internal Guido editor
|
|
11
|
-
* store keeps id `guidoEditor` — these are intentionally separate. The
|
|
12
|
-
* internal store carries UI state that cortex-fe should not see; this public
|
|
13
|
-
* store carries the contract Guido is willing to share.
|
|
14
|
-
*/
|
|
15
|
-
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", {
|
|
1
|
+
/** The published editor snapshot — the shape a consumer reads off the shared store. */
|
|
2
|
+
export interface GuidoEmailEditorState {
|
|
16
3
|
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
17
4
|
html: string;
|
|
18
5
|
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
19
6
|
css: string;
|
|
20
7
|
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
21
8
|
lastUpdatedAt: number;
|
|
22
|
-
/** Template id from the editor config,
|
|
9
|
+
/** Template id from the editor config, so a consumer can scope per-template. */
|
|
23
10
|
templateId: string;
|
|
24
|
-
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Outbound contract Guido publishes to the host's shared Pinia singleton so a
|
|
14
|
+
* consumer can read the current editor state: cortex-fe forwards it as
|
|
15
|
+
* `clientState.editor` on the next chat-stream POST, email-fe scans it for the
|
|
16
|
+
* Array of Objects lock.
|
|
17
|
+
*
|
|
18
|
+
* Published as `@useinsider/guido/editor-state` and from the root barrel, so a
|
|
19
|
+
* consumer imports this store instead of re-declaring one under the same id.
|
|
20
|
+
*
|
|
21
|
+
* State + getters only, no actions. `useGuidoStateBridge` is the only intended
|
|
22
|
+
* writer, but that is Guido's own convention rather than something the store
|
|
23
|
+
* enforces: publishing the definition hands a consumer `$patch` as well, exactly
|
|
24
|
+
* as the runtime `pinia._s` probe always did.
|
|
25
|
+
*
|
|
26
|
+
* Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it via
|
|
27
|
+
* `pinia._s.get('guidoEmailEditor')` at runtime rather than importing it, so the
|
|
28
|
+
* id stays part of the contract. The internal Guido editor store keeps id
|
|
29
|
+
* `guidoEditor` — these are intentionally separate. The internal store carries
|
|
30
|
+
* UI state a consumer should not see; this public store carries the contract
|
|
31
|
+
* Guido is willing to share.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", GuidoEmailEditorState, {
|
|
25
34
|
/** True once the bridge has published at least one snapshot. */
|
|
26
35
|
hasSnapshot: (state: {
|
|
27
36
|
html: string;
|
|
28
37
|
css: string;
|
|
29
38
|
lastUpdatedAt: number;
|
|
30
39
|
templateId: string;
|
|
31
|
-
} & import("pinia").PiniaCustomStateProperties<
|
|
32
|
-
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
33
|
-
html: string;
|
|
34
|
-
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
35
|
-
css: string;
|
|
36
|
-
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
37
|
-
lastUpdatedAt: number;
|
|
38
|
-
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
39
|
-
templateId: string;
|
|
40
|
-
}>) => boolean;
|
|
40
|
+
} & import("pinia").PiniaCustomStateProperties<GuidoEmailEditorState>) => boolean;
|
|
41
41
|
}, {}>;
|
package/dist/stores/editor.js
CHANGED
|
@@ -8,6 +8,10 @@ const o = e("guidoEditor", {
|
|
|
8
8
|
isPreviewModeOpen: !1,
|
|
9
9
|
editorVisualMode: "desktop",
|
|
10
10
|
hasChanges: !1,
|
|
11
|
+
// Bumped on every Stripo document change. `hasChanges` is a latch that stays
|
|
12
|
+
// true until a save, so it cannot signal the second edit onwards; watchers
|
|
13
|
+
// that need every change (the outbound state bridge) watch this instead.
|
|
14
|
+
changeSeq: 0,
|
|
11
15
|
isStripoInitialized: !1,
|
|
12
16
|
templateId: "",
|
|
13
17
|
syncModulesEnabled: !1,
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
2
|
const d = e("guidoEmailEditor", {
|
|
3
3
|
state: () => ({
|
|
4
|
-
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
5
4
|
html: "",
|
|
6
|
-
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
7
5
|
css: "",
|
|
8
|
-
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
9
6
|
lastUpdatedAt: 0,
|
|
10
|
-
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
11
7
|
templateId: ""
|
|
12
8
|
}),
|
|
13
9
|
getters: {
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
4
|
+
import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
+
import { DATA_ATTRIBUTES as C } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
8
|
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
9
|
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
10
|
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
-
function O(
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const o =
|
|
13
|
+
function O(l) {
|
|
14
|
+
const c = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${C.PAGE_LIST}]`), t = [];
|
|
15
|
+
return c.forEach((i) => {
|
|
16
|
+
const o = i.getAttribute(C.PAGE_LIST);
|
|
17
17
|
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
|
-
async function M(
|
|
21
|
-
const n = new DOMParser().parseFromString(
|
|
20
|
+
async function M(l) {
|
|
21
|
+
const n = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
22
|
if (n.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
24
|
+
const c = T();
|
|
25
25
|
n.forEach((t) => {
|
|
26
|
-
var r,
|
|
27
|
-
const
|
|
26
|
+
var r, d, g, f, s, y;
|
|
27
|
+
const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
|
|
28
28
|
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -38,7 +38,7 @@ async function M(m) {
|
|
|
38
38
|
}
|
|
39
39
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
40
40
|
return;
|
|
41
|
-
const
|
|
41
|
+
const b = {
|
|
42
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
@@ -51,16 +51,17 @@ async function M(m) {
|
|
|
51
51
|
productIds: e.productIds ?? [...a.productIds],
|
|
52
52
|
filters: e.filters ?? [...a.filters],
|
|
53
53
|
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
54
|
-
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ??
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? m.code,
|
|
55
|
+
currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
|
|
56
|
+
currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
|
|
57
|
+
currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
|
|
58
|
+
currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
|
|
59
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
c.seedBlockUrlConfig(o, b);
|
|
61
62
|
});
|
|
62
63
|
try {
|
|
63
|
-
await
|
|
64
|
+
await c.fetchRecommendationCreateData();
|
|
64
65
|
} catch (t) {
|
|
65
66
|
console.warn(
|
|
66
67
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -69,44 +70,44 @@ async function M(m) {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
const Z = () => {
|
|
72
|
-
const
|
|
73
|
+
const l = N(), u = z(), n = _(), { getCompiledEmail: c, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
73
74
|
return {
|
|
74
75
|
prepareTemplateDetails: async () => {
|
|
75
|
-
let { html: r, css:
|
|
76
|
+
let { html: r, css: d, syncModulesIds: g = [] } = await t();
|
|
76
77
|
if (e("linkTrackingIds"))
|
|
77
78
|
try {
|
|
78
|
-
const { html:
|
|
79
|
-
u.trackIdSessionFloor = H, F && (r =
|
|
80
|
-
} catch (
|
|
81
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
79
|
+
const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
80
|
+
u.trackIdSessionFloor = H, F && (r = h, await i(h, d));
|
|
81
|
+
} catch (h) {
|
|
82
|
+
console.error("Tracking-id step failed, saving anyway:", h);
|
|
82
83
|
}
|
|
83
|
-
const { html: f, ampHtml:
|
|
84
|
+
const { html: f, ampHtml: s = "", ampErrors: y = [] } = await c({
|
|
84
85
|
minimize: !0,
|
|
85
86
|
resetDataSavedFlag: !1
|
|
86
87
|
});
|
|
87
88
|
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
|
|
88
|
-
const { compiledHtml: I, stats:
|
|
89
|
+
const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, E = l.getSelectedDynamicContentList, P = T(), A = O(r);
|
|
89
90
|
return console.debug("HTML Compilation Stats:", {
|
|
90
|
-
originalSize:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
91
|
+
originalSize: S.originalSize,
|
|
92
|
+
compiledSize: S.compiledSize,
|
|
93
|
+
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
93
94
|
appliedRules: w,
|
|
94
|
-
executionTime: `${
|
|
95
|
+
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
95
96
|
}), {
|
|
96
97
|
dynamicContentList: E,
|
|
97
98
|
compiledHtml: I,
|
|
98
99
|
rawHtml: r,
|
|
99
|
-
css:
|
|
100
|
+
css: d,
|
|
100
101
|
ampHtml: D,
|
|
101
|
-
ampErrors:
|
|
102
|
+
ampErrors: y,
|
|
102
103
|
modules: g.map(Number),
|
|
103
104
|
recommendation: {
|
|
104
105
|
campaignUrls: P.recommendationCampaignUrls,
|
|
105
106
|
configs: {}
|
|
106
107
|
},
|
|
107
108
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
109
|
+
status: A.length > 0,
|
|
110
|
+
config: A
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.2-beta.
|
|
3
|
+
"version": "3.18.2-beta.83b62a8",
|
|
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",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./dist/src/public/trackingIds.d.ts",
|
|
19
19
|
"import": "./dist/public/trackingIds.js"
|
|
20
20
|
},
|
|
21
|
+
"./editor-state": {
|
|
22
|
+
"types": "./dist/src/public/editorState.d.ts",
|
|
23
|
+
"import": "./dist/public/editorState.js"
|
|
24
|
+
},
|
|
21
25
|
"./style": "./dist/guido.css"
|
|
22
26
|
},
|
|
23
27
|
"scripts": {
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"author": "",
|
|
48
52
|
"license": "ISC",
|
|
49
53
|
"dependencies": {
|
|
50
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
54
|
+
"@stripoinc/ui-editor-extensions": "3.10.0",
|
|
51
55
|
"@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
|
|
52
56
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
57
|
"@vueuse/core": "11.3.0",
|
|
@@ -118,7 +122,7 @@
|
|
|
118
122
|
},
|
|
119
123
|
"guido": {
|
|
120
124
|
"stripo": {
|
|
121
|
-
"version": "2.
|
|
125
|
+
"version": "2.76.0"
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
128
|
}
|