@portabletext/editor 3.3.15 → 4.0.0

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,2 +1,2 @@
1
- import { J as defineBehavior, Y as BehaviorGuard, a as forward, c as CustomBehaviorEvent, d as SyntheticBehaviorEvent, i as execute, l as InsertPlacement, n as BehaviorActionSet, o as raise, q as Behavior, r as effect, s as BehaviorEvent, t as BehaviorAction, u as NativeBehaviorEvent } from "../_chunks-dts/index.js";
2
- export { Behavior, BehaviorAction, BehaviorActionSet, BehaviorEvent, BehaviorGuard, CustomBehaviorEvent, InsertPlacement, NativeBehaviorEvent, SyntheticBehaviorEvent, defineBehavior, effect, execute, forward, raise };
1
+ import { J as defineBehavior, Y as BehaviorGuard, a as forward, c as CustomBehaviorEvent, d as SyntheticBehaviorEvent, i as execute, l as InsertPlacement, n as BehaviorActionSet, o as raise, q as Behavior, r as effect, s as BehaviorEvent, t as BehaviorAction, u as NativeBehaviorEvent } from "../_chunks-dts/behavior.types.action.js";
2
+ export { type Behavior, type BehaviorAction, type BehaviorActionSet, type BehaviorEvent, type BehaviorGuard, type CustomBehaviorEvent, type InsertPlacement, type NativeBehaviorEvent, type SyntheticBehaviorEvent, defineBehavior, effect, execute, forward, raise };
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as BlockAnnotationRenderProps, $t as AnnotationPath, A as PortableTextTextBlock, At as ReadyChange, B as EditorSelector, Bt as ScrollSelectionIntoViewFunction, C as ListDefinition, Ct as OnPasteResultOrPromise, D as PortableTextChild, Dt as PortableTextMemberSchemaTypes, E as PortableTextBlock, Et as PatchObservable, F as BlockOffset, Ft as RenderDecoratorFunction, G as EditorConfig, Gt as PortableTextEditable, H as EditorProvider, Ht as UndoChange, I as useEditor, It as RenderEditableFunction, Jt as PortableTextEditor, K as EditorEvent, Kt as PortableTextEditableProps, L as defaultKeyGenerator, Lt as RenderListItemFunction, M as StyleDefinition, Mt as RenderAnnotationFunction, N as StyleSchemaType, Nt as RenderBlockFunction, O as PortableTextObject, Ot as RangeDecoration, P as defineSchema, Pt as RenderChildFunction, Q as AddedAnnotationPaths, Qt as EditorSchema, R as usePortableTextEditorSelection, Rt as RenderPlaceholderFunction, S as InlineObjectSchemaType, St as OnPasteResult, T as Patch, Tt as PatchChange, U as EditorProviderProps, Ut as UnsetChange, V as useEditorSelector, Vt as SelectionChange, W as Editor, Wt as ValueChange, X as EditorContext, Xt as EditorEmittedEvent, Yt as PortableTextEditorProps, Z as EditorSnapshot, Zt as MutationEvent, _ as BlockObjectSchemaType, _t as LoadingChange, at as BlurChange, b as FieldDefinition, bt as OnCopyFn, ct as EditableAPIDeleteOptions, dt as EditorSelection, en as BlockPath, et as BlockChildRenderProps, f as PatchesEvent, ft as EditorSelectionPoint, g as BlockObjectDefinition, gt as InvalidValueResolution, h as BaseDefinition, ht as InvalidValue, it as BlockStyleRenderProps, j as SchemaDefinition, jt as RedoChange, k as PortableTextSpan, kt as RangeDecorationOnMovedDetails, lt as EditorChange, m as AnnotationSchemaType, mt as FocusChange, nt as BlockListItemRenderProps, ot as ConnectionChange, p as AnnotationDefinition, pt as ErrorChange, qt as HotkeyOptions, rt as BlockRenderProps, st as EditableAPI, tn as ChildPath, tt as BlockDecoratorRenderProps, ut as EditorChanges, v as DecoratorDefinition, vt as MutationChange, w as ListSchemaType, wt as PasteData, x as InlineObjectDefinition, xt as OnPasteFn, y as DecoratorSchemaType, yt as OnBeforeInputFn, z as usePortableTextEditor, zt as RenderStyleFunction } from "./_chunks-dts/index.js";
1
+ import { $ as BlockAnnotationRenderProps, $t as AnnotationPath, A as PortableTextTextBlock, At as ReadyChange, B as EditorSelector, Bt as ScrollSelectionIntoViewFunction, C as ListDefinition, Ct as OnPasteResultOrPromise, D as PortableTextChild, Dt as PortableTextMemberSchemaTypes, E as PortableTextBlock, Et as PatchObservable, F as BlockOffset, Ft as RenderDecoratorFunction, G as EditorConfig, Gt as PortableTextEditable, H as EditorProvider, Ht as UndoChange, I as useEditor, It as RenderEditableFunction, Jt as PortableTextEditor, K as EditorEvent, Kt as PortableTextEditableProps, L as defaultKeyGenerator, Lt as RenderListItemFunction, M as StyleDefinition, Mt as RenderAnnotationFunction, N as StyleSchemaType, Nt as RenderBlockFunction, O as PortableTextObject, Ot as RangeDecoration, P as defineSchema, Pt as RenderChildFunction, Q as AddedAnnotationPaths, Qt as EditorSchema, R as usePortableTextEditorSelection, Rt as RenderPlaceholderFunction, S as InlineObjectSchemaType, St as OnPasteResult, T as Patch, Tt as PatchChange, U as EditorProviderProps, Ut as UnsetChange, V as useEditorSelector, Vt as SelectionChange, W as Editor, Wt as ValueChange, X as EditorContext, Xt as EditorEmittedEvent, Yt as PortableTextEditorProps, Z as EditorSnapshot, Zt as MutationEvent, _ as BlockObjectSchemaType, _t as LoadingChange, at as BlurChange, b as FieldDefinition, bt as OnCopyFn, ct as EditableAPIDeleteOptions, dt as EditorSelection, en as BlockPath, et as BlockChildRenderProps, f as PatchesEvent, ft as EditorSelectionPoint, g as BlockObjectDefinition, gt as InvalidValueResolution, h as BaseDefinition, ht as InvalidValue, it as BlockStyleRenderProps, j as SchemaDefinition, jt as RedoChange, k as PortableTextSpan, kt as RangeDecorationOnMovedDetails, lt as EditorChange, m as AnnotationSchemaType, mt as FocusChange, nt as BlockListItemRenderProps, ot as ConnectionChange, p as AnnotationDefinition, pt as ErrorChange, qt as HotkeyOptions, rt as BlockRenderProps, st as EditableAPI, tn as ChildPath, tt as BlockDecoratorRenderProps, ut as EditorChanges, v as DecoratorDefinition, vt as MutationChange, w as ListSchemaType, wt as PasteData, x as InlineObjectDefinition, xt as OnPasteFn, y as DecoratorSchemaType, yt as OnBeforeInputFn, z as usePortableTextEditor, zt as RenderStyleFunction } from "./_chunks-dts/behavior.types.action.js";
2
2
  export { AddedAnnotationPaths, AnnotationDefinition, AnnotationPath, AnnotationSchemaType, BaseDefinition, BlockAnnotationRenderProps, BlockChildRenderProps, BlockDecoratorRenderProps, BlockListItemRenderProps, BlockObjectDefinition, BlockObjectSchemaType, BlockOffset, BlockPath, BlockRenderProps, BlockStyleRenderProps, BlurChange, ChildPath, ConnectionChange, DecoratorDefinition, DecoratorSchemaType, EditableAPI, EditableAPIDeleteOptions, Editor, EditorChange, EditorChanges, EditorConfig, EditorContext, EditorEmittedEvent, EditorEvent, EditorProvider, EditorProviderProps, EditorSchema, EditorSelection, EditorSelectionPoint, EditorSelector, EditorSnapshot, ErrorChange, FieldDefinition, FocusChange, HotkeyOptions, InlineObjectDefinition, InlineObjectSchemaType, InvalidValue, InvalidValueResolution, ListDefinition, ListSchemaType, LoadingChange, MutationChange, MutationEvent, OnBeforeInputFn, OnCopyFn, OnPasteFn, OnPasteResult, OnPasteResultOrPromise, PasteData, Patch, PatchChange, PatchObservable, PatchesEvent, PortableTextBlock, PortableTextChild, PortableTextEditable, PortableTextEditableProps, PortableTextEditor, PortableTextEditorProps, PortableTextMemberSchemaTypes, PortableTextObject, PortableTextSpan, PortableTextTextBlock, RangeDecoration, RangeDecorationOnMovedDetails, ReadyChange, RedoChange, RenderAnnotationFunction, RenderBlockFunction, RenderChildFunction, RenderDecoratorFunction, RenderEditableFunction, RenderListItemFunction, RenderPlaceholderFunction, RenderStyleFunction, SchemaDefinition, ScrollSelectionIntoViewFunction, SelectionChange, StyleDefinition, StyleSchemaType, UndoChange, UnsetChange, ValueChange, defineSchema, defaultKeyGenerator as keyGenerator, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection };
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
2
+ import { c } from "react/compiler-runtime";
3
3
  import { useSelector, useActorRef } from "@xstate/react";
