@useinsider/guido 3.19.0-beta.d04f200 → 3.19.0-beta.e110e88
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/dist/@types/config/schemas.js +91 -104
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +74 -79
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +3 -4
- package/dist/composables/useHttp.js +54 -64
- package/dist/composables/useLegacyStrategyConversion.js +19 -23
- package/dist/composables/useStripo.js +20 -24
- package/dist/composables/useToaster.js +15 -17
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/migrator/index.js +13 -14
- package/dist/enums/extensions/recommendationBlock.js +29 -30
- package/dist/extensions/Blocks/Recommendation/block.js +22 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +107 -97
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +49 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +209 -203
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +91 -67
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -21
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +55 -16
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -16
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -5
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useHttp.d.ts +0 -2
- package/dist/src/config/migrator/index.d.ts +1 -2
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +13 -2
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +7 -0
- package/dist/src/stores/config.d.ts +0 -20
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -9
- package/package.json +1 -1
- package/dist/components/organisms/base/AuthErrorModal.vue.js +0 -18
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +0 -42
- package/dist/composables/useAuthError.js +0 -52
- package/dist/config/migrator/recommendationPartnerMigrator.js +0 -50
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +0 -25
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +0 -2
- package/dist/src/composables/useAuthError.d.ts +0 -12
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +0 -19
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +0 -33
|
@@ -139,6 +139,8 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
139
139
|
* fails when the size actually changed.
|
|
140
140
|
*/
|
|
141
141
|
private _debouncedRegenerateWithProducts;
|
|
142
|
+
/** Draws the current block's products into this panel's node. */
|
|
143
|
+
private _regenerateWithProducts;
|
|
142
144
|
/**
|
|
143
145
|
* Listen to store changes that require product refresh or regeneration.
|
|
144
146
|
*
|
|
@@ -623,9 +623,20 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
623
623
|
* Block-scoped counterpart of `fetchRecommendationProducts`, which only ever serves the
|
|
624
624
|
* selected block. The legacy conversion must refresh the products of the block that
|
|
625
625
|
* started it even after the user selected another one.
|
|
626
|
+
* @returns whether real products arrived
|
|
626
627
|
*/
|
|
627
|
-
fetchStrategyProductsForBlock(blockId: number
|
|
628
|
-
|
|
628
|
+
fetchStrategyProductsForBlock(blockId: number, options?: {
|
|
629
|
+
keepOnFailure?: boolean;
|
|
630
|
+
}): Promise<boolean>;
|
|
631
|
+
/**
|
|
632
|
+
* Reloads a block's products and adopts its strategy's current size, which may have
|
|
633
|
+
* moved since the block was assigned.
|
|
634
|
+
* @returns whether a fresh listing holds the strategy and its products arrived
|
|
635
|
+
*/
|
|
636
|
+
refreshStrategyBlock(blockId: number): Promise<boolean>;
|
|
637
|
+
_doFetchStrategyProducts(blockId: number, { keepOnFailure }?: {
|
|
638
|
+
keepOnFailure?: boolean;
|
|
639
|
+
}): Promise<boolean>;
|
|
629
640
|
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
630
641
|
}>;
|
|
631
642
|
export {};
|
|
@@ -83,12 +83,6 @@ export interface RecommendationNodeConfig {
|
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
85
|
strategyId: string;
|
|
86
|
-
/**
|
|
87
|
-
* Account (`config.partner.name`) that last wrote the strategy config. Strategy ids and
|
|
88
|
-
* attribute types are account-scoped, so a block opened under another account is reset.
|
|
89
|
-
* Absent on blocks saved before SD-151945.
|
|
90
|
-
*/
|
|
91
|
-
partnerName?: string;
|
|
92
86
|
/**
|
|
93
87
|
* Layout orientation
|
|
94
88
|
* - 'grid': Products in a grid, attributes aligned across products
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocumentModifier } from '../services/configService';
|
|
2
|
-
import type { PartialNodeConfig } from '../types/nodeConfig';
|
|
2
|
+
import type { PartialNodeConfig, RecommendationNodeConfig } from '../types/nodeConfig';
|
|
3
3
|
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
4
4
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
5
5
|
interface ConfigWriterApi {
|
|
@@ -13,6 +13,8 @@ interface ConfigWriterApi {
|
|
|
13
13
|
* itself is torn down.
|
|
14
14
|
*/
|
|
15
15
|
export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
|
|
16
|
+
/** Reads the persisted config of every node carrying a block id (two while a duplicate still shares it). */
|
|
17
|
+
export declare function readBlockNodeConfigs(blockId: number): RecommendationNodeConfig[];
|
|
16
18
|
/**
|
|
17
19
|
* Commits a config change and its product re-render straight to the document,
|
|
18
20
|
* bypassing the settings panel.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { RecommendationNodeConfig } from '../types/nodeConfig';
|
|
2
|
+
/**
|
|
3
|
+
* Re-reads the strategy of a duplicated block and its source and redraws both: the clone copies the
|
|
4
|
+
* cards the source last drew, so a strategy edited since then only reached a block once selected (SD-153266).
|
|
5
|
+
* @param config - the arriving block's persisted config; seeds either block its store entry does not match
|
|
6
|
+
*/
|
|
7
|
+
export declare function refreshDuplicatedStrategyBlocks(sourceId: number, duplicateId: number, config: RecommendationNodeConfig): Promise<void>;
|
|
1
8
|
/**
|
|
2
9
|
* Writes a strategy change and its products straight to the document, without the settings panel.
|
|
3
10
|
*
|
|
@@ -48,7 +48,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
48
48
|
selectedUnsubscribePages: number[];
|
|
49
49
|
forceRecreate: boolean;
|
|
50
50
|
trackIdCounter: number;
|
|
51
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
52
51
|
migration: {
|
|
53
52
|
recommendationConfigs: {
|
|
54
53
|
[x: string]: {
|
|
@@ -192,7 +191,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
192
191
|
selectedUnsubscribePages: number[];
|
|
193
192
|
forceRecreate: boolean;
|
|
194
193
|
trackIdCounter: number;
|
|
195
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
196
194
|
migration: {
|
|
197
195
|
recommendationConfigs: {
|
|
198
196
|
[x: string]: {
|
|
@@ -336,7 +334,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
336
334
|
selectedUnsubscribePages: number[];
|
|
337
335
|
forceRecreate: boolean;
|
|
338
336
|
trackIdCounter: number;
|
|
339
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
340
337
|
migration: {
|
|
341
338
|
recommendationConfigs: {
|
|
342
339
|
[x: string]: {
|
|
@@ -480,7 +477,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
480
477
|
selectedUnsubscribePages: number[];
|
|
481
478
|
forceRecreate: boolean;
|
|
482
479
|
trackIdCounter: number;
|
|
483
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
484
480
|
migration: {
|
|
485
481
|
recommendationConfigs: {
|
|
486
482
|
[x: string]: {
|
|
@@ -624,7 +620,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
624
620
|
selectedUnsubscribePages: number[];
|
|
625
621
|
forceRecreate: boolean;
|
|
626
622
|
trackIdCounter: number;
|
|
627
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
628
623
|
migration: {
|
|
629
624
|
recommendationConfigs: {
|
|
630
625
|
[x: string]: {
|
|
@@ -768,7 +763,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
768
763
|
selectedUnsubscribePages: number[];
|
|
769
764
|
forceRecreate: boolean;
|
|
770
765
|
trackIdCounter: number;
|
|
771
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
772
766
|
migration: {
|
|
773
767
|
recommendationConfigs: {
|
|
774
768
|
[x: string]: {
|
|
@@ -912,7 +906,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
912
906
|
selectedUnsubscribePages: number[];
|
|
913
907
|
forceRecreate: boolean;
|
|
914
908
|
trackIdCounter: number;
|
|
915
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
916
909
|
migration: {
|
|
917
910
|
recommendationConfigs: {
|
|
918
911
|
[x: string]: {
|
|
@@ -1056,7 +1049,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1056
1049
|
selectedUnsubscribePages: number[];
|
|
1057
1050
|
forceRecreate: boolean;
|
|
1058
1051
|
trackIdCounter: number;
|
|
1059
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1060
1052
|
migration: {
|
|
1061
1053
|
recommendationConfigs: {
|
|
1062
1054
|
[x: string]: {
|
|
@@ -1200,7 +1192,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1200
1192
|
selectedUnsubscribePages: number[];
|
|
1201
1193
|
forceRecreate: boolean;
|
|
1202
1194
|
trackIdCounter: number;
|
|
1203
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1204
1195
|
migration: {
|
|
1205
1196
|
recommendationConfigs: {
|
|
1206
1197
|
[x: string]: {
|
|
@@ -1344,7 +1335,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1344
1335
|
selectedUnsubscribePages: number[];
|
|
1345
1336
|
forceRecreate: boolean;
|
|
1346
1337
|
trackIdCounter: number;
|
|
1347
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1348
1338
|
migration: {
|
|
1349
1339
|
recommendationConfigs: {
|
|
1350
1340
|
[x: string]: {
|
|
@@ -1488,7 +1478,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1488
1478
|
selectedUnsubscribePages: number[];
|
|
1489
1479
|
forceRecreate: boolean;
|
|
1490
1480
|
trackIdCounter: number;
|
|
1491
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1492
1481
|
migration: {
|
|
1493
1482
|
recommendationConfigs: {
|
|
1494
1483
|
[x: string]: {
|
|
@@ -1632,7 +1621,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1632
1621
|
selectedUnsubscribePages: number[];
|
|
1633
1622
|
forceRecreate: boolean;
|
|
1634
1623
|
trackIdCounter: number;
|
|
1635
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1636
1624
|
migration: {
|
|
1637
1625
|
recommendationConfigs: {
|
|
1638
1626
|
[x: string]: {
|
|
@@ -1776,7 +1764,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1776
1764
|
selectedUnsubscribePages: number[];
|
|
1777
1765
|
forceRecreate: boolean;
|
|
1778
1766
|
trackIdCounter: number;
|
|
1779
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1780
1767
|
migration: {
|
|
1781
1768
|
recommendationConfigs: {
|
|
1782
1769
|
[x: string]: {
|
|
@@ -1920,7 +1907,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1920
1907
|
selectedUnsubscribePages: number[];
|
|
1921
1908
|
forceRecreate: boolean;
|
|
1922
1909
|
trackIdCounter: number;
|
|
1923
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1924
1910
|
migration: {
|
|
1925
1911
|
recommendationConfigs: {
|
|
1926
1912
|
[x: string]: {
|
|
@@ -2064,7 +2050,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2064
2050
|
selectedUnsubscribePages: number[];
|
|
2065
2051
|
forceRecreate: boolean;
|
|
2066
2052
|
trackIdCounter: number;
|
|
2067
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2068
2053
|
migration: {
|
|
2069
2054
|
recommendationConfigs: {
|
|
2070
2055
|
[x: string]: {
|
|
@@ -2208,7 +2193,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2208
2193
|
selectedUnsubscribePages: number[];
|
|
2209
2194
|
forceRecreate: boolean;
|
|
2210
2195
|
trackIdCounter: number;
|
|
2211
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2212
2196
|
migration: {
|
|
2213
2197
|
recommendationConfigs: {
|
|
2214
2198
|
[x: string]: {
|
|
@@ -2352,7 +2336,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2352
2336
|
selectedUnsubscribePages: number[];
|
|
2353
2337
|
forceRecreate: boolean;
|
|
2354
2338
|
trackIdCounter: number;
|
|
2355
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2356
2339
|
migration: {
|
|
2357
2340
|
recommendationConfigs: {
|
|
2358
2341
|
[x: string]: {
|
|
@@ -2496,7 +2479,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2496
2479
|
selectedUnsubscribePages: number[];
|
|
2497
2480
|
forceRecreate: boolean;
|
|
2498
2481
|
trackIdCounter: number;
|
|
2499
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2500
2482
|
migration: {
|
|
2501
2483
|
recommendationConfigs: {
|
|
2502
2484
|
[x: string]: {
|
|
@@ -2640,7 +2622,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2640
2622
|
selectedUnsubscribePages: number[];
|
|
2641
2623
|
forceRecreate: boolean;
|
|
2642
2624
|
trackIdCounter: number;
|
|
2643
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2644
2625
|
migration: {
|
|
2645
2626
|
recommendationConfigs: {
|
|
2646
2627
|
[x: string]: {
|
|
@@ -2786,7 +2767,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2786
2767
|
selectedUnsubscribePages: number[];
|
|
2787
2768
|
forceRecreate: boolean;
|
|
2788
2769
|
trackIdCounter: number;
|
|
2789
|
-
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2790
2770
|
migration: {
|
|
2791
2771
|
recommendationConfigs: {
|
|
2792
2772
|
[x: string]: {
|
|
@@ -52,15 +52,6 @@ const n = `.strategy-control-header {
|
|
|
52
52
|
mask-size: 24px 24px;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.strategy-control-notice--error {
|
|
56
|
-
border-color: var(--guido-color-border-onpage-message-error);
|
|
57
|
-
background-color: var(--guido-color-background-onpage-message-error);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.strategy-control-notice--error::before {
|
|
61
|
-
background-color: var(--guido-color-border-onpage-message-error);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
55
|
.strategy-control-notice-text {
|
|
65
56
|
margin: 0;
|
|
66
57
|
padding: 4px 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.19.0-beta.
|
|
3
|
+
"version": "3.19.0-beta.e110e88",
|
|
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",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import e from "./AuthErrorModal.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var a = function() {
|
|
5
|
-
var o = this, r = o._self._c, t = o._self._setupProxy;
|
|
6
|
-
return t.authError ? r("div", { staticClass: "auth-error-modal" }, [r(t.WpModal, { attrs: { id: "guido__auth-error-modal", state: "warning", "close-button-status": !1, "close-on-outside-click": !1, "footer-button-options": t.footerButtonOptions, title: t.title }, on: { close: t.dismiss, "primary-action": t.recover } }, [r("p", [o._v(o._s(t.message))])])], 1) : o._e();
|
|
7
|
-
}, n = [], i = /* @__PURE__ */ s(
|
|
8
|
-
e,
|
|
9
|
-
a,
|
|
10
|
-
n,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"b4d7ae51"
|
|
14
|
-
);
|
|
15
|
-
const m = i.exports;
|
|
16
|
-
export {
|
|
17
|
-
m as default
|
|
18
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, computed as n } from "vue";
|
|
2
|
-
import p from "../../wrappers/WpModal.vue.js";
|
|
3
|
-
import { useAuthError as d } from "../../../composables/useAuthError.js";
|
|
4
|
-
import { useTranslations as m } from "../../../composables/useTranslations.js";
|
|
5
|
-
const _ = /* @__PURE__ */ c({
|
|
6
|
-
__name: "AuthErrorModal",
|
|
7
|
-
setup(v) {
|
|
8
|
-
const e = m(), { authError: t } = d(), r = n(() => {
|
|
9
|
-
var o;
|
|
10
|
-
return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data !== null;
|
|
11
|
-
}), s = n(() => {
|
|
12
|
-
var o;
|
|
13
|
-
return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data === null;
|
|
14
|
-
}), i = n(() => r.value ? e("integration-hub.reload-this-page") : e("action-builder.session-expired")), u = n(() => r.value ? e("auth.error-occurred-refresh") : s.value ? e("settings.session-on-another-device") : e("journey-builder.login-session-expired")), l = n(() => ({
|
|
15
|
-
primaryButton: {
|
|
16
|
-
type: "primary",
|
|
17
|
-
labelText: r.value ? e("integration-hub.reload") : e("journey-builder.login-popup-button")
|
|
18
|
-
},
|
|
19
|
-
cancelOrBackButton: {
|
|
20
|
-
type: "secondary",
|
|
21
|
-
styling: "ghost",
|
|
22
|
-
labelText: e("settings.cancel")
|
|
23
|
-
}
|
|
24
|
-
})), a = () => {
|
|
25
|
-
if (r.value) {
|
|
26
|
-
window.location.reload();
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
window.location.replace("/");
|
|
30
|
-
};
|
|
31
|
-
return { __sfc: !0, trans: e, authError: t, isPageExpired: r, isTakenOver: s, title: i, message: u, footerButtonOptions: l, recover: a, dismiss: () => {
|
|
32
|
-
if (r.value) {
|
|
33
|
-
t.value = null;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
a();
|
|
37
|
-
}, WpModal: p };
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
export {
|
|
41
|
-
_ as default
|
|
42
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ToasterTypeOptions as l } from "../enums/toaster.js";
|
|
2
|
-
import { ref as p } from "vue";
|
|
3
|
-
import { useToaster as u } from "./useToaster.js";
|
|
4
|
-
import { useTranslations as f } from "./useTranslations.js";
|
|
5
|
-
const d = ["accessExpired", "domainRestricted", "ipRestricted", "insiderAccessRestricted"], n = p(null), a = (e) => {
|
|
6
|
-
try {
|
|
7
|
-
return new URL(e, window.location.href).origin === window.location.origin;
|
|
8
|
-
} catch {
|
|
9
|
-
return !0;
|
|
10
|
-
}
|
|
11
|
-
}, g = (e) => {
|
|
12
|
-
try {
|
|
13
|
-
const o = new URL(e, window.location.href);
|
|
14
|
-
return o.origin === window.location.origin ? o.href : "";
|
|
15
|
-
} catch {
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
}, w = (e) => {
|
|
19
|
-
try {
|
|
20
|
-
const o = JSON.parse(e);
|
|
21
|
-
return o && typeof o == "object" && Object.keys(o).length ? o : null;
|
|
22
|
-
} catch {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}, y = (e) => typeof (e == null ? void 0 : e.message) == "string" ? e.message : "", s = (e) => y(e) || f()("user-management.collaborate-forbidden-action"), c = (e) => {
|
|
26
|
-
u().showToaster({ type: l.Error, message: e });
|
|
27
|
-
}, R = (e, o, t) => {
|
|
28
|
-
if (t && !a(t))
|
|
29
|
-
return;
|
|
30
|
-
const r = w(o);
|
|
31
|
-
if (e === 403) {
|
|
32
|
-
c(s(r));
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (e === 401 && (r == null ? void 0 : r.type) === "groupLevelAccess") {
|
|
36
|
-
c(s(r));
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (e === 401 && typeof (r == null ? void 0 : r.type) == "string" && d.includes(r.type)) {
|
|
40
|
-
const i = typeof r.redirect == "string" ? g(r.redirect) : "";
|
|
41
|
-
if (i) {
|
|
42
|
-
window.location.replace(i);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
e !== 401 && e !== 419 || n.value || (window.isSessionExpired = !0, n.value = { status: e, data: r });
|
|
47
|
-
}, T = () => ({ authError: n });
|
|
48
|
-
export {
|
|
49
|
-
a as isPanelOrigin,
|
|
50
|
-
R as reportAuthError,
|
|
51
|
-
T as useAuthError
|
|
52
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { RECOMMENDATION_ID_ATTR as f, SELECTOR_ATTRIBUTE_ROW as _, ATTR_DATA_ATTRIBUTE_TYPE as a, ATTR_CUSTOM_PREFIX as g, ATTR_DATA_CARD_COMPOSITION as O, ATTR_DATA_CUSTOM_ATTRIBUTES as R } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
-
import { carriesForeignPartnerConfig as m, canJudgeUnstampedBlock as E, withoutCustomAttributes as d } from "../../extensions/Blocks/Recommendation/utils/partnerScope.js";
|
|
3
|
-
const S = ".recommendation-block-v2[esd-ext-config]", c = "esd-ext-config";
|
|
4
|
-
function C(t) {
|
|
5
|
-
const e = t.getAttribute(c);
|
|
6
|
-
if (!e)
|
|
7
|
-
return null;
|
|
8
|
-
try {
|
|
9
|
-
const r = JSON.parse(e);
|
|
10
|
-
return r && typeof r == "object" && !Array.isArray(r) ? r : null;
|
|
11
|
-
} catch {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function I(t, e, r) {
|
|
16
|
-
const o = d(e.composition ?? []);
|
|
17
|
-
t.querySelectorAll(_).forEach((i) => {
|
|
18
|
-
var s;
|
|
19
|
-
(s = i.getAttribute(a)) != null && s.startsWith(g) && i.remove();
|
|
20
|
-
}), t.setAttribute(O, o.join(",")), t.setAttribute(R, "[]"), t.setAttribute(c, JSON.stringify({
|
|
21
|
-
...e,
|
|
22
|
-
strategyId: "",
|
|
23
|
-
strategy: "",
|
|
24
|
-
filters: [],
|
|
25
|
-
productIds: [],
|
|
26
|
-
composition: o,
|
|
27
|
-
partnerName: r
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
function p(t, { partnerName: e, campaignUrls: r, rrsEnabled: o }) {
|
|
31
|
-
if (!e)
|
|
32
|
-
return t;
|
|
33
|
-
const i = new DOMParser().parseFromString(t, "text/html"), s = Array.from(i.querySelectorAll(S));
|
|
34
|
-
if (s.length === 0)
|
|
35
|
-
return t;
|
|
36
|
-
let T = 0;
|
|
37
|
-
return s.forEach((u) => {
|
|
38
|
-
const n = C(u), A = Number(u.getAttribute(f));
|
|
39
|
-
if (!(!n || !Number.isFinite(A))) {
|
|
40
|
-
if (m({ config: n, blockId: A, partnerName: e, campaignUrls: r, rrsEnabled: o })) {
|
|
41
|
-
I(u, n, e), T += 1;
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
n.partnerName || !E({ config: n, campaignUrls: r, rrsEnabled: o }) || (u.setAttribute(c, JSON.stringify({ ...n, partnerName: e })), T += 1);
|
|
45
|
-
}
|
|
46
|
-
}), T > 0 ? i.documentElement.outerHTML : t;
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
p as migrateRecommendationPartnerScope
|
|
50
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ATTR_CUSTOM_PREFIX as f } from "../constants/selectors.js";
|
|
2
|
-
function o(t) {
|
|
3
|
-
if (typeof t == "string")
|
|
4
|
-
return t.trim() !== "";
|
|
5
|
-
if (t && typeof t == "object" && "strategyId" in t) {
|
|
6
|
-
const { strategyId: r } = t;
|
|
7
|
-
return (typeof r == "string" || typeof r == "number") && String(r).trim() !== "";
|
|
8
|
-
}
|
|
9
|
-
return !1;
|
|
10
|
-
}
|
|
11
|
-
function u({ config: t, blockId: r, partnerName: e, campaignUrls: n, rrsEnabled: i }) {
|
|
12
|
-
return e ? t.partnerName ? t.partnerName !== e : !i || !t.strategyId || !n ? !1 : !o(n[String(r)]) : !1;
|
|
13
|
-
}
|
|
14
|
-
function a({ config: t, campaignUrls: r, rrsEnabled: e }) {
|
|
15
|
-
return !t.strategyId || e && !!r;
|
|
16
|
-
}
|
|
17
|
-
function g(t) {
|
|
18
|
-
return t.filter((r) => !r.startsWith(f));
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
a as canJudgeUnstampedBlock,
|
|
22
|
-
u as carriesForeignPartnerConfig,
|
|
23
|
-
o as isDefinedCampaignUrl,
|
|
24
|
-
g as withoutCustomAttributes
|
|
25
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface AuthErrorState {
|
|
2
|
-
status: number;
|
|
3
|
-
data: Record<string, unknown> | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const isPanelOrigin: (url: string) => boolean;
|
|
6
|
-
export declare const reportAuthError: (status: number, body: string, url: string) => void;
|
|
7
|
-
export declare const useAuthError: () => {
|
|
8
|
-
authError: import("vue").Ref<{
|
|
9
|
-
status: number;
|
|
10
|
-
data: Record<string, unknown> | null;
|
|
11
|
-
} | null>;
|
|
12
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Empties recommendation blocks copied in from another account and stamps the
|
|
3
|
-
* current one, before the editor ever sees the template (SD-151945).
|
|
4
|
-
*
|
|
5
|
-
* Runs at load rather than on document change: the stamp makes it a one-time
|
|
6
|
-
* pass per template, the campaign-URL rule only ever applies to the loaded HTML,
|
|
7
|
-
* and Stripo takes the result as the original document, so nothing is dirtied.
|
|
8
|
-
*/
|
|
9
|
-
export interface PartnerScopeMigrationOptions {
|
|
10
|
-
partnerName: string;
|
|
11
|
-
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
-
campaignUrls?: Record<string, unknown>;
|
|
13
|
-
rrsEnabled: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @param html Template HTML, already normalized by `migrateRecommendation`.
|
|
17
|
-
* @returns Migrated HTML, or the original when no block needed a reset or a stamp.
|
|
18
|
-
*/
|
|
19
|
-
export declare function migrateRecommendationPartnerScope(html: string, { partnerName, campaignUrls, rrsEnabled }: PartnerScopeMigrationOptions): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { RecommendationNodeConfig } from '../types/nodeConfig';
|
|
2
|
-
/**
|
|
3
|
-
* Mirrors the backend's `RecommendationCampaignUrls::isDefined`: a legacy feed URL
|
|
4
|
-
* string or an entry that names a strategy.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isDefinedCampaignUrl(value: unknown): boolean;
|
|
7
|
-
export interface PartnerScopeInputs {
|
|
8
|
-
config: Pick<RecommendationNodeConfig, 'strategyId' | 'partnerName'>;
|
|
9
|
-
blockId: number;
|
|
10
|
-
partnerName: string;
|
|
11
|
-
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
-
campaignUrls: Record<string, unknown> | undefined;
|
|
13
|
-
/** With RRS off `buildCampaignUrl` drops the block's map entry, so the map says nothing. */
|
|
14
|
-
rrsEnabled: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Whether a block carries another account's strategy config (SD-151945).
|
|
18
|
-
*
|
|
19
|
-
* A stamped block is judged by its stamp. An unstamped one predates the stamp, so it
|
|
20
|
-
* falls back to the backend's own signal: a cross-account duplicate drops the block's
|
|
21
|
-
* strategy entry from the campaign URL map but leaves the HTML untouched. That signal
|
|
22
|
-
* only holds while RRS is on, and only for the HTML the host loaded — which is what
|
|
23
|
-
* the caller, a load-time migrator, runs on.
|
|
24
|
-
*/
|
|
25
|
-
export declare function carriesForeignPartnerConfig({ config, blockId, partnerName, campaignUrls, rrsEnabled }: PartnerScopeInputs): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Whether an unstamped block's ownership can be decided at all. `carriesForeignPartnerConfig`
|
|
28
|
-
* answers `false` both for "clean" and for "cannot tell", and stamping on the latter would
|
|
29
|
-
* record a foreign block as this account's and silence every later check. A block with no
|
|
30
|
-
* strategy reference has nothing foreign to carry, so it is always decidable.
|
|
31
|
-
*/
|
|
32
|
-
export declare function canJudgeUnstampedBlock({ config, campaignUrls, rrsEnabled }: Pick<PartnerScopeInputs, 'config' | 'campaignUrls' | 'rrsEnabled'>): boolean;
|
|
33
|
-
export declare function withoutCustomAttributes(composition: string[]): string[];
|