@webstudio-is/sdk-components-react 0.264.0 → 0.265.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/image.ws.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { img as e } from "@webstudio-is/sdk/normalize.css";
2
2
  import { props as t } from "./__generated__/image.props.js";
3
- const o = {
3
+ const r = {
4
4
  img: [
5
5
  ...e,
6
6
  // Otherwise on new image insert onto canvas it can overfit screen size multiple times
@@ -25,7 +25,7 @@ const o = {
25
25
  }, i = {
26
26
  category: "media",
27
27
  description: "Add an image asset to the page. Webstudio automatically converts images to WebP or AVIF format and makes them responsive for best performance.",
28
- presetStyle: o,
28
+ presetStyle: r,
29
29
  order: 0,
30
30
  initialProps: [
31
31
  "id",
@@ -45,7 +45,26 @@ const o = {
45
45
  control: "file",
46
46
  label: "Source",
47
47
  required: !1,
48
- accept: "image/*"
48
+ accept: "image/*",
49
+ contentMode: !0
50
+ },
51
+ width: {
52
+ type: "number",
53
+ control: "number",
54
+ required: !1,
55
+ contentMode: !0
56
+ },
57
+ height: {
58
+ type: "number",
59
+ control: "number",
60
+ required: !1,
61
+ contentMode: !0
62
+ },
63
+ alt: {
64
+ type: "string",
65
+ control: "text",
66
+ required: !1,
67
+ contentMode: !0
49
68
  }
50
69
  }
51
70
  };
package/lib/link.ws.js CHANGED
@@ -17,7 +17,8 @@ const t = {
17
17
  href: {
18
18
  type: "string",
19
19
  control: "url",
20
- required: !1
20
+ required: !1,
21
+ contentMode: !0
21
22
  }
22
23
  }
23
24
  };
@@ -1,6 +1,6 @@
1
1
  import { MarkdownEmbedIcon as e } from "@webstudio-is/icons/svg";
2
2
  import { descendantComponent as o } from "@webstudio-is/sdk";
3
- import { props as r } from "./__generated__/markdown-embed.props.js";
3
+ import { props as t } from "./__generated__/markdown-embed.props.js";
4
4
  const a = {
5
5
  icon: e,
6
6
  contentModel: {
@@ -21,12 +21,13 @@ const a = {
21
21
  },
22
22
  initialProps: ["class"],
23
23
  props: {
24
- ...r,
24
+ ...t,
25
25
  code: {
26
26
  required: !0,
27
27
  control: "code",
28
28
  language: "markdown",
29
- type: "string"
29
+ type: "string",
30
+ contentMode: !0
30
31
  }
31
32
  }
32
33
  };
package/lib/time.js CHANGED
@@ -291,9 +291,9 @@ const N = [
291
291
  if (Number.isNaN(e.getTime()) === !1)
292
292
  return e;
293
293
  }, Y = (t, e, n = "en-US") => {
294
- const s = (r, o = 2) => String(r).padStart(o, "0"), D = new Intl.DateTimeFormat(n, {
294
+ const s = (r, o = 2) => String(r).padStart(o, "0"), T = new Intl.DateTimeFormat(n, {
295
295
  weekday: "long"
296
- }).format(t), T = new Intl.DateTimeFormat(n, {
296
+ }).format(t), D = new Intl.DateTimeFormat(n, {
297
297
  weekday: "short"
298
298
  }).format(t), l = new Intl.DateTimeFormat(n, {
299
299
  month: "long"
@@ -306,8 +306,8 @@ const N = [
306
306
  MMM: M,
307
307
  MM: s(t.getMonth() + 1),
308
308
  M: t.getMonth() + 1,
309
- DDDD: D,
310
- DDD: T,
309
+ DDDD: T,
310
+ DDD: D,
311
311
  DD: s(t.getDate()),
312
312
  D: t.getDate(),
313
313
  HH: s(t.getHours()),
@@ -324,9 +324,8 @@ const N = [
324
324
  country: e = u,
325
325
  dateStyle: n = G,
326
326
  timeStyle: s = I,
327
- format: D,
328
- // native html attribute in react style
329
- dateTime: T = f,
327
+ format: T,
328
+ datetime: D = f,
330
329
  ...l
331
330
  }, M) => {
332
331
  const m = `${L(t)}-${h(
@@ -334,12 +333,12 @@ const N = [
334
333
  )}`, a = {
335
334
  dateStyle: B(n),
336
335
  timeStyle: R(s)
337
- }, i = T === null ? E : T.toString(), r = U(i);
336
+ }, i = D === null ? E : D.toString(), r = U(i);
338
337
  let o = i;
339
338
  if (r)
340
- if (D)
339
+ if (T)
341
340
  try {
342
- o = Y(r, D, m);
341
+ o = Y(r, T, m);
343
342
  } catch {
344
343
  }
345
344
  else
package/lib/time.ws.js CHANGED
@@ -1,5 +1,5 @@
1
- import { time as t } from "@webstudio-is/sdk/normalize.css";
2
- import { props as e } from "./__generated__/time.props.js";
1
+ import { time as e } from "@webstudio-is/sdk/normalize.css";
2
+ import { props as t } from "./__generated__/time.props.js";
3
3
  const r = {
4
4
  category: "localization",
5
5
  description: "Converts machine-readable date and time to a human-readable format.",
@@ -8,7 +8,7 @@ const r = {
8
8
  children: []
9
9
  },
10
10
  presetStyle: {
11
- time: t
11
+ time: e
12
12
  },
13
13
  initialProps: [
14
14
  "datetime",
@@ -18,7 +18,35 @@ const r = {
18
18
  "timeStyle",
19
19
  "format"
20
20
  ],
21
- props: e
21
+ props: {
22
+ ...t,
23
+ datetime: {
24
+ type: "string",
25
+ control: "text",
26
+ required: !1,
27
+ contentMode: !0
28
+ },
29
+ language: {
30
+ ...t.language,
31
+ contentMode: !0
32
+ },
33
+ country: {
34
+ ...t.country,
35
+ contentMode: !0
36
+ },
37
+ dateStyle: {
38
+ ...t.dateStyle,
39
+ contentMode: !0
40
+ },
41
+ timeStyle: {
42
+ ...t.timeStyle,
43
+ contentMode: !0
44
+ },
45
+ format: {
46
+ ...t.format,
47
+ contentMode: !0
48
+ }
49
+ }
22
50
  };
23
51
  export {
24
52
  r as meta
@@ -1,10 +1,13 @@
1
+ import { type ComponentProps } from "react";
1
2
  declare const languages: readonly ["af", "am", "ar", "az", "be", "bg", "bn", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "es", "et", "eu", "fa", "fi", "fr", "ga", "gl", "gu", "he", "hi", "hr", "hu", "hy", "id", "is", "it", "ja", "ka", "kk", "km", "kn", "ko", "ky", "lb", "lt", "lv", "mk", "ml", "mn", "mr", "ms", "mt", "nb", "nl", "nn", "pl", "pt", "ro", "ru", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tr", "uk", "ur", "uz", "vi", "zh"];
2
3
  declare const countries: readonly ["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CG", "CD", "CR", "HR", "CU", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FJ", "FI", "FR", "GA", "GM", "GE", "DE", "GH", "GR", "GD", "GT", "GN", "GW", "GY", "HT", "HN", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IL", "IT", "JM", "JP", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NZ", "NI", "NE", "NG", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "QA", "RO", "RU", "RW", "KN", "LC", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SK", "SI", "SB", "SO", "ZA", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TO", "TT", "TN", "TR", "TM", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "YE", "ZM", "ZW"];
3
4
  type Language = (typeof languages)[number];
4
5
  type Country = (typeof countries)[number];
5
6
  type DateStyle = Intl.DateTimeFormatOptions["dateStyle"] | "none";
6
7
  type TimeStyle = Intl.DateTimeFormatOptions["timeStyle"] | "none";
7
- export declare const Time: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>, "dateTime"> & {
8
+ type TimeDateTime = ComponentProps<"time">["dateTime"];
9
+ type TimeProps = {
10
+ datetime?: TimeDateTime;
8
11
  language?: Language;
9
12
  country?: Country;
10
13
  dateStyle?: DateStyle;
@@ -22,7 +25,8 @@ export declare const Time: import("react").ForwardRefExoticComponent<Pick<import
22
25
  * Day and month names use the selected language.
23
26
  */
24
27
  format?: string;
25
- } & import("react").RefAttributes<HTMLTimeElement>>;
28
+ };
29
+ export declare const Time: import("react").ForwardRefExoticComponent<TimeProps & import("react").RefAttributes<HTMLTimeElement>>;
26
30
  export declare const __testing__: {
27
31
  parseDate: (datetimeString: string) => Date | undefined;
28
32
  formatDate: (date: Date, template: string, locale?: string) => string;
package/lib/video.ws.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VideoIcon as e } from "@webstudio-is/icons/svg";
2
- import { props as o } from "./__generated__/video.props.js";
3
- const i = {
2
+ import { props as t } from "./__generated__/video.props.js";
3
+ const n = {
4
4
  icon: e,
5
5
  contentModel: {
6
6
  category: "instance",
@@ -28,17 +28,30 @@ const i = {
28
28
  "playsInline"
29
29
  ],
30
30
  props: {
31
- ...o,
31
+ ...t,
32
32
  // Automatically generated props don't have the right control.
33
33
  src: {
34
34
  type: "string",
35
35
  control: "file",
36
36
  label: "Source",
37
37
  required: !1,
38
- accept: ".mp4,.webm,.mpg,.mpeg,.mov"
38
+ accept: ".mp4,.webm,.mpg,.mpeg,.mov",
39
+ contentMode: !0
40
+ },
41
+ width: {
42
+ type: "number",
43
+ control: "number",
44
+ required: !1,
45
+ contentMode: !0
46
+ },
47
+ height: {
48
+ type: "number",
49
+ control: "number",
50
+ required: !1,
51
+ contentMode: !0
39
52
  }
40
53
  }
41
54
  };
42
55
  export {
43
- i as meta
56
+ n as meta
44
57
  };
@@ -1,5 +1,5 @@
1
1
  import { meta as e } from "./image.ws.js";
2
- import { props as r } from "./__generated__/vimeo-preview-image.props.js";
2
+ import { props as o } from "./__generated__/vimeo-preview-image.props.js";
3
3
  const i = {
4
4
  ...e,
5
5
  category: "hidden",
@@ -10,13 +10,14 @@ const i = {
10
10
  },
11
11
  initialProps: e.initialProps,
12
12
  props: {
13
- ...r,
13
+ ...o,
14
14
  // Automatically generated props don't have the right control.
15
15
  src: {
16
16
  type: "string",
17
17
  control: "file",
18
18
  label: "Source",
19
- required: !1
19
+ required: !1,
20
+ contentMode: !0
20
21
  }
21
22
  }
22
23
  };
package/lib/vimeo.ws.js CHANGED
@@ -1,6 +1,6 @@
1
- import { VimeoIcon as o } from "@webstudio-is/icons/svg";
2
- import { div as e } from "@webstudio-is/sdk/normalize.css";
3
- import { props as t } from "./__generated__/vimeo.props.js";
1
+ import { VimeoIcon as e } from "@webstudio-is/icons/svg";
2
+ import { div as t } from "@webstudio-is/sdk/normalize.css";
3
+ import { props as o } from "./__generated__/vimeo.props.js";
4
4
  const i = [
5
5
  "id",
6
6
  "className",
@@ -20,15 +20,21 @@ const i = [
20
20
  "controlsColor",
21
21
  "playsinline"
22
22
  ], s = {
23
- icon: o,
23
+ icon: e,
24
24
  contentModel: {
25
25
  category: "instance",
26
26
  children: ["instance"],
27
27
  descendants: ["VimeoSpinner", "VimeoPlayButton", "VimeoPreviewImage"]
28
28
  },
29
- presetStyle: { div: e },
29
+ presetStyle: { div: t },
30
30
  initialProps: i,
31
- props: t
31
+ props: {
32
+ ...o,
33
+ url: {
34
+ ...o.url,
35
+ contentMode: !0
36
+ }
37
+ }
32
38
  };
33
39
  export {
34
40
  s as meta
package/lib/youtube.ws.js CHANGED
@@ -1,7 +1,7 @@
1
- import { YoutubeIcon as e } from "@webstudio-is/icons/svg";
2
- import { div as o } from "@webstudio-is/sdk/normalize.css";
3
- import { props as i } from "./__generated__/youtube.props.js";
4
- const n = [
1
+ import { YoutubeIcon as o } from "@webstudio-is/icons/svg";
2
+ import { div as t } from "@webstudio-is/sdk/normalize.css";
3
+ import { props as e } from "./__generated__/youtube.props.js";
4
+ const i = [
5
5
  "id",
6
6
  "className",
7
7
  "url",
@@ -29,17 +29,23 @@ const n = [
29
29
  "language",
30
30
  "color",
31
31
  "playlist"
32
- ], s = {
33
- icon: e,
32
+ ], l = {
33
+ icon: o,
34
34
  contentModel: {
35
35
  category: "instance",
36
36
  children: ["instance"],
37
37
  descendants: ["VimeoSpinner", "VimeoPlayButton", "VimeoPreviewImage"]
38
38
  },
39
- presetStyle: { div: o },
40
- initialProps: n,
41
- props: i
39
+ presetStyle: { div: t },
40
+ initialProps: i,
41
+ props: {
42
+ ...e,
43
+ url: {
44
+ ...e.url,
45
+ contentMode: !0
46
+ }
47
+ }
42
48
  };
43
49
  export {
44
- s as meta
50
+ l as meta
45
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.264.0",
3
+ "version": "0.265.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -44,10 +44,10 @@
44
44
  "colord": "^2.9.3",
45
45
  "micromark": "^4.0.2",
46
46
  "micromark-extension-gfm-table": "^2.1.1",
47
- "@webstudio-is/icons": "0.264.0",
48
- "@webstudio-is/image": "0.264.0",
49
- "@webstudio-is/react-sdk": "0.264.0",
50
- "@webstudio-is/sdk": "0.264.0"
47
+ "@webstudio-is/image": "0.265.0",
48
+ "@webstudio-is/react-sdk": "0.265.0",
49
+ "@webstudio-is/sdk": "0.265.0",
50
+ "@webstudio-is/icons": "0.265.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@testing-library/dom": "^10.4.0",
@@ -60,8 +60,8 @@
60
60
  "vitest": "^3.1.2",
61
61
  "@webstudio-is/design-system": "0.0.0",
62
62
  "@webstudio-is/generate-arg-types": "0.0.0",
63
+ "@webstudio-is/template": "0.265.0",
63
64
  "@webstudio-is/sdk-cli": "0.94.0",
64
- "@webstudio-is/template": "0.264.0",
65
65
  "@webstudio-is/tsconfig": "1.0.7"
66
66
  },
67
67
  "scripts": {