@useinsider/guido 3.23.0-beta.ff29317 → 3.24.0-beta.0abeefe

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 (72) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +39 -37
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +4 -4
  5. package/dist/components/Guido.vue2.js +98 -92
  6. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +17 -0
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
  8. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +17 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +45 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +36 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  15. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  16. package/dist/composables/useBlocksConfig.js +31 -20
  17. package/dist/composables/useDisplayConditions.js +117 -0
  18. package/dist/composables/useTranslations.js +2 -1
  19. package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
  20. package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
  21. package/dist/enums/academy.js +1 -0
  22. package/dist/enums/display-condition.js +12 -0
  23. package/dist/extensions/DisplayConditions/bridge.js +25 -0
  24. package/dist/extensions/DisplayConditions/constants.js +26 -0
  25. package/dist/extensions/DisplayConditions/control.js +215 -0
  26. package/dist/extensions/DisplayConditions/display-conditions.css.js +226 -0
  27. package/dist/extensions/DisplayConditions/extension.js +28 -0
  28. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  29. package/dist/extensions/DisplayConditions/library.js +30 -0
  30. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  31. package/dist/extensions/LinkTracking/extension.js +17 -0
  32. package/dist/extensions/LinkTracking/writer.js +41 -0
  33. package/dist/guido.css +1 -1
  34. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
  35. package/dist/node_modules/valibot/dist/index.js +297 -261
  36. package/dist/package.json.js +6 -6
  37. package/dist/services/displayConditionApi.js +39 -0
  38. package/dist/src/@types/config/schemas.d.ts +4 -0
  39. package/dist/src/@types/display-condition.d.ts +60 -0
  40. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  41. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
  42. package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +18 -0
  43. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
  44. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
  45. package/dist/src/composables/useConfig.d.ts +2 -0
  46. package/dist/src/composables/useDisplayConditions.d.ts +18 -0
  47. package/dist/src/enums/academy.d.ts +1 -0
  48. package/dist/src/enums/display-condition.d.ts +15 -0
  49. package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
  50. package/dist/src/extensions/DisplayConditions/constants.d.ts +23 -0
  51. package/dist/src/extensions/DisplayConditions/control.d.ts +25 -0
  52. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  53. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  54. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  55. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  56. package/dist/src/extensions/LinkTracking/extension.d.ts +2 -0
  57. package/dist/src/extensions/LinkTracking/writer.d.ts +13 -0
  58. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  59. package/dist/src/services/displayConditionApi.d.ts +8 -0
  60. package/dist/src/stores/config.d.ts +167 -0
  61. package/dist/src/stores/display-condition.d.ts +84 -0
  62. package/dist/src/utils/displayCondition.d.ts +11 -0
  63. package/dist/src/utils/linkTrackingIds.d.ts +22 -5
  64. package/dist/src/utils/protectTableText.d.ts +2 -0
  65. package/dist/stores/config.js +13 -6
  66. package/dist/stores/display-condition.js +29 -0
  67. package/dist/utils/displayCondition.js +26 -0
  68. package/dist/utils/linkTrackingIds.js +82 -48
  69. package/dist/utils/pairProductVariables.js +30 -29
  70. package/dist/utils/protectTableText.js +22 -0
  71. package/dist/utils/templatePreparation.js +67 -57
  72. package/package.json +1 -1
@@ -94,6 +94,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
94
94
  ui: {
95
95
  showHeader: boolean;
96
96
  backButtonLabel?: string | undefined;
97
+ externalDisplayConditions: boolean;
97
98
  };
