@builder.io/sdk-svelte 0.2.1 → 0.2.3
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/package/--package.json +3 -2
- package/package/CHANGELOG.md +6 -0
- package/package/blocks/columns/columns.svelte +20 -23
- package/package/blocks/columns/columns.svelte.d.ts +1 -1
- package/package/blocks/image/image.svelte +1 -2
- package/package/blocks/image/image.svelte.d.ts +2 -2
- package/package/blocks/symbol/symbol.svelte +2 -3
- package/package/blocks/symbol/symbol.svelte.d.ts +2 -2
- package/package/components/render-block/block-styles.svelte +0 -2
- package/package/components/render-block/block-styles.svelte.d.ts +2 -2
- package/package/components/render-block/render-block.svelte +3 -7
- package/package/components/render-block/render-block.svelte.d.ts +2 -2
- package/package/components/render-block/render-component.svelte +1 -3
- package/package/components/render-block/render-component.svelte.d.ts +2 -2
- package/package/components/render-block/render-repeated-block.svelte +1 -2
- package/package/components/render-block/render-repeated-block.svelte.d.ts +2 -2
- package/package/components/render-blocks.svelte +0 -1
- package/package/components/render-blocks.svelte.d.ts +1 -1
- package/package/components/render-content/components/render-styles.svelte +8 -9
- package/package/components/render-content/components/render-styles.svelte.d.ts +1 -1
- package/package/components/render-content/render-content.svelte +11 -10
- package/package/components/render-content/render-content.svelte.d.ts +1 -1
- package/package/functions/get-block-properties.d.ts +1 -0
- package/package/functions/get-block-properties.js +31 -0
- package/package/functions/get-content/index.d.ts +1 -1
- package/package/functions/get-content/index.js +24 -17
- package/package/functions/track/index.js +2 -1
- package/package/helpers/logger.d.ts +5 -0
- package/package/helpers/logger.js +6 -0
- package/package/index.d.ts +1 -0
- package/package/types/builder-content.d.ts +1 -1
- package/package/types/components.d.ts +1 -72
- package/package/types/input.d.ts +4 -0
- package/package.json +2 -2
- package/src/blocks/columns/columns.svelte +25 -25
- package/src/blocks/image/image.svelte +3 -3
- package/src/blocks/symbol/symbol.svelte +4 -3
- package/src/components/render-block/block-styles.svelte +2 -2
- package/src/components/render-block/render-block.svelte +5 -6
- package/src/components/render-block/render-component.svelte +2 -2
- package/src/components/render-block/render-repeated-block.svelte +3 -2
- package/src/components/render-blocks.svelte +1 -1
- package/src/components/render-content/components/render-styles.svelte +9 -9
- package/src/components/render-content/render-content.svelte +23 -11
- package/src/functions/get-block-properties.ts +34 -0
- package/src/functions/get-content/index.ts +28 -22
- package/src/functions/register-component.ts +10 -10
- package/src/functions/track/index.ts +3 -2
- package/src/helpers/logger.ts +6 -0
- package/src/index.ts +1 -0
- package/src/types/builder-content.ts +1 -1
- package/src/types/components.ts +1 -68
- package/src/types/input.ts +5 -0
package/src/types/components.ts
CHANGED
|
@@ -1,72 +1,5 @@
|
|
|
1
1
|
import type { BuilderElement } from './element';
|
|
2
|
-
|
|
3
|
-
export interface Input {
|
|
4
|
-
name: string;
|
|
5
|
-
friendlyName?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
defaultValue?: any;
|
|
8
|
-
type: string;
|
|
9
|
-
valueType?: {
|
|
10
|
-
type?: string;
|
|
11
|
-
};
|
|
12
|
-
required?: boolean;
|
|
13
|
-
autoFocus?: boolean;
|
|
14
|
-
subFields?: Input[];
|
|
15
|
-
helperText?: string;
|
|
16
|
-
allowedFileTypes?: string[];
|
|
17
|
-
imageHeight?: number;
|
|
18
|
-
imageWidth?: number;
|
|
19
|
-
mediaHeight?: number;
|
|
20
|
-
mediaWidth?: number;
|
|
21
|
-
hideFromUI?: boolean;
|
|
22
|
-
modelId?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Number field type validation maximum accepted input
|
|
25
|
-
*/
|
|
26
|
-
max?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Number field type validation minimum accepted input
|
|
29
|
-
*/
|
|
30
|
-
min?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Number field type step size when using arrows
|
|
33
|
-
*/
|
|
34
|
-
step?: number;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Set this to `true` to show the editor for this input when
|
|
38
|
-
* children of this component are selected. This is useful for things
|
|
39
|
-
* like Tabs, such that users may not always select the Tabs component
|
|
40
|
-
* directly but will still be looking for how to add additional tabs
|
|
41
|
-
*/
|
|
42
|
-
broadcast?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Set this to `true` to show the editor for this input when
|
|
45
|
-
* group locked parents of this component are selected. This is useful
|
|
46
|
-
* to bubble up important inputs for locked groups, like text and images
|
|
47
|
-
*/
|
|
48
|
-
bubble?: boolean;
|
|
49
|
-
options?: { [key: string]: any };
|
|
50
|
-
enum?: string[] | { label: string; value: any; helperText?: string }[];
|
|
51
|
-
/** Regex field validation for all string types (text, longText, html, url, etc) */
|
|
52
|
-
regex?: {
|
|
53
|
-
/** pattern to test, like "^\/[a-z]$" */
|
|
54
|
-
pattern: string;
|
|
55
|
-
/** flags for the RegExp constructor, e.g. "gi" */
|
|
56
|
-
options?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Friendly message to display to end-users if the regex fails, e.g.
|
|
59
|
-
* "You must use a relative url starting with '/...' "
|
|
60
|
-
*/
|
|
61
|
-
message: string;
|
|
62
|
-
};
|
|
63
|
-
advanced?: boolean;
|
|
64
|
-
onChange?: ((options: Map<string, any>) => void | Promise<void>) | string;
|
|
65
|
-
code?: boolean;
|
|
66
|
-
richText?: boolean;
|
|
67
|
-
showIf?: ((options: Map<string, any>) => boolean) | string;
|
|
68
|
-
copyOnAdd?: boolean;
|
|
69
|
-
}
|
|
2
|
+
import type { Input } from './input';
|
|
70
3
|
|
|
71
4
|
export interface ComponentInfo {
|
|
72
5
|
/**
|
package/src/types/input.ts
CHANGED
|
@@ -117,4 +117,9 @@ export interface Input {
|
|
|
117
117
|
* Use optionally with inputs of type `reference`. Restricts the content entry picker to a specific model by name.
|
|
118
118
|
*/
|
|
119
119
|
model?: string;
|
|
120
|
+
|
|
121
|
+
valueType?: {
|
|
122
|
+
type?: string;
|
|
123
|
+
};
|
|
124
|
+
onChange?: ((options: Map<string, any>) => void | Promise<void>) | string;
|
|
120
125
|
}
|