@useinsider/guido 3.24.0-beta.89982ef → 3.24.0-beta.8e9f4e2
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/README.md +0 -1
- package/dist/@types/config/schemas.js +37 -39
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +92 -98
- package/dist/composables/useActionsApi.js +2 -2
- package/dist/composables/useBlocksConfig.js +20 -31
- package/dist/composables/useEditorTrackingIds.js +49 -0
- package/dist/composables/useTranslations.js +1 -2
- package/dist/config/compiler/utils/itemsCompilerUtils.js +42 -43
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -67
- package/dist/config/migrator/recommendation/inferLegacyConfig.js +133 -0
- package/dist/config/migrator/recommendationMigrator.js +69 -63
- package/dist/enums/academy.js +0 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +10 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +28 -24
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +23 -22
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
- package/dist/node_modules/valibot/dist/index.js +261 -297
- package/dist/package.json.js +4 -4
- package/dist/services/templateLibraryApi.js +39 -36
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useEditorTrackingIds.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/inferLegacyConfig.d.ts +6 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +1 -1
- package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -5
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/stores/config.d.ts +0 -167
- package/dist/src/utils/linkTrackingIds.d.ts +24 -22
- package/dist/static/styles/variables.css.js +0 -1
- package/dist/stores/config.js +6 -13
- package/dist/utils/linkTrackingIds.js +72 -72
- package/dist/utils/pairProductVariables.js +29 -30
- package/dist/utils/templatePreparation.js +59 -72
- package/package.json +1 -1
- package/dist/@types/display-condition.js +0 -25
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -17
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -41
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -81
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +0 -45
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -36
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -63
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
- package/dist/composables/useDisplayConditions.js +0 -117
- package/dist/enums/display-condition.js +0 -12
- package/dist/extensions/DisplayConditions/bridge.js +0 -25
- package/dist/extensions/DisplayConditions/constants.js +0 -26
- package/dist/extensions/DisplayConditions/control.js +0 -215
- package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -226
- package/dist/extensions/DisplayConditions/extension.js +0 -28
- package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
- package/dist/extensions/DisplayConditions/library.js +0 -30
- package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
- package/dist/extensions/LinkTracking/extension.js +0 -17
- package/dist/extensions/LinkTracking/writer.js +0 -41
- package/dist/services/displayConditionApi.js +0 -39
- package/dist/src/@types/display-condition.d.ts +0 -61
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +0 -18
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
- package/dist/src/composables/useDisplayConditions.d.ts +0 -18
- package/dist/src/enums/display-condition.d.ts +0 -15
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -7
- package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -23
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -25
- package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
- package/dist/src/extensions/LinkTracking/extension.d.ts +0 -2
- package/dist/src/extensions/LinkTracking/writer.d.ts +0 -13
- package/dist/src/mock/api/display-conditions.d.ts +0 -2
- package/dist/src/services/displayConditionApi.d.ts +0 -8
- package/dist/src/stores/display-condition.d.ts +0 -86
- package/dist/src/utils/displayCondition.d.ts +0 -11
- package/dist/src/utils/protectTableText.d.ts +0 -2
- package/dist/stores/display-condition.js +0 -29
- package/dist/utils/displayCondition.js +0 -29
- package/dist/utils/protectTableText.js +0 -22
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
export declare const DisplayConditionSyntaxSchema: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
3
|
-
export declare const DisplayConditionMethodSchema: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
4
|
-
export declare const SavedDisplayConditionSchema: v.ObjectSchema<{
|
|
5
|
-
readonly id: v.NumberSchema<undefined>;
|
|
6
|
-
readonly name: v.StringSchema<undefined>;
|
|
7
|
-
readonly description: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
8
|
-
readonly syntax: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
9
|
-
readonly method: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
10
|
-
readonly codeBefore: v.StringSchema<undefined>;
|
|
11
|
-
readonly codeAfter: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
12
|
-
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
-
}, undefined>;
|
|
14
|
-
export declare const DisplayConditionListResponseSchema: v.ObjectSchema<{
|
|
15
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
16
|
-
readonly id: v.NumberSchema<undefined>;
|
|
17
|
-
readonly name: v.StringSchema<undefined>;
|
|
18
|
-
readonly description: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
19
|
-
readonly syntax: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
20
|
-
readonly method: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
21
|
-
readonly codeBefore: v.StringSchema<undefined>;
|
|
22
|
-
readonly codeAfter: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
23
|
-
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
-
}, undefined>, undefined>;
|
|
25
|
-
readonly meta: v.ObjectSchema<{
|
|
26
|
-
readonly totalCount: v.NumberSchema<undefined>;
|
|
27
|
-
readonly perPage: v.NumberSchema<undefined>;
|
|
28
|
-
readonly currentPage: v.NumberSchema<undefined>;
|
|
29
|
-
readonly lastPage: v.NumberSchema<undefined>;
|
|
30
|
-
}, undefined>;
|
|
31
|
-
}, undefined>;
|
|
32
|
-
export type DisplayConditionSyntax = v.InferOutput<typeof DisplayConditionSyntaxSchema>;
|
|
33
|
-
export type DisplayConditionMethod = v.InferOutput<typeof DisplayConditionMethodSchema>;
|
|
34
|
-
export type SavedDisplayCondition = v.InferOutput<typeof SavedDisplayConditionSchema>;
|
|
35
|
-
export type DisplayConditionListResponse = v.InferOutput<typeof DisplayConditionListResponseSchema>;
|
|
36
|
-
export interface DisplayConditionDraft {
|
|
37
|
-
name: string;
|
|
38
|
-
description: string;
|
|
39
|
-
codeBefore: string;
|
|
40
|
-
codeAfter: string;
|
|
41
|
-
}
|
|
42
|
-
/** Mirrors Stripo's `DisplayCondition`; kept local so Vue code does not import the Stripo package. */
|
|
43
|
-
export interface AppliedDisplayCondition {
|
|
44
|
-
id: number;
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
beforeScript: string;
|
|
48
|
-
afterScript: string;
|
|
49
|
-
extraData?: string;
|
|
50
|
-
type?: string;
|
|
51
|
-
}
|
|
52
|
-
export type DisplayConditionOpenMode = 'select' | 'create' | 'edit';
|
|
53
|
-
export type DisplayConditionListState = 'error' | 'empty' | 'no-result';
|
|
54
|
-
export interface DisplayConditionOpenDetail {
|
|
55
|
-
mode: DisplayConditionOpenMode;
|
|
56
|
-
current: AppliedDisplayCondition | null;
|
|
57
|
-
}
|
|
58
|
-
export interface DisplayConditionApplyDetail {
|
|
59
|
-
condition: AppliedDisplayCondition | null;
|
|
60
|
-
applied?: boolean;
|
|
61
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
error?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
10
|
-
placeholder: string;
|
|
11
|
-
error: string;
|
|
12
|
-
disabled: boolean;
|
|
13
|
-
}>, {
|
|
14
|
-
read: () => Promise<string>;
|
|
15
|
-
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
16
|
-
input: (value: string) => void;
|
|
17
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
18
|
-
placeholder: string;
|
|
19
|
-
error: string;
|
|
20
|
-
disabled: boolean;
|
|
21
|
-
}>>>, {
|
|
22
|
-
error: string;
|
|
23
|
-
placeholder: string;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
}>;
|
|
26
|
-
export default _default;
|
|
27
|
-
type __VLS_WithDefaults<P, D> = {
|
|
28
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
29
|
-
default: D[K];
|
|
30
|
-
}> : P[K];
|
|
31
|
-
};
|
|
32
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
-
type __VLS_TypePropsToOption<T> = {
|
|
34
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
-
} : {
|
|
37
|
-
type: import('vue').PropType<T[K]>;
|
|
38
|
-
required: true;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
type __VLS_PrettifyLocal<T> = {
|
|
42
|
-
[K in keyof T]: T[K];
|
|
43
|
-
} & {};
|
package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DisplayConditionListState } from '@@/Types/display-condition';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
state: DisplayConditionListState;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
6
|
-
retry: () => void;
|
|
7
|
-
create: () => void;
|
|
8
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
9
|
-
export default _default;
|
|
10
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
|
-
type __VLS_TypePropsToOption<T> = {
|
|
12
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
13
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
14
|
-
} : {
|
|
15
|
-
type: import('vue').PropType<T[K]>;
|
|
16
|
-
required: true;
|
|
17
|
-
};
|
|
18
|
-
};
|
package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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;
|
|
@@ -1,2 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DisplayConditionDraft, DisplayConditionOpenDetail, SavedDisplayCondition } from '@@/Types/display-condition';
|
|
2
|
-
export type DraftField = keyof DisplayConditionDraft;
|
|
3
|
-
export type DraftErrors = Partial<Record<DraftField, string>>;
|
|
4
|
-
export type CreateIntent = 'inline' | 'save';
|
|
5
|
-
export declare const DISPLAY_CONDITIONS_TRANS_KEY = "email-editor.display-conditions";
|
|
6
|
-
export declare const useDisplayConditions: () => {
|
|
7
|
-
syntax: import("vue").ComputedRef<"liquid" | "pongo">;
|
|
8
|
-
handleOpen: (detail: DisplayConditionOpenDetail) => void;
|
|
9
|
-
cancel: () => void;
|
|
10
|
-
loadList: () => Promise<void>;
|
|
11
|
-
validate: (draft: DisplayConditionDraft) => DraftErrors;
|
|
12
|
-
notifyInvalid: () => void;
|
|
13
|
-
describeWithAcademyLink: (descriptionKey: "create-description" | "select-description") => string;
|
|
14
|
-
createInline: (draft: DisplayConditionDraft) => void;
|
|
15
|
-
createAndSave: (draft: DisplayConditionDraft) => Promise<DraftErrors | null>;
|
|
16
|
-
select: (row: SavedDisplayCondition) => void;
|
|
17
|
-
deleteSaved: (row: SavedDisplayCondition) => Promise<void>;
|
|
18
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare enum DisplayConditionEvent {
|
|
2
|
-
OPEN = "display-condition:open",
|
|
3
|
-
APPLY = "display-condition:apply",
|
|
4
|
-
CANCEL = "display-condition:cancel"
|
|
5
|
-
}
|
|
6
|
-
export declare enum DisplayConditionSourceType {
|
|
7
|
-
INLINE = "inline",
|
|
8
|
-
SAVED = "saved"
|
|
9
|
-
}
|
|
10
|
-
export declare const DISPLAY_CONDITION_LIMITS: {
|
|
11
|
-
readonly NAME_MIN: 2;
|
|
12
|
-
readonly NAME_MAX: 40;
|
|
13
|
-
readonly DESCRIPTION_MAX: 200;
|
|
14
|
-
readonly CODE_MAX: 65535;
|
|
15
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AppliedDisplayCondition, DisplayConditionOpenDetail } from '@@/Types/display-condition';
|
|
2
|
-
export interface ConditionRequestHandlers {
|
|
3
|
-
onApply: (condition: AppliedDisplayCondition | null) => boolean;
|
|
4
|
-
onCancel?: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const disposeDisplayConditionRequest: () => void;
|
|
7
|
-
export declare const requestDisplayCondition: (detail: DisplayConditionOpenDetail, handlers: ConditionRequestHandlers) => () => void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BlockType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare const CONDITIONS_TAB_ID = "conditions";
|
|
3
|
-
export declare const CONDITIONS_CONTROL_ID = "guido-display-conditions-control";
|
|
4
|
-
export declare const MAX_COLLAPSED_LINES = 10;
|
|
5
|
-
export declare const CONDITION_BLOCK_TYPES: readonly [BlockType.STRIPE, BlockType.STRUCTURE, BlockType.CONTAINER];
|
|
6
|
-
export declare const CONDITION_ICONS: {
|
|
7
|
-
readonly PLUS: "guido-display-condition-plus";
|
|
8
|
-
readonly EDIT: "guido-display-condition-edit";
|
|
9
|
-
readonly TRASH: "guido-display-condition-trash";
|
|
10
|
-
readonly CHEVRON: "guido-display-condition-chevron";
|
|
11
|
-
};
|
|
12
|
-
export declare const CONDITION_BUTTONS: {
|
|
13
|
-
readonly ADD: "guidoDisplayConditionAdd";
|
|
14
|
-
readonly CREATE: "guidoDisplayConditionCreate";
|
|
15
|
-
readonly SELECT: "guidoDisplayConditionSelect";
|
|
16
|
-
readonly SHOW_MORE: "guidoDisplayConditionShowMore";
|
|
17
|
-
readonly SHOW_LESS: "guidoDisplayConditionShowLess";
|
|
18
|
-
readonly EDIT: "guidoDisplayConditionEdit";
|
|
19
|
-
readonly REMOVE: "guidoDisplayConditionRemove";
|
|
20
|
-
};
|
|
21
|
-
export declare const BUILT_IN_CONDITION_CONTROLS: string[];
|
|
22
|
-
export declare const EMPTY_DESCRIPTION: string;
|
|
23
|
-
export declare const APPLIED_DESCRIPTION: string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '@@/Extensions/Blocks/common-control';
|
|
3
|
-
export declare class DisplayConditionsControl extends CommonControl {
|
|
4
|
-
private expanded;
|
|
5
|
-
private listeners;
|
|
6
|
-
private resizeObserver;
|
|
7
|
-
private detachOutsideClick;
|
|
8
|
-
getId(): string;
|
|
9
|
-
getTemplate(): string;
|
|
10
|
-
onRender(): void;
|
|
11
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
12
|
-
onDestroy(): void;
|
|
13
|
-
private setExpanded;
|
|
14
|
-
private getCondition;
|
|
15
|
-
private toggleMenu;
|
|
16
|
-
private listenOutsideClick;
|
|
17
|
-
private openDrawer;
|
|
18
|
-
private removeCondition;
|
|
19
|
-
private applyCondition;
|
|
20
|
-
private wire;
|
|
21
|
-
private teardown;
|
|
22
|
-
private observeCodeSize;
|
|
23
|
-
private paint;
|
|
24
|
-
private collapsedHeight;
|
|
25
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DisplayCondition, ExternalDisplayConditionSelectedCB } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { ExternalDisplayConditionsLibrary } from '@stripoinc/ui-editor-extensions';
|
|
3
|
-
export declare class DisplayConditionsLibrary extends ExternalDisplayConditionsLibrary {
|
|
4
|
-
getCategoryName(): string;
|
|
5
|
-
openExternalDisplayConditionsDialog(currentCondition: DisplayCondition, successCallback: ExternalDisplayConditionSelectedCB, cancelCallback: () => void): void;
|
|
6
|
-
getIsContextActionEnabled(): boolean;
|
|
7
|
-
getContextActionIndex(): number;
|
|
8
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { SettingsPanelTab as SettingsPanelTabType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { SettingsPanelRegistry } from '@stripoinc/ui-editor-extensions';
|
|
3
|
-
export declare class DisplayConditionsSettingsPanel extends SettingsPanelRegistry {
|
|
4
|
-
registerBlockControls(blockControlsMap: Record<string, SettingsPanelTabType[]>): void;
|
|
5
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DocumentTrackingIdPlan } from '@@/Utils/linkTrackingIds';
|
|
2
|
-
import type { CssNodeModifier, HtmlNodeModifier, ImmutableHtmlNode, TemplateModifier } from '@stripoinc/ui-editor-extensions';
|
|
3
|
-
export interface TrackingIdWriterApi {
|
|
4
|
-
getDocumentModifier: () => TemplateModifier<HtmlNodeModifier, CssNodeModifier>;
|
|
5
|
-
getDocumentRootHtmlNode: () => ImmutableHtmlNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const registerTrackingIdWriter: (readApi: () => TrackingIdWriterApi | undefined) => void;
|
|
8
|
-
export declare const disposeTrackingIdWriter: () => void;
|
|
9
|
-
/**
|
|
10
|
-
* One hidden modification keeps the selection and the panel alive, unlike a document replacement.
|
|
11
|
-
* Returns false when the live document does not match the plan; the caller then falls back.
|
|
12
|
-
*/
|
|
13
|
-
export declare const writeTrackingIdsInPlace: ({ anchorIds, inComment, plan }: DocumentTrackingIdPlan) => boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DisplayConditionDraft, DisplayConditionSyntax, SavedDisplayCondition } from '@@/Types/display-condition';
|
|
2
|
-
export declare const DISPLAY_CONDITIONS_URL = "/email-proxy/v1/display-conditions";
|
|
3
|
-
export declare const DISPLAY_CONDITIONS_PAGE_LIMIT = 100;
|
|
4
|
-
export declare const useDisplayConditionApi: () => {
|
|
5
|
-
list: (syntax: DisplayConditionSyntax) => Promise<SavedDisplayCondition[]>;
|
|
6
|
-
create: (draft: DisplayConditionDraft, syntax: DisplayConditionSyntax) => Promise<SavedDisplayCondition>;
|
|
7
|
-
remove: (id: number) => Promise<void>;
|
|
8
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
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
|
-
type?: string | undefined;
|
|
23
|
-
} | null;
|
|
24
|
-
list: {
|
|
25
|
-
id: number;
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
syntax: "liquid" | "pongo";
|
|
29
|
-
method: "codeOnly" | "logicBuilder";
|
|
30
|
-
codeBefore: string;
|
|
31
|
-
codeAfter: string;
|
|
32
|
-
createdAt?: string | undefined;
|
|
33
|
-
}[];
|
|
34
|
-
listStatus: DisplayConditionListStatus;
|
|
35
|
-
listRequest: number;
|
|
36
|
-
pendingDelete: {
|
|
37
|
-
id: number;
|
|
38
|
-
name: string;
|
|
39
|
-
description: string;
|
|
40
|
-
syntax: "liquid" | "pongo";
|
|
41
|
-
method: "codeOnly" | "logicBuilder";
|
|
42
|
-
codeBefore: string;
|
|
43
|
-
codeAfter: string;
|
|
44
|
-
createdAt?: string | undefined;
|
|
45
|
-
} | null;
|
|
46
|
-
} & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
|
|
47
|
-
isSelectOpen: (state: {
|
|
48
|
-
view: DisplayConditionView;
|
|
49
|
-
editing: {
|
|
50
|
-
id: number;
|
|
51
|
-
name: string;
|
|
52
|
-
description: string;
|
|
53
|
-
beforeScript: string;
|
|
54
|
-
afterScript: string;
|
|
55
|
-
extraData?: string | undefined;
|
|
56
|
-
type?: string | undefined;
|
|
57
|
-
} | null;
|
|
58
|
-
list: {
|
|
59
|
-
id: number;
|
|
60
|
-
name: string;
|
|
61
|
-
description: string;
|
|
62
|
-
syntax: "liquid" | "pongo";
|
|
63
|
-
method: "codeOnly" | "logicBuilder";
|
|
64
|
-
codeBefore: string;
|
|
65
|
-
codeAfter: string;
|
|
66
|
-
createdAt?: string | undefined;
|
|
67
|
-
}[];
|
|
68
|
-
listStatus: DisplayConditionListStatus;
|
|
69
|
-
listRequest: number;
|
|
70
|
-
pendingDelete: {
|
|
71
|
-
id: number;
|
|
72
|
-
name: string;
|
|
73
|
-
description: string;
|
|
74
|
-
syntax: "liquid" | "pongo";
|
|
75
|
-
method: "codeOnly" | "logicBuilder";
|
|
76
|
-
codeBefore: string;
|
|
77
|
-
codeAfter: string;
|
|
78
|
-
createdAt?: string | undefined;
|
|
79
|
-
} | null;
|
|
80
|
-
} & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
|
|
81
|
-
}, {
|
|
82
|
-
openCreate(editing?: AppliedDisplayCondition | null): void;
|
|
83
|
-
openSelect(): void;
|
|
84
|
-
close(): void;
|
|
85
|
-
}>;
|
|
86
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { DisplayConditionSourceType as n } from "../enums/display-condition.js";
|
|
2
|
-
const p = "PREDEFINED", I = (e) => {
|
|
3
|
-
if (!e)
|
|
4
|
-
return null;
|
|
5
|
-
if (e.type === p)
|
|
6
|
-
return n.SAVED;
|
|
7
|
-
try {
|
|
8
|
-
const t = JSON.parse(e.extraData || "{}");
|
|
9
|
-
return (t == null ? void 0 : t.source) === n.SAVED ? n.SAVED : n.INLINE;
|
|
10
|
-
} catch {
|
|
11
|
-
return n.INLINE;
|
|
12
|
-
}
|
|
13
|
-
}, m = (e) => !e || !(e.name || e.beforeScript || e.afterScript) ? null : { ...e, description: e.description ?? "" };
|
|
14
|
-
let l = 0;
|
|
15
|
-
const _ = () => (l = Math.max(Date.now(), l + 1), l), E = /{%-?\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, f = /* @__PURE__ */ new Set(["if", "unless", "for", "case", "capture", "tablerow", "comment"]), T = /* @__PURE__ */ new Set(["else", "elsif", "elif", "when"]), h = (e) => /{%|{{/.test(e.replace(S, "")), C = (e, t, d = "liquid") => {
|
|
16
|
-
const r = /* @__PURE__ */ new Set(), o = [];
|
|
17
|
-
return [["codeBefore", e], ["codeAfter", t]].forEach(([c, a]) => {
|
|
18
|
-
const i = (d === "pongo" ? a.replace(A, "") : a).replace(u, "");
|
|
19
|
-
h(i) && r.add(c), Array.from(i.matchAll(E), (s) => s[1]).forEach((s) => {
|
|
20
|
-
f.has(s) ? o.push(s) : s.startsWith("end") && f.has(s.slice(3)) ? o.pop() !== s.slice(3) && r.add(c) : T.has(s) && !o.length && r.add(c);
|
|
21
|
-
});
|
|
22
|
-
}), o.length && r.add("codeAfter"), [...r];
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
C as findInvalidCodeFields,
|
|
26
|
-
_ as nextConditionId,
|
|
27
|
-
I as parseSource,
|
|
28
|
-
m as toAppliedCondition
|
|
29
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const n = "guido-table-text:", i = new RegExp(`<!--${n}([A-Za-z0-9+/=]*)-->`, "g"), T = /<!--[\s\S]*?-->|\{%[\s\S]*?%\}|<[a-zA-Z/!?](?:[^>"']|"[^"]*"|'[^']*')*>|[^<{]+|[<{]/g, o = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr", "colgroup"]), r = /* @__PURE__ */ new Set(["col"]), f = /* @__PURE__ */ new Set([...o, ...r, "td", "th", "caption"]), p = (s) => btoa(unescape(encodeURIComponent(s))), u = (s) => decodeURIComponent(escape(atob(s))), d = (s) => {
|
|
2
|
-
const e = /^<(\/?)([a-zA-Z][\w-]*)/.exec(s);
|
|
3
|
-
return { name: e ? e[2].toLowerCase() : "", closing: e ? e[1] === "/" : !1 };
|
|
4
|
-
};
|
|
5
|
-
function E(s) {
|
|
6
|
-
const e = [];
|
|
7
|
-
let a = !1;
|
|
8
|
-
return s.replace(T, (t) => {
|
|
9
|
-
if (t.startsWith("<!--") || t.startsWith("{%"))
|
|
10
|
-
return t;
|
|
11
|
-
if (t.length > 1 && t.startsWith("<")) {
|
|
12
|
-
const { name: c, closing: l } = d(t);
|
|
13
|
-
return a = f.has(c), !a || r.has(c) || (l ? e.includes(c) && e.splice(e.lastIndexOf(c)) : e.push(c)), t;
|
|
14
|
-
}
|
|
15
|
-
return a && o.has(e[e.length - 1] ?? "") && t.trim() ? `<!--${n}${p(t)}-->` : t;
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
const g = (s) => s.replace(i, (e, a) => u(a));
|
|
19
|
-
export {
|
|
20
|
-
E as protectTableText,
|
|
21
|
-
g as restoreTableText
|
|
22
|
-
};
|