@portabletext/editor 7.10.16 → 7.10.18
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/lib/{_chunks-dts/behavior.types.action.d.ts → behavior.types.action-CYtiRDck.d.ts} +260 -59
- package/lib/behavior.types.action-CYtiRDck.d.ts.map +1 -0
- package/lib/behavior.types.behavior-B_77VtQR.js +159 -0
- package/lib/behavior.types.behavior-B_77VtQR.js.map +1 -0
- package/lib/behaviors/index.d.ts +1 -1
- package/lib/behaviors/index.js +2 -35
- package/lib/get-container-BeXYKpoi.js +222 -0
- package/lib/get-container-BeXYKpoi.js.map +1 -0
- package/lib/get-parent-51Kzgaf9.js +237 -0
- package/lib/get-parent-51Kzgaf9.js.map +1 -0
- package/lib/get-path-sub-schema--2I4NJbG.js +513 -0
- package/lib/get-path-sub-schema--2I4NJbG.js.map +1 -0
- package/lib/index.d.ts +2 -67
- package/lib/index.js +16743 -18963
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.ts +1 -2
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +103 -41
- package/lib/plugins/index.js.map +1 -1
- package/lib/selector.is-at-the-start-of-block-gJIMWRpU.js +822 -0
- package/lib/selector.is-at-the-start-of-block-gJIMWRpU.js.map +1 -0
- package/lib/selectors/index.d.ts +1 -3
- package/lib/selectors/index.d.ts.map +1 -1
- package/lib/selectors/index.js +256 -215
- package/lib/selectors/index.js.map +1 -1
- package/lib/traversal/index.d.ts +1 -1
- package/lib/traversal/index.d.ts.map +1 -1
- package/lib/traversal/index.js +33 -52
- package/lib/traversal/index.js.map +1 -1
- package/lib/use-editor-CwNeVwVC.js +47 -0
- package/lib/use-editor-CwNeVwVC.js.map +1 -0
- package/lib/util.is-equal-selections-BF4WJtz5.js +25 -0
- package/lib/util.is-equal-selections-BF4WJtz5.js.map +1 -0
- package/lib/util.slice-blocks-DQnr9X2s.js +633 -0
- package/lib/util.slice-blocks-DQnr9X2s.js.map +1 -0
- package/lib/utils/index.d.ts +11 -39
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +87 -123
- package/lib/utils/index.js.map +1 -1
- package/package.json +25 -20
- package/lib/_chunks-dts/behavior.types.action.d.ts.map +0 -1
- package/lib/_chunks-dts/block-offset.d.ts +0 -10
- package/lib/_chunks-dts/block-offset.d.ts.map +0 -1
- package/lib/_chunks-dts/editor-selector.d.ts +0 -33
- package/lib/_chunks-dts/editor-selector.d.ts.map +0 -1
- package/lib/_chunks-dts/editor.d.ts +0 -99
- package/lib/_chunks-dts/editor.d.ts.map +0 -1
- package/lib/_chunks-es/get-container.js +0 -187
- package/lib/_chunks-es/get-container.js.map +0 -1
- package/lib/_chunks-es/get-parent.js +0 -195
- package/lib/_chunks-es/get-parent.js.map +0 -1
- package/lib/_chunks-es/get-path-sub-schema.js +0 -399
- package/lib/_chunks-es/get-path-sub-schema.js.map +0 -1
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js +0 -947
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js.map +0 -1
- package/lib/_chunks-es/use-editor.js +0 -20
- package/lib/_chunks-es/use-editor.js.map +0 -1
- package/lib/_chunks-es/util.is-equal-selections.js +0 -20
- package/lib/_chunks-es/util.is-equal-selections.js.map +0 -1
- package/lib/_chunks-es/util.slice-blocks.js +0 -720
- package/lib/_chunks-es/util.slice-blocks.js.map +0 -1
- package/lib/behaviors/index.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
|
|
3
|
-
import { n as useEditorSelector, t as EditorSelector } from "./_chunks-dts/editor-selector.js";
|
|
4
|
-
import { t as BlockOffset } from "./_chunks-dts/block-offset.js";
|
|
5
|
-
import { AnnotationDefinition, AnnotationSchemaType, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, DecoratorDefinition, DecoratorSchemaType, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, ListDefinition, ListSchemaType, PortableTextBlock, PortableTextChild, PortableTextObject, PortableTextSpan, PortableTextTextBlock, SchemaDefinition, StyleDefinition, StyleSchemaType, defineSchema } from "@portabletext/schema";
|
|
6
|
-
import { Patch } from "@portabletext/patches";
|
|
7
|
-
import React from "react";
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
type EditorProviderProps = {
|
|
12
|
-
initialConfig: EditorConfig;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
* The EditorProvider component is used to set up the editor context and configure the Portable Text Editor.
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* import {EditorProvider} from '@portabletext/editor'
|
|
21
|
-
*
|
|
22
|
-
* function App() {
|
|
23
|
-
* return (
|
|
24
|
-
* <EditorProvider initialConfig={{ ... }} >
|
|
25
|
-
* ...
|
|
26
|
-
* </EditorProvider>
|
|
27
|
-
* )
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
* @group Components
|
|
32
|
-
*/
|
|
33
|
-
declare function EditorProvider(props: EditorProviderProps): React.JSX.Element;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use `useEditor` to get the current editor instance.
|
|
36
|
-
* @public
|
|
37
|
-
* Get the current editor object from the React context.
|
|
38
|
-
*/
|
|
39
|
-
declare const usePortableTextEditor: () => PortableTextEditor;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use `useEditorSelector` to get the current editor selection.
|
|
42
|
-
* @public
|
|
43
|
-
* Get the current editor selection from the React context.
|
|
44
|
-
*/
|
|
45
|
-
declare const usePortableTextEditorSelection: () => EditorSelection;
|
|
46
|
-
/**
|
|
47
|
-
* @public
|
|
48
|
-
*/
|
|
49
|
-
declare const defaultKeyGenerator: () => string;
|
|
50
|
-
/**
|
|
51
|
-
* @public
|
|
52
|
-
* Get the current editor context from the `EditorProvider`.
|
|
53
|
-
* Must be used inside the `EditorProvider` component.
|
|
54
|
-
* @returns The current editor object.
|
|
55
|
-
* @example
|
|
56
|
-
* ```tsx
|
|
57
|
-
* import { useEditor } from '@portabletext/editor'
|
|
58
|
-
*
|
|
59
|
-
* function MyComponent() {
|
|
60
|
-
* const editor = useEditor()
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
* @group Hooks
|
|
64
|
-
*/
|
|
65
|
-
declare function useEditor(): import("..").Editor;
|
|
66
|
-
export { type AddedAnnotationPaths, type AnnotationDefinition, type AnnotationPath, type AnnotationSchemaType, type BaseDefinition, type BlockAnnotationRenderProps, type BlockChildRenderProps, type BlockDecoratorRenderProps, type BlockListItemRenderProps, type BlockObject, type BlockObjectDefinition, type BlockObjectRender, type BlockObjectRenderProps, type BlockObjectSchemaType, type BlockOffset, type BlockPath, type BlockRenderProps, type BlockStyleRenderProps, type ChildPath, type Container, type ContainerRender, type ContainerRenderProps, type Containers, type DecoratorDefinition, type DecoratorSchemaType, type EditableAPIDeleteOptions, type Editor, type EditorConfig, type EditorContext, type EditorEmittedEvent, type EditorEvent, EditorProvider, type EditorProviderProps, type EditorSchema, type EditorSelection, type EditorSelectionPoint, type EditorSelector, type EditorSnapshot, type FieldDefinition, type HotkeyOptions, type InlineObject, type InlineObjectDefinition, type InlineObjectRender, type InlineObjectRenderProps, type InlineObjectSchemaType, type InvalidValueResolution, type ListDefinition, type ListSchemaType, type MutationEvent, type OnCopyFn, type OnPasteFn, type OnPasteResult, type OnPasteResultOrPromise, type Operation, type PasteData, type Patch, type PatchesEvent, type Path, type PortableTextBlock, type PortableTextChild, PortableTextEditable, type PortableTextEditableProps, PortableTextEditor, type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock, type RangeDecoration, type RangeDecorationOnMovedDetails, type RegisteredBlockObject, type RegisteredContainer, type RegisteredInlineObject, type RegisteredPositional, type RegisteredSpan, type RegistrableNode, type RenderAnnotationFunction, type RenderBlockFunction, type RenderChildFunction, type RenderDecoratorFunction, type RenderEditableFunction, type RenderListItemFunction, type RenderPlaceholderFunction, type RenderStyleFunction, type SchemaDefinition, type ScrollSelectionIntoViewFunction, type Span, type SpanRender, type SpanRenderProps, type StyleDefinition, type StyleSchemaType, type TextBlock, type TextBlockRender, type TextBlockRenderProps, defineBlockObject, defineContainer, defineInlineObject, defineSchema, defineSpan, defineTextBlock, defaultKeyGenerator as keyGenerator, resolveContainerAt, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection };
|
|
67
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { $ as EditorContext, $t as SpanRender, A as PortableTextTextBlock, At as HotkeyOptions, B as EditorSelector, Bt as RegisteredPositional, C as ListDefinition, Ct as RenderEditableFunction, D as PortableTextChild, Dt as ScrollSelectionIntoViewFunction, E as PortableTextBlock, Et as RenderStyleFunction, F as BlockOffset, Ft as EditorSchema, G as EditorConfig, Gt as Container, H as EditorProvider, Ht as BlockObject, I as useEditor, It as Containers, J as MutationEvent, Jt as InlineObject, K as EditorEvent, Kt as ContainerRender, L as defaultKeyGenerator, Lt as RegisteredBlockObject, M as StyleDefinition, Mt as resolveContainerAt, N as StyleSchemaType, O as PortableTextObject, Ot as PortableTextEditable, P as defineSchema, Qt as Span, R as usePortableTextEditorSelection, Rt as RegisteredContainer, S as InlineObjectSchemaType, St as RenderDecoratorFunction, T as Patch, Tt as RenderPlaceholderFunction, U as EditorProviderProps, Ut as BlockObjectRender, V as useEditorSelector, Vt as RegisteredSpan, W as Editor, Wt as BlockObjectRenderProps, Xt as InlineObjectRenderProps, Y as Operation, Yt as InlineObjectRender, Zt as RegistrableNode, _ as BlockObjectSchemaType, _t as RangeDecoration, an as defineContainer, at as BlockListItemRenderProps, b as FieldDefinition, bt as RenderBlockFunction, cn as defineTextBlock, ct as EditableAPIDeleteOptions, dn as ChildPath, dt as InvalidValueResolution, en as SpanRenderProps, et as EditorSnapshot, f as PatchesEvent, ft as OnCopyFn, g as BlockObjectDefinition, gt as PasteData, h as BaseDefinition, ht as OnPasteResultOrPromise, in as defineBlockObject, it as BlockDecoratorRenderProps, j as SchemaDefinition, jt as PortableTextEditor, k as PortableTextSpan, kt as PortableTextEditableProps, ln as AnnotationPath, lt as EditorSelection, m as AnnotationSchemaType, mt as OnPasteResult, nn as TextBlockRender, nt as BlockAnnotationRenderProps, on as defineInlineObject, ot as BlockRenderProps, p as AnnotationDefinition, pn as Path, pt as OnPasteFn, q as EditorEmittedEvent, qt as ContainerRenderProps, rn as TextBlockRenderProps, rt as BlockChildRenderProps, sn as defineSpan, st as BlockStyleRenderProps, tn as TextBlock, tt as AddedAnnotationPaths, un as BlockPath, ut as EditorSelectionPoint, v as DecoratorDefinition, vt as RangeDecorationOnMovedDetails, w as ListSchemaType, wt as RenderListItemFunction, x as InlineObjectDefinition, xt as RenderChildFunction, y as DecoratorSchemaType, yt as RenderAnnotationFunction, z as usePortableTextEditor, zt as RegisteredInlineObject } from "./behavior.types.action-CYtiRDck.js";
|
|
2
|
+
export { type AddedAnnotationPaths, type AnnotationDefinition, type AnnotationPath, type AnnotationSchemaType, type BaseDefinition, type BlockAnnotationRenderProps, type BlockChildRenderProps, type BlockDecoratorRenderProps, type BlockListItemRenderProps, type BlockObject, type BlockObjectDefinition, type BlockObjectRender, type BlockObjectRenderProps, type BlockObjectSchemaType, type BlockOffset, type BlockPath, type BlockRenderProps, type BlockStyleRenderProps, type ChildPath, type Container, type ContainerRender, type ContainerRenderProps, type Containers, type DecoratorDefinition, type DecoratorSchemaType, type EditableAPIDeleteOptions, type Editor, type EditorConfig, type EditorContext, type EditorEmittedEvent, type EditorEvent, EditorProvider, type EditorProviderProps, type EditorSchema, type EditorSelection, type EditorSelectionPoint, type EditorSelector, type EditorSnapshot, type FieldDefinition, type HotkeyOptions, type InlineObject, type InlineObjectDefinition, type InlineObjectRender, type InlineObjectRenderProps, type InlineObjectSchemaType, type InvalidValueResolution, type ListDefinition, type ListSchemaType, type MutationEvent, type OnCopyFn, type OnPasteFn, type OnPasteResult, type OnPasteResultOrPromise, type Operation, type PasteData, type Patch, type PatchesEvent, type Path, type PortableTextBlock, type PortableTextChild, PortableTextEditable, type PortableTextEditableProps, PortableTextEditor, type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock, type RangeDecoration, type RangeDecorationOnMovedDetails, type RegisteredBlockObject, type RegisteredContainer, type RegisteredInlineObject, type RegisteredPositional, type RegisteredSpan, type RegistrableNode, type RenderAnnotationFunction, type RenderBlockFunction, type RenderChildFunction, type RenderDecoratorFunction, type RenderEditableFunction, type RenderListItemFunction, type RenderPlaceholderFunction, type RenderStyleFunction, type SchemaDefinition, type ScrollSelectionIntoViewFunction, type Span, type SpanRender, type SpanRenderProps, type StyleDefinition, type StyleSchemaType, type TextBlock, type TextBlockRender, type TextBlockRenderProps, defineBlockObject, defineContainer, defineInlineObject, defineSchema, defineSpan, defineTextBlock, defaultKeyGenerator as keyGenerator, resolveContainerAt, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection };
|