@useinsider/guido 3.20.1-beta.2a573b4 → 3.20.1-beta.2c8da49

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.
Files changed (44) hide show
  1. package/dist/composables/useActionsApi.js +80 -63
  2. package/dist/composables/useGuidoStateBridge.js +3 -3
  3. package/dist/composables/useStripo.js +8 -8
  4. package/dist/extensions/Blocks/Recommendation/block.js +33 -29
  5. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +78 -83
  6. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
  7. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +2 -12
  8. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +104 -86
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +222 -210
  10. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -50
  11. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +16 -21
  12. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +44 -40
  13. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +14 -19
  14. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +104 -102
  15. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +18 -23
  16. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +312 -286
  17. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +24 -20
  18. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -7
  19. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
  20. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +113 -151
  21. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +20 -11
  22. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  23. package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +25 -0
  24. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +9 -9
  25. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +106 -50
  26. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +3 -5
  27. package/dist/src/composables/useActionsApi.d.ts +5 -1
  28. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  29. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -6
  30. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
  31. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -11
  32. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +6 -3
  33. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +6 -5
  34. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -3
  35. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +21 -9
  36. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +19 -13
  37. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +10 -8
  38. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +9 -5
  39. package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +6 -0
  40. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +13 -13
  41. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +0 -2
  42. package/dist/src/stores/editor.d.ts +3 -1
  43. package/dist/stores/editor.js +5 -0
  44. package/package.json +1 -1
@@ -6,6 +6,8 @@ interface ConfigWriterApi {
6
6
  getDocumentModifier: () => DocumentModifier;
7
7
  getDocumentRootHtmlNode: () => ImmutableHtmlNode;
8
8
  }
9
+ export declare const UPDATE_FILTERS_DESCRIPTION = "Update recommendation filters";
10
+ export type OutsidePanelWriteResult = 'applied' | 'unchanged' | 'missing';
9
11
  /**
10
12
  * Keeps a document handle alive for writes the settings panel can no longer make.
11
13
  * Deliberately not cleared on deselect — that is the exact moment the handle is
@@ -13,27 +15,25 @@ interface ConfigWriterApi {
13
15
  * itself is torn down.
14
16
  */
15
17
  export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
18
+ /** Registers a config write still waiting for its product fetch; the flush reports whether it applied a patch. */
19
+ export declare function registerPendingConfigFlush(flush: () => boolean): () => void;
20
+ /** Lands every deferred config write before the document is read (save, export, autosave); returns the patches applied. */
21
+ export declare function flushPendingNodeConfigWrites(): number;
22
+ export declare function describeConfigChange(nodeConfig: RecommendationNodeConfig, updates: PartialNodeConfig): string | null;
16
23
  export declare function hasEditedConfigChange(node: ImmutableHtmlNode, updates: PartialNodeConfig): boolean;
24
+ /** Stages the config and the compiler-read currency attributes that must follow it, without applying. */
25
+ export declare function stageConfigChange(documentModifier: DocumentModifier, node: ImmutableHtmlNode, updates: PartialNodeConfig): void;
17
26
  /**
18
27
  * Writes a config change to the block's node on its own, found by id — never through a
19
28
  * panel-held node, which may already belong to the block the user switched to.
20
- * @returns whether the block's node was found
29
+ * @param description - overrides the label derived from the keys that move
21
30
  */
22
- export declare function writeBlockConfigOutsidePanel(blockId: number, updates: PartialNodeConfig, description: string): boolean;
31
+ export declare function writeBlockConfigOutsidePanel(blockId: number, updates: PartialNodeConfig, description?: string): OutsidePanelWriteResult;
23
32
  /** Reads the persisted config of every node carrying a block id (two while a duplicate still shares it). */
24
33
  export declare function readBlockNodeConfigs(blockId: number): RecommendationNodeConfig[];
25
34
  /**
26
- * Commits a config change and its product re-render straight to the document,
27
- * bypassing the settings panel.
28
- *
29
- * Host-rendered UI (the remove-strategy modal) lives outside `ui-editor`, and
30
- * Stripo deselects the block on the first click that lands there — destroying the
31
- * control that normally does both, before the store change even happens.
32
- *
33
- * Mirrors the control's regenerate routine so config and cards land in ONE undo
34
- * entry, and so partner-managed blocks keep their hand-authored cells.
35
- * @param description - labels the undo entry only when there are no cards to
36
- * re-render; the product helpers label their own batch.
35
+ * Commits a config change and its cards to the document in ONE apply, bypassing the settings panel
36
+ * (host-rendered UI deselects the block first): one Undo reverts both and Version History previews the cards.
37
37
  * @returns whether the write reached a node
38
38
  */
39
39
  export declare function commitBlockChangeOutsidePanel(blockId: number, updates: PartialNodeConfig, products: RecommendationProduct[], description: string): boolean;
@@ -1,5 +1,3 @@
1
- /** Joins `sanitizeProductIds` output; split with the same value to read it back. */
2
- export declare const PRODUCT_ID_SEPARATOR = ",";
3
1
  /**
4
2
  * Builds the request/URL `productId` value from raw product ID segments.
5
3
  * Trimming happens here — NOT on input change — so the user's in-progress
@@ -336,4 +336,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
336
336
  syncModulesEnabled: boolean;
337
337
  trackIdSessionFloor: number;
338
338
  }>) => boolean;
339
- }, {}>;
339
+ }, {
340
+ markChanged(): void;
341
+ }>;
@@ -35,6 +35,11 @@ const o = e("guidoEditor", {
35
35
  isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen,
36
36
  // Autosave
37
37
  isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
38
+ },
39
+ actions: {
40
+ markChanged() {
41
+ this.hasChanges = !0, this.changeSeq += 1;
42
+ }
38
43
  }
39
44
  });
40
45
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.20.1-beta.2a573b4",
3
+ "version": "3.20.1-beta.2c8da49",
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",