@webstudio-is/sdk-components-react 0.185.0 → 0.189.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/components.js +17 -8
- package/lib/metas.js +8 -0
- package/lib/props.js +4 -0
- package/lib/types/vimeo-preview-image.d.ts +3 -3
- package/lib/types/xml-node.d.ts +5 -1
- package/package.json +9 -9
package/lib/components.js
CHANGED
|
@@ -920,21 +920,30 @@ var XmlNode = forwardRef34(
|
|
|
920
920
|
const attrProps = Object.fromEntries(attributeEntries);
|
|
921
921
|
return createElement4(tag, attrProps, children);
|
|
922
922
|
}
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
);
|
|
926
|
-
const elementName = tag.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._]+/gu, "");
|
|
923
|
+
const childrenArray = Children.toArray(children);
|
|
924
|
+
const isTextChild = childrenArray.length > 0 && childrenArray.every((child) => typeof child === "string");
|
|
925
|
+
const elementName = tag.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._:]+/gu, "");
|
|
927
926
|
const attributes = attributeEntries.map(
|
|
928
927
|
([key, value]) => `${key}=${JSON.stringify(value)}`
|
|
929
928
|
);
|
|
930
|
-
return /* @__PURE__ */ jsxs2("div", {
|
|
931
|
-
/* @__PURE__ */ jsxs2("
|
|
929
|
+
return /* @__PURE__ */ jsxs2("div", { ...props, children: [
|
|
930
|
+
/* @__PURE__ */ jsxs2("span", { style: { color: "rgb(16, 23, 233)" }, children: [
|
|
932
931
|
"<",
|
|
933
932
|
[elementName, ...attributes].join(" "),
|
|
934
933
|
">"
|
|
935
934
|
] }),
|
|
936
|
-
/* @__PURE__ */ jsx31(
|
|
937
|
-
|
|
935
|
+
childrenArray.length > 0 && /* @__PURE__ */ jsx31(
|
|
936
|
+
"div",
|
|
937
|
+
{
|
|
938
|
+
ref,
|
|
939
|
+
style: {
|
|
940
|
+
display: isTextChild ? "inline" : "block",
|
|
941
|
+
marginLeft: isTextChild ? 0 : "1rem"
|
|
942
|
+
},
|
|
943
|
+
children
|
|
944
|
+
}
|
|
945
|
+
),
|
|
946
|
+
/* @__PURE__ */ jsxs2("span", { style: { color: "rgb(16, 23, 233)" }, children: [
|
|
938
947
|
"</",
|
|
939
948
|
elementName,
|
|
940
949
|
">"
|
package/lib/metas.js
CHANGED
|
@@ -37,6 +37,10 @@ var presetStyle = {
|
|
|
37
37
|
{
|
|
38
38
|
property: "display",
|
|
39
39
|
value: { type: "keyword", value: "contents" }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
property: "whiteSpaceCollapse",
|
|
43
|
+
value: { type: "keyword", value: "collapse" }
|
|
40
44
|
}
|
|
41
45
|
]
|
|
42
46
|
};
|
|
@@ -141,6 +145,10 @@ var meta4 = {
|
|
|
141
145
|
{
|
|
142
146
|
property: "display",
|
|
143
147
|
value: { type: "keyword", value: "contents" }
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
property: "whiteSpaceCollapse",
|
|
151
|
+
value: { type: "keyword", value: "collapse" }
|
|
144
152
|
}
|
|
145
153
|
]
|
|
146
154
|
},
|
package/lib/props.js
CHANGED
|
@@ -274,11 +274,11 @@ export declare const VimeoPreviewImage: import("react").ForwardRefExoticComponen
|
|
|
274
274
|
src?: string | undefined;
|
|
275
275
|
loading?: "eager" | "lazy" | undefined;
|
|
276
276
|
decoding?: "async" | "auto" | "sync" | undefined;
|
|
277
|
-
fetchPriority?: "high" | "low" | "auto";
|
|
277
|
+
fetchPriority?: ("high" | "low" | "auto") | undefined;
|
|
278
278
|
sizes?: string | undefined;
|
|
279
279
|
srcSet?: string | undefined;
|
|
280
|
-
quality?: number;
|
|
281
|
-
optimize?: boolean;
|
|
280
|
+
quality?: number | undefined;
|
|
281
|
+
optimize?: boolean | undefined;
|
|
282
282
|
} & {
|
|
283
283
|
$webstudio$canvasOnly$assetId?: string | undefined;
|
|
284
284
|
} & import("react").RefAttributes<HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
|
package/lib/types/xml-node.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ export declare const defaultTag = "div";
|
|
|
3
3
|
type Props = {
|
|
4
4
|
tag: string;
|
|
5
5
|
xmlns?: string;
|
|
6
|
-
children
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
rel?: string;
|
|
8
|
+
hreflang?: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
"xmlns:xhtml"?: string;
|
|
7
11
|
};
|
|
8
12
|
export declare const XmlNode: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.189.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@react-aria/utils": "^3.25.
|
|
42
|
+
"@react-aria/utils": "^3.25.3",
|
|
43
43
|
"colord": "^2.9.3",
|
|
44
44
|
"micromark": "^4.0.0",
|
|
45
|
-
"@webstudio-is/
|
|
46
|
-
"@webstudio-is/
|
|
47
|
-
"@webstudio-is/
|
|
48
|
-
"@webstudio-is/
|
|
45
|
+
"@webstudio-is/icons": "0.189.0",
|
|
46
|
+
"@webstudio-is/image": "0.189.0",
|
|
47
|
+
"@webstudio-is/sdk": "0.189.0",
|
|
48
|
+
"@webstudio-is/react-sdk": "0.189.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@jest/globals": "^29.7.0",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"jest-environment-jsdom": "^29.7.0",
|
|
56
56
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
57
57
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
58
|
-
"typescript": "5.
|
|
58
|
+
"typescript": "5.6.3",
|
|
59
|
+
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
59
60
|
"@webstudio-is/jest-config": "1.0.7",
|
|
60
|
-
"@webstudio-is/tsconfig": "1.0.7"
|
|
61
|
-
"@webstudio-is/generate-arg-types": "0.0.0"
|
|
61
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "rm -rf lib && esbuild src/components.ts src/metas.ts src/props.ts --outdir=lib --bundle --format=esm --packages=external",
|