@portabletext/editor 1.45.2 → 1.45.4

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.
@@ -276,11 +276,6 @@ declare type BehaviorAction =
276
276
  */
277
277
  declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
278
278
  payload: {
279
- /**
280
- * @deprecated
281
- * Use `snapshot` instead
282
- */
283
- context: EditorContext
284
279
  snapshot: EditorSnapshot
285
280
  event: TBehaviorEvent
286
281
  },
@@ -306,11 +301,6 @@ declare type BehaviorEventTypeNamespace =
306
301
  * @beta
307
302
  */
308
303
  declare type BehaviorGuard<TBehaviorEvent, TGuardResponse> = (payload: {
309
- /**
310
- * @deprecated
311
- * Use `snapshot` instead
312
- */
313
- context: EditorContext
314
304
  snapshot: EditorSnapshot
315
305
  event: TBehaviorEvent
316
306
  }) => TGuardResponse | false
@@ -661,7 +651,7 @@ declare const editorMachine: StateMachine<
661
651
  initialReadOnly: boolean
662
652
  maxBlocks: number | undefined
663
653
  selection: EditorSelection
664
- value: Array<PortableTextBlock> | undefined
654
+ incomingValue: Array<PortableTextBlock> | undefined
665
655
  internalDrag?: {
666
656
  ghost?: HTMLElement
667
657
  origin: Pick<EventPosition, 'selection'>
@@ -868,7 +858,7 @@ declare const editorMachine: StateMachine<
868
858
  maxBlocks?: number
869
859
  readOnly?: boolean
870
860
  schema: EditorSchema
871
- value?: Array<PortableTextBlock>
861
+ initialValue?: Array<PortableTextBlock>
872
862
  },
873
863
  NonReducibleUnknown,
874
864
  | PatchEvent
@@ -953,7 +943,7 @@ declare const editorMachine: StateMachine<
953
943
  maxBlocks?: number
954
944
  readOnly?: boolean
955
945
  schema: EditorSchema
956
- value?: Array<PortableTextBlock>
946
+ initialValue?: Array<PortableTextBlock>
957
947
  }
958
948
  self: ActorRef<
959
949
  MachineSnapshot<
@@ -966,7 +956,7 @@ declare const editorMachine: StateMachine<
966
956
  initialReadOnly: boolean
967
957
  maxBlocks: number | undefined
968
958
  selection: EditorSelection
969
- value: Array<PortableTextBlock> | undefined
959
+ incomingValue: Array<PortableTextBlock> | undefined
970
960
  internalDrag?: {
971
961
  ghost?: HTMLElement
972
962
  origin: Pick<EventPosition, 'selection'>
@@ -1230,7 +1220,7 @@ declare const editorMachine: StateMachine<
1230
1220
  selection: null
1231
1221
  initialReadOnly: boolean
1232
1222
  maxBlocks: number | undefined
1233
- value: PortableTextBlock[] | undefined
1223
+ incomingValue: PortableTextBlock[] | undefined
1234
1224
  }
