@plitzi/sdk-authoring 0.39.11 → 0.39.12
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/CHANGELOG.md +7 -0
- package/dist/index-src.js +1733 -1312
- package/dist/index.d.ts +258 -7
- package/dist/index.js +2 -2
- package/dist/node.d.ts +82 -1
- package/dist/node.js +2 -2
- package/dist/plugin.d.ts +5 -0
- package/package.json +7 -7
- package/skills/plitzi-authoring/reference/authoring-errors.md +14 -0
- package/skills/plitzi-authoring/reference/feature-flags.md +61 -0
- package/skills/plitzi-authoring/reference/index.md +1 -1
- package/skills/plitzi-authoring/reference/templates.md +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1113,6 +1113,71 @@ export declare const AUTHORING_CODES: {
|
|
|
1113
1113
|
readonly means: "a `when` asking a step of its flow for a key it never publishes — `whenSucceeded` / `whenFailed` on anything but `runServerAction`";
|
|
1114
1114
|
readonly fix: "a key the step publishes (`explain <step>`): after `authLogin`, `when({ field: 'signedIn.ok', operator: '=', value: true }, …)`";
|
|
1115
1115
|
};
|
|
1116
|
+
readonly 'time-window-bound': {
|
|
1117
|
+
readonly kind: "refused";
|
|
1118
|
+
readonly means: "a `timeWindow`'s `startsAt` or `endsAt` that is not an instant with its offset — never read, so no bound";
|
|
1119
|
+
readonly fix: "`startsAt: '2026-12-01T09:00:00Z'` (or `+01:00`); empty for no bound";
|
|
1120
|
+
};
|
|
1121
|
+
readonly 'time-window-empty': {
|
|
1122
|
+
readonly kind: "warned";
|
|
1123
|
+
readonly means: "a `timeWindow` that ends before it starts — it never shows what it holds";
|
|
1124
|
+
readonly fix: "`endsAt` after `startsAt`";
|
|
1125
|
+
};
|
|
1126
|
+
readonly 'variants-choose-by': {
|
|
1127
|
+
readonly kind: "refused";
|
|
1128
|
+
readonly means: "a `variants`' `chooseBy` that is neither `'chance'` nor `'rules'` — it chooses by chance";
|
|
1129
|
+
readonly fix: "`chooseBy: 'chance'` or `chooseBy: 'rules'`";
|
|
1130
|
+
};
|
|
1131
|
+
readonly 'variants-items': {
|
|
1132
|
+
readonly kind: "refused";
|
|
1133
|
+
readonly means: "a `variants` holding something beside its `variantItem`s, or too few — two to five by chance, one by rules";
|
|
1134
|
+
readonly fix: "`variants({ children: [variantItem([…]), variantItem([…])] })`";
|
|
1135
|
+
};
|
|
1136
|
+
readonly 'variants-builder-variant': {
|
|
1137
|
+
readonly kind: "warned";
|
|
1138
|
+
readonly means: "a `variants`' `builderVariant` that is not the place of one of its variants — the builder shows the first";
|
|
1139
|
+
readonly fix: "the place of a variant it has, from 0";
|
|
1140
|
+
};
|
|
1141
|
+
readonly 'variants-rule': {
|
|
1142
|
+
readonly kind: "refused";
|
|
1143
|
+
readonly means: "a `variantItem`'s `when` that is not a rule group";
|
|
1144
|
+
readonly fix: "`when: { combinator: 'and', rules: [{ field: 'visitor.device', operator: '=', value: 'mobile' }] }`";
|
|
1145
|
+
};
|
|
1146
|
+
readonly 'variants-unreachable': {
|
|
1147
|
+
readonly kind: "warned";
|
|
1148
|
+
readonly means: "by rules, a `variantItem` after one with no rule, which takes everybody left — it is never shown";
|
|
1149
|
+
readonly fix: "move the variant with no rule last, or give it one";
|
|
1150
|
+
};
|
|
1151
|
+
readonly 'variants-no-fallback': {
|
|
1152
|
+
readonly kind: "warned";
|
|
1153
|
+
readonly means: "by rules, a `variants` whose every variant has a rule: a visitor matching none is shown nothing";
|
|
1154
|
+
readonly fix: "end it with a `variantItem` with no `when`, for everybody else";
|
|
1155
|
+
};
|
|
1156
|
+
readonly 'experiment-name': {
|
|
1157
|
+
readonly kind: "refused";
|
|
1158
|
+
readonly means: "by chance, a `variants`' `experiment` that a template cannot read as `experiments.x`";
|
|
1159
|
+
readonly fix: "letters, digits and `_`, starting with a letter or `_` — or empty, for the element's own name";
|
|
1160
|
+
};
|
|
1161
|
+
readonly 'experiment-weight': {
|
|
1162
|
+
readonly kind: "refused";
|
|
1163
|
+
readonly means: "by chance, a `variantItem`'s `weight` that is not a whole number from 0 to 100, or variants that all weigh 0";
|
|
1164
|
+
readonly fix: "`weight: 50`; 0 shows a variant to nobody, and at least one has to show";
|
|
1165
|
+
};
|
|
1166
|
+
readonly 'experiment-weights-total': {
|
|
1167
|
+
readonly kind: "warned";
|
|
1168
|
+
readonly means: "by chance, `variant`s whose `weight`s do not add up to 100 — each is read as its part of their total";
|
|
1169
|
+
readonly fix: "percents adding up to 100: 50/25/20/5, or the proportions the warning gives";
|
|
1170
|
+
};
|
|
1171
|
+
readonly 'experiment-weights-differ': {
|
|
1172
|
+
readonly kind: "warned";
|
|
1173
|
+
readonly means: "two `variants` running the same test with different weights — they share it, so one set is ignored";
|
|
1174
|
+
readonly fix: "the same weights on both, or a test name of its own for each";
|
|
1175
|
+
};
|
|
1176
|
+
readonly 'experiment-unknown': {
|
|
1177
|
+
readonly kind: "refused";
|
|
1178
|
+
readonly means: "a template, a binding or a `when` reading an experiment no `variants` chosen by chance runs";
|
|
1179
|
+
readonly fix: "the name it suggests, or a `variants` with that `experiment`";
|
|
1180
|
+
};
|
|
1116
1181
|
readonly 'flag-gate': {
|
|
1117
1182
|
readonly kind: "refused";
|
|
1118
1183
|
readonly means: "an element's or a page's `flag` that is not a flag name";
|
|
@@ -1143,6 +1208,11 @@ export declare const AUTHORING_CODES: {
|
|
|
1143
1208
|
readonly means: "a flag rule that is not `{ when, value }`, or whose `value` is not `true` or `false`";
|
|
1144
1209
|
readonly fix: "`{ when: { … }, value: true }`";
|
|
1145
1210
|
};
|
|
1211
|
+
readonly 'flag-rollout': {
|
|
1212
|
+
readonly kind: "refused";
|
|
1213
|
+
readonly means: "a flag's `rollout` that is not `{ percent, value }` — a whole share from 0 to 100 and the answer it gives";
|
|
1214
|
+
readonly fix: "`rollout: { percent: 10, value: true }`";
|
|
1215
|
+
};
|
|
1146
1216
|
readonly 'flag-rule-empty': {
|
|
1147
1217
|
readonly kind: "warned";
|
|
1148
1218
|
readonly means: "a flag rule with no conditions — skipped, never read as \"always\"";
|
|
@@ -2833,6 +2903,11 @@ export declare const chart: {
|
|
|
2833
2903
|
}>> | undefined): ElementSpec;
|
|
2834
2904
|
};
|
|
2835
2905
|
|
|
2906
|
+
/** How a `variants` element chooses: at random by the variants' shares, or by the visitor's facts. */
|
|
2907
|
+
declare const CHOOSE_BY: readonly ["chance", "rules"];
|
|
2908
|
+
|
|
2909
|
+
declare type ChooseBy = (typeof CHOOSE_BY)[number];
|
|
2910
|
+
|
|
2836
2911
|
/**
|
|
2837
2912
|
* The classes a selector wears: one, or several.
|
|
2838
2913
|
*
|
|
@@ -2958,7 +3033,7 @@ export declare const component: (componentId: string, instance?: ComponentInstan
|
|
|
2958
3033
|
/** What an element inside a component can read besides its own tree: the globals, and what its instance hands in. */
|
|
2959
3034
|
export declare const COMPONENT_SOURCES: string[];
|
|
2960
3035
|
|
|
2961
|
-
declare type ComponentDefinition = Pick<PluginSchema, 'attributes' | 'builder' | 'definition' | 'defaultStyle' | 'initialItems' | 'contentAttributes'> & {
|
|
3036
|
+
declare type ComponentDefinition = Pick<PluginSchema, 'attributes' | 'builder' | 'definition' | 'defaultStyle' | 'initialItems' | 'contentAttributes' | 'ancestorType'> & {
|
|
2962
3037
|
assets: Asset[];
|
|
2963
3038
|
assetsSettings: Omit<Asset, 'isMain'>[];
|
|
2964
3039
|
manifest: PluginManifest;
|
|
@@ -4015,6 +4090,9 @@ export declare const elementAttributeNames: {
|
|
|
4015
4090
|
readonly tabContainerItem: readonly ["hash"];
|
|
4016
4091
|
readonly text: readonly ["content", "decorative", "title"];
|
|
4017
4092
|
readonly themeToggle: readonly ["darkLabel", "lightLabel", "showSystem", "subType", "systemLabel"];
|
|
4093
|
+
readonly timeWindow: readonly ["endsAt", "startsAt"];
|
|
4094
|
+
readonly variantItem: readonly ["weight", "when"];
|
|
4095
|
+
readonly variants: readonly ["builderVariant", "chooseBy", "experiment"];
|
|
4018
4096
|
readonly video: readonly ["autoPlay", "loop", "muted", "playsInline", "src"];
|
|
4019
4097
|
};
|
|
4020
4098
|
|
|
@@ -5446,9 +5524,9 @@ declare const elementDeclarations: {
|
|
|
5446
5524
|
}, Partial<{
|
|
5447
5525
|
title?: string | undefined;
|
|
5448
5526
|
src?: string | undefined;
|
|
5527
|
+
referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
|
|
5449
5528
|
allow?: string | undefined;
|
|
5450
5529
|
loading?: "lazy" | "eager" | undefined;
|
|
5451
|
-
referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
|
|
5452
5530
|
sandbox?: string | undefined;
|
|
5453
5531
|
}>>;
|
|
5454
5532
|
readonly FontAwesome: DeclaredElement< {
|
|
@@ -8108,6 +8186,106 @@ declare const elementDeclarations: {
|
|
|
8108
8186
|
systemLabel?: string | undefined;
|
|
8109
8187
|
showSystem?: boolean | undefined;
|
|
8110
8188
|
}>>;
|
|
8189
|
+
readonly TimeWindow: DeclaredElement< {
|
|
8190
|
+
readonly type: "timeWindow";
|
|
8191
|
+
readonly content: {
|
|
8192
|
+
readonly attributes: {
|
|
8193
|
+
readonly startsAt: "";
|
|
8194
|
+
readonly endsAt: "";
|
|
8195
|
+
};
|
|
8196
|
+
readonly definition: {
|
|
8197
|
+
readonly label: "Time Window";
|
|
8198
|
+
readonly description: string;
|
|
8199
|
+
readonly items: [];
|
|
8200
|
+
};
|
|
8201
|
+
readonly market: {
|
|
8202
|
+
readonly category: "structure";
|
|
8203
|
+
readonly icon: "fa-regular fa-calendar";
|
|
8204
|
+
};
|
|
8205
|
+
readonly defaultStyle: {
|
|
8206
|
+
readonly style: {
|
|
8207
|
+
readonly base: {
|
|
8208
|
+
readonly default: {};
|
|
8209
|
+
};
|
|
8210
|
+
};
|
|
8211
|
+
readonly subTypes: {};
|
|
8212
|
+
};
|
|
8213
|
+
};
|
|
8214
|
+
}, Partial<{
|
|
8215
|
+
startsAt?: string | undefined;
|
|
8216
|
+
endsAt?: string | undefined;
|
|
8217
|
+
}>>;
|
|
8218
|
+
readonly Variants: DeclaredElement< {
|
|
8219
|
+
readonly type: "variants";
|
|
8220
|
+
readonly attributeValues: {
|
|
8221
|
+
readonly chooseBy: readonly string[];
|
|
8222
|
+
};
|
|
8223
|
+
readonly content: {
|
|
8224
|
+
readonly attributes: {
|
|
8225
|
+
readonly chooseBy: "chance";
|
|
8226
|
+
readonly experiment: "";
|
|
8227
|
+
readonly builderVariant: 0;
|
|
8228
|
+
};
|
|
8229
|
+
readonly definition: {
|
|
8230
|
+
readonly label: "Variants";
|
|
8231
|
+
readonly description: string;
|
|
8232
|
+
readonly items: [];
|
|
8233
|
+
};
|
|
8234
|
+
readonly builder: {
|
|
8235
|
+
readonly itemsAllowed: ["variantItem"];
|
|
8236
|
+
};
|
|
8237
|
+
readonly market: {
|
|
8238
|
+
readonly category: "testing";
|
|
8239
|
+
readonly icon: "fa-solid fa-shuffle";
|
|
8240
|
+
};
|
|
8241
|
+
readonly defaultStyle: {
|
|
8242
|
+
readonly style: {
|
|
8243
|
+
readonly base: {
|
|
8244
|
+
readonly default: {};
|
|
8245
|
+
};
|
|
8246
|
+
};
|
|
8247
|
+
readonly subTypes: {};
|
|
8248
|
+
};
|
|
8249
|
+
};
|
|
8250
|
+
readonly initialItems: readonly ["variantItem", "variantItem"];
|
|
8251
|
+
}, Partial<{
|
|
8252
|
+
chooseBy?: ChooseBy | undefined;
|
|
8253
|
+
experiment?: string | undefined;
|
|
8254
|
+
builderVariant?: number | undefined;
|
|
8255
|
+
}>>;
|
|
8256
|
+
readonly VariantItem: DeclaredElement< {
|
|
8257
|
+
readonly type: "variantItem";
|
|
8258
|
+
readonly ancestorType: "variants";
|
|
8259
|
+
readonly content: {
|
|
8260
|
+
readonly attributes: {
|
|
8261
|
+
readonly weight: 50;
|
|
8262
|
+
};
|
|
8263
|
+
readonly definition: {
|
|
8264
|
+
readonly label: "Variant";
|
|
8265
|
+
readonly description: string;
|
|
8266
|
+
readonly items: [];
|
|
8267
|
+
};
|
|
8268
|
+
readonly builder: {
|
|
8269
|
+
readonly canSnippet: false;
|
|
8270
|
+
readonly itemsNotAllowed: ["variantItem"];
|
|
8271
|
+
};
|
|
8272
|
+
readonly market: {
|
|
8273
|
+
readonly category: "testing";
|
|
8274
|
+
readonly icon: "fa-solid fa-code-branch";
|
|
8275
|
+
};
|
|
8276
|
+
readonly defaultStyle: {
|
|
8277
|
+
readonly style: {
|
|
8278
|
+
readonly base: {
|
|
8279
|
+
readonly default: {};
|
|
8280
|
+
};
|
|
8281
|
+
};
|
|
8282
|
+
readonly subTypes: {};
|
|
8283
|
+
};
|
|
8284
|
+
};
|
|
8285
|
+
}, Partial<{
|
|
8286
|
+
when?: RuleGroup_2 | undefined;
|
|
8287
|
+
weight?: number | undefined;
|
|
8288
|
+
}>>;
|
|
8111
8289
|
readonly Video: DeclaredElement< {
|
|
8112
8290
|
readonly type: "video";
|
|
8113
8291
|
readonly contentAttributes: readonly ["src"];
|
|
@@ -8626,17 +8804,17 @@ export declare const embed: {
|
|
|
8626
8804
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
8627
8805
|
title?: string | undefined;
|
|
8628
8806
|
src?: string | undefined;
|
|
8807
|
+
referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
|
|
8629
8808
|
allow?: string | undefined;
|
|
8630
8809
|
loading?: "lazy" | "eager" | undefined;
|
|
8631
|
-
referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
|
|
8632
8810
|
sandbox?: string | undefined;
|
|
8633
8811
|
}>> | undefined): ElementSpec;
|
|
8634
8812
|
(props?: ElementProps<Partial<{
|
|
8635
8813
|
title?: string | undefined;
|
|
8636
8814
|
src?: string | undefined;
|
|
8815
|
+
referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
|
|
8637
8816
|
allow?: string | undefined;
|
|
8638
8817
|
loading?: "lazy" | "eager" | undefined;
|
|
8639
|
-
referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
|
|
8640
8818
|
sandbox?: string | undefined;
|
|
8641
8819
|
}>> | undefined): ElementSpec;
|
|
8642
8820
|
};
|
|
@@ -11369,6 +11547,11 @@ export declare type PluginSchema = {
|
|
|
11369
11547
|
definition: Element_2['definition'];
|
|
11370
11548
|
/** The attributes a role that edits the content and not the design may change; none, it may change none. */
|
|
11371
11549
|
contentAttributes?: string[];
|
|
11550
|
+
/**
|
|
11551
|
+
* The element this one only works somewhere inside — a carousel's track, an A/B test's variant: the builder's
|
|
11552
|
+
* catalogue lists it after that one, as a part of it.
|
|
11553
|
+
*/
|
|
11554
|
+
ancestorType?: string;
|
|
11372
11555
|
defaultStyle: {
|
|
11373
11556
|
name: string;
|
|
11374
11557
|
displayMode: DisplayMode;
|
|
@@ -11599,6 +11782,12 @@ export declare const publishOn: (target: string, type: string, data?: unknown, {
|
|
|
11599
11782
|
echo?: boolean;
|
|
11600
11783
|
}) => StepSpec;
|
|
11601
11784
|
|
|
11785
|
+
/**
|
|
11786
|
+
* A goal reached — `reachGoal('signup')` — counted in the space's analytics as a conversion of each A/B variant the
|
|
11787
|
+
* visitor is shown. Letters, digits, `-` and `_`.
|
|
11788
|
+
*/
|
|
11789
|
+
export declare const reachGoal: (goal: string) => StepSpec;
|
|
11790
|
+
|
|
11602
11791
|
/** The page's dev tools, read: the flows that ran and, when asked, the state, the sources and one element. */
|
|
11603
11792
|
export declare const readDevTools: (driver: DevToolsDriver, input: DevToolsInput) => Promise<DevToolsReport>;
|
|
11604
11793
|
|
|
@@ -12171,9 +12360,20 @@ export declare type Schema = {
|
|
|
12171
12360
|
*/
|
|
12172
12361
|
export declare type SchemaFlag = {
|
|
12173
12362
|
description?: string;
|
|
12174
|
-
/** The answer when no rule matches. */
|
|
12363
|
+
/** The answer when no rule matches — and no rollout takes the visitor in. */
|
|
12175
12364
|
value: boolean;
|
|
12176
12365
|
rules: SchemaFlagRule[];
|
|
12366
|
+
/**
|
|
12367
|
+
* A gradual rollout, read when no rule matches: `percent` of the visitors (0–100) get `value`, the rest the flag's own
|
|
12368
|
+
* `value`. Each visitor is kept in their place by a cookie, so raising the percent keeps everyone who was in.
|
|
12369
|
+
*/
|
|
12370
|
+
rollout?: SchemaFlagRollout;
|
|
12371
|
+
};
|
|
12372
|
+
|
|
12373
|
+
/** A share of the visitors a flag answers `value` for, when none of its rules matched. */
|
|
12374
|
+
declare type SchemaFlagRollout = {
|
|
12375
|
+
percent: number;
|
|
12376
|
+
value: boolean;
|
|
12177
12377
|
};
|
|
12178
12378
|
|
|
12179
12379
|
/** A value a flag takes where its `when` matches. The first rule that matches decides. */
|
|
@@ -13561,6 +13761,12 @@ export declare type SuggestionCode = {
|
|
|
13561
13761
|
[Code in AuthoringCode]: Codes[Code]['kind'] extends 'suggested' ? Code : never;
|
|
13562
13762
|
}[AuthoringCode];
|
|
13563
13763
|
|
|
13764
|
+
/**
|
|
13765
|
+
* `suggestSpace`, knowing this SDK's own elements: the variants of a Variants element side by side are versions of
|
|
13766
|
+
* one place, never offered as a list — what `authorSpace` says of them too.
|
|
13767
|
+
*/
|
|
13768
|
+
export declare const suggestSpace: (documents: Parameters<typeof suggestSpace_2>[0], options?: Parameters<typeof suggestSpace_2>[1]) => Suggestion[];
|
|
13769
|
+
|
|
13564
13770
|
/**
|
|
13565
13771
|
* A shorter way to the same page: what a space's documents could say with fewer elements or less CSS — or, for its
|
|
13566
13772
|
* animations, a lighter one, and for its headings, an outline a screen reader reads whole.
|
|
@@ -13573,10 +13779,10 @@ export declare type SuggestionCode = {
|
|
|
13573
13779
|
* Each names what to write instead, and the ones about elements say how many it saves, which is what they are ranked
|
|
13574
13780
|
* by.
|
|
13575
13781
|
*/
|
|
13576
|
-
|
|
13782
|
+
declare const suggestSpace_2: ({ schema, style }: {
|
|
13577
13783
|
schema: Schema;
|
|
13578
13784
|
style: Style;
|
|
13579
|
-
}, { stylesheets, families, pluginTypes }?: {
|
|
13785
|
+
}, { stylesheets, families, pluginTypes, ancestorTypes }?: {
|
|
13580
13786
|
/** The CSS the pages load besides the space's own — its plugins' stylesheets: a token read there is read. */
|
|
13581
13787
|
stylesheets?: readonly string[];
|
|
13582
13788
|
/** The pages each `pageFamily` wrote, by id: what they share is written once, never a copy. */
|
|
@@ -13586,6 +13792,8 @@ export declare const suggestSpace: ({ schema, style }: {
|
|
|
13586
13792
|
* declaration it has — a `custom` element naming one placed it by name.
|
|
13587
13793
|
*/
|
|
13588
13794
|
pluginTypes?: readonly string[];
|
|
13795
|
+
/** The types that only work inside another, and that type (`elementAncestorTypes`): a Variants element's variants. */
|
|
13796
|
+
ancestorTypes?: Readonly<Record<string, string>>;
|
|
13589
13797
|
}) => Suggestion[];
|
|
13590
13798
|
|
|
13591
13799
|
/** The closest known transformer action to a mistyped one (substring match either way), so a wrong action like
|
|
@@ -13741,6 +13949,18 @@ export declare const themeToggle: {
|
|
|
13741
13949
|
}>> | undefined): ElementSpec;
|
|
13742
13950
|
};
|
|
13743
13951
|
|
|
13952
|
+
/** What shows only between two instants: `timeWindow({ startsAt: '2026-12-01T09:00:00Z', endsAt: '…', children })`. */
|
|
13953
|
+
export declare const timeWindow: {
|
|
13954
|
+
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
13955
|
+
startsAt?: string | undefined;
|
|
13956
|
+
endsAt?: string | undefined;
|
|
13957
|
+
}>> | undefined): ElementSpec;
|
|
13958
|
+
(props?: ElementProps<Partial<{
|
|
13959
|
+
startsAt?: string | undefined;
|
|
13960
|
+
endsAt?: string | undefined;
|
|
13961
|
+
}>> | undefined): ElementSpec;
|
|
13962
|
+
};
|
|
13963
|
+
|
|
13744
13964
|
/** Both binding forms as one list. The map form targets attributes, which is what nearly every binding does. */
|
|
13745
13965
|
export declare const toBindingSpecs: (bind: BindingsSpec) => BindingSpec[];
|
|
13746
13966
|
|
|
@@ -14154,6 +14374,37 @@ export declare interface VariantFromOptions {
|
|
|
14154
14374
|
template?: string;
|
|
14155
14375
|
}
|
|
14156
14376
|
|
|
14377
|
+
export declare const variantItem: {
|
|
14378
|
+
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
14379
|
+
when?: RuleGroup | undefined;
|
|
14380
|
+
weight?: number | undefined;
|
|
14381
|
+
}>> | undefined): ElementSpec;
|
|
14382
|
+
(props?: ElementProps<Partial<{
|
|
14383
|
+
when?: RuleGroup | undefined;
|
|
14384
|
+
weight?: number | undefined;
|
|
14385
|
+
}>> | undefined): ElementSpec;
|
|
14386
|
+
};
|
|
14387
|
+
|
|
14388
|
+
/**
|
|
14389
|
+
* Variants: each visitor sees one of its variants. By chance (an A/B test) — `variants({ children: [variantItem({ weight: 90, children: [a]
|
|
14390
|
+
* }), variantItem({ weight: 10, children: [b] })] })`, drawn by the shares and kept when they come back, named after the
|
|
14391
|
+
* element until it says `experiment`. By rules — `variants({ chooseBy: 'rules', children: [variantItem({ when: { combinator:
|
|
14392
|
+
* 'and', rules: [{ field: 'visitor.device', operator: '=', value: 'mobile' }] }, children: [phones] }),
|
|
14393
|
+
* variantItem([everyone])] })` — the first whose rule they match; one with no `when` is for everybody else.
|
|
14394
|
+
*/
|
|
14395
|
+
export declare const variants: {
|
|
14396
|
+
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
14397
|
+
chooseBy?: ChooseBy | undefined;
|
|
14398
|
+
experiment?: string | undefined;
|
|
14399
|
+
builderVariant?: number | undefined;
|
|
14400
|
+
}>> | undefined): ElementSpec;
|
|
14401
|
+
(props?: ElementProps<Partial<{
|
|
14402
|
+
chooseBy?: ChooseBy | undefined;
|
|
14403
|
+
experiment?: string | undefined;
|
|
14404
|
+
builderVariant?: number | undefined;
|
|
14405
|
+
}>> | undefined): ElementSpec;
|
|
14406
|
+
};
|
|
14407
|
+
|
|
14157
14408
|
/** One variant of a selector: what it changes, and how it reacts on its own. A variant cannot carry variants. */
|
|
14158
14409
|
export declare interface VariantSpec {
|
|
14159
14410
|
css?: CssSpec;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as readDevTools, $a as dialogContainer, $i as onClick, $n as css, $o as withVisibility, $r as SET_STATE_TYPES, $t as journeyStartWarnings, A as withElement, Aa as reloadApi, Ai as whenFailed, An as pressFailure, Ao as video, As as t$1, At as actionSpecFromEntry, B as pageDecorations, Ba as withPluginCatalogs, Bi as carouselPause, Bn as grid, Bo as activeOn, Br as instanceSelectorFor, Bs as i$1, Bt as suggestClassOverrides, C as stepLines, Ca as onScroll, Ci as twigTemplate, Cn as HYDRATION_MS, Co as tabContainerHeader, Cs as typeCallbackDefinitions, Ct as searchScore, D as e2eStepProblems, Da as openDialog, Di as flowStepIds, Dn as hoverElement, Do as timeWindow, Ds as r$3, Dt as specToSource, E as unit, Ea as onView, Ei as authorFlows, En as fieldsOf, Eo as themeToggle, Es as n, Et as SPACE_FIELDS, F as PAGE_TEXT_LIMIT, Fa as setFieldValue, Fi as getGlobalCallback, Fn as STATE_PATH_PARAMS, Fo as defineElement, Fs as n$3, Ft as suggestTransformer, G as profilePictures, Ga as blockJsx, Gi as declaredCallback, Gn as isClassModifier, Go as groupBindings, Gr as flagSpecOf, Gs as r$4, Gt as familyOf, H as comparePictures, Ha as i, Hi as carouselPrevious, Hn as className, Ho as authorBinding, Hr as pathForSlug, Hs as s, Ht as PAGE_SPEC_FIELDS, I as compareTexts, Ia as toggleElement, Ii as announceOn, In as tokens, Io as element, Is as r$1, It as transformerCatalog, J as inspectDocument, Ja as carouselTrack, Ji as on, Jn as modifierClassName, Jo as resolveSource, Jr as taskAction, Js as a$2, Jt as withNotificationsCss, K as loadImages, Ka as button, Ki as declaredTrigger, Kn as isClassRef, Ko as hasVisibilityBinding, Kr as authoringCodesTable, Ks as s$1, Kt as pageFamily, L as pageTexts, La as updateElement, Li as cancelApi, Ln as createTw, Lo as inferredLinkMode, Lr as digest, Ls as t$2, Lt as assertSnippetValid, M as shortcutKey, Ma as scrollBy, Mi as whileRunning, Mn as settle, Mo as declaresAttribute, Ms as elementAttributeNames, Mt as withNamedIds, N as inspectRenders, Na as scrollIntoView, Ni as BUILTIN_GLOBAL_CALLBACKS, Nn as targetId, No as defaultAttributes, Ns as e, Nt as BUILTIN_TRANSFORMERS, O as readSpaceTests, Oa as openModal, Oi as named, On as locateField, Oo as variantItem, Os as n$1, Ot as specFromSpace, P as summariseRenders, Pa as scrollTo, Pi as applyBuiltinCallback, Pn as targetOf, Po as defaultLabel, Ps as i$2, Pt as getTransformer, Q as failedFlowText, Qa as custom, Qi as onChange, Qn as STYLE_STATES, Qo as visibleWhen, Qr as getUtility, Qt as e2eTestProblems, R as PAGE_DECORATION_LIMIT, Ra as elementsFromManifest, Ri as carouselGoTo, Rn as tw, Ro as COMPONENT_SOURCES, Rr as slugify, Rs as a, Rt as assertSpaceValid, S as parseE2eSteps, Sa as onPointerDown, Si as toggleState, Sn as FIELD, So as tabContainerBody, Ss as elementTypeNames, St as explanationText, T as e2e, Ta as onThemeChange, Ti as authorFlow, Tn as endlesslyMovedInPage, To as text, Tt as ELEMENT_FIELDS, U as diffPictures, Ua as apiContainer, Ui as closeDialog, Un as classNames, Uo as bindTemplate, Ur as selectorFor, Us as c$1, Ut as SpaceRefusedError, V as alignPictures, Va as d, Vi as carouselPlay, Vn as row, Vo as activeWhen, Vr as locate, Vs as o, Vt as unusedDeclarations, W as pageRegions, Wa as blockHtml, Wi as closeModal, Wn as classRefs, Wo as boundAttribute, Wr as flagGateOf, Ws as n$2, Wt as refusalOf, X as onScreen, Xa as chart, Xi as onApiSuccess, Xn as styles, Xo as toBindingSpecs, Xr as BUILTIN_UTILITIES, Xs as o$1, Xt as FIXABLE_CODES, Y as inspectPage, Ya as channel, Yi as onApiError, Yn as splitClassList, Yo as scopedHint, Ys as i$3, Yt as navOf, Z as onScreenIfChosen, Za as container, Zi as onBlur, Zn as BREAKPOINTS, Zo as variantFrom, Zr as applyUtility, Zt as unitTestProblems, _ as durationMs, _a as onModalOpen, _i as runServerAction, _n as dragElement, _o as plitziSdk, _r as suggestCssProperty, _s as elementPartTypes, _t as GLOBAL_CALLBACK_BUILDERS, a as locateClasses, aa as onFlowError, ai as authRefreshDetails, an as playE2eStep, ao as form, ar as expandShorthand, as as AUTHORING_CODES, at as blankTemplateFiles, b as leadingTarget, ba as onPageChange, bi as stepState, bn as shownCopy, bo as svg, bs as elementSourceTypes, bt as explainList, c as suggestSpace, ca as onHover, ci as copyToClipboard, cn as unitReportText, co as image, cr as shorthandLonghands, cs as authoringCodeEntry, ct as toPortableSource, d as compactSvg, da as onJoin, di as hostAction, dn as EDGES, do as listItem, dr as cssNumberValue, ds as elementAttributeValues, dt as darkScheme, ea as onDialogAccept, ei as addNotification, en as testAccountWarnings, eo as dropdown, er as isRuleSetSpec, es as actionSource, et as readDevToolsInPage, f as e2eResultText, fa as onKey, fi as invalidateQueries, fn as parseRelation, fo as markdown, fr as cssProperties, fs as elementCallbacks, ft as importSlug, g as MAX_WAIT_FOR_MS, ga as onModalClose, gi as removeState, gn as answered, go as paragraph, gr as replacedCssProperty, gs as elementMarks, gt as EXPLAIN_KINDS, h as E2E_STEP_USAGE, ha as onMessage, hi as reachGoal, hn as sidePx, ho as pagination, hr as isCustomProperty, hs as elementLeafTypes, ht as BUILDER_NAMES, i as lintSpace, ia as onFlowEnd, ii as authLogoutEverywhere, in as isExpectation, io as fontAwesome, ir as cssShorthands, is as scope, it as blankSpace, j as pressShortcut, ja as resetForm, ji as whenSucceeded, jn as pressOnce, jo as component, jt as actionToSource, k as singlePageSpace, ka as publishOn, ki as when, kn as locateTarget, ko as variants, ks as r, kt as compareSpaces, l as validateSnippet, la as onInterval, li as cycleState, ln as resolveElement, lo as link, lr as ambiguousShorthands, ls as isSuggestionCode, lt as space$1, m as runE2eTest, ma as onLoad, mi as navigate, mn as relationHolds, mo as nodeHtml, mr as isCssProperty, ms as elementDefaultAttributes, mt as importProbe, n as authorSpace, na as onDialogOpen, ni as authLogin, nn as pageAt, no as embed, nr as toBlocks, ns as twig, nt as answerAction, o as locateElements, oa as onFlowProgress, oi as cancelServerAction, on as runUnitTest, oo as formControl, or as expandShorthandPatch, os as AUTHORING_ONLY_CODES, ot as catalogTemplateFiles, p as journeyAccount, pa as onLeave, pi as moveState, pn as relationElements, po as modalContainer, pr as cssPropertyName, ps as elementCatalog, pt as importedFiles, q as unrollPage, qa as carousel, qi as focus, qn as isStyleDeclaration, qo as hiddenWhen, qr as defineAction, qs as t, qt as notificationsCss, r as fixSpace, ra as onDialogReject, ri as authLogout, rn as bridge, ro as focusGroup, rr as toResponsive, rs as closest, rt as CATALOG_TEMPLATE_IDENTITY, s as planFixes, sa as onFocus, si as clearState, sn as runUnitTests, so as heading, sr as expandShorthandTraced, ss as AuthoringError, st as emptyTemplateFiles, t as authorSnippet, ta as onDialogClose, ti as appendState, tn as audienceAt, to as dropdownPopup, tr as sameBlocks, ts as source, tt as dataIssues, u as validateSpace, ua as onInvalid, ui as delay, un as openPage, uo as list, ur as fontUnread, us as elementAncestorTypes, ut as space, v as e2eStepText, va as onMouseEnter, vi as runServerActionOrNotify, vn as giveValue, vo as reference, vs as elementPublishes, vt as explain, w as unquoted, wa as onSubmit, wi as webHook, wn as awaitHydration, wo as tabContainerItem, ws as typeTriggerDefinitions, wt as searchWords, x as parseE2eStep, xa as onPageLoad, xi as toggleInState, xn as valueFieldIn, xo as tabContainer, xs as elementTriggers, xt as explainSearch, y as isE2eStepWord, ya as onMouseLeave, yi as setState, yn as hiddenAtWidth, yo as richText, ys as elementSlots, yt as explainKindOf, z as compareDecorations, za as pluginTypesOf, zi as carouselNext, zn as column, zo as GLOBAL_SOURCES, zr as buildHandles, zs as c, zt as withoutQuieted } from "./index-src.js";
|
|
2
2
|
import { n as e$1, r as r$2, t as a$1 } from "./index-declare.js";
|
|
3
|
-
export { AUTHORING_CODES, AUTHORING_ONLY_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, o as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, t as BUILTIN_PARAM_TYPES, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, n as DOCUMENT_SCROLLS, E2E_STEP_USAGE, EDGES, ELEMENT_FIELDS, EXPLAIN_KINDS, FIELD, FIXABLE_CODES, a as FOCUS_CALLBACKS, GLOBAL_CALLBACK_BUILDERS, GLOBAL_SOURCES, HYDRATION_MS, MAX_WAIT_FOR_MS, t$1 as MOTION_ENTERS, r as MOTION_LOOPS, n$1 as MOTION_TRIGGERS, i as NOTIFICATIONS_FIELDS, t$2 as NOTIFICATION_APPEARANCES, r$1 as NOTIFICATION_DEFAULTS, e as NOTIFICATION_PLACEMENTS, PAGE_DECORATION_LIMIT, PAGE_SPEC_FIELDS, PAGE_TEXT_LIMIT, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STATE_PATH_PARAMS, STYLE_STATES, SpaceRefusedError, actionSource, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, alignPictures, ambiguousShorthands, announceOn, answerAction, answered, apiContainer, appendState, applyBuiltinCallback, c as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, audienceAt, authLogin, authLogout, authLogoutEverywhere, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, awaitHydration, bindTemplate, blankSpace, space as blankSpaceSpec, blankTemplateFiles, blockHtml, blockJsx, boundAttribute, bridge, buildHandles, button, cancelApi, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, chart, className, classNames, classRefs, clearState, closeDialog, closeModal, closest, column, compactSvg, compareDecorations, comparePictures, compareSpaces, compareTexts, component, container, copyToClipboard, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, dataIssues, declaredCallback, declaredTrigger, declaresAttribute, defaultAttributes, defaultLabel, defineAction, defineElement, a$1 as definePlugin, delay, dialogContainer, diffPictures, digest, dragElement, dropdown, dropdownPopup, durationMs, e2e, e2eResultText, e2eStepProblems, e2eStepText, e2eTestProblems, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, r$2 as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementMarks, elementPartTypes, elementPublishes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, space$1 as emptySpaceSpec, emptyTemplateFiles, endlesslyMovedInPage, expandShorthand, expandShorthandPatch, expandShorthandTraced, explain, explainKindOf, explainList, explainSearch, explanationText, failedFlowText, familyOf, fieldsOf, fixSpace, flagGateOf, flagSpecOf, flowStepIds, focus, focusGroup, fontAwesome, fontUnread, form, formControl, s as getElementCallback, getGlobalCallback, getTransformer, getUtility, giveValue, grid, groupBindings, hasVisibilityBinding, heading, hiddenAtWidth, n$2 as hiddenParams, hiddenWhen, hostAction, hoverElement, image, importProbe, importSlug, importedFiles, inferredLinkMode, inspectDocument, inspectPage, inspectRenders, instanceSelectorFor, s$1 as invalidParams, invalidateQueries, isClassModifier, isClassRef, isCssProperty, isCustomProperty, r$3 as isDocumentScroll, isE2eStepWord, isExpectation, isRuleSetSpec, isStyleDeclaration, isSuggestionCode, journeyAccount, journeyStartWarnings, leadingTarget, link, lintSpace, list, listItem, loadImages, locate, locateClasses, locateElements, locateField, locateTarget, markdown, r$4 as missingRequiredParams, modalContainer, modifierClassName, moveState, named, navOf, navigate, nodeHtml, notificationsCss, on, onApiError, onApiSuccess, onBlur, onChange, onClick, onDialogAccept, onDialogClose, onDialogOpen, onDialogReject, onFlowEnd, onFlowError, onFlowProgress, onFocus, onHover, onInterval, onInvalid, onJoin, onKey, onLeave, onLoad, onMessage, onModalClose, onModalOpen, onMouseEnter, onMouseLeave, onPageChange, onPageLoad, onPointerDown, onScreen, onScreenIfChosen, onScroll, onSubmit, onThemeChange, onView, openDialog, openModal, openPage, pageAt, pageDecorations, pageFamily, pageRegions, pageTexts, pagination, paragraph, parseE2eStep, parseE2eSteps, parseRelation, pathForSlug, planFixes, playE2eStep, plitziSdk, pluginTypesOf, pressFailure, pressOnce, pressShortcut, profilePictures, publishOn, readDevTools, readDevToolsInPage, n$3 as readNotificationOptions, readSpaceTests, c$1 as reconcileParams, reference, refusalOf, relationElements, relationHolds, reloadApi, removeState, replacedCssProperty, resetForm, resolveElement, resolveSource, richText, row, runE2eTest, runServerAction, runServerActionOrNotify, runUnitTest, runUnitTests, sameBlocks, scope, scopedHint, scrollBy, scrollIntoView, scrollTo, searchScore, searchWords, selectorFor, setFieldValue, setState, settle, shortcutKey, shorthandLonghands, shownCopy, sidePx, singlePageSpace, slugify, source, i$2 as spaceCallbacks, specFromSpace, specToSource, splitClassList, d as splitNotificationsCss, stepLines, stepState, styles, suggestClassOverrides, suggestCssProperty, suggestSpace, suggestTransformer, summariseRenders, svg, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, targetId, targetOf, taskAction, testAccountWarnings, text, themeToggle, toBindingSpecs, toBlocks, i$3 as toBuilderParams, a$2 as toInteractionCallback, o$1 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, tokens, transformerCatalog, tw, twig, twigTemplate, typeCallbackDefinitions, typeTriggerDefinitions, unit, unitReportText, unitTestProblems, unquoted, unrollPage, unusedDeclarations, updateElement, validateSnippet, validateSpace, valueFieldIn, e$1 as valuesOf, variantFrom, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, whileRunning, withElement, withNamedIds, withNotificationsCss, withPluginCatalogs, withVisibility, withoutQuieted };
|
|
3
|
+
export { AUTHORING_CODES, AUTHORING_ONLY_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, o as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, t as BUILTIN_PARAM_TYPES, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, n as DOCUMENT_SCROLLS, E2E_STEP_USAGE, EDGES, ELEMENT_FIELDS, EXPLAIN_KINDS, FIELD, FIXABLE_CODES, a as FOCUS_CALLBACKS, GLOBAL_CALLBACK_BUILDERS, GLOBAL_SOURCES, HYDRATION_MS, MAX_WAIT_FOR_MS, t$1 as MOTION_ENTERS, r as MOTION_LOOPS, n$1 as MOTION_TRIGGERS, i as NOTIFICATIONS_FIELDS, t$2 as NOTIFICATION_APPEARANCES, r$1 as NOTIFICATION_DEFAULTS, e as NOTIFICATION_PLACEMENTS, PAGE_DECORATION_LIMIT, PAGE_SPEC_FIELDS, PAGE_TEXT_LIMIT, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STATE_PATH_PARAMS, STYLE_STATES, SpaceRefusedError, actionSource, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, alignPictures, ambiguousShorthands, announceOn, answerAction, answered, apiContainer, appendState, applyBuiltinCallback, c as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, audienceAt, authLogin, authLogout, authLogoutEverywhere, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, awaitHydration, bindTemplate, blankSpace, space as blankSpaceSpec, blankTemplateFiles, blockHtml, blockJsx, boundAttribute, bridge, buildHandles, button, cancelApi, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, chart, className, classNames, classRefs, clearState, closeDialog, closeModal, closest, column, compactSvg, compareDecorations, comparePictures, compareSpaces, compareTexts, component, container, copyToClipboard, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, dataIssues, declaredCallback, declaredTrigger, declaresAttribute, defaultAttributes, defaultLabel, defineAction, defineElement, a$1 as definePlugin, delay, dialogContainer, diffPictures, digest, dragElement, dropdown, dropdownPopup, durationMs, e2e, e2eResultText, e2eStepProblems, e2eStepText, e2eTestProblems, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, r$2 as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementMarks, elementPartTypes, elementPublishes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, space$1 as emptySpaceSpec, emptyTemplateFiles, endlesslyMovedInPage, expandShorthand, expandShorthandPatch, expandShorthandTraced, explain, explainKindOf, explainList, explainSearch, explanationText, failedFlowText, familyOf, fieldsOf, fixSpace, flagGateOf, flagSpecOf, flowStepIds, focus, focusGroup, fontAwesome, fontUnread, form, formControl, s as getElementCallback, getGlobalCallback, getTransformer, getUtility, giveValue, grid, groupBindings, hasVisibilityBinding, heading, hiddenAtWidth, n$2 as hiddenParams, hiddenWhen, hostAction, hoverElement, image, importProbe, importSlug, importedFiles, inferredLinkMode, inspectDocument, inspectPage, inspectRenders, instanceSelectorFor, s$1 as invalidParams, invalidateQueries, isClassModifier, isClassRef, isCssProperty, isCustomProperty, r$3 as isDocumentScroll, isE2eStepWord, isExpectation, isRuleSetSpec, isStyleDeclaration, isSuggestionCode, journeyAccount, journeyStartWarnings, leadingTarget, link, lintSpace, list, listItem, loadImages, locate, locateClasses, locateElements, locateField, locateTarget, markdown, r$4 as missingRequiredParams, modalContainer, modifierClassName, moveState, named, navOf, navigate, nodeHtml, notificationsCss, on, onApiError, onApiSuccess, onBlur, onChange, onClick, onDialogAccept, onDialogClose, onDialogOpen, onDialogReject, onFlowEnd, onFlowError, onFlowProgress, onFocus, onHover, onInterval, onInvalid, onJoin, onKey, onLeave, onLoad, onMessage, onModalClose, onModalOpen, onMouseEnter, onMouseLeave, onPageChange, onPageLoad, onPointerDown, onScreen, onScreenIfChosen, onScroll, onSubmit, onThemeChange, onView, openDialog, openModal, openPage, pageAt, pageDecorations, pageFamily, pageRegions, pageTexts, pagination, paragraph, parseE2eStep, parseE2eSteps, parseRelation, pathForSlug, planFixes, playE2eStep, plitziSdk, pluginTypesOf, pressFailure, pressOnce, pressShortcut, profilePictures, publishOn, reachGoal, readDevTools, readDevToolsInPage, n$3 as readNotificationOptions, readSpaceTests, c$1 as reconcileParams, reference, refusalOf, relationElements, relationHolds, reloadApi, removeState, replacedCssProperty, resetForm, resolveElement, resolveSource, richText, row, runE2eTest, runServerAction, runServerActionOrNotify, runUnitTest, runUnitTests, sameBlocks, scope, scopedHint, scrollBy, scrollIntoView, scrollTo, searchScore, searchWords, selectorFor, setFieldValue, setState, settle, shortcutKey, shorthandLonghands, shownCopy, sidePx, singlePageSpace, slugify, source, i$2 as spaceCallbacks, specFromSpace, specToSource, splitClassList, d as splitNotificationsCss, stepLines, stepState, styles, suggestClassOverrides, suggestCssProperty, suggestSpace, suggestTransformer, summariseRenders, svg, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, targetId, targetOf, taskAction, testAccountWarnings, text, themeToggle, timeWindow, toBindingSpecs, toBlocks, i$3 as toBuilderParams, a$2 as toInteractionCallback, o$1 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, tokens, transformerCatalog, tw, twig, twigTemplate, typeCallbackDefinitions, typeTriggerDefinitions, unit, unitReportText, unitTestProblems, unquoted, unrollPage, unusedDeclarations, updateElement, validateSnippet, validateSpace, valueFieldIn, e$1 as valuesOf, variantFrom, variantItem, variants, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, whileRunning, withElement, withNamedIds, withNotificationsCss, withPluginCatalogs, withVisibility, withoutQuieted };
|
package/dist/node.d.ts
CHANGED
|
@@ -510,6 +510,71 @@ declare const AUTHORING_CODES: {
|
|
|
510
510
|
readonly means: "a `when` asking a step of its flow for a key it never publishes — `whenSucceeded` / `whenFailed` on anything but `runServerAction`";
|
|
511
511
|
readonly fix: "a key the step publishes (`explain <step>`): after `authLogin`, `when({ field: 'signedIn.ok', operator: '=', value: true }, …)`";
|
|
512
512
|
};
|
|
513
|
+
readonly 'time-window-bound': {
|
|
514
|
+
readonly kind: "refused";
|
|
515
|
+
readonly means: "a `timeWindow`'s `startsAt` or `endsAt` that is not an instant with its offset — never read, so no bound";
|
|
516
|
+
readonly fix: "`startsAt: '2026-12-01T09:00:00Z'` (or `+01:00`); empty for no bound";
|
|
517
|
+
};
|
|
518
|
+
readonly 'time-window-empty': {
|
|
519
|
+
readonly kind: "warned";
|
|
520
|
+
readonly means: "a `timeWindow` that ends before it starts — it never shows what it holds";
|
|
521
|
+
readonly fix: "`endsAt` after `startsAt`";
|
|
522
|
+
};
|
|
523
|
+
readonly 'variants-choose-by': {
|
|
524
|
+
readonly kind: "refused";
|
|
525
|
+
readonly means: "a `variants`' `chooseBy` that is neither `'chance'` nor `'rules'` — it chooses by chance";
|
|
526
|
+
readonly fix: "`chooseBy: 'chance'` or `chooseBy: 'rules'`";
|
|
527
|
+
};
|
|
528
|
+
readonly 'variants-items': {
|
|
529
|
+
readonly kind: "refused";
|
|
530
|
+
readonly means: "a `variants` holding something beside its `variantItem`s, or too few — two to five by chance, one by rules";
|
|
531
|
+
readonly fix: "`variants({ children: [variantItem([…]), variantItem([…])] })`";
|
|
532
|
+
};
|
|
533
|
+
readonly 'variants-builder-variant': {
|
|
534
|
+
readonly kind: "warned";
|
|
535
|
+
readonly means: "a `variants`' `builderVariant` that is not the place of one of its variants — the builder shows the first";
|
|
536
|
+
readonly fix: "the place of a variant it has, from 0";
|
|
537
|
+
};
|
|
538
|
+
readonly 'variants-rule': {
|
|
539
|
+
readonly kind: "refused";
|
|
540
|
+
readonly means: "a `variantItem`'s `when` that is not a rule group";
|
|
541
|
+
readonly fix: "`when: { combinator: 'and', rules: [{ field: 'visitor.device', operator: '=', value: 'mobile' }] }`";
|
|
542
|
+
};
|
|
543
|
+
readonly 'variants-unreachable': {
|
|
544
|
+
readonly kind: "warned";
|
|
545
|
+
readonly means: "by rules, a `variantItem` after one with no rule, which takes everybody left — it is never shown";
|
|
546
|
+
readonly fix: "move the variant with no rule last, or give it one";
|
|
547
|
+
};
|
|
548
|
+
readonly 'variants-no-fallback': {
|
|
549
|
+
readonly kind: "warned";
|
|
550
|
+
readonly means: "by rules, a `variants` whose every variant has a rule: a visitor matching none is shown nothing";
|
|
551
|
+
readonly fix: "end it with a `variantItem` with no `when`, for everybody else";
|
|
552
|
+
};
|
|
553
|
+
readonly 'experiment-name': {
|
|
554
|
+
readonly kind: "refused";
|
|
555
|
+
readonly means: "by chance, a `variants`' `experiment` that a template cannot read as `experiments.x`";
|
|
556
|
+
readonly fix: "letters, digits and `_`, starting with a letter or `_` — or empty, for the element's own name";
|
|
557
|
+
};
|
|
558
|
+
readonly 'experiment-weight': {
|
|
559
|
+
readonly kind: "refused";
|
|
560
|
+
readonly means: "by chance, a `variantItem`'s `weight` that is not a whole number from 0 to 100, or variants that all weigh 0";
|
|
561
|
+
readonly fix: "`weight: 50`; 0 shows a variant to nobody, and at least one has to show";
|
|
562
|
+
};
|
|
563
|
+
readonly 'experiment-weights-total': {
|
|
564
|
+
readonly kind: "warned";
|
|
565
|
+
readonly means: "by chance, `variant`s whose `weight`s do not add up to 100 — each is read as its part of their total";
|
|
566
|
+
readonly fix: "percents adding up to 100: 50/25/20/5, or the proportions the warning gives";
|
|
567
|
+
};
|
|
568
|
+
readonly 'experiment-weights-differ': {
|
|
569
|
+
readonly kind: "warned";
|
|
570
|
+
readonly means: "two `variants` running the same test with different weights — they share it, so one set is ignored";
|
|
571
|
+
readonly fix: "the same weights on both, or a test name of its own for each";
|
|
572
|
+
};
|
|
573
|
+
readonly 'experiment-unknown': {
|
|
574
|
+
readonly kind: "refused";
|
|
575
|
+
readonly means: "a template, a binding or a `when` reading an experiment no `variants` chosen by chance runs";
|
|
576
|
+
readonly fix: "the name it suggests, or a `variants` with that `experiment`";
|
|
577
|
+
};
|
|
513
578
|
readonly 'flag-gate': {
|
|
514
579
|
readonly kind: "refused";
|
|
515
580
|
readonly means: "an element's or a page's `flag` that is not a flag name";
|
|
@@ -540,6 +605,11 @@ declare const AUTHORING_CODES: {
|
|
|
540
605
|
readonly means: "a flag rule that is not `{ when, value }`, or whose `value` is not `true` or `false`";
|
|
541
606
|
readonly fix: "`{ when: { … }, value: true }`";
|
|
542
607
|
};
|
|
608
|
+
readonly 'flag-rollout': {
|
|
609
|
+
readonly kind: "refused";
|
|
610
|
+
readonly means: "a flag's `rollout` that is not `{ percent, value }` — a whole share from 0 to 100 and the answer it gives";
|
|
611
|
+
readonly fix: "`rollout: { percent: 10, value: true }`";
|
|
612
|
+
};
|
|
543
613
|
readonly 'flag-rule-empty': {
|
|
544
614
|
readonly kind: "warned";
|
|
545
615
|
readonly means: "a flag rule with no conditions — skipped, never read as \"always\"";
|
|
@@ -3166,9 +3236,20 @@ declare type Schema = {
|
|
|
3166
3236
|
*/
|
|
3167
3237
|
declare type SchemaFlag = {
|
|
3168
3238
|
description?: string;
|
|
3169
|
-
/** The answer when no rule matches. */
|
|
3239
|
+
/** The answer when no rule matches — and no rollout takes the visitor in. */
|
|
3170
3240
|
value: boolean;
|
|
3171
3241
|
rules: SchemaFlagRule[];
|
|
3242
|
+
/**
|
|
3243
|
+
* A gradual rollout, read when no rule matches: `percent` of the visitors (0–100) get `value`, the rest the flag's own
|
|
3244
|
+
* `value`. Each visitor is kept in their place by a cookie, so raising the percent keeps everyone who was in.
|
|
3245
|
+
*/
|
|
3246
|
+
rollout?: SchemaFlagRollout;
|
|
3247
|
+
};
|
|
3248
|
+
|
|
3249
|
+
/** A share of the visitors a flag answers `value` for, when none of its rules matched. */
|
|
3250
|
+
declare type SchemaFlagRollout = {
|
|
3251
|
+
percent: number;
|
|
3252
|
+
value: boolean;
|
|
3172
3253
|
};
|
|
3173
3254
|
|
|
3174
3255
|
/** A value a flag takes where its `when` matches. The first rule that matches decides. */
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as o$3, Cr as b$1,
|
|
1
|
+
import { Ar as o$3, Cr as b$1, Dr as g$1, Er as f$2, Fr as v$1, Io as element, Ir as y$1, Mr as s$3, Nr as t$1, Or as l$3, Pr as u$3, Sr as _, Tr as d$2, Ts as X, Yr as c$3, Za as container, br as N$1, d as compactSvg, jo as component, jr as p$2, js as e$2, kr as m$2, n as authorSpace, u as validateSpace, vr as C$1, wr as c$4, xr as P, yr as M$1, zr as buildHandles } from "./index-src.js";
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import e from "node:path";
|
|
@@ -494,7 +494,7 @@ var SpacePreviewError = class extends Error {
|
|
|
494
494
|
};
|
|
495
495
|
Object.defineProperty(SpacePreviewError, "name", { value: "SpacePreviewError" });
|
|
496
496
|
var PREVIEW_ID = N$1;
|
|
497
|
-
var BUILT_IN = new Set(Object.values(
|
|
497
|
+
var BUILT_IN = new Set(Object.values(X).map((declaration) => declaration.type));
|
|
498
498
|
/** A preview file read as one, or why it is not, said whole. */
|
|
499
499
|
var parsePreview = (value) => {
|
|
500
500
|
if (!e$2(value) || typeof value.element !== "string" || value.element === "") return { problem: "it names no element: write { \"element\": \"<a component or an element type>\", \"copies\": [{ … }] }" };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -535,6 +535,11 @@ declare type PluginSchema = {
|
|
|
535
535
|
definition: Element_2['definition'];
|
|
536
536
|
/** The attributes a role that edits the content and not the design may change; none, it may change none. */
|
|
537
537
|
contentAttributes?: string[];
|
|
538
|
+
/**
|
|
539
|
+
* The element this one only works somewhere inside — a carousel's track, an A/B test's variant: the builder's
|
|
540
|
+
* catalogue lists it after that one, as a part of it.
|
|
541
|
+
*/
|
|
542
|
+
ancestorType?: string;
|
|
538
543
|
defaultStyle: {
|
|
539
544
|
name: string;
|
|
540
545
|
displayMode: DisplayMode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-authoring",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.12",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/index.js",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@microsoft/api-extractor": "^7.60.1",
|
|
69
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
70
|
-
"@plitzi/sdk-elements": "0.39.
|
|
71
|
-
"@plitzi/sdk-interactions": "0.39.
|
|
72
|
-
"@plitzi/sdk-schema": "0.39.
|
|
73
|
-
"@plitzi/sdk-shared": "0.39.
|
|
74
|
-
"@plitzi/sdk-style": "0.39.
|
|
69
|
+
"@plitzi/plitzi-ui": "^1.6.41",
|
|
70
|
+
"@plitzi/sdk-elements": "0.39.12",
|
|
71
|
+
"@plitzi/sdk-interactions": "0.39.12",
|
|
72
|
+
"@plitzi/sdk-schema": "0.39.12",
|
|
73
|
+
"@plitzi/sdk-shared": "0.39.12",
|
|
74
|
+
"@plitzi/sdk-style": "0.39.12",
|
|
75
75
|
"@types/react": "^19.3.0",
|
|
76
76
|
"eslint": "^9.39.5",
|
|
77
77
|
"prettier": "^3.10.1",
|