@portabletext/editor 1.0.6 → 1.0.8
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 +6 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -5
- package/src/editor/Editable.tsx +4 -1
- package/src/types/editor.ts +6 -1
package/lib/index.js
CHANGED
|
@@ -4426,7 +4426,7 @@ const debug$1 = debugWithName("components:Leaf"), EMPTY_MARKS = [], Leaf = (prop
|
|
|
4426
4426
|
}
|
|
4427
4427
|
const value = PortableTextEditor.getValue(portableTextEditor), ptRange = toPortableTextRange(value, slateEditor.selection, schemaTypes), path = (ptRange == null ? void 0 : ptRange.focus.path) || [], onPasteResult = onPaste({ event, value, path, schemaTypes });
|
|
4428
4428
|
onPasteResult === void 0 ? (debug("No result from custom paste handler, pasting normally"), slateEditor.insertData(event.clipboardData)) : (change$.next({ type: "loading", isLoading: !0 }), Promise.resolve(onPasteResult).then((result) => {
|
|
4429
|
-
debug("Custom paste function from client resolved", result), result
|
|
4429
|
+
debug("Custom paste function from client resolved", result), !result || !result.insert ? (debug("No result from custom paste handler, pasting normally"), slateEditor.insertData(event.clipboardData)) : result.insert ? slateEditor.insertFragment(
|
|
4430
4430
|
toSlateValue(result.insert, { schemaTypes })
|
|
4431
4431
|
) : console.warn("Your onPaste function returned something unexpected:", result);
|
|
4432
4432
|
}).catch((error) => (console.error(error), error)).finally(() => {
|