@webstudio-is/sdk-components-react 0.182.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 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 isTextChild = Children.toArray(children).every(
924
- (child) => typeof child === "string"
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", { style: { display: isTextChild ? "flex" : "contents" }, ...props, children: [
931
- /* @__PURE__ */ jsxs2("div", { style: { color: "rgb(16, 23, 233)" }, children: [
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("div", { ref, style: { marginLeft: isTextChild ? 0 : "1rem" }, children }),
937
- /* @__PURE__ */ jsxs2("div", { style: { color: "rgb(16, 23, 233)" }, children: [
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
  },
@@ -295,7 +303,8 @@ var meta6 = {
295
303
  type: "container",
296
304
  icon: BodyIcon,
297
305
  states: defaultStates,
298
- presetStyle: presetStyle2
306
+ presetStyle: presetStyle2,
307
+ detachable: false
299
308
  };
300
309
 
301
310
  // src/box.ws.ts
package/lib/props.js CHANGED
@@ -117,6 +117,10 @@ var meta = {
117
117
  {
118
118
  property: "display",
119
119
  value: { type: "keyword", value: "contents" }
120
+ },
121
+ {
122
+ property: "whiteSpaceCollapse",
123
+ value: { type: "keyword", value: "collapse" }
120
124
  }
121
125
  ]
122
126
  },
@@ -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>>;
@@ -3,7 +3,11 @@ export declare const defaultTag = "div";
3
3
  type Props = {
4
4
  tag: string;
5
5
  xmlns?: string;
6
- children: ReactNode;
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.182.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.2",
42
+ "@react-aria/utils": "^3.25.3",
43
43
  "colord": "^2.9.3",
44
44
  "micromark": "^4.0.0",
45
- "@webstudio-is/icons": "0.182.0",
46
- "@webstudio-is/react-sdk": "0.182.0",
47
- "@webstudio-is/sdk": "0.182.0",
48
- "@webstudio-is/image": "0.182.0"
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,7 +55,7 @@
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.5.2",
58
+ "typescript": "5.6.3",
59
59
  "@webstudio-is/generate-arg-types": "0.0.0",
60
60
  "@webstudio-is/jest-config": "1.0.7",
61
61
  "@webstudio-is/tsconfig": "1.0.7"