@prismicio/editor-fields 0.4.28 → 0.4.30

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.
Files changed (26) hide show
  1. package/dist/EditorConfig.d.ts +2 -0
  2. package/dist/GroupAndNestableWidgetSwitch.d.ts +12 -0
  3. package/dist/core/MediaLibrary/components/MediaLibraryContext.d.ts +7 -2
  4. package/dist/core/MediaLibrary/components/Sidepane/components/SidepaneMetadata.d.ts +1 -1
  5. package/dist/core/MediaLibrary/components/Sidepane/components/SidepaneMetadataTags/MultiMediaMetadataTags.d.ts +9 -0
  6. package/dist/core/MediaLibrary/components/Sidepane/components/SidepaneMetadataTags/SingleMediaMetadataTags.d.ts +7 -0
  7. package/dist/core/MediaLibrary/components/Sidepane/components/SidepaneMetadataTags/Tags.d.ts +10 -0
  8. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +144 -13
  9. package/dist/core/MediaLibrary/hooks/tagData.d.ts +7 -4
  10. package/dist/core/MediaLibrary/hooks/useMediaLibraryAnalytics.d.ts +1 -0
  11. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +9 -1
  12. package/dist/core/UID.d.ts +2 -2
  13. package/dist/core/service/document.d.ts +1905 -0
  14. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +2 -2
  15. package/dist/fields/RichTextField/extensions/Bold/BoldModel.d.ts +4 -3
  16. package/dist/fields/RichTextField/extensions/Italic/ItalicModel.d.ts +4 -3
  17. package/dist/fields/RichTextField/extensions/Label/LabelModel.d.ts +4 -3
  18. package/dist/fields/RichTextField/extensions/Link/LinkModel.d.ts +4 -3
  19. package/dist/fields/RichTextField/models/RichTextConfig.d.ts +1 -1
  20. package/dist/index.cjs.js +31 -31
  21. package/dist/index.es.js +15191 -14745
  22. package/dist/slices/utils.d.ts +2 -320
  23. package/dist/zones/RepeatableZoneEditor.d.ts +2 -2
  24. package/package.json +8 -4
  25. package/dist/SlicePrimaryWidgetSwitch.d.ts +0 -12
  26. package/dist/core/MediaLibrary/components/Sidepane/components/SidepaneMetadataTags.d.ts +0 -2
@@ -11,7 +11,7 @@ interface MaybeResetSliceWidgetArgs {
11
11
  * @description Legacy slices depend on default values within their widget. Since some components will clear state when emptied, we need to swap the emptied response (`undefined`) with a default widget value.
12
12
  * @returns default value of a widget for a legacy slice.
13
13
  */
14
- export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs): {
14
+ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs): import("@prismicio/types-internal/lib/content").GroupContent | {
15
15
  type: string;
16
16
  __TYPE__: "EmptyContent";
17
17
  } | {
@@ -259,7 +259,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
259
259
  label?: string | null | undefined;
260
260
  direction?: string | null | undefined;
261
261
  }) | ({
262
- type: "image" | "em" | "embed" | "strong" | "list-item" | "paragraph" | "rtl" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink";
262
+ type: "image" | "em" | "embed" | "strong" | "list-item" | "paragraph" | "rtl" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "o-list-item";
263
263
  content: {
264
264
  text: string;
265
265
  } & {
@@ -323,323 +323,5 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
323
323
  }))[];
324
324
  } | {
325
325
  __TYPE__: "SeparatorContent";
326
- } | {
327
- __TYPE__: "GroupContentType";
328
- value: {
329
- __TYPE__: "GroupItemContent";
330
- value: [string, {
331
- type: string;
332
- __TYPE__: "EmptyContent";
333
- } | {
334
- __TYPE__: "BooleanContent";
335
- value: boolean;
336
- } | ({
337
- embed_url: string;
338
- type: string;
339
- } & {
340
- version?: string | number | null | undefined;
341
- title?: string | null | undefined;
342
- author_name?: string | null | undefined;
343
- author_url?: string | null | undefined;
344
- provider_name?: string | null | undefined;
345
- provider_url?: string | null | undefined;
346
- cache_age?: string | number | null | undefined;
347
- thumbnail_url?: string | null | undefined;
348
- thumbnail_width?: number | null | undefined;
349
- thumbnail_height?: number | null | undefined;
350
- html?: string | null | undefined;
351
- } & {
352
- __TYPE__: "EmbedContent";
353
- all: unknown;
354
- }) | {
355
- type: "Text";
356
- value: string;
357
- __TYPE__: "FieldContent";
358
- } | {
359
- type: "Timestamp";
360
- value: string;
361
- __TYPE__: "FieldContent";
362
- } | {
363
- type: "Select";
364
- value: string;
365
- __TYPE__: "FieldContent";
366
- } | {
367
- type: "Range";
368
- value: string;
369
- __TYPE__: "FieldContent";
370
- } | {
371
- type: "Number";
372
- value: string;
373
- __TYPE__: "FieldContent";
374
- } | {
375
- type: "Date";
376
- value: string;
377
- __TYPE__: "FieldContent";
378
- } | {
379
- type: "Color";
380
- value: string;
381
- __TYPE__: "FieldContent";
382
- } | ({
383
- position: {
384
- lat: number;
385
- lng: number;
386
- };
387
- } & {
388
- __TYPE__: "GeoPointContent";
389
- }) | ({
390
- origin: {
391
- id: string;
392
- url: string;
393
- width: number;
394
- height: number;
395
- };
396
- width: number;
397
- height: number;
398
- edit: {
399
- zoom: number;
400
- crop: {
401
- x: number;
402
- y: number;
403
- };
404
- background: string;
405
- };
406
- } & {
407
- url?: string | undefined;
408
- credits?: string | null | undefined;
409
- alt?: string | null | undefined;
410
- provider?: string | null | undefined;
411
- } & {
412
- thumbnails?: {
413
- [x: string]: {
414
- origin: {
415
- id: string;
416
- url: string;
417
- width: number;
418
- height: number;
419
- };
420
- width: number;
421
- height: number;
422
- edit: {
423
- zoom: number;
424
- crop: {
425
- x: number;
426
- y: number;
427
- };
428
- background: string;
429
- };
430
- } & {
431
- url?: string | undefined;
432
- credits?: string | null | undefined;
433
- alt?: string | null | undefined;
434
- provider?: string | null | undefined;
435
- };
436
- } | undefined;
437
- } & {
438
- __TYPE__: "ImageContent";
439
- }) | {
440
- __TYPE__: "IntegrationFieldsContent";
441
- value: string;
442
- } | {
443
- __TYPE__: "LinkContent";
444
- value: ({
445
- __TYPE__: "ImageLink";
446
- } & {
447
- id: string;
448
- url: string;
449
- height: string;
450
- width: string;
451
- size: string;
452
- name: string;
453
- kind: string;
454
- } & {
455
- date?: string | null | undefined;
456
- }) | ({
457
- id: string;
458
- url: string;
459
- name: string;
460
- kind: string;
461
- size: string;
462
- } & {
463
- date?: string | null | undefined;
464
- } & {
465
- __TYPE__: "FileLink";
466
- } & {
467
- size?: string | undefined;
468
- }) | ({
469
- __TYPE__: "DocumentLink";
470
- } & {
471
- id: string;
472
- }) | ({
473
- __TYPE__: "ExternalLink";
474
- } & {
475
- url: string;
476
- } & {
477
- kind?: "web" | undefined;
478
- target?: string | null | undefined;
479
- preview?: {
480
- title?: string | undefined;
481
- } | null | undefined;
482
- });
483
- } | {
484
- __TYPE__: "StructuredTextContent";
485
- value: (({
486
- type: "image";
487
- data: {
488
- origin: {
489
- id: string;
490
- url: string;
491
- width: number;
492
- height: number;
493
- };
494
- width: number;
495
- height: number;
496
- edit: {
497
- zoom: number;
498
- crop: {
499
- x: number;
500
- y: number;
501
- };
502
- background: string;
503
- };
504
- } & {
505
- url?: string | undefined;
506
- credits?: string | null | undefined;
507
- alt?: string | null | undefined;
508
- provider?: string | null | undefined;
509
- } & {
510
- linkTo?: ({
511
- __TYPE__: "ImageLink";
512
- } & {
513
- id: string;
514
- url: string;
515
- height: string;
516
- width: string;
517
- size: string;
518
- name: string;
519
- kind: string;
520
- } & {
521
- date?: string | null | undefined;
522
- }) | ({
523
- id: string;
524
- url: string;
525
- name: string;
526
- kind: string;
527
- size: string;
528
- } & {
529
- date?: string | null | undefined;
530
- } & {
531
- __TYPE__: "FileLink";
532
- } & {
533
- size?: string | undefined;
534
- }) | ({
535
- __TYPE__: "DocumentLink";
536
- } & {
537
- id: string;
538
- }) | ({
539
- __TYPE__: "ExternalLink";
540
- } & {
541
- url: string;
542
- } & {
543
- kind?: "web" | undefined;
544
- target?: string | null | undefined;
545
- preview?: {
546
- title?: string | undefined;
547
- } | null | undefined;
548
- }) | null | undefined;
549
- };
550
- } & {
551
- label?: string | null | undefined;
552
- direction?: string | null | undefined;
553
- }) | ({
554
- type: "embed";
555
- data: {
556
- embed_url: string;
557
- type: string;
558
- } & {
559
- version?: string | number | null | undefined;
560
- title?: string | null | undefined;
561
- author_name?: string | null | undefined;
562
- author_url?: string | null | undefined;
563
- provider_name?: string | null | undefined;
564
- provider_url?: string | null | undefined;
565
- cache_age?: string | number | null | undefined;
566
- thumbnail_url?: string | null | undefined;
567
- thumbnail_width?: number | null | undefined;
568
- thumbnail_height?: number | null | undefined;
569
- html?: string | null | undefined;
570
- } & {
571
- __TYPE__: "EmbedContent";
572
- all: unknown;
573
- };
574
- } & {
575
- label?: string | null | undefined;
576
- direction?: string | null | undefined;
577
- }) | ({
578
- type: "image" | "em" | "embed" | "strong" | "list-item" | "paragraph" | "rtl" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink";
579
- content: {
580
- text: string;
581
- } & {
582
- spans?: ({
583
- data: ({
584
- __TYPE__: "ImageLink";
585
- } & {
586
- id: string;
587
- url: string;
588
- height: string;
589
- width: string;
590
- size: string;
591
- name: string;
592
- kind: string;
593
- } & {
594
- date?: string | null | undefined;
595
- }) | ({
596
- id: string;
597
- url: string;
598
- name: string;
599
- kind: string;
600
- size: string;
601
- } & {
602
- date?: string | null | undefined;
603
- } & {
604
- __TYPE__: "FileLink";
605
- } & {
606
- size?: string | undefined;
607
- }) | ({
608
- __TYPE__: "DocumentLink";
609
- } & {
610
- id: string;
611
- }) | ({
612
- __TYPE__: "ExternalLink";
613
- } & {
614
- url: string;
615
- } & {
616
- kind?: "web" | undefined;
617
- target?: string | null | undefined;
618
- preview?: {
619
- title?: string | undefined;
620
- } | null | undefined;
621
- });
622
- start: number;
623
- end: number;
624
- type: "hyperlink";
625
- } | {
626
- data: string;
627
- start: number;
628
- end: number;
629
- type: "label";
630
- } | {
631
- start: number;
632
- end: number;
633
- type: "em" | "strong" | "list-item";
634
- })[] | undefined;
635
- };
636
- } & {
637
- label?: string | undefined;
638
- direction?: string | undefined;
639
- }))[];
640
- } | {
641
- __TYPE__: "SeparatorContent";
642
- }][];
643
- }[];
644
326
  } | undefined;
645
327
  export {};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type GroupItemContent } from "@prismicio/types-internal/lib/content";
3
- import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes";
3
+ import type { Group as GroupWidget, NestableWidget } from "@prismicio/types-internal/lib/customtypes";
4
4
  type RepeatableZoneEditorProps = {
5
5
  id: string;
6
6
  readOnly: boolean;
@@ -9,7 +9,7 @@ type RepeatableZoneEditorProps = {
9
9
  * Defaults to true.
10
10
  */
11
11
  repeatable?: boolean;
12
- repeatableZone: Readonly<Record<string, NestableWidget>>;
12
+ repeatableZone: Readonly<Record<string, NestableWidget | GroupWidget>>;
13
13
  content: GroupItemContent[] | undefined;
14
14
  onContentChange: (content: GroupItemContent[]) => void;
15
15
  } & ({
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@floating-ui/react-dom-interactions": "0.9.3",
4
- "@prismicio/editor-support": "0.4.28",
4
+ "@prismicio/editor-support": "0.4.30",
5
5
  "@prismicio/richtext": "2.1.1",
6
- "@prismicio/types-internal": "2.4.1",
6
+ "@prismicio/types-internal": "2.6.0",
7
7
  "@tiptap/core": "2.3.0",
8
8
  "@tiptap/extension-bold": "2.3.0",
9
9
  "@tiptap/extension-bullet-list": "2.3.0",
@@ -33,7 +33,9 @@
33
33
  "zod": "3.21.4"
34
34
  },
35
35
  "devDependencies": {
36
+ "@testing-library/react": "15.0.7",
36
37
  "@types/react": "18.0.18",
38
+ "@types/react-dom": "18.3.0",
37
39
  "@types/uuid": "9.0.8",
38
40
  "@vitejs/plugin-react": "4.0.3",
39
41
  "eslint": "8.50.0",
@@ -42,7 +44,9 @@
42
44
  "eslint-plugin-jsx-a11y": "6.6.1",
43
45
  "eslint-plugin-react": "7.31.7",
44
46
  "eslint-plugin-react-hooks": "4.6.0",
47
+ "jsdom": "24.0.0",
45
48
  "react": "18.2.0",
49
+ "react-dom": "18.3.1",
46
50
  "typescript": "5.2.2",
47
51
  "vite": "5.1.5",
48
52
  "vitest": "1.3.1"
@@ -63,7 +67,7 @@
63
67
  "module": "./dist/index.es.js",
64
68
  "name": "@prismicio/editor-fields",
65
69
  "peerDependencies": {
66
- "@prismicio/editor-ui": "^0.4.28",
70
+ "@prismicio/editor-ui": "^0.4.30",
67
71
  "react": "18",
68
72
  "react-dom": "18"
69
73
  },
@@ -80,5 +84,5 @@
80
84
  "sideEffects": false,
81
85
  "stableVersion": "0.0.0",
82
86
  "types": "./dist/index.d.ts",
83
- "version": "0.4.28"
87
+ "version": "0.4.30"
84
88
  }
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { type SlicePrimaryContent } from "@prismicio/types-internal/lib/content";
3
- import type { SlicePrimaryWidget } from "@prismicio/types-internal/lib/customtypes";
4
- interface Props {
5
- content: SlicePrimaryContent | undefined;
6
- id: string;
7
- slicePrimaryWidget: SlicePrimaryWidget;
8
- onContentChange: (content: SlicePrimaryContent | undefined) => void;
9
- readOnly: boolean;
10
- }
11
- export declare function SlicePrimaryWidgetSwitch(props: Props): JSX.Element;
12
- export {};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function Tags(): JSX.Element;