@webstudio-is/sdk 0.0.0-c1d6247 → 0.0.0-ca00e2a
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 +40 -36
- package/lib/index.js +788 -378
- package/lib/runtime.js +17 -1
- package/lib/types/__generated__/normalize.css.d.ts +2 -2
- package/lib/types/core-metas.d.ts +371 -89
- 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 -1
- package/lib/types/instances-utils.d.ts +3 -0
- package/lib/types/runtime.d.ts +5 -0
- package/lib/types/schema/animation-schema.d.ts +53844 -0
- package/lib/types/schema/assets.d.ts +12 -84
- package/lib/types/schema/breakpoints.d.ts +8 -8
- package/lib/types/schema/component-meta.d.ts +11162 -995
- package/lib/types/schema/data-sources.d.ts +18 -18
- package/lib/types/schema/deployment.d.ts +4 -4
- package/lib/types/schema/instances.d.ts +14 -217
- package/lib/types/schema/pages.d.ts +147 -146
- package/lib/types/schema/prop-meta.d.ts +105 -39
- package/lib/types/schema/props.d.ts +36858 -20
- package/lib/types/schema/resources.d.ts +4 -4
- package/lib/types/schema/styles.d.ts +4903 -1239
- package/lib/types/schema/webstudio.d.ts +23143 -783
- package/package.json +10 -9
- package/lib/types/schema/embed-template.d.ts +0 -2250
|
@@ -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
|
@@ -11,7 +11,6 @@ export * from "./schema/styles";
|
|
|
11
11
|
export * from "./schema/deployment";
|
|
12
12
|
export * from "./schema/webstudio";
|
|
13
13
|
export * from "./schema/prop-meta";
|
|
14
|
-
export * from "./schema/embed-template";
|
|
15
14
|
export * from "./schema/component-meta";
|
|
16
15
|
export * from "./core-metas";
|
|
17
16
|
export * from "./instances-utils";
|
|
@@ -21,3 +20,6 @@ export * from "./expression";
|
|
|
21
20
|
export * from "./resources-generator";
|
|
22
21
|
export * from "./page-meta-generator";
|
|
23
22
|
export * from "./url-pattern";
|
|
23
|
+
export * from "./css";
|
|
24
|
+
export type { AnimationAction, AnimationActionScroll, AnimationActionView, AnimationKeyframe, KeyframeStyles, RangeUnit, RangeUnitValue, ScrollNamedRange, ScrollRangeValue, ViewNamedRange, ViewRangeValue, ScrollAnimation, ViewAnimation, InsetUnitValue, DurationUnitValue, TimeUnit, } from "./schema/animation-schema";
|
|
25
|
+
export { animationActionSchema, scrollAnimationSchema, viewAnimationSchema, rangeUnitValueSchema, animationKeyframeSchema, insetUnitValueSchema, durationUnitValueSchema, 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;
|
package/lib/types/runtime.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from "./resource-loader";
|
|
2
2
|
export * from "./to-string";
|
|
3
3
|
export * from "./form-fields";
|
|
4
|
+
export declare const tagProperty = "data-ws-tag";
|
|
5
|
+
export declare const getTagFromProps: (props: Record<string, unknown>) => string | undefined;
|
|
6
|
+
export declare const indexProperty = "data-ws-index";
|
|
7
|
+
export declare const getIndexWithinAncestorFromProps: (props: Record<string, unknown>) => string | undefined;
|
|
8
|
+
export declare const animationCanPlayOnCanvasProperty = "data-ws-animation-can-play-on-canvas";
|