@portabletext/editor 1.48.14 → 1.49.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.
Files changed (48) hide show
  1. package/lib/_chunks-cjs/editor-provider.cjs +117 -34
  2. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  3. package/lib/_chunks-cjs/util.slice-blocks.cjs +2 -0
  4. package/lib/_chunks-cjs/util.slice-blocks.cjs.map +1 -1
  5. package/lib/_chunks-es/editor-provider.js +117 -34
  6. package/lib/_chunks-es/editor-provider.js.map +1 -1
  7. package/lib/_chunks-es/util.slice-blocks.js +2 -0
  8. package/lib/_chunks-es/util.slice-blocks.js.map +1 -1
  9. package/lib/behaviors/index.d.cts +222 -208
  10. package/lib/behaviors/index.d.ts +222 -208
  11. package/lib/index.cjs +346 -257
  12. package/lib/index.cjs.map +1 -1
  13. package/lib/index.d.cts +222 -216
  14. package/lib/index.d.ts +222 -216
  15. package/lib/index.js +353 -264
  16. package/lib/index.js.map +1 -1
  17. package/lib/plugins/index.d.cts +222 -216
  18. package/lib/plugins/index.d.ts +222 -216
  19. package/lib/selectors/index.d.cts +222 -208
  20. package/lib/selectors/index.d.ts +222 -208
  21. package/lib/utils/index.d.cts +222 -208
  22. package/lib/utils/index.d.ts +222 -208
  23. package/package.json +1 -1
  24. package/src/behaviors/behavior.config.ts +7 -0
  25. package/src/behaviors/behavior.core.block-element.ts +108 -0
  26. package/src/behaviors/behavior.core.ts +6 -2
  27. package/src/converters/converter.portable-text.ts +4 -1
  28. package/src/converters/converter.text-html.ts +4 -1
  29. package/src/converters/converter.text-plain.ts +4 -1
  30. package/src/editor/Editable.tsx +2 -4
  31. package/src/editor/__tests__/PortableTextEditor.test.tsx +6 -0
  32. package/src/editor/components/Leaf.tsx +8 -1
  33. package/src/editor/components/render-block-object.tsx +90 -0
  34. package/src/editor/components/render-default-object.tsx +21 -0
  35. package/src/editor/components/render-element.tsx +140 -0
  36. package/src/editor/components/render-inline-object.tsx +93 -0
  37. package/src/editor/components/render-text-block.tsx +148 -0
  38. package/src/editor/components/use-core-block-element-behaviors.ts +39 -0
  39. package/src/editor/create-editor.ts +17 -5
  40. package/src/editor/editor-machine.ts +21 -18
  41. package/src/internal-utils/parse-blocks.ts +2 -2
  42. package/src/internal-utils/slate-utils.ts +1 -1
  43. package/src/priority/priority.core.ts +3 -0
  44. package/src/priority/priority.sort.test.ts +319 -0
  45. package/src/priority/priority.sort.ts +121 -0
  46. package/src/priority/priority.types.ts +24 -0
  47. package/src/editor/components/DefaultObject.tsx +0 -21
  48. package/src/editor/components/Element.tsx +0 -435
@@ -286,6 +286,11 @@ export declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
286
286
  guardResponse: TGuardResponse,
287
287
  ) => Array<BehaviorAction>
288
288
 
289
+ declare type BehaviorConfig = {
290
+ behavior: Behavior
291
+ priority: EditorPriority
292
+ }
293
+
289
294
  /**
290
295
  * @beta
291
296
  */
