@useinsider/guido 3.3.0-beta.86ea9cd → 3.3.0-beta.8f029c7

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 (34) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +42 -40
  3. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
  4. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
  5. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  6. package/dist/composables/useCortexBlueprintBridge.js +66 -0
  7. package/dist/composables/useEmailTemplateApplier.js +41 -0
  8. package/dist/composables/useGuidoStateBridge.js +48 -0
  9. package/dist/composables/useHtmlValidator.js +41 -36
  10. package/dist/composables/useRecommendation.js +2 -2
  11. package/dist/config/migrator/radioButtonMigrator.js +30 -29
  12. package/dist/enums/extensions/recommendationBlock.js +101 -46
  13. package/dist/enums/unsubscribe.js +25 -24
  14. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  15. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  16. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  17. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
  18. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
  19. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  20. package/dist/guido.css +1 -1
  21. package/dist/package.json.js +1 -1
  22. package/dist/services/unsubscribeApi.js +6 -6
  23. package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
  24. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  25. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  26. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  27. package/dist/src/enums/unsubscribe.d.ts +8 -3
  28. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  29. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  30. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  31. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  32. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  33. package/dist/stores/guido-email-editor.js +20 -0
  34. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationProduct } from '@@/Types/recommendation';
2
- interface PerBlockConfigs {
2
+ export interface PerBlockConfigs {
3
3
  cardsInRow: number;
4
4
  currencySettings: {
5
5
  name: string;
@@ -272,6 +272,12 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
272
272
  deleteFilter(filter: Filter): void;
273
273
  addFilter(filter: Filter): void;
274
274
  generateFilterQuery(): string;
275
+ /**
276
+ * Validation-only check invoked at save-CTA time. Defined as an action
277
+ * (not a getter) so reading it does not register reactive tracking on
278
+ * every block's recommendationConfigs across user edits.
279
+ */
280
+ hasInvalidBlock(): boolean;
275
281
  fetchRecommendationProducts(): Promise<void>;
276
282
  _doFetchProducts(): Promise<void>;
277
283
  }>;
@@ -1,4 +1,6 @@
1
1
  import type { Filter } from '@@/Types/recommendation';
2
+ export declare function safeDecodeURIComponent(value: string): string;
3
+ export declare function parseTagList(value: string): string[];
2
4
  /**
3
5
  * Generates the complete query with outer group operators
4
6
  * @param filters Array of Filter objects
@@ -0,0 +1,21 @@
1
+ import type { PerBlockConfigs } from '../store/recommendation';
2
+ import type { Currency, Languages } from '@@/Types/recommendation';
3
+ /**
4
+ * Structural slice of the recommendation extension store that descriptors may read.
5
+ * Add new fields here when a future descriptor needs them.
6
+ */
7
+ export interface ExtensionStoreSlice {
8
+ languages: Languages;
9
+ currencyList: Currency[];
10
+ }
11
+ interface RequiredField {
12
+ key: string;
13
+ getValue: (config: PerBlockConfigs) => string;
14
+ getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
15
+ condition?: (config: PerBlockConfigs) => boolean;
16
+ }
17
+ export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
18
+ export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
19
+ export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice): string[];
20
+ export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
21
+ export {};
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Outbound contract Guido publishes to the host's shared Pinia singleton so
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", {
16
+ /** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
17
+ html: string;
18
+ /** Current Stripo CSS — es-p* utility classes used by the html. */
19
+ css: string;
20
+ /** Wall-clock ms when html/css were last written by the bridge. */
21
+ lastUpdatedAt: number;
22
+ /** Template id from the editor config, for cortex-fe to scope per-template. */
23
+ templateId: string;
24
+ }, {
25
+ /** True once the bridge has published at least one snapshot. */
26
+ hasSnapshot: (state: {
27
+ html: string;
28
+ css: string;
29
+ lastUpdatedAt: number;
30
+ 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;
41
+ }, {}>;
@@ -0,0 +1,20 @@
1
+ import { defineStore as e } from "pinia";
2
+ const d = e("guidoEmailEditor", {
3
+ state: () => ({
4
+ /** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
5
+ html: "",
6
+ /** Current Stripo CSS — es-p* utility classes used by the html. */
7
+ css: "",
8
+ /** Wall-clock ms when html/css were last written by the bridge. */
9
+ lastUpdatedAt: 0,
10
+ /** Template id from the editor config, for cortex-fe to scope per-template. */
11
+ templateId: ""
12
+ }),
13
+ getters: {
14
+ /** True once the bridge has published at least one snapshot. */
15
+ hasSnapshot: (t) => t.lastUpdatedAt > 0 && t.html !== ""
16
+ }
17
+ });
18
+ export {
19
+ d as useGuidoEmailEditorStore
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.3.0-beta.86ea9cd",
3
+ "version": "3.3.0-beta.8f029c7",
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",
@@ -90,7 +90,7 @@
90
90
  },
91
91
  "guido": {
92
92
  "stripo": {
93
- "version": "2.62.0"
93
+ "version": "2.64.0"
94
94
  }
95
95
  }
96
96
  }