@webstudio-is/react-sdk 0.55.0 → 0.57.0
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/lib/app/custom-components/image.js +6 -6
- package/lib/app/custom-components/shared/remix-link.js +3 -3
- package/lib/app/params.js +4 -2
- package/lib/cjs/app/custom-components/image.js +6 -6
- package/lib/cjs/app/custom-components/shared/remix-link.js +3 -3
- package/lib/cjs/app/params.js +4 -2
- package/lib/cjs/components/link.js +14 -8
- package/lib/cjs/css/css.js +8 -5
- package/lib/cjs/css/global-rules.js +3 -3
- package/lib/cjs/css/style-rules.js +10 -3
- package/lib/cjs/props.js +18 -9
- package/lib/cjs/pubsub/raf-queue.js +3 -6
- package/lib/cjs/tree/root.js +1 -1
- package/lib/components/link.js +14 -8
- package/lib/css/css.js +8 -5
- package/lib/css/global-rules.js +4 -7
- package/lib/css/style-rules.js +10 -3
- package/lib/props.js +18 -9
- package/lib/pubsub/raf-queue.js +3 -6
- package/lib/tree/root.js +1 -1
- package/package.json +21 -21
- package/src/app/custom-components/image.tsx +6 -7
- package/src/app/custom-components/shared/remix-link.tsx +3 -3
- package/src/app/params.ts +6 -4
- package/src/components/link.tsx +17 -7
- package/src/css/css.ts +9 -7
- package/src/css/global-rules.ts +6 -10
- package/src/css/style-rules.test.ts +22 -0
- package/src/css/style-rules.ts +15 -4
- package/src/props.test.ts +50 -20
- package/src/props.ts +27 -12
- package/src/pubsub/raf-queue.ts +3 -9
- package/src/tree/create-elements-tree.tsx +3 -7
- package/src/tree/root.ts +1 -1
- package/src/tree/webstudio-component.tsx +2 -2
- package/lib/types/app/custom-components/image.d.ts +0 -6
- package/lib/types/app/custom-components/index.d.ts +0 -26
- package/lib/types/app/custom-components/link-block.d.ts +0 -6
- package/lib/types/app/custom-components/link.d.ts +0 -6
- package/lib/types/app/custom-components/rich-text-link.d.ts +0 -6
- package/lib/types/app/custom-components/shared/remix-link.d.ts +0 -10
- package/lib/types/app/handle-request.server.d.ts +0 -2
- package/lib/types/app/index.d.ts +0 -3
- package/lib/types/app/params.d.ts +0 -6
- package/lib/types/app/root.d.ts +0 -8
- package/lib/types/components/__generated__/blockquote.props.d.ts +0 -2
- package/lib/types/components/__generated__/body.props.d.ts +0 -2
- package/lib/types/components/__generated__/bold.props.d.ts +0 -2
- package/lib/types/components/__generated__/box.props.d.ts +0 -2
- package/lib/types/components/__generated__/button.props.d.ts +0 -2
- package/lib/types/components/__generated__/code.props.d.ts +0 -2
- package/lib/types/components/__generated__/form.props.d.ts +0 -2
- package/lib/types/components/__generated__/fragment.props.d.ts +0 -2
- package/lib/types/components/__generated__/heading.props.d.ts +0 -2
- package/lib/types/components/__generated__/image.props.d.ts +0 -2
- package/lib/types/components/__generated__/input.props.d.ts +0 -2
- package/lib/types/components/__generated__/italic.props.d.ts +0 -2
- package/lib/types/components/__generated__/link-block.props.d.ts +0 -2
- package/lib/types/components/__generated__/link.props.d.ts +0 -2
- package/lib/types/components/__generated__/list-item.props.d.ts +0 -2
- package/lib/types/components/__generated__/list.props.d.ts +0 -2
- package/lib/types/components/__generated__/paragraph.props.d.ts +0 -2
- package/lib/types/components/__generated__/rich-text-link.props.d.ts +0 -2
- package/lib/types/components/__generated__/separator.props.d.ts +0 -2
- package/lib/types/components/__generated__/slot.props.d.ts +0 -2
- package/lib/types/components/__generated__/span.props.d.ts +0 -2
- package/lib/types/components/__generated__/subscript.props.d.ts +0 -2
- package/lib/types/components/__generated__/superscript.props.d.ts +0 -2
- package/lib/types/components/__generated__/text-block.props.d.ts +0 -2
- package/lib/types/components/blockquote.d.ts +0 -3
- package/lib/types/components/blockquote.stories.d.ts +0 -5
- package/lib/types/components/blockquote.ws.d.ts +0 -3
- package/lib/types/components/body.d.ts +0 -3
- package/lib/types/components/body.stories.d.ts +0 -6
- package/lib/types/components/body.ws.d.ts +0 -3
- package/lib/types/components/bold.d.ts +0 -3
- package/lib/types/components/bold.stories.d.ts +0 -5
- package/lib/types/components/bold.ws.d.ts +0 -3
- package/lib/types/components/box.d.ts +0 -7
- package/lib/types/components/box.stories.d.ts +0 -9
- package/lib/types/components/box.ws.d.ts +0 -3
- package/lib/types/components/button.d.ts +0 -7
- package/lib/types/components/button.stories.d.ts +0 -9
- package/lib/types/components/button.ws.d.ts +0 -3
- package/lib/types/components/code.d.ts +0 -9
- package/lib/types/components/code.stories.d.ts +0 -11
- package/lib/types/components/code.ws.d.ts +0 -3
- package/lib/types/components/component-meta.d.ts +0 -610
- package/lib/types/components/components-utils.d.ts +0 -34
- package/lib/types/components/components.d.ts +0 -31
- package/lib/types/components/form.d.ts +0 -3
- package/lib/types/components/form.stories.d.ts +0 -5
- package/lib/types/components/form.ws.d.ts +0 -3
- package/lib/types/components/fragment.d.ts +0 -6
- package/lib/types/components/fragment.ws.d.ts +0 -3
- package/lib/types/components/heading.d.ts +0 -7
- package/lib/types/components/heading.stories.d.ts +0 -9
- package/lib/types/components/heading.ws.d.ts +0 -3
- package/lib/types/components/image.d.ts +0 -3
- package/lib/types/components/image.stories.d.ts +0 -5
- package/lib/types/components/image.ws.d.ts +0 -3
- package/lib/types/components/index.d.ts +0 -17
- package/lib/types/components/input.d.ts +0 -3
- package/lib/types/components/input.stories.d.ts +0 -5
- package/lib/types/components/input.ws.d.ts +0 -3
- package/lib/types/components/italic.d.ts +0 -3
- package/lib/types/components/italic.stories.d.ts +0 -5
- package/lib/types/components/italic.ws.d.ts +0 -3
- package/lib/types/components/link-block.d.ts +0 -3
- package/lib/types/components/link-block.stories.d.ts +0 -13
- package/lib/types/components/link-block.ws.d.ts +0 -3
- package/lib/types/components/link.d.ts +0 -9
- package/lib/types/components/link.stories.d.ts +0 -13
- package/lib/types/components/link.ws.d.ts +0 -3
- package/lib/types/components/list-item.d.ts +0 -3
- package/lib/types/components/list-item.stories.d.ts +0 -5
- package/lib/types/components/list-item.ws.d.ts +0 -3
- package/lib/types/components/list.d.ts +0 -9
- package/lib/types/components/list.stories.d.ts +0 -9
- package/lib/types/components/list.ws.d.ts +0 -3
- package/lib/types/components/paragraph.d.ts +0 -3
- package/lib/types/components/paragraph.stories.d.ts +0 -5
- package/lib/types/components/paragraph.ws.d.ts +0 -3
- package/lib/types/components/rich-text-link.d.ts +0 -2
- package/lib/types/components/rich-text-link.stories.d.ts +0 -13
- package/lib/types/components/rich-text-link.ws.d.ts +0 -3
- package/lib/types/components/separator.d.ts +0 -3
- package/lib/types/components/separator.stories.d.ts +0 -5
- package/lib/types/components/separator.ws.d.ts +0 -3
- package/lib/types/components/slot.d.ts +0 -6
- package/lib/types/components/slot.stories.d.ts +0 -9
- package/lib/types/components/slot.ws.d.ts +0 -3
- package/lib/types/components/span.d.ts +0 -3
- package/lib/types/components/span.stories.d.ts +0 -5
- package/lib/types/components/span.ws.d.ts +0 -3
- package/lib/types/components/subscript.d.ts +0 -3
- package/lib/types/components/subscript.stories.d.ts +0 -5
- package/lib/types/components/subscript.ws.d.ts +0 -3
- package/lib/types/components/superscript.d.ts +0 -3
- package/lib/types/components/superscript.stories.d.ts +0 -5
- package/lib/types/components/superscript.ws.d.ts +0 -3
- package/lib/types/components/text-block.d.ts +0 -3
- package/lib/types/components/text-block.stories.d.ts +0 -5
- package/lib/types/components/text-block.ws.d.ts +0 -3
- package/lib/types/context.d.ts +0 -9
- package/lib/types/css/css.d.ts +0 -54
- package/lib/types/css/get-browser-style.d.ts +0 -2
- package/lib/types/css/global-rules.d.ts +0 -44
- package/lib/types/css/index.d.ts +0 -4
- package/lib/types/css/normalize-type-check.d.ts +0 -1
- package/lib/types/css/normalize.d.ts +0 -2429
- package/lib/types/css/presets.d.ts +0 -38
- package/lib/types/css/style-rules.d.ts +0 -201
- package/lib/types/css/style-rules.test.d.ts +0 -1
- package/lib/types/index.d.ts +0 -9
- package/lib/types/props.d.ts +0 -97
- package/lib/types/props.test.d.ts +0 -1
- package/lib/types/pubsub/create.d.ts +0 -28
- package/lib/types/pubsub/index.d.ts +0 -1
- package/lib/types/pubsub/raf-queue.d.ts +0 -1
- package/lib/types/tree/create-elements-tree.d.ts +0 -29
- package/lib/types/tree/index.d.ts +0 -3
- package/lib/types/tree/root.d.ts +0 -25
- package/lib/types/tree/session-storage-polyfill.d.ts +0 -2
- package/lib/types/tree/webstudio-component.d.ts +0 -15
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare const borders: {
|
|
2
|
-
readonly borderTopColor: {
|
|
3
|
-
readonly type: "keyword";
|
|
4
|
-
readonly value: "currentColor";
|
|
5
|
-
};
|
|
6
|
-
readonly borderRightColor: {
|
|
7
|
-
readonly type: "keyword";
|
|
8
|
-
readonly value: "currentColor";
|
|
9
|
-
};
|
|
10
|
-
readonly borderBottomColor: {
|
|
11
|
-
readonly type: "keyword";
|
|
12
|
-
readonly value: "currentColor";
|
|
13
|
-
};
|
|
14
|
-
readonly borderLeftColor: {
|
|
15
|
-
readonly type: "keyword";
|
|
16
|
-
readonly value: "currentColor";
|
|
17
|
-
};
|
|
18
|
-
readonly borderTopWidth: {
|
|
19
|
-
readonly type: "unit";
|
|
20
|
-
readonly value: 1;
|
|
21
|
-
readonly unit: "px";
|
|
22
|
-
};
|
|
23
|
-
readonly borderRightWidth: {
|
|
24
|
-
readonly type: "unit";
|
|
25
|
-
readonly value: 1;
|
|
26
|
-
readonly unit: "px";
|
|
27
|
-
};
|
|
28
|
-
readonly borderBottomWidth: {
|
|
29
|
-
readonly type: "unit";
|
|
30
|
-
readonly value: 1;
|
|
31
|
-
readonly unit: "px";
|
|
32
|
-
};
|
|
33
|
-
readonly borderLeftWidth: {
|
|
34
|
-
readonly type: "unit";
|
|
35
|
-
readonly value: 1;
|
|
36
|
-
readonly unit: "px";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import type { Style } from "@webstudio-is/css-data";
|
|
2
|
-
type StyleRule = {
|
|
3
|
-
instanceId: string;
|
|
4
|
-
breakpointId: string;
|
|
5
|
-
style: Style;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Merge styles from different style sources
|
|
9
|
-
* and group by instance and breakpoint
|
|
10
|
-
*/
|
|
11
|
-
export declare const getStyleRules: (styles: Map<string, {
|
|
12
|
-
state?: string | undefined;
|
|
13
|
-
value: {
|
|
14
|
-
type: "unit";
|
|
15
|
-
value: number;
|
|
16
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
17
|
-
} | {
|
|
18
|
-
type: "keyword";
|
|
19
|
-
value: string;
|
|
20
|
-
} | {
|
|
21
|
-
hidden?: boolean | undefined;
|
|
22
|
-
type: "unparsed";
|
|
23
|
-
value: string;
|
|
24
|
-
} | {
|
|
25
|
-
type: "fontFamily";
|
|
26
|
-
value: string[];
|
|
27
|
-
} | {
|
|
28
|
-
type: "rgb";
|
|
29
|
-
alpha: number;
|
|
30
|
-
r: number;
|
|
31
|
-
g: number;
|
|
32
|
-
b: number;
|
|
33
|
-
} | {
|
|
34
|
-
hidden?: boolean | undefined;
|
|
35
|
-
type: "image";
|
|
36
|
-
value: {
|
|
37
|
-
type: "asset";
|
|
38
|
-
value: string;
|
|
39
|
-
} | {
|
|
40
|
-
type: "url";
|
|
41
|
-
url: string;
|
|
42
|
-
};
|
|
43
|
-
} | {
|
|
44
|
-
type: "invalid";
|
|
45
|
-
value: string;
|
|
46
|
-
} | {
|
|
47
|
-
type: "unset";
|
|
48
|
-
value: "";
|
|
49
|
-
} | {
|
|
50
|
-
type: "tuple";
|
|
51
|
-
value: ({
|
|
52
|
-
type: "unit";
|
|
53
|
-
value: number;
|
|
54
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
55
|
-
} | {
|
|
56
|
-
type: "keyword";
|
|
57
|
-
value: string;
|
|
58
|
-
} | {
|
|
59
|
-
hidden?: boolean | undefined;
|
|
60
|
-
type: "unparsed";
|
|
61
|
-
value: string;
|
|
62
|
-
})[];
|
|
63
|
-
} | {
|
|
64
|
-
type: "layers";
|
|
65
|
-
value: ({
|
|
66
|
-
type: "unit";
|
|
67
|
-
value: number;
|
|
68
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
69
|
-
} | {
|
|
70
|
-
type: "keyword";
|
|
71
|
-
value: string;
|
|
72
|
-
} | {
|
|
73
|
-
hidden?: boolean | undefined;
|
|
74
|
-
type: "unparsed";
|
|
75
|
-
value: string;
|
|
76
|
-
} | {
|
|
77
|
-
hidden?: boolean | undefined;
|
|
78
|
-
type: "image";
|
|
79
|
-
value: {
|
|
80
|
-
type: "asset";
|
|
81
|
-
value: string;
|
|
82
|
-
} | {
|
|
83
|
-
type: "url";
|
|
84
|
-
url: string;
|
|
85
|
-
};
|
|
86
|
-
} | {
|
|
87
|
-
type: "invalid";
|
|
88
|
-
value: string;
|
|
89
|
-
} | {
|
|
90
|
-
type: "tuple";
|
|
91
|
-
value: ({
|
|
92
|
-
type: "unit";
|
|
93
|
-
value: number;
|
|
94
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
95
|
-
} | {
|
|
96
|
-
type: "keyword";
|
|
97
|
-
value: string;
|
|
98
|
-
} | {
|
|
99
|
-
hidden?: boolean | undefined;
|
|
100
|
-
type: "unparsed";
|
|
101
|
-
value: string;
|
|
102
|
-
})[];
|
|
103
|
-
})[];
|
|
104
|
-
} | {
|
|
105
|
-
type: "var";
|
|
106
|
-
value: string;
|
|
107
|
-
fallbacks: ({
|
|
108
|
-
type: "unit";
|
|
109
|
-
value: number;
|
|
110
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
111
|
-
} | {
|
|
112
|
-
type: "keyword";
|
|
113
|
-
value: string;
|
|
114
|
-
} | {
|
|
115
|
-
hidden?: boolean | undefined;
|
|
116
|
-
type: "unparsed";
|
|
117
|
-
value: string;
|
|
118
|
-
} | {
|
|
119
|
-
type: "fontFamily";
|
|
120
|
-
value: string[];
|
|
121
|
-
} | {
|
|
122
|
-
type: "rgb";
|
|
123
|
-
alpha: number;
|
|
124
|
-
r: number;
|
|
125
|
-
g: number;
|
|
126
|
-
b: number;
|
|
127
|
-
} | {
|
|
128
|
-
hidden?: boolean | undefined;
|
|
129
|
-
type: "image";
|
|
130
|
-
value: {
|
|
131
|
-
type: "asset";
|
|
132
|
-
value: string;
|
|
133
|
-
} | {
|
|
134
|
-
type: "url";
|
|
135
|
-
url: string;
|
|
136
|
-
};
|
|
137
|
-
} | {
|
|
138
|
-
type: "tuple";
|
|
139
|
-
value: ({
|
|
140
|
-
type: "unit";
|
|
141
|
-
value: number;
|
|
142
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
143
|
-
} | {
|
|
144
|
-
type: "keyword";
|
|
145
|
-
value: string;
|
|
146
|
-
} | {
|
|
147
|
-
hidden?: boolean | undefined;
|
|
148
|
-
type: "unparsed";
|
|
149
|
-
value: string;
|
|
150
|
-
})[];
|
|
151
|
-
} | {
|
|
152
|
-
type: "layers";
|
|
153
|
-
value: ({
|
|
154
|
-
type: "unit";
|
|
155
|
-
value: number;
|
|
156
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
157
|
-
} | {
|
|
158
|
-
type: "keyword";
|
|
159
|
-
value: string;
|
|
160
|
-
} | {
|
|
161
|
-
hidden?: boolean | undefined;
|
|
162
|
-
type: "unparsed";
|
|
163
|
-
value: string;
|
|
164
|
-
} | {
|
|
165
|
-
hidden?: boolean | undefined;
|
|
166
|
-
type: "image";
|
|
167
|
-
value: {
|
|
168
|
-
type: "asset";
|
|
169
|
-
value: string;
|
|
170
|
-
} | {
|
|
171
|
-
type: "url";
|
|
172
|
-
url: string;
|
|
173
|
-
};
|
|
174
|
-
} | {
|
|
175
|
-
type: "invalid";
|
|
176
|
-
value: string;
|
|
177
|
-
} | {
|
|
178
|
-
type: "tuple";
|
|
179
|
-
value: ({
|
|
180
|
-
type: "unit";
|
|
181
|
-
value: number;
|
|
182
|
-
unit: "number" | "x" | "s" | "%" | "px" | "dppx" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "st" | "ms";
|
|
183
|
-
} | {
|
|
184
|
-
type: "keyword";
|
|
185
|
-
value: string;
|
|
186
|
-
} | {
|
|
187
|
-
hidden?: boolean | undefined;
|
|
188
|
-
type: "unparsed";
|
|
189
|
-
value: string;
|
|
190
|
-
})[];
|
|
191
|
-
})[];
|
|
192
|
-
})[];
|
|
193
|
-
};
|
|
194
|
-
styleSourceId: string;
|
|
195
|
-
breakpointId: string;
|
|
196
|
-
property: "filter" | "float" | "fontFamily" | "width" | "height" | "color" | "left" | "right" | "top" | "bottom" | "contain" | "clip" | "content" | `--${string}` | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationTimeline" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockOverflow" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "printColorAdjust" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inputSecurity" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "letterSpacing" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex";
|
|
197
|
-
}>, styleSourceSelections: Map<string, {
|
|
198
|
-
values: string[];
|
|
199
|
-
instanceId: string;
|
|
200
|
-
}>) => StyleRule[];
|
|
201
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/types/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./css";
|
|
2
|
-
export * from "./tree";
|
|
3
|
-
export * from "./components";
|
|
4
|
-
export * from "./pubsub";
|
|
5
|
-
export * from "./app";
|
|
6
|
-
export * from "./components/components";
|
|
7
|
-
export * from "./components/components-utils";
|
|
8
|
-
export { customComponents, customComponentMetas, customComponentPropsMetas, } from "./app/custom-components";
|
|
9
|
-
export { type WsComponentPropsMeta, type WsComponentMeta, componentCategories, } from "./components/component-meta";
|
package/lib/types/props.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { Instance, Page, Prop } from "@webstudio-is/project-build";
|
|
2
|
-
export type PropsByInstanceId = Map<Instance["id"], Prop[]>;
|
|
3
|
-
export type Pages = Map<Page["id"], Page>;
|
|
4
|
-
export declare const getPropsByInstanceId: (props: Map<string, {
|
|
5
|
-
required?: boolean | undefined;
|
|
6
|
-
name: string;
|
|
7
|
-
type: "number";
|
|
8
|
-
value: number;
|
|
9
|
-
id: string;
|
|
10
|
-
instanceId: string;
|
|
11
|
-
} | {
|
|
12
|
-
required?: boolean | undefined;
|
|
13
|
-
name: string;
|
|
14
|
-
type: "string";
|
|
15
|
-
value: string;
|
|
16
|
-
id: string;
|
|
17
|
-
instanceId: string;
|
|
18
|
-
} | {
|
|
19
|
-
required?: boolean | undefined;
|
|
20
|
-
name: string;
|
|
21
|
-
type: "boolean";
|
|
22
|
-
value: boolean;
|
|
23
|
-
id: string;
|
|
24
|
-
instanceId: string;
|
|
25
|
-
} | {
|
|
26
|
-
required?: boolean | undefined;
|
|
27
|
-
name: string;
|
|
28
|
-
type: "asset";
|
|
29
|
-
value: string;
|
|
30
|
-
id: string;
|
|
31
|
-
instanceId: string;
|
|
32
|
-
} | {
|
|
33
|
-
required?: boolean | undefined;
|
|
34
|
-
name: string;
|
|
35
|
-
type: "page";
|
|
36
|
-
value: string;
|
|
37
|
-
id: string;
|
|
38
|
-
instanceId: string;
|
|
39
|
-
} | {
|
|
40
|
-
required?: boolean | undefined;
|
|
41
|
-
name: string;
|
|
42
|
-
type: "string[]";
|
|
43
|
-
value: string[];
|
|
44
|
-
id: string;
|
|
45
|
-
instanceId: string;
|
|
46
|
-
}>) => PropsByInstanceId;
|
|
47
|
-
export declare const useInstanceProps: (instanceId: Instance["id"]) => Record<string, string | number | boolean | string[]>;
|
|
48
|
-
export declare const usePropAsset: (instanceId: Instance["id"], name: string) => {
|
|
49
|
-
name: string;
|
|
50
|
-
path: string;
|
|
51
|
-
type: "font";
|
|
52
|
-
format: "ttf" | "woff" | "woff2" | "otf";
|
|
53
|
-
id: string;
|
|
54
|
-
projectId: string;
|
|
55
|
-
size: number;
|
|
56
|
-
description: string | null;
|
|
57
|
-
location: "FS" | "REMOTE";
|
|
58
|
-
createdAt: string;
|
|
59
|
-
meta: {
|
|
60
|
-
style: "normal" | "italic" | "oblique";
|
|
61
|
-
weight: number;
|
|
62
|
-
family: string;
|
|
63
|
-
} | {
|
|
64
|
-
variationAxes: Partial<Record<"wght" | "wdth" | "slnt" | "opsz" | "ital" | "GRAD" | "XTRA" | "XOPQ" | "YOPQ" | "YTLC" | "YTUC" | "YTAS" | "YTDE" | "YTFI", {
|
|
65
|
-
name: string;
|
|
66
|
-
min: number;
|
|
67
|
-
default: number;
|
|
68
|
-
max: number;
|
|
69
|
-
}>>;
|
|
70
|
-
family: string;
|
|
71
|
-
};
|
|
72
|
-
} | {
|
|
73
|
-
name: string;
|
|
74
|
-
path: string;
|
|
75
|
-
type: "image";
|
|
76
|
-
format: string;
|
|
77
|
-
id: string;
|
|
78
|
-
projectId: string;
|
|
79
|
-
size: number;
|
|
80
|
-
description: string | null;
|
|
81
|
-
location: "FS" | "REMOTE";
|
|
82
|
-
createdAt: string;
|
|
83
|
-
meta: {
|
|
84
|
-
width: number;
|
|
85
|
-
height: number;
|
|
86
|
-
};
|
|
87
|
-
} | undefined;
|
|
88
|
-
export declare const resolveUrlProp: (instanceId: Instance["id"], name: string, propsByInstanceId: PropsByInstanceId, pages: Pages) => Page | string | undefined;
|
|
89
|
-
export declare const usePropUrl: (instanceId: Instance["id"], name: string) => string | {
|
|
90
|
-
name: string;
|
|
91
|
-
path: string;
|
|
92
|
-
id: string;
|
|
93
|
-
meta: Record<string, string>;
|
|
94
|
-
title: string;
|
|
95
|
-
rootInstanceId: string;
|
|
96
|
-
} | undefined;
|
|
97
|
-
export declare const getInstanceIdFromComponentProps: (props: Record<string, unknown>) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const createPubsub: <PublishMap>() => {
|
|
3
|
-
/**
|
|
4
|
-
* To publish a postMessage event on the current window and parent window from the iframe.
|
|
5
|
-
*/
|
|
6
|
-
publish<Type extends keyof PublishMap>(action: undefined extends PublishMap[Type] ? {
|
|
7
|
-
type: Type;
|
|
8
|
-
payload?: PublishMap[Type] | undefined;
|
|
9
|
-
} : {
|
|
10
|
-
type: Type;
|
|
11
|
-
payload: PublishMap[Type];
|
|
12
|
-
}): void;
|
|
13
|
-
/**
|
|
14
|
-
* To publish a postMessage event on the iframe and parent window from the parent window.
|
|
15
|
-
*/
|
|
16
|
-
usePublish(): readonly [<Type_1 extends keyof PublishMap>(action: undefined extends PublishMap[Type_1] ? {
|
|
17
|
-
type: Type_1;
|
|
18
|
-
payload?: PublishMap[Type_1] | undefined;
|
|
19
|
-
} : {
|
|
20
|
-
type: Type_1;
|
|
21
|
-
payload: PublishMap[Type_1];
|
|
22
|
-
}) => void, import("react").MutableRefObject<HTMLIFrameElement | null>];
|
|
23
|
-
/**
|
|
24
|
-
* To subscribe a message event on the current window.
|
|
25
|
-
*/
|
|
26
|
-
useSubscribe<Type_2 extends keyof PublishMap>(type: Type_2, onAction: (payload: PublishMap[Type_2]) => void): void;
|
|
27
|
-
subscribe<Type_3 extends keyof PublishMap>(type: Type_3, onAction: (payload: PublishMap[Type_3]) => void): import("nanoevents").Unsubscribe;
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./create";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const batchUpdate: (update: () => void) => void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type ComponentProps } from "react";
|
|
2
|
-
import type { ReadableAtom } from "nanostores";
|
|
3
|
-
import type { Assets } from "@webstudio-is/asset-uploader";
|
|
4
|
-
import type { Instance, Instances } from "@webstudio-is/project-build";
|
|
5
|
-
import type { GetComponent } from "../components/components-utils";
|
|
6
|
-
import type { Pages, PropsByInstanceId } from "../props";
|
|
7
|
-
import type { WebstudioComponent } from "./webstudio-component";
|
|
8
|
-
export declare const createElementsTree: ({ instances, rootInstanceId, sandbox, propsByInstanceIdStore, assetsStore, pagesStore, Component, getComponent, }: {
|
|
9
|
-
instances: Map<string, {
|
|
10
|
-
label?: string | undefined;
|
|
11
|
-
type: "instance";
|
|
12
|
-
id: string;
|
|
13
|
-
component: string;
|
|
14
|
-
children: ({
|
|
15
|
-
type: "text";
|
|
16
|
-
value: string;
|
|
17
|
-
} | {
|
|
18
|
-
type: "id";
|
|
19
|
-
value: string;
|
|
20
|
-
})[];
|
|
21
|
-
}>;
|
|
22
|
-
rootInstanceId: Instance["id"];
|
|
23
|
-
sandbox?: boolean | undefined;
|
|
24
|
-
propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
|
|
25
|
-
assetsStore: ReadableAtom<Assets>;
|
|
26
|
-
pagesStore: ReadableAtom<Pages>;
|
|
27
|
-
Component: (props: ComponentProps<typeof WebstudioComponent>) => JSX.Element;
|
|
28
|
-
getComponent: GetComponent;
|
|
29
|
-
}) => JSX.Element | null;
|
package/lib/types/tree/root.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import type { Build, Page } from "@webstudio-is/project-build";
|
|
3
|
-
import type { Asset } from "@webstudio-is/asset-uploader";
|
|
4
|
-
import { WebstudioComponent } from "./webstudio-component";
|
|
5
|
-
import { registerComponents } from "../components";
|
|
6
|
-
import { type Params } from "../app/params";
|
|
7
|
-
import type { GetComponent } from "../components/components-utils";
|
|
8
|
-
export type Data = {
|
|
9
|
-
page: Page;
|
|
10
|
-
pages: Array<Page>;
|
|
11
|
-
build: Build;
|
|
12
|
-
assets: Array<Asset>;
|
|
13
|
-
params?: Params;
|
|
14
|
-
};
|
|
15
|
-
export type RootPropsData = Omit<Data, "build"> & {
|
|
16
|
-
build: Pick<Data["build"], "instances" | "props">;
|
|
17
|
-
};
|
|
18
|
-
type RootProps = {
|
|
19
|
-
data: RootPropsData;
|
|
20
|
-
Component?: (props: ComponentProps<typeof WebstudioComponent>) => JSX.Element;
|
|
21
|
-
customComponents?: Parameters<typeof registerComponents>[0];
|
|
22
|
-
getComponent: GetComponent;
|
|
23
|
-
};
|
|
24
|
-
export declare const InstanceRoot: ({ data, Component, customComponents, getComponent, }: RootProps) => JSX.Element | null;
|
|
25
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Instance, InstancesItem } from "@webstudio-is/project-build";
|
|
3
|
-
import type { GetComponent } from "../components/components-utils";
|
|
4
|
-
export declare const renderWebstudioComponentChildren: (children: Array<JSX.Element | string> | undefined) => Array<JSX.Element | string | Array<JSX.Element | string>> | undefined;
|
|
5
|
-
type WebstudioComponentProps = {
|
|
6
|
-
instance: InstancesItem;
|
|
7
|
-
instanceSelector: Instance["id"][];
|
|
8
|
-
children: Array<JSX.Element | string>;
|
|
9
|
-
getComponent: GetComponent;
|
|
10
|
-
};
|
|
11
|
-
export declare const WebstudioComponent: ({ instance, instanceSelector, children, getComponent, ...rest }: WebstudioComponentProps) => JSX.Element;
|
|
12
|
-
export declare const idAttribute = "data-ws-id";
|
|
13
|
-
export declare const componentAttribute = "data-ws-component";
|
|
14
|
-
export declare const collapsedAttribute = "data-ws-collapsed";
|
|
15
|
-
export {};
|