4
4
  import { createContext, useContext, useEffect, useState, useRef, forwardRef, Component, startTransition } from "react";
5
5
  import { Element as Element$1, Text, Range, Editor, Node, Point, Path, Transforms, deleteText, Operation, createEditor } from "slate";
@@ -1,4 +1,4 @@
1
- import { W as Editor, Xt as EditorEmittedEvent, q as Behavior } from "../_chunks-dts/index.js";
1
+ import { W as Editor, Xt as EditorEmittedEvent, q as Behavior } from "../_chunks-dts/behavior.types.action.js";
2
2
  import React from "react";
3
3
  /**
4
4
  * @beta
@@ -1,4 +1,4 @@
1
- import { c } from "react-compiler-runtime";
1
+ import { c } from "react/compiler-runtime";
2
2
  import React, { useEffect } from "react";
3
3
  import { useEditor } from "../_chunks-es/use-editor.js";
4
4
  function BehaviorPlugin(props) {
@@ -1,4 +1,4 @@
1
- import { B as EditorSelector, F as BlockOffset, dt as EditorSelection, en as BlockPath, ft as EditorSelectionPoint, nn as KeyedSegment, tn as ChildPath } from "../_chunks-dts/index.js";
1
+ import { B as EditorSelector, F as BlockOffset, dt as EditorSelection, en as BlockPath, ft as EditorSelectionPoint, nn as KeyedSegment, tn as ChildPath } from "../_chunks-dts/behavior.types.action.js";
2
2
  import { PortableTextBlock, PortableTextListBlock, PortableTextObject, PortableTextSpan, PortableTextTextBlock } from "@portabletext/schema";
3
3
  /**
4
4
  * @public
@@ -1,5 +1,5 @@
1
- import { F as BlockOffset, X as EditorContext, dt as EditorSelection, en as BlockPath, ft as EditorSelectionPoint, nn as KeyedSegment, tn as ChildPath } from "../_chunks-dts/index.js";
2
- import * as _portabletext_schema15 from "@portabletext/schema";
1
+ import { F as BlockOffset, X as EditorContext, dt as EditorSelection, en as BlockPath, ft as EditorSelectionPoint, nn as KeyedSegment, tn as ChildPath } from "../_chunks-dts/behavior.types.action.js";
2
+ import * as _portabletext_schema9 from "@portabletext/schema";
3
3
  import { PortableTextBlock, PortableTextTextBlock, isSpan, isTextBlock } from "@portabletext/schema";
4
4
  /**
5
5
  * @public
@@ -142,7 +142,7 @@ declare function mergeTextBlocks({
142
142
  context: Pick<EditorContext, 'keyGenerator' | 'schema'>;
143
143
  targetBlock: PortableTextTextBlock;
144
144
  incomingBlock: PortableTextTextBlock;
145
- }): PortableTextTextBlock<_portabletext_schema15.PortableTextObject | _portabletext_schema15.PortableTextSpan>;
145
+ }): PortableTextTextBlock<_portabletext_schema9.PortableTextObject | _portabletext_schema9.PortableTextSpan>;
146
146
  /**
147
147
  * @public
148
148
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "3.3.15",
3
+ "version": "4.0.0",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -27,32 +27,13 @@
27
27
  "sideEffects": false,
28
28
  "type": "module",
29
29
  "exports": {
30
- ".": {
31
- "source": "./src/index.ts",
32
- "default": "./lib/index.js"
33
- },
34
- "./behaviors": {
35
- "source": "./src/behaviors/_exports/index.ts",
36
- "default": "./lib/behaviors/index.js"
37
- },
38
- "./plugins": {
39
- "source": "./src/plugins/_exports/index.ts",
40
- "default": "./lib/plugins/index.js"
41
- },
42
- "./selectors": {
43
- "source": "./src/selectors/_exports/index.ts",
44
- "default": "./lib/selectors/index.js"
45
- },
46
- "./test": {
47
- "default": "./src/test/_exports/index.ts"
48
- },
49
- "./test/vitest": {
50
- "default": "./src/test/vitest/_exports/index.ts"
51
- },
52
- "./utils": {
53
- "source": "./src/utils/_exports/index.ts",
54
- "default": "./lib/utils/index.js"
55
- },
30
+ ".": "./lib/index.js",
31
+ "./behaviors": "./lib/behaviors/index.js",
32
+ "./plugins": "./lib/plugins/index.js",
33
+ "./selectors": "./lib/selectors/index.js",
34
+ "./test": "./src/test/_exports/index.ts",
35
+ "./test/vitest": "./src/test/vitest/_exports/index.ts",
36
+ "./utils": "./lib/utils/index.js",
56
37
  "./package.json": "./package.json"
57
38
  },
58
39
  "main": "./lib/index.js",
@@ -62,24 +43,23 @@
62
43
  ],
63
44
  "dependencies": {
64
45
  "@portabletext/to-html": "^5.0.0",
65
- "@sanity/schema": "^4.21.1",
66
- "@sanity/types": "^4.21.1",
46
+ "@sanity/schema": "^5.0.0",
47
+ "@sanity/types": "^5.0.0",
67
48
  "@xstate/react": "^6.0.0",
68
49
  "debug": "^4.4.3",
69
- "react-compiler-runtime": "^1.0.0",
70
50
  "slate": "^0.120.0",
71
51
  "slate-dom": "^0.119.0",
72
52
  "slate-react": "^0.120.0",
73
- "xstate": "^5.24.0",
74
- "@portabletext/block-tools": "^4.1.11",
75
- "@portabletext/keyboard-shortcuts": "^2.1.1",
76
- "@portabletext/markdown": "^1.1.0",
77
- "@portabletext/patches": "^2.0.2",
78
- "@portabletext/schema": "^2.1.0"
53
+ "xstate": "^5.25.0",
54
+ "@portabletext/block-tools": "^5.0.0",
55
+ "@portabletext/keyboard-shortcuts": "^2.1.2",
56
+ "@portabletext/markdown": "^1.1.1",
57
+ "@portabletext/patches": "^2.0.3",
58
+ "@portabletext/schema": "^2.1.1"
79
59
  },
80
60
  "devDependencies": {
81
61
  "@sanity/diff-match-patch": "^3.2.0",
82
- "@sanity/pkg-utils": "^10.1.2",
62
+ "@sanity/pkg-utils": "^10.2.1",
83
63
  "@types/debug": "^4.1.12",
84
64
  "@types/node": "^20",
85
65
  "@types/react": "^19.2.7",
@@ -101,21 +81,18 @@
101
81
  "vite": "^7.1.12",
102
82
  "vitest": "^4.0.14",
103
83
  "vitest-browser-react": "^2.0.2",
104
- "@portabletext/sanity-bridge": "1.2.14",
84
+ "@portabletext/sanity-bridge": "2.0.0",
105
85
  "@portabletext/test": "^1.0.3",
106
- "racejar": "2.0.1"
86
+ "racejar": "2.0.2"
107
87
  },
108
88
  "peerDependencies": {
109
- "@portabletext/sanity-bridge": "^1.2.14",
110
- "react": "^18.3 || ^19",
89
+ "@portabletext/sanity-bridge": "^2.0.0",
90
+ "react": "^19.2.3",
111
91
  "rxjs": "^7.8.2"
112
92
  },
113
93
  "engines": {
114
94
  "node": ">=20.19 <22 || >=22.12"
115
95
  },
116
- "publishConfig": {
117
- "access": "public"
118
- },
119
96
  "scripts": {
120
97
  "build": "pkg-utils build --strict --check --clean",
121
98
  "check:lint": "biome lint .",