Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/EditorMediaHandler.provider.js')
-rw-r--r--src/components/EditorMediaHandler.provider.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/EditorMediaHandler.provider.js b/src/components/EditorMediaHandler.provider.js
new file mode 100644
index 000000000..74e6ec667
--- /dev/null
+++ b/src/components/EditorMediaHandler.provider.js
@@ -0,0 +1,26 @@
+export const STATE_UPLOADING = Symbol('state:uploading-state')
+export const ACTION_IMAGE_PROMPT = Symbol('editor:action:image-prompt')
+export const ACTION_CHOOSE_LOCAL_IMAGE = Symbol('editor:action:upload-image')
+
+export const useUploadingStateMixin = {
+ inject: {
+ $uploadingState: {
+ from: STATE_UPLOADING,
+ default: {
+ isUploadingImages: false,
+ },
+ },
+ },
+}
+
+export const useActionImagePromptMixin = {
+ inject: {
+ $callImagePrompt: { from: ACTION_IMAGE_PROMPT, default: () => {} },
+ },
+}
+
+export const useActionChooseLocalImageMixin = {
+ inject: {
+ $callChooseLocalImage: { from: ACTION_CHOOSE_LOCAL_IMAGE, default: () => {} },
+ },
+}