@useinsider/guido 3.27.1 → 3.28.0-beta.93b3145

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/README.md +10 -5
  2. package/dist/components/Guido.vue.js +7 -7
  3. package/dist/components/Guido.vue2.js +86 -83
  4. package/dist/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js +24 -0
  5. package/dist/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue2.js +59 -0
  6. package/dist/composables/useAmbiguousDynamicContent.js +72 -0
  7. package/dist/composables/useHtmlCompiler.js +21 -17
  8. package/dist/composables/useHtmlValidator.js +71 -71
  9. package/dist/composables/useModuleRepair.js +63 -32
  10. package/dist/composables/useSaveValidation.js +80 -80
  11. package/dist/composables/useStripo.js +44 -43
  12. package/dist/config/compiler/htmlCompilerRules.js +16 -6
  13. package/dist/config/compiler/pongoCompilerRules.js +13 -0
  14. package/dist/config/migrator/itemsBlockMigrator.js +220 -178
  15. package/dist/enums/dynamic-content.js +4 -0
  16. package/dist/enums/html-validator.js +8 -7
  17. package/dist/guido.css +1 -1
  18. package/dist/package.json.js +2 -2
  19. package/dist/src/@types/generic.d.ts +7 -0
  20. package/dist/src/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue.d.ts +2 -0
  21. package/dist/src/composables/useAmbiguousDynamicContent.d.ts +7 -0
  22. package/dist/src/composables/useModuleRepair.d.ts +6 -0
  23. package/dist/src/config/compiler/pongoCompilerRules.d.ts +2 -0
  24. package/dist/src/enums/dynamic-content.d.ts +3 -0
  25. package/dist/src/enums/html-validator.d.ts +1 -0
  26. package/dist/src/stores/module-dynamic-content.d.ts +30 -0
  27. package/dist/src/utils/dynamicContentConverter.d.ts +20 -18
  28. package/dist/src/utils/dynamicContentPendingMarker.d.ts +2 -0
  29. package/dist/src/utils/genericUtil.d.ts +4 -8
  30. package/dist/stores/module-dynamic-content.js +20 -0
  31. package/dist/utils/dynamicContentConverter.js +41 -27
  32. package/dist/utils/dynamicContentPendingMarker.js +6 -0
  33. package/dist/utils/genericUtil.js +39 -39
  34. package/package.json +1 -1
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-8fc59697]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-8fc59697]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-8fc59697]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
@@ -1,9 +1,9 @@
1
- const o = "3.27.1", s = { stripo: { version: "2.86.1" } }, n = {
1
+ const o = "3.28.0-beta.93b3145", s = { stripo: { version: "2.86.1" } }, t = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
5
5
  export {
6
- n as default,
6
+ t as default,
7
7
  s as guido,
8
8
  o as version
9
9
  };
@@ -31,6 +31,13 @@ export type DynamicContentNode = {
31
31
  * flattens the active (first) partner's leaf attributes into a `DynamicContent[]`.
32
32
  */
33
33
  export type DynamicContentList = Record<string, DynamicContentNode[]>;
34
+ /** A leaf attribute with both backend labels and its category path (root → parent). */
35
+ export type DynamicContentCandidate = {
36
+ value: string;
37
+ text: string;
38
+ tagText: string;
39
+ path: string[];
40
+ };
34
41
  export type MergeTag = BaseDynamicContent & {
35
42
  label: string;
36
43
  selStart?: number;
@@ -0,0 +1,2 @@
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;
@@ -0,0 +1,7 @@
1
+ import { type PendingModuleDynamicContent } from '@@/Stores/module-dynamic-content';
2
+ /** Resolves or dismisses the labels a dropped module left pending (see `useModuleRepair`). */
3
+ export declare const useAmbiguousDynamicContent: () => {
4
+ resolve: ({ id, items }: PendingModuleDynamicContent, selections: Record<string, string>) => void;
5
+ dismiss: (id: string) => void;
6
+ restorePending: () => void;
7
+ };
@@ -1,9 +1,15 @@
1
+ import type { DynamicContentCandidate } from '@@/Types/generic';
1
2
  import type { ModuleAddData, ModuleModifier } from '@@/Types/stripo';
3
+ import { type DynamicContentConversionResult } from '@@/Utils/dynamicContentConverter';
2
4
  export declare const UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY = "dynamic-content.unresolved-attributes-on-drop";
5
+ export declare const registerUsedAttributes: (html: string, candidates: DynamicContentCandidate[]) => void;
3
6
  /**
4
7
  * Repairs dropped/copied saved modules (items currency, linkless legacy unsubscribe → text block,
5
8
  * dynamic-content labels → tokens) in one write-back; wired via Stripo's `onModuleAdd` (see `useStripo`).
6
9
  */
7
10
  export declare const useModuleRepair: () => {
8
11
  handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
12
+ convertDynamicContent: (html: string) => DynamicContentConversionResult & {
13
+ candidates: DynamicContentCandidate[];
14
+ };
9
15
  };
@@ -0,0 +1,2 @@
1
+ import type { CompilerRule } from '@@/Types/html-compiler';
2
+ export declare const pongoCompilerRules: CompilerRule[];
@@ -0,0 +1,3 @@
1
+ export declare enum ModuleDynamicContentAttribute {
2
+ Pending = "data-guido-dc-pending"
3
+ }
@@ -3,6 +3,7 @@ export declare const CanNotMakeAnyChangesKey = "newsletter.can-not-make-any-chan
3
3
  export declare const CampaignCouldNotBeSavedKey = "newsletter.campaign-could-not-be-saved";
4
4
  export declare const DISPLAY_CONDITIONS_REGEX: RegExp;
5
5
  export declare const DISPLAY_CONDITIONS_EXCEPTIONS_REGEX: RegExp;
6
+ export declare const CONDITION_TAG_REGEX: RegExp;
6
7
  export declare const REMOVE_CONDITIONS_REGEX: RegExp;
7
8
  export declare const DYNAMIC_CONTENT_TAG_REGEX: RegExp;
8
9
  export declare const DATA_ATTRIBUTE_REGEX: RegExp;
@@ -0,0 +1,30 @@
1
+ import type { AmbiguousDynamicContent } from '@@/Utils/dynamicContentConverter';
2
+ export interface PendingModuleDynamicContent {
3
+ /** Value of the module root's pending marker attribute. */
4
+ id: string;
5
+ items: AmbiguousDynamicContent[];
6
+ }
7
+ interface ModuleDynamicContentState {
8
+ queue: PendingModuleDynamicContent[];
9
+ }
10
+ export declare const useModuleDynamicContentStore: import("pinia").StoreDefinition<"guidoModuleDynamicContent", ModuleDynamicContentState, {
11
+ current: (state: {
12
+ queue: {
13
+ id: string;
14
+ items: {
15
+ label: string;
16
+ spellings: string[];
17
+ candidates: {
18
+ value: string;
19
+ text: string;
20
+ tagText: string;
21
+ path: string[];
22
+ }[];
23
+ }[];
24
+ }[];
25
+ } & import("pinia").PiniaCustomStateProperties<ModuleDynamicContentState>) => PendingModuleDynamicContent | null;
26
+ }, {
27
+ enqueue(entry: PendingModuleDynamicContent): void;
28
+ remove(id: string): void;
29
+ }>;
30
+ export {};
@@ -1,27 +1,29 @@
1
- import type { DynamicContent } from '@@/Types/generic';
1
+ import type { DynamicContentCandidate } from '@@/Types/generic';
2
+ type DynamicContentLookup = Map<string, DynamicContentCandidate[]>;
3
+ export interface AmbiguousDynamicContent {
4
+ /** The label as the author wrote it (first occurrence). */
5
+ label: string;
6
+ /** Every exact token name that resolved to this label, so a choice never touches a valid token. */
7
+ spellings: string[];
8
+ candidates: DynamicContentCandidate[];
9
+ }
2
10
  export interface DynamicContentConversionResult {
3
11
  html: string;
4
12
  /** Distinct tokens that matched neither a known value nor a known label (reported to the user). */
5
13
  unresolved: string[];
14
+ /** Labels shared by several attributes; left untouched for the user to choose. */
15
+ ambiguous: AmbiguousDynamicContent[];
6
16
  }
7
17
  /**
8
- * Builds a label→item lookup from one or more dynamic-content lists, keyed by
9
- * normalized label (trimmed, lowercased). When lists overlap, a later list wins
10
- * for a shared key.
18
+ * Builds a label → candidates lookup keyed by both backend labels (`text`, `tag_text`),
19
+ * normalized (trimmed, lowercased). A label shared by several attributes keeps all of them.
11
20
  */
12
- export declare const buildDynamicContentLookup: (...lists: DynamicContent[][]) => Map<string, DynamicContent>;
21
+ export declare const buildDynamicContentLookup: (candidates: DynamicContentCandidate[]) => DynamicContentLookup;
13
22
  /**
14
- * Repairs dynamic-content tokens in a dropped module's HTML, using `lookup`
15
- * (label→item) built from the account's full dynamic-content list. Returns the
16
- * rewritten HTML plus the tokens it could not resolve.
17
- *
18
- * A token is rewritten to its canonical `{{value}}` form when its name matches a
19
- * display label (`{{ Phone Number }}` → `{{phone_number}}`). Left untouched: an
20
- * exact canonical value (already correct — this also stops a valid token being
21
- * rewritten just because it coincides with an unrelated label), Liquid nested
22
- * tokens (dotted, e.g. `coupon.code`), recommendation-block variables
23
- * (`123_0_attr`), allowed system tokens, and `data-*` product tags. The account
24
- * list is exhaustive, so any remaining token matching neither a value nor a label
25
- * is reported in `unresolved`; the text itself is always left in place.
23
+ * Rewrites label tokens with one candidate; exact values/`validTokens` stay. Several candidates
24
+ * → `ambiguous`, none → `unresolved`; reported text is never changed.
26
25
  */
27
- export declare const convertModuleDynamicContent: (html: string, lookup: Map<string, DynamicContent>, liquidSyntax: boolean) => DynamicContentConversionResult;
26
+ export declare const convertModuleDynamicContent: (html: string, lookup: DynamicContentLookup, validTokens?: string[]) => DynamicContentConversionResult;
27
+ /** Rewrites every token whose exact name the user resolved (`spelling → value`), keeping tails. */
28
+ export declare const applyDynamicContentChoices: (html: string, choices: Map<string, string>) => string;
29
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const PENDING_MARKER_PATTERN = "\\s+data-guido-dc-pending=\"[^\"]*\"";
2
+ export declare const stripPendingMarker: (html: string) => string;
@@ -1,15 +1,11 @@
1
- import type { DynamicContent, DynamicContentList, MergeTag } from '@@/Types/generic';
1
+ import type { DynamicContent, DynamicContentCandidate, DynamicContentList, MergeTag } from '@@/Types/generic';
2
2
  export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
3
3
  export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
4
4
  /**
5
- * Flattens the partner-keyed dynamic-content tree into a deduped flat list of the
6
- * ACTIVE partner's leaf attributes. A single editor session targets one partner,
7
- * so only the FIRST partner entry is used (the sole entry for a single-partner
8
- * host like email-fe; merging all partners would risk cross-partner label
9
- * collisions). A node carrying `children`/`select_items` is a category grouping:
10
- * recursed into but never collected itself — only real leaf attributes
11
- * (`text`/`tag_text` + `value`) become `{ text, value }` pairs.
5
+ * Flattens the ACTIVE (first) partner's tree into deduped leaf attributes with both labels and
6
+ * their category path; category nodes (`children`/`select_items`) are walked, never collected.
12
7
  */
8
+ export declare const flattenDynamicContentCandidates: (list: DynamicContentList | undefined | null) => DynamicContentCandidate[];
13
9
  export declare const flattenDynamicContentList: (list: DynamicContentList | undefined | null) => DynamicContent[];
14
10
  /**
15
11
  * Builds the editor merge-tag entries from the template's preselected list plus
@@ -0,0 +1,20 @@
1
+ import { defineStore as u } from "pinia";
2
+ const i = u("guidoModuleDynamicContent", {
3
+ state: () => ({
4
+ queue: []
5
+ }),
6
+ getters: {
7
+ current: (e) => e.queue[0] ?? null
8
+ },
9
+ actions: {
10
+ enqueue(e) {
11
+ this.queue = [...this.queue, e];
12
+ },
13
+ remove(e) {
14
+ this.queue = this.queue.filter((t) => t.id !== e);
15
+ }
16
+ }
17
+ });
18
+ export {
19
+ i as useModuleDynamicContentStore
20
+ };
@@ -1,31 +1,45 @@
1
- import { DATA_ATTRIBUTE_REGEX as A, DYNAMIC_CONTENT_TAG_REGEX as m, ALLOWED_DYNAMIC_SYSTEM_TOKENS as D } from "../enums/html-validator.js";
2
- import { dynamicContentToMergeTags as T } from "./genericUtil.js";
3
- const p = "guidoDataMask", M = "EndDataMask", f = /guidoDataMask(\d+)EndDataMask/g, h = /^\d+_\d+_.+$/, E = (o) => o.trim().toLowerCase(), I = (...o) => {
4
- const r = /* @__PURE__ */ new Map();
5
- return o.forEach((i) => {
6
- i.forEach((s) => {
7
- const a = E(s.text);
8
- a && r.set(a, s);
1
+ import { DATA_ATTRIBUTE_REGEX as g, DYNAMIC_CONTENT_TAG_REGEX as A, ALLOWED_DYNAMIC_SYSTEM_TOKENS as T } from "../enums/html-validator.js";
2
+ import { dynamicContentToMergeTags as D } from "./genericUtil.js";
3
+ const f = "guidoDataMask", h = "EndDataMask", v = /guidoDataMask(\d+)EndDataMask/g, M = /^\d+_\d+_.+$/, d = (e) => e.trim().toLowerCase(), E = (e, n) => {
4
+ const t = [];
5
+ return e.replace(g, (o) => (t.push(o), `${f}${t.length - 1}${h}`)).replace(A, (o) => {
6
+ const i = o.slice(2, -2), c = i.indexOf("|"), l = c === -1 ? i : i.slice(0, c);
7
+ return n({ tag: o, inner: i, pipeIndex: c, namePart: l, name: l.trim() });
8
+ }).replace(v, (o, i) => t[Number(i)]);
9
+ }, _ = (e, n) => e.pipeIndex !== -1 ? `{{${e.namePart.replace(e.name, () => n)}${e.inner.slice(e.pipeIndex)}}}` : D([{ text: e.name, value: n }])[0].value, w = (e) => {
10
+ const n = /* @__PURE__ */ new Map();
11
+ return e.forEach((t) => {
12
+ new Set([t.text, t.tagText].map(d)).forEach((s) => {
13
+ if (!s)
14
+ return;
15
+ let a = n.get(s);
16
+ a || (a = [], n.set(s, a)), a.some((o) => o.value === t.value) || a.push(t);
9
17
  });
10
- }), r;
11
- }, w = (o, r, i) => {
12
- const s = /* @__PURE__ */ new Set(), a = new Set([...r.values()].map((e) => e.value)), u = [];
13
- return { html: o.replace(A, (e) => (u.push(e), `${p}${u.length - 1}${M}`)).replace(m, (e) => {
14
- const n = e.slice(2, -2), c = n.indexOf("|"), l = c === -1 ? n : n.slice(0, c), t = l.trim();
15
- if (t === "" || D.includes(t) || t.includes(".") || h.test(t) || a.has(t))
16
- return e;
17
- const d = r.get(E(t));
18
- if (d) {
19
- if (c !== -1) {
20
- const _ = n.slice(c);
21
- return `{{${l.replace(t, () => d.value)}${_}}}`;
22
- }
23
- return T([d], i)[0].value;
18
+ }), n;
19
+ }, x = (e, n, t = []) => {
20
+ const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set([
21
+ ...[...n.values()].flat().map((c) => c.value),
22
+ ...t
23
+ ]);
24
+ return { html: E(e, (c) => {
25
+ const { tag: l, name: r } = c;
26
+ if (r === "" || T.includes(r) || r.includes(".") || M.test(r) || o.has(r))
27
+ return l;
28
+ const m = d(r), u = n.get(m) ?? [];
29
+ if (u.length === 1)
30
+ return _(c, u[0].value);
31
+ if (u.length > 1) {
32
+ const p = a.get(m) ?? { label: r, spellings: [], candidates: u };
33
+ return p.spellings.includes(r) || p.spellings.push(r), a.set(m, p), l;
24
34
  }
25
- return s.add(t), e;
26
- }).replace(f, (e, n) => u[Number(n)]), unresolved: [...s] };
27
- };
35
+ return s.add(r), l;
36
+ }), unresolved: [...s], ambiguous: [...a.values()] };
37
+ }, I = (e, n) => E(e, (t) => {
38
+ const s = n.get(t.name);
39
+ return s ? _(t, s) : t.tag;
40
+ });
28
41
  export {
29
- I as buildDynamicContentLookup,
30
- w as convertModuleDynamicContent
42
+ I as applyDynamicContentChoices,
43
+ w as buildDynamicContentLookup,
44
+ x as convertModuleDynamicContent
31
45
  };
@@ -0,0 +1,6 @@
1
+ import { ModuleDynamicContentAttribute as n } from "../enums/dynamic-content.js";
2
+ const t = `\\s+${n.Pending}="[^"]*"`, o = (e) => e.replace(new RegExp(t, "g"), "");
3
+ export {
4
+ t as PENDING_MARKER_PATTERN,
5
+ o as stripPendingMarker
6
+ };
@@ -1,78 +1,78 @@
1
- import { formatToLiquidFilter as b, quoteArgument as y, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
2
- const g = (t) => {
1
+ import { formatToLiquidFilter as y, liquidFilterToFormat as g, quoteArgument as m } from "./liquidDynamicContent.js";
2
+ const v = (t) => {
3
3
  if (!t.includes("="))
4
4
  return null;
5
5
  const [r, e] = t.split("=");
6
6
  return { key: r.trim(), value: e.trim() };
7
- }, c = "default:", f = (t) => {
8
- if (!t.startsWith(c))
7
+ }, u = "default:", i = (t) => {
8
+ if (!t.startsWith(u))
9
9
  return t;
10
- const r = t.slice(c.length).trim(), e = (l) => r.length >= 2 && r.startsWith(l) && r.endsWith(l);
10
+ const r = t.slice(u.length).trim(), e = (n) => r.length >= 2 && r.startsWith(n) && r.endsWith(n);
11
11
  return e('"') || e("'") ? r.slice(1, -1) : r;
12
- }, k = (t) => {
13
- const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [l] = e, s = {
12
+ }, $ = (t) => {
13
+ const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [n] = e, s = {
14
14
  text: t.label,
15
- value: l || ""
15
+ value: n || ""
16
16
  };
17
17
  if (e.length >= 2) {
18
- const [, a, n] = e;
19
- if (a.startsWith(c))
20
- s.fallback = f(a);
18
+ const [, a, o] = e;
19
+ if (a.startsWith(u))
20
+ s.fallback = i(a);
21
21
  else {
22
- const o = h(a) ?? g(a);
23
- o ? s.format = o : n || (s.fallback = a), n && (s.fallback = f(n));
22
+ const l = g(a) ?? v(a);
23
+ l ? s.format = l : o || (s.fallback = a), o && (s.fallback = i(o));
24
24
  }
25
25
  }
26
26
  return s;
27
+ }, h = (t) => {
28
+ const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : m(t);
29
+ return e === null ? null : `${u} ${e}`;
27
30
  }, p = (t) => {
28
- const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
29
- return e === null ? null : `${c} ${e}`;
30
- }, v = (t) => {
31
- const r = t.format ? b(t.format) : null, e = t.fallback ? p(t.fallback) : null, l = [t.value, r, e].filter(Boolean);
31
+ const r = t.format ? y(t.format) : null, e = t.fallback ? h(t.fallback) : null, n = [t.value, r, e].filter(Boolean);
32
32
  return {
33
33
  label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
34
- value: `{{ ${l.join(" | ")} }}`
34
+ value: `{{ ${n.join(" | ")} }}`
35
35
  };
36
- }, i = (t, r = !1) => t.map((e) => r ? v(e) : e.format ? {
36
+ }, b = (t, r = !1) => t.map((e) => r ? p(e) : e.format ? {
37
37
  label: `${e.text} | ${e.format.key}=${e.format.value}`,
38
38
  value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
39
39
  } : {
40
40
  label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
41
41
  value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
42
- }), $ = (t) => {
43
- const r = [], e = /* @__PURE__ */ new Set(), l = (a) => {
44
- Array.isArray(a) && a.forEach((n) => {
45
- const o = [...n.children ?? [], ...n.select_items ?? []];
46
- if (o.length > 0) {
47
- l(o);
42
+ }), k = (t) => {
43
+ const r = [], e = /* @__PURE__ */ new Set(), n = (a, o) => {
44
+ Array.isArray(a) && a.forEach((l) => {
45
+ const f = [...l.children ?? [], ...l.select_items ?? []], c = l.text || l.tag_text;
46
+ if (f.length > 0) {
47
+ n(f, c ? [...o, c] : o);
48
48
  return;
49
49
  }
50
- const u = n.text || n.tag_text;
51
- u && n.value && !e.has(n.value) && (e.add(n.value), r.push({ text: u, value: n.value }));
50
+ c && l.value && !e.has(l.value) && (e.add(l.value), r.push({ value: l.value, text: c, tagText: l.tag_text || c, path: o }));
52
51
  });
53
52
  }, [s] = Object.values(t ?? {});
54
- return l(s), r;
55
- }, d = (t, r, e = !1) => {
56
- const l = new Set(t.map((a) => a.value)), s = r.filter((a) => l.has(a.value) ? !1 : (l.add(a.value), !0));
53
+ return n(s, []), r;
54
+ }, x = (t) => k(t).map(({ text: r, value: e }) => ({ text: r, value: e })), T = (t, r, e = !1) => {
55
+ const n = new Set(t.map((a) => a.value)), s = r.filter((a) => n.has(a.value) ? !1 : (n.add(a.value), !0));
57
56
  return [
58
- ...i(t, e),
59
- ...i(s, e)
57
+ ...b(t, e),
58
+ ...b(s, e)
60
59
  ];
61
60
  }, F = () => {
62
61
  var t;
63
62
  return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
64
- }, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
63
+ }, P = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", j = (t) => {
65
64
  if (t === null || typeof t != "object" || Array.isArray(t))
66
65
  return !1;
67
66
  const r = Object.getPrototypeOf(t);
68
67
  return r === Object.prototype || r === null;
69
68
  };
70
69
  export {
71
- T as asText,
72
- d as buildMergeTagEntries,
73
- i as dynamicContentToMergeTags,
74
- $ as flattenDynamicContentList,
70
+ P as asText,
71
+ T as buildMergeTagEntries,
72
+ b as dynamicContentToMergeTags,
73
+ k as flattenDynamicContentCandidates,
74
+ x as flattenDynamicContentList,
75
75
  F as getCsrfToken,
76
- x as isPlainObject,
77
- k as mergeTagToDynamicContent
76
+ j as isPlainObject,
77
+ $ as mergeTagToDynamicContent
78
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.27.1",
3
+ "version": "3.28.0-beta.93b3145",
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",