1235
1225
  readonly on: {
1236
1226
  readonly 'notify.blurred': {
@@ -1244,7 +1234,7 @@ declare const editorMachine: StateMachine<
1244
1234
  initialReadOnly: boolean
1245
1235
  maxBlocks: number | undefined
1246
1236
  selection: EditorSelection
1247
- value: Array<PortableTextBlock> | undefined
1237
+ incomingValue: Array<PortableTextBlock> | undefined
1248
1238
  internalDrag?: {
1249
1239
  ghost?: HTMLElement
1250
1240
  origin: Pick<EventPosition, 'selection'>
@@ -1439,7 +1429,7 @@ declare const editorMachine: StateMachine<
1439
1429
  initialReadOnly: boolean
1440
1430
  maxBlocks: number | undefined
1441
1431
  selection: EditorSelection
1442
- value: Array<PortableTextBlock> | undefined
1432
+ incomingValue: Array<PortableTextBlock> | undefined
1443
1433
  internalDrag?: {
1444
1434
  ghost?: HTMLElement
1445
1435
  origin: Pick<EventPosition, 'selection'>
@@ -1633,7 +1623,7 @@ declare const editorMachine: StateMachine<
1633
1623
  initialReadOnly: boolean
1634
1624
  maxBlocks: number | undefined
1635
1625
  selection: EditorSelection
1636
- value: Array<PortableTextBlock> | undefined
1626
+ incomingValue: Array<PortableTextBlock> | undefined
1637
1627
  internalDrag?: {
1638
1628
  ghost?: HTMLElement
1639
1629
  origin: Pick<EventPosition, 'selection'>
@@ -1830,7 +1820,7 @@ declare const editorMachine: StateMachine<
1830
1820
  initialReadOnly: boolean
1831
1821
  maxBlocks: number | undefined
1832
1822
  selection: EditorSelection
1833
- value: Array<PortableTextBlock> | undefined
1823
+ incomingValue: Array<PortableTextBlock> | undefined
1834
1824
  internalDrag?: {
1835
1825
  ghost?: HTMLElement
1836
1826
  origin: Pick<EventPosition, 'selection'>
@@ -2026,7 +2016,7 @@ declare const editorMachine: StateMachine<
2026
2016
  initialReadOnly: boolean
2027
2017
  maxBlocks: number | undefined
2028
2018
  selection: EditorSelection
2029
- value: Array<PortableTextBlock> | undefined
2019
+ incomingValue: Array<PortableTextBlock> | undefined
2030
2020
  internalDrag?: {
2031
2021
  ghost?: HTMLElement
2032
2022
  origin: Pick<EventPosition, 'selection'>
@@ -2222,7 +2212,7 @@ declare const editorMachine: StateMachine<
2222
2212
  initialReadOnly: boolean
2223
2213
  maxBlocks: number | undefined
2224
2214
  selection: EditorSelection
2225
- value: Array<PortableTextBlock> | undefined
2215
+ incomingValue: Array<PortableTextBlock> | undefined
2226
2216
  internalDrag?: {
2227
2217
  ghost?: HTMLElement
2228
2218
  origin: Pick<EventPosition, 'selection'>
@@ -2369,7 +2359,7 @@ declare const editorMachine: StateMachine<
2369
2359
  initialReadOnly: boolean
2370
2360
  maxBlocks: number | undefined
2371
2361
  selection: EditorSelection
2372
- value: Array<PortableTextBlock> | undefined
2362
+ incomingValue: Array<PortableTextBlock> | undefined
2373
2363
  internalDrag?: {
2374
2364
  ghost?: HTMLElement
2375
2365
  origin: Pick<EventPosition, 'selection'>
@@ -2565,7 +2555,7 @@ declare const editorMachine: StateMachine<
2565
2555
  initialReadOnly: boolean
2566
2556
  maxBlocks: number | undefined
2567
2557
  selection: EditorSelection
2568
- value: Array<PortableTextBlock> | undefined
2558
+ incomingValue: Array<PortableTextBlock> | undefined
2569
2559
  internalDrag?: {
2570
2560
  ghost?: HTMLElement
2571
2561
  origin: Pick<EventPosition, 'selection'>
@@ -2760,7 +2750,7 @@ declare const editorMachine: StateMachine<
2760
2750
  initialReadOnly: boolean
2761
2751
  maxBlocks: number | undefined
2762
2752
  selection: EditorSelection
2763
- value: Array<PortableTextBlock> | undefined
2753
+ incomingValue: Array<PortableTextBlock> | undefined
2764
2754
  internalDrag?: {
2765
2755
  ghost?: HTMLElement
2766
2756
  origin: Pick<EventPosition, 'selection'>
@@ -2954,7 +2944,7 @@ declare const editorMachine: StateMachine<
2954
2944
  initialReadOnly: boolean
2955
2945
  maxBlocks: number | undefined
2956
2946
  selection: EditorSelection
2957
- value: Array<PortableTextBlock> | undefined
2947
+ incomingValue: Array<PortableTextBlock> | undefined
2958
2948
  internalDrag?: {
2959
2949
  ghost?: HTMLElement
2960
2950
  origin: Pick<EventPosition, 'selection'>
@@ -3155,7 +3145,7 @@ declare const editorMachine: StateMachine<
3155
3145
  initialReadOnly: boolean
3156
3146
  maxBlocks: number | undefined
3157
3147
  selection: EditorSelection
3158
- value: Array<PortableTextBlock> | undefined
3148
+ incomingValue: Array<PortableTextBlock> | undefined
3159
3149
  internalDrag?: {
3160
3150
  ghost?: HTMLElement
3161
3151
  origin: Pick<EventPosition, 'selection'>
@@ -3350,7 +3340,7 @@ declare const editorMachine: StateMachine<
3350
3340
  initialReadOnly: boolean
3351
3341
  maxBlocks: number | undefined
3352
3342
  selection: EditorSelection
3353
- value: Array<PortableTextBlock> | undefined
3343
+ incomingValue: Array<PortableTextBlock> | undefined
3354
3344
  internalDrag?: {
3355
3345
  ghost?: HTMLElement
3356
3346
  origin: Pick<EventPosition, 'selection'>
@@ -3502,7 +3492,7 @@ declare const editorMachine: StateMachine<
3502
3492
  initialReadOnly: boolean
3503
3493
  maxBlocks: number | undefined
3504
3494
  selection: EditorSelection
3505
- value: Array<PortableTextBlock> | undefined
3495
+ incomingValue: Array<PortableTextBlock> | undefined
3506
3496
  internalDrag?: {
3507
3497
  ghost?: HTMLElement
3508
3498
  origin: Pick<EventPosition, 'selection'>
@@ -3651,7 +3641,7 @@ declare const editorMachine: StateMachine<
3651
3641
  initialReadOnly: boolean
3652
3642
  maxBlocks: number | undefined
3653
3643
  selection: EditorSelection
3654
- value: Array<PortableTextBlock> | undefined
3644
+ incomingValue: Array<PortableTextBlock> | undefined
3655
3645
  internalDrag?: {
3656
3646
  ghost?: HTMLElement
3657
3647
  origin: Pick<EventPosition, 'selection'>
@@ -3812,7 +3802,7 @@ declare const editorMachine: StateMachine<
3812
3802
  initialReadOnly: boolean
3813
3803
  maxBlocks: number | undefined
3814
3804
  selection: EditorSelection
3815
- value: Array<PortableTextBlock> | undefined
3805
+ incomingValue: Array<PortableTextBlock> | undefined
3816
3806
  internalDrag?: {
3817
3807
  ghost?: HTMLElement
3818
3808
  origin: Pick<EventPosition, 'selection'>
@@ -3850,7 +3840,7 @@ declare const editorMachine: StateMachine<
3850
3840
  initialReadOnly: boolean
3851
3841
  maxBlocks: number | undefined
3852
3842
  selection: EditorSelection
3853
- value: Array<PortableTextBlock> | undefined
3843
+ incomingValue: Array<PortableTextBlock> | undefined
3854
3844
  internalDrag?: {
3855
3845
  ghost?: HTMLElement
3856
3846
  origin: Pick<EventPosition, 'selection'>
@@ -3882,7 +3872,7 @@ declare const editorMachine: StateMachine<
3882
3872
  initialReadOnly: boolean
3883
3873
  maxBlocks: number | undefined
3884
3874
  selection: EditorSelection
3885
- value: Array<PortableTextBlock> | undefined
3875
+ incomingValue: Array<PortableTextBlock> | undefined
3886
3876
  internalDrag?: {
3887
3877
  ghost?: HTMLElement
3888
3878
  origin: Pick<EventPosition, 'selection'>
@@ -3915,7 +3905,7 @@ declare const editorMachine: StateMachine<
3915
3905
  initialReadOnly: boolean
3916
3906
  maxBlocks: number | undefined
3917
3907
  selection: EditorSelection
3918
- value: Array<PortableTextBlock> | undefined
3908
+ incomingValue: Array<PortableTextBlock> | undefined
3919
3909
  internalDrag?: {
3920
3910
  ghost?: HTMLElement
3921
3911
  origin: Pick<EventPosition, 'selection'>
@@ -3951,7 +3941,7 @@ declare const editorMachine: StateMachine<
3951
3941
  initialReadOnly: boolean
3952
3942
  maxBlocks: number | undefined
3953
3943
  selection: EditorSelection
3954
- value: Array<PortableTextBlock> | undefined
3944
+ incomingValue: Array<PortableTextBlock> | undefined
3955
3945
  internalDrag?: {
3956
3946
  ghost?: HTMLElement
3957
3947
  origin: Pick<EventPosition, 'selection'>
@@ -4108,7 +4098,7 @@ declare const editorMachine: StateMachine<
4108
4098
  initialReadOnly: boolean
4109
4099
  maxBlocks: number | undefined
4110
4100
  selection: EditorSelection
4111
- value: Array<PortableTextBlock> | undefined
4101
+ incomingValue: Array<PortableTextBlock> | undefined
4112
4102
  internalDrag?: {
4113
4103
  ghost?: HTMLElement
4114
4104
  origin: Pick<EventPosition, 'selection'>
@@ -4365,7 +4355,7 @@ declare const editorMachine: StateMachine<
4365
4355
  initialReadOnly: boolean
4366
4356
  maxBlocks: number | undefined
4367
4357
  selection: EditorSelection
4368
- value: Array<PortableTextBlock> | undefined
4358
+ incomingValue: Array<PortableTextBlock> | undefined
4369
4359
  internalDrag?: {
4370
4360
  ghost?: HTMLElement
4371
4361
  origin: Pick<EventPosition, 'selection'>
@@ -276,11 +276,6 @@ declare type BehaviorAction =
276
276
  */
277
277
  declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
278
278
  payload: {
279
- /**
280
- * @deprecated
281
- * Use `snapshot` instead
282
- */
283
- context: EditorContext
284
279
  snapshot: EditorSnapshot
285
280
  event: TBehaviorEvent
286
281
  },
@@ -306,11 +301,6 @@ declare type BehaviorEventTypeNamespace =
306
301
  * @beta
307
302
  */
308
303
  declare type BehaviorGuard<TBehaviorEvent, TGuardResponse> = (payload: {
309
- /**
310
- * @deprecated
311
- * Use `snapshot` instead
312
- */
313
- context: EditorContext
314
304
  snapshot: EditorSnapshot
315
305
  event: TBehaviorEvent
316
306
  }) => TGuardResponse | false
@@ -661,7 +651,7 @@ declare const editorMachine: StateMachine<
661
651
  initialReadOnly: boolean
662
652
  maxBlocks: number | undefined
663
653
  selection: EditorSelection
664
- value: Array<PortableTextBlock> | undefined
654
+ incomingValue: Array<PortableTextBlock> | undefined
665
655
  internalDrag?: {
666
656
  ghost?: HTMLElement
667
657
  origin: Pick<EventPosition, 'selection'>
@@ -868,7 +858,7 @@ declare const editorMachine: StateMachine<
868
858
  maxBlocks?: number
869
859
  readOnly?: boolean
870
860
  schema: EditorSchema
871
- value?: Array<PortableTextBlock>
861
+ initialValue?: Array<PortableTextBlock>
872
862
  },
873
863
  NonReducibleUnknown,
874
864
  | PatchEvent
@@ -953,7 +943,7 @@ declare const editorMachine: StateMachine<
953
943
  maxBlocks?: number
954
944
  readOnly?: boolean
955
945
  schema: EditorSchema
956
- value?: Array<PortableTextBlock>
946
+ initialValue?: Array<PortableTextBlock>
957
947
  }
958
948
  self: ActorRef<
959
949
  MachineSnapshot<
@@ -966,7 +956,7 @@ declare const editorMachine: StateMachine<
966
956
  initialReadOnly: boolean
967
957
  maxBlocks: number | undefined
968
958
  selection: EditorSelection
969
- value: Array<PortableTextBlock> | undefined
959
+ incomingValue: Array<PortableTextBlock> | undefined
970
960
  internalDrag?: {
971
961
  ghost?: HTMLElement
972
962
  origin: Pick<EventPosition, 'selection'>
@@ -1230,7 +1220,7 @@ declare const editorMachine: StateMachine<
1230
1220
  selection: null
1231
1221
  initialReadOnly: boolean
1232
1222
  maxBlocks: number | undefined
1233
- value: PortableTextBlock[] | undefined
1223
+ incomingValue: PortableTextBlock[] | undefined
1234
1224
  }
1235
1225
  readonly on: {
1236
1226
  readonly 'notify.blurred': {
@@ -1244,7 +1234,7 @@ declare const editorMachine: StateMachine<
1244
1234
  initialReadOnly: boolean
1245
1235
  maxBlocks: number | undefined
1246
1236
  selection: EditorSelection
1247
- value: Array<PortableTextBlock> | undefined
1237
+ incomingValue: Array<PortableTextBlock> | undefined
1248
1238
  internalDrag?: {
1249
1239
  ghost?: HTMLElement
1250
1240
  origin: Pick<EventPosition, 'selection'>
@@ -1439,7 +1429,7 @@ declare const editorMachine: StateMachine<
1439
1429
  initialReadOnly: boolean
1440
1430
  maxBlocks: number | undefined
1441
1431
  selection: EditorSelection
1442
- value: Array<PortableTextBlock> | undefined
1432
+ incomingValue: Array<PortableTextBlock> | undefined
1443
1433
  internalDrag?: {
1444
1434
  ghost?: HTMLElement
1445
1435
  origin: Pick<EventPosition, 'selection'>
@@ -1633,7 +1623,7 @@ declare const editorMachine: StateMachine<
1633
1623
  initialReadOnly: boolean
1634
1624
  maxBlocks: number | undefined
1635
1625
  selection: EditorSelection
1636
- value: Array<PortableTextBlock> | undefined
1626
+ incomingValue: Array<PortableTextBlock> | undefined
1637
1627
  internalDrag?: {
1638
1628
  ghost?: HTMLElement
1639
1629
  origin: Pick<EventPosition, 'selection'>
@@ -1830,7 +1820,7 @@ declare const editorMachine: StateMachine<
1830
1820
  initialReadOnly: boolean
1831
1821
  maxBlocks: number | undefined
1832
1822
  selection: EditorSelection
1833
- value: Array<PortableTextBlock> | undefined
1823
+ incomingValue: Array<PortableTextBlock> | undefined
1834
1824
  internalDrag?: {
1835
1825
  ghost?: HTMLElement
1836
1826
  origin: Pick<EventPosition, 'selection'>
@@ -2026,7 +2016,7 @@ declare const editorMachine: StateMachine<
2026
2016
  initialReadOnly: boolean
2027
2017
  maxBlocks: number | undefined
2028
2018
  selection: EditorSelection
2029
- value: Array<PortableTextBlock> | undefined
2019
+ incomingValue: Array<PortableTextBlock> | undefined
2030
2020
  internalDrag?: {
2031
2021
  ghost?: HTMLElement
2032
2022
  origin: Pick<EventPosition, 'selection'>
@@ -2222,7 +2212,7 @@ declare const editorMachine: StateMachine<
2222
2212
  initialReadOnly: boolean
2223
2213
  maxBlocks: number | undefined
2224
2214
  selection: EditorSelection
2225
- value: Array<PortableTextBlock> | undefined
2215
+ incomingValue: Array<PortableTextBlock> | undefined
2226
2216
  internalDrag?: {
2227
2217
  ghost?: HTMLElement
2228
2218
  origin: Pick<EventPosition, 'selection'>
@@ -2369,7 +2359,7 @@ declare const editorMachine: StateMachine<
2369
2359
  initialReadOnly: boolean
2370
2360
  maxBlocks: number | undefined
2371
2361
  selection: EditorSelection
2372
- value: Array<PortableTextBlock> | undefined
2362
+ incomingValue: Array<PortableTextBlock> | undefined
2373
2363
  internalDrag?: {
2374
2364
  ghost?: HTMLElement
2375
2365
  origin: Pick<EventPosition, 'selection'>
@@ -2565,7 +2555,7 @@ declare const editorMachine: StateMachine<
2565
2555
  initialReadOnly: boolean
2566
2556
  maxBlocks: number | undefined
2567
2557
  selection: EditorSelection
2568
- value: Array<PortableTextBlock> | undefined
2558
+ incomingValue: Array<PortableTextBlock> | undefined
2569
2559
  internalDrag?: {
2570
2560
  ghost?: HTMLElement
2571
2561
  origin: Pick<EventPosition, 'selection'>
@@ -2760,7 +2750,7 @@ declare const editorMachine: StateMachine<
2760
2750
  initialReadOnly: boolean
2761
2751
  maxBlocks: number | undefined
2762
2752
  selection: EditorSelection
2763
- value: Array<PortableTextBlock> | undefined
2753
+ incomingValue: Array<PortableTextBlock> | undefined
2764
2754
  internalDrag?: {
2765
2755
  ghost?: HTMLElement
2766
2756
  origin: Pick<EventPosition, 'selection'>
@@ -2954,7 +2944,7 @@ declare const editorMachine: StateMachine<
2954
2944
  initialReadOnly: boolean
2955
2945
  maxBlocks: number | undefined
2956
2946
  selection: EditorSelection
2957
- value: Array<PortableTextBlock> | undefined
2947
+ incomingValue: Array<PortableTextBlock> | undefined
2958
2948
  internalDrag?: {
2959
2949
  ghost?: HTMLElement
2960
2950
  origin: Pick<EventPosition, 'selection'>
@@ -3155,7 +3145,7 @@ declare const editorMachine: StateMachine<
3155
3145
  initialReadOnly: boolean
3156
3146
  maxBlocks: number | undefined
3157
3147
  selection: EditorSelection
3158
- value: Array<PortableTextBlock> | undefined
3148
+ incomingValue: Array<PortableTextBlock> | undefined
3159
3149
  internalDrag?: {
3160
3150
  ghost?: HTMLElement
3161
3151
  origin: Pick<EventPosition, 'selection'>
@@ -3350,7 +3340,7 @@ declare const editorMachine: StateMachine<
3350
3340
  initialReadOnly: boolean
3351
3341
  maxBlocks: number | undefined
3352
3342
  selection: EditorSelection
3353
- value: Array<PortableTextBlock> | undefined
3343
+ incomingValue: Array<PortableTextBlock> | undefined
3354
3344
  internalDrag?: {
3355
3345
  ghost?: HTMLElement
3356
3346
  origin: Pick<EventPosition, 'selection'>
@@ -3502,7 +3492,7 @@ declare const editorMachine: StateMachine<
3502
3492
  initialReadOnly: boolean
3503
3493
  maxBlocks: number | undefined
3504
3494
  selection: EditorSelection
3505
- value: Array<PortableTextBlock> | undefined
3495
+ incomingValue: Array<PortableTextBlock> | undefined
3506
3496
  internalDrag?: {
3507
3497
  ghost?: HTMLElement
3508
3498
  origin: Pick<EventPosition, 'selection'>
@@ -3651,7 +3641,7 @@ declare const editorMachine: StateMachine<
3651
3641
  initialReadOnly: boolean
3652
3642
  maxBlocks: number | undefined
3653
3643
  selection: EditorSelection
3654
- value: Array<PortableTextBlock> | undefined
3644
+ incomingValue: Array<PortableTextBlock> | undefined
3655
3645
  internalDrag?: {
3656
3646
  ghost?: HTMLElement
3657
3647
  origin: Pick<EventPosition, 'selection'>
@@ -3812,7 +3802,7 @@ declare const editorMachine: StateMachine<
3812
3802
  initialReadOnly: boolean
3813
3803
  maxBlocks: number | undefined
3814
3804
  selection: EditorSelection
3815
- value: Array<PortableTextBlock> | undefined
3805
+ incomingValue: Array<PortableTextBlock> | undefined
3816
3806
  internalDrag?: {
3817
3807
  ghost?: HTMLElement
3818
3808
  origin: Pick<EventPosition, 'selection'>
@@ -3850,7 +3840,7 @@ declare const editorMachine: StateMachine<
3850
3840
  initialReadOnly: boolean
3851
3841
  maxBlocks: number | undefined
3852
3842
  selection: EditorSelection
3853
- value: Array<PortableTextBlock> | undefined
3843
+ incomingValue: Array<PortableTextBlock> | undefined
3854
3844
  internalDrag?: {
3855
3845
  ghost?: HTMLElement
3856
3846
  origin: Pick<EventPosition, 'selection'>
@@ -3882,7 +3872,7 @@ declare const editorMachine: StateMachine<
3882
3872
  initialReadOnly: boolean
3883
3873
  maxBlocks: number | undefined
3884
3874
  selection: EditorSelection
3885
- value: Array<PortableTextBlock> | undefined
3875
+ incomingValue: Array<PortableTextBlock> | undefined
3886
3876
  internalDrag?: {
3887
3877
  ghost?: HTMLElement
3888
3878
  origin: Pick<EventPosition, 'selection'>
@@ -3915,7 +3905,7 @@ declare const editorMachine: StateMachine<
3915
3905
  initialReadOnly: boolean
3916
3906
  maxBlocks: number | undefined
3917
3907
  selection: EditorSelection
3918
- value: Array<PortableTextBlock> | undefined
3908
+ incomingValue: Array<PortableTextBlock> | undefined
3919
3909
  internalDrag?: {
3920
3910
  ghost?: HTMLElement
3921
3911
  origin: Pick<EventPosition, 'selection'>
@@ -3951,7 +3941,7 @@ declare const editorMachine: StateMachine<
3951
3941
  initialReadOnly: boolean
3952
3942
  maxBlocks: number | undefined
3953
3943
  selection: EditorSelection
3954
- value: Array<PortableTextBlock> | undefined
3944
+ incomingValue: Array<PortableTextBlock> | undefined
3955
3945
  internalDrag?: {
3956
3946
  ghost?: HTMLElement
3957
3947
  origin: Pick<EventPosition, 'selection'>
@@ -4108,7 +4098,7 @@ declare const editorMachine: StateMachine<
4108
4098
  initialReadOnly: boolean
4109
4099
  maxBlocks: number | undefined
4110
4100
  selection: EditorSelection
4111
- value: Array<PortableTextBlock> | undefined
4101
+ incomingValue: Array<PortableTextBlock> | undefined
4112
4102
  internalDrag?: {
4113
4103
  ghost?: HTMLElement
4114
4104
  origin: Pick<EventPosition, 'selection'>
@@ -4365,7 +4355,7 @@ declare const editorMachine: StateMachine<
4365
4355
  initialReadOnly: boolean
4366
4356
  maxBlocks: number | undefined
4367
4357
  selection: EditorSelection
4368
- value: Array<PortableTextBlock> | undefined
4358
+ incomingValue: Array<PortableTextBlock> | undefined
4369
4359
  internalDrag?: {
4370
4360
  ghost?: HTMLElement
4371
4361
  origin: Pick<EventPosition, 'selection'>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "1.45.2",
3
+ "version": "1.45.4",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -79,15 +79,15 @@
79
79
  "slate-react": "0.112.1",
80
80
  "use-effect-event": "^1.0.2",
81
81
  "xstate": "^5.19.2",
82
- "@portabletext/block-tools": "1.1.16",
82
+ "@portabletext/block-tools": "1.1.17",
83
83
  "@portabletext/patches": "1.1.3"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@portabletext/toolkit": "^2.0.17",
87
87
  "@sanity/diff-match-patch": "^3.2.0",
88
88
  "@sanity/pkg-utils": "^7.2.2",
89
- "@sanity/schema": "^3.82.0",
90
- "@sanity/types": "^3.82.0",
89
+ "@sanity/schema": "^3.83.0",
90
+ "@sanity/types": "^3.83.0",
91
91
  "@testing-library/jest-dom": "^6.6.3",
92
92
  "@testing-library/react": "^16.3.0",
93
93
  "@types/debug": "^4.1.12",
@@ -115,8 +115,8 @@
115
115
  "racejar": "1.2.3"
116
116
  },
117
117
  "peerDependencies": {
118
- "@sanity/schema": "^3.82.0",
119
- "@sanity/types": "^3.82.0",
118
+ "@sanity/schema": "^3.83.0",
119
+ "@sanity/types": "^3.83.0",
120
120
  "react": "^16.9 || ^17 || ^18 || ^19",
121
121
  "rxjs": "^7.8.2"
122
122
  },
@@ -128,6 +128,7 @@ export function performEvent({
128
128
  },
129
129
  action: defaultAction,
130
130
  })
131
+ editor.onChange()
131
132
  } catch (error) {
132
133
  console.error(
133
134
  new Error(
@@ -136,11 +137,10 @@ export function performEvent({
136
137
  )
137
138
  }
138
139
  })
139
- editor.onChange()
140
140
  return
141
141
  }
142
142
 
143
- const editorSnapshot = getSnapshot()
143
+ const guardSnapshot = getSnapshot()
144
144
 
145
145
  let behaviorOverwritten = false
146
146
 
@@ -148,8 +148,7 @@ export function performEvent({
148
148
  const shouldRun =
149
149
  eventBehavior.guard === undefined ||
150
150
  eventBehavior.guard({
151
- context: editorSnapshot.context,
152
- snapshot: editorSnapshot,
151
+ snapshot: guardSnapshot,
153
152
  event,
154
153
  })
155
154
 
@@ -157,28 +156,27 @@ export function performEvent({
157
156
  continue
158
157
  }
159
158
 
160
- const actionSets = eventBehavior.actions.map((actionSet) =>
161
- actionSet(
159
+ for (const actionSet of eventBehavior.actions) {
160
+ const actionsSnapshot = getSnapshot()
161
+
162
+ const actions = actionSet(
162
163
  {
163
- context: editorSnapshot.context,
164
- snapshot: editorSnapshot,
164
+ snapshot: actionsSnapshot,
165
165
  event,
166
166
  },
167
167
  shouldRun,
168
- ),
169
- )
168
+ )
170
169
 
171
- for (const actionSet of actionSets) {
172
- if (actionSet.length === 0) {
170
+ if (actions.length === 0) {
173
171
  continue
174
172
  }
175
173
 
176
174
  behaviorOverwritten =
177
175
  behaviorOverwritten ||
178
- actionSet.some((action) => action.type !== 'effect')
176
+ actions.some((action) => action.type !== 'effect')
179
177
 
180
178
  withApplyingBehaviorActionSet(editor, () => {
181
- for (const action of actionSet) {
179
+ for (const action of actions) {
182
180
  if (action.type === 'raise') {
183
181
  performEvent({
184
182
  behaviors,
@@ -216,8 +214,8 @@ export function performEvent({
216
214
  break
217
215
  }
218
216
  }
217
+ editor.onChange()
219
218
  })
220
- editor.onChange()
221
219
  }
222
220
 
223
221
  if (behaviorOverwritten) {
@@ -255,6 +253,7 @@ export function performEvent({
255
253
  },
256
254
  action: defaultAction,
257
255
  })
256
+ editor.onChange()
258
257
  } catch (error) {
259
258
  console.error(
260
259
  new Error(
@@ -263,6 +262,5 @@ export function performEvent({
263
262
  )
264
263
  }
265
264
  })
266
- editor.onChange()
267
265
  }
268
266
  }
@@ -1,4 +1,4 @@
1
- import type {EditorContext, EditorSnapshot} from '../editor/editor-snapshot'
1
+ import type {EditorSnapshot} from '../editor/editor-snapshot'
2
2
  import type {OmitFromUnion, PickFromUnion} from '../type-utils'
3
3
  import type {PortableTextSlateEditor} from '../types/editor'
4
4
  import type {
@@ -41,11 +41,6 @@ export function raise(
41
41
  */
42
42
  export type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
43
43
  payload: {
44
- /**
45
- * @deprecated
46
- * Use `snapshot` instead
47
- */
48
- context: EditorContext
49
44
  snapshot: EditorSnapshot
50
45
  event: TBehaviorEvent
51
46
  },
@@ -1,14 +1,9 @@
1
- import type {EditorContext, EditorSnapshot} from '../editor/editor-snapshot'
1
+ import type {EditorSnapshot} from '../editor/editor-snapshot'
2
2
 
3
3
  /**
4
4
  * @beta
5
5
  */
6
6
  export type BehaviorGuard<TBehaviorEvent, TGuardResponse> = (payload: {
7
- /**
8
- * @deprecated
9
- * Use `snapshot` instead
10
- */
11
- context: EditorContext
12
7
  snapshot: EditorSnapshot
13
8
  event: TBehaviorEvent
14
9
  }) => TGuardResponse | false