@portabletext/editor 1.35.0 → 1.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-cjs/{plugin.event-listener.cjs → editor-provider.cjs} +50 -20
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -0
- package/lib/_chunks-es/{plugin.event-listener.js → editor-provider.js} +51 -21
- package/lib/_chunks-es/editor-provider.js.map +1 -0
- package/lib/behaviors/index.d.cts +19377 -210
- package/lib/behaviors/index.d.ts +19377 -210
- package/lib/index.cjs +81 -51
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +318 -47
- package/lib/index.d.ts +318 -47
- package/lib/index.js +35 -4
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.cjs +22 -7
- package/lib/plugins/index.cjs.map +1 -1
- package/lib/plugins/index.d.cts +313 -2
- package/lib/plugins/index.d.ts +313 -2
- package/lib/plugins/index.js +18 -3
- package/lib/plugins/index.js.map +1 -1
- package/lib/selectors/index.d.cts +19504 -1
- package/lib/selectors/index.d.ts +19504 -1
- package/lib/utils/index.d.cts +19506 -2
- package/lib/utils/index.d.ts +19506 -2
- package/package.json +3 -3
- package/src/behavior-actions/behavior.action.decorator.add.ts +1 -0
- package/src/behavior-actions/behavior.action.delete.text.ts +1 -0
- package/src/behaviors/behavior.decorator-pair.ts +1 -0
- package/src/converters/converter.portable-text.deserialize.test.ts +3 -7
- package/src/converters/converter.portable-text.ts +7 -1
- package/src/converters/converter.text-html.deserialize.test.ts +3 -7
- package/src/converters/converter.text-html.serialize.test.ts +5 -10
- package/src/converters/converter.text-plain.test.ts +4 -6
- package/src/editor/Editable.tsx +26 -0
- package/src/editor/editor-machine.ts +170 -147
- package/src/editor/editor-selector.ts +3 -0
- package/src/editor/editor-snapshot.ts +13 -0
- package/src/editor/mutation-machine.ts +2 -0
- package/src/editor-event-listener.tsx +30 -0
- package/src/index.ts +1 -1
- package/src/internal-utils/create-test-snapshot.ts +23 -0
- package/src/plugins/plugin.one-line.tsx +1 -1
- package/src/selectors/selector.get-active-annotations.test.ts +4 -13
- package/src/selectors/selector.get-caret-word-selection.test.ts +3 -7
- package/src/selectors/selector.get-selected-spans.test.ts +5 -9
- package/src/selectors/selector.get-selection-text.test.ts +5 -7
- package/src/selectors/selector.get-trimmed-selection.test.ts +3 -5
- package/src/selectors/selector.is-active-decorator.test.ts +5 -9
- package/lib/_chunks-cjs/plugin.event-listener.cjs.map +0 -1
- package/lib/_chunks-es/plugin.event-listener.js.map +0 -1
package/lib/index.d.cts
CHANGED
|
@@ -607,52 +607,12 @@ export declare type EditorEvent =
|
|
|
607
607
|
|
|
608
608
|
/**
|
|
609
609
|
* @public
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
* - 'done loading'
|
|
613
|
-
* - 'editable'
|
|
614
|
-
* - 'error'
|
|
615
|
-
* - 'focused'
|
|
616
|
-
* - 'invalid value'
|
|
617
|
-
* - 'loading'
|
|
618
|
-
* - 'mutation'
|
|
619
|
-
* - 'patch'
|
|
620
|
-
* - 'read only'
|
|
621
|
-
* - 'ready'
|
|
622
|
-
* - 'selection'
|
|
623
|
-
* - 'value changed'
|
|
610
|
+
* @deprecated
|
|
611
|
+
* This component has been renamed. Use `EventListenerPlugin` instead.
|
|
624
612
|
*
|
|
625
|
-
* @example
|
|
626
|
-
* Listen and log events.
|
|
627
|
-
* ```tsx
|
|
628
|
-
* import {EditorProvider} from '@portabletext/editor'
|
|
629
|
-
* import {EventListenerPlugin} from '@portabletext/editor/plugins'
|
|
630
|
-
*
|
|
631
|
-
* function MyComponent() {
|
|
632
|
-
* return (
|
|
633
|
-
* <EditorProvider>
|
|
634
|
-
* <EventListenerPlugin
|
|
635
|
-
* on={(event) => {
|
|
636
|
-
* console.log(event)
|
|
637
|
-
* }
|
|
638
|
-
* } />
|
|
639
|
-
* { ... }
|
|
640
|
-
* </EditorProvider>
|
|
641
|
-
* )
|
|
642
|
-
* }
|
|
643
613
|
* ```
|
|
644
|
-
* @
|
|
645
|
-
* Handle events when there is a mutation.
|
|
646
|
-
* ```tsx
|
|
647
|
-
* <EventListenerPlugin
|
|
648
|
-
* on={(event) => {
|
|
649
|
-
* if (event.type === 'mutation') {
|
|
650
|
-
* console.log('Value changed:', event.snapshot)
|
|
651
|
-
* }
|
|
652
|
-
* }}
|
|
653
|
-
* />
|
|
614
|
+
* import {EventListenerPlugin} from '@portabletext/editor/plugins'
|
|
654
615
|
* ```
|
|
655
|
-
* @group Components
|
|
656
616
|
*/
|
|
657
617
|
export declare function EditorEventListener(props: {
|
|
658
618
|
on: (event: EditorEmittedEvent) => void
|
|
@@ -1013,6 +973,15 @@ declare const editorMachine: StateMachine<
|
|
|
1013
973
|
| {
|
|
1014
974
|
type: 'notify.unset'
|
|
1015
975
|
previousValue: Array<PortableTextBlock>
|
|
976
|
+
}
|
|
977
|
+
| {
|
|
978
|
+
type: 'dragstart'
|
|
979
|
+
}
|
|
980
|
+
| {
|
|
981
|
+
type: 'dragend'
|
|
982
|
+
}
|
|
983
|
+
| {
|
|
984
|
+
type: 'drop'
|
|
1016
985
|
},
|
|
1017
986
|
{},
|
|
1018
987
|
never,
|
|
@@ -1074,7 +1043,9 @@ declare const editorMachine: StateMachine<
|
|
|
1074
1043
|
never,
|
|
1075
1044
|
{
|
|
1076
1045
|
'edit mode':
|
|
1077
|
-
|
|
|
1046
|
+
| {
|
|
1047
|
+
editable: 'dragging internally' | 'idle'
|
|
1048
|
+
}
|
|
1078
1049
|
| {
|
|
1079
1050
|
'read only': 'read only' | 'determine initial edit mode'
|
|
1080
1051
|
}
|
|
@@ -1085,7 +1056,7 @@ declare const editorMachine: StateMachine<
|
|
|
1085
1056
|
pristine: 'normalizing' | 'idle'
|
|
1086
1057
|
}
|
|
1087
1058
|
},
|
|
1088
|
-
|
|
1059
|
+
'dragging internally',
|
|
1089
1060
|
{
|
|
1090
1061
|
behaviors?: Array<Behavior>
|
|
1091
1062
|
converters?: Array<Converter>
|
|
@@ -1759,6 +1730,15 @@ declare const editorMachine: StateMachine<
|
|
|
1759
1730
|
| {
|
|
1760
1731
|
type: 'notify.unset'
|
|
1761
1732
|
previousValue: Array<PortableTextBlock>
|
|
1733
|
+
}
|
|
1734
|
+
| {
|
|
1735
|
+
type: 'dragstart'
|
|
1736
|
+
}
|
|
1737
|
+
| {
|
|
1738
|
+
type: 'dragend'
|
|
1739
|
+
}
|
|
1740
|
+
| {
|
|
1741
|
+
type: 'drop'
|
|
1762
1742
|
},
|
|
1763
1743
|
Record<string, AnyActorRef | undefined>,
|
|
1764
1744
|
StateValue,
|
|
@@ -2107,6 +2087,15 @@ declare const editorMachine: StateMachine<
|
|
|
2107
2087
|
| {
|
|
2108
2088
|
type: 'notify.unset'
|
|
2109
2089
|
previousValue: Array<PortableTextBlock>
|
|
2090
|
+
}
|
|
2091
|
+
| {
|
|
2092
|
+
type: 'dragstart'
|
|
2093
|
+
}
|
|
2094
|
+
| {
|
|
2095
|
+
type: 'dragend'
|
|
2096
|
+
}
|
|
2097
|
+
| {
|
|
2098
|
+
type: 'drop'
|
|
2110
2099
|
},
|
|
2111
2100
|
AnyEventObject
|
|
2112
2101
|
>
|
|
@@ -2479,6 +2468,15 @@ declare const editorMachine: StateMachine<
|
|
|
2479
2468
|
| {
|
|
2480
2469
|
type: 'notify.unset'
|
|
2481
2470
|
previousValue: Array<PortableTextBlock>
|
|
2471
|
+
}
|
|
2472
|
+
| {
|
|
2473
|
+
type: 'dragstart'
|
|
2474
|
+
}
|
|
2475
|
+
| {
|
|
2476
|
+
type: 'dragend'
|
|
2477
|
+
}
|
|
2478
|
+
| {
|
|
2479
|
+
type: 'drop'
|
|
2482
2480
|
},
|
|
2483
2481
|
undefined,
|
|
2484
2482
|
never,
|
|
@@ -3116,6 +3114,15 @@ declare const editorMachine: StateMachine<
|
|
|
3116
3114
|
| {
|
|
3117
3115
|
type: 'notify.unset'
|
|
3118
3116
|
previousValue: Array<PortableTextBlock>
|
|
3117
|
+
}
|
|
3118
|
+
| {
|
|
3119
|
+
type: 'dragstart'
|
|
3120
|
+
}
|
|
3121
|
+
| {
|
|
3122
|
+
type: 'dragend'
|
|
3123
|
+
}
|
|
3124
|
+
| {
|
|
3125
|
+
type: 'drop'
|
|
3119
3126
|
},
|
|
3120
3127
|
undefined,
|
|
3121
3128
|
never,
|
|
@@ -3756,6 +3763,15 @@ declare const editorMachine: StateMachine<
|
|
|
3756
3763
|
| {
|
|
3757
3764
|
type: 'notify.unset'
|
|
3758
3765
|
previousValue: Array<PortableTextBlock>
|
|
3766
|
+
}
|
|
3767
|
+
| {
|
|
3768
|
+
type: 'dragstart'
|
|
3769
|
+
}
|
|
3770
|
+
| {
|
|
3771
|
+
type: 'dragend'
|
|
3772
|
+
}
|
|
3773
|
+
| {
|
|
3774
|
+
type: 'drop'
|
|
3759
3775
|
},
|
|
3760
3776
|
undefined,
|
|
3761
3777
|
never,
|
|
@@ -4395,6 +4411,15 @@ declare const editorMachine: StateMachine<
|
|
|
4395
4411
|
| {
|
|
4396
4412
|
type: 'notify.unset'
|
|
4397
4413
|
previousValue: Array<PortableTextBlock>
|
|
4414
|
+
}
|
|
4415
|
+
| {
|
|
4416
|
+
type: 'dragstart'
|
|
4417
|
+
}
|
|
4418
|
+
| {
|
|
4419
|
+
type: 'dragend'
|
|
4420
|
+
}
|
|
4421
|
+
| {
|
|
4422
|
+
type: 'drop'
|
|
4398
4423
|
},
|
|
4399
4424
|
undefined,
|
|
4400
4425
|
never,
|
|
@@ -5033,6 +5058,15 @@ declare const editorMachine: StateMachine<
|
|
|
5033
5058
|
| {
|
|
5034
5059
|
type: 'notify.unset'
|
|
5035
5060
|
previousValue: Array<PortableTextBlock>
|
|
5061
|
+
}
|
|
5062
|
+
| {
|
|
5063
|
+
type: 'dragstart'
|
|
5064
|
+
}
|
|
5065
|
+
| {
|
|
5066
|
+
type: 'dragend'
|
|
5067
|
+
}
|
|
5068
|
+
| {
|
|
5069
|
+
type: 'drop'
|
|
5036
5070
|
},
|
|
5037
5071
|
undefined,
|
|
5038
5072
|
never,
|
|
@@ -5672,6 +5706,15 @@ declare const editorMachine: StateMachine<
|
|
|
5672
5706
|
| {
|
|
5673
5707
|
type: 'notify.unset'
|
|
5674
5708
|
previousValue: Array<PortableTextBlock>
|
|
5709
|
+
}
|
|
5710
|
+
| {
|
|
5711
|
+
type: 'dragstart'
|
|
5712
|
+
}
|
|
5713
|
+
| {
|
|
5714
|
+
type: 'dragend'
|
|
5715
|
+
}
|
|
5716
|
+
| {
|
|
5717
|
+
type: 'drop'
|
|
5675
5718
|
},
|
|
5676
5719
|
undefined,
|
|
5677
5720
|
never,
|
|
@@ -6036,6 +6079,15 @@ declare const editorMachine: StateMachine<
|
|
|
6036
6079
|
| {
|
|
6037
6080
|
type: 'notify.unset'
|
|
6038
6081
|
previousValue: Array<PortableTextBlock>
|
|
6082
|
+
}
|
|
6083
|
+
| {
|
|
6084
|
+
type: 'dragstart'
|
|
6085
|
+
}
|
|
6086
|
+
| {
|
|
6087
|
+
type: 'dragend'
|
|
6088
|
+
}
|
|
6089
|
+
| {
|
|
6090
|
+
type: 'drop'
|
|
6039
6091
|
},
|
|
6040
6092
|
undefined,
|
|
6041
6093
|
never,
|
|
@@ -6675,6 +6727,15 @@ declare const editorMachine: StateMachine<
|
|
|
6675
6727
|
| {
|
|
6676
6728
|
type: 'notify.unset'
|
|
6677
6729
|
previousValue: Array<PortableTextBlock>
|
|
6730
|
+
}
|
|
6731
|
+
| {
|
|
6732
|
+
type: 'dragstart'
|
|
6733
|
+
}
|
|
6734
|
+
| {
|
|
6735
|
+
type: 'dragend'
|
|
6736
|
+
}
|
|
6737
|
+
| {
|
|
6738
|
+
type: 'drop'
|
|
6678
6739
|
},
|
|
6679
6740
|
undefined,
|
|
6680
6741
|
never,
|
|
@@ -7312,6 +7373,15 @@ declare const editorMachine: StateMachine<
|
|
|
7312
7373
|
| {
|
|
7313
7374
|
type: 'notify.unset'
|
|
7314
7375
|
previousValue: Array<PortableTextBlock>
|
|
7376
|
+
}
|
|
7377
|
+
| {
|
|
7378
|
+
type: 'dragstart'
|
|
7379
|
+
}
|
|
7380
|
+
| {
|
|
7381
|
+
type: 'dragend'
|
|
7382
|
+
}
|
|
7383
|
+
| {
|
|
7384
|
+
type: 'drop'
|
|
7315
7385
|
},
|
|
7316
7386
|
undefined,
|
|
7317
7387
|
never,
|
|
@@ -7950,6 +8020,15 @@ declare const editorMachine: StateMachine<
|
|
|
7950
8020
|
| {
|
|
7951
8021
|
type: 'notify.unset'
|
|
7952
8022
|
previousValue: Array<PortableTextBlock>
|
|
8023
|
+
}
|
|
8024
|
+
| {
|
|
8025
|
+
type: 'dragstart'
|
|
8026
|
+
}
|
|
8027
|
+
| {
|
|
8028
|
+
type: 'dragend'
|
|
8029
|
+
}
|
|
8030
|
+
| {
|
|
8031
|
+
type: 'drop'
|
|
7953
8032
|
},
|
|
7954
8033
|
undefined,
|
|
7955
8034
|
never,
|
|
@@ -8591,6 +8670,15 @@ declare const editorMachine: StateMachine<
|
|
|
8591
8670
|
| {
|
|
8592
8671
|
type: 'notify.unset'
|
|
8593
8672
|
previousValue: Array<PortableTextBlock>
|
|
8673
|
+
}
|
|
8674
|
+
| {
|
|
8675
|
+
type: 'dragstart'
|
|
8676
|
+
}
|
|
8677
|
+
| {
|
|
8678
|
+
type: 'dragend'
|
|
8679
|
+
}
|
|
8680
|
+
| {
|
|
8681
|
+
type: 'drop'
|
|
8594
8682
|
},
|
|
8595
8683
|
undefined,
|
|
8596
8684
|
never,
|
|
@@ -9232,6 +9320,15 @@ declare const editorMachine: StateMachine<
|
|
|
9232
9320
|
| {
|
|
9233
9321
|
type: 'notify.unset'
|
|
9234
9322
|
previousValue: Array<PortableTextBlock>
|
|
9323
|
+
}
|
|
9324
|
+
| {
|
|
9325
|
+
type: 'dragstart'
|
|
9326
|
+
}
|
|
9327
|
+
| {
|
|
9328
|
+
type: 'dragend'
|
|
9329
|
+
}
|
|
9330
|
+
| {
|
|
9331
|
+
type: 'drop'
|
|
9235
9332
|
},
|
|
9236
9333
|
undefined,
|
|
9237
9334
|
never,
|
|
@@ -9601,6 +9698,15 @@ declare const editorMachine: StateMachine<
|
|
|
9601
9698
|
| {
|
|
9602
9699
|
type: 'notify.unset'
|
|
9603
9700
|
previousValue: Array<PortableTextBlock>
|
|
9701
|
+
}
|
|
9702
|
+
| {
|
|
9703
|
+
type: 'dragstart'
|
|
9704
|
+
}
|
|
9705
|
+
| {
|
|
9706
|
+
type: 'dragend'
|
|
9707
|
+
}
|
|
9708
|
+
| {
|
|
9709
|
+
type: 'drop'
|
|
9604
9710
|
},
|
|
9605
9711
|
undefined,
|
|
9606
9712
|
never,
|
|
@@ -9967,6 +10073,15 @@ declare const editorMachine: StateMachine<
|
|
|
9967
10073
|
| {
|
|
9968
10074
|
type: 'notify.unset'
|
|
9969
10075
|
previousValue: Array<PortableTextBlock>
|
|
10076
|
+
}
|
|
10077
|
+
| {
|
|
10078
|
+
type: 'dragstart'
|
|
10079
|
+
}
|
|
10080
|
+
| {
|
|
10081
|
+
type: 'dragend'
|
|
10082
|
+
}
|
|
10083
|
+
| {
|
|
10084
|
+
type: 'drop'
|
|
9970
10085
|
},
|
|
9971
10086
|
undefined,
|
|
9972
10087
|
never,
|
|
@@ -10483,6 +10598,15 @@ declare const editorMachine: StateMachine<
|
|
|
10483
10598
|
| {
|
|
10484
10599
|
type: 'notify.unset'
|
|
10485
10600
|
previousValue: Array<PortableTextBlock>
|
|
10601
|
+
}
|
|
10602
|
+
| {
|
|
10603
|
+
type: 'dragstart'
|
|
10604
|
+
}
|
|
10605
|
+
| {
|
|
10606
|
+
type: 'dragend'
|
|
10607
|
+
}
|
|
10608
|
+
| {
|
|
10609
|
+
type: 'drop'
|
|
10486
10610
|
},
|
|
10487
10611
|
undefined,
|
|
10488
10612
|
never,
|
|
@@ -11129,6 +11253,15 @@ declare const editorMachine: StateMachine<
|
|
|
11129
11253
|
| {
|
|
11130
11254
|
type: 'notify.unset'
|
|
11131
11255
|
previousValue: Array<PortableTextBlock>
|
|
11256
|
+
}
|
|
11257
|
+
| {
|
|
11258
|
+
type: 'dragstart'
|
|
11259
|
+
}
|
|
11260
|
+
| {
|
|
11261
|
+
type: 'dragend'
|
|
11262
|
+
}
|
|
11263
|
+
| {
|
|
11264
|
+
type: 'drop'
|
|
11132
11265
|
},
|
|
11133
11266
|
undefined,
|
|
11134
11267
|
never,
|
|
@@ -11768,6 +11901,15 @@ declare const editorMachine: StateMachine<
|
|
|
11768
11901
|
| {
|
|
11769
11902
|
type: 'notify.unset'
|
|
11770
11903
|
previousValue: Array<PortableTextBlock>
|
|
11904
|
+
}
|
|
11905
|
+
| {
|
|
11906
|
+
type: 'dragstart'
|
|
11907
|
+
}
|
|
11908
|
+
| {
|
|
11909
|
+
type: 'dragend'
|
|
11910
|
+
}
|
|
11911
|
+
| {
|
|
11912
|
+
type: 'drop'
|
|
11771
11913
|
},
|
|
11772
11914
|
undefined,
|
|
11773
11915
|
never,
|
|
@@ -12407,6 +12549,15 @@ declare const editorMachine: StateMachine<
|
|
|
12407
12549
|
| {
|
|
12408
12550
|
type: 'notify.unset'
|
|
12409
12551
|
previousValue: Array<PortableTextBlock>
|
|
12552
|
+
}
|
|
12553
|
+
| {
|
|
12554
|
+
type: 'dragstart'
|
|
12555
|
+
}
|
|
12556
|
+
| {
|
|
12557
|
+
type: 'dragend'
|
|
12558
|
+
}
|
|
12559
|
+
| {
|
|
12560
|
+
type: 'drop'
|
|
12410
12561
|
},
|
|
12411
12562
|
undefined,
|
|
12412
12563
|
never,
|
|
@@ -13059,6 +13210,15 @@ declare const editorMachine: StateMachine<
|
|
|
13059
13210
|
| {
|
|
13060
13211
|
type: 'notify.unset'
|
|
13061
13212
|
previousValue: Array<PortableTextBlock>
|
|
13213
|
+
}
|
|
13214
|
+
| {
|
|
13215
|
+
type: 'dragstart'
|
|
13216
|
+
}
|
|
13217
|
+
| {
|
|
13218
|
+
type: 'dragend'
|
|
13219
|
+
}
|
|
13220
|
+
| {
|
|
13221
|
+
type: 'drop'
|
|
13062
13222
|
},
|
|
13063
13223
|
undefined,
|
|
13064
13224
|
never,
|
|
@@ -13712,6 +13872,15 @@ declare const editorMachine: StateMachine<
|
|
|
13712
13872
|
| {
|
|
13713
13873
|
type: 'notify.unset'
|
|
13714
13874
|
previousValue: Array<PortableTextBlock>
|
|
13875
|
+
}
|
|
13876
|
+
| {
|
|
13877
|
+
type: 'dragstart'
|
|
13878
|
+
}
|
|
13879
|
+
| {
|
|
13880
|
+
type: 'dragend'
|
|
13881
|
+
}
|
|
13882
|
+
| {
|
|
13883
|
+
type: 'drop'
|
|
13715
13884
|
},
|
|
13716
13885
|
undefined,
|
|
13717
13886
|
never,
|
|
@@ -14351,6 +14520,15 @@ declare const editorMachine: StateMachine<
|
|
|
14351
14520
|
| {
|
|
14352
14521
|
type: 'notify.unset'
|
|
14353
14522
|
previousValue: Array<PortableTextBlock>
|
|
14523
|
+
}
|
|
14524
|
+
| {
|
|
14525
|
+
type: 'dragstart'
|
|
14526
|
+
}
|
|
14527
|
+
| {
|
|
14528
|
+
type: 'dragend'
|
|
14529
|
+
}
|
|
14530
|
+
| {
|
|
14531
|
+
type: 'drop'
|
|
14354
14532
|
},
|
|
14355
14533
|
undefined,
|
|
14356
14534
|
never,
|
|
@@ -14993,6 +15171,15 @@ declare const editorMachine: StateMachine<
|
|
|
14993
15171
|
| {
|
|
14994
15172
|
type: 'notify.unset'
|
|
14995
15173
|
previousValue: Array<PortableTextBlock>
|
|
15174
|
+
}
|
|
15175
|
+
| {
|
|
15176
|
+
type: 'dragstart'
|
|
15177
|
+
}
|
|
15178
|
+
| {
|
|
15179
|
+
type: 'dragend'
|
|
15180
|
+
}
|
|
15181
|
+
| {
|
|
15182
|
+
type: 'drop'
|
|
14996
15183
|
},
|
|
14997
15184
|
undefined,
|
|
14998
15185
|
never,
|
|
@@ -15686,6 +15873,15 @@ declare const editorMachine: StateMachine<
|
|
|
15686
15873
|
| {
|
|
15687
15874
|
type: 'notify.unset'
|
|
15688
15875
|
previousValue: Array<PortableTextBlock>
|
|
15876
|
+
}
|
|
15877
|
+
| {
|
|
15878
|
+
type: 'dragstart'
|
|
15879
|
+
}
|
|
15880
|
+
| {
|
|
15881
|
+
type: 'dragend'
|
|
15882
|
+
}
|
|
15883
|
+
| {
|
|
15884
|
+
type: 'drop'
|
|
15689
15885
|
},
|
|
15690
15886
|
undefined,
|
|
15691
15887
|
never,
|
|
@@ -16334,6 +16530,15 @@ declare const editorMachine: StateMachine<
|
|
|
16334
16530
|
| {
|
|
16335
16531
|
type: 'notify.unset'
|
|
16336
16532
|
previousValue: Array<PortableTextBlock>
|
|
16533
|
+
}
|
|
16534
|
+
| {
|
|
16535
|
+
type: 'dragstart'
|
|
16536
|
+
}
|
|
16537
|
+
| {
|
|
16538
|
+
type: 'dragend'
|
|
16539
|
+
}
|
|
16540
|
+
| {
|
|
16541
|
+
type: 'drop'
|
|
16337
16542
|
},
|
|
16338
16543
|
undefined,
|
|
16339
16544
|
never,
|
|
@@ -16983,6 +17188,15 @@ declare const editorMachine: StateMachine<
|
|
|
16983
17188
|
| {
|
|
16984
17189
|
type: 'notify.unset'
|
|
16985
17190
|
previousValue: Array<PortableTextBlock>
|
|
17191
|
+
}
|
|
17192
|
+
| {
|
|
17193
|
+
type: 'dragstart'
|
|
17194
|
+
}
|
|
17195
|
+
| {
|
|
17196
|
+
type: 'dragend'
|
|
17197
|
+
}
|
|
17198
|
+
| {
|
|
17199
|
+
type: 'drop'
|
|
16986
17200
|
},
|
|
16987
17201
|
undefined,
|
|
16988
17202
|
never,
|
|
@@ -17623,6 +17837,15 @@ declare const editorMachine: StateMachine<
|
|
|
17623
17837
|
| {
|
|
17624
17838
|
type: 'notify.unset'
|
|
17625
17839
|
previousValue: Array<PortableTextBlock>
|
|
17840
|
+
}
|
|
17841
|
+
| {
|
|
17842
|
+
type: 'dragstart'
|
|
17843
|
+
}
|
|
17844
|
+
| {
|
|
17845
|
+
type: 'dragend'
|
|
17846
|
+
}
|
|
17847
|
+
| {
|
|
17848
|
+
type: 'drop'
|
|
17626
17849
|
},
|
|
17627
17850
|
undefined,
|
|
17628
17851
|
never,
|
|
@@ -18265,6 +18488,15 @@ declare const editorMachine: StateMachine<
|
|
|
18265
18488
|
| {
|
|
18266
18489
|
type: 'notify.unset'
|
|
18267
18490
|
previousValue: Array<PortableTextBlock>
|
|
18491
|
+
}
|
|
18492
|
+
| {
|
|
18493
|
+
type: 'dragstart'
|
|
18494
|
+
}
|
|
18495
|
+
| {
|
|
18496
|
+
type: 'dragend'
|
|
18497
|
+
}
|
|
18498
|
+
| {
|
|
18499
|
+
type: 'drop'
|
|
18268
18500
|
},
|
|
18269
18501
|
undefined,
|
|
18270
18502
|
never,
|
|
@@ -18913,6 +19145,15 @@ declare const editorMachine: StateMachine<
|
|
|
18913
19145
|
| {
|
|
18914
19146
|
type: 'notify.unset'
|
|
18915
19147
|
previousValue: Array<PortableTextBlock>
|
|
19148
|
+
}
|
|
19149
|
+
| {
|
|
19150
|
+
type: 'dragstart'
|
|
19151
|
+
}
|
|
19152
|
+
| {
|
|
19153
|
+
type: 'dragend'
|
|
19154
|
+
}
|
|
19155
|
+
| {
|
|
19156
|
+
type: 'drop'
|
|
18916
19157
|
},
|
|
18917
19158
|
undefined,
|
|
18918
19159
|
never,
|
|
@@ -19208,6 +19449,27 @@ declare const editorMachine: StateMachine<
|
|
|
19208
19449
|
>
|
|
19209
19450
|
}
|
|
19210
19451
|
}
|
|
19452
|
+
readonly initial: 'idle'
|
|
19453
|
+
readonly states: {
|
|
19454
|
+
readonly 'idle': {
|
|
19455
|
+
readonly on: {
|
|
19456
|
+
readonly dragstart: {
|
|
19457
|
+
readonly target: 'dragging internally'
|
|
19458
|
+
}
|
|
19459
|
+
}
|
|
19460
|
+
}
|
|
19461
|
+
readonly 'dragging internally': {
|
|
19462
|
+
readonly tags: readonly ['dragging internally']
|
|
19463
|
+
readonly on: {
|
|
19464
|
+
readonly dragend: {
|
|
19465
|
+
readonly target: 'idle'
|
|
19466
|
+
}
|
|
19467
|
+
readonly drop: {
|
|
19468
|
+
readonly target: 'idle'
|
|
19469
|
+
}
|
|
19470
|
+
}
|
|
19471
|
+
}
|
|
19472
|
+
}
|
|
19211
19473
|
}
|
|
19212
19474
|
}
|
|
19213
19475
|
}
|
|
@@ -19347,6 +19609,13 @@ export declare type EditorSelector<TSelected> = (
|
|
|
19347
19609
|
*/
|
|
19348
19610
|
export declare type EditorSnapshot = {
|
|
19349
19611
|
context: EditorContext
|
|
19612
|
+
/**
|
|
19613
|
+
* @beta
|
|
19614
|
+
* Do not rely on this externally
|
|
19615
|
+
*/
|
|
19616
|
+
beta: {
|
|
19617
|
+
hasTag: HasTag
|
|
19618
|
+
}
|
|
19350
19619
|
}
|
|
19351
19620
|
|
|
19352
19621
|
/**
|
|
@@ -19406,6 +19675,8 @@ export declare type FocusChange = {
|
|
|
19406
19675
|
event: FocusEvent_2<HTMLDivElement, Element>
|
|
19407
19676
|
}
|
|
19408
19677
|
|
|
19678
|
+
declare type HasTag = ReturnType<EditorActor['getSnapshot']>['hasTag']
|
|
19679
|
+
|
|
19409
19680
|
/** @internal */
|
|
19410
19681
|
declare interface History_2 {
|
|
19411
19682
|
redos: HistoryItem[]
|
|
@@ -19771,9 +20042,9 @@ export declare class PortableTextEditor extends Component<
|
|
|
19771
20042
|
path: Path,
|
|
19772
20043
|
) => [
|
|
19773
20044
|
(
|
|
19774
|
-
| PortableTextSpan
|
|
20045
|
+
| PortableTextTextBlock<PortableTextObject | PortableTextSpan>
|
|
19775
20046
|
| PortableTextObject
|
|
19776
|
-
|
|
|
20047
|
+
| PortableTextSpan
|
|
19777
20048
|
| undefined
|
|
19778
20049
|
),
|
|
19779
20050
|
Path | undefined,
|