@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.
Files changed (63) hide show
  1. package/lib/{_chunks-dts/behavior.types.action.d.ts → behavior.types.action-CYtiRDck.d.ts} +260 -59
  2. package/lib/behavior.types.action-CYtiRDck.d.ts.map +1 -0
  3. package/lib/behavior.types.behavior-B_77VtQR.js +159 -0
  4. package/lib/behavior.types.behavior-B_77VtQR.js.map +1 -0
  5. package/lib/behaviors/index.d.ts +1 -1
  6. package/lib/behaviors/index.js +2 -35
  7. package/lib/get-container-BeXYKpoi.js +222 -0
  8. package/lib/get-container-BeXYKpoi.js.map +1 -0
  9. package/lib/get-parent-51Kzgaf9.js +237 -0
  10. package/lib/get-parent-51Kzgaf9.js.map +1 -0
  11. package/lib/get-path-sub-schema--2I4NJbG.js +513 -0
  12. package/lib/get-path-sub-schema--2I4NJbG.js.map +1 -0
  13. package/lib/index.d.ts +2 -67
  14. package/lib/index.js +16743 -18963
  15. package/lib/index.js.map +1 -1
  16. package/lib/plugins/index.d.ts +1 -2
  17. package/lib/plugins/index.d.ts.map +1 -1
  18. package/lib/plugins/index.js +103 -41
  19. package/lib/plugins/index.js.map +1 -1
  20. package/lib/selector.is-at-the-start-of-block-gJIMWRpU.js +822 -0
  21. package/lib/selector.is-at-the-start-of-block-gJIMWRpU.js.map +1 -0
  22. package/lib/selectors/index.d.ts +1 -3
  23. package/lib/selectors/index.d.ts.map +1 -1
  24. package/lib/selectors/index.js +256 -215
  25. package/lib/selectors/index.js.map +1 -1
  26. package/lib/traversal/index.d.ts +1 -1
  27. package/lib/traversal/index.d.ts.map +1 -1
  28. package/lib/traversal/index.js +33 -52
  29. package/lib/traversal/index.js.map +1 -1
  30. package/lib/use-editor-CwNeVwVC.js +47 -0
  31. package/lib/use-editor-CwNeVwVC.js.map +1 -0
  32. package/lib/util.is-equal-selections-BF4WJtz5.js +25 -0
  33. package/lib/util.is-equal-selections-BF4WJtz5.js.map +1 -0
  34. package/lib/util.slice-blocks-DQnr9X2s.js +633 -0
  35. package/lib/util.slice-blocks-DQnr9X2s.js.map +1 -0
  36. package/lib/utils/index.d.ts +11 -39
  37. package/lib/utils/index.d.ts.map +1 -1
  38. package/lib/utils/index.js +87 -123
  39. package/lib/utils/index.js.map +1 -1
  40. package/package.json +25 -20
  41. package/lib/_chunks-dts/behavior.types.action.d.ts.map +0 -1
  42. package/lib/_chunks-dts/block-offset.d.ts +0 -10
  43. package/lib/_chunks-dts/block-offset.d.ts.map +0 -1
  44. package/lib/_chunks-dts/editor-selector.d.ts +0 -33
  45. package/lib/_chunks-dts/editor-selector.d.ts.map +0 -1
  46. package/lib/_chunks-dts/editor.d.ts +0 -99
  47. package/lib/_chunks-dts/editor.d.ts.map +0 -1
  48. package/lib/_chunks-es/get-container.js +0 -187
  49. package/lib/_chunks-es/get-container.js.map +0 -1
  50. package/lib/_chunks-es/get-parent.js +0 -195
  51. package/lib/_chunks-es/get-parent.js.map +0 -1
  52. package/lib/_chunks-es/get-path-sub-schema.js +0 -399
  53. package/lib/_chunks-es/get-path-sub-schema.js.map +0 -1
  54. package/lib/_chunks-es/selector.is-at-the-start-of-block.js +0 -947
  55. package/lib/_chunks-es/selector.is-at-the-start-of-block.js.map +0 -1
  56. package/lib/_chunks-es/use-editor.js +0 -20
  57. package/lib/_chunks-es/use-editor.js.map +0 -1
  58. package/lib/_chunks-es/util.is-equal-selections.js +0 -20
  59. package/lib/_chunks-es/util.is-equal-selections.js.map +0 -1
  60. package/lib/_chunks-es/util.slice-blocks.js +0 -720
  61. package/lib/_chunks-es/util.slice-blocks.js.map +0 -1
  62. package/lib/behaviors/index.js.map +0 -1
  63. package/lib/index.d.ts.map +0 -1
package/lib/index.d.ts CHANGED
@@ -1,67 +1,2 @@
1
- import { $ as HotkeyOptions, A as BlockStyleRenderProps, At as defineSpan, B as RangeDecoration, C as EditorSnapshot, Ct as SpanRenderProps, D as BlockDecoratorRenderProps, Dt as defineBlockObject, E as BlockChildRenderProps, Et as TextBlockRenderProps, F as OnCopyFn, G as RenderDecoratorFunction, H as RenderAnnotationFunction, I as OnPasteFn, It as Path, J as RenderPlaceholderFunction, K as RenderEditableFunction, L as OnPasteResult, M as EditorSelection, Mt as AnnotationPath, N as EditorSelectionPoint, Nt as BlockPath, O as BlockListItemRenderProps, Ot as defineContainer, P as InvalidValueResolution, Pt as ChildPath, Q as PortableTextEditableProps, R as OnPasteResultOrPromise, S as EditorContext, St as SpanRender, T as BlockAnnotationRenderProps, Tt as TextBlockRender, U as RenderBlockFunction, V as RangeDecorationOnMovedDetails, W as RenderChildFunction, X as ScrollSelectionIntoViewFunction, Y as RenderStyleFunction, Z as PortableTextEditable, _ as MutationEvent, _t as InlineObject, at as Containers, bt as RegistrableNode, ct as RegisteredInlineObject, dt as BlockObject, et as PortableTextEditor, ft as BlockObjectRender, g as EditorEmittedEvent, gt as ContainerRenderProps, h as PatchesEvent, ht as ContainerRender, it as EditorSchema, j as EditableAPIDeleteOptions, jt as defineTextBlock, k as BlockRenderProps, kt as defineInlineObject, lt as RegisteredPositional, mt as Container, ot as RegisteredBlockObject, pt as BlockObjectRenderProps, q as RenderListItemFunction, st as RegisteredContainer, tt as resolveContainerAt, ut as RegisteredSpan, v as Operation, vt as InlineObjectRender, w as AddedAnnotationPaths, wt as TextBlock, xt as Span, yt as InlineObjectRenderProps, z as PasteData } from "./_chunks-dts/behavior.types.action.js";
2
- import { n as EditorConfig, r as EditorEvent, t as Editor } from "./_chunks-dts/editor.js";
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 };