@portabletext/editor 1.26.2 → 1.26.3
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/index.cjs +8 -6
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +29 -29
- package/lib/index.d.ts +29 -29
- package/lib/index.js +8 -6
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/editor/editor-machine.ts +12 -10
package/lib/index.d.cts
CHANGED
|
@@ -9266,6 +9266,35 @@ export declare const editorMachine: StateMachine<
|
|
|
9266
9266
|
readonly states: {
|
|
9267
9267
|
readonly 'read only': {
|
|
9268
9268
|
readonly initial: 'determine initial edit mode'
|
|
9269
|
+
readonly on: {
|
|
9270
|
+
readonly 'behavior event': {
|
|
9271
|
+
readonly actions: 'handle behavior event'
|
|
9272
|
+
readonly guard: ({
|
|
9273
|
+
event,
|
|
9274
|
+
}: GuardArgs<
|
|
9275
|
+
{
|
|
9276
|
+
behaviors: Set<Behavior>
|
|
9277
|
+
converters: Set<Converter>
|
|
9278
|
+
keyGenerator: () => string
|
|
9279
|
+
pendingEvents: Array<PatchEvent | MutationEvent>
|
|
9280
|
+
schema: EditorSchema
|
|
9281
|
+
initialReadOnly: boolean
|
|
9282
|
+
maxBlocks: number | undefined
|
|
9283
|
+
selection: EditorSelection
|
|
9284
|
+
value: Array<PortableTextBlock> | undefined
|
|
9285
|
+
},
|
|
9286
|
+
{
|
|
9287
|
+
type: 'behavior event'
|
|
9288
|
+
behaviorEvent: SyntheticBehaviorEvent | NativeBehaviorEvent
|
|
9289
|
+
editor: PortableTextSlateEditor
|
|
9290
|
+
defaultActionCallback?: () => void
|
|
9291
|
+
nativeEvent?: {
|
|
9292
|
+
preventDefault: () => void
|
|
9293
|
+
}
|
|
9294
|
+
}
|
|
9295
|
+
>) => boolean
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9269
9298
|
readonly states: {
|
|
9270
9299
|
readonly 'determine initial edit mode': {
|
|
9271
9300
|
readonly on: {
|
|
@@ -9299,35 +9328,6 @@ export declare const editorMachine: StateMachine<
|
|
|
9299
9328
|
}
|
|
9300
9329
|
readonly 'read only': {
|
|
9301
9330
|
readonly on: {
|
|
9302
|
-
readonly 'behavior event': {
|
|
9303
|
-
readonly actions: 'handle behavior event'
|
|
9304
|
-
readonly guard: ({
|
|
9305
|
-
event,
|
|
9306
|
-
}: GuardArgs<
|
|
9307
|
-
{
|
|
9308
|
-
behaviors: Set<Behavior>
|
|
9309
|
-
converters: Set<Converter>
|
|
9310
|
-
keyGenerator: () => string
|
|
9311
|
-
pendingEvents: Array<PatchEvent | MutationEvent>
|
|
9312
|
-
schema: EditorSchema
|
|
9313
|
-
initialReadOnly: boolean
|
|
9314
|
-
maxBlocks: number | undefined
|
|
9315
|
-
selection: EditorSelection
|
|
9316
|
-
value: Array<PortableTextBlock> | undefined
|
|
9317
|
-
},
|
|
9318
|
-
{
|
|
9319
|
-
type: 'behavior event'
|
|
9320
|
-
behaviorEvent:
|
|
9321
|
-
| SyntheticBehaviorEvent
|
|
9322
|
-
| NativeBehaviorEvent
|
|
9323
|
-
editor: PortableTextSlateEditor
|
|
9324
|
-
defaultActionCallback?: () => void
|
|
9325
|
-
nativeEvent?: {
|
|
9326
|
-
preventDefault: () => void
|
|
9327
|
-
}
|
|
9328
|
-
}
|
|
9329
|
-
>) => boolean
|
|
9330
|
-
}
|
|
9331
9331
|
readonly 'update readOnly': {
|
|
9332
9332
|
readonly guard: ({
|
|
9333
9333
|
event,
|
package/lib/index.d.ts
CHANGED
|
@@ -9266,6 +9266,35 @@ export declare const editorMachine: StateMachine<
|
|
|
9266
9266
|
readonly states: {
|
|
9267
9267
|
readonly 'read only': {
|
|
9268
9268
|
readonly initial: 'determine initial edit mode'
|
|
9269
|
+
readonly on: {
|
|
9270
|
+
readonly 'behavior event': {
|
|
9271
|
+
readonly actions: 'handle behavior event'
|
|
9272
|
+
readonly guard: ({
|
|
9273
|
+
event,
|
|
9274
|
+
}: GuardArgs<
|
|
9275
|
+
{
|
|
9276
|
+
behaviors: Set<Behavior>
|
|
9277
|
+
converters: Set<Converter>
|
|
9278
|
+
keyGenerator: () => string
|
|
9279
|
+
pendingEvents: Array<PatchEvent | MutationEvent>
|
|
9280
|
+
schema: EditorSchema
|
|
9281
|
+
initialReadOnly: boolean
|
|
9282
|
+
maxBlocks: number | undefined
|
|
9283
|
+
selection: EditorSelection
|
|
9284
|
+
value: Array<PortableTextBlock> | undefined
|
|
9285
|
+
},
|
|
9286
|
+
{
|
|
9287
|
+
type: 'behavior event'
|
|
9288
|
+
behaviorEvent: SyntheticBehaviorEvent | NativeBehaviorEvent
|
|
9289
|
+
editor: PortableTextSlateEditor
|
|
9290
|
+
defaultActionCallback?: () => void
|
|
9291
|
+
nativeEvent?: {
|
|
9292
|
+
preventDefault: () => void
|
|
9293
|
+
}
|
|
9294
|
+
}
|
|
9295
|
+
>) => boolean
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9269
9298
|
readonly states: {
|
|
9270
9299
|
readonly 'determine initial edit mode': {
|
|
9271
9300
|
readonly on: {
|
|
@@ -9299,35 +9328,6 @@ export declare const editorMachine: StateMachine<
|
|
|
9299
9328
|
}
|
|
9300
9329
|
readonly 'read only': {
|
|
9301
9330
|
readonly on: {
|
|
9302
|
-
readonly 'behavior event': {
|
|
9303
|
-
readonly actions: 'handle behavior event'
|
|
9304
|
-
readonly guard: ({
|
|
9305
|
-
event,
|
|
9306
|
-
}: GuardArgs<
|
|
9307
|
-
{
|
|
9308
|
-
behaviors: Set<Behavior>
|
|
9309
|
-
converters: Set<Converter>
|
|
9310
|
-
keyGenerator: () => string
|
|
9311
|
-
pendingEvents: Array<PatchEvent | MutationEvent>
|
|
9312
|
-
schema: EditorSchema
|
|
9313
|
-
initialReadOnly: boolean
|
|
9314
|
-
maxBlocks: number | undefined
|
|
9315
|
-
selection: EditorSelection
|
|
9316
|
-
value: Array<PortableTextBlock> | undefined
|
|
9317
|
-
},
|
|
9318
|
-
{
|
|
9319
|
-
type: 'behavior event'
|
|
9320
|
-
behaviorEvent:
|
|
9321
|
-
| SyntheticBehaviorEvent
|
|
9322
|
-
| NativeBehaviorEvent
|
|
9323
|
-
editor: PortableTextSlateEditor
|
|
9324
|
-
defaultActionCallback?: () => void
|
|
9325
|
-
nativeEvent?: {
|
|
9326
|
-
preventDefault: () => void
|
|
9327
|
-
}
|
|
9328
|
-
}
|
|
9329
|
-
>) => boolean
|
|
9330
|
-
}
|
|
9331
9331
|
readonly 'update readOnly': {
|
|
9332
9332
|
readonly guard: ({
|
|
9333
9333
|
event,
|
package/lib/index.js
CHANGED
|
@@ -6284,6 +6284,14 @@ const editorMachine = setup({
|
|
|
6284
6284
|
states: {
|
|
6285
6285
|
"read only": {
|
|
6286
6286
|
initial: "determine initial edit mode",
|
|
6287
|
+
on: {
|
|
6288
|
+
"behavior event": {
|
|
6289
|
+
actions: "handle behavior event",
|
|
6290
|
+
guard: ({
|
|
6291
|
+
event
|
|
6292
|
+
}) => event.behaviorEvent.type === "copy" || event.behaviorEvent.type === "data transfer.set" || event.behaviorEvent.type === "serialize" || event.behaviorEvent.type === "serialization.failure" || event.behaviorEvent.type === "serialization.success" || event.behaviorEvent.type === "select"
|
|
6293
|
+
}
|
|
6294
|
+
},
|
|
6287
6295
|
states: {
|
|
6288
6296
|
"determine initial edit mode": {
|
|
6289
6297
|
on: {
|
|
@@ -6299,12 +6307,6 @@ const editorMachine = setup({
|
|
|
6299
6307
|
},
|
|
6300
6308
|
"read only": {
|
|
6301
6309
|
on: {
|
|
6302
|
-
"behavior event": {
|
|
6303
|
-
actions: "handle behavior event",
|
|
6304
|
-
guard: ({
|
|
6305
|
-
event
|
|
6306
|
-
}) => event.behaviorEvent.type === "copy" || event.behaviorEvent.type === "data transfer.set" || event.behaviorEvent.type === "serialize" || event.behaviorEvent.type === "serialization.failure" || event.behaviorEvent.type === "serialization.success" || event.behaviorEvent.type === "select"
|
|
6307
|
-
},
|
|
6308
6310
|
"update readOnly": {
|
|
6309
6311
|
guard: ({
|
|
6310
6312
|
event
|