@webstudio-is/sdk-components-react 0.174.0 → 0.175.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,121 @@ 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(({ children: _children, type = "text", ...props }, ref) => /* @__PURE__ */ jsx17("input", { ...props, type, ref }));
363
381
  Input.displayName = "Input";
364
382
 
365
383
  // 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 }));
384
+ import { forwardRef as forwardRef19 } from "react";
385
+ import { jsx as jsx18 } from "react/jsx-runtime";
386
+ var Form = forwardRef19(({ children, ...props }, ref) => /* @__PURE__ */ jsx18("form", { ...props, ref, children }));
369
387
  Form.displayName = "Form";
370
388
 
371
389
  // src/image.tsx
372
390
  import {
373
- forwardRef as forwardRef19,
391
+ forwardRef as forwardRef20,
374
392
  useContext as useContext2
375
393
  } from "react";
376
394
  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(
395
+ import { ReactSdkContext as ReactSdkContext2 } from "@webstudio-is/react-sdk/runtime";
396
+ import { jsx as jsx19 } from "react/jsx-runtime";
397
+ var Image = forwardRef20(
380
398
  ({
381
399
  loading = "lazy",
382
400
  width,
383
401
  height,
384
402
  optimize = true,
385
403
  decoding: decodingProp,
404
+ // @todo: it's a hack made for the builder and should't be in the runtime at all.
386
405
  $webstudio$canvasOnly$assetId,
387
406
  ...props
388
407
  }, ref) => {
@@ -404,15 +423,7 @@ var Image = forwardRef19(
404
423
  if (src.startsWith(assetBaseUrl)) {
405
424
  assetName = src.slice(assetBaseUrl.length);
406
425
  }
407
- console.info(
408
- "assetName",
409
- assetName,
410
- "src",
411
- src,
412
- "assetBaseUrl",
413
- assetBaseUrl
414
- );
415
- return /* @__PURE__ */ jsx18(
426
+ return /* @__PURE__ */ jsx19(
416
427
  WebstudioImage,
417
428
  {
418
429
  loading,
@@ -432,45 +443,45 @@ var Image = forwardRef19(
432
443
  Image.displayName = "Image";
433
444
 
434
445
  // src/blockquote.tsx
435
- import { forwardRef as forwardRef20 } from "react";
436
- import { jsx as jsx19 } from "react/jsx-runtime";
437
- var Blockquote = forwardRef20(
446
+ import { forwardRef as forwardRef21 } from "react";
447
+ import { jsx as jsx20 } from "react/jsx-runtime";
448
+ var Blockquote = forwardRef21(
438
449
  ({ children, ...props }, ref) => {
439
- return /* @__PURE__ */ jsx19("blockquote", { ...props, ref, children });
450
+ return /* @__PURE__ */ jsx20("blockquote", { ...props, ref, children });
440
451
  }
441
452
  );
442
453
  Blockquote.displayName = "Blockquote";
443
454
 
444
455
  // src/list.tsx
445
456
  import {
446
- forwardRef as forwardRef21,
457
+ forwardRef as forwardRef22,
447
458
  createElement as createElement2
448
459
  } from "react";
449
460
  var unorderedTag = "ul";
450
461
  var orderedTag = "ol";
451
- var List = forwardRef21(({ ordered = false, ...props }, ref) => {
462
+ var List = forwardRef22(({ ordered = false, ...props }, ref) => {
452
463
  const tag = ordered ? orderedTag : unorderedTag;
453
464
  return createElement2(tag, { ...props, ref });
454
465
  });
455
466
  List.displayName = "List";
456
467
 
457
468
  // src/list-item.tsx
458
- import { forwardRef as forwardRef22 } from "react";
459
- import { jsx as jsx20 } from "react/jsx-runtime";
460
- var ListItem = forwardRef22(
469
+ import { forwardRef as forwardRef23 } from "react";
470
+ import { jsx as jsx21 } from "react/jsx-runtime";
471
+ var ListItem = forwardRef23(
461
472
  ({ children, ...props }, ref) => {
462
- return /* @__PURE__ */ jsx20("li", { ...props, ref, children });
473
+ return /* @__PURE__ */ jsx21("li", { ...props, ref, children });
463
474
  }
464
475
  );
465
476
  ListItem.displayName = "ListItem";
466
477
 
467
478
  // src/separator.tsx
468
479
  import {
469
- forwardRef as forwardRef23,
480
+ forwardRef as forwardRef24,
470
481
  createElement as createElement3
471
482
  } from "react";
472
483
  var defaultTag4 = "hr";
473
- var Separator = forwardRef23(
484
+ var Separator = forwardRef24(
474
485
  (props, ref) => {
475
486
  return createElement3(defaultTag4, { ...props, ref });
476
487
  }
@@ -479,60 +490,60 @@ Separator.displayName = "Separator";
479
490
 
480
491
  // src/code-text.tsx
481
492
  import {
482
- forwardRef as forwardRef24
493
+ forwardRef as forwardRef25
483
494
  } from "react";
484
- import { jsx as jsx21 } from "react/jsx-runtime";
495
+ import { jsx as jsx22 } from "react/jsx-runtime";
485
496
  var Placeholder2 = ({
486
497
  innerRef,
487
498
  ...rest
488
499
  }) => {
489
- return /* @__PURE__ */ jsx21("code", { ...rest, style: { padding: 20 }, ref: innerRef, children: `Open the "Settings" panel to edit the code.` });
500
+ return /* @__PURE__ */ jsx22("code", { ...rest, style: { padding: 20 }, ref: innerRef, children: `Open the "Settings" panel to edit the code.` });
490
501
  };
491
- var CodeText = forwardRef24(({ code, children, ...props }, ref) => {
502
+ var CodeText = forwardRef25(({ code, children, ...props }, ref) => {
492
503
  if (children === void 0 && code === void 0 || String(code).trim().length === 0) {
493
- return /* @__PURE__ */ jsx21(Placeholder2, { innerRef: ref, ...props });
504
+ return /* @__PURE__ */ jsx22(Placeholder2, { innerRef: ref, ...props });
494
505
  }
495
- return /* @__PURE__ */ jsx21("code", { ...props, ref, children: code ?? children });
506
+ return /* @__PURE__ */ jsx22("code", { ...props, ref, children: code ?? children });
496
507
  });
497
508
  CodeText.displayName = "CodeText";
498
509
 
499
510
  // 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 }));
511
+ import { forwardRef as forwardRef26 } from "react";
512
+ import { jsx as jsx23 } from "react/jsx-runtime";
513
+ var Label = forwardRef26((props, ref) => /* @__PURE__ */ jsx23("label", { ...props, ref }));
503
514
  Label.displayName = "Label";
504
515
 
505
516
  // 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 }));
517
+ import { forwardRef as forwardRef27 } from "react";
518
+ import { jsx as jsx24 } from "react/jsx-runtime";
519
+ var Textarea = forwardRef27(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx24("textarea", { ...props, ref }));
509
520
  Textarea.displayName = "Textarea";
510
521
 
511
522
  // 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 }));
523
+ import { forwardRef as forwardRef28 } from "react";
524
+ import { jsx as jsx25 } from "react/jsx-runtime";
525
+ var RadioButton = forwardRef28(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx25("input", { ...props, type: "radio", ref }));
515
526
  RadioButton.displayName = "RadioButton";
516
527
 
517
528
  // 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 });
529
+ import { forwardRef as forwardRef29 } from "react";
530
+ import { jsx as jsx26 } from "react/jsx-runtime";
531
+ var Checkbox = forwardRef29(({ children: _children, ...props }, ref) => {
532
+ return /* @__PURE__ */ jsx26("input", { ...props, type: "checkbox", ref });
522
533
  });
523
534
  Checkbox.displayName = "Checkbox";
524
535
 
525
536
  // src/vimeo.tsx
526
537
  import { colord } from "colord";
527
538
  import {
528
- forwardRef as forwardRef29,
539
+ forwardRef as forwardRef30,
529
540
  useState as useState2,
530
541
  useEffect as useEffect2,
531
542
  useContext as useContext3,
532
543
  createContext
533
544
  } 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";
545
+ import { ReactSdkContext as ReactSdkContext3 } from "@webstudio-is/react-sdk/runtime";
546
+ import { Fragment as Fragment2, jsx as jsx27, jsxs } from "react/jsx-runtime";
536
547
  var getVideoUrl = (options) => {
537
548
  if (options.url === void 0) {
538
549
  return;
@@ -628,7 +639,7 @@ var loadPreviewImageUrl = async (videoUrl) => {
628
639
  return imageUrl;
629
640
  };
630
641
  var EmptyState = () => {
631
- return /* @__PURE__ */ jsx26(
642
+ return /* @__PURE__ */ jsx27(
632
643
  "div",
633
644
  {
634
645
  style: {
@@ -682,7 +693,7 @@ var Player = ({
682
693
  if (renderer === "canvas" || status === "initial") {
683
694
  return;
684
695
  }
685
- return /* @__PURE__ */ jsx26(
696
+ return /* @__PURE__ */ jsx27(
686
697
  "iframe",
687
698
  {
688
699
  src: videoUrl,
@@ -705,12 +716,11 @@ var Player = ({
705
716
  );
706
717
  };
707
718
  var VimeoContext = createContext({
708
- // eslint-disable-next-line @typescript-eslint/no-empty-function
709
719
  onInitPlayer: () => {
710
720
  },
711
721
  status: "initial"
712
722
  });
713
- var Vimeo = forwardRef29(
723
+ var Vimeo = forwardRef30(
714
724
  ({
715
725
  url,
716
726
  loading = "lazy",
@@ -765,7 +775,7 @@ var Vimeo = forwardRef29(
765
775
  showPortrait,
766
776
  autopip
767
777
  });
768
- return /* @__PURE__ */ jsx26(
778
+ return /* @__PURE__ */ jsx27(
769
779
  VimeoContext.Provider,
770
780
  {
771
781
  value: {
@@ -777,7 +787,7 @@ var Vimeo = forwardRef29(
777
787
  }
778
788
  }
779
789
  },
780
- children: /* @__PURE__ */ jsx26(
790
+ children: /* @__PURE__ */ jsx27(
781
791
  "div",
782
792
  {
783
793
  ...rest,
@@ -786,9 +796,9 @@ var Vimeo = forwardRef29(
786
796
  typeof ref === "function" ? ref(value) : ref.current = value;
787
797
  }
788
798
  },
789
- children: videoUrl === void 0 ? /* @__PURE__ */ jsx26(EmptyState, {}) : /* @__PURE__ */ jsxs(Fragment2, { children: [
799
+ children: videoUrl === void 0 ? /* @__PURE__ */ jsx27(EmptyState, {}) : /* @__PURE__ */ jsxs(Fragment2, { children: [
790
800
  children,
791
- /* @__PURE__ */ jsx26(
801
+ /* @__PURE__ */ jsx27(
792
802
  Player,
793
803
  {
794
804
  autoplay,
@@ -813,14 +823,14 @@ Vimeo.displayName = "Vimeo";
813
823
 
814
824
  // src/vimeo-preview-image.tsx
815
825
  import {
816
- forwardRef as forwardRef30,
826
+ forwardRef as forwardRef31,
817
827
  useContext as useContext4
818
828
  } from "react";
819
- import { jsx as jsx27 } from "react/jsx-runtime";
829
+ import { jsx as jsx28 } from "react/jsx-runtime";
820
830
  var base64Preview = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=`;
821
- var VimeoPreviewImage = forwardRef30(({ src, ...rest }, ref) => {
831
+ var VimeoPreviewImage = forwardRef31(({ src, ...rest }, ref) => {
822
832
  const vimeoContext = useContext4(VimeoContext);
823
- return /* @__PURE__ */ jsx27(
833
+ return /* @__PURE__ */ jsx28(
824
834
  Image,
825
835
  {
826
836
  ...rest,
@@ -833,50 +843,48 @@ VimeoPreviewImage.displayName = "VimeoPreviewImage";
833
843
 
834
844
  // src/vimeo-play-button.tsx
835
845
  import {
836
- forwardRef as forwardRef31,
846
+ forwardRef as forwardRef32,
837
847
  useContext as useContext5
838
848
  } from "react";
839
- import { jsx as jsx28 } from "react/jsx-runtime";
840
- var VimeoPlayButton = forwardRef31(
849
+ import { jsx as jsx29 } from "react/jsx-runtime";
850
+ var VimeoPlayButton = forwardRef32(
841
851
  (props, ref) => {
842
852
  const vimeoContext = useContext5(VimeoContext);
843
853
  if (vimeoContext.status !== "initial") {
844
854
  return;
845
855
  }
846
- return /* @__PURE__ */ jsx28(Button, { ...props, onClick: vimeoContext.onInitPlayer, ref });
856
+ return /* @__PURE__ */ jsx29(Button, { ...props, onClick: vimeoContext.onInitPlayer, ref });
847
857
  }
848
858
  );
849
859
  VimeoPlayButton.displayName = "VimeoPlayButton";
850
860
 
851
861
  // src/vimeo-spinner.tsx
852
862
  import {
853
- forwardRef as forwardRef32,
863
+ forwardRef as forwardRef33,
854
864
  useContext as useContext6
855
865
  } from "react";
856
- import { jsx as jsx29 } from "react/jsx-runtime";
857
- var VimeoSpinner = forwardRef32(
866
+ import { jsx as jsx30 } from "react/jsx-runtime";
867
+ var VimeoSpinner = forwardRef33(
858
868
  (props, ref) => {
859
869
  const vimeoContext = useContext6(VimeoContext);
860
870
  if (vimeoContext.status !== "loading") {
861
871
  return;
862
872
  }
863
- return /* @__PURE__ */ jsx29("div", { ...props, ref });
873
+ return /* @__PURE__ */ jsx30("div", { ...props, ref });
864
874
  }
865
875
  );
866
876
  VimeoSpinner.displayName = "VimeoSpinner";
867
877
 
868
878
  // src/xml-node.tsx
869
- import {
870
- ReactSdkContext as ReactSdkContext4
871
- } from "@webstudio-is/react-sdk";
879
+ import { ReactSdkContext as ReactSdkContext4 } from "@webstudio-is/react-sdk/runtime";
872
880
  import {
873
881
  Children,
874
882
  createElement as createElement4,
875
- forwardRef as forwardRef33,
883
+ forwardRef as forwardRef34,
876
884
  useContext as useContext7
877
885
  } from "react";
878
- import { jsx as jsx30, jsxs as jsxs2 } from "react/jsx-runtime";
879
- var XmlNode = forwardRef33(
886
+ import { jsx as jsx31, jsxs as jsxs2 } from "react/jsx-runtime";
887
+ var XmlNode = forwardRef34(
880
888
  ({ tag = "", children, ...props }, ref) => {
881
889
  const { renderer } = useContext7(ReactSdkContext4);
882
890
  const attributeEntries = Object.entries(props).filter(
@@ -899,7 +907,7 @@ var XmlNode = forwardRef33(
899
907
  [elementName, ...attributes].join(" "),
900
908
  ">"
901
909
  ] }),
902
- /* @__PURE__ */ jsx30("div", { ref, style: { marginLeft: isTextChild ? 0 : "1rem" }, children }),
910
+ /* @__PURE__ */ jsx31("div", { ref, style: { marginLeft: isTextChild ? 0 : "1rem" }, children }),
903
911
  /* @__PURE__ */ jsxs2("div", { style: { color: "rgb(16, 23, 233)" }, children: [
904
912
  "</",
905
913
  elementName,
@@ -911,8 +919,8 @@ var XmlNode = forwardRef33(
911
919
  XmlNode.displayName = "XmlNode";
912
920
 
913
921
  // src/time.tsx
914
- import * as React from "react";
915
- import { jsx as jsx31 } from "react/jsx-runtime";
922
+ import { forwardRef as forwardRef35 } from "react";
923
+ import { jsx as jsx32 } from "react/jsx-runtime";
916
924
  var languages = [
917
925
  "af",
918
926
  "am",
@@ -1211,7 +1219,26 @@ var timeStyleOrUndefined = (value) => {
1211
1219
  }
1212
1220
  return void 0;
1213
1221
  };
1214
- var Time = React.forwardRef(
1222
+ var parseDate = (datetimeString) => {
1223
+ if (datetimeString === "") {
1224
+ return;
1225
+ }
1226
+ let date = new Date(datetimeString);
1227
+ if (Number.isNaN(date.getTime()) === false) {
1228
+ return date;
1229
+ }
1230
+ if (/^\d+$/.test(datetimeString)) {
1231
+ let timestamp = Number(datetimeString);
1232
+ if (datetimeString.length === 10) {
1233
+ timestamp *= 1e3;
1234
+ }
1235
+ date = new Date(timestamp);
1236
+ }
1237
+ if (Number.isNaN(date.getTime()) === false) {
1238
+ return date;
1239
+ }
1240
+ };
1241
+ var Time = forwardRef35(
1215
1242
  ({
1216
1243
  language = DEFAULT_LANGUAGE,
1217
1244
  country = DEFAULT_COUNTRY,
@@ -1228,16 +1255,15 @@ var Time = React.forwardRef(
1228
1255
  timeStyle: timeStyleOrUndefined(timeStyle)
1229
1256
  };
1230
1257
  const datetimeString = datetime === null ? INVALID_DATE_STRING : datetime.toString();
1231
- const date = new Date(datetimeString);
1232
- const isValidDate = false === Number.isNaN(date.getTime());
1258
+ const date = parseDate(datetimeString);
1233
1259
  let formattedDate = datetimeString;
1234
- if (isValidDate) {
1260
+ if (date) {
1235
1261
  try {
1236
1262
  formattedDate = new Intl.DateTimeFormat(locale, options).format(date);
1237
1263
  } catch {
1238
1264
  }
1239
1265
  }
1240
- return /* @__PURE__ */ jsx31("time", { ref, dateTime: datetimeString, ...props, children: formattedDate });
1266
+ return /* @__PURE__ */ jsx32("time", { ref, dateTime: datetimeString, ...props, children: formattedDate });
1241
1267
  }
1242
1268
  );
1243
1269
 
@@ -1245,16 +1271,16 @@ var Time = React.forwardRef(
1245
1271
  import {
1246
1272
  getClosestInstance,
1247
1273
  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 }));
1274
+ } from "@webstudio-is/react-sdk/runtime";
1275
+ import { forwardRef as forwardRef36 } from "react";
1276
+ import { jsx as jsx33 } from "react/jsx-runtime";
1277
+ var Select = forwardRef36((props, ref) => /* @__PURE__ */ jsx33("select", { ...props, ref }));
1252
1278
  Select.displayName = "Select";
1253
1279
 
1254
1280
  // 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 }));
1281
+ import { forwardRef as forwardRef37 } from "react";
1282
+ import { jsx as jsx34 } from "react/jsx-runtime";
1283
+ var Option = forwardRef37((props, ref) => /* @__PURE__ */ jsx34("option", { ...props, ref }));
1258
1284
  Option.displayName = "Option";
1259
1285
  export {
1260
1286
  Blockquote,
@@ -1275,9 +1301,11 @@ export {
1275
1301
  Link,
1276
1302
  List,
1277
1303
  ListItem,
1304
+ MarkdownEmbed,
1278
1305
  Option,
1279
1306
  Paragraph,
1280
1307
  RadioButton,
1308
+ Form as RemixForm,
1281
1309
  RichTextLink,
1282
1310
  Select,
1283
1311
  Separator,