@webstudio-is/sdk-components-react 0.132.0 → 0.133.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 +10 -5
- package/lib/props.js +18 -1
- package/lib/types/input.d.ts +1 -1
- package/package.json +7 -7
package/lib/components.js
CHANGED
|
@@ -109,7 +109,8 @@ import { forwardRef as forwardRef6 } from "react";
|
|
|
109
109
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
110
110
|
var defaultTag2 = "div";
|
|
111
111
|
var Text = forwardRef6(
|
|
112
|
-
({ tag
|
|
112
|
+
({ tag = defaultTag2, children, ...props }, ref) => {
|
|
113
|
+
const Tag = tag;
|
|
113
114
|
return /* @__PURE__ */ jsx5(Tag, { ...props, ref, children: children ?? "The text you can edit" });
|
|
114
115
|
}
|
|
115
116
|
);
|
|
@@ -120,7 +121,8 @@ import { forwardRef as forwardRef7 } from "react";
|
|
|
120
121
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
121
122
|
var defaultTag3 = "h1";
|
|
122
123
|
var Heading = forwardRef7(
|
|
123
|
-
({ tag
|
|
124
|
+
({ tag = defaultTag3, children, ...props }, ref) => {
|
|
125
|
+
const Tag = tag;
|
|
124
126
|
return /* @__PURE__ */ jsx6(Tag, { ...props, ref, children: children ?? "Heading you can edit" });
|
|
125
127
|
}
|
|
126
128
|
);
|
|
@@ -189,7 +191,7 @@ Button.displayName = "Button";
|
|
|
189
191
|
// src/input.tsx
|
|
190
192
|
import { forwardRef as forwardRef17 } from "react";
|
|
191
193
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
192
|
-
var Input = forwardRef17(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx16("input", { ...props, ref }));
|
|
194
|
+
var Input = forwardRef17(({ children: _children, type = "text", ...props }, ref) => /* @__PURE__ */ jsx16("input", { ...props, type, ref }));
|
|
193
195
|
Input.displayName = "Input";
|
|
194
196
|
|
|
195
197
|
// src/form.tsx
|
|
@@ -231,7 +233,10 @@ var imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
|
|
|
231
233
|
</svg>`)}`;
|
|
232
234
|
var Image = forwardRef19(
|
|
233
235
|
({ loading = "lazy", ...props }, ref) => {
|
|
234
|
-
const { imageLoader, assetBaseUrl } = useContext2(ReactSdkContext2);
|
|
236
|
+
const { imageLoader, renderer, assetBaseUrl } = useContext2(ReactSdkContext2);
|
|
237
|
+
if (renderer === "canvas") {
|
|
238
|
+
loading = "eager";
|
|
239
|
+
}
|
|
235
240
|
if (props.src === void 0 || props.src.startsWith(assetBaseUrl) === false) {
|
|
236
241
|
return /* @__PURE__ */ jsx18(
|
|
237
242
|
"img",
|
|
@@ -511,7 +516,7 @@ var useVimeo = ({
|
|
|
511
516
|
var Vimeo = forwardRef29(
|
|
512
517
|
({
|
|
513
518
|
url,
|
|
514
|
-
loading,
|
|
519
|
+
loading = "lazy",
|
|
515
520
|
autoplay = false,
|
|
516
521
|
autopause = true,
|
|
517
522
|
backgroundMode = false,
|
package/lib/props.js
CHANGED
|
@@ -7223,7 +7223,24 @@ var props14 = {
|
|
|
7223
7223
|
required: false,
|
|
7224
7224
|
control: "select",
|
|
7225
7225
|
type: "string",
|
|
7226
|
-
|
|
7226
|
+
defaultValue: "text",
|
|
7227
|
+
options: [
|
|
7228
|
+
"number",
|
|
7229
|
+
"search",
|
|
7230
|
+
"time",
|
|
7231
|
+
"text",
|
|
7232
|
+
"hidden",
|
|
7233
|
+
"color",
|
|
7234
|
+
"date",
|
|
7235
|
+
"datetime-local",
|
|
7236
|
+
"email",
|
|
7237
|
+
"month",
|
|
7238
|
+
"password",
|
|
7239
|
+
"range",
|
|
7240
|
+
"tel",
|
|
7241
|
+
"url",
|
|
7242
|
+
"week"
|
|
7243
|
+
],
|
|
7227
7244
|
description: "Specifies the type of data that this input will accept and helps the browser provide appropriate validation and formatting for that input type."
|
|
7228
7245
|
},
|
|
7229
7246
|
typeof: { required: false, control: "text", type: "string" },
|
package/lib/types/input.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const defaultTag = "input";
|
|
3
3
|
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
-
type?: "number" | "text" | "tel" | "url" | "email" | "password" | undefined;
|
|
4
|
+
type?: "number" | "search" | "time" | "text" | "hidden" | "color" | "tel" | "url" | "email" | "date" | "range" | "datetime-local" | "month" | "password" | "week" | undefined;
|
|
5
5
|
}, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.133.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@react-aria/utils": "^3.21.0",
|
|
41
41
|
"colord": "^2.9.3",
|
|
42
42
|
"shallow-equal": "^3.1.0",
|
|
43
|
-
"@webstudio-is/
|
|
44
|
-
"@webstudio-is/
|
|
45
|
-
"@webstudio-is/react-sdk": "0.
|
|
43
|
+
"@webstudio-is/image": "0.133.0",
|
|
44
|
+
"@webstudio-is/icons": "0.133.0",
|
|
45
|
+
"@webstudio-is/react-sdk": "0.133.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@storybook/react": "^7.4.0",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-dom": "^18.2.0",
|
|
53
53
|
"typescript": "5.2.2",
|
|
54
|
-
"@webstudio-is/generate-arg-types": "0.
|
|
55
|
-
"@webstudio-is/
|
|
56
|
-
"@webstudio-is/
|
|
54
|
+
"@webstudio-is/generate-arg-types": "0.133.0",
|
|
55
|
+
"@webstudio-is/tsconfig": "1.0.7",
|
|
56
|
+
"@webstudio-is/storybook-config": "0.0.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "rm -rf lib && esbuild 'src/**/*.ts' 'src/**/*.tsx' --outdir=lib --watch",
|