@builder-builder/builder 0.0.28 → 0.0.29
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/dist/bb.js +5 -6
- package/dist/client/schema.d.ts +49 -29
- package/dist/components/BuilderOption.svelte.d.ts +12 -12
- package/dist/components/BuilderOptionValueBoolean.svelte.d.ts +20 -0
- package/dist/components/BuilderOptionValueNumber.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionValueSelect.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionValueString.svelte.d.ts +21 -0
- package/dist/components/index.d.ts +8 -8
- package/dist/components/index.js +2479 -2435
- package/dist/components/index.min.js +3 -3
- package/dist/entities/collection/collection.d.ts +162 -372
- package/dist/entities/collection/collection.js +7 -4
- package/dist/entities/collection/{when.d.ts → condition.d.ts} +3 -4
- package/dist/entities/collection/condition.js +2 -0
- package/dist/entities/collection/config.d.ts +52 -70
- package/dist/entities/collection/index.d.ts +4 -4
- package/dist/entities/collection/index.js +2 -2
- package/dist/entities/component/component.d.ts +11 -23
- package/dist/entities/component/component.js +4 -4
- package/dist/entities/component/{when.d.ts → condition.d.ts} +3 -4
- package/dist/entities/component/{when.js → condition.js} +3 -9
- package/dist/entities/component/index.d.ts +4 -4
- package/dist/entities/component/index.js +2 -2
- package/dist/entities/{when.d.ts → condition.d.ts} +21 -34
- package/dist/entities/{when.js → condition.js} +20 -25
- package/dist/entities/expectation.d.ts +135 -3
- package/dist/entities/expectation.js +6 -2
- package/dist/entities/index.d.ts +8 -8
- package/dist/entities/index.js +4 -4
- package/dist/entities/kind.d.ts +1 -1
- package/dist/entities/kind.js +4 -5
- package/dist/entities/model/bind.d.ts +5 -5
- package/dist/entities/model/methods.d.ts +18 -27
- package/dist/entities/model/methods.js +4 -22
- package/dist/entities/model/model.d.ts +3 -1
- package/dist/entities/model/model.js +25 -27
- package/dist/entities/option/condition.d.ts +9 -0
- package/dist/entities/option/condition.js +2 -0
- package/dist/entities/option/config.d.ts +44 -69
- package/dist/entities/option/config.js +6 -6
- package/dist/entities/option/expectation.d.ts +6 -1
- package/dist/entities/option/expectation.js +2 -2
- package/dist/entities/option/index.d.ts +8 -8
- package/dist/entities/option/index.js +4 -4
- package/dist/entities/option/option.d.ts +171 -202
- package/dist/entities/option/option.js +4 -4
- package/dist/entities/option/select.d.ts +16 -43
- package/dist/entities/option/select.js +8 -31
- package/dist/entities/option/value.d.ts +73 -0
- package/dist/entities/option/value.js +99 -0
- package/dist/entities/references.d.ts +104 -64
- package/dist/entities/serialise.d.ts +147 -80
- package/dist/entities/serialise.js +26 -21
- package/dist/entities/ui/input.d.ts +1 -1
- package/dist/entities/validated.d.ts +1 -1
- package/dist/errors/errors.d.ts +8 -3
- package/dist/errors/errors.js +5 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mappers/dependencies.js +4 -3
- package/dist/mappers/resolve.js +23 -22
- package/dist/mappers/variants/option-graph.js +1 -1
- package/dist/public.d.ts +17 -17
- package/dist/public.js +17 -9
- package/dist/validate/expectations.js +21 -3
- package/dist/validate/model.js +8 -11
- package/dist/validate/resolve.js +14 -18
- package/package.json +1 -1
- package/dist/components/BuilderOptionSelect.svelte.d.ts +0 -21
- package/dist/components/BuilderOptionToggleBoolean.svelte.d.ts +0 -20
- package/dist/components/BuilderOptionToggleNumber.svelte.d.ts +0 -21
- package/dist/components/BuilderOptionToggleString.svelte.d.ts +0 -21
- package/dist/entities/collection/when.js +0 -2
- package/dist/entities/option/toggle.d.ts +0 -45
- package/dist/entities/option/toggle.js +0 -71
- package/dist/entities/option/when.d.ts +0 -10
- package/dist/entities/option/when.js +0 -2
package/dist/bb.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateBoolean, validateCollectionConfig, validateCollectionSelectMap,
|
|
1
|
+
import { validateBoolean, validateCollectionConfig, validateCollectionSelectMap, validateCollectionCondition, validateComponentConfig, validateComponentSelectMap, validateComponentCondition, validateExpectations, validateNumber, validateOptionSelectMap, validateOptionCondition, validatePath, validatePaths, validatePricingRates, validateString, validateValue, validateUIDescribe, validateUIInput, validateUIItems, validateUIPage, validateUIPages } from './entities/index.js';
|
|
2
2
|
import { BuilderException } from './errors/index.js';
|
|
3
3
|
import { createInstance, createVariants, order, price, render } from './mappers/index.js';
|
|
4
4
|
import { assertValidated, validateBuilder, validateInstance, validateModel, validatePricing, validateUI, validateVariants } from './validate/index.js';
|
|
@@ -18,16 +18,15 @@ function bbFactory(environment, references = []) {
|
|
|
18
18
|
validate: {
|
|
19
19
|
builder: (input) => throwInProd(validateBuilder(input, references)),
|
|
20
20
|
model: (input) => throwInProd(validateModel(input, references)),
|
|
21
|
-
|
|
22
|
-
toggle: (input) => throwInProd(validateToggle(input, references)),
|
|
21
|
+
value: (input) => throwInProd(validateValue(input, references)),
|
|
23
22
|
optionSelectMap: (input) => throwInProd(validateOptionSelectMap(input, references)),
|
|
24
|
-
|
|
23
|
+
optionCondition: (input) => throwInProd(validateOptionCondition(input, references)),
|
|
25
24
|
componentConfig: (input) => throwInProd(validateComponentConfig(input, references)),
|
|
26
25
|
componentSelectMap: (input) => throwInProd(validateComponentSelectMap(input, references)),
|
|
27
|
-
|
|
26
|
+
componentCondition: (input) => throwInProd(validateComponentCondition(input, references)),
|
|
28
27
|
collectionConfig: (input) => throwInProd(validateCollectionConfig(input, references)),
|
|
29
28
|
collectionSelectMap: (input) => throwInProd(validateCollectionSelectMap(input, references)),
|
|
30
|
-
|
|
29
|
+
collectionCondition: (input) => throwInProd(validateCollectionCondition(input, references)),
|
|
31
30
|
ui: (input) => throwInProd(validateUI(input, references)),
|
|
32
31
|
uiDescribe: (input) => throwInProd(validateUIDescribe(input, references)),
|
|
33
32
|
uiItems: (input) => throwInProd(validateUIItems(input, references)),
|
package/dist/client/schema.d.ts
CHANGED
|
@@ -11,17 +11,18 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
11
11
|
readonly references: v.ArraySchema<v.ObjectSchema<{
|
|
12
12
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
13
13
|
readonly serialised: v.GenericSchema<string | number | boolean | readonly (string | number)[] | readonly (readonly (string | number)[])[] | import("../public.js").BuilderSerialised | import("../public.js").BuilderModelSerialised | Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
defaultValue: string | null;
|
|
14
|
+
kind: "string" | "number" | "boolean";
|
|
15
|
+
type: "value";
|
|
16
|
+
defaultValue: string | number | boolean | null;
|
|
17
17
|
isOptional: boolean;
|
|
18
|
-
optionLabels: {
|
|
19
|
-
[x: string]: string;
|
|
20
|
-
};
|
|
21
18
|
tags?: readonly string[] | undefined;
|
|
22
19
|
}> | Readonly<{
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
kind: "select";
|
|
21
|
+
readonly options: readonly [string, ...string[]];
|
|
22
|
+
optionLabels?: {
|
|
23
|
+
[x: string]: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
type: "value";
|
|
25
26
|
defaultValue: string | number | boolean | null;
|
|
26
27
|
isOptional: boolean;
|
|
27
28
|
tags?: readonly string[] | undefined;
|
|
@@ -29,37 +30,39 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
29
30
|
type: "parameter";
|
|
30
31
|
id: string;
|
|
31
32
|
name: string;
|
|
32
|
-
}> | Readonly<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
defaultValue: string | null;
|
|
33
|
+
}> | Readonly<{
|
|
34
|
+
kind: "string" | "number" | "boolean";
|
|
35
|
+
type: "value";
|
|
36
|
+
defaultValue: string | number | boolean | null;
|
|
36
37
|
isOptional: boolean;
|
|
37
|
-
|
|
38
|
+
tags?: readonly string[] | undefined;
|
|
39
|
+
}> | Readonly<{
|
|
40
|
+
kind: "select";
|
|
41
|
+
readonly options: readonly [string, ...string[]];
|
|
42
|
+
optionLabels?: {
|
|
38
43
|
[x: string]: string;
|
|
39
|
-
};
|
|
44
|
+
} | undefined;
|
|
45
|
+
type: "value";
|
|
46
|
+
defaultValue: string | number | boolean | null;
|
|
47
|
+
isOptional: boolean;
|
|
40
48
|
tags?: readonly string[] | undefined;
|
|
41
|
-
}>> |
|
|
42
|
-
type: "toggle";
|
|
49
|
+
}>> | import("../public.js").BuilderConditionSerialised<Readonly<{
|
|
43
50
|
kind: "string" | "number" | "boolean";
|
|
51
|
+
type: "value";
|
|
44
52
|
defaultValue: string | number | boolean | null;
|
|
45
53
|
isOptional: boolean;
|
|
46
54
|
tags?: readonly string[] | undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
55
|
+
}> | Readonly<{
|
|
56
|
+
kind: "select";
|
|
49
57
|
readonly options: readonly [string, ...string[]];
|
|
50
|
-
|
|
51
|
-
isOptional: boolean;
|
|
52
|
-
optionLabels: {
|
|
58
|
+
optionLabels?: {
|
|
53
59
|
[x: string]: string;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
}>> | Readonly<Readonly<{
|
|
57
|
-
type: "toggle";
|
|
58
|
-
kind: "string" | "number" | "boolean";
|
|
60
|
+
} | undefined;
|
|
61
|
+
type: "value";
|
|
59
62
|
defaultValue: string | number | boolean | null;
|
|
60
63
|
isOptional: boolean;
|
|
61
64
|
tags?: readonly string[] | undefined;
|
|
62
|
-
}
|
|
65
|
+
}>> | Readonly<{
|
|
63
66
|
details: Readonly<{
|
|
64
67
|
type: "parameter";
|
|
65
68
|
id: string;
|
|
@@ -95,7 +98,7 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
95
98
|
tags?: readonly string[] | undefined;
|
|
96
99
|
}>[];
|
|
97
100
|
tags?: readonly string[] | undefined;
|
|
98
|
-
}>> | import("../public.js").
|
|
101
|
+
}>> | import("../public.js").BuilderConditionSerialised<Readonly<{
|
|
99
102
|
details: Readonly<{
|
|
100
103
|
type: "parameter";
|
|
101
104
|
id: string;
|
|
@@ -167,7 +170,7 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
167
170
|
id: string;
|
|
168
171
|
}>;
|
|
169
172
|
tags?: readonly string[] | undefined;
|
|
170
|
-
}>> | import("../public.js").
|
|
173
|
+
}>> | import("../public.js").BuilderConditionSerialised<Readonly<{
|
|
171
174
|
model: Readonly<{
|
|
172
175
|
type: "parameter";
|
|
173
176
|
id: string;
|
|
@@ -390,6 +393,23 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
390
393
|
}> | import("../entities/index.js").BuilderUIItemSerialised)[] | import("../public.js").BuilderPricingSerialised | import("../entities/index.js").BuilderRates | readonly Readonly<{
|
|
391
394
|
name: string;
|
|
392
395
|
kind: "option" | "component" | "collection";
|
|
396
|
+
payload?: Readonly<{
|
|
397
|
+
kind: "string" | "number" | "boolean";
|
|
398
|
+
type: "value";
|
|
399
|
+
defaultValue: string | number | boolean | null;
|
|
400
|
+
isOptional: boolean;
|
|
401
|
+
tags?: readonly string[] | undefined;
|
|
402
|
+
}> | Readonly<{
|
|
403
|
+
kind: "select";
|
|
404
|
+
readonly options: readonly [string, ...string[]];
|
|
405
|
+
optionLabels?: {
|
|
406
|
+
[x: string]: string;
|
|
407
|
+
} | undefined;
|
|
408
|
+
type: "value";
|
|
409
|
+
defaultValue: string | number | boolean | null;
|
|
410
|
+
isOptional: boolean;
|
|
411
|
+
tags?: readonly string[] | undefined;
|
|
412
|
+
}> | undefined;
|
|
393
413
|
}>[]>;
|
|
394
414
|
}, undefined>, undefined>;
|
|
395
415
|
readonly environment: v.PicklistSchema<["development", "staging", "production"], undefined>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderPrimitive, BuilderRenderOption } from '../index.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
3
|
+
import type { BuilderBuilderOptionValueSelectProps } from './BuilderOptionValueSelect.svelte';
|
|
4
|
+
import type { BuilderBuilderOptionValueBooleanProps } from './BuilderOptionValueBoolean.svelte';
|
|
5
|
+
import type { BuilderBuilderOptionValueNumberProps } from './BuilderOptionValueNumber.svelte';
|
|
6
|
+
import type { BuilderBuilderOptionValueStringProps } from './BuilderOptionValueString.svelte';
|
|
7
7
|
export type BuilderBuilderOptionProps = {
|
|
8
8
|
readonly option: BuilderRenderOption;
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
9
|
+
readonly valueSelect?: Partial<BuilderBuilderOptionValueSelectProps>;
|
|
10
|
+
readonly valueBoolean?: Partial<BuilderBuilderOptionValueBooleanProps>;
|
|
11
|
+
readonly valueNumber?: Partial<BuilderBuilderOptionValueNumberProps>;
|
|
12
|
+
readonly valueString?: Partial<BuilderBuilderOptionValueStringProps>;
|
|
13
13
|
};
|
|
14
14
|
export type BuilderBuilderOptionUpdateEvent = CustomEvent<BuilderPrimitive>;
|
|
15
|
-
import './
|
|
16
|
-
import './
|
|
17
|
-
import './
|
|
18
|
-
import './
|
|
15
|
+
import './BuilderOptionValueSelect.svelte';
|
|
16
|
+
import './BuilderOptionValueBoolean.svelte';
|
|
17
|
+
import './BuilderOptionValueNumber.svelte';
|
|
18
|
+
import './BuilderOptionValueString.svelte';
|
|
19
19
|
declare const __propDef: {
|
|
20
20
|
props: Record<string, never>;
|
|
21
21
|
events: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueBooleanProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly id?: string;
|
|
6
|
+
};
|
|
7
|
+
export type BuilderBuilderOptionValueBooleanUpdateEvent = CustomEvent<boolean>;
|
|
8
|
+
declare const __propDef: {
|
|
9
|
+
props: Record<string, never>;
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type BuilderOptionValueBooleanProps = typeof __propDef.props;
|
|
16
|
+
export type BuilderOptionValueBooleanEvents = typeof __propDef.events;
|
|
17
|
+
export type BuilderOptionValueBooleanSlots = typeof __propDef.slots;
|
|
18
|
+
export default class BuilderOptionValueBoolean extends SvelteComponentTyped<BuilderOptionValueBooleanProps, BuilderOptionValueBooleanEvents, BuilderOptionValueBooleanSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueNumberProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly placeholder?: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderBuilderOptionValueNumberUpdateEvent = CustomEvent<number>;
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: Record<string, never>;
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BuilderOptionValueNumberProps = typeof __propDef.props;
|
|
17
|
+
export type BuilderOptionValueNumberEvents = typeof __propDef.events;
|
|
18
|
+
export type BuilderOptionValueNumberSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BuilderOptionValueNumber extends SvelteComponentTyped<BuilderOptionValueNumberProps, BuilderOptionValueNumberEvents, BuilderOptionValueNumberSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueSelectProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly placeholder?: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderBuilderOptionValueSelectUpdateEvent = CustomEvent<string | null>;
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: Record<string, never>;
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BuilderOptionValueSelectProps = typeof __propDef.props;
|
|
17
|
+
export type BuilderOptionValueSelectEvents = typeof __propDef.events;
|
|
18
|
+
export type BuilderOptionValueSelectSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BuilderOptionValueSelect extends SvelteComponentTyped<BuilderOptionValueSelectProps, BuilderOptionValueSelectEvents, BuilderOptionValueSelectSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueStringProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly placeholder?: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderBuilderOptionValueStringUpdateEvent = CustomEvent<string>;
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: Record<string, never>;
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BuilderOptionValueStringProps = typeof __propDef.props;
|
|
17
|
+
export type BuilderOptionValueStringEvents = typeof __propDef.events;
|
|
18
|
+
export type BuilderOptionValueStringSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BuilderOptionValueString extends SvelteComponentTyped<BuilderOptionValueStringProps, BuilderOptionValueStringEvents, BuilderOptionValueStringSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './
|
|
2
|
-
import './
|
|
3
|
-
import './
|
|
4
|
-
import './
|
|
1
|
+
import './BuilderOptionValueSelect.svelte';
|
|
2
|
+
import './BuilderOptionValueBoolean.svelte';
|
|
3
|
+
import './BuilderOptionValueNumber.svelte';
|
|
4
|
+
import './BuilderOptionValueString.svelte';
|
|
5
5
|
import './BuilderOption.svelte';
|
|
6
6
|
import './BuilderCollectionButtons.svelte';
|
|
7
7
|
import './BuilderLayout.svelte';
|
|
@@ -11,10 +11,10 @@ import './BuilderPrice.svelte';
|
|
|
11
11
|
import './BuilderRender.svelte';
|
|
12
12
|
import './Builder.svelte';
|
|
13
13
|
export type { BuilderBuilderOptionUpdateEvent, BuilderBuilderOptionProps } from './BuilderOption.svelte';
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
14
|
+
export type { BuilderBuilderOptionValueSelectUpdateEvent, BuilderBuilderOptionValueSelectProps } from './BuilderOptionValueSelect.svelte';
|
|
15
|
+
export type { BuilderBuilderOptionValueBooleanUpdateEvent, BuilderBuilderOptionValueBooleanProps } from './BuilderOptionValueBoolean.svelte';
|
|
16
|
+
export type { BuilderBuilderOptionValueNumberUpdateEvent, BuilderBuilderOptionValueNumberProps } from './BuilderOptionValueNumber.svelte';
|
|
17
|
+
export type { BuilderBuilderOptionValueStringUpdateEvent, BuilderBuilderOptionValueStringProps } from './BuilderOptionValueString.svelte';
|
|
18
18
|
export type { BuilderBuilderCollectionButtonsAddEvent, BuilderBuilderCollectionButtonsProps, BuilderBuilderCollectionButtonsRemoveEvent } from './BuilderCollectionButtons.svelte';
|
|
19
19
|
export type { BuilderBuilderLayoutUpdateEvent, BuilderBuilderLayoutProps } from './BuilderLayout.svelte';
|
|
20
20
|
export type { BuilderBuilderCollectionsUpdateEvent, BuilderBuilderCollectionsProps } from './BuilderCollections.svelte';
|