@webstudio-is/react-sdk 0.74.0 → 0.75.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/cjs/components/component-meta.js +1 -0
- package/lib/cjs/css/global-rules.js +1 -1
- package/lib/cjs/css/normalize.js +1 -12
- package/lib/components/component-meta.js +1 -0
- package/lib/css/global-rules.js +1 -1
- package/lib/css/normalize.js +1 -12
- package/lib/types/components/component-meta.d.ts +3 -0
- package/package.json +12 -12
- package/src/components/component-meta.ts +1 -0
- package/src/css/global-rules.ts +2 -1
- package/src/css/normalize.ts +1 -12
|
@@ -63,6 +63,7 @@ const WsComponentMeta = import_zod.z.object({
|
|
|
63
63
|
invalidAncestors: import_zod.z.optional(import_zod.z.array(import_zod.z.string())),
|
|
64
64
|
stylable: import_zod.z.optional(import_zod.z.boolean()),
|
|
65
65
|
label: import_zod.z.string(),
|
|
66
|
+
description: import_zod.z.string().optional(),
|
|
66
67
|
icon: import_zod.z.string(),
|
|
67
68
|
presetStyle: import_zod.z.optional(import_zod.z.record(import_zod.z.string(), import_embed_template.EmbedTemplateStyleDecl)),
|
|
68
69
|
states: import_zod.z.optional(import_zod.z.array(ComponentState)),
|
|
@@ -23,7 +23,7 @@ __export(global_rules_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(global_rules_exports);
|
|
24
24
|
var import_fonts = require("@webstudio-is/fonts");
|
|
25
25
|
const addGlobalRules = (engine, { assets, assetBaseUrl }) => {
|
|
26
|
-
engine.addPlaintextRule("html {margin: 0; height: 100%}");
|
|
26
|
+
engine.addPlaintextRule("html {margin: 0; display: grid; min-height: 100%}");
|
|
27
27
|
const fontAssets = [];
|
|
28
28
|
for (const asset of assets.values()) {
|
|
29
29
|
if (asset?.type === "font") {
|
package/lib/cjs/css/normalize.js
CHANGED
|
@@ -93,18 +93,7 @@ const h5 = baseStyle;
|
|
|
93
93
|
const h6 = baseStyle;
|
|
94
94
|
const i = baseStyle;
|
|
95
95
|
const img = baseStyle;
|
|
96
|
-
const a =
|
|
97
|
-
...baseStyle,
|
|
98
|
-
{
|
|
99
|
-
property: "color",
|
|
100
|
-
value: { type: "rgb", r: 0, g: 0, b: 238, alpha: 1 }
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
state: ":visited",
|
|
104
|
-
property: "color",
|
|
105
|
-
value: { type: "rgb", r: 85, g: 26, b: 139, alpha: 1 }
|
|
106
|
-
}
|
|
107
|
-
];
|
|
96
|
+
const a = baseStyle;
|
|
108
97
|
const li = baseStyle;
|
|
109
98
|
const ul = baseStyle;
|
|
110
99
|
const ol = baseStyle;
|
|
@@ -37,6 +37,7 @@ const WsComponentMeta = z.object({
|
|
|
37
37
|
invalidAncestors: z.optional(z.array(z.string())),
|
|
38
38
|
stylable: z.optional(z.boolean()),
|
|
39
39
|
label: z.string(),
|
|
40
|
+
description: z.string().optional(),
|
|
40
41
|
icon: z.string(),
|
|
41
42
|
presetStyle: z.optional(z.record(z.string(), EmbedTemplateStyleDecl)),
|
|
42
43
|
states: z.optional(z.array(ComponentState)),
|
package/lib/css/global-rules.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getFontFaces } from "@webstudio-is/fonts";
|
|
2
2
|
const addGlobalRules = (engine, { assets, assetBaseUrl }) => {
|
|
3
|
-
engine.addPlaintextRule("html {margin: 0; height: 100%}");
|
|
3
|
+
engine.addPlaintextRule("html {margin: 0; display: grid; min-height: 100%}");
|
|
4
4
|
const fontAssets = [];
|
|
5
5
|
for (const asset of assets.values()) {
|
|
6
6
|
if (asset?.type === "font") {
|
package/lib/css/normalize.js
CHANGED
|
@@ -24,18 +24,7 @@ const h5 = baseStyle;
|
|
|
24
24
|
const h6 = baseStyle;
|
|
25
25
|
const i = baseStyle;
|
|
26
26
|
const img = baseStyle;
|
|
27
|
-
const a =
|
|
28
|
-
...baseStyle,
|
|
29
|
-
{
|
|
30
|
-
property: "color",
|
|
31
|
-
value: { type: "rgb", r: 0, g: 0, b: 238, alpha: 1 }
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
state: ":visited",
|
|
35
|
-
property: "color",
|
|
36
|
-
value: { type: "rgb", r: 85, g: 26, b: 139, alpha: 1 }
|
|
37
|
-
}
|
|
38
|
-
];
|
|
27
|
+
const a = baseStyle;
|
|
39
28
|
const li = baseStyle;
|
|
40
29
|
const ul = baseStyle;
|
|
41
30
|
const ol = baseStyle;
|
|
@@ -642,6 +642,7 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
642
642
|
invalidAncestors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
643
643
|
stylable: z.ZodOptional<z.ZodBoolean>;
|
|
644
644
|
label: z.ZodString;
|
|
645
|
+
description: z.ZodOptional<z.ZodString>;
|
|
645
646
|
icon: z.ZodString;
|
|
646
647
|
presetStyle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
|
|
647
648
|
value: {
|
|
@@ -1044,6 +1045,7 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
1044
1045
|
requiredAncestors?: string[] | undefined;
|
|
1045
1046
|
invalidAncestors?: string[] | undefined;
|
|
1046
1047
|
stylable?: boolean | undefined;
|
|
1048
|
+
description?: string | undefined;
|
|
1047
1049
|
presetStyle?: Record<string, {
|
|
1048
1050
|
value: {
|
|
1049
1051
|
type: "unit";
|
|
@@ -1247,6 +1249,7 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
1247
1249
|
requiredAncestors?: string[] | undefined;
|
|
1248
1250
|
invalidAncestors?: string[] | undefined;
|
|
1249
1251
|
stylable?: boolean | undefined;
|
|
1252
|
+
description?: string | undefined;
|
|
1250
1253
|
presetStyle?: Record<string, {
|
|
1251
1254
|
value: {
|
|
1252
1255
|
type: "unit";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -33,25 +33,25 @@
|
|
|
33
33
|
"nanoevents": "^7.0.1",
|
|
34
34
|
"nanoid": "^3.2.0",
|
|
35
35
|
"nanostores": "^0.7.1",
|
|
36
|
-
"@webstudio-is/asset-uploader": "^0.
|
|
37
|
-
"@webstudio-is/css-data": "^0.
|
|
38
|
-
"@webstudio-is/css-engine": "^0.
|
|
39
|
-
"@webstudio-is/fonts": "^0.
|
|
40
|
-
"@webstudio-is/generate-arg-types": "^0.
|
|
41
|
-
"@webstudio-is/project-build": "^0.
|
|
36
|
+
"@webstudio-is/asset-uploader": "^0.75.0",
|
|
37
|
+
"@webstudio-is/css-data": "^0.75.0",
|
|
38
|
+
"@webstudio-is/css-engine": "^0.75.0",
|
|
39
|
+
"@webstudio-is/fonts": "^0.75.0",
|
|
40
|
+
"@webstudio-is/generate-arg-types": "^0.75.0",
|
|
41
|
+
"@webstudio-is/project-build": "^0.75.0"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
45
45
|
"source": "./src/index.ts",
|
|
46
|
+
"types": "./lib/types/index.d.ts",
|
|
46
47
|
"import": "./lib/index.js",
|
|
47
|
-
"require": "./lib/cjs/index.js"
|
|
48
|
-
"types": "./lib/types/index.d.ts"
|
|
48
|
+
"require": "./lib/cjs/index.js"
|
|
49
49
|
},
|
|
50
50
|
"./css-normalize": {
|
|
51
51
|
"source": "./src/css/normalize.ts",
|
|
52
|
+
"types": "./lib/types/css/normalize.d.ts",
|
|
52
53
|
"import": "./lib/css/normalize.js",
|
|
53
|
-
"require": "./lib/cjs/css/normalize.js"
|
|
54
|
-
"types": "./lib/types/css/normalize.d.ts"
|
|
54
|
+
"require": "./lib/cjs/css/normalize.js"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"files": [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"dev": "build-package --watch",
|
|
67
67
|
"build": "build-package",
|
|
68
68
|
"build:args": "generate-arg-types './src/components/*.tsx ./src/app/custom-components/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx' && prettier --write \"**/*.props.ts\"",
|
|
69
|
-
"dts": "tsc --
|
|
69
|
+
"dts": "tsc --project tsconfig.dts.json",
|
|
70
70
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false",
|
|
71
71
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
|
|
72
72
|
"lint": "eslint ./src --ext .ts,.tsx --max-warnings 0",
|
|
@@ -54,6 +54,7 @@ const WsComponentMeta = z.object({
|
|
|
54
54
|
invalidAncestors: z.optional(z.array(z.string())),
|
|
55
55
|
stylable: z.optional(z.boolean()),
|
|
56
56
|
label: z.string(),
|
|
57
|
+
description: z.string().optional(),
|
|
57
58
|
icon: z.string(),
|
|
58
59
|
presetStyle: z.optional(z.record(z.string(), EmbedTemplateStyleDecl)),
|
|
59
60
|
states: z.optional(z.array(ComponentState)),
|
package/src/css/global-rules.ts
CHANGED
|
@@ -9,7 +9,8 @@ export const addGlobalRules = (
|
|
|
9
9
|
// @todo we need to figure out all global resets while keeping
|
|
10
10
|
// the engine aware of all of them.
|
|
11
11
|
// Ideally, the user is somehow aware and in control of the reset
|
|
12
|
-
|
|
12
|
+
// Layout source https://twitter.com/ChallengesCss/status/1471128244720181258
|
|
13
|
+
engine.addPlaintextRule("html {margin: 0; display: grid; min-height: 100%}");
|
|
13
14
|
|
|
14
15
|
const fontAssets: FontAsset[] = [];
|
|
15
16
|
for (const asset of assets.values()) {
|
package/src/css/normalize.ts
CHANGED
|
@@ -63,18 +63,7 @@ export const i = baseStyle;
|
|
|
63
63
|
|
|
64
64
|
export const img = baseStyle;
|
|
65
65
|
|
|
66
|
-
export const a =
|
|
67
|
-
...baseStyle,
|
|
68
|
-
{
|
|
69
|
-
property: "color",
|
|
70
|
-
value: { type: "rgb", r: 0, g: 0, b: 238, alpha: 1 },
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
state: ":visited",
|
|
74
|
-
property: "color",
|
|
75
|
-
value: { type: "rgb", r: 85, g: 26, b: 139, alpha: 1 },
|
|
76
|
-
},
|
|
77
|
-
] satisfies Styles;
|
|
66
|
+
export const a = baseStyle;
|
|
78
67
|
export const li = baseStyle;
|
|
79
68
|
export const ul = baseStyle;
|
|
80
69
|
export const ol = baseStyle;
|