@webstudio-is/react-sdk 0.73.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/components/component-meta.js +1 -0
- package/lib/css/global-rules.js +1 -1
- 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
|
@@ -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") {
|
|
@@ -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") {
|
|
@@ -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()) {
|