@portabletext/editor 3.3.9 → 3.3.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,2 +1,2 @@
1
- import { H as Behavior, U as defineBehavior, W as BehaviorGuard, a as forward, c as CustomBehaviorEvent, d as SyntheticBehaviorEvent, i as execute, l as InsertPlacement, n as BehaviorActionSet, o as raise, r as effect, s as BehaviorEvent, t as BehaviorAction, u as NativeBehaviorEvent } from "../_chunks-dts/index.js";
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
2
  export { Behavior, BehaviorAction, BehaviorActionSet, BehaviorEvent, BehaviorGuard, CustomBehaviorEvent, InsertPlacement, NativeBehaviorEvent, SyntheticBehaviorEvent, defineBehavior, effect, execute, forward, raise };
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as BlockStyleRenderProps, $t as PortableTextChild, A as BlockOffset, At as RenderDecoratorFunction, B as EditorConfig, Bt as AnnotationPath, C as ListDefinition, Ct as RangeDecoration, D as StyleDefinition, Dt as RenderAnnotationFunction, E as SchemaDefinition, Et as RedoChange, F as EditorSelector, Ft as ScrollSelectionIntoViewFunction, G as EditorContext, Gt as HotkeyOptions, Ht as ChildPath, I as useEditorSelector, It as SelectionChange, J as BlockAnnotationRenderProps, Jt as EditorEmittedEvent, K as EditorSnapshot, Kt as PortableTextEditor, L as EditorProvider, Lt as UndoChange, M as defaultKeyGenerator, Mt as RenderListItemFunction, N as usePortableTextEditorSelection, Nt as RenderPlaceholderFunction, O as StyleSchemaType, Ot as RenderBlockFunction, P as usePortableTextEditor, Pt as RenderStyleFunction, Q as BlockRenderProps, Qt as PortableTextBlock, R as EditorProviderProps, Rt as UnsetChange, S as InlineObjectSchemaType, St as PortableTextMemberSchemaTypes, T as Patch, Tt as ReadyChange, Ut as PortableTextEditable, V as EditorEvent, Vt as BlockPath, Wt as PortableTextEditableProps, X as BlockDecoratorRenderProps, Xt as EditorSchema, Y as BlockChildRenderProps, Yt as MutationEvent, Z as BlockListItemRenderProps, _ as BlockObjectSchemaType, _t as OnPasteResult, at as EditorChanges, b as FieldDefinition, bt as PatchChange, ct as ErrorChange, dt as InvalidValueResolution, et as BlurChange, f as PatchesEvent, ft as LoadingChange, g as BlockObjectDefinition, gt as OnPasteFn, h as BaseDefinition, ht as OnCopyFn, it as EditorChange, j as useEditor, jt as RenderEditableFunction, k as defineSchema, kt as RenderChildFunction, lt as FocusChange, m as AnnotationSchemaType, mt as OnBeforeInputFn, nn as PortableTextSpan, nt as EditableAPI, ot as EditorSelection, p as AnnotationDefinition, pt as MutationChange, q as AddedAnnotationPaths, qt as PortableTextEditorProps, rn as PortableTextTextBlock, rt as EditableAPIDeleteOptions, st as EditorSelectionPoint, tn as PortableTextObject, tt as ConnectionChange, ut as InvalidValue, v as DecoratorDefinition, vt as OnPasteResultOrPromise, w as ListSchemaType, wt as RangeDecorationOnMovedDetails, x as InlineObjectDefinition, xt as PatchObservable, y as DecoratorSchemaType, yt as PasteData, z as Editor, zt as ValueChange } from "./_chunks-dts/index.js";
1
+ import { $ as BlockAnnotationRenderProps, $t as EditorEmittedEvent, 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 AnnotationPath, H as EditorProvider, Ht as UndoChange, I as useEditor, It as RenderEditableFunction, Jt as PortableTextEditable, K as EditorEvent, Kt as BlockPath, 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 PortableTextEditorProps, 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 HotkeyOptions, Yt as PortableTextEditableProps, Z as EditorSnapshot, Zt as PortableTextEditor, _ as BlockObjectSchemaType, _t as LoadingChange, at as BlurChange, b as FieldDefinition, bt as OnCopyFn, ct as EditableAPIDeleteOptions, dt as EditorSelection, en as MutationEvent, 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 ChildPath, rt as BlockRenderProps, st as EditableAPI, tn as EditorSchema, 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";
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 };
@@ -1,4 +1,4 @@
1
- import { H as Behavior, Jt as EditorEmittedEvent, z as Editor } from "../_chunks-dts/index.js";
1
+ import { $t as EditorEmittedEvent, W as Editor, q as Behavior } from "../_chunks-dts/index.js";
2
2
  import React from "react";
3
3
  /**
4
4
  * @beta
@@ -1,4 +1,5 @@
1
- import { A as BlockOffset, F as EditorSelector, Ht as ChildPath, Qt as PortableTextBlock, Vt as BlockPath, Zt as KeyedSegment, en as PortableTextListBlock, nn as PortableTextSpan, ot as EditorSelection, rn as PortableTextTextBlock, st as EditorSelectionPoint, tn as PortableTextObject } from "../_chunks-dts/index.js";
1
+ import { B as EditorSelector, F as BlockOffset, Kt as BlockPath, dt as EditorSelection, ft as EditorSelectionPoint, qt as ChildPath } from "../_chunks-dts/index.js";
2
+ import { KeyedSegment, PortableTextBlock, PortableTextListBlock, PortableTextObject, PortableTextSpan, PortableTextTextBlock } from "@sanity/types";
2
3
  /**
3
4
  * @public
4
5
  */
