Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: onOpenAttachmentPicker not getting called

thecodrra14353793f3f
diff --git a/packages/editor/dist/index.js b/packages/editor/dist/index.js
index 809978069..fbae2dfa6 100644
--- a/packages/editor/dist/index.js
+++ b/packages/editor/dist/index.js
@@ -61,7 +61,7 @@ EditorView.prototype.updateState = function updateState(state) {
};
var useTiptap = function (options, deps) {
if (options === void 0) { options = {}; }
- var theme = options.theme, onCreate = options.onCreate, onDownloadAttachment = options.onDownloadAttachment, portalProviderAPI = options.portalProviderAPI, restOptions = __rest(options, ["theme", "onCreate", "onDownloadAttachment", "portalProviderAPI"]);
+ var theme = options.theme, onCreate = options.onCreate, onDownloadAttachment = options.onDownloadAttachment, onOpenAttachmentPicker = options.onOpenAttachmentPicker, portalProviderAPI = options.portalProviderAPI, restOptions = __rest(options, ["theme", "onCreate", "onDownloadAttachment", "onOpenAttachmentPicker", "portalProviderAPI"]);
var eventDispatcher = useMemo(function () { return new EventDispatcher(); }, []);
var defaultOptions = useMemo(function () { return ({
extensions: [
@@ -113,6 +113,7 @@ var useTiptap = function (options, deps) {
EmbedNode,
AttachmentNode.configure({
onDownloadAttachment: onDownloadAttachment,
+ onOpenAttachmentPicker: onOpenAttachmentPicker,
}),
ListItem,
],
@@ -129,7 +130,14 @@ var useTiptap = function (options, deps) {
onCreate({ editor: editor });
},
injectCSS: false,
- }); }, [theme, onCreate, onDownloadAttachment, portalProviderAPI, eventDispatcher]);
+ }); }, [
+ theme,
+ onCreate,
+ onDownloadAttachment,
+ onOpenAttachmentPicker,
+ portalProviderAPI,
+ eventDispatcher,
+ ]);
var editor = useEditor(__assign(__assign({}, defaultOptions), restOptions), deps);
/**
* Add editor to global for use in React Native.
diff --git a/packages/editor/src/index.ts b/packages/editor/src/index.ts
index 566fbd876..3faf9d9a9 100644
--- a/packages/editor/src/index.ts
+++ b/packages/editor/src/index.ts
@@ -50,6 +50,7 @@ const useTiptap = (
theme,
onCreate,
onDownloadAttachment,
+ onOpenAttachmentPicker,
portalProviderAPI,
...restOptions
} = options;
@@ -107,6 +108,7 @@ const useTiptap = (
EmbedNode,
AttachmentNode.configure({
onDownloadAttachment,
+ onOpenAttachmentPicker,
}),
ListItem,
],
@@ -122,7 +124,14 @@ const useTiptap = (
},
injectCSS: false,
}),
- [theme, onCreate, onDownloadAttachment, portalProviderAPI, eventDispatcher]
+ [
+ theme,
+ onCreate,
+ onDownloadAttachment,
+ onOpenAttachmentPicker,
+ portalProviderAPI,
+ eventDispatcher,
+ ]
);
const editor = useEditor({ ...defaultOptions, ...restOptions }, deps);