@portabletext/editor
Advanced tools
Comparing version 1.16.0 to 1.16.1
{ | ||
"name": "@portabletext/editor", | ||
"version": "1.16.0", | ||
"version": "1.16.1", | ||
"description": "Portable Text Editor made in React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -36,2 +36,5 @@ import type { | ||
keyGenerator?: () => string | ||
/** | ||
* @deprecated Will be removed in the next major version | ||
*/ | ||
maxBlocks?: number | ||
@@ -68,4 +71,4 @@ readOnly?: boolean | ||
| 'patches' | ||
| 'toggle readOnly' | ||
| 'update behaviors' | ||
| 'update readOnly' | ||
| 'update value' | ||
@@ -72,0 +75,0 @@ > |
@@ -85,2 +85,6 @@ import type {Patch} from '@portabletext/patches' | ||
| { | ||
type: 'update readOnly' | ||
readOnly: boolean | ||
} | ||
| { | ||
type: 'update schema' | ||
@@ -98,5 +102,2 @@ schema: EditorSchema | ||
| { | ||
type: 'toggle readOnly' | ||
} | ||
| { | ||
type: 'update maxBlocks' | ||
@@ -444,3 +445,4 @@ maxBlocks: number | undefined | ||
on: { | ||
'toggle readOnly': { | ||
'update readOnly': { | ||
guard: ({event}) => !event.readOnly, | ||
target: '#editor.edit mode.editable', | ||
@@ -455,3 +457,4 @@ actions: ['emit editable'], | ||
on: { | ||
'toggle readOnly': { | ||
'update readOnly': { | ||
guard: ({event}) => event.readOnly, | ||
target: '#editor.edit mode.read only.read only', | ||
@@ -458,0 +461,0 @@ actions: ['emit read only'], |
@@ -114,3 +114,4 @@ import type {Patch} from '@portabletext/patches' | ||
| { | ||
type: 'toggle readOnly' | ||
type: 'update readOnly' | ||
readOnly: boolean | ||
} | ||
@@ -126,3 +127,6 @@ | SyncValueEvent, | ||
'assign readOnly': assign({ | ||
readOnly: ({context}) => !context.readOnly, | ||
readOnly: ({event}) => { | ||
assertEvent(event, 'update readOnly') | ||
return event.readOnly | ||
}, | ||
}), | ||
@@ -195,3 +199,3 @@ 'assign pending value': assign({ | ||
}, | ||
'toggle readOnly': { | ||
'update readOnly': { | ||
actions: ['assign readOnly'], | ||
@@ -198,0 +202,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3427966
48148