@@ -1,4 +1,6 @@
1
- import { A as BlockOffset, G as EditorContext, Ht as ChildPath, Qt as PortableTextBlock, Vt as BlockPath, Zt as KeyedSegment, nn as PortableTextSpan$1, ot as EditorSelection, rn as PortableTextTextBlock$1, st as EditorSelectionPoint, tn as PortableTextObject$1 } from "../_chunks-dts/index.js";
1
+ import { F as BlockOffset, Kt as BlockPath, X as EditorContext, dt as EditorSelection, ft as EditorSelectionPoint, qt as ChildPath } from "../_chunks-dts/index.js";
2
+ import * as _sanity_types7 from "@sanity/types";
3
+ import { KeyedSegment, PortableTextBlock, PortableTextTextBlock } from "@sanity/types";
2
4
  import { isSpan, isTextBlock } from "@portabletext/schema";
3
5
  /**
4
6
  * @public
@@ -109,7 +111,7 @@ declare function getSelectionStartPoint<TEditorSelection extends NonNullable<Edi
109
111
  /**
110
112
  * @public
111
113
  */
112
- declare function getTextBlockText(block: PortableTextTextBlock$1): string;
114
+ declare function getTextBlockText(block: PortableTextTextBlock): string;
113
115
  /**
114
116
  * @public
115
117
  */
@@ -139,9 +141,9 @@ declare function mergeTextBlocks({
139
141
  incomingBlock
140
142
  }: {
141
143
  context: Pick<EditorContext, 'keyGenerator' | 'schema'>;
142
- targetBlock: PortableTextTextBlock$1;
143
- incomingBlock: PortableTextTextBlock$1;
144
- }): PortableTextTextBlock$1<PortableTextObject$1 | PortableTextSpan$1>;
144
+ targetBlock: PortableTextTextBlock;
145
+ incomingBlock: PortableTextTextBlock;
146
+ }): PortableTextTextBlock<_sanity_types7.PortableTextObject | _sanity_types7.PortableTextSpan>;
145
147
  /**
146
148
  * @public
147
149
  */
@@ -177,10 +179,10 @@ declare function splitTextBlock({
177
179
  point
178
180
  }: {
179
181
  context: Pick<EditorContext, 'schema'>;
180
- block: PortableTextTextBlock$1;
182
+ block: PortableTextTextBlock;
181
183
  point: EditorSelectionPoint;
182
184
  }): {
183
- before: PortableTextTextBlock$1;
184
- after: PortableTextTextBlock$1;
185
+ before: PortableTextTextBlock;
186
+ after: PortableTextTextBlock;
185
187
  } | undefined;
186
188
  export { blockOffsetToBlockSelectionPoint, blockOffsetToSelectionPoint, blockOffsetToSpanSelectionPoint, blockOffsetsToSelection, childSelectionPointToBlockOffset, getBlockEndPoint, getBlockStartPoint, getSelectionEndPoint, getSelectionStartPoint, getTextBlockText, isEmptyTextBlock, isEqualSelectionPoints, isEqualSelections, isKeyedSegment, isSelectionCollapsed, isSpan, isTextBlock, mergeTextBlocks, reverseSelection, selectionPointToBlockOffset, sliceBlocks, spanSelectionPointToBlockOffset, splitTextBlock };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "3.3.9",
3
+ "version": "3.3.11",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -63,6 +63,7 @@
63
63
  "dependencies": {
64
64
  "@portabletext/to-html": "^5.0.0",
65
65
  "@sanity/schema": "^4.20.3",
66
+ "@sanity/types": "^4.20.3",
66
67
  "@xstate/react": "^6.0.0",
67
68
  "debug": "^4.4.3",
68
69
  "react-compiler-runtime": "^1.0.0",
@@ -70,16 +71,15 @@
70
71
  "slate-dom": "^0.119.0",
71
72
  "slate-react": "^0.120.0",
72
73
  "xstate": "^5.24.0",
73
- "@portabletext/markdown": "^1.0.5",
74
74
  "@portabletext/block-tools": "^4.1.10",
75
75
  "@portabletext/keyboard-shortcuts": "^2.1.1",
76
- "@portabletext/schema": "^2.0.1",
77
- "@portabletext/patches": "^2.0.2"
76
+ "@portabletext/markdown": "^1.0.6",
77
+ "@portabletext/patches": "^2.0.2",
78
+ "@portabletext/schema": "^2.0.1"
78
79
  },
79
80
  "devDependencies": {
80
81
  "@sanity/diff-match-patch": "^3.2.0",
81
82
  "@sanity/pkg-utils": "^10.1.2",
82
- "@sanity/types": "^4.20.3",
83
83
  "@types/debug": "^4.1.12",
84
84
  "@types/node": "^20",
85
85
  "@types/react": "^19.2.7",
@@ -101,8 +101,8 @@
101
101
  "vite": "^7.1.12",
102
102
  "vitest": "^4.0.14",
103
103
  "vitest-browser-react": "^2.0.2",
104
- "@portabletext/test": "^1.0.2",
105
104
  "@portabletext/sanity-bridge": "1.2.13",
105
+ "@portabletext/test": "^1.0.2",
106
106
  "racejar": "2.0.1"
107
107
  },
108
108
  "peerDependencies": {