@portabletext/editor 1.14.2 → 1.15.1
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-cjs/selector.get-text-before.cjs +16 -5
- package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
- package/lib/_chunks-es/selector.get-text-before.js +16 -5
- package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
- package/lib/index.cjs +877 -544
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +15 -15
- package/lib/index.d.ts +15 -15
- package/lib/index.js +877 -544
- package/lib/index.js.map +1 -1
- package/package.json +9 -9
- package/src/editor/__tests__/PortableTextEditor.test.tsx +6 -6
- package/src/editor/__tests__/RangeDecorations.test.tsx +1 -1
- package/src/editor/__tests__/handleClick.test.tsx +4 -4
- package/src/editor/__tests__/insert-block.test.tsx +3 -3
- package/src/editor/__tests__/pteWarningsSelfSolving.test.tsx +6 -6
- package/src/editor/__tests__/self-solving.test.tsx +1 -1
- package/src/editor/components/DraggableBlock.tsx +1 -1
- package/src/editor/components/Element.tsx +8 -2
- package/src/editor/components/Leaf.tsx +1 -1
- package/src/editor/create-editor.ts +18 -29
- package/src/editor/hooks/useSyncValue.test.tsx +2 -2
- package/src/editor/hooks/useSyncValue.ts +2 -2
- package/src/editor/nodes/DefaultObject.tsx +1 -0
- package/src/editor/plugins/__tests__/withEditableAPIDelete.test.tsx +4 -4
- package/src/editor/plugins/__tests__/withEditableAPIGetFragment.test.tsx +2 -2
- package/src/editor/plugins/__tests__/withEditableAPIInsert.test.tsx +7 -7
- package/src/editor/plugins/__tests__/withEditableAPISelectionsOverlapping.test.tsx +4 -4
- package/src/editor/plugins/__tests__/withPortableTextLists.test.tsx +1 -1
- package/src/editor/plugins/__tests__/withPortableTextMarkModel.test.tsx +9 -9
- package/src/editor/plugins/__tests__/withPortableTextSelections.test.tsx +1 -1
- package/src/editor/plugins/__tests__/withUndoRedo.test.tsx +2 -2
- package/src/types/editor.ts +14 -13
- package/src/utils/__tests__/valueNormalization.test.tsx +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -29,7 +29,7 @@ import type {
|
|
|
29
29
|
import {
|
|
30
30
|
Component,
|
|
31
31
|
ForwardRefExoticComponent,
|
|
32
|
-
JSX
|
|
32
|
+
JSX,
|
|
33
33
|
MutableRefObject,
|
|
34
34
|
PropsWithChildren,
|
|
35
35
|
default as React_2,
|
|
@@ -239,8 +239,8 @@ export declare type BehaviorGuard<
|
|
|
239
239
|
/** @beta */
|
|
240
240
|
export declare interface BlockAnnotationRenderProps {
|
|
241
241
|
block: PortableTextBlock
|
|
242
|
-
children: ReactElement
|
|
243
|
-
editorElementRef: RefObject<HTMLElement>
|
|
242
|
+
children: ReactElement<any>
|
|
243
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
244
244
|
focused: boolean
|
|
245
245
|
path: Path
|
|
246
246
|
schemaType: ObjectSchemaType
|
|
@@ -253,8 +253,8 @@ export declare interface BlockAnnotationRenderProps {
|
|
|
253
253
|
/** @beta */
|
|
254
254
|
export declare interface BlockChildRenderProps {
|
|
255
255
|
annotations: PortableTextObject[]
|
|
256
|
-
children: ReactElement
|
|
257
|
-
editorElementRef: RefObject<HTMLElement>
|
|
256
|
+
children: ReactElement<any>
|
|
257
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
258
258
|
focused: boolean
|
|
259
259
|
path: Path
|
|
260
260
|
selected: boolean
|
|
@@ -266,8 +266,8 @@ export declare interface BlockChildRenderProps {
|
|
|
266
266
|
|
|
267
267
|
/** @beta */
|
|
268
268
|
export declare interface BlockDecoratorRenderProps {
|
|
269
|
-
children: ReactElement
|
|
270
|
-
editorElementRef: RefObject<HTMLElement>
|
|
269
|
+
children: ReactElement<any>
|
|
270
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
271
271
|
focused: boolean
|
|
272
272
|
path: Path
|
|
273
273
|
schemaType: BlockDecoratorDefinition
|
|
@@ -280,8 +280,8 @@ export declare interface BlockDecoratorRenderProps {
|
|
|
280
280
|
/** @beta */
|
|
281
281
|
export declare interface BlockListItemRenderProps {
|
|
282
282
|
block: PortableTextTextBlock
|
|
283
|
-
children: ReactElement
|
|
284
|
-
editorElementRef: RefObject<HTMLElement>
|
|
283
|
+
children: ReactElement<any>
|
|
284
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
285
285
|
focused: boolean
|
|
286
286
|
level: number
|
|
287
287
|
path: Path
|
|
@@ -300,8 +300,8 @@ export declare type BlockOffset = {
|
|
|
300
300
|
|
|
301
301
|
/** @beta */
|
|
302
302
|
export declare interface BlockRenderProps {
|
|
303
|
-
children: ReactElement
|
|
304
|
-
editorElementRef: RefObject<HTMLElement>
|
|
303
|
+
children: ReactElement<any>
|
|
304
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
305
305
|
focused: boolean
|
|
306
306
|
level?: number
|
|
307
307
|
listItem?: string
|
|
@@ -317,8 +317,8 @@ export declare interface BlockRenderProps {
|
|
|
317
317
|
/** @beta */
|
|
318
318
|
export declare interface BlockStyleRenderProps {
|
|
319
319
|
block: PortableTextTextBlock
|
|
320
|
-
children: ReactElement
|
|
321
|
-
editorElementRef: RefObject<HTMLElement>
|
|
320
|
+
children: ReactElement<any>
|
|
321
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
322
322
|
focused: boolean
|
|
323
323
|
path: Path
|
|
324
324
|
selected: boolean
|
|
@@ -9804,7 +9804,7 @@ export declare class PortableTextEditor extends Component<
|
|
|
9804
9804
|
constructor(props: PortableTextEditorProps)
|
|
9805
9805
|
componentDidUpdate(prevProps: PortableTextEditorProps): void
|
|
9806
9806
|
setEditable: (editable: EditableAPI) => void
|
|
9807
|
-
render():
|
|
9807
|
+
render(): JSX.Element
|
|
9808
9808
|
static activeAnnotations: (editor: PortableTextEditor) => PortableTextObject[]
|
|
9809
9809
|
static isAnnotationActive: (
|
|
9810
9810
|
editor: PortableTextEditor,
|
|
@@ -10052,7 +10052,7 @@ export declare interface RangeDecoration {
|
|
|
10052
10052
|
* )
|
|
10053
10053
|
* ```
|
|
10054
10054
|
*/
|
|
10055
|
-
component: (props: PropsWithChildren) => ReactElement
|
|
10055
|
+
component: (props: PropsWithChildren) => ReactElement<any>
|
|
10056
10056
|
/**
|
|
10057
10057
|
* The editor content selection range
|
|
10058
10058
|
*/
|
package/lib/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ import type {
|
|
|
29
29
|
import {
|
|
30
30
|
Component,
|
|
31
31
|
ForwardRefExoticComponent,
|
|
32
|
-
JSX
|
|
32
|
+
JSX,
|
|
33
33
|
MutableRefObject,
|
|
34
34
|
PropsWithChildren,
|
|
35
35
|
default as React_2,
|
|
@@ -239,8 +239,8 @@ export declare type BehaviorGuard<
|
|
|
239
239
|
/** @beta */
|
|
240
240
|
export declare interface BlockAnnotationRenderProps {
|
|
241
241
|
block: PortableTextBlock
|
|
242
|
-
children: ReactElement
|
|
243
|
-
editorElementRef: RefObject<HTMLElement>
|
|
242
|
+
children: ReactElement<any>
|
|
243
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
244
244
|
focused: boolean
|
|
245
245
|
path: Path
|
|
246
246
|
schemaType: ObjectSchemaType
|
|
@@ -253,8 +253,8 @@ export declare interface BlockAnnotationRenderProps {
|
|
|
253
253
|
/** @beta */
|
|
254
254
|
export declare interface BlockChildRenderProps {
|
|
255
255
|
annotations: PortableTextObject[]
|
|
256
|
-
children: ReactElement
|
|
257
|
-
editorElementRef: RefObject<HTMLElement>
|
|
256
|
+
children: ReactElement<any>
|
|
257
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
258
258
|
focused: boolean
|
|
259
259
|
path: Path
|
|
260
260
|
selected: boolean
|
|
@@ -266,8 +266,8 @@ export declare interface BlockChildRenderProps {
|
|
|
266
266
|
|
|
267
267
|
/** @beta */
|
|
268
268
|
export declare interface BlockDecoratorRenderProps {
|
|
269
|
-
children: ReactElement
|
|
270
|
-
editorElementRef: RefObject<HTMLElement>
|
|
269
|
+
children: ReactElement<any>
|
|
270
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
271
271
|
focused: boolean
|
|
272
272
|
path: Path
|
|
273
273
|
schemaType: BlockDecoratorDefinition
|
|
@@ -280,8 +280,8 @@ export declare interface BlockDecoratorRenderProps {
|
|
|
280
280
|
/** @beta */
|
|
281
281
|
export declare interface BlockListItemRenderProps {
|
|
282
282
|
block: PortableTextTextBlock
|
|
283
|
-
children: ReactElement
|
|
284
|
-
editorElementRef: RefObject<HTMLElement>
|
|
283
|
+
children: ReactElement<any>
|
|
284
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
285
285
|
focused: boolean
|
|
286
286
|
level: number
|
|
287
287
|
path: Path
|
|
@@ -300,8 +300,8 @@ export declare type BlockOffset = {
|
|
|
300
300
|
|
|
301
301
|
/** @beta */
|
|
302
302
|
export declare interface BlockRenderProps {
|
|
303
|
-
children: ReactElement
|
|
304
|
-
editorElementRef: RefObject<HTMLElement>
|
|
303
|
+
children: ReactElement<any>
|
|
304
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
305
305
|
focused: boolean
|
|
306
306
|
level?: number
|
|
307
307
|
listItem?: string
|
|
@@ -317,8 +317,8 @@ export declare interface BlockRenderProps {
|
|
|
317
317
|
/** @beta */
|
|
318
318
|
export declare interface BlockStyleRenderProps {
|
|
319
319
|
block: PortableTextTextBlock
|
|
320
|
-
children: ReactElement
|
|
321
|
-
editorElementRef: RefObject<HTMLElement>
|
|
320
|
+
children: ReactElement<any>
|
|
321
|
+
editorElementRef: RefObject<HTMLElement | null>
|
|
322
322
|
focused: boolean
|
|
323
323
|
path: Path
|
|
324
324
|
selected: boolean
|
|
@@ -9804,7 +9804,7 @@ export declare class PortableTextEditor extends Component<
|
|
|
9804
9804
|
constructor(props: PortableTextEditorProps)
|
|
9805
9805
|
componentDidUpdate(prevProps: PortableTextEditorProps): void
|
|
9806
9806
|
setEditable: (editable: EditableAPI) => void
|
|
9807
|
-
render():
|
|
9807
|
+
render(): JSX.Element
|
|
9808
9808
|
static activeAnnotations: (editor: PortableTextEditor) => PortableTextObject[]
|
|
9809
9809
|
static isAnnotationActive: (
|
|
9810
9810
|
editor: PortableTextEditor,
|
|
@@ -10052,7 +10052,7 @@ export declare interface RangeDecoration {
|
|
|
10052
10052
|
* )
|
|
10053
10053
|
* ```
|
|
10054
10054
|
*/
|
|
10055
|
-
component: (props: PropsWithChildren) => ReactElement
|
|
10055
|
+
component: (props: PropsWithChildren) => ReactElement<any>
|
|
10056
10056
|
/**
|
|
10057
10057
|
* The editor content selection range
|
|
10058
10058
|
*/
|