@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portabletext/editor",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.3",
|
|
4
4
|
"description": "Portable Text Editor made in React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@portabletext/toolkit": "^2.0.16",
|
|
81
81
|
"@sanity/diff-match-patch": "^3.2.0",
|
|
82
|
-
"@sanity/pkg-utils": "^7.0.
|
|
82
|
+
"@sanity/pkg-utils": "^7.0.3",
|
|
83
83
|
"@sanity/schema": "^3.71.2",
|
|
84
84
|
"@sanity/types": "^3.71.2",
|
|
85
85
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -548,6 +548,18 @@ export const editorMachine = setup({
|
|
|
548
548
|
states: {
|
|
549
549
|
'read only': {
|
|
550
550
|
initial: 'determine initial edit mode',
|
|
551
|
+
on: {
|
|
552
|
+
'behavior event': {
|
|
553
|
+
actions: 'handle behavior event',
|
|
554
|
+
guard: ({event}) =>
|
|
555
|
+
event.behaviorEvent.type === 'copy' ||
|
|
556
|
+
event.behaviorEvent.type === 'data transfer.set' ||
|
|
557
|
+
event.behaviorEvent.type === 'serialize' ||
|
|
558
|
+
event.behaviorEvent.type === 'serialization.failure' ||
|
|
559
|
+
event.behaviorEvent.type === 'serialization.success' ||
|
|
560
|
+
event.behaviorEvent.type === 'select',
|
|
561
|
+
},
|
|
562
|
+
},
|
|
551
563
|
states: {
|
|
552
564
|
'determine initial edit mode': {
|
|
553
565
|
on: {
|
|
@@ -564,16 +576,6 @@ export const editorMachine = setup({
|
|
|
564
576
|
},
|
|
565
577
|
'read only': {
|
|
566
578
|
on: {
|
|
567
|
-
'behavior event': {
|
|
568
|
-
actions: 'handle behavior event',
|
|
569
|
-
guard: ({event}) =>
|
|
570
|
-
event.behaviorEvent.type === 'copy' ||
|
|
571
|
-
event.behaviorEvent.type === 'data transfer.set' ||
|
|
572
|
-
event.behaviorEvent.type === 'serialize' ||
|
|
573
|
-
event.behaviorEvent.type === 'serialization.failure' ||
|
|
574
|
-
event.behaviorEvent.type === 'serialization.success' ||
|
|
575
|
-
event.behaviorEvent.type === 'select',
|
|
576
|
-
},
|
|
577
579
|
'update readOnly': {
|
|
578
580
|
guard: ({event}) => !event.readOnly,
|
|
579
581
|
target: '#editor.edit mode.editable',
|