@webstudio-is/sdk 0.0.0-c1d6247 → 0.0.0-d45cd53
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/__generated__/normalize.css.js +247 -151
- package/lib/core-templates.js +5 -5
- package/lib/index.js +755 -311
- package/lib/types/__generated__/normalize.css.d.ts +2 -2
- package/lib/types/core-metas.d.ts +70 -0
- package/lib/types/css.d.ts +31 -0
- package/lib/types/css.test.d.ts +1 -0
- package/lib/types/expression.d.ts +7 -5
- package/lib/types/index.d.ts +3 -0
- package/lib/types/instances-utils.d.ts +3 -0
- package/lib/types/schema/animation-schema.d.ts +22925 -0
- package/lib/types/schema/component-meta.d.ts +4013 -379
- package/lib/types/schema/data-sources.d.ts +18 -18
- package/lib/types/schema/deployment.d.ts +4 -4
- package/lib/types/schema/pages.d.ts +13 -13
- package/lib/types/schema/prop-meta.d.ts +42 -0
- package/lib/types/schema/props.d.ts +16186 -0
- package/lib/types/schema/webstudio.d.ts +9386 -15
- package/package.json +8 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CssProperty, StyleValue } from "@webstudio-is/css-engine";
|
|
2
2
|
type StyleDecl = {
|
|
3
3
|
state?: string;
|
|
4
|
-
property:
|
|
4
|
+
property: CssProperty;
|
|
5
5
|
value: StyleValue;
|
|
6
6
|
};
|
|
7
7
|
export declare const div: StyleDecl[];
|
|
@@ -37,6 +37,13 @@ export declare const corePropsMetas: {
|
|
|
37
37
|
rows?: number | undefined;
|
|
38
38
|
label?: string | undefined;
|
|
39
39
|
description?: string | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
type: "resource";
|
|
42
|
+
required: boolean;
|
|
43
|
+
control: "resource";
|
|
44
|
+
defaultValue?: string | undefined;
|
|
45
|
+
label?: string | undefined;
|
|
46
|
+
description?: string | undefined;
|
|
40
47
|
} | {
|
|
41
48
|
type: "string";
|
|
42
49
|
required: boolean;
|
|
@@ -157,6 +164,13 @@ export declare const corePropsMetas: {
|
|
|
157
164
|
defaultValue?: string | undefined;
|
|
158
165
|
label?: string | undefined;
|
|
159
166
|
description?: string | undefined;
|
|
167
|
+
} | {
|
|
168
|
+
type: "animationAction";
|
|
169
|
+
required: boolean;
|
|
170
|
+
control: "animationAction";
|
|
171
|
+
defaultValue?: undefined;
|
|
172
|
+
label?: string | undefined;
|
|
173
|
+
description?: string | undefined;
|
|
160
174
|
}>;
|
|
161
175
|
initialProps?: string[] | undefined;
|
|
162
176
|
};
|
|
@@ -183,6 +197,13 @@ export declare const corePropsMetas: {
|
|
|
183
197
|
rows?: number | undefined;
|
|
184
198
|
label?: string | undefined;
|
|
185
199
|
description?: string | undefined;
|
|
200
|
+
} | {
|
|
201
|
+
type: "resource";
|
|
202
|
+
required: boolean;
|
|
203
|
+
control: "resource";
|
|
204
|
+
defaultValue?: string | undefined;
|
|
205
|
+
label?: string | undefined;
|
|
206
|
+
description?: string | undefined;
|
|
186
207
|
} | {
|
|
187
208
|
type: "string";
|
|
188
209
|
required: boolean;
|
|
@@ -303,6 +324,13 @@ export declare const corePropsMetas: {
|
|
|
303
324
|
defaultValue?: string | undefined;
|
|
304
325
|
label?: string | undefined;
|
|
305
326
|
description?: string | undefined;
|
|
327
|
+
} | {
|
|
328
|
+
type: "animationAction";
|
|
329
|
+
required: boolean;
|
|
330
|
+
control: "animationAction";
|
|
331
|
+
defaultValue?: undefined;
|
|
332
|
+
label?: string | undefined;
|
|
333
|
+
description?: string | undefined;
|
|
306
334
|
}>;
|
|
307
335
|
initialProps?: string[] | undefined;
|
|
308
336
|
};
|
|
@@ -329,6 +357,13 @@ export declare const corePropsMetas: {
|
|
|
329
357
|
rows?: number | undefined;
|
|
330
358
|
label?: string | undefined;
|
|
331
359
|
description?: string | undefined;
|
|
360
|
+
} | {
|
|
361
|
+
type: "resource";
|
|
362
|
+
required: boolean;
|
|
363
|
+
control: "resource";
|
|
364
|
+
defaultValue?: string | undefined;
|
|
365
|
+
label?: string | undefined;
|
|
366
|
+
description?: string | undefined;
|
|
332
367
|
} | {
|
|
333
368
|
type: "string";
|
|
334
369
|
required: boolean;
|
|
@@ -449,6 +484,13 @@ export declare const corePropsMetas: {
|
|
|
449
484
|
defaultValue?: string | undefined;
|
|
450
485
|
label?: string | undefined;
|
|
451
486
|
description?: string | undefined;
|
|
487
|
+
} | {
|
|
488
|
+
type: "animationAction";
|
|
489
|
+
required: boolean;
|
|
490
|
+
control: "animationAction";
|
|
491
|
+
defaultValue?: undefined;
|
|
492
|
+
label?: string | undefined;
|
|
493
|
+
description?: string | undefined;
|
|
452
494
|
}>;
|
|
453
495
|
initialProps?: string[] | undefined;
|
|
454
496
|
};
|
|
@@ -475,6 +517,13 @@ export declare const corePropsMetas: {
|
|
|
475
517
|
rows?: number | undefined;
|
|
476
518
|
label?: string | undefined;
|
|
477
519
|
description?: string | undefined;
|
|
520
|
+
} | {
|
|
521
|
+
type: "resource";
|
|
522
|
+
required: boolean;
|
|
523
|
+
control: "resource";
|
|
524
|
+
defaultValue?: string | undefined;
|
|
525
|
+
label?: string | undefined;
|
|
526
|
+
description?: string | undefined;
|
|
478
527
|
} | {
|
|
479
528
|
type: "string";
|
|
480
529
|
required: boolean;
|
|
@@ -595,6 +644,13 @@ export declare const corePropsMetas: {
|
|
|
595
644
|
defaultValue?: string | undefined;
|
|
596
645
|
label?: string | undefined;
|
|
597
646
|
description?: string | undefined;
|
|
647
|
+
} | {
|
|
648
|
+
type: "animationAction";
|
|
649
|
+
required: boolean;
|
|
650
|
+
control: "animationAction";
|
|
651
|
+
defaultValue?: undefined;
|
|
652
|
+
label?: string | undefined;
|
|
653
|
+
description?: string | undefined;
|
|
598
654
|
}>;
|
|
599
655
|
initialProps?: string[] | undefined;
|
|
600
656
|
};
|
|
@@ -621,6 +677,13 @@ export declare const corePropsMetas: {
|
|
|
621
677
|
rows?: number | undefined;
|
|
622
678
|
label?: string | undefined;
|
|
623
679
|
description?: string | undefined;
|
|
680
|
+
} | {
|
|
681
|
+
type: "resource";
|
|
682
|
+
required: boolean;
|
|
683
|
+
control: "resource";
|
|
684
|
+
defaultValue?: string | undefined;
|
|
685
|
+
label?: string | undefined;
|
|
686
|
+
description?: string | undefined;
|
|
624
687
|
} | {
|
|
625
688
|
type: "string";
|
|
626
689
|
required: boolean;
|
|
@@ -741,6 +804,13 @@ export declare const corePropsMetas: {
|
|
|
741
804
|
defaultValue?: string | undefined;
|
|
742
805
|
label?: string | undefined;
|
|
743
806
|
description?: string | undefined;
|
|
807
|
+
} | {
|
|
808
|
+
type: "animationAction";
|
|
809
|
+
required: boolean;
|
|
810
|
+
control: "animationAction";
|
|
811
|
+
defaultValue?: undefined;
|
|
812
|
+
label?: string | undefined;
|
|
813
|
+
description?: string | undefined;
|
|
744
814
|
}>;
|
|
745
815
|
initialProps?: string[] | undefined;
|
|
746
816
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type StyleSheetRegular, type TransformValue } from "@webstudio-is/css-engine";
|
|
2
|
+
import type { Assets } from "./schema/assets";
|
|
3
|
+
import type { Instances } from "./schema/instances";
|
|
4
|
+
import type { Props } from "./schema/props";
|
|
5
|
+
import type { Breakpoints } from "./schema/breakpoints";
|
|
6
|
+
import type { Styles } from "./schema/styles";
|
|
7
|
+
import type { StyleSourceSelections } from "./schema/style-source-selections";
|
|
8
|
+
import type { WsComponentMeta } from "./schema/component-meta";
|
|
9
|
+
export declare const addFontRules: ({ sheet, assets, assetBaseUrl, }: {
|
|
10
|
+
sheet: StyleSheetRegular;
|
|
11
|
+
assets: Assets;
|
|
12
|
+
assetBaseUrl: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
export type CssConfig = {
|
|
15
|
+
assets: Assets;
|
|
16
|
+
instances: Instances;
|
|
17
|
+
props: Props;
|
|
18
|
+
breakpoints: Breakpoints;
|
|
19
|
+
styles: Styles;
|
|
20
|
+
styleSourceSelections: StyleSourceSelections;
|
|
21
|
+
componentMetas: Map<string, WsComponentMeta>;
|
|
22
|
+
assetBaseUrl: string;
|
|
23
|
+
atomic: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const createImageValueTransformer: (assets: Assets, { assetBaseUrl }: {
|
|
26
|
+
assetBaseUrl: string;
|
|
27
|
+
}) => TransformValue;
|
|
28
|
+
export declare const generateCss: ({ assets, instances, props, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
|
|
29
|
+
cssText: string;
|
|
30
|
+
classes: Map<string, string[]>;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type Identifier } from "acorn";
|
|
2
|
-
import type { DataSources } from "./schema/data-sources";
|
|
2
|
+
import type { DataSource, DataSources } from "./schema/data-sources";
|
|
3
3
|
import type { Scope } from "./scope";
|
|
4
|
+
export declare const SYSTEM_VARIABLE_ID = ":system";
|
|
5
|
+
export declare const systemParameter: DataSource;
|
|
4
6
|
export type Diagnostic = {
|
|
5
7
|
from: number;
|
|
6
8
|
to: number;
|
|
@@ -42,10 +44,10 @@ export declare const parseObjectExpression: (expression: string) => Map<string,
|
|
|
42
44
|
* after updating individual value expressions
|
|
43
45
|
*/
|
|
44
46
|
export declare const generateObjectExpression: (map: Map<string, string>) => string;
|
|
45
|
-
export declare const
|
|
46
|
-
export {
|
|
47
|
-
export declare const
|
|
48
|
-
export {
|
|
47
|
+
export declare const encodeDataVariableId: (id: string) => string;
|
|
48
|
+
export { encodeDataVariableId as encodeDataSourceVariable };
|
|
49
|
+
export declare const decodeDataVariableId: (name: string) => string | undefined;
|
|
50
|
+
export { decodeDataVariableId as decodeDataSourceVariable };
|
|
49
51
|
export declare const generateExpression: ({ expression, dataSources, usedDataSources, scope, }: {
|
|
50
52
|
expression: string;
|
|
51
53
|
dataSources: DataSources;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -21,3 +21,6 @@ export * from "./expression";
|
|
|
21
21
|
export * from "./resources-generator";
|
|
22
22
|
export * from "./page-meta-generator";
|
|
23
23
|
export * from "./url-pattern";
|
|
24
|
+
export * from "./css";
|
|
25
|
+
export type { AnimationAction, AnimationActionScroll, AnimationActionView, AnimationKeyframe, KeyframeStyles, RangeUnit, RangeUnitValue, ScrollNamedRange, ScrollRangeValue, ViewNamedRange, ViewRangeValue, ScrollAnimation, ViewAnimation, InsetUnitValue, } from "./schema/animation-schema";
|
|
26
|
+
export { animationActionSchema, scrollAnimationSchema, viewAnimationSchema, rangeUnitValueSchema, animationKeyframeSchema, insetUnitValueSchema, RANGE_UNITS, } from "./schema/animation-schema";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { WsComponentMeta } from "./schema/component-meta";
|
|
1
2
|
import type { Instance, Instances } from "./schema/instances";
|
|
2
3
|
export declare const ROOT_INSTANCE_ID = ":root";
|
|
3
4
|
export declare const findTreeInstanceIds: (instances: Instances, rootInstanceId: Instance["id"]) => Set<string>;
|
|
4
5
|
export declare const findTreeInstanceIdsExcludingSlotDescendants: (instances: Instances, rootInstanceId: Instance["id"]) => Set<string>;
|
|
5
6
|
export declare const parseComponentName: (componentName: string) => readonly [string | undefined, string];
|
|
7
|
+
export type IndexesWithinAncestors = Map<Instance["id"], number>;
|
|
8
|
+
export declare const getIndexesWithinAncestors: (metas: Map<Instance["component"], WsComponentMeta>, instances: Instances, rootIds: Instance["id"][]) => IndexesWithinAncestors;
|