@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
@@ -285,6 +285,11 @@ declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
285
285
  guardResponse: TGuardResponse,
286
286
  ) => Array<BehaviorAction>
287
287
 
288
+ declare type BehaviorConfig = {
289
+ behavior: Behavior
290
+ priority: EditorPriority
291
+ }
292
+
288
293
  /**
289
294
  * @beta
290
295
  */
@@ -644,7 +649,7 @@ declare type EditorContext = {
644
649
  */
645
650
  declare const editorMachine: StateMachine<
646
651
  {
647
- behaviors: Set<Behavior>
652
+ behaviors: Set<BehaviorConfig>
648
653
  converters: Set<Converter>
649
654
  getLegacySchema: () => PortableTextMemberSchemaTypes
650
655
  keyGenerator: () => string
@@ -664,14 +669,6 @@ declare const editorMachine: StateMachine<
664
669
  | InternalPatchEvent
665
670
  | MutationEvent
666
671
  | PatchesEvent
667
- | {
668
- type: 'add behavior'
669
- behavior: Behavior
670
- }
671
- | {
672
- type: 'remove behavior'
673
- behavior: Behavior
674
- }
675
672
  | {
676
673
  type: 'update readOnly'
677
674
  readOnly: boolean
@@ -692,6 +689,14 @@ declare const editorMachine: StateMachine<
692
689
  type: 'update maxBlocks'
693
690
  maxBlocks: number | undefined
694
691
  }
692
+ | {
693
+ type: 'add behavior'
694
+ behaviorConfig: BehaviorConfig
695
+ }
696
+ | {
697
+ type: 'remove behavior'
698
+ behaviorConfig: BehaviorConfig
699
+ }
695
700
  | {
696
701
  type: 'blur'
697
702
  editor: PortableTextSlateEditor
@@ -988,7 +993,7 @@ declare const editorMachine: StateMachine<
988
993
  self: ActorRef<
989
994
  MachineSnapshot<
990
995
  {
991
- behaviors: Set<Behavior>
996
+ behaviors: Set<BehaviorConfig>
992
997
  converters: Set<Converter>
993
998
  getLegacySchema: () => PortableTextMemberSchemaTypes
994
999
  keyGenerator: () => string
@@ -1008,14 +1013,6 @@ declare const editorMachine: StateMachine<
1008
1013
  | InternalPatchEvent
1009
1014
  | MutationEvent
1010
1015
  | PatchesEvent
1011
- | {
1012
- type: 'add behavior'
1013
- behavior: Behavior
1014
- }
1015
- | {
1016
- type: 'remove behavior'
1017
- behavior: Behavior
1018
- }
1019
1016
  | {
1020
1017
  type: 'update readOnly'
1021
1018
  readOnly: boolean
@@ -1036,6 +1033,14 @@ declare const editorMachine: StateMachine<
1036
1033
  type: 'update maxBlocks'
1037
1034
  maxBlocks: number | undefined
1038
1035
  }
1036
+ | {
1037
+ type: 'add behavior'
1038
+ behaviorConfig: BehaviorConfig
1039
+ }
1040
+ | {
1041
+ type: 'remove behavior'
1042
+ behaviorConfig: BehaviorConfig
1043
+ }
1039
1044
  | {
1040
1045
  type: 'blur'
1041
1046
  editor: PortableTextSlateEditor
@@ -1141,14 +1146,6 @@ declare const editorMachine: StateMachine<
1141
1146
  | InternalPatchEvent
1142
1147
  | MutationEvent
1143
1148
  | PatchesEvent
1144
- | {
1145
- type: 'add behavior'
1146
- behavior: Behavior
1147
- }
1148
- | {
1149
- type: 'remove behavior'
1150
- behavior: Behavior
1151
- }
1152
1149
  | {
1153
1150
  type: 'update readOnly'
1154
1151
  readOnly: boolean
@@ -1169,6 +1166,14 @@ declare const editorMachine: StateMachine<
1169
1166
  type: 'update maxBlocks'
1170
1167
  maxBlocks: number | undefined
1171
1168
  }
1169
+ | {
1170
+ type: 'add behavior'
1171
+ behaviorConfig: BehaviorConfig
1172
+ }
1173
+ | {
1174
+ type: 'remove behavior'
1175
+ behaviorConfig: BehaviorConfig
1176
+ }
1172
1177
  | {
1173
1178
  type: 'blur'
1174
1179
  editor: PortableTextSlateEditor
@@ -1283,7 +1288,7 @@ declare const editorMachine: StateMachine<
1283
1288
  readonly 'notify.blurred': {
1284
1289
  readonly actions: ActionFunction<
1285
1290
  {
1286
- behaviors: Set<Behavior>
1291
+ behaviors: Set<BehaviorConfig>
1287
1292
  converters: Set<Converter>
1288
1293
  getLegacySchema: () => PortableTextMemberSchemaTypes
1289
1294
  keyGenerator: () => string
@@ -1307,14 +1312,6 @@ declare const editorMachine: StateMachine<
1307
1312
  | InternalPatchEvent
1308
1313
  | MutationEvent
1309
1314
  | PatchesEvent
1310
- | {
1311
- type: 'add behavior'
1312
- behavior: Behavior
1313
- }
1314
- | {
1315
- type: 'remove behavior'
1316
- behavior: Behavior
1317
- }
1318
1315
  | {
1319
1316
  type: 'update readOnly'
1320
1317
  readOnly: boolean
@@ -1335,6 +1332,14 @@ declare const editorMachine: StateMachine<
1335
1332
  type: 'update maxBlocks'
1336
1333
  maxBlocks: number | undefined
1337
1334
  }
1335
+ | {
1336
+ type: 'add behavior'
1337
+ behaviorConfig: BehaviorConfig
1338
+ }
1339
+ | {
1340
+ type: 'remove behavior'
1341
+ behaviorConfig: BehaviorConfig
1342
+ }
1338
1343
  | {
1339
1344
  type: 'blur'
1340
1345
  editor: PortableTextSlateEditor
@@ -1487,7 +1492,7 @@ declare const editorMachine: StateMachine<
1487
1492
  readonly 'notify.done loading': {
1488
1493
  readonly actions: ActionFunction<
1489
1494
  {
1490
- behaviors: Set<Behavior>
1495
+ behaviors: Set<BehaviorConfig>
1491
1496
  converters: Set<Converter>
1492
1497
  getLegacySchema: () => PortableTextMemberSchemaTypes
1493
1498
  keyGenerator: () => string
@@ -1510,14 +1515,6 @@ declare const editorMachine: StateMachine<
1510
1515
  | InternalPatchEvent
1511
1516
  | MutationEvent
1512
1517
  | PatchesEvent
1513
- | {
1514
- type: 'add behavior'
1515
- behavior: Behavior
1516
- }
1517
- | {
1518
- type: 'remove behavior'
1519
- behavior: Behavior
1520
- }
1521
1518
  | {
1522
1519
  type: 'update readOnly'
1523
1520
  readOnly: boolean
@@ -1538,6 +1535,14 @@ declare const editorMachine: StateMachine<
1538
1535
  type: 'update maxBlocks'
1539
1536
  maxBlocks: number | undefined
1540
1537
  }
1538
+ | {
1539
+ type: 'add behavior'
1540
+ behaviorConfig: BehaviorConfig
1541
+ }
1542
+ | {
1543
+ type: 'remove behavior'
1544
+ behaviorConfig: BehaviorConfig
1545
+ }
1541
1546
  | {
1542
1547
  type: 'blur'
1543
1548
  editor: PortableTextSlateEditor
@@ -1690,7 +1695,7 @@ declare const editorMachine: StateMachine<
1690
1695
  readonly 'notify.error': {
1691
1696
  readonly actions: ActionFunction<
1692
1697
  {
1693
- behaviors: Set<Behavior>
1698
+ behaviors: Set<BehaviorConfig>
1694
1699
  converters: Set<Converter>
1695
1700
  getLegacySchema: () => PortableTextMemberSchemaTypes
1696
1701
  keyGenerator: () => string
@@ -1716,14 +1721,6 @@ declare const editorMachine: StateMachine<
1716
1721
  | InternalPatchEvent
1717
1722
  | MutationEvent
1718
1723
  | PatchesEvent
1719
- | {
1720
- type: 'add behavior'
1721
- behavior: Behavior
1722
- }
1723
- | {
1724
- type: 'remove behavior'
1725
- behavior: Behavior
1726
- }
1727
1724
  | {
1728
1725
  type: 'update readOnly'
1729
1726
  readOnly: boolean
@@ -1744,6 +1741,14 @@ declare const editorMachine: StateMachine<
1744
1741
  type: 'update maxBlocks'
1745
1742
  maxBlocks: number | undefined
1746
1743
  }
1744
+ | {
1745
+ type: 'add behavior'
1746
+ behaviorConfig: BehaviorConfig
1747
+ }
1748
+ | {
1749
+ type: 'remove behavior'
1750
+ behaviorConfig: BehaviorConfig
1751
+ }
1747
1752
  | {
1748
1753
  type: 'blur'
1749
1754
  editor: PortableTextSlateEditor
@@ -1896,7 +1901,7 @@ declare const editorMachine: StateMachine<
1896
1901
  readonly 'notify.invalid value': {
1897
1902
  readonly actions: ActionFunction<
1898
1903
  {
1899
- behaviors: Set<Behavior>
1904
+ behaviors: Set<BehaviorConfig>
1900
1905
  converters: Set<Converter>
1901
1906
  getLegacySchema: () => PortableTextMemberSchemaTypes
1902
1907
  keyGenerator: () => string
@@ -1921,14 +1926,6 @@ declare const editorMachine: StateMachine<
1921
1926
  | InternalPatchEvent
1922
1927
  | MutationEvent
1923
1928
  | PatchesEvent
1924
- | {
1925
- type: 'add behavior'
1926
- behavior: Behavior
1927
- }
1928
- | {
1929
- type: 'remove behavior'
1930
- behavior: Behavior
1931
- }
1932
1929
  | {
1933
1930
  type: 'update readOnly'
1934
1931
  readOnly: boolean
@@ -1949,6 +1946,14 @@ declare const editorMachine: StateMachine<
1949
1946
  type: 'update maxBlocks'
1950
1947
  maxBlocks: number | undefined
1951
1948
  }
1949
+ | {
1950
+ type: 'add behavior'
1951
+ behaviorConfig: BehaviorConfig
1952
+ }
1953
+ | {
1954
+ type: 'remove behavior'
1955
+ behaviorConfig: BehaviorConfig
1956
+ }
1952
1957
  | {
1953
1958
  type: 'blur'
1954
1959
  editor: PortableTextSlateEditor
@@ -2101,7 +2106,7 @@ declare const editorMachine: StateMachine<
2101
2106
  readonly 'notify.focused': {
2102
2107
  readonly actions: ActionFunction<
2103
2108
  {
2104
- behaviors: Set<Behavior>
2109
+ behaviors: Set<BehaviorConfig>
2105
2110
  converters: Set<Converter>
2106
2111
  getLegacySchema: () => PortableTextMemberSchemaTypes
2107
2112
  keyGenerator: () => string
@@ -2125,14 +2130,6 @@ declare const editorMachine: StateMachine<
2125
2130
  | InternalPatchEvent
2126
2131
  | MutationEvent
2127
2132
  | PatchesEvent
2128
- | {
2129
- type: 'add behavior'
2130
- behavior: Behavior
2131
- }
2132
- | {
2133
- type: 'remove behavior'
2134
- behavior: Behavior
2135
- }
2136
2133
  | {
2137
2134
  type: 'update readOnly'
2138
2135
  readOnly: boolean
@@ -2153,6 +2150,14 @@ declare const editorMachine: StateMachine<
2153
2150
  type: 'update maxBlocks'
2154
2151
  maxBlocks: number | undefined
2155
2152
  }
2153
+ | {
2154
+ type: 'add behavior'
2155
+ behaviorConfig: BehaviorConfig
2156
+ }
2157
+ | {
2158
+ type: 'remove behavior'
2159
+ behaviorConfig: BehaviorConfig
2160
+ }
2156
2161
  | {
2157
2162
  type: 'blur'
2158
2163
  editor: PortableTextSlateEditor
@@ -2306,7 +2311,7 @@ declare const editorMachine: StateMachine<
2306
2311
  readonly actions: readonly [
2307
2312
  ActionFunction<
2308
2313
  {
2309
- behaviors: Set<Behavior>
2314
+ behaviors: Set<BehaviorConfig>
2310
2315
  converters: Set<Converter>
2311
2316
  getLegacySchema: () => PortableTextMemberSchemaTypes
2312
2317
  keyGenerator: () => string
@@ -2330,14 +2335,6 @@ declare const editorMachine: StateMachine<
2330
2335
  | InternalPatchEvent
2331
2336
  | MutationEvent
2332
2337
  | PatchesEvent
2333
- | {
2334
- type: 'add behavior'
2335
- behavior: Behavior
2336
- }
2337
- | {
2338
- type: 'remove behavior'
2339
- behavior: Behavior
2340
- }
2341
2338
  | {
2342
2339
  type: 'update readOnly'
2343
2340
  readOnly: boolean
@@ -2358,6 +2355,14 @@ declare const editorMachine: StateMachine<
2358
2355
  type: 'update maxBlocks'
2359
2356
  maxBlocks: number | undefined
2360
2357
  }
2358
+ | {
2359
+ type: 'add behavior'
2360
+ behaviorConfig: BehaviorConfig
2361
+ }
2362
+ | {
2363
+ type: 'remove behavior'
2364
+ behaviorConfig: BehaviorConfig
2365
+ }
2361
2366
  | {
2362
2367
  type: 'blur'
2363
2368
  editor: PortableTextSlateEditor
@@ -2462,7 +2467,7 @@ declare const editorMachine: StateMachine<
2462
2467
  >,
2463
2468
  ActionFunction<
2464
2469
  {
2465
- behaviors: Set<Behavior>
2470
+ behaviors: Set<BehaviorConfig>
2466
2471
  converters: Set<Converter>
2467
2472
  getLegacySchema: () => PortableTextMemberSchemaTypes
2468
2473
  keyGenerator: () => string
@@ -2486,14 +2491,6 @@ declare const editorMachine: StateMachine<
2486
2491
  | InternalPatchEvent
2487
2492
  | MutationEvent
2488
2493
  | PatchesEvent
2489
- | {
2490
- type: 'add behavior'
2491
- behavior: Behavior
2492
- }
2493
- | {
2494
- type: 'remove behavior'
2495
- behavior: Behavior
2496
- }
2497
2494
  | {
2498
2495
  type: 'update readOnly'
2499
2496
  readOnly: boolean
@@ -2514,6 +2511,14 @@ declare const editorMachine: StateMachine<
2514
2511
  type: 'update maxBlocks'
2515
2512
  maxBlocks: number | undefined
2516
2513
  }
2514
+ | {
2515
+ type: 'add behavior'
2516
+ behaviorConfig: BehaviorConfig
2517
+ }
2518
+ | {
2519
+ type: 'remove behavior'
2520
+ behaviorConfig: BehaviorConfig
2521
+ }
2517
2522
  | {
2518
2523
  type: 'blur'
2519
2524
  editor: PortableTextSlateEditor
@@ -2667,7 +2672,7 @@ declare const editorMachine: StateMachine<
2667
2672
  readonly 'notify.unset': {
2668
2673
  readonly actions: ActionFunction<
2669
2674
  {
2670
- behaviors: Set<Behavior>
2675
+ behaviors: Set<BehaviorConfig>
2671
2676
  converters: Set<Converter>
2672
2677
  getLegacySchema: () => PortableTextMemberSchemaTypes
2673
2678
  keyGenerator: () => string
@@ -2691,14 +2696,6 @@ declare const editorMachine: StateMachine<
2691
2696
  | InternalPatchEvent
2692
2697
  | MutationEvent
2693
2698
  | PatchesEvent
2694
- | {
2695
- type: 'add behavior'
2696
- behavior: Behavior
2697
- }
2698
- | {
2699
- type: 'remove behavior'
2700
- behavior: Behavior
2701
- }
2702
2699
  | {
2703
2700
  type: 'update readOnly'
2704
2701
  readOnly: boolean
@@ -2719,6 +2716,14 @@ declare const editorMachine: StateMachine<
2719
2716
  type: 'update maxBlocks'
2720
2717
  maxBlocks: number | undefined
2721
2718
  }
2719
+ | {
2720
+ type: 'add behavior'
2721
+ behaviorConfig: BehaviorConfig
2722
+ }
2723
+ | {
2724
+ type: 'remove behavior'
2725
+ behaviorConfig: BehaviorConfig
2726
+ }
2722
2727
  | {
2723
2728
  type: 'blur'
2724
2729
  editor: PortableTextSlateEditor
@@ -2871,7 +2876,7 @@ declare const editorMachine: StateMachine<
2871
2876
  readonly 'notify.loading': {
2872
2877
  readonly actions: ActionFunction<
2873
2878
  {
2874
- behaviors: Set<Behavior>
2879
+ behaviors: Set<BehaviorConfig>
2875
2880
  converters: Set<Converter>
2876
2881
  getLegacySchema: () => PortableTextMemberSchemaTypes
2877
2882
  keyGenerator: () => string
@@ -2894,14 +2899,6 @@ declare const editorMachine: StateMachine<
2894
2899
  | InternalPatchEvent
2895
2900
  | MutationEvent
2896
2901
  | PatchesEvent
2897
- | {
2898
- type: 'add behavior'
2899
- behavior: Behavior
2900
- }
2901
- | {
2902
- type: 'remove behavior'
2903
- behavior: Behavior
2904
- }
2905
2902
  | {
2906
2903
  type: 'update readOnly'
2907
2904
  readOnly: boolean
@@ -2922,6 +2919,14 @@ declare const editorMachine: StateMachine<
2922
2919
  type: 'update maxBlocks'
2923
2920
  maxBlocks: number | undefined
2924
2921
  }
2922
+ | {
2923
+ type: 'add behavior'
2924
+ behaviorConfig: BehaviorConfig
2925
+ }
2926
+ | {
2927
+ type: 'remove behavior'
2928
+ behaviorConfig: BehaviorConfig
2929
+ }
2925
2930
  | {
2926
2931
  type: 'blur'
2927
2932
  editor: PortableTextSlateEditor
@@ -3074,7 +3079,7 @@ declare const editorMachine: StateMachine<
3074
3079
  readonly 'notify.value changed': {
3075
3080
  readonly actions: ActionFunction<
3076
3081
  {
3077
- behaviors: Set<Behavior>
3082
+ behaviors: Set<BehaviorConfig>
3078
3083
  converters: Set<Converter>
3079
3084
  getLegacySchema: () => PortableTextMemberSchemaTypes
3080
3085
  keyGenerator: () => string
@@ -3098,14 +3103,6 @@ declare const editorMachine: StateMachine<
3098
3103
  | InternalPatchEvent
3099
3104
  | MutationEvent
3100
3105
  | PatchesEvent
3101
- | {
3102
- type: 'add behavior'
3103
- behavior: Behavior
3104
- }
3105
- | {
3106
- type: 'remove behavior'
3107
- behavior: Behavior
3108
- }
3109
3106
  | {
3110
3107
  type: 'update readOnly'
3111
3108
  readOnly: boolean
@@ -3126,6 +3123,14 @@ declare const editorMachine: StateMachine<
3126
3123
  type: 'update maxBlocks'
3127
3124
  maxBlocks: number | undefined
3128
3125
  }
3126
+ | {
3127
+ type: 'add behavior'
3128
+ behaviorConfig: BehaviorConfig
3129
+ }
3130
+ | {
3131
+ type: 'remove behavior'
3132
+ behaviorConfig: BehaviorConfig
3133
+ }
3129
3134
  | {
3130
3135
  type: 'blur'
3131
3136
  editor: PortableTextSlateEditor
@@ -3284,7 +3289,7 @@ declare const editorMachine: StateMachine<
3284
3289
  readonly 'update key generator': {
3285
3290
  readonly actions: ActionFunction<
3286
3291
  {
3287
- behaviors: Set<Behavior>
3292
+ behaviors: Set<BehaviorConfig>
3288
3293
  converters: Set<Converter>
3289
3294
  getLegacySchema: () => PortableTextMemberSchemaTypes
3290
3295
  keyGenerator: () => string
@@ -3308,14 +3313,6 @@ declare const editorMachine: StateMachine<
3308
3313
  | InternalPatchEvent
3309
3314
  | MutationEvent
3310
3315
  | PatchesEvent
3311
- | {
3312
- type: 'add behavior'
3313
- behavior: Behavior
3314
- }
3315
- | {
3316
- type: 'remove behavior'
3317
- behavior: Behavior
3318
- }
3319
3316
  | {
3320
3317
  type: 'update readOnly'
3321
3318
  readOnly: boolean
@@ -3336,6 +3333,14 @@ declare const editorMachine: StateMachine<
3336
3333
  type: 'update maxBlocks'
3337
3334
  maxBlocks: number | undefined
3338
3335
  }
3336
+ | {
3337
+ type: 'add behavior'
3338
+ behaviorConfig: BehaviorConfig
3339
+ }
3340
+ | {
3341
+ type: 'remove behavior'
3342
+ behaviorConfig: BehaviorConfig
3343
+ }
3339
3344
  | {
3340
3345
  type: 'blur'
3341
3346
  editor: PortableTextSlateEditor
@@ -3445,7 +3450,7 @@ declare const editorMachine: StateMachine<
3445
3450
  readonly 'update value': {
3446
3451
  readonly actions: ActionFunction<
3447
3452
  {
3448
- behaviors: Set<Behavior>
3453
+ behaviors: Set<BehaviorConfig>
3449
3454
  converters: Set<Converter>
3450
3455
  getLegacySchema: () => PortableTextMemberSchemaTypes
3451
3456
  keyGenerator: () => string
@@ -3469,14 +3474,6 @@ declare const editorMachine: StateMachine<
3469
3474
  | InternalPatchEvent
3470
3475
  | MutationEvent
3471
3476
  | PatchesEvent
3472
- | {
3473
- type: 'add behavior'
3474
- behavior: Behavior
3475
- }
3476
- | {
3477
- type: 'remove behavior'
3478
- behavior: Behavior
3479
- }
3480
3477
  | {
3481
3478
  type: 'update readOnly'
3482
3479
  readOnly: boolean
@@ -3497,6 +3494,14 @@ declare const editorMachine: StateMachine<
3497
3494
  type: 'update maxBlocks'
3498
3495
  maxBlocks: number | undefined
3499
3496
  }
3497
+ | {
3498
+ type: 'add behavior'
3499
+ behaviorConfig: BehaviorConfig
3500
+ }
3501
+ | {
3502
+ type: 'remove behavior'
3503
+ behaviorConfig: BehaviorConfig
3504
+ }
3500
3505
  | {
3501
3506
  type: 'blur'
3502
3507
  editor: PortableTextSlateEditor
@@ -3603,7 +3608,7 @@ declare const editorMachine: StateMachine<
3603
3608
  readonly 'update maxBlocks': {
3604
3609
  readonly actions: ActionFunction<
3605
3610
  {
3606
- behaviors: Set<Behavior>
3611
+ behaviors: Set<BehaviorConfig>
3607
3612
  converters: Set<Converter>
3608
3613
  getLegacySchema: () => PortableTextMemberSchemaTypes
3609
3614
  keyGenerator: () => string
@@ -3627,14 +3632,6 @@ declare const editorMachine: StateMachine<
3627
3632
  | InternalPatchEvent
3628
3633
  | MutationEvent
3629
3634
  | PatchesEvent
3630
- | {
3631
- type: 'add behavior'
3632
- behavior: Behavior
3633
- }
3634
- | {
3635
- type: 'remove behavior'
3636
- behavior: Behavior
3637
- }
3638
3635
  | {
3639
3636
  type: 'update readOnly'
3640
3637
  readOnly: boolean
@@ -3655,6 +3652,14 @@ declare const editorMachine: StateMachine<
3655
3652
  type: 'update maxBlocks'
3656
3653
  maxBlocks: number | undefined
3657
3654
  }
3655
+ | {
3656
+ type: 'add behavior'
3657
+ behaviorConfig: BehaviorConfig
3658
+ }
3659
+ | {
3660
+ type: 'remove behavior'
3661
+ behaviorConfig: BehaviorConfig
3662
+ }
3658
3663
  | {
3659
3664
  type: 'blur'
3660
3665
  editor: PortableTextSlateEditor
@@ -3773,7 +3778,7 @@ declare const editorMachine: StateMachine<
3773
3778
  event,
3774
3779
  }: GuardArgs<
3775
3780
  {
3776
- behaviors: Set<Behavior>
3781
+ behaviors: Set<BehaviorConfig>
3777
3782
  converters: Set<Converter>
3778
3783
  getLegacySchema: () => PortableTextMemberSchemaTypes
3779
3784
  keyGenerator: () => string
@@ -3811,7 +3816,7 @@ declare const editorMachine: StateMachine<
3811
3816
  context,
3812
3817
  }: GuardArgs<
3813
3818
  {
3814
- behaviors: Set<Behavior>
3819
+ behaviors: Set<BehaviorConfig>
3815
3820
  converters: Set<Converter>
3816
3821
  getLegacySchema: () => PortableTextMemberSchemaTypes
3817
3822
  keyGenerator: () => string
@@ -3848,7 +3853,7 @@ declare const editorMachine: StateMachine<
3848
3853
  event,
3849
3854
  }: GuardArgs<
3850
3855
  {
3851
- behaviors: Set<Behavior>
3856
+ behaviors: Set<BehaviorConfig>
3852
3857
  converters: Set<Converter>
3853
3858
  getLegacySchema: () => PortableTextMemberSchemaTypes
3854
3859
  keyGenerator: () => string
@@ -3884,7 +3889,7 @@ declare const editorMachine: StateMachine<
3884
3889
  event,
3885
3890
  }: GuardArgs<
3886
3891
  {
3887
- behaviors: Set<Behavior>
3892
+ behaviors: Set<BehaviorConfig>
3888
3893
  converters: Set<Converter>
3889
3894
  getLegacySchema: () => PortableTextMemberSchemaTypes
3890
3895
  keyGenerator: () => string
@@ -3920,7 +3925,7 @@ declare const editorMachine: StateMachine<
3920
3925
  readonly actions: readonly [
3921
3926
  ActionFunction<
3922
3927
  {
3923
- behaviors: Set<Behavior>
3928
+ behaviors: Set<BehaviorConfig>
3924
3929
  converters: Set<Converter>
3925
3930
  getLegacySchema: () => PortableTextMemberSchemaTypes
3926
3931
  keyGenerator: () => string
@@ -3944,14 +3949,6 @@ declare const editorMachine: StateMachine<
3944
3949
  | InternalPatchEvent
3945
3950
  | MutationEvent
3946
3951
  | PatchesEvent
3947
- | {
3948
- type: 'add behavior'
3949
- behavior: Behavior
3950
- }
3951
- | {
3952
- type: 'remove behavior'
3953
- behavior: Behavior
3954
- }
3955
3952
  | {
3956
3953
  type: 'update readOnly'
3957
3954
  readOnly: boolean
@@ -3972,6 +3969,14 @@ declare const editorMachine: StateMachine<
3972
3969
  type: 'update maxBlocks'
3973
3970
  maxBlocks: number | undefined
3974
3971
  }
3972
+ | {
3973
+ type: 'add behavior'
3974
+ behaviorConfig: BehaviorConfig
3975
+ }
3976
+ | {
3977
+ type: 'remove behavior'
3978
+ behaviorConfig: BehaviorConfig
3979
+ }
3975
3980
  | {
3976
3981
  type: 'blur'
3977
3982
  editor: PortableTextSlateEditor
@@ -4085,7 +4090,7 @@ declare const editorMachine: StateMachine<
4085
4090
  readonly actions: readonly [
4086
4091
  ActionFunction<
4087
4092
  {
4088
- behaviors: Set<Behavior>
4093
+ behaviors: Set<BehaviorConfig>
4089
4094
  converters: Set<Converter>
4090
4095
  getLegacySchema: () => PortableTextMemberSchemaTypes
4091
4096
  keyGenerator: () => string
@@ -4112,14 +4117,6 @@ declare const editorMachine: StateMachine<
4112
4117
  | InternalPatchEvent
4113
4118
  | MutationEvent
4114
4119
  | PatchesEvent
4115
- | {
4116
- type: 'add behavior'
4117
- behavior: Behavior
4118
- }
4119
- | {
4120
- type: 'remove behavior'
4121
- behavior: Behavior
4122
- }
4123
4120
  | {
4124
4121
  type: 'update readOnly'
4125
4122
  readOnly: boolean
@@ -4140,6 +4137,14 @@ declare const editorMachine: StateMachine<
4140
4137
  type: 'update maxBlocks'
4141
4138
  maxBlocks: number | undefined
4142
4139
  }
4140
+ | {
4141
+ type: 'add behavior'
4142
+ behaviorConfig: BehaviorConfig
4143
+ }
4144
+ | {
4145
+ type: 'remove behavior'
4146
+ behaviorConfig: BehaviorConfig
4147
+ }
4143
4148
  | {
4144
4149
  type: 'blur'
4145
4150
  editor: PortableTextSlateEditor
@@ -4277,7 +4282,7 @@ declare const editorMachine: StateMachine<
4277
4282
  context,
4278
4283
  }: ActionArgs<
4279
4284
  {
4280
- behaviors: Set<Behavior>
4285
+ behaviors: Set<BehaviorConfig>
4281
4286
  converters: Set<Converter>
4282
4287
  getLegacySchema: () => PortableTextMemberSchemaTypes
4283
4288
  keyGenerator: () => string
@@ -4297,14 +4302,6 @@ declare const editorMachine: StateMachine<
4297
4302
  | InternalPatchEvent
4298
4303
  | MutationEvent
4299
4304
  | PatchesEvent
4300
- | {
4301
- type: 'add behavior'
4302
- behavior: Behavior
4303
- }
4304
- | {
4305
- type: 'remove behavior'
4306
- behavior: Behavior
4307
- }
4308
4305
  | {
4309
4306
  type: 'update readOnly'
4310
4307
  readOnly: boolean
@@ -4325,6 +4322,14 @@ declare const editorMachine: StateMachine<
4325
4322
  type: 'update maxBlocks'
4326
4323
  maxBlocks: number | undefined
4327
4324
  }
4325
+ | {
4326
+ type: 'add behavior'
4327
+ behaviorConfig: BehaviorConfig
4328
+ }
4329
+ | {
4330
+ type: 'remove behavior'
4331
+ behaviorConfig: BehaviorConfig
4332
+ }
4328
4333
  | {
4329
4334
  type: 'blur'
4330
4335
  editor: PortableTextSlateEditor
@@ -4423,14 +4428,6 @@ declare const editorMachine: StateMachine<
4423
4428
  | InternalPatchEvent
4424
4429
  | MutationEvent
4425
4430
  | PatchesEvent
4426
- | {
4427
- type: 'add behavior'
4428
- behavior: Behavior
4429
- }
4430
- | {
4431
- type: 'remove behavior'
4432
- behavior: Behavior
4433
- }
4434
4431
  | {
4435
4432
  type: 'update readOnly'
4436
4433
  readOnly: boolean
@@ -4451,6 +4448,14 @@ declare const editorMachine: StateMachine<
4451
4448
  type: 'update maxBlocks'
4452
4449
  maxBlocks: number | undefined
4453
4450
  }
4451
+ | {
4452
+ type: 'add behavior'
4453
+ behaviorConfig: BehaviorConfig
4454
+ }
4455
+ | {
4456
+ type: 'remove behavior'
4457
+ behaviorConfig: BehaviorConfig
4458
+ }
4454
4459
  | {
4455
4460
  type: 'blur'
4456
4461
  editor: PortableTextSlateEditor
@@ -4549,7 +4554,7 @@ declare const editorMachine: StateMachine<
4549
4554
  >) => void,
4550
4555
  ActionFunction<
4551
4556
  {
4552
- behaviors: Set<Behavior>
4557
+ behaviors: Set<BehaviorConfig>
4553
4558
  converters: Set<Converter>
4554
4559
  getLegacySchema: () => PortableTextMemberSchemaTypes
4555
4560
  keyGenerator: () => string
@@ -4569,14 +4574,6 @@ declare const editorMachine: StateMachine<
4569
4574
  | InternalPatchEvent
4570
4575
  | MutationEvent
4571
4576
  | PatchesEvent
4572
- | {
4573
- type: 'add behavior'
4574
- behavior: Behavior
4575
- }
4576
- | {
4577
- type: 'remove behavior'
4578
- behavior: Behavior
4579
- }
4580
4577
  | {
4581
4578
  type: 'update readOnly'
4582
4579
  readOnly: boolean
@@ -4597,6 +4594,14 @@ declare const editorMachine: StateMachine<
4597
4594
  type: 'update maxBlocks'
4598
4595
  maxBlocks: number | undefined
4599
4596
  }
4597
+ | {
4598
+ type: 'add behavior'
4599
+ behaviorConfig: BehaviorConfig
4600
+ }
4601
+ | {
4602
+ type: 'remove behavior'
4603
+ behaviorConfig: BehaviorConfig
4604
+ }
4600
4605
  | {
4601
4606
  type: 'blur'
4602
4607
  editor: PortableTextSlateEditor
@@ -4695,14 +4700,6 @@ declare const editorMachine: StateMachine<
4695
4700
  | InternalPatchEvent
4696
4701
  | MutationEvent
4697
4702
  | PatchesEvent
4698
- | {
4699
- type: 'add behavior'
4700
- behavior: Behavior
4701
- }
4702
- | {
4703
- type: 'remove behavior'
4704
- behavior: Behavior
4705
- }
4706
4703
  | {
4707
4704
  type: 'update readOnly'
4708
4705
  readOnly: boolean
@@ -4723,6 +4720,14 @@ declare const editorMachine: StateMachine<
4723
4720
  type: 'update maxBlocks'
4724
4721
  maxBlocks: number | undefined
4725
4722
  }
4723
+ | {
4724
+ type: 'add behavior'
4725
+ behaviorConfig: BehaviorConfig
4726
+ }
4727
+ | {
4728
+ type: 'remove behavior'
4729
+ behaviorConfig: BehaviorConfig
4730
+ }
4726
4731
  | {
4727
4732
  type: 'blur'
4728
4733
  editor: PortableTextSlateEditor
@@ -4876,7 +4881,7 @@ declare const editorMachine: StateMachine<
4876
4881
  readonly actions: readonly [
4877
4882
  ActionFunction<
4878
4883
  {
4879
- behaviors: Set<Behavior>
4884
+ behaviors: Set<BehaviorConfig>
4880
4885
  converters: Set<Converter>
4881
4886
  getLegacySchema: () => PortableTextMemberSchemaTypes
4882
4887
  keyGenerator: () => string
@@ -4901,14 +4906,6 @@ declare const editorMachine: StateMachine<
4901
4906
  | InternalPatchEvent
4902
4907
  | MutationEvent
4903
4908
  | PatchesEvent
4904
- | {
4905
- type: 'add behavior'
4906
- behavior: Behavior
4907
- }
4908
- | {
4909
- type: 'remove behavior'
4910
- behavior: Behavior
4911
- }
4912
4909
  | {
4913
4910
  type: 'update readOnly'
4914
4911
  readOnly: boolean
@@ -4929,6 +4926,14 @@ declare const editorMachine: StateMachine<
4929
4926
  type: 'update maxBlocks'
4930
4927
  maxBlocks: number | undefined
4931
4928
  }
4929
+ | {
4930
+ type: 'add behavior'
4931
+ behaviorConfig: BehaviorConfig
4932
+ }
4933
+ | {
4934
+ type: 'remove behavior'
4935
+ behaviorConfig: BehaviorConfig
4936
+ }
4932
4937
  | {
4933
4938
  type: 'blur'
4934
4939
  editor: PortableTextSlateEditor
@@ -5160,6 +5165,15 @@ declare const editorMachine: StateMachine<
5160
5165
  }
5161
5166
  >
5162
5167
 
5168
+ declare type EditorPriority = {
5169
+ id: string
5170
+ name?: string
5171
+ reference?: {
5172
+ priority: EditorPriority
5173
+ importance: 'higher' | 'lower'
5174
+ }
5175
+ }
5176
+
5163
5177
  /**
5164
5178
  * @public
5165
5179
  */