@webstudio-is/sdk-components-react 0.174.0 → 0.179.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
@@ -32,7 +32,7 @@ import {
32
32
  useMemo
33
33
  } from "react";
34
34
  import { mergeRefs } from "@react-aria/utils";
35
- import { ReactSdkContext } from "@webstudio-is/react-sdk";
35
+ import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
36
36
 
37
37
  // src/html-embed-patchers.ts
38
38
  var isDOMContentLoaded = () => {
@@ -253,19 +253,33 @@ var HtmlEmbed = forwardRef3(
253
253
  );
254
254
  HtmlEmbed.displayName = "HtmlEmbed";
255
255
 
256
- // src/body.tsx
257
- import { forwardRef as forwardRef4 } from "react";
256
+ // src/markdown-embed.tsx
257
+ import { micromark } from "micromark";
258
+ import { forwardRef as forwardRef4, useMemo as useMemo2 } from "react";
258
259
  import { jsx as jsx4 } from "react/jsx-runtime";
259
- var Body = forwardRef4((props, ref) => /* @__PURE__ */ jsx4("body", { ...props, ref }));
260
+ var MarkdownEmbed = /* @__PURE__ */ forwardRef4((props, ref) => {
261
+ const { code, children, ...rest } = props;
262
+ const html = useMemo2(
263
+ // support data uri protocol in images
264
+ () => micromark(code ?? "", { allowDangerousProtocol: true }),
265
+ [code]
266
+ );
267
+ return /* @__PURE__ */ jsx4("div", { ...rest, ref, dangerouslySetInnerHTML: { __html: html } });
268
+ });
269
+
270
+ // src/body.tsx
271
+ import { forwardRef as forwardRef5 } from "react";
272
+ import { jsx as jsx5 } from "react/jsx-runtime";
273
+ var Body = forwardRef5((props, ref) => /* @__PURE__ */ jsx5("body", { ...props, ref }));
260
274
  Body.displayName = "Body";
261
275
 
262
276
  // src/box.tsx
263
277
  import {
264
278
  createElement,
265
- forwardRef as forwardRef5
279
+ forwardRef as forwardRef6
266
280
  } from "react";
267
281
  var defaultTag = "div";
268
- var Box = forwardRef5(
282
+ var Box = forwardRef6(
269
283
  ({ tag = defaultTag, ...props }, ref) => {
270
284
  return createElement(tag, { ...props, ref });
271
285
  }
@@ -273,116 +287,131 @@ var Box = forwardRef5(
273
287
  Box.displayName = "Box";
274
288
 
275
289
  // src/text.tsx
276
- import { forwardRef as forwardRef6 } from "react";
277
- import { jsx as jsx5 } from "react/jsx-runtime";
290
+ import { forwardRef as forwardRef7 } from "react";
291
+ import { jsx as jsx6 } from "react/jsx-runtime";
278
292
  var defaultTag2 = "div";
279
- var Text = forwardRef6(
293
+ var Text = forwardRef7(
280
294
  ({ tag = defaultTag2, children, ...props }, ref) => {
281
295
  const Tag = tag;
282
- return /* @__PURE__ */ jsx5(Tag, { ...props, ref, children });
296
+ return /* @__PURE__ */ jsx6(Tag, { ...props, ref, children });
283
297
  }
284
298
  );
285
299
  Text.displayName = "Text";
286
300
 
287
301
  // src/heading.tsx
288
- import { forwardRef as forwardRef7 } from "react";
289
- import { jsx as jsx6 } from "react/jsx-runtime";
302
+ import { forwardRef as forwardRef8 } from "react";
303
+ import { jsx as jsx7 } from "react/jsx-runtime";
290
304
  var defaultTag3 = "h1";
291
- var Heading = forwardRef7(
305
+ var Heading = forwardRef8(
292
306
  ({ tag = defaultTag3, children, ...props }, ref) => {
293
307
  const Tag = tag;
294
- return /* @__PURE__ */ jsx6(Tag, { ...props, ref, children });
308
+ return /* @__PURE__ */ jsx7(Tag, { ...props, ref, children });
295
309
  }
296
310
  );
297
311
  Heading.displayName = "Heading";
298
312
 
299
313
  // src/paragraph.tsx
300
- import { forwardRef as forwardRef8 } from "react";
301
- import { jsx as jsx7 } from "react/jsx-runtime";
302
- var Paragraph = forwardRef8(({ children, ...props }, ref) => /* @__PURE__ */ jsx7("p", { ...props, ref, children }));
314
+ import { forwardRef as forwardRef9 } from "react";
315
+ import { jsx as jsx8 } from "react/jsx-runtime";
316
+ var Paragraph = forwardRef9(({ children, ...props }, ref) => /* @__PURE__ */ jsx8("p", { ...props, ref, children }));
303
317
  Paragraph.displayName = "Paragraph";
304
318
 
305
319
  // src/link.tsx
306
- import { forwardRef as forwardRef9 } from "react";
307
- import { jsx as jsx8 } from "react/jsx-runtime";
308
- var Link = forwardRef9(
309
- ({ children, ...props }, ref) => {
310
- return /* @__PURE__ */ jsx8("a", { ...props, href: props.href ?? "#", ref, children });
311
- }
312
- );
320
+ import { forwardRef as forwardRef10 } from "react";
321
+ import { jsx as jsx9 } from "react/jsx-runtime";
322
+ var Link = forwardRef10((props, ref) => {
323
+ const {
324
+ children,
325
+ // @todo: it's a hack made for Image component for the builder and should't be in the runtime at all.
326
+ $webstudio$canvasOnly$assetId,
327
+ ...rest
328
+ } = props;
329
+ return /* @__PURE__ */ jsx9("a", { ...rest, href: rest.href ?? "#", ref, children });
330
+ });
313
331
  Link.displayName = "Link";
314
332
 
315
333
  // src/rich-text-link.tsx
316
- import { forwardRef as forwardRef10 } from "react";
317
- import { jsx as jsx9 } from "react/jsx-runtime";
318
- var RichTextLink = forwardRef10((props, ref) => /* @__PURE__ */ jsx9(Link, { ...props, ref }));
334
+ import { forwardRef as forwardRef11 } from "react";
335
+ import { jsx as jsx10 } from "react/jsx-runtime";
336
+ var RichTextLink = forwardRef11((props, ref) => /* @__PURE__ */ jsx10(Link, { ...props, ref }));
319
337
  RichTextLink.displayName = "RichTextLink";
320
338
 
321
339
  // src/span.tsx
322
- import { forwardRef as forwardRef11 } from "react";
323
- import { jsx as jsx10 } from "react/jsx-runtime";
324
- var Span = forwardRef11((props, ref) => /* @__PURE__ */ jsx10("span", { ...props, ref }));
340
+ import { forwardRef as forwardRef12 } from "react";
341
+ import { jsx as jsx11 } from "react/jsx-runtime";
342
+ var Span = forwardRef12((props, ref) => /* @__PURE__ */ jsx11("span", { ...props, ref }));
325
343
  Span.displayName = "Span";
326
344
 
327
345
  // src/bold.tsx
328
- import { forwardRef as forwardRef12 } from "react";
329
- import { jsx as jsx11 } from "react/jsx-runtime";
330
- var Bold = forwardRef12((props, ref) => /* @__PURE__ */ jsx11("b", { ...props, ref }));
346
+ import { forwardRef as forwardRef13 } from "react";
347
+ import { jsx as jsx12 } from "react/jsx-runtime";
348
+ var Bold = forwardRef13((props, ref) => /* @__PURE__ */ jsx12("b", { ...props, ref }));
331
349
  Bold.displayName = "Bold";
332
350
 
333
351
  // src/italic.tsx
334
- import { forwardRef as forwardRef13 } from "react";
335
- import { jsx as jsx12 } from "react/jsx-runtime";
336
- var Italic = forwardRef13((props, ref) => /* @__PURE__ */ jsx12("i", { ...props, ref }));
352
+ import { forwardRef as forwardRef14 } from "react";
353
+ import { jsx as jsx13 } from "react/jsx-runtime";
354
+ var Italic = forwardRef14((props, ref) => /* @__PURE__ */ jsx13("i", { ...props, ref }));
337
355
  Italic.displayName = "Italic";
338
356
 
339
357
  // src/superscript.tsx
340
- import { forwardRef as forwardRef14 } from "react";
341
- import { jsx as jsx13 } from "react/jsx-runtime";
342
- var Superscript = forwardRef14((props, ref) => /* @__PURE__ */ jsx13("sup", { ...props, ref }));
358
+ import { forwardRef as forwardRef15 } from "react";
359
+ import { jsx as jsx14 } from "react/jsx-runtime";
360
+ var Superscript = forwardRef15((props, ref) => /* @__PURE__ */ jsx14("sup", { ...props, ref }));
343
361
  Superscript.displayName = "Bold";
344
362
 
345
363
  // src/subscript.tsx
346
- import { forwardRef as forwardRef15 } from "react";
347
- import { jsx as jsx14 } from "react/jsx-runtime";
348
- var Subscript = forwardRef15((props, ref) => /* @__PURE__ */ jsx14("sub", { ...props, ref }));
364
+ import { forwardRef as forwardRef16 } from "react";
365
+ import { jsx as jsx15 } from "react/jsx-runtime";
366
+ var Subscript = forwardRef16((props, ref) => /* @__PURE__ */ jsx15("sub", { ...props, ref }));
349
367
  Subscript.displayName = "Subscript";
350
368
 
351
369
  // src/button.tsx
352
- import { forwardRef as forwardRef16 } from "react";
353
- import { jsx as jsx15 } from "react/jsx-runtime";
354
- var Button = forwardRef16(
355
- ({ type = "submit", children, ...props }, ref) => /* @__PURE__ */ jsx15("button", { type, ...props, ref, children })
370
+ import { forwardRef as forwardRef17 } from "react";
371
+ import { jsx as jsx16 } from "react/jsx-runtime";
372
+ var Button = forwardRef17(
373
+ ({ type = "submit", children, ...props }, ref) => /* @__PURE__ */ jsx16("button", { type, ...props, ref, children })
356
374
  );
357
375
  Button.displayName = "Button";
358
376
 
359
377
  // src/input.tsx
360
- import { forwardRef as forwardRef17 } from "react";
361
- import { jsx as jsx16 } from "react/jsx-runtime";
362
- var Input = forwardRef17(({ children: _children, type = "text", ...props }, ref) => /* @__PURE__ */ jsx16("input", { ...props, type, ref }));
378
+ import { forwardRef as forwardRef18 } from "react";
379
+ import { jsx as jsx17 } from "react/jsx-runtime";
380
+ var Input = forwardRef18(
381
+ ({ children: _children, type = "text", value, defaultValue, ...props }, ref) => /* @__PURE__ */ jsx17(
382
+ "input",
383
+ {
384
+ ...props,
385
+ defaultValue: value ?? defaultValue,
386
+ type,
387
+ ref
388
+ }
389
+ )
390
+ );
363
391
  Input.displayName = "Input";
364
392
 
365
393
  // src/form.tsx
366
- import { forwardRef as forwardRef18 } from "react";
367
- import { jsx as jsx17 } from "react/jsx-runtime";
368
- var Form = forwardRef18(({ children, ...props }, ref) => /* @__PURE__ */ jsx17("form", { ...props, ref, children }));
394
+ import { forwardRef as forwardRef19 } from "react";
395
+ import { jsx as jsx18 } from "react/jsx-runtime";
396
+ var Form = forwardRef19(({ children, ...props }, ref) => /* @__PURE__ */ jsx18("form", { ...props, ref, children }));
369
397
  Form.displayName = "Form";
370
398
 
371
399
  // src/image.tsx
372
400
  import {
373
- forwardRef as forwardRef19,
401
+ forwardRef as forwardRef20,
374
402
  useContext as useContext2
375
403
  } from "react";
376
404
  import { Image as WebstudioImage } from "@webstudio-is/image";
377
- import { ReactSdkContext as ReactSdkContext2 } from "@webstudio-is/react-sdk";
378
- import { jsx as jsx18 } from "react/jsx-runtime";
379
- var Image = forwardRef19(
405
+ import { ReactSdkContext as ReactSdkContext2 } from "@webstudio-is/react-sdk/runtime";
406
+ import { jsx as jsx19 } from "react/jsx-runtime";
407
+ var Image = forwardRef20(
380
408
  ({
381
409
  loading = "lazy",
382
410
  width,
383
411
  height,
384
412
  optimize = true,
385
413
  decoding: decodingProp,
414
+ // @todo: it's a hack made for the builder and should't be in the runtime at all.
386
415
  $webstudio$canvasOnly$assetId,
387
416
  ...props
388
417
  }, ref) => {
@@ -404,15 +433,7 @@ var Image = forwardRef19(
404
433
  if (src.startsWith(assetBaseUrl)) {
405
434
  assetName = src.slice(assetBaseUrl.length);
406
435
  }
407
- console.info(
408
- "assetName",
409
- assetName,
410
- "src",
411
- src,
412
- "assetBaseUrl",
413
- assetBaseUrl
414
- );
415
- return /* @__PURE__ */ jsx18(
436
+ return /* @__PURE__ */ jsx19(
416
437
  WebstudioImage,
417
438
  {
418
439
  loading,
@@ -432,45 +453,45 @@ var Image = forwardRef19(
432
453
  Image.displayName = "Image";
433
454
 
434
455
  // src/blockquote.tsx
435
- import { forwardRef as forwardRef20 } from "react";
436
- import { jsx as jsx19 } from "react/jsx-runtime";
437
- var Blockquote = forwardRef20(
456
+ import { forwardRef as forwardRef21 } from "react";
457
+ import { jsx as jsx20 } from "react/jsx-runtime";
458
+ var Blockquote = forwardRef21(
438
459
  ({ children, ...props }, ref) => {
439
- return /* @__PURE__ */ jsx19("blockquote", { ...props, ref, children });
460
+ return /* @__PURE__ */ jsx20("blockquote", { ...props, ref, children });
440
461
  }
441
462
  );
442
463
  Blockquote.displayName = "Blockquote";
443
464
 
444
465
  // src/list.tsx
445
466
  import {
446
- forwardRef as forwardRef21,
467
+ forwardRef as forwardRef22,
447
468
  createElement as createElement2
448
469
  } from "react";
449
470
  var unorderedTag = "ul";
450
471
  var orderedTag = "ol";
451
- var List = forwardRef21(({ ordered = false, ...props }, ref) => {
472
+ var List = forwardRef22(({ ordered = false, ...props }, ref) => {
452
473
  const tag = ordered ? orderedTag : unorderedTag;
453
474
  return createElement2(tag, { ...props, ref });
454
475
  });
455
476
  List.displayName = "List";
456
477
 
457
478
  // src/list-item.tsx
458
- import { forwardRef as forwardRef22 } from "react";
459
- import { jsx as jsx20 } from "react/jsx-runtime";
460
- var ListItem = forwardRef22(
479
+ import { forwardRef as forwardRef23 } from "react";
480
+ import { jsx as jsx21 } from "react/jsx-runtime";
481
+ var ListItem = forwardRef23(
461
482
  ({ children, ...props }, ref) => {
462
- return /* @__PURE__ */ jsx20("li", { ...props, ref, children });
483
+ return /* @__PURE__ */ jsx21("li", { ...props, ref, children });
463
484
  }
464
485
  );
465
486
  ListItem.displayName = "ListItem";
466
487
 
467
488
  // src/separator.tsx
468
489
  import {
469
- forwardRef as forwardRef23,
490
+ forwardRef as forwardRef24,
470
491
  createElement as createElement3
471
492
  } from "react";
472
493
  var defaultTag4 = "hr";
473
- var Separator = forwardRef23(
494
+ var Separator = forwardRef24(
474
495
  (props, ref) => {
475
496
  return createElement3(defaultTag4, { ...props, ref });
476
497
  }
@@ -479,60 +500,76 @@ Separator.displayName = "Separator";
479
500
 
480
501
  // src/code-text.tsx
481
502
  import {
482
- forwardRef as forwardRef24
503
+ forwardRef as forwardRef25
483
504
  } from "react";
484
- import { jsx as jsx21 } from "react/jsx-runtime";
505
+ import { jsx as jsx22 } from "react/jsx-runtime";
485
506
  var Placeholder2 = ({
486
507
  innerRef,
487
508
  ...rest
488
509
  }) => {
489
- return /* @__PURE__ */ jsx21("code", { ...rest, style: { padding: 20 }, ref: innerRef, children: `Open the "Settings" panel to edit the code.` });
510
+ return /* @__PURE__ */ jsx22("code", { ...rest, style: { padding: 20 }, ref: innerRef, children: `Open the "Settings" panel to edit the code.` });
490
511
  };
491
- var CodeText = forwardRef24(({ code, children, ...props }, ref) => {
512
+ var CodeText = forwardRef25(({ code, children, ...props }, ref) => {
492
513
  if (children === void 0 && code === void 0 || String(code).trim().length === 0) {
493
- return /* @__PURE__ */ jsx21(Placeholder2, { innerRef: ref, ...props });
514
+ return /* @__PURE__ */ jsx22(Placeholder2, { innerRef: ref, ...props });
494
515
  }
495
- return /* @__PURE__ */ jsx21("code", { ...props, ref, children: code ?? children });
516
+ return /* @__PURE__ */ jsx22("code", { ...props, ref, children: code ?? children });
496
517
  });
497
518
  CodeText.displayName = "CodeText";
498
519
 
499
520
  // src/label.tsx
500
- import { forwardRef as forwardRef25 } from "react";
501
- import { jsx as jsx22 } from "react/jsx-runtime";
502
- var Label = forwardRef25((props, ref) => /* @__PURE__ */ jsx22("label", { ...props, ref }));
521
+ import { forwardRef as forwardRef26 } from "react";
522
+ import { jsx as jsx23 } from "react/jsx-runtime";
523
+ var Label = forwardRef26((props, ref) => /* @__PURE__ */ jsx23("label", { ...props, ref }));
503
524
  Label.displayName = "Label";
504
525
 
505
526
  // src/textarea.tsx
506
- import { forwardRef as forwardRef26 } from "react";
507
- import { jsx as jsx23 } from "react/jsx-runtime";
508
- var Textarea = forwardRef26(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx23("textarea", { ...props, ref }));
527
+ import { forwardRef as forwardRef27 } from "react";
528
+ import { jsx as jsx24 } from "react/jsx-runtime";
529
+ var Textarea = forwardRef27(({ children: _children, value, defaultValue, ...props }, ref) => /* @__PURE__ */ jsx24("textarea", { ...props, defaultValue: value ?? defaultValue, ref }));
509
530
  Textarea.displayName = "Textarea";
510
531
 
511
532
  // src/radio-button.tsx
512
- import { forwardRef as forwardRef27 } from "react";
513
- import { jsx as jsx24 } from "react/jsx-runtime";
514
- var RadioButton = forwardRef27(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx24("input", { ...props, type: "radio", ref }));
533
+ import { forwardRef as forwardRef28 } from "react";
534
+ import { jsx as jsx25 } from "react/jsx-runtime";
535
+ var RadioButton = forwardRef28(({ children: _children, checked, defaultChecked, ...props }, ref) => /* @__PURE__ */ jsx25(
536
+ "input",
537
+ {
538
+ ...props,
539
+ defaultChecked: checked ?? defaultChecked,
540
+ type: "radio",
541
+ ref
542
+ }
543
+ ));
515
544
  RadioButton.displayName = "RadioButton";
516
545
 
517
546
  // src/checkbox.tsx
518
- import { forwardRef as forwardRef28 } from "react";
519
- import { jsx as jsx25 } from "react/jsx-runtime";
520
- var Checkbox = forwardRef28(({ children: _children, ...props }, ref) => {
521
- return /* @__PURE__ */ jsx25("input", { ...props, type: "checkbox", ref });
547
+ import { forwardRef as forwardRef29 } from "react";
548
+ import { jsx as jsx26 } from "react/jsx-runtime";
549
+ var Checkbox = forwardRef29(({ children: _children, checked, defaultChecked, ...props }, ref) => {
550
+ return /* @__PURE__ */ jsx26(
551
+ "input",
552
+ {
553
+ ...props,
554
+ defaultChecked: checked ?? defaultChecked,
555
+ type: "checkbox",
556
+ ref
557
+ }
558
+ );
522
559
  });
523
560
  Checkbox.displayName = "Checkbox";
524
561
 
525
562
  // src/vimeo.tsx
526
563
  import { colord } from "colord";
527
564
  import {
528
- forwardRef as forwardRef29,
565
+ forwardRef as forwardRef30,
529
566
  useState as useState2,
530
567
  useEffect as useEffect2,
531
568
  useContext as useContext3,
532
569
  createContext
533
570
  } from "react";
534
- import { ReactSdkContext as ReactSdkContext3 } from "@webstudio-is/react-sdk";
535
- import { Fragment as Fragment2, jsx as jsx26, jsxs } from "react/jsx-runtime";
571
+ import { ReactSdkContext as ReactSdkContext3 } from "@webstudio-is/react-sdk/runtime";
572
+ import { Fragment as Fragment2, jsx as jsx27, jsxs } from "react/jsx-runtime";
536
573
  var getVideoUrl = (options) => {
537
574
  if (options.url === void 0) {
538
575
  return;
@@ -628,7 +665,7 @@ var loadPreviewImageUrl = async (videoUrl) => {
628
665
  return imageUrl;
629
666
  };
630
667
  var EmptyState = () => {
631
- return /* @__PURE__ */ jsx26(
668
+ return /* @__PURE__ */ jsx27(
632
669
  "div",
633
670
  {
634
671
  style: {
@@ -682,7 +719,7 @@ var Player = ({
682
719
  if (renderer === "canvas" || status === "initial") {
683
720
  return;
684
721
  }
685
- return /* @__PURE__ */ jsx26(
722
+ return /* @__PURE__ */ jsx27(
686
723
  "iframe",
687
724
  {
688
725
  src: videoUrl,
@@ -705,12 +742,11 @@ var Player = ({
705
742
  );
706
743
  };
707
744
  var VimeoContext = createContext({
708
- // eslint-disable-next-line @typescript-eslint/no-empty-function
709
745
  onInitPlayer: () => {
710
746
  },
711
747
  status: "initial"
712
748
  });
713
- var Vimeo = forwardRef29(
749
+ var Vimeo = forwardRef30(
714
750
  ({
715
751
  url,
716
752
  loading = "lazy",
@@ -765,7 +801,7 @@ var Vimeo = forwardRef29(
765
801
  showPortrait,
766
802
  autopip
767
803
  });
768
- return /* @__PURE__ */ jsx26(
804
+ return /* @__PURE__ */ jsx27(
769
805
  VimeoContext.Provider,
770
806
  {
771
807
  value: {
@@ -777,7 +813,7 @@ var Vimeo = forwardRef29(
777
813
  }
778
814
  }
779
815
  },
780
- children: /* @__PURE__ */ jsx26(
816
+ children: /* @__PURE__ */ jsx27(
781
817
  "div",
782
818
  {
783
819
  ...rest,
@@ -786,9 +822,9 @@ var Vimeo = forwardRef29(
786
822
  typeof ref === "function" ? ref(value) : ref.current = value;
787
823
  }
788
824
  },
789
- children: videoUrl === void 0 ? /* @__PURE__ */ jsx26(EmptyState, {}) : /* @__PURE__ */ jsxs(Fragment2, { children: [
825
+ children: videoUrl === void 0 ? /* @__PURE__ */ jsx27(EmptyState, {}) : /* @__PURE__ */ jsxs(Fragment2, { children: [
790
826
  children,
791
- /* @__PURE__ */ jsx26(
827
+ /* @__PURE__ */ jsx27(
792
828
  Player,
793
829
  {
794
830
  autoplay,
@@ -813,14 +849,14 @@ Vimeo.displayName = "Vimeo";
813
849
 
814
850
  // src/vimeo-preview-image.tsx
815
851
  import {
816
- forwardRef as forwardRef30,
852
+ forwardRef as forwardRef31,
817
853
  useContext as useContext4
818
854
  } from "react";
819
- import { jsx as jsx27 } from "react/jsx-runtime";
855
+ import { jsx as jsx28 } from "react/jsx-runtime";
820
856
  var base64Preview = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=`;
821
- var VimeoPreviewImage = forwardRef30(({ src, ...rest }, ref) => {
857
+ var VimeoPreviewImage = forwardRef31(({ src, ...rest }, ref) => {
822
858
  const vimeoContext = useContext4(VimeoContext);
823
- return /* @__PURE__ */ jsx27(
859
+ return /* @__PURE__ */ jsx28(
824
860
  Image,
825
861
  {
826
862
  ...rest,
@@ -833,50 +869,48 @@ VimeoPreviewImage.displayName = "VimeoPreviewImage";
833
869
 
834
870
  // src/vimeo-play-button.tsx
835
871
  import {
836
- forwardRef as forwardRef31,
872
+ forwardRef as forwardRef32,
837
873
  useContext as useContext5
838
874
  } from "react";
839
- import { jsx as jsx28 } from "react/jsx-runtime";
840
- var VimeoPlayButton = forwardRef31(
875
+ import { jsx as jsx29 } from "react/jsx-runtime";
876
+ var VimeoPlayButton = forwardRef32(
841
877
  (props, ref) => {
842
878
  const vimeoContext = useContext5(VimeoContext);
843
879
  if (vimeoContext.status !== "initial") {
844
880
  return;
845
881
  }
846
- return /* @__PURE__ */ jsx28(Button, { ...props, onClick: vimeoContext.onInitPlayer, ref });
882
+ return /* @__PURE__ */ jsx29(Button, { ...props, onClick: vimeoContext.onInitPlayer, ref });
847
883
  }
848
884
  );
849
885
  VimeoPlayButton.displayName = "VimeoPlayButton";
850
886
 
851
887
  // src/vimeo-spinner.tsx
852
888
  import {
853
- forwardRef as forwardRef32,
889
+ forwardRef as forwardRef33,
854
890
  useContext as useContext6
855
891
  } from "react";
856
- import { jsx as jsx29 } from "react/jsx-runtime";
857
- var VimeoSpinner = forwardRef32(
892
+ import { jsx as jsx30 } from "react/jsx-runtime";
893
+ var VimeoSpinner = forwardRef33(
858
894
  (props, ref) => {
859
895
  const vimeoContext = useContext6(VimeoContext);
860
896
  if (vimeoContext.status !== "loading") {
861
897
  return;
862
898
  }
863
- return /* @__PURE__ */ jsx29("div", { ...props, ref });
899
+ return /* @__PURE__ */ jsx30("div", { ...props, ref });
864
900
  }
865
901
  );
866
902
  VimeoSpinner.displayName = "VimeoSpinner";
867
903
 
868
904
  // src/xml-node.tsx
869
- import {
870
- ReactSdkContext as ReactSdkContext4
871
- } from "@webstudio-is/react-sdk";
905
+ import { ReactSdkContext as ReactSdkContext4 } from "@webstudio-is/react-sdk/runtime";
872
906
  import {
873
907
  Children,
874
908
  createElement as createElement4,
875
- forwardRef as forwardRef33,
909
+ forwardRef as forwardRef34,
876
910
  useContext as useContext7
877
911
  } from "react";
878
- import { jsx as jsx30, jsxs as jsxs2 } from "react/jsx-runtime";
879
- var XmlNode = forwardRef33(
912
+ import { jsx as jsx31, jsxs as jsxs2 } from "react/jsx-runtime";
913
+ var XmlNode = forwardRef34(
880
914
  ({ tag = "", children, ...props }, ref) => {
881
915
  const { renderer } = useContext7(ReactSdkContext4);
882
916
  const attributeEntries = Object.entries(props).filter(
@@ -899,7 +933,7 @@ var XmlNode = forwardRef33(
899
933
  [elementName, ...attributes].join(" "),
900
934
  ">"
901
935
  ] }),
902
- /* @__PURE__ */ jsx30("div", { ref, style: { marginLeft: isTextChild ? 0 : "1rem" }, children }),
936
+ /* @__PURE__ */ jsx31("div", { ref, style: { marginLeft: isTextChild ? 0 : "1rem" }, children }),
903
937
  /* @__PURE__ */ jsxs2("div", { style: { color: "rgb(16, 23, 233)" }, children: [
904
938
  "</",
905
939
  elementName,
@@ -911,8 +945,8 @@ var XmlNode = forwardRef33(
911
945
  XmlNode.displayName = "XmlNode";
912
946
 
913
947
  // src/time.tsx
914
- import * as React from "react";
915
- import { jsx as jsx31 } from "react/jsx-runtime";
948
+ import { forwardRef as forwardRef35 } from "react";
949
+ import { jsx as jsx32 } from "react/jsx-runtime";
916
950
  var languages = [
917
951
  "af",
918
952
  "am",
@@ -1211,7 +1245,26 @@ var timeStyleOrUndefined = (value) => {
1211
1245
  }
1212
1246
  return void 0;
1213
1247
  };
1214
- var Time = React.forwardRef(
1248
+ var parseDate = (datetimeString) => {
1249
+ if (datetimeString === "") {
1250
+ return;
1251
+ }
1252
+ let date = new Date(datetimeString);
1253
+ if (Number.isNaN(date.getTime()) === false) {
1254
+ return date;
1255
+ }
1256
+ if (/^\d+$/.test(datetimeString)) {
1257
+ let timestamp = Number(datetimeString);
1258
+ if (datetimeString.length === 10) {
1259
+ timestamp *= 1e3;
1260
+ }
1261
+ date = new Date(timestamp);
1262
+ }
1263
+ if (Number.isNaN(date.getTime()) === false) {
1264
+ return date;
1265
+ }
1266
+ };
1267
+ var Time = forwardRef35(
1215
1268
  ({
1216
1269
  language = DEFAULT_LANGUAGE,
1217
1270
  country = DEFAULT_COUNTRY,
@@ -1228,16 +1281,15 @@ var Time = React.forwardRef(
1228
1281
  timeStyle: timeStyleOrUndefined(timeStyle)
1229
1282
  };
1230
1283
  const datetimeString = datetime === null ? INVALID_DATE_STRING : datetime.toString();
1231
- const date = new Date(datetimeString);
1232
- const isValidDate = false === Number.isNaN(date.getTime());
1284
+ const date = parseDate(datetimeString);
1233
1285
  let formattedDate = datetimeString;
1234
- if (isValidDate) {
1286
+ if (date) {
1235
1287
  try {
1236
1288
  formattedDate = new Intl.DateTimeFormat(locale, options).format(date);
1237
1289
  } catch {
1238
1290
  }
1239
1291
  }
1240
- return /* @__PURE__ */ jsx31("time", { ref, dateTime: datetimeString, ...props, children: formattedDate });
1292
+ return /* @__PURE__ */ jsx32("time", { ref, dateTime: datetimeString, ...props, children: formattedDate });
1241
1293
  }
1242
1294
  );
1243
1295
 
@@ -1245,16 +1297,16 @@ var Time = React.forwardRef(
1245
1297
  import {
1246
1298
  getClosestInstance,
1247
1299
  getInstanceSelectorById
1248
- } from "@webstudio-is/react-sdk";
1249
- import { forwardRef as forwardRef35 } from "react";
1250
- import { jsx as jsx32 } from "react/jsx-runtime";
1251
- var Select = forwardRef35((props, ref) => /* @__PURE__ */ jsx32("select", { ...props, ref }));
1300
+ } from "@webstudio-is/react-sdk/runtime";
1301
+ import { forwardRef as forwardRef36 } from "react";
1302
+ import { jsx as jsx33 } from "react/jsx-runtime";
1303
+ var Select = forwardRef36(({ value, defaultValue, ...props }, ref) => /* @__PURE__ */ jsx33("select", { ...props, defaultValue: value ?? defaultValue, ref }));
1252
1304
  Select.displayName = "Select";
1253
1305
 
1254
1306
  // src/option.tsx
1255
- import { forwardRef as forwardRef36 } from "react";
1256
- import { jsx as jsx33 } from "react/jsx-runtime";
1257
- var Option = forwardRef36((props, ref) => /* @__PURE__ */ jsx33("option", { ...props, ref }));
1307
+ import { forwardRef as forwardRef37 } from "react";
1308
+ import { jsx as jsx34 } from "react/jsx-runtime";
1309
+ var Option = forwardRef37((props, ref) => /* @__PURE__ */ jsx34("option", { ...props, ref }));
1258
1310
  Option.displayName = "Option";
1259
1311
  export {
1260
1312
  Blockquote,
@@ -1275,9 +1327,11 @@ export {
1275
1327
  Link,
1276
1328
  List,
1277
1329
  ListItem,
1330
+ MarkdownEmbed,
1278
1331
  Option,
1279
1332
  Paragraph,
1280
1333
  RadioButton,
1334
+ Form as RemixForm,
1281
1335
  RichTextLink,
1282
1336
  Select,
1283
1337
  Separator,