98
99
  features: {
99
100
  dynamicContent: boolean;
@@ -240,6 +241,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
240
241
  ui: {
241
242
  showHeader: boolean;
242
243
  backButtonLabel?: string | undefined;
244
+ externalDisplayConditions: boolean;
243
245
  };
244
246
  features: {
245
247
  dynamicContent: boolean;
@@ -386,6 +388,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
386
388
  ui: {
387
389
  showHeader: boolean;
388
390
  backButtonLabel?: string | undefined;
391
+ externalDisplayConditions: boolean;
389
392
  };
390
393
  features: {
391
394
  dynamicContent: boolean;
@@ -532,6 +535,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
532
535
  ui: {
533
536
  showHeader: boolean;
534
537
  backButtonLabel?: string | undefined;
538
+ externalDisplayConditions: boolean;
535
539
  };
536
540
  features: {
537
541
  dynamicContent: boolean;
@@ -678,6 +682,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
678
682
  ui: {
679
683
  showHeader: boolean;
680
684
  backButtonLabel?: string | undefined;
685
+ externalDisplayConditions: boolean;
681
686
  };
682
687
  features: {
683
688
  dynamicContent: boolean;
@@ -824,6 +829,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
824
829
  ui: {
825
830
  showHeader: boolean;
826
831
  backButtonLabel?: string | undefined;
832
+ externalDisplayConditions: boolean;
827
833
  };
828
834
  features: {
829
835
  dynamicContent: boolean;
@@ -970,6 +976,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
970
976
  ui: {
971
977
  showHeader: boolean;
972
978
  backButtonLabel?: string | undefined;
979
+ externalDisplayConditions: boolean;
973
980
  };
974
981
  features: {
975
982
  dynamicContent: boolean;
@@ -1116,6 +1123,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1116
1123
  ui: {
1117
1124
  showHeader: boolean;
1118
1125
  backButtonLabel?: string | undefined;
1126
+ externalDisplayConditions: boolean;
1119
1127
  };
1120
1128
  features: {
1121
1129
  dynamicContent: boolean;
@@ -1262,6 +1270,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1262
1270
  ui: {
1263
1271
  showHeader: boolean;
1264
1272
  backButtonLabel?: string | undefined;
1273
+ externalDisplayConditions: boolean;
1265
1274
  };
1266
1275
  features: {
1267
1276
  dynamicContent: boolean;
@@ -1408,6 +1417,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1408
1417
  ui: {
1409
1418
  showHeader: boolean;
1410
1419
  backButtonLabel?: string | undefined;
1420
+ externalDisplayConditions: boolean;
1411
1421
  };
1412
1422
  features: {
1413
1423
  dynamicContent: boolean;
@@ -1554,6 +1564,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1554
1564
  ui: {
1555
1565
  showHeader: boolean;
1556
1566
  backButtonLabel?: string | undefined;
1567
+ externalDisplayConditions: boolean;
1557
1568
  };
1558
1569
  features: {
1559
1570
  dynamicContent: boolean;
@@ -1700,6 +1711,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1700
1711
  ui: {
1701
1712
  showHeader: boolean;
1702
1713
  backButtonLabel?: string | undefined;
1714
+ externalDisplayConditions: boolean;
1703
1715
  };
1704
1716
  features: {
1705
1717
  dynamicContent: boolean;
@@ -1846,6 +1858,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1846
1858
  ui: {
1847
1859
  showHeader: boolean;
1848
1860
  backButtonLabel?: string | undefined;
1861
+ externalDisplayConditions: boolean;
1849
1862
  };
1850
1863
  features: {
1851
1864
  dynamicContent: boolean;
@@ -1992,6 +2005,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1992
2005
  ui: {
1993
2006
  showHeader: boolean;
1994
2007
  backButtonLabel?: string | undefined;
2008
+ externalDisplayConditions: boolean;
1995
2009
  };
1996
2010
  features: {
1997
2011
  dynamicContent: boolean;
@@ -2138,6 +2152,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2138
2152
  ui: {
2139
2153
  showHeader: boolean;
2140
2154
  backButtonLabel?: string | undefined;
2155
+ externalDisplayConditions: boolean;
2141
2156
  };
2142
2157
  features: {
2143
2158
  dynamicContent: boolean;
@@ -2284,6 +2299,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2284
2299
  ui: {
2285
2300
  showHeader: boolean;
2286
2301
  backButtonLabel?: string | undefined;
2302
+ externalDisplayConditions: boolean;
2287
2303
  };
2288
2304
  features: {
2289
2305
  dynamicContent: boolean;
@@ -2430,6 +2446,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2430
2446
  ui: {
2431
2447
  showHeader: boolean;
2432
2448
  backButtonLabel?: string | undefined;
2449
+ externalDisplayConditions: boolean;
2433
2450
  };
2434
2451
  features: {
2435
2452
  dynamicContent: boolean;
@@ -2588,6 +2605,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2588
2605
  ui: {
2589
2606
  showHeader: boolean;
2590
2607
  backButtonLabel?: string | undefined;
2608
+ externalDisplayConditions: boolean;
2591
2609
  };
2592
2610
  features: {
2593
2611
  dynamicContent: boolean;
@@ -2734,6 +2752,154 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2734
2752
  ui: {
2735
2753
  showHeader: boolean;
2736
2754
  backButtonLabel?: string | undefined;
2755
+ externalDisplayConditions: boolean;
2756
+ };
2757
+ features: {
2758
+ dynamicContent: boolean;
2759
+ saveAsTemplate: boolean;
2760
+ versionHistory: boolean;
2761
+ testMessage: boolean;
2762
+ displayConditions: boolean;
2763
+ unsubscribe: boolean;
2764
+ modulesDisabled: boolean;
2765
+ liquidSyntax: boolean;
2766
+ autosave: boolean;
2767
+ accessibilityTesting: boolean;
2768
+ allowlistEnabled: boolean;
2769
+ linkTrackingIds: boolean;
2770
+ allowSaveWithErrors: boolean;
2771
+ reusableRecommendationStrategy: boolean;
2772
+ };
2773
+ blocks: {
2774
+ excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
2775
+ includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
2776
+ };
2777
+ compiler: {
2778
+ customRules: ({
2779
+ type: "replace";
2780
+ search: string;
2781
+ replacement: string;
2782
+ replaceAll?: boolean | undefined;
2783
+ id: string;
2784
+ description?: string | undefined;
2785
+ priority: number;
2786
+ } | {
2787
+ type: "regex";
2788
+ pattern: string;
2789
+ replacement: string;
2790
+ flags?: string | undefined;
2791
+ id: string;
2792
+ description?: string | undefined;
2793
+ priority: number;
2794
+ } | {
2795
+ type: "remove";
2796
+ targets: string[];
2797
+ id: string;
2798
+ description?: string | undefined;
2799
+ priority: number;
2800
+ } | {
2801
+ type: "custom";
2802
+ processor: (html: string) => string;
2803
+ id: string;
2804
+ description?: string | undefined;
2805
+ priority: number;
2806
+ })[];
2807
+ ignoreDefaultRules: boolean;
2808
+ };
2809
+ callbacks: {
2810
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
2811
+ };
2812
+ } | null;
2813
+ } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
2814
+ /**
2815
+ * Check if the Insider display-condition UI replaces Stripo's
2816
+ */
2817
+ externalDisplayConditions: (state: {
2818
+ initialized: boolean;
2819
+ config: {
2820
+ identity: {
2821
+ templateId: string;
2822
+ userId: string;
2823
+ variationId?: string | undefined;
2824
+ campaignId?: string | undefined;
2825
+ templateLibraryId?: string | undefined;
2826
+ };
2827
+ partner: {
2828
+ name: string;
2829
+ productType: 60 | 49 | 97;
2830
+ messageType: 1 | 2;
2831
+ username: string;
2832
+ fallbackFont?: {
2833
+ name: string;
2834
+ family: string;
2835
+ } | undefined;
2836
+ };
2837
+ template: {
2838
+ html: string;
2839
+ css: string;
2840
+ preselectedDynamicContent: {
2841
+ text: string;
2842
+ value: string;
2843
+ fallback?: string | undefined;
2844
+ format?: {
2845
+ key: string;
2846
+ value: string;
2847
+ } | undefined;
2848
+ }[];
2849
+ dynamicContentList: {
2850
+ [x: string]: import("../library").DynamicContentNode[];
2851
+ };
2852
+ customFieldAttributes: string[];
2853
+ selectedUnsubscribePages: number[];
2854
+ forceRecreate: boolean;
2855
+ trackIdCounter: number;
2856
+ recommendationCampaignUrls?: Record<string, unknown> | undefined;
2857
+ migration: {
2858
+ recommendationConfigs: {
2859
+ [x: string]: {
2860
+ id?: number | undefined;
2861
+ decimalCount?: string | number | undefined;
2862
+ productIds?: unknown[] | undefined;
2863
+ sendProductRequestFlag?: boolean | undefined;
2864
+ shuffleProducts?: boolean | undefined;
2865
+ filters?: unknown[] | undefined;
2866
+ currency?: string | undefined;
2867
+ currencySettings?: unknown;
2868
+ language?: string | undefined;
2869
+ strategy?: string | undefined;
2870
+ recommendedProducts?: unknown[] | undefined;
2871
+ cardsInRow?: number | undefined;
2872
+ mobileRightPadding?: number | undefined;
2873
+ mobileLeftPadding?: number | undefined;
2874
+ unresponsive?: boolean | undefined;
2875
+ orientation?: string | undefined;
2876
+ textTrimming?: boolean | undefined;
2877
+ blockType?: string | undefined;
2878
+ size?: string | number | undefined;
2879
+ verticalResponsiveness?: boolean | undefined;
2880
+ isPriceMovedToNextLine?: boolean | undefined;
2881
+ isPriceDeletedForZeroSale?: boolean | undefined;
2882
+ } & {
2883
+ [key: string]: unknown;
2884
+ };
2885
+ };
2886
+ };
2887
+ };
2888
+ editor: {
2889
+ locale: string;
2890
+ translationsPath: string;
2891
+ migrationDate: number;
2892
+ emailHeader: {
2893
+ senderName: string;
2894
+ subject: string;
2895
+ };
2896
+ savedModulesFolderName: string;
2897
+ defaultModulesFolderName: string;
2898
+ };
2899
+ ui: {
2900
+ showHeader: boolean;
2901
+ backButtonLabel?: string | undefined;
2902
+ externalDisplayConditions: boolean;
2737
2903
  };
2738
2904
  features: {
2739
2905
  dynamicContent: boolean;
@@ -2882,6 +3048,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2882
3048
  ui: {
2883
3049
  showHeader: boolean;
2884
3050
  backButtonLabel?: string | undefined;
3051
+ externalDisplayConditions: boolean;
2885
3052
  };
2886
3053
  features: {
2887
3054
  dynamicContent: boolean;
@@ -0,0 +1,84 @@
1
+ import type { AppliedDisplayCondition, SavedDisplayCondition } from '@@/Types/display-condition';
2
+ export type DisplayConditionView = 'none' | 'create' | 'select';
3
+ export type DisplayConditionListStatus = 'idle' | 'loading' | 'loaded' | 'error';
4
+ interface DisplayConditionState {
5
+ view: DisplayConditionView;
6
+ editing: AppliedDisplayCondition | null;
7
+ list: SavedDisplayCondition[];
8
+ listStatus: DisplayConditionListStatus;
9
+ listRequest: number;
10
+ pendingDelete: SavedDisplayCondition | null;
11
+ }
12
+ export declare const useDisplayConditionStore: import("pinia").StoreDefinition<"guidoDisplayCondition", DisplayConditionState, {
13
+ isCreateOpen: (state: {
14
+ view: DisplayConditionView;
15
+ editing: {
16
+ id: number;
17
+ name: string;
18
+ description: string;
19
+ beforeScript: string;
20
+ afterScript: string;
21
+ extraData?: string | undefined;
22
+ } | null;
23
+ list: {
24
+ id: number;
25
+ name: string;
26
+ description: string;
27
+ syntax: "liquid" | "pongo";
28
+ method: "codeOnly" | "logicBuilder";
29
+ codeBefore: string;
30
+ codeAfter: string;
31
+ createdAt?: string | undefined;
32
+ }[];
33
+ listStatus: DisplayConditionListStatus;
34
+ listRequest: number;
35
+ pendingDelete: {
36
+ id: number;
37
+ name: string;
38
+ description: string;
39
+ syntax: "liquid" | "pongo";
40
+ method: "codeOnly" | "logicBuilder";
41
+ codeBefore: string;
42
+ codeAfter: string;
43
+ createdAt?: string | undefined;
44
+ } | null;
45
+ } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
46
+ isSelectOpen: (state: {
47
+ view: DisplayConditionView;
48
+ editing: {
49
+ id: number;
50
+ name: string;
51
+ description: string;
52
+ beforeScript: string;
53
+ afterScript: string;
54
+ extraData?: string | undefined;
55
+ } | null;
56
+ list: {
57
+ id: number;
58
+ name: string;
59
+ description: string;
60
+ syntax: "liquid" | "pongo";
61
+ method: "codeOnly" | "logicBuilder";
62
+ codeBefore: string;
63
+ codeAfter: string;
64
+ createdAt?: string | undefined;
65
+ }[];
66
+ listStatus: DisplayConditionListStatus;
67
+ listRequest: number;
68
+ pendingDelete: {
69
+ id: number;
70
+ name: string;
71
+ description: string;
72
+ syntax: "liquid" | "pongo";
73
+ method: "codeOnly" | "logicBuilder";
74
+ codeBefore: string;
75
+ codeAfter: string;
76
+ createdAt?: string | undefined;
77
+ } | null;
78
+ } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
79
+ }, {
80
+ openCreate(editing?: AppliedDisplayCondition | null): void;
81
+ openSelect(): void;
82
+ close(): void;
83
+ }>;
84
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { AppliedDisplayCondition, DisplayConditionSyntax } from '@@/Types/display-condition';
2
+ import { DisplayConditionSourceType } from '@@/Enums/display-condition';
3
+ export declare const parseSource: (condition: AppliedDisplayCondition | null | undefined) => DisplayConditionSourceType | null;
4
+ type ConditionLike = Omit<AppliedDisplayCondition, 'description'> & {
5
+ description?: string | null;
6
+ };
7
+ export declare const toAppliedCondition: (condition: ConditionLike | null | undefined) => AppliedDisplayCondition | null;
8
+ export declare const nextConditionId: () => number;
9
+ export type CodeField = 'codeBefore' | 'codeAfter';
10
+ export declare const findInvalidCodeFields: (codeBefore: string, codeAfter: string, syntax?: DisplayConditionSyntax) => CodeField[];
11
+ export {};
@@ -10,6 +10,13 @@ export interface TrackingIdResult {
10
10
  changed: boolean;
11
11
  nextSeq: number;
12
12
  }
13
+ export interface TrackingIdPlan {
14
+ /** Anchor index in document order → id to write. Anchors keeping their id are absent. */
15
+ assignments: Map<number, number>;
16
+ nextSeq: number;
17
+ seqChanged: boolean;
18
+ changed: boolean;
19
+ }
13
20
  /**
14
21
  * Reads the persisted id high-water mark: <body> attr, then <html> attr,
15
22
  * then the leading comment fallback. Returns 0 when absent.
@@ -21,10 +28,20 @@ export declare function readTrackSeq(html: string): number;
21
28
  */
22
29
  export declare function readTrackFloor(html: string, persistedCounter?: number): number;
23
30
  /**
24
- * Ensures every <a> opening tag carries a unique positive-integer id and the
25
- * document records the id high-water mark. Ids are minted above
26
- * max(persisted seq, max id in document, floor) so deleted ids are never
27
- * reused — even after a version restore or paste-over (floor = session floor).
28
- * Idempotent: a document already normalized returns changed=false.
31
+ * Mints ids above max(persisted seq, max id seen, floor) so a deleted id is never reused;
32
+ * invalid or duplicate values are reassigned, the first duplicate in document order keeps its id.
29
33
  */
34
+ export declare function planTrackingIds(rawIds: (string | null)[], persistedSeq: number, floor?: number): TrackingIdPlan;
35
+ export interface DocumentTrackingIdPlan {
36
+ /** data-ins-track-id per anchor in document order; '' when absent. */
37
+ anchorIds: string[];
38
+ /** Per anchor: inside an HTML comment (e.g. Stripo's `<!--[if mso]>` button copy), absent from the node tree. */
39
+ inComment: boolean[];
40
+ plan: TrackingIdPlan;
41
+ }
42
+ /** Plans the ids for an HTML document without rewriting it. */
43
+ export declare function planDocumentTrackingIds(html: string, floor?: number): DocumentTrackingIdPlan;
44
+ /** Writes a plan into the HTML string: anchor ids by document order, then the seq host. */
45
+ export declare function renderTrackingIdPlan(html: string, { plan }: DocumentTrackingIdPlan): string;
46
+ /** Gives every <a> a unique positive-integer id and records the high-water mark; idempotent. */
30
47
  export declare function assignTrackingIds(html: string, floor?: number): TrackingIdResult;
@@ -0,0 +1,2 @@
1
+ export declare function protectTableText(html: string): string;
2
+ export declare const restoreTableText: (html: string) => string;
@@ -1,8 +1,8 @@
1
- import { MessageType as r } from "../@types/config/schemas.js";
1
+ import { MessageType as a } from "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
- import { parseConfig as a } from "../@types/config/validator.js";
4
- import { defineStore as o } from "pinia";
5
- const g = o("guido-config", {
3
+ import { parseConfig as o } from "../@types/config/validator.js";
4
+ import { defineStore as l } from "pinia";
5
+ const g = l("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -132,7 +132,7 @@ const g = o("guido-config", {
132
132
  * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
133
133
  */
134
134
  isTransactional() {
135
- return this.messageType === r.TRANSACTIONAL;
135
+ return this.messageType === a.TRANSACTIONAL;
136
136
  },
137
137
  /**
138
138
  * Soft-save policy: may the editor persist a template with validation errors?
@@ -158,6 +158,13 @@ const g = o("guido-config", {
158
158
  var e, t;
159
159
  return ((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.showHeader) ?? !0;
160
160
  },
161
+ /**
162
+ * Check if the Insider display-condition UI replaces Stripo's
163
+ */
164
+ externalDisplayConditions: (i) => {
165
+ var e, t, n, r;
166
+ return (((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.externalDisplayConditions) ?? !1) && (((r = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : r.displayConditions) ?? !0);
167
+ },
161
168
  /**
162
169
  * Check if a specific feature is enabled.
163
170
  * Returns false before init (config null) so header controls don't
@@ -174,7 +181,7 @@ const g = o("guido-config", {
174
181
  * Initialize the config store with validated configuration
175
182
  */
176
183
  init(i) {
177
- const e = a(i);
184
+ const e = o(i);
178
185
  this.config = e, this.initialized = !0;
179
186
  },
180
187
  /**
@@ -0,0 +1,29 @@
1
+ import { defineStore as t } from "pinia";
2
+ const n = t("guidoDisplayCondition", {
3
+ state: () => ({
4
+ view: "none",
5
+ editing: null,
6
+ list: [],
7
+ listStatus: "idle",
8
+ listRequest: 0,
9
+ pendingDelete: null
10
+ }),
11
+ getters: {
12
+ isCreateOpen: (e) => e.view === "create",
13
+ isSelectOpen: (e) => e.view === "select"
14
+ },
15
+ actions: {
16
+ openCreate(e = null) {
17
+ this.editing = e, this.view = "create";
18
+ },
19
+ openSelect() {
20
+ this.editing = null, this.view = "select";
21
+ },
22
+ close() {
23
+ this.view = "none", this.pendingDelete = null;
24
+ }
25
+ }
26
+ });
27
+ export {
28
+ n as useDisplayConditionStore
29
+ };
@@ -0,0 +1,26 @@
1
+ import { DisplayConditionSourceType as n } from "../enums/display-condition.js";
2
+ const m = (e) => {
3
+ if (!e)
4
+ return null;
5
+ try {
6
+ return JSON.parse(e.extraData ?? "{}").source === n.INLINE ? n.INLINE : n.SAVED;
7
+ } catch {
8
+ return n.SAVED;
9
+ }
10
+ }, I = (e) => !e || !(e.name || e.beforeScript || e.afterScript) ? null : { ...e, description: e.description ?? "" };
11
+ let c = 0;
12
+ const C = () => (c = Math.max(Date.now(), c + 1), c), p = /{%-?\s*(\w+)[\s\S]*?-?%}/g, S = /{%[\s\S]*?%}|{{[\s\S]*?}}/g, u = /{%-?\s*(comment|raw)\s*-?%}[\s\S]*?{%-?\s*end\1\s*-?%}/g, A = /{#[\s\S]*?#}/g, d = /* @__PURE__ */ new Set(["if", "unless", "for", "case", "capture", "tablerow", "comment"]), T = /* @__PURE__ */ new Set(["else", "elsif", "elif", "when"]), h = (e) => /{%|%}|{{|}}/.test(e.replace(S, "")), D = (e, a, f = "liquid") => {
13
+ const t = /* @__PURE__ */ new Set(), r = [];
14
+ return [["codeBefore", e], ["codeAfter", a]].forEach(([o, l]) => {
15
+ const i = (f === "pongo" ? l.replace(A, "") : l).replace(u, "");
16
+ h(i) && t.add(o), Array.from(i.matchAll(p), (s) => s[1]).forEach((s) => {
17
+ d.has(s) ? r.push(s) : s.startsWith("end") && d.has(s.slice(3)) ? r.pop() !== s.slice(3) && t.add(o) : T.has(s) && !r.length && t.add(o);
18
+ });
19
+ }), r.length && t.add("codeAfter"), [...t];
20
+ };
21
+ export {
22
+ D as findInvalidCodeFields,
23
+ C as nextConditionId,
24
+ m as parseSource,
25
+ I as toAppliedCondition
26
+ };