@webstudio-is/sdk-components-react 0.173.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 +168 -132
- package/lib/metas.js +270 -186
- package/lib/props.js +302 -179
- package/lib/types/__generated__/markdown-embed.props.d.ts +2 -0
- package/lib/types/components.d.ts +2 -0
- package/lib/types/link.d.ts +5 -5
- package/lib/types/markdown-embed.d.ts +7 -0
- package/lib/types/markdown-embed.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +2 -0
- package/lib/types/props.d.ts +2 -0
- package/lib/types/select.d.ts +1 -1
- package/lib/types/time.d.ts +5 -3
- package/lib/types/time.test.d.ts +1 -0
- package/lib/types/xml-node.d.ts +0 -3
- package/package.json +8 -6
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/
|
|
257
|
-
import {
|
|
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
|
|
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
|
|
279
|
+
forwardRef as forwardRef6
|
|
266
280
|
} from "react";
|
|
267
281
|
var defaultTag = "div";
|
|
268
|
-
var Box =
|
|
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
|
|
277
|
-
import { jsx as
|
|
290
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
291
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
278
292
|
var defaultTag2 = "div";
|
|
279
|
-
var Text =
|
|
293
|
+
var Text = forwardRef7(
|
|
280
294
|
({ tag = defaultTag2, children, ...props }, ref) => {
|
|
281
295
|
const Tag = tag;
|
|
282
|
-
return /* @__PURE__ */
|
|
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
|
|
289
|
-
import { jsx as
|
|
302
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
303
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
290
304
|
var defaultTag3 = "h1";
|
|
291
|
-
var Heading =
|
|
305
|
+
var Heading = forwardRef8(
|
|
292
306
|
({ tag = defaultTag3, children, ...props }, ref) => {
|
|
293
307
|
const Tag = tag;
|
|
294
|
-
return /* @__PURE__ */
|
|
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
|
|
301
|
-
import { jsx as
|
|
302
|
-
var Paragraph =
|
|
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
|
|
307
|
-
import { jsx as
|
|
308
|
-
var Link =
|
|
309
|
-
|
|
310
|
-
|
|
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
|
|
317
|
-
import { jsx as
|
|
318
|
-
var RichTextLink =
|
|
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
|
|
323
|
-
import { jsx as
|
|
324
|
-
var Span =
|
|
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
|
|
329
|
-
import { jsx as
|
|
330
|
-
var Bold =
|
|
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
|
|
335
|
-
import { jsx as
|
|
336
|
-
var Italic =
|
|
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
|
|
341
|
-
import { jsx as
|
|
342
|
-
var Superscript =
|
|
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
|
|
347
|
-
import { jsx as
|
|
348
|
-
var Subscript =
|
|
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
|
|
353
|
-
import { jsx as
|
|
354
|
-
var Button =
|
|
355
|
-
({ type = "submit", children, ...props }, ref) => /* @__PURE__ */
|
|
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
|
|
361
|
-
import { jsx as
|
|
362
|
-
var Input =
|
|
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
|
|
367
|
-
import { jsx as
|
|
368
|
-
var Form =
|
|
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
|
|
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
|
|
379
|
-
var Image =
|
|
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,7 +423,7 @@ var Image = forwardRef19(
|
|
|
404
423
|
if (src.startsWith(assetBaseUrl)) {
|
|
405
424
|
assetName = src.slice(assetBaseUrl.length);
|
|
406
425
|
}
|
|
407
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ jsx19(
|
|
408
427
|
WebstudioImage,
|
|
409
428
|
{
|
|
410
429
|
loading,
|
|
@@ -424,45 +443,45 @@ var Image = forwardRef19(
|
|
|
424
443
|
Image.displayName = "Image";
|
|
425
444
|
|
|
426
445
|
// src/blockquote.tsx
|
|
427
|
-
import { forwardRef as
|
|
428
|
-
import { jsx as
|
|
429
|
-
var Blockquote =
|
|
446
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
447
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
448
|
+
var Blockquote = forwardRef21(
|
|
430
449
|
({ children, ...props }, ref) => {
|
|
431
|
-
return /* @__PURE__ */
|
|
450
|
+
return /* @__PURE__ */ jsx20("blockquote", { ...props, ref, children });
|
|
432
451
|
}
|
|
433
452
|
);
|
|
434
453
|
Blockquote.displayName = "Blockquote";
|
|
435
454
|
|
|
436
455
|
// src/list.tsx
|
|
437
456
|
import {
|
|
438
|
-
forwardRef as
|
|
457
|
+
forwardRef as forwardRef22,
|
|
439
458
|
createElement as createElement2
|
|
440
459
|
} from "react";
|
|
441
460
|
var unorderedTag = "ul";
|
|
442
461
|
var orderedTag = "ol";
|
|
443
|
-
var List =
|
|
462
|
+
var List = forwardRef22(({ ordered = false, ...props }, ref) => {
|
|
444
463
|
const tag = ordered ? orderedTag : unorderedTag;
|
|
445
464
|
return createElement2(tag, { ...props, ref });
|
|
446
465
|
});
|
|
447
466
|
List.displayName = "List";
|
|
448
467
|
|
|
449
468
|
// src/list-item.tsx
|
|
450
|
-
import { forwardRef as
|
|
451
|
-
import { jsx as
|
|
452
|
-
var ListItem =
|
|
469
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
470
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
471
|
+
var ListItem = forwardRef23(
|
|
453
472
|
({ children, ...props }, ref) => {
|
|
454
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ jsx21("li", { ...props, ref, children });
|
|
455
474
|
}
|
|
456
475
|
);
|
|
457
476
|
ListItem.displayName = "ListItem";
|
|
458
477
|
|
|
459
478
|
// src/separator.tsx
|
|
460
479
|
import {
|
|
461
|
-
forwardRef as
|
|
480
|
+
forwardRef as forwardRef24,
|
|
462
481
|
createElement as createElement3
|
|
463
482
|
} from "react";
|
|
464
483
|
var defaultTag4 = "hr";
|
|
465
|
-
var Separator =
|
|
484
|
+
var Separator = forwardRef24(
|
|
466
485
|
(props, ref) => {
|
|
467
486
|
return createElement3(defaultTag4, { ...props, ref });
|
|
468
487
|
}
|
|
@@ -471,60 +490,60 @@ Separator.displayName = "Separator";
|
|
|
471
490
|
|
|
472
491
|
// src/code-text.tsx
|
|
473
492
|
import {
|
|
474
|
-
forwardRef as
|
|
493
|
+
forwardRef as forwardRef25
|
|
475
494
|
} from "react";
|
|
476
|
-
import { jsx as
|
|
495
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
477
496
|
var Placeholder2 = ({
|
|
478
497
|
innerRef,
|
|
479
498
|
...rest
|
|
480
499
|
}) => {
|
|
481
|
-
return /* @__PURE__ */
|
|
500
|
+
return /* @__PURE__ */ jsx22("code", { ...rest, style: { padding: 20 }, ref: innerRef, children: `Open the "Settings" panel to edit the code.` });
|
|
482
501
|
};
|
|
483
|
-
var CodeText =
|
|
502
|
+
var CodeText = forwardRef25(({ code, children, ...props }, ref) => {
|
|
484
503
|
if (children === void 0 && code === void 0 || String(code).trim().length === 0) {
|
|
485
|
-
return /* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ jsx22(Placeholder2, { innerRef: ref, ...props });
|
|
486
505
|
}
|
|
487
|
-
return /* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ jsx22("code", { ...props, ref, children: code ?? children });
|
|
488
507
|
});
|
|
489
508
|
CodeText.displayName = "CodeText";
|
|
490
509
|
|
|
491
510
|
// src/label.tsx
|
|
492
|
-
import { forwardRef as
|
|
493
|
-
import { jsx as
|
|
494
|
-
var Label =
|
|
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 }));
|
|
495
514
|
Label.displayName = "Label";
|
|
496
515
|
|
|
497
516
|
// src/textarea.tsx
|
|
498
|
-
import { forwardRef as
|
|
499
|
-
import { jsx as
|
|
500
|
-
var Textarea =
|
|
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 }));
|
|
501
520
|
Textarea.displayName = "Textarea";
|
|
502
521
|
|
|
503
522
|
// src/radio-button.tsx
|
|
504
|
-
import { forwardRef as
|
|
505
|
-
import { jsx as
|
|
506
|
-
var RadioButton =
|
|
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 }));
|
|
507
526
|
RadioButton.displayName = "RadioButton";
|
|
508
527
|
|
|
509
528
|
// src/checkbox.tsx
|
|
510
|
-
import { forwardRef as
|
|
511
|
-
import { jsx as
|
|
512
|
-
var Checkbox =
|
|
513
|
-
return /* @__PURE__ */
|
|
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 });
|
|
514
533
|
});
|
|
515
534
|
Checkbox.displayName = "Checkbox";
|
|
516
535
|
|
|
517
536
|
// src/vimeo.tsx
|
|
518
537
|
import { colord } from "colord";
|
|
519
538
|
import {
|
|
520
|
-
forwardRef as
|
|
539
|
+
forwardRef as forwardRef30,
|
|
521
540
|
useState as useState2,
|
|
522
541
|
useEffect as useEffect2,
|
|
523
542
|
useContext as useContext3,
|
|
524
543
|
createContext
|
|
525
544
|
} from "react";
|
|
526
|
-
import { ReactSdkContext as ReactSdkContext3 } from "@webstudio-is/react-sdk";
|
|
527
|
-
import { Fragment as Fragment2, jsx as
|
|
545
|
+
import { ReactSdkContext as ReactSdkContext3 } from "@webstudio-is/react-sdk/runtime";
|
|
546
|
+
import { Fragment as Fragment2, jsx as jsx27, jsxs } from "react/jsx-runtime";
|
|
528
547
|
var getVideoUrl = (options) => {
|
|
529
548
|
if (options.url === void 0) {
|
|
530
549
|
return;
|
|
@@ -620,7 +639,7 @@ var loadPreviewImageUrl = async (videoUrl) => {
|
|
|
620
639
|
return imageUrl;
|
|
621
640
|
};
|
|
622
641
|
var EmptyState = () => {
|
|
623
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ jsx27(
|
|
624
643
|
"div",
|
|
625
644
|
{
|
|
626
645
|
style: {
|
|
@@ -674,7 +693,7 @@ var Player = ({
|
|
|
674
693
|
if (renderer === "canvas" || status === "initial") {
|
|
675
694
|
return;
|
|
676
695
|
}
|
|
677
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ jsx27(
|
|
678
697
|
"iframe",
|
|
679
698
|
{
|
|
680
699
|
src: videoUrl,
|
|
@@ -697,12 +716,11 @@ var Player = ({
|
|
|
697
716
|
);
|
|
698
717
|
};
|
|
699
718
|
var VimeoContext = createContext({
|
|
700
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
701
719
|
onInitPlayer: () => {
|
|
702
720
|
},
|
|
703
721
|
status: "initial"
|
|
704
722
|
});
|
|
705
|
-
var Vimeo =
|
|
723
|
+
var Vimeo = forwardRef30(
|
|
706
724
|
({
|
|
707
725
|
url,
|
|
708
726
|
loading = "lazy",
|
|
@@ -757,7 +775,7 @@ var Vimeo = forwardRef29(
|
|
|
757
775
|
showPortrait,
|
|
758
776
|
autopip
|
|
759
777
|
});
|
|
760
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ jsx27(
|
|
761
779
|
VimeoContext.Provider,
|
|
762
780
|
{
|
|
763
781
|
value: {
|
|
@@ -769,7 +787,7 @@ var Vimeo = forwardRef29(
|
|
|
769
787
|
}
|
|
770
788
|
}
|
|
771
789
|
},
|
|
772
|
-
children: /* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ jsx27(
|
|
773
791
|
"div",
|
|
774
792
|
{
|
|
775
793
|
...rest,
|
|
@@ -778,9 +796,9 @@ var Vimeo = forwardRef29(
|
|
|
778
796
|
typeof ref === "function" ? ref(value) : ref.current = value;
|
|
779
797
|
}
|
|
780
798
|
},
|
|
781
|
-
children: videoUrl === void 0 ? /* @__PURE__ */
|
|
799
|
+
children: videoUrl === void 0 ? /* @__PURE__ */ jsx27(EmptyState, {}) : /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
782
800
|
children,
|
|
783
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ jsx27(
|
|
784
802
|
Player,
|
|
785
803
|
{
|
|
786
804
|
autoplay,
|
|
@@ -805,14 +823,14 @@ Vimeo.displayName = "Vimeo";
|
|
|
805
823
|
|
|
806
824
|
// src/vimeo-preview-image.tsx
|
|
807
825
|
import {
|
|
808
|
-
forwardRef as
|
|
826
|
+
forwardRef as forwardRef31,
|
|
809
827
|
useContext as useContext4
|
|
810
828
|
} from "react";
|
|
811
|
-
import { jsx as
|
|
829
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
812
830
|
var base64Preview = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=`;
|
|
813
|
-
var VimeoPreviewImage =
|
|
831
|
+
var VimeoPreviewImage = forwardRef31(({ src, ...rest }, ref) => {
|
|
814
832
|
const vimeoContext = useContext4(VimeoContext);
|
|
815
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ jsx28(
|
|
816
834
|
Image,
|
|
817
835
|
{
|
|
818
836
|
...rest,
|
|
@@ -825,50 +843,48 @@ VimeoPreviewImage.displayName = "VimeoPreviewImage";
|
|
|
825
843
|
|
|
826
844
|
// src/vimeo-play-button.tsx
|
|
827
845
|
import {
|
|
828
|
-
forwardRef as
|
|
846
|
+
forwardRef as forwardRef32,
|
|
829
847
|
useContext as useContext5
|
|
830
848
|
} from "react";
|
|
831
|
-
import { jsx as
|
|
832
|
-
var VimeoPlayButton =
|
|
849
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
850
|
+
var VimeoPlayButton = forwardRef32(
|
|
833
851
|
(props, ref) => {
|
|
834
852
|
const vimeoContext = useContext5(VimeoContext);
|
|
835
853
|
if (vimeoContext.status !== "initial") {
|
|
836
854
|
return;
|
|
837
855
|
}
|
|
838
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ jsx29(Button, { ...props, onClick: vimeoContext.onInitPlayer, ref });
|
|
839
857
|
}
|
|
840
858
|
);
|
|
841
859
|
VimeoPlayButton.displayName = "VimeoPlayButton";
|
|
842
860
|
|
|
843
861
|
// src/vimeo-spinner.tsx
|
|
844
862
|
import {
|
|
845
|
-
forwardRef as
|
|
863
|
+
forwardRef as forwardRef33,
|
|
846
864
|
useContext as useContext6
|
|
847
865
|
} from "react";
|
|
848
|
-
import { jsx as
|
|
849
|
-
var VimeoSpinner =
|
|
866
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
867
|
+
var VimeoSpinner = forwardRef33(
|
|
850
868
|
(props, ref) => {
|
|
851
869
|
const vimeoContext = useContext6(VimeoContext);
|
|
852
870
|
if (vimeoContext.status !== "loading") {
|
|
853
871
|
return;
|
|
854
872
|
}
|
|
855
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ jsx30("div", { ...props, ref });
|
|
856
874
|
}
|
|
857
875
|
);
|
|
858
876
|
VimeoSpinner.displayName = "VimeoSpinner";
|
|
859
877
|
|
|
860
878
|
// src/xml-node.tsx
|
|
861
|
-
import {
|
|
862
|
-
ReactSdkContext as ReactSdkContext4
|
|
863
|
-
} from "@webstudio-is/react-sdk";
|
|
879
|
+
import { ReactSdkContext as ReactSdkContext4 } from "@webstudio-is/react-sdk/runtime";
|
|
864
880
|
import {
|
|
865
881
|
Children,
|
|
866
882
|
createElement as createElement4,
|
|
867
|
-
forwardRef as
|
|
883
|
+
forwardRef as forwardRef34,
|
|
868
884
|
useContext as useContext7
|
|
869
885
|
} from "react";
|
|
870
|
-
import { jsx as
|
|
871
|
-
var XmlNode =
|
|
886
|
+
import { jsx as jsx31, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
887
|
+
var XmlNode = forwardRef34(
|
|
872
888
|
({ tag = "", children, ...props }, ref) => {
|
|
873
889
|
const { renderer } = useContext7(ReactSdkContext4);
|
|
874
890
|
const attributeEntries = Object.entries(props).filter(
|
|
@@ -891,7 +907,7 @@ var XmlNode = forwardRef33(
|
|
|
891
907
|
[elementName, ...attributes].join(" "),
|
|
892
908
|
">"
|
|
893
909
|
] }),
|
|
894
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ jsx31("div", { ref, style: { marginLeft: isTextChild ? 0 : "1rem" }, children }),
|
|
895
911
|
/* @__PURE__ */ jsxs2("div", { style: { color: "rgb(16, 23, 233)" }, children: [
|
|
896
912
|
"</",
|
|
897
913
|
elementName,
|
|
@@ -903,8 +919,8 @@ var XmlNode = forwardRef33(
|
|
|
903
919
|
XmlNode.displayName = "XmlNode";
|
|
904
920
|
|
|
905
921
|
// src/time.tsx
|
|
906
|
-
import
|
|
907
|
-
import { jsx as
|
|
922
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
923
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
908
924
|
var languages = [
|
|
909
925
|
"af",
|
|
910
926
|
"am",
|
|
@@ -1203,7 +1219,26 @@ var timeStyleOrUndefined = (value) => {
|
|
|
1203
1219
|
}
|
|
1204
1220
|
return void 0;
|
|
1205
1221
|
};
|
|
1206
|
-
var
|
|
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(
|
|
1207
1242
|
({
|
|
1208
1243
|
language = DEFAULT_LANGUAGE,
|
|
1209
1244
|
country = DEFAULT_COUNTRY,
|
|
@@ -1220,16 +1255,15 @@ var Time = React.forwardRef(
|
|
|
1220
1255
|
timeStyle: timeStyleOrUndefined(timeStyle)
|
|
1221
1256
|
};
|
|
1222
1257
|
const datetimeString = datetime === null ? INVALID_DATE_STRING : datetime.toString();
|
|
1223
|
-
const date =
|
|
1224
|
-
const isValidDate = false === Number.isNaN(date.getTime());
|
|
1258
|
+
const date = parseDate(datetimeString);
|
|
1225
1259
|
let formattedDate = datetimeString;
|
|
1226
|
-
if (
|
|
1260
|
+
if (date) {
|
|
1227
1261
|
try {
|
|
1228
1262
|
formattedDate = new Intl.DateTimeFormat(locale, options).format(date);
|
|
1229
1263
|
} catch {
|
|
1230
1264
|
}
|
|
1231
1265
|
}
|
|
1232
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ jsx32("time", { ref, dateTime: datetimeString, ...props, children: formattedDate });
|
|
1233
1267
|
}
|
|
1234
1268
|
);
|
|
1235
1269
|
|
|
@@ -1237,16 +1271,16 @@ var Time = React.forwardRef(
|
|
|
1237
1271
|
import {
|
|
1238
1272
|
getClosestInstance,
|
|
1239
1273
|
getInstanceSelectorById
|
|
1240
|
-
} from "@webstudio-is/react-sdk";
|
|
1241
|
-
import { forwardRef as
|
|
1242
|
-
import { jsx as
|
|
1243
|
-
var Select =
|
|
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 }));
|
|
1244
1278
|
Select.displayName = "Select";
|
|
1245
1279
|
|
|
1246
1280
|
// src/option.tsx
|
|
1247
|
-
import { forwardRef as
|
|
1248
|
-
import { jsx as
|
|
1249
|
-
var Option =
|
|
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 }));
|
|
1250
1284
|
Option.displayName = "Option";
|
|
1251
1285
|
export {
|
|
1252
1286
|
Blockquote,
|
|
@@ -1267,9 +1301,11 @@ export {
|
|
|
1267
1301
|
Link,
|
|
1268
1302
|
List,
|
|
1269
1303
|
ListItem,
|
|
1304
|
+
MarkdownEmbed,
|
|
1270
1305
|
Option,
|
|
1271
1306
|
Paragraph,
|
|
1272
1307
|
RadioButton,
|
|
1308
|
+
Form as RemixForm,
|
|
1273
1309
|
RichTextLink,
|
|
1274
1310
|
Select,
|
|
1275
1311
|
Separator,
|