@portabletext/editor 2.1.10 → 2.1.11

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.
@@ -1,5 +1,5 @@
1
1
  import { Behavior, Editor, EditorEmittedEvent, EditorSchema } from "../_chunks-dts/behavior.types.action.cjs";
2
- import * as react22 from "react";
2
+ import * as react12 from "react";
3
3
  import React from "react";
4
4
  /**
5
5
  * @beta
@@ -181,7 +181,7 @@ type MarkdownPluginConfig = MarkdownBehaviorsConfig & {
181
181
  */
182
182
  declare function MarkdownPlugin(props: {
183
183
  config: MarkdownPluginConfig;
184
- }): react22.JSX.Element;
184
+ }): react12.JSX.Element;
185
185
  /**
186
186
  * @beta
187
187
  * Restrict the editor to one line. The plugin takes care of blocking
@@ -192,5 +192,5 @@ declare function MarkdownPlugin(props: {
192
192
  *
193
193
  * @deprecated Install the plugin from `@portabletext/plugin-one-line`
194
194
  */
195
- declare function OneLinePlugin(): react22.JSX.Element;
195
+ declare function OneLinePlugin(): react12.JSX.Element;
196
196
  export { BehaviorPlugin, DecoratorShortcutPlugin, EditorRefPlugin, EventListenerPlugin, MarkdownPlugin, type MarkdownPluginConfig, OneLinePlugin };
@@ -1,5 +1,5 @@
1
1
  import { BlockOffset, BlockPath, ChildPath, EditorContext, EditorSelection, EditorSelectionPoint } from "../_chunks-dts/behavior.types.action.js";
2
- import * as _sanity_types8 from "@sanity/types";
2
+ import * as _sanity_types9 from "@sanity/types";
3
3
  import { KeyedSegment, PortableTextBlock, PortableTextChild, PortableTextSpan, PortableTextTextBlock } from "@sanity/types";
4
4
  /**
5
5
  * @public
@@ -150,7 +150,7 @@ declare function mergeTextBlocks({
150
150
  context: Pick<EditorContext, 'keyGenerator' | 'schema'>;
151
151
  targetBlock: PortableTextTextBlock;
152
152
  incomingBlock: PortableTextTextBlock;
153
- }): PortableTextTextBlock<_sanity_types8.PortableTextObject | _sanity_types8.PortableTextSpan>;
153
+ }): PortableTextTextBlock<_sanity_types9.PortableTextObject | _sanity_types9.PortableTextSpan>;
154
154
  /**
155
155
  * @public
156
156
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "2.1.10",
3
+ "version": "2.1.11",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -78,7 +78,7 @@
78
78
  "slate": "0.118.0",
79
79
  "slate-dom": "^0.117.4",
80
80
  "slate-react": "0.117.4",
81
- "xstate": "^5.20.1",
81
+ "xstate": "^5.20.2",
82
82
  "@portabletext/block-tools": "2.0.8",
83
83
  "@portabletext/patches": "1.1.6",
84
84
  "@portabletext/keyboard-shortcuts": "1.1.1"
@@ -86,7 +86,7 @@
86
86
  "devDependencies": {
87
87
  "@portabletext/toolkit": "^2.0.17",
88
88
  "@sanity/diff-match-patch": "^3.2.0",
89
- "@sanity/pkg-utils": "^7.9.21",
89
+ "@sanity/pkg-utils": "^7.11.1",
90
90
  "@sanity/schema": "^4.3.0",
91
91
  "@sanity/types": "^4.3.0",
92
92
  "@testing-library/react": "^16.3.0",
@@ -95,8 +95,8 @@
95
95
  "@types/lodash.startcase": "^4.4.9",
96
96
  "@types/react": "^19.1.9",
97
97
  "@types/react-dom": "^19.1.7",
98
- "@typescript-eslint/eslint-plugin": "^8.38.0",
99
- "@typescript-eslint/parser": "^8.38.0",
98
+ "@typescript-eslint/eslint-plugin": "^8.39.0",
99
+ "@typescript-eslint/parser": "^8.39.0",
100
100
  "@vitejs/plugin-react": "^4.7.0",
101
101
  "@vitest/browser": "^3.2.4",
102
102
  "@vitest/coverage-istanbul": "^3.2.4",
@@ -424,7 +424,7 @@ export function createEditableAPI(
424
424
  return isActiveAnnotation(annotationType)(snapshot)
425
425
  },
426
426
  addAnnotation: (type, value) => {
427
- let paths: ReturnType<EditableAPI['addAnnotation']> = undefined
427
+ let paths: ReturnType<EditableAPI['addAnnotation']>
428
428
 
429
429
  Editor.withoutNormalizing(editor, () => {
430
430
  paths = addAnnotationOperationImplementation({
@@ -298,7 +298,7 @@ function setPatch(editor: PortableTextSlateEditor, patch: SetPatch) {
298
298
  return true
299
299
  } else if (Element.isElement(block.node) && patch.path.length === 1) {
300
300
  const {children, ...nextRest} = value as unknown as PortableTextBlock
301
- const {children: prevChildren, ...prevRest} = block.node || {
301
+ const {children: _prevChildren, ...prevRest} = block.node || {
302
302
  children: undefined,
303
303
  }
304
304
 
@@ -9,7 +9,7 @@ export function getTextMarks(
9
9
  return undefined
10
10
  }
11
11
 
12
- let marks: Array<string> | undefined = undefined
12
+ let marks: Array<string> | undefined
13
13
 
14
14
  for (const block of value) {
15
15
  if (isPortableTextBlock(block)) {
@@ -136,7 +136,7 @@ function toSlateSelectionPoint(
136
136
  let offset = spanSelectionPoint?.offset ?? selectionPoint.offset
137
137
  let childPath: Array<number> = []
138
138
  let childIndex = -1
139
- let pathChild: PortableTextSpan | PortableTextObject | undefined = undefined
139
+ let pathChild: PortableTextSpan | PortableTextObject | undefined
140
140
 
141
141
  for (const child of block.children) {
142
142
  childIndex++
@@ -46,7 +46,7 @@ export const addAnnotationOperationImplementation: BehaviorOperationImplementati
46
46
  return
47
47
  }
48
48
 
49
- let paths: AddedAnnotationPaths | undefined = undefined
49
+ let paths: AddedAnnotationPaths | undefined
50
50
  let spanPath: Path | undefined
51
51
  let markDefPath: Path | undefined
52
52
  const markDefPaths: Path[] = []