@@ -605,7 +610,7 @@ declare type EditorContext = {
605
610
  */
606
611
  declare const editorMachine: StateMachine<
607
612
  {
608
- behaviors: Set<Behavior>
613
+ behaviors: Set<BehaviorConfig>
609
614
  converters: Set<Converter>
610
615
  getLegacySchema: () => PortableTextMemberSchemaTypes
611
616
  keyGenerator: () => string
@@ -625,14 +630,6 @@ declare const editorMachine: StateMachine<
625
630
  | InternalPatchEvent
626
631
  | MutationEvent
627
632
  | PatchesEvent
628
- | {
629
- type: 'add behavior'
630
- behavior: Behavior
631
- }
632
- | {
633
- type: 'remove behavior'
634
- behavior: Behavior
635
- }
636
633
  | {
637
634
  type: 'update readOnly'
638
635
  readOnly: boolean
@@ -653,6 +650,14 @@ declare const editorMachine: StateMachine<
653
650
  type: 'update maxBlocks'
654
651
  maxBlocks: number | undefined
655
652
  }
653
+ | {
654
+ type: 'add behavior'
655
+ behaviorConfig: BehaviorConfig
656
+ }
657
+ | {
658
+ type: 'remove behavior'
659
+ behaviorConfig: BehaviorConfig
660
+ }
656
661
  | {
657
662
  type: 'blur'
658
663
  editor: PortableTextSlateEditor
@@ -949,7 +954,7 @@ declare const editorMachine: StateMachine<
949
954
  self: ActorRef<
950
955
  MachineSnapshot<
951
956
  {
952
- behaviors: Set<Behavior>
957
+ behaviors: Set<BehaviorConfig>
953
958
  converters: Set<Converter>
954
959
  getLegacySchema: () => PortableTextMemberSchemaTypes
955
960
  keyGenerator: () => string
@@ -969,14 +974,6 @@ declare const editorMachine: StateMachine<
969
974
  | InternalPatchEvent
970
975
  | MutationEvent
971
976
  | PatchesEvent
972
- | {
973
- type: 'add behavior'
974
- behavior: Behavior
975
- }
976
- | {
977
- type: 'remove behavior'
978
- behavior: Behavior
979
- }
980
977
  | {
981
978
  type: 'update readOnly'
982
979
  readOnly: boolean
@@ -997,6 +994,14 @@ declare const editorMachine: StateMachine<
997
994
  type: 'update maxBlocks'
998
995
  maxBlocks: number | undefined
999
996
  }
997
+ | {
998
+ type: 'add behavior'
999
+ behaviorConfig: BehaviorConfig
1000
+ }
1001
+ | {
1002
+ type: 'remove behavior'
1003
+ behaviorConfig: BehaviorConfig
1004
+ }
1000
1005
  | {
1001
1006
  type: 'blur'
1002
1007
  editor: PortableTextSlateEditor
@@ -1102,14 +1107,6 @@ declare const editorMachine: StateMachine<
1102
1107
  | InternalPatchEvent
1103
1108
  | MutationEvent
1104
1109
  | PatchesEvent
1105
- | {
1106
- type: 'add behavior'
1107
- behavior: Behavior
1108
- }
1109
- | {
1110
- type: 'remove behavior'
1111
- behavior: Behavior
1112
- }
1113
1110
  | {
1114
1111
  type: 'update readOnly'
1115
1112
  readOnly: boolean
@@ -1130,6 +1127,14 @@ declare const editorMachine: StateMachine<
1130
1127
  type: 'update maxBlocks'
1131
1128
  maxBlocks: number | undefined
1132
1129
  }
1130
+ | {
1131
+ type: 'add behavior'
1132
+ behaviorConfig: BehaviorConfig
1133
+ }
1134
+ | {
1135
+ type: 'remove behavior'
1136
+ behaviorConfig: BehaviorConfig
1137
+ }
1133
1138
  | {
1134
1139
  type: 'blur'
1135
1140
  editor: PortableTextSlateEditor
@@ -1244,7 +1249,7 @@ declare const editorMachine: StateMachine<
1244
1249
  readonly 'notify.blurred': {
1245
1250
  readonly actions: ActionFunction<
1246
1251
  {
1247
- behaviors: Set<Behavior>
1252
+ behaviors: Set<BehaviorConfig>
1248
1253
  converters: Set<Converter>
1249
1254
  getLegacySchema: () => PortableTextMemberSchemaTypes
1250
1255
  keyGenerator: () => string
@@ -1268,14 +1273,6 @@ declare const editorMachine: StateMachine<
1268
1273
  | InternalPatchEvent
1269
1274
  | MutationEvent
1270
1275
  | PatchesEvent
1271
- | {
1272
- type: 'add behavior'
1273
- behavior: Behavior
1274
- }
1275
- | {
1276
- type: 'remove behavior'
1277
- behavior: Behavior
1278
- }
1279
1276
  | {
1280
1277
  type: 'update readOnly'
1281
1278
  readOnly: boolean
@@ -1296,6 +1293,14 @@ declare const editorMachine: StateMachine<
1296
1293
  type: 'update maxBlocks'
1297
1294
  maxBlocks: number | undefined
1298
1295
  }
1296
+ | {
1297
+ type: 'add behavior'
1298
+ behaviorConfig: BehaviorConfig
1299
+ }
1300
+ | {
1301
+ type: 'remove behavior'
1302
+ behaviorConfig: BehaviorConfig
1303
+ }
1299
1304
  | {
1300
1305
  type: 'blur'
1301
1306
  editor: PortableTextSlateEditor
@@ -1448,7 +1453,7 @@ declare const editorMachine: StateMachine<
1448
1453
  readonly 'notify.done loading': {
1449
1454
  readonly actions: ActionFunction<
1450
1455
  {
1451
- behaviors: Set<Behavior>
1456
+ behaviors: Set<BehaviorConfig>
1452
1457
  converters: Set<Converter>
1453
1458
  getLegacySchema: () => PortableTextMemberSchemaTypes
1454
1459
  keyGenerator: () => string
@@ -1471,14 +1476,6 @@ declare const editorMachine: StateMachine<
1471
1476
  | InternalPatchEvent
1472
1477
  | MutationEvent
1473
1478
  | PatchesEvent
1474
- | {
1475
- type: 'add behavior'
1476
- behavior: Behavior
1477
- }
1478
- | {
1479
- type: 'remove behavior'
1480
- behavior: Behavior
1481
- }
1482
1479
  | {
1483
1480
  type: 'update readOnly'
1484
1481
  readOnly: boolean
@@ -1499,6 +1496,14 @@ declare const editorMachine: StateMachine<
1499
1496
  type: 'update maxBlocks'
1500
1497
  maxBlocks: number | undefined
1501
1498
  }
1499
+ | {
1500
+ type: 'add behavior'
1501
+ behaviorConfig: BehaviorConfig
1502
+ }
1503
+ | {
1504
+ type: 'remove behavior'
1505
+ behaviorConfig: BehaviorConfig
1506
+ }
1502
1507
  | {
1503
1508
  type: 'blur'
1504
1509
  editor: PortableTextSlateEditor
@@ -1651,7 +1656,7 @@ declare const editorMachine: StateMachine<
1651
1656
  readonly 'notify.error': {
1652
1657
  readonly actions: ActionFunction<
1653
1658
  {
1654
- behaviors: Set<Behavior>
1659
+ behaviors: Set<BehaviorConfig>
1655
1660
  converters: Set<Converter>
1656
1661
  getLegacySchema: () => PortableTextMemberSchemaTypes
1657
1662
  keyGenerator: () => string
@@ -1677,14 +1682,6 @@ declare const editorMachine: StateMachine<
1677
1682
  | InternalPatchEvent
1678
1683
  | MutationEvent
1679
1684
  | PatchesEvent
1680
- | {
1681
- type: 'add behavior'
1682
- behavior: Behavior
1683
- }
1684
- | {
1685
- type: 'remove behavior'
1686
- behavior: Behavior
1687
- }
1688
1685
  | {
1689
1686
  type: 'update readOnly'
1690
1687
  readOnly: boolean
@@ -1705,6 +1702,14 @@ declare const editorMachine: StateMachine<
1705
1702
  type: 'update maxBlocks'
1706
1703
  maxBlocks: number | undefined
1707
1704
  }
1705
+ | {
1706
+ type: 'add behavior'
1707
+ behaviorConfig: BehaviorConfig
1708
+ }
1709
+ | {
1710
+ type: 'remove behavior'
1711
+ behaviorConfig: BehaviorConfig
1712
+ }
1708
1713
  | {
1709
1714
  type: 'blur'
1710
1715
  editor: PortableTextSlateEditor
@@ -1857,7 +1862,7 @@ declare const editorMachine: StateMachine<
1857
1862
  readonly 'notify.invalid value': {
1858
1863
  readonly actions: ActionFunction<
1859
1864
  {
1860
- behaviors: Set<Behavior>
1865
+ behaviors: Set<BehaviorConfig>
1861
1866
  converters: Set<Converter>
1862
1867
  getLegacySchema: () => PortableTextMemberSchemaTypes
1863
1868
  keyGenerator: () => string
@@ -1882,14 +1887,6 @@ declare const editorMachine: StateMachine<
1882
1887
  | InternalPatchEvent
1883
1888
  | MutationEvent
1884
1889
  | PatchesEvent
1885
- | {
1886
- type: 'add behavior'
1887
- behavior: Behavior
1888
- }
1889
- | {
1890
- type: 'remove behavior'
1891
- behavior: Behavior
1892
- }
1893
1890
  | {
1894
1891
  type: 'update readOnly'
1895
1892
  readOnly: boolean
@@ -1910,6 +1907,14 @@ declare const editorMachine: StateMachine<
1910
1907
  type: 'update maxBlocks'
1911
1908
  maxBlocks: number | undefined
1912
1909
  }
1910
+ | {
1911
+ type: 'add behavior'
1912
+ behaviorConfig: BehaviorConfig
1913
+ }
1914
+ | {
1915
+ type: 'remove behavior'
1916
+ behaviorConfig: BehaviorConfig
1917
+ }
1913
1918
  | {
1914
1919
  type: 'blur'
1915
1920
  editor: PortableTextSlateEditor
@@ -2062,7 +2067,7 @@ declare const editorMachine: StateMachine<
2062
2067
  readonly 'notify.focused': {
2063
2068
  readonly actions: ActionFunction<
2064
2069
  {
2065
- behaviors: Set<Behavior>
2070
+ behaviors: Set<BehaviorConfig>
2066
2071
  converters: Set<Converter>
2067
2072
  getLegacySchema: () => PortableTextMemberSchemaTypes
2068
2073
  keyGenerator: () => string
@@ -2086,14 +2091,6 @@ declare const editorMachine: StateMachine<
2086
2091
  | InternalPatchEvent
2087
2092
  | MutationEvent
2088
2093
  | PatchesEvent
2089
- | {
2090
- type: 'add behavior'
2091
- behavior: Behavior
2092
- }
2093
- | {
2094
- type: 'remove behavior'
2095
- behavior: Behavior
2096
- }
2097
2094
  | {
2098
2095
  type: 'update readOnly'
2099
2096
  readOnly: boolean
@@ -2114,6 +2111,14 @@ declare const editorMachine: StateMachine<
2114
2111
  type: 'update maxBlocks'
2115
2112
  maxBlocks: number | undefined
2116
2113
  }
2114
+ | {
2115
+ type: 'add behavior'
2116
+ behaviorConfig: BehaviorConfig
2117
+ }
2118
+ | {
2119
+ type: 'remove behavior'
2120
+ behaviorConfig: BehaviorConfig
2121
+ }
2117
2122
  | {
2118
2123
  type: 'blur'
2119
2124
  editor: PortableTextSlateEditor
@@ -2267,7 +2272,7 @@ declare const editorMachine: StateMachine<
2267
2272
  readonly actions: readonly [
2268
2273
  ActionFunction<
2269
2274
  {
2270
- behaviors: Set<Behavior>
2275
+ behaviors: Set<BehaviorConfig>
2271
2276
  converters: Set<Converter>
2272
2277
  getLegacySchema: () => PortableTextMemberSchemaTypes
2273
2278
  keyGenerator: () => string
@@ -2291,14 +2296,6 @@ declare const editorMachine: StateMachine<
2291
2296
  | InternalPatchEvent
2292
2297
  | MutationEvent
2293
2298
  | PatchesEvent
2294
- | {
2295
- type: 'add behavior'
2296
- behavior: Behavior
2297
- }
2298
- | {
2299
- type: 'remove behavior'
2300
- behavior: Behavior
2301
- }
2302
2299
  | {
2303
2300
  type: 'update readOnly'
2304
2301
  readOnly: boolean
@@ -2319,6 +2316,14 @@ declare const editorMachine: StateMachine<
2319
2316
  type: 'update maxBlocks'
2320
2317
  maxBlocks: number | undefined
2321
2318
  }
2319
+ | {
2320
+ type: 'add behavior'
2321
+ behaviorConfig: BehaviorConfig
2322
+ }
2323
+ | {
2324
+ type: 'remove behavior'
2325
+ behaviorConfig: BehaviorConfig
2326
+ }
2322
2327
  | {
2323
2328
  type: 'blur'
2324
2329
  editor: PortableTextSlateEditor
@@ -2423,7 +2428,7 @@ declare const editorMachine: StateMachine<
2423
2428
  >,
2424
2429
  ActionFunction<
2425
2430
  {
2426
- behaviors: Set<Behavior>
2431
+ behaviors: Set<BehaviorConfig>
2427
2432
  converters: Set<Converter>
2428
2433
  getLegacySchema: () => PortableTextMemberSchemaTypes
2429
2434
  keyGenerator: () => string
@@ -2447,14 +2452,6 @@ declare const editorMachine: StateMachine<
2447
2452
  | InternalPatchEvent
2448
2453
  | MutationEvent
2449
2454
  | PatchesEvent
2450
- | {
2451
- type: 'add behavior'
2452
- behavior: Behavior
2453
- }
2454
- | {
2455
- type: 'remove behavior'
2456
- behavior: Behavior
2457
- }
2458
2455
  | {
2459
2456
  type: 'update readOnly'
2460
2457
  readOnly: boolean
@@ -2475,6 +2472,14 @@ declare const editorMachine: StateMachine<
2475
2472
  type: 'update maxBlocks'
2476
2473
  maxBlocks: number | undefined
2477
2474
  }
2475
+ | {
2476
+ type: 'add behavior'
2477
+ behaviorConfig: BehaviorConfig
2478
+ }
2479
+ | {
2480
+ type: 'remove behavior'
2481
+ behaviorConfig: BehaviorConfig
2482
+ }
2478
2483
  | {
2479
2484
  type: 'blur'
2480
2485
  editor: PortableTextSlateEditor
@@ -2628,7 +2633,7 @@ declare const editorMachine: StateMachine<
2628
2633
  readonly 'notify.unset': {
2629
2634
  readonly actions: ActionFunction<
2630
2635
  {
2631
- behaviors: Set<Behavior>
2636
+ behaviors: Set<BehaviorConfig>
2632
2637
  converters: Set<Converter>
2633
2638
  getLegacySchema: () => PortableTextMemberSchemaTypes
2634
2639
  keyGenerator: () => string
@@ -2652,14 +2657,6 @@ declare const editorMachine: StateMachine<
2652
2657
  | InternalPatchEvent
2653
2658
  | MutationEvent
2654
2659
  | PatchesEvent
2655
- | {
2656
- type: 'add behavior'
2657
- behavior: Behavior
2658
- }
2659
- | {
2660
- type: 'remove behavior'
2661
- behavior: Behavior
2662
- }
2663
2660
  | {
2664
2661
  type: 'update readOnly'
2665
2662
  readOnly: boolean
@@ -2680,6 +2677,14 @@ declare const editorMachine: StateMachine<
2680
2677
  type: 'update maxBlocks'
2681
2678
  maxBlocks: number | undefined
2682
2679
  }
2680
+ | {
2681
+ type: 'add behavior'
2682
+ behaviorConfig: BehaviorConfig
2683
+ }
2684
+ | {
2685
+ type: 'remove behavior'
2686
+ behaviorConfig: BehaviorConfig
2687
+ }
2683
2688
  | {
2684
2689
  type: 'blur'
2685
2690
  editor: PortableTextSlateEditor
@@ -2832,7 +2837,7 @@ declare const editorMachine: StateMachine<
2832
2837
  readonly 'notify.loading': {
2833
2838
  readonly actions: ActionFunction<
2834
2839
  {
2835
- behaviors: Set<Behavior>
2840
+ behaviors: Set<BehaviorConfig>
2836
2841
  converters: Set<Converter>
2837
2842
  getLegacySchema: () => PortableTextMemberSchemaTypes
2838
2843
  keyGenerator: () => string
@@ -2855,14 +2860,6 @@ declare const editorMachine: StateMachine<
2855
2860
  | InternalPatchEvent
2856
2861
  | MutationEvent
2857
2862
  | PatchesEvent
2858
- | {
2859
- type: 'add behavior'
2860
- behavior: Behavior
2861
- }
2862
- | {
2863
- type: 'remove behavior'
2864
- behavior: Behavior
2865
- }
2866
2863
  | {
2867
2864
  type: 'update readOnly'
2868
2865
  readOnly: boolean
@@ -2883,6 +2880,14 @@ declare const editorMachine: StateMachine<
2883
2880
  type: 'update maxBlocks'
2884
2881
  maxBlocks: number | undefined
2885
2882
  }
2883
+ | {
2884
+ type: 'add behavior'
2885
+ behaviorConfig: BehaviorConfig
2886
+ }
2887
+ | {
2888
+ type: 'remove behavior'
2889
+ behaviorConfig: BehaviorConfig
2890
+ }
2886
2891
  | {
2887
2892
  type: 'blur'
2888
2893
  editor: PortableTextSlateEditor
@@ -3035,7 +3040,7 @@ declare const editorMachine: StateMachine<
3035
3040
  readonly 'notify.value changed': {
3036
3041
  readonly actions: ActionFunction<
3037
3042
  {
3038
- behaviors: Set<Behavior>
3043
+ behaviors: Set<BehaviorConfig>
3039
3044
  converters: Set<Converter>
3040
3045
  getLegacySchema: () => PortableTextMemberSchemaTypes
3041
3046
  keyGenerator: () => string
@@ -3059,14 +3064,6 @@ declare const editorMachine: StateMachine<
3059
3064
  | InternalPatchEvent
3060
3065
  | MutationEvent
3061
3066
  | PatchesEvent
3062
- | {
3063
- type: 'add behavior'
3064
- behavior: Behavior
3065
- }
3066
- | {
3067
- type: 'remove behavior'
3068
- behavior: Behavior
3069
- }
3070
3067
  | {
3071
3068
  type: 'update readOnly'
3072
3069
  readOnly: boolean
@@ -3087,6 +3084,14 @@ declare const editorMachine: StateMachine<
3087
3084
  type: 'update maxBlocks'
3088
3085
  maxBlocks: number | undefined
3089
3086
  }
3087
+ | {
3088
+ type: 'add behavior'
3089
+ behaviorConfig: BehaviorConfig
3090
+ }
3091
+ | {
3092
+ type: 'remove behavior'
3093
+ behaviorConfig: BehaviorConfig
3094
+ }
3090
3095
  | {
3091
3096
  type: 'blur'
3092
3097
  editor: PortableTextSlateEditor
@@ -3245,7 +3250,7 @@ declare const editorMachine: StateMachine<
3245
3250
  readonly 'update key generator': {
3246
3251
  readonly actions: ActionFunction<
3247
3252
  {
3248
- behaviors: Set<Behavior>
3253
+ behaviors: Set<BehaviorConfig>
3249
3254
  converters: Set<Converter>
3250
3255
  getLegacySchema: () => PortableTextMemberSchemaTypes
3251
3256
  keyGenerator: () => string
@@ -3269,14 +3274,6 @@ declare const editorMachine: StateMachine<
3269
3274
  | InternalPatchEvent
3270
3275
  | MutationEvent
3271
3276
  | PatchesEvent
3272
- | {
3273
- type: 'add behavior'
3274
- behavior: Behavior
3275
- }
3276
- | {
3277
- type: 'remove behavior'
3278
- behavior: Behavior
3279
- }
3280
3277
  | {
3281
3278
  type: 'update readOnly'
3282
3279
  readOnly: boolean
@@ -3297,6 +3294,14 @@ declare const editorMachine: StateMachine<
3297
3294
  type: 'update maxBlocks'
3298
3295
  maxBlocks: number | undefined
3299
3296
  }
3297
+ | {
3298
+ type: 'add behavior'
3299
+ behaviorConfig: BehaviorConfig
3300
+ }
3301
+ | {
3302
+ type: 'remove behavior'
3303
+ behaviorConfig: BehaviorConfig
3304
+ }
3300
3305
  | {
3301
3306
  type: 'blur'
3302
3307
  editor: PortableTextSlateEditor
@@ -3406,7 +3411,7 @@ declare const editorMachine: StateMachine<
3406
3411
  readonly 'update value': {
3407
3412
  readonly actions: ActionFunction<
3408
3413
  {
3409
- behaviors: Set<Behavior>
3414
+ behaviors: Set<BehaviorConfig>
3410
3415
  converters: Set<Converter>
3411
3416
  getLegacySchema: () => PortableTextMemberSchemaTypes
3412
3417
  keyGenerator: () => string
@@ -3430,14 +3435,6 @@ declare const editorMachine: StateMachine<
3430
3435
  | InternalPatchEvent
3431
3436
  | MutationEvent
3432
3437
  | PatchesEvent
3433
- | {
3434
- type: 'add behavior'
3435
- behavior: Behavior
3436
- }
3437
- | {
3438
- type: 'remove behavior'
3439
- behavior: Behavior
3440
- }
3441
3438
  | {
3442
3439
  type: 'update readOnly'
3443
3440
  readOnly: boolean
@@ -3458,6 +3455,14 @@ declare const editorMachine: StateMachine<
3458
3455
  type: 'update maxBlocks'
3459
3456
  maxBlocks: number | undefined
3460
3457
  }
3458
+ | {
3459
+ type: 'add behavior'
3460
+ behaviorConfig: BehaviorConfig
3461
+ }
3462
+ | {
3463
+ type: 'remove behavior'
3464
+ behaviorConfig: BehaviorConfig
3465
+ }
3461
3466
  | {
3462
3467
  type: 'blur'
3463
3468
  editor: PortableTextSlateEditor
@@ -3564,7 +3569,7 @@ declare const editorMachine: StateMachine<
3564
3569
  readonly 'update maxBlocks': {
3565
3570
  readonly actions: ActionFunction<
3566
3571
  {
3567
- behaviors: Set<Behavior>
3572
+ behaviors: Set<BehaviorConfig>
3568
3573
  converters: Set<Converter>
3569
3574
  getLegacySchema: () => PortableTextMemberSchemaTypes
3570
3575
  keyGenerator: () => string
@@ -3588,14 +3593,6 @@ declare const editorMachine: StateMachine<
3588
3593
  | InternalPatchEvent
3589
3594
  | MutationEvent
3590
3595
  | PatchesEvent
3591
- | {
3592
- type: 'add behavior'
3593
- behavior: Behavior
3594
- }
3595
- | {
3596
- type: 'remove behavior'
3597
- behavior: Behavior
3598
- }
3599
3596
  | {
3600
3597
  type: 'update readOnly'
3601
3598
  readOnly: boolean
@@ -3616,6 +3613,14 @@ declare const editorMachine: StateMachine<
3616
3613
  type: 'update maxBlocks'
3617
3614
  maxBlocks: number | undefined
3618
3615
  }
3616
+ | {
3617
+ type: 'add behavior'
3618
+ behaviorConfig: BehaviorConfig
3619
+ }
3620
+ | {
3621
+ type: 'remove behavior'
3622
+ behaviorConfig: BehaviorConfig
3623
+ }
3619
3624
  | {
3620
3625
  type: 'blur'
3621
3626
  editor: PortableTextSlateEditor
@@ -3734,7 +3739,7 @@ declare const editorMachine: StateMachine<
3734
3739
  event,
3735
3740
  }: GuardArgs<
3736
3741
  {
3737
- behaviors: Set<Behavior>
3742
+ behaviors: Set<BehaviorConfig>
3738
3743
  converters: Set<Converter>
3739
3744
  getLegacySchema: () => PortableTextMemberSchemaTypes
3740
3745
  keyGenerator: () => string
@@ -3772,7 +3777,7 @@ declare const editorMachine: StateMachine<
3772
3777
  context,
3773
3778
  }: GuardArgs<
3774
3779
  {
3775
- behaviors: Set<Behavior>
3780
+ behaviors: Set<BehaviorConfig>
3776
3781
  converters: Set<Converter>
3777
3782
  getLegacySchema: () => PortableTextMemberSchemaTypes
3778
3783
  keyGenerator: () => string
@@ -3809,7 +3814,7 @@ declare const editorMachine: StateMachine<
3809
3814
  event,
3810
3815
  }: GuardArgs<
3811
3816
  {
3812
- behaviors: Set<Behavior>
3817
+ behaviors: Set<BehaviorConfig>
3813
3818
  converters: Set<Converter>
3814
3819
  getLegacySchema: () => PortableTextMemberSchemaTypes
3815
3820
  keyGenerator: () => string
@@ -3845,7 +3850,7 @@ declare const editorMachine: StateMachine<
3845
3850
  event,
3846
3851
  }: GuardArgs<
3847
3852
  {
3848
- behaviors: Set<Behavior>
3853
+ behaviors: Set<BehaviorConfig>
3849
3854
  converters: Set<Converter>
3850
3855
  getLegacySchema: () => PortableTextMemberSchemaTypes
3851
3856
  keyGenerator: () => string
@@ -3881,7 +3886,7 @@ declare const editorMachine: StateMachine<
3881
3886
  readonly actions: readonly [
3882
3887
  ActionFunction<
3883
3888
  {
3884
- behaviors: Set<Behavior>
3889
+ behaviors: Set<BehaviorConfig>
3885
3890
  converters: Set<Converter>
3886
3891
  getLegacySchema: () => PortableTextMemberSchemaTypes
3887
3892
  keyGenerator: () => string
@@ -3905,14 +3910,6 @@ declare const editorMachine: StateMachine<
3905
3910
  | InternalPatchEvent
3906
3911
  | MutationEvent
3907
3912
  | PatchesEvent
3908
- | {
3909
- type: 'add behavior'
3910
- behavior: Behavior
3911
- }
3912
- | {
3913
- type: 'remove behavior'
3914
- behavior: Behavior
3915
- }
3916
3913
  | {
3917
3914
  type: 'update readOnly'
3918
3915
  readOnly: boolean
@@ -3933,6 +3930,14 @@ declare const editorMachine: StateMachine<
3933
3930
  type: 'update maxBlocks'
3934
3931
  maxBlocks: number | undefined
3935
3932
  }
3933
+ | {
3934
+ type: 'add behavior'
3935
+ behaviorConfig: BehaviorConfig
3936
+ }
3937
+ | {
3938
+ type: 'remove behavior'
3939
+ behaviorConfig: BehaviorConfig
3940
+ }
3936
3941
  | {
3937
3942
  type: 'blur'
3938
3943
  editor: PortableTextSlateEditor
@@ -4046,7 +4051,7 @@ declare const editorMachine: StateMachine<
4046
4051
  readonly actions: readonly [
4047
4052
  ActionFunction<
4048
4053
  {
4049
- behaviors: Set<Behavior>
4054
+ behaviors: Set<BehaviorConfig>
4050
4055
  converters: Set<Converter>
4051
4056
  getLegacySchema: () => PortableTextMemberSchemaTypes
4052
4057
  keyGenerator: () => string
@@ -4073,14 +4078,6 @@ declare const editorMachine: StateMachine<
4073
4078
  | InternalPatchEvent
4074
4079
  | MutationEvent
4075
4080
  | PatchesEvent
4076
- | {
4077
- type: 'add behavior'
4078
- behavior: Behavior
4079
- }
4080
- | {
4081
- type: 'remove behavior'
4082
- behavior: Behavior
4083
- }
4084
4081
  | {
4085
4082
  type: 'update readOnly'
4086
4083
  readOnly: boolean
@@ -4101,6 +4098,14 @@ declare const editorMachine: StateMachine<
4101
4098
  type: 'update maxBlocks'
4102
4099
  maxBlocks: number | undefined
4103
4100
  }
4101
+ | {
4102
+ type: 'add behavior'
4103
+ behaviorConfig: BehaviorConfig
4104
+ }
4105
+ | {
4106
+ type: 'remove behavior'
4107
+ behaviorConfig: BehaviorConfig
4108
+ }
4104
4109
  | {
4105
4110
  type: 'blur'
4106
4111
  editor: PortableTextSlateEditor
@@ -4238,7 +4243,7 @@ declare const editorMachine: StateMachine<
4238
4243
  context,
4239
4244
  }: ActionArgs<
4240
4245
  {
4241
- behaviors: Set<Behavior>
4246
+ behaviors: Set<BehaviorConfig>
4242
4247
  converters: Set<Converter>
4243
4248
  getLegacySchema: () => PortableTextMemberSchemaTypes
4244
4249
  keyGenerator: () => string
@@ -4258,14 +4263,6 @@ declare const editorMachine: StateMachine<
4258
4263
  | InternalPatchEvent
4259
4264
  | MutationEvent
4260
4265
  | PatchesEvent
4261
- | {
4262
- type: 'add behavior'
4263
- behavior: Behavior
4264
- }
4265
- | {
4266
- type: 'remove behavior'
4267
- behavior: Behavior
4268
- }
4269
4266
  | {
4270
4267
  type: 'update readOnly'
4271
4268
  readOnly: boolean
@@ -4286,6 +4283,14 @@ declare const editorMachine: StateMachine<
4286
4283
  type: 'update maxBlocks'
4287
4284
  maxBlocks: number | undefined
4288
4285
  }
4286
+ | {
4287
+ type: 'add behavior'
4288
+ behaviorConfig: BehaviorConfig
4289
+ }
4290
+ | {
4291
+ type: 'remove behavior'
4292
+ behaviorConfig: BehaviorConfig
4293
+ }
4289
4294
  | {
4290
4295
  type: 'blur'
4291
4296
  editor: PortableTextSlateEditor
@@ -4384,14 +4389,6 @@ declare const editorMachine: StateMachine<
4384
4389
  | InternalPatchEvent
4385
4390
  | MutationEvent
4386
4391
  | PatchesEvent
4387
- | {
4388
- type: 'add behavior'
4389
- behavior: Behavior
4390
- }
4391
- | {
4392
- type: 'remove behavior'
4393
- behavior: Behavior
4394
- }
4395
4392
  | {
4396
4393
  type: 'update readOnly'
4397
4394
  readOnly: boolean
@@ -4412,6 +4409,14 @@ declare const editorMachine: StateMachine<
4412
4409
  type: 'update maxBlocks'
4413
4410
  maxBlocks: number | undefined
4414
4411
  }
4412
+ | {
4413
+ type: 'add behavior'
4414
+ behaviorConfig: BehaviorConfig
4415
+ }
4416
+ | {
4417
+ type: 'remove behavior'
4418
+ behaviorConfig: BehaviorConfig
4419
+ }
4415
4420
  | {
4416
4421
  type: 'blur'
4417
4422
  editor: PortableTextSlateEditor
@@ -4510,7 +4515,7 @@ declare const editorMachine: StateMachine<
4510
4515
  >) => void,
4511
4516
  ActionFunction<
4512
4517
  {
4513
- behaviors: Set<Behavior>
4518
+ behaviors: Set<BehaviorConfig>
4514
4519
  converters: Set<Converter>
4515
4520
  getLegacySchema: () => PortableTextMemberSchemaTypes
4516
4521
  keyGenerator: () => string
@@ -4530,14 +4535,6 @@ declare const editorMachine: StateMachine<
4530
4535
  | InternalPatchEvent
4531
4536
  | MutationEvent
4532
4537
  | PatchesEvent
4533
- | {
4534
- type: 'add behavior'
4535
- behavior: Behavior
4536
- }
4537
- | {
4538
- type: 'remove behavior'
4539
- behavior: Behavior
4540
- }
4541
4538
  | {
4542
4539
  type: 'update readOnly'
4543
4540
  readOnly: boolean
@@ -4558,6 +4555,14 @@ declare const editorMachine: StateMachine<
4558
4555
  type: 'update maxBlocks'
4559
4556
  maxBlocks: number | undefined
4560
4557
  }
4558
+ | {
4559
+ type: 'add behavior'
4560
+ behaviorConfig: BehaviorConfig
4561
+ }
4562
+ | {
4563
+ type: 'remove behavior'
4564
+ behaviorConfig: BehaviorConfig
4565
+ }
4561
4566
  | {
4562
4567
  type: 'blur'
4563
4568
  editor: PortableTextSlateEditor
@@ -4656,14 +4661,6 @@ declare const editorMachine: StateMachine<
4656
4661
  | InternalPatchEvent
4657
4662
  | MutationEvent
4658
4663
  | PatchesEvent
4659
- | {
4660
- type: 'add behavior'
4661
- behavior: Behavior
4662
- }
4663
- | {
4664
- type: 'remove behavior'
4665
- behavior: Behavior
4666
- }
4667
4664
  | {
4668
4665
  type: 'update readOnly'
4669
4666
  readOnly: boolean
@@ -4684,6 +4681,14 @@ declare const editorMachine: StateMachine<
4684
4681
  type: 'update maxBlocks'
4685
4682
  maxBlocks: number | undefined
4686
4683
  }
4684
+ | {
4685
+ type: 'add behavior'
4686
+ behaviorConfig: BehaviorConfig
4687
+ }
4688
+ | {
4689
+ type: 'remove behavior'
4690
+ behaviorConfig: BehaviorConfig
4691
+ }
4687
4692
  | {
4688
4693
  type: 'blur'
4689
4694
  editor: PortableTextSlateEditor
@@ -4837,7 +4842,7 @@ declare const editorMachine: StateMachine<
4837
4842
  readonly actions: readonly [
4838
4843
  ActionFunction<
4839
4844
  {
4840
- behaviors: Set<Behavior>
4845
+ behaviors: Set<BehaviorConfig>
4841
4846
  converters: Set<Converter>
4842
4847
  getLegacySchema: () => PortableTextMemberSchemaTypes
4843
4848
  keyGenerator: () => string
@@ -4862,14 +4867,6 @@ declare const editorMachine: StateMachine<
4862
4867
  | InternalPatchEvent
4863
4868
  | MutationEvent
4864
4869
  | PatchesEvent
4865
- | {
4866
- type: 'add behavior'
4867
- behavior: Behavior
4868
- }
4869
- | {
4870
- type: 'remove behavior'
4871
- behavior: Behavior
4872
- }
4873
4870
  | {
4874
4871
  type: 'update readOnly'
4875
4872
  readOnly: boolean
@@ -4890,6 +4887,14 @@ declare const editorMachine: StateMachine<
4890
4887
  type: 'update maxBlocks'
4891
4888
  maxBlocks: number | undefined
4892
4889
  }
4890
+ | {
4891
+ type: 'add behavior'
4892
+ behaviorConfig: BehaviorConfig
4893
+ }
4894
+ | {
4895
+ type: 'remove behavior'
4896
+ behaviorConfig: BehaviorConfig
4897
+ }
4893
4898
  | {
4894
4899
  type: 'blur'
4895
4900
  editor: PortableTextSlateEditor
@@ -5121,6 +5126,15 @@ declare const editorMachine: StateMachine<
5121
5126
  }
5122
5127
  >
5123
5128
 
5129
+ declare type EditorPriority = {
5130
+ id: string
5131
+ name?: string
5132
+ reference?: {
5133
+ priority: EditorPriority
5134
+ importance: 'higher' | 'lower'
5135
+ }
5136
+ }
5137
+
5124
5138
  /**
5125
5139
  * @public
5126
5140
  */