@useinsider/guido 3.19.0-beta.cac604e → 3.19.0-beta.d04f200
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/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +79 -74
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useHttp.js +64 -54
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/extensions/Blocks/Recommendation/block.js +54 -88
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +32 -51
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +11 -12
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +13 -7
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -8,8 +8,8 @@ export declare const URLS: {
|
|
|
8
8
|
NEWSLETTER_RECOMMENDATIONS_PATH: string;
|
|
9
9
|
MIGRATE_STRATEGIES_PATH: string;
|
|
10
10
|
TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
|
|
11
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
12
11
|
};
|
|
12
|
+
export declare const strategyCreatePath: () => string;
|
|
13
13
|
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
14
14
|
export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
|
|
15
15
|
export declare const QUERY_PARAMS: {
|
|
@@ -137,12 +137,6 @@ export declare class RecommendationBlock extends Block {
|
|
|
137
137
|
* heals templates saved before this feature without dirtying current ones.
|
|
138
138
|
*/
|
|
139
139
|
private _healHidePriceAttr;
|
|
140
|
-
/**
|
|
141
|
-
* Empties a block copied in from another account: its strategy and attribute types
|
|
142
|
-
* are account-scoped and would not resolve here (SD-151945). Layout, locale and
|
|
143
|
-
* currency stay. The write stamps the current account, so the next pass is a no-op.
|
|
144
|
-
*/
|
|
145
|
-
private _resetForeignPartnerConfig;
|
|
146
140
|
/**
|
|
147
141
|
* Gets the recommendation-id from a block node
|
|
148
142
|
*/
|
|
@@ -543,11 +543,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
543
543
|
openRemoveStrategyModal(): void;
|
|
544
544
|
closeRemoveStrategyModal(): void;
|
|
545
545
|
fetchStrategies(): Promise<void>;
|
|
546
|
-
/**
|
|
547
|
-
* Drops what the store still holds for a block whose account-scoped config was just
|
|
548
|
-
* reset in the document (SD-151945), so the panel re-seeds from the emptied node.
|
|
549
|
-
*/
|
|
550
|
-
resetPartnerScopedConfig(id: number): void;
|
|
551
546
|
/**
|
|
552
547
|
* Clears what a block inherited from the id it arrived holding, so the panel fetches for it.
|
|
553
548
|
* A re-dropped saved module can keep the source's id — and its "already fetched" entry —
|
|
@@ -4,24 +4,30 @@ import type { RecommendationNodeConfig } from '../types/nodeConfig';
|
|
|
4
4
|
* string or an entry that names a strategy.
|
|
5
5
|
*/
|
|
6
6
|
export declare function isDefinedCampaignUrl(value: unknown): boolean;
|
|
7
|
-
/** Recommendation block ids present in the HTML the host loaded the editor with. */
|
|
8
|
-
export declare function loadedRecommendationIds(html: string): Set<number>;
|
|
9
7
|
export interface PartnerScopeInputs {
|
|
10
8
|
config: Pick<RecommendationNodeConfig, 'strategyId' | 'partnerName'>;
|
|
11
9
|
blockId: number;
|
|
12
10
|
partnerName: string;
|
|
13
11
|
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
14
12
|
campaignUrls: Record<string, unknown> | undefined;
|
|
15
|
-
|
|
13
|
+
/** With RRS off `buildCampaignUrl` drops the block's map entry, so the map says nothing. */
|
|
14
|
+
rrsEnabled: boolean;
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
17
|
* Whether a block carries another account's strategy config (SD-151945).
|
|
19
18
|
*
|
|
20
19
|
* A stamped block is judged by its stamp. An unstamped one predates the stamp, so it
|
|
21
20
|
* falls back to the backend's own signal: a cross-account duplicate drops the block's
|
|
22
|
-
* strategy entry from the campaign URL map but leaves the HTML untouched. That
|
|
23
|
-
* only holds
|
|
24
|
-
*
|
|
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.
|
|
25
24
|
*/
|
|
26
|
-
export declare function carriesForeignPartnerConfig({ config, blockId, partnerName, campaignUrls,
|
|
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;
|
|
27
33
|
export declare function withoutCustomAttributes(composition: string[]): string[];
|
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.d04f200",
|
|
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",
|