@portabletext/editor 1.0.7 → 1.0.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/lib/index.d.mts +7 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.esm.js +185 -174
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +184 -173
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +185 -174
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -3
- package/src/editor/Editable.tsx +8 -8
- package/src/editor/PortableTextEditor.tsx +30 -11
- package/src/editor/__tests__/RangeDecorations.test.tsx +4 -4
- package/src/editor/components/Synchronizer.tsx +15 -46
- package/src/editor/hooks/usePortableTextEditorSelection.tsx +62 -0
- package/src/types/editor.ts +6 -1
- package/src/utils/withChanges.ts +0 -7
- package/src/editor/hooks/usePortableTextEditorSelection.ts +0 -22
- package/src/editor/hooks/usePortableTextEditorValue.ts +0 -16
package/lib/index.d.mts
CHANGED
|
@@ -341,7 +341,12 @@ export declare type OnCopyFn = (
|
|
|
341
341
|
event: ClipboardEvent_2<HTMLDivElement | HTMLSpanElement>,
|
|
342
342
|
) => undefined | unknown
|
|
343
343
|
|
|
344
|
-
/**
|
|
344
|
+
/**
|
|
345
|
+
* @beta
|
|
346
|
+
* It is encouraged not to return `Promise<undefined>` from the `OnPasteFn` as
|
|
347
|
+
* a mechanism to fall back to the native paste behaviour. This doesn't work in
|
|
348
|
+
* all cases. Always return plain `undefined` if possible.
|
|
349
|
+
**/
|
|
345
350
|
export declare type OnPasteFn = (data: PasteData) => OnPasteResultOrPromise
|
|
346
351
|
|
|
347
352
|
/** @beta */
|
|
@@ -451,6 +456,7 @@ export declare class PortableTextEditor extends Component<PortableTextEditorProp
|
|
|
451
456
|
constructor(props: PortableTextEditorProps)
|
|
452
457
|
componentDidUpdate(prevProps: PortableTextEditorProps): void
|
|
453
458
|
setEditable: (editable: EditableAPI) => void
|
|
459
|
+
private getValue
|
|
454
460
|
render(): JSX_2.Element
|
|
455
461
|
static activeAnnotations: (editor: PortableTextEditor) => PortableTextObject[]
|
|
456
462
|
static isAnnotationActive: (
|
package/lib/index.d.ts
CHANGED
|
@@ -341,7 +341,12 @@ export declare type OnCopyFn = (
|
|
|
341
341
|
event: ClipboardEvent_2<HTMLDivElement | HTMLSpanElement>,
|
|
342
342
|
) => undefined | unknown
|
|
343
343
|
|
|
344
|
-
/**
|
|
344
|
+
/**
|
|
345
|
+
* @beta
|
|
346
|
+
* It is encouraged not to return `Promise<undefined>` from the `OnPasteFn` as
|
|
347
|
+
* a mechanism to fall back to the native paste behaviour. This doesn't work in
|
|
348
|
+
* all cases. Always return plain `undefined` if possible.
|
|
349
|
+
**/
|
|
345
350
|
export declare type OnPasteFn = (data: PasteData) => OnPasteResultOrPromise
|
|
346
351
|
|
|
347
352
|
/** @beta */
|
|
@@ -451,6 +456,7 @@ export declare class PortableTextEditor extends Component<PortableTextEditorProp
|
|
|
451
456
|
constructor(props: PortableTextEditorProps)
|
|
452
457
|
componentDidUpdate(prevProps: PortableTextEditorProps): void
|
|
453
458
|
setEditable: (editable: EditableAPI) => void
|
|
459
|
+
private getValue
|
|
454
460
|
render(): JSX_2.Element
|
|
455
461
|
static activeAnnotations: (editor: PortableTextEditor) => PortableTextObject[]
|
|
456
462
|
static isAnnotationActive: (
|