@portabletext/editor 1.1.8 → 1.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -124,7 +124,7 @@
124
124
  "lint:fix": "biome lint --write .",
125
125
  "test": "vitest --run",
126
126
  "test:watch": "vitest",
127
- "test:e2e": "jest --config=e2e-tests/e2e.config.ts",
128
- "test:e2e:watch": "jest --config=e2e-tests/e2e.config.ts --watch"
127
+ "test:e2e-legacy": "jest --config=e2e-tests/e2e.config.ts",
128
+ "test:e2e-legacy:watch": "jest --config=e2e-tests/e2e.config.ts --watch"
129
129
  }
130
130
  }
@@ -383,6 +383,18 @@ export function createWithPortableTextMarkModel(
383
383
  }
384
384
  }
385
385
  }
386
+
387
+ if (atTheBeginningOfSpan && !spanIsEmpty && !!previousSpan) {
388
+ Transforms.insertNodes(editor, {
389
+ _type: 'span',
390
+ _key: editorActor.getSnapshot().context.keyGenerator(),
391
+ text: op.text,
392
+ marks: (previousSpan.marks ?? []).filter((mark) =>
393
+ decorators.includes(mark),
394
+ ),
395
+ })
396
+ return
397
+ }
386
398
  }
387
399
  }
388
400