@portabletext/editor 3.3.2 → 3.3.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.
@@ -2926,6 +2926,12 @@ type BlockOffset = {
2926
2926
  path: BlockPath;
2927
2927
  offset: number;
2928
2928
  };
2929
+ declare global {
2930
+ type DOMNode = typeof globalThis.Node;
2931
+ type DOMRange = typeof globalThis.Range;
2932
+ type DOMSelection = typeof globalThis.Selection;
2933
+ type DOMStaticRange = typeof globalThis.StaticRange;
2934
+ }
2929
2935
  type TextBlockWithOptionalKey = Omit<PortableTextTextBlock$1, '_key'> & {
2930
2936
  _key?: PortableTextTextBlock$1['_key'];
2931
2937
  };
@@ -3299,7 +3305,7 @@ declare const editorMachine: xstate228.StateMachine<{
3299
3305
  }, xstate228.AnyEventObject>;
3300
3306
  }) => {
3301
3307
  behaviors: Set<{
3302
- behavior: Behavior<"*" | "split" | `custom.${string}` | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.block" | "insert.child" | "insert.text" | "move.backward" | "move.block" | "move.forward" | "select" | "annotation.set" | "annotation.toggle" | "decorator.toggle" | "delete.backward" | "delete.block" | "delete.child" | "delete.forward" | "delete.text" | "deserialize" | "deserialize.data" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.inline object" | "insert.soft break" | "insert.span" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.block" | "select.previous block" | "select.next block" | "serialize" | "serialize.data" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle" | "clipboard.copy" | "clipboard.cut" | "clipboard.paste" | "drag.dragstart" | "drag.drag" | "drag.dragend" | "drag.dragenter" | "drag.dragover" | "drag.dragleave" | "drag.drop" | "input.*" | "keyboard.keydown" | "keyboard.keyup" | "mouse.click" | "history.*" | "split.*" | "delete.*" | "select.*" | "deserialize.*" | "serialize.*" | "annotation.*" | "block.*" | "child.*" | "decorator.*" | "insert.*" | "move.*" | "deserialization.*" | "list item.*" | "serialization.*" | "style.*" | "clipboard.*" | "drag.*" | "keyboard.*" | "mouse.*", true, {
3308
+ behavior: Behavior<"*" | "split" | `custom.${string}` | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.block" | "insert.child" | "insert.text" | "move.backward" | "move.block" | "move.forward" | "select" | "annotation.set" | "annotation.toggle" | "decorator.toggle" | "delete.backward" | "delete.block" | "delete.child" | "delete.forward" | "delete.text" | "deserialize" | "deserialize.data" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.inline object" | "insert.soft break" | "insert.span" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.block" | "select.previous block" | "select.next block" | "serialize" | "serialize.data" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle" | "clipboard.copy" | "clipboard.cut" | "clipboard.paste" | "drag.dragstart" | "drag.drag" | "drag.dragend" | "drag.dragenter" | "drag.dragover" | "drag.dragleave" | "drag.drop" | "input.*" | "keyboard.keydown" | "keyboard.keyup" | "mouse.click" | "style.*" | "history.*" | "split.*" | "delete.*" | "select.*" | "deserialize.*" | "serialize.*" | "annotation.*" | "block.*" | "child.*" | "decorator.*" | "insert.*" | "move.*" | "deserialization.*" | "list item.*" | "serialization.*" | "clipboard.*" | "drag.*" | "keyboard.*" | "mouse.*", true, {
3303
3309
  type: StrictExtract<"split" | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.block" | "insert.child" | "insert.text" | "move.backward" | "move.block" | "move.forward" | "select" | "annotation.set" | "annotation.toggle" | "decorator.toggle" | "delete.backward" | "delete.block" | "delete.child" | "delete.forward" | "delete.text" | "deserialize" | "deserialize.data" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.inline object" | "insert.soft break" | "insert.span" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.block" | "select.previous block" | "select.next block" | "serialize" | "serialize.data" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle", "annotation.add">;
3304
3310
  annotation: {
3305
3311
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -63,13 +63,15 @@
63
63
  ],
64
64
  "dependencies": {
65
65
  "@portabletext/to-html": "^4.0.1",
66
+ "@sanity/schema": "^4.20.3",
67
+ "@sanity/types": "^4.20.3",
66
68
  "@xstate/react": "^6.0.0",
67
69
  "debug": "^4.4.3",
68
70
  "lodash": "^4.17.21",
69
71
  "lodash.startcase": "^4.4.0",
70
- "react-compiler-runtime": "1.0.0",
72
+ "react-compiler-runtime": "^1.0.0",
71
73
  "xstate": "^5.24.0",
72
- "@portabletext/block-tools": "^4.1.7",
74
+ "@portabletext/block-tools": "^4.1.8",
73
75
  "@portabletext/keyboard-shortcuts": "^2.1.0",
74
76
  "@portabletext/markdown": "^1.0.3",
75
77
  "@portabletext/patches": "^2.0.0",
@@ -78,8 +80,6 @@
78
80
  "devDependencies": {
79
81
  "@sanity/diff-match-patch": "^3.2.0",
80
82
  "@sanity/pkg-utils": "^10.1.1",
81
- "@sanity/schema": "^4.20.3",
82
- "@sanity/types": "^4.20.3",
83
83
  "@types/debug": "^4.1.12",
84
84
  "@types/lodash": "^4.17.20",
85
85
  "@types/lodash.startcase": "^4.4.9",
@@ -90,10 +90,10 @@
90
90
  "@vitest/browser": "^4.0.14",
91
91
  "@vitest/browser-playwright": "^4.0.14",
92
92
  "@vitest/coverage-istanbul": "^4.0.14",
93
- "babel-plugin-react-compiler": "1.0.0",
93
+ "babel-plugin-react-compiler": "^1.0.0",
94
94
  "eslint": "^9.39.1",
95
95
  "eslint-formatter-gha": "^1.6.0",
96
- "eslint-plugin-react-hooks": "7.0.1",
96
+ "eslint-plugin-react-hooks": "^7.0.1",
97
97
  "jsdom": "^27.0.0",
98
98
  "react": "^19.2.1",
99
99
  "react-dom": "^19.2.1",
@@ -106,14 +106,12 @@
106
106
  "vite": "^7.1.12",
107
107
  "vitest": "^4.0.14",
108
108
  "vitest-browser-react": "^2.0.2",
109
- "@portabletext/sanity-bridge": "1.2.10",
110
- "@portabletext/test": "^1.0.0",
109
+ "@portabletext/sanity-bridge": "1.2.11",
110
+ "@portabletext/test": "^1.0.1",
111
111
  "racejar": "2.0.0"
112
112
  },
113
113
  "peerDependencies": {
114
- "@portabletext/sanity-bridge": "^1.2.10",
115
- "@sanity/schema": "^4.20.3",
116
- "@sanity/types": "^4.20.3",
114
+ "@portabletext/sanity-bridge": "^1.2.11",
117
115
  "react": "^18.3 || ^19",
118
116
  "rxjs": "^7.8.2"
119
117
  },
package/src/index.ts CHANGED
@@ -96,3 +96,12 @@ export type {
96
96
  } from './types/editor'
97
97
  export type {HotkeyOptions} from './types/options'
98
98
  export type {AnnotationPath, BlockPath, ChildPath} from './types/paths'
99
+
100
+ // Fixes an issue where slate aliased types from (https://github.com/ianstormtaylor/slate/blob/eae2474124949a4e2239568876663ce201357ac6/packages/slate-dom/src/utils/dom.ts#L5-L15)
101
+ // does not make it into the generated dts.
102
+ declare global {
103
+ type DOMNode = typeof globalThis.Node
104
+ type DOMRange = typeof globalThis.Range
105
+ type DOMSelection = typeof globalThis.Selection
106
+ type DOMStaticRange = typeof globalThis.StaticRange
107
+ }