@opencloud-eu/web-pkg 4.1.0 → 4.2.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.
Files changed (36) hide show
  1. package/dist/{TextEditor-QVYD64f0.js → TextEditor-BEOcGAsh.js} +124 -70
  2. package/dist/assets/{worker-BJJcEMnx.js → worker-C2IPj8GP.js} +29 -29
  3. package/dist/assets/{worker-C9GzAwNf.js → worker-CQqhh0uK.js} +26 -26
  4. package/dist/assets/{worker-DIwRVmuf.js → worker-DkMHRpBn.js} +16 -16
  5. package/dist/{index-zEQVUjcV.js → index-C-VmIu2P.js} +11999 -11993
  6. package/dist/src/apps/types.d.ts +0 -1
  7. package/dist/src/components/AppBar/AppBar.vue.d.ts +23 -167
  8. package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +48 -248
  9. package/dist/src/components/AppTopBar.vue.d.ts +1 -0
  10. package/dist/src/components/ContextActions/ActionMenuDropItem.vue.d.ts +1 -2
  11. package/dist/src/components/ContextActions/ContextActionMenu.vue.d.ts +1 -14
  12. package/dist/src/components/ContextActions/ContextMenuQuickAction.vue.d.ts +32 -38
  13. package/dist/src/components/CreateLinkModal.vue.d.ts +2 -18
  14. package/dist/src/components/FilesList/ContextActions.vue.d.ts +1 -27
  15. package/dist/src/components/FilesList/ResourceTable.vue.d.ts +56 -39
  16. package/dist/src/components/FilesList/ResourceTiles.vue.d.ts +0 -4
  17. package/dist/src/components/Modals/FilePickerModal.vue.d.ts +12 -5
  18. package/dist/src/components/TextEditor/TextEditor.vue.d.ts +3 -0
  19. package/dist/src/components/TextEditor/index.d.ts +3 -0
  20. package/dist/src/components/VersionCheck.vue.d.ts +2 -0
  21. package/dist/src/components/ViewOptions.vue.d.ts +12 -141
  22. package/dist/src/components/index.d.ts +1 -0
  23. package/dist/src/composables/actions/files/useFileActionsOpenWithApp.d.ts +6 -0
  24. package/dist/src/composables/clipboard/useClipboard.d.ts +3 -0
  25. package/dist/src/composables/links/index.d.ts +1 -0
  26. package/dist/src/composables/links/useCopyLink.d.ts +14 -0
  27. package/dist/src/composables/piniaStores/capabilities.d.ts +13 -1
  28. package/dist/src/composables/resources/useGetResourceContext.d.ts +1 -1
  29. package/dist/src/helpers/download.d.ts +1 -1
  30. package/dist/src/helpers/resource/index.d.ts +1 -0
  31. package/dist/src/helpers/resource/isItemInCurrentFolder.d.ts +5 -0
  32. package/dist/src/services/archiver.d.ts +0 -3
  33. package/dist/src/services/cache.d.ts +1 -0
  34. package/dist/web-pkg.js +240 -237
  35. package/dist/web-pkg.umd.cjs +49 -49
  36. package/package.json +4 -3
@@ -1,6 +1,6 @@
1
- import { d as L, u as w, c as r, a as n, _ as v, r as g, b as y, o as s, e as h } from "./index-zEQVUjcV.js";
2
- import { MdPreview as z, MdEditor as P, config as C, XSSPlugin as I } from "md-editor-v3";
3
- import { useGettext as D } from "vue3-gettext";
1
+ import { d as P, u as C, r as I, c as d, a as r, _ as D, b as u, e as x, o as g, f as L, w, g as v } from "./index-C-VmIu2P.js";
2
+ import { NormalToolbar as j, MdPreview as E, MdEditor as R, config as S, XSSPlugin as U } from "md-editor-v3";
3
+ import { useGettext as F } from "vue3-gettext";
4
4
  import "@casl/vue";
5
5
  import "@opencloud-eu/web-client";
6
6
  import "fuse.js";
@@ -21,13 +21,15 @@ import "pinia";
21
21
  import "oidc-client-ts";
22
22
  import "p-queue";
23
23
  import "@vueuse/core";
24
- import x from "cropperjs";
24
+ import M from "cropperjs";
25
25
  import "dompurify";
26
26
  import "mark.js";
27
27
  import "vue-router";
28
28
  import "portal-vue";
29
- import j from "screenfull";
30
- const R = {
29
+ import q from "screenfull";
30
+ import { lineNumbers as A } from "@codemirror/view";
31
+ import { normalizeClass as H } from "@vue/shared";
32
+ const O = {
31
33
  toolbarTips: {
32
34
  bold: "Gras",
33
35
  underline: "Souligné",
@@ -107,7 +109,7 @@ const R = {
107
109
  markdownTotal: "Nombre de mots",
108
110
  scrollAuto: "Défilement synchronisé"
109
111
  }
110
- }, E = {
112
+ }, N = {
111
113
  toolbarTips: {
112
114
  bold: "Fett",
113
115
  underline: "Unterstrichen",
@@ -187,7 +189,7 @@ const R = {
187
189
  markdownTotal: "Zeichenanzahl",
188
190
  scrollAuto: "Automatisches Scrollen"
189
191
  }
190
- }, U = {
192
+ }, B = {
191
193
  toolbarTips: {
192
194
  bold: "Grassetto",
193
195
  underline: "Sottolineato",
@@ -267,7 +269,7 @@ const R = {
267
269
  markdownTotal: "Conteggio parole",
268
270
  scrollAuto: "Scorrimento automatico"
269
271
  }
270
- }, F = {
272
+ }, K = {
271
273
  toolbarTips: {
272
274
  bold: "Negrita",
273
275
  underline: "Subrayado",
@@ -347,7 +349,7 @@ const R = {
347
349
  markdownTotal: "Conteo de letras",
348
350
  scrollAuto: "Desplazamiento automático"
349
351
  }
350
- }, S = {
352
+ }, G = {
351
353
  toolbarTips: {
352
354
  bold: "Pogrubienie",
353
355
  underline: "Podkreślenie",
@@ -427,7 +429,7 @@ const R = {
427
429
  markdownTotal: "Liczba znaków",
428
430
  scrollAuto: "Automatyczne przewijanie"
429
431
  }
430
- }, M = {
432
+ }, J = {
431
433
  toolbarTips: {
432
434
  bold: "жирный",
433
435
  underline: "подчёркнутый",
@@ -508,7 +510,7 @@ const R = {
508
510
  markdownTotal: "Кол-во символов",
509
511
  scrollAuto: "Автопрокрутка"
510
512
  }
511
- }, q = {
513
+ }, $ = {
512
514
  toolbarTips: {
513
515
  bold: "太字",
514
516
  underline: "下線",
@@ -588,7 +590,7 @@ const R = {
588
590
  markdownTotal: "単語数",
589
591
  scrollAuto: "同期スクロール"
590
592
  }
591
- }, A = {
593
+ }, V = {
592
594
  toolbarTips: {
593
595
  bold: "tebal",
594
596
  underline: "garis bawah",
@@ -668,7 +670,7 @@ const R = {
668
670
  markdownTotal: "Jumlah Kata",
669
671
  scrollAuto: "Gulir Otomatis"
670
672
  }
671
- }, H = {
673
+ }, _ = {
672
674
  zh: "zh-CN",
673
675
  fr: "fr-FR",
674
676
  ja: "jp-JP",
@@ -679,19 +681,23 @@ const R = {
679
681
  es: "es-ES",
680
682
  pl: "pl-PL",
681
683
  en: "en-US"
682
- }, O = {
683
- "fr-FR": R,
684
- "de-DE": E,
685
- "it-IT": U,
686
- "es-ES": F,
687
- "pl-PL": S,
688
- ru: M,
689
- "jp-JP": q,
690
- "id-ID": A
691
- }, B = L({
684
+ }, W = {
685
+ "fr-FR": O,
686
+ "de-DE": N,
687
+ "it-IT": B,
688
+ "es-ES": K,
689
+ "pl-PL": G,
690
+ ru: J,
691
+ "jp-JP": $,
692
+ "id-ID": V
693
+ }, Z = P({
692
694
  name: "TextEditor",
693
695
  // type casts are needed to ensure type inference works correctly when building web-pkg
694
- components: { MdEditor: P, MdPreview: z },
696
+ components: {
697
+ MdEditor: R,
698
+ MdPreview: E,
699
+ NormalToolbar: j
700
+ },
695
701
  props: {
696
702
  applicationConfig: { type: Object, required: !1 },
697
703
  currentContent: {
@@ -704,20 +710,46 @@ const R = {
704
710
  },
705
711
  emits: ["update:currentContent"],
706
712
  setup(e, { emit: i }) {
707
- const d = D(), { currentTheme: u } = w(), m = r(() => {
713
+ const b = F(), { currentTheme: h } = C(), k = I(!0), T = d(() => {
708
714
  const { showPreviewOnlyMd: a = !0 } = e.applicationConfig;
709
715
  return { showPreviewOnlyMd: a };
710
- }), c = r(() => e.markdownMode || ["md", "markdown"].includes(e.resource?.extension) || !n(m).showPreviewOnlyMd), o = r(() => n(u).isDark ? "dark" : "light");
711
- return C({
716
+ }), t = d(() => e.markdownMode || ["md", "markdown"].includes(e.resource?.extension) || !r(T).showPreviewOnlyMd), m = d(() => r(h).isDark ? "dark" : "light"), c = d(() => r(t) ? [
717
+ "bold",
718
+ "underline",
719
+ "italic",
720
+ "-",
721
+ "title",
722
+ "strikeThrough",
723
+ "sub",
724
+ "sup",
725
+ "quote",
726
+ "unorderedList",
727
+ "orderedList",
728
+ "task",
729
+ "-",
730
+ "codeRow",
731
+ "code",
732
+ "link",
733
+ "image",
734
+ "table",
735
+ "-",
736
+ "revoke",
737
+ "next",
738
+ "=",
739
+ 0,
740
+ "preview",
741
+ "previewOnly"
742
+ ] : ["revoke", "next", "=", 0]);
743
+ return S({
712
744
  editorConfig: {
713
- languageUserDefined: O
745
+ languageUserDefined: W
714
746
  },
715
747
  editorExtensions: {
716
748
  screenfull: {
717
- instance: j
749
+ instance: q
718
750
  },
719
751
  cropper: {
720
- instance: x
752
+ instance: M
721
753
  }
722
754
  },
723
755
  markdownItPlugins(a) {
@@ -725,41 +757,57 @@ const R = {
725
757
  ...a,
726
758
  {
727
759
  type: "xss",
728
- plugin: I,
760
+ plugin: U,
729
761
  options: {}
730
762
  }
731
763
  ];
764
+ },
765
+ codeMirrorExtensions(a) {
766
+ const l = [
767
+ ...a,
768
+ {
769
+ type: "lineNumbers",
770
+ extension: A()
771
+ }
772
+ ], n = l.find(
773
+ (o) => o.type === "linkShortener"
774
+ );
775
+ return n && (n.options.maxLength = 120), r(t) ? l : l.filter(
776
+ (o) => ["lineWrapping", "keymap", "floatingToolbar", "lineNumbers"].includes(o.type)
777
+ );
732
778
  }
733
779
  }), {
734
- isMarkdown: c,
735
- theme: o,
736
- language: d,
737
- languages: H,
780
+ isMarkdown: t,
781
+ theme: m,
782
+ toolbars: c,
783
+ language: b,
784
+ languages: _,
738
785
  onUploadImg: async (a) => {
739
- const b = (await Promise.all(
786
+ const n = (await Promise.all(
740
787
  [...a].map(
741
- (l) => new Promise((T, f) => {
742
- const t = new FileReader();
743
- t.onload = () => T(t.result), t.onerror = f, t.readAsDataURL(l);
788
+ (p) => new Promise((y, z) => {
789
+ const s = new FileReader();
790
+ s.onload = () => y(s.result), s.onerror = z, s.readAsDataURL(p);
744
791
  })
745
792
  )
746
- )).map((l) => `![image](${l})`), k = `${n(e.currentContent)}
747
- ${b.join(`
793
+ )).map((p) => `![image](${p})`), o = `${r(e.currentContent)}
794
+ ${n.join(`
748
795
 
749
796
  `)}
750
797
  `;
751
- i("update:currentContent", k);
752
- }
798
+ i("update:currentContent", o);
799
+ },
800
+ showLineNumbers: k
753
801
  };
754
802
  }
755
- }), K = {
803
+ }), Q = {
756
804
  id: "text-editor-container",
757
805
  class: "h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"
758
806
  };
759
- function G(e, i, d, u, m, c) {
760
- const o = g("md-preview"), p = g("md-editor");
761
- return s(), y("div", K, [
762
- e.isReadOnly ? (s(), h(o, {
807
+ function X(e, i, b, h, k, T) {
808
+ const t = u("md-preview"), m = u("oc-icon"), c = u("NormalToolbar"), f = u("md-editor");
809
+ return g(), x("div", Q, [
810
+ e.isReadOnly ? (g(), L(t, {
763
811
  key: 0,
764
812
  id: "text-editor-preview-component",
765
813
  "model-value": e.currentContent,
@@ -772,40 +820,46 @@ function G(e, i, d, u, m, c) {
772
820
  language: e.languages[e.language.current] || "en-US",
773
821
  theme: e.theme,
774
822
  "auto-focus": "",
775
- "read-only": "",
776
- toolbars: []
777
- }, null, 8, ["model-value", "language", "theme"])) : (s(), h(p, {
823
+ "read-only": ""
824
+ }, null, 8, ["model-value", "language", "theme"])) : (g(), L(f, {
778
825
  key: 1,
779
826
  id: "text-editor-component",
780
- class: "[&_.cm-content]:!font-(family-name:--oc-font-family)",
827
+ class: H([{ "no-line-numbers": !e.showLineNumbers }, "[&_.cm-content]:!font-(family-name:--oc-font-family)"]),
781
828
  "model-value": e.currentContent,
782
829
  "no-katex": "",
783
830
  "no-mermaid": "",
784
831
  "no-prettier": "",
785
832
  "no-highlight": "",
833
+ "no-echarts": "",
786
834
  "on-upload-img": e.onUploadImg,
787
835
  language: e.languages[e.language.current] || "en-US",
788
836
  theme: e.theme,
789
837
  preview: e.isMarkdown,
790
- toolbars: e.isMarkdown ? void 0 : ["revoke", "next"],
791
- "toolbars-exclude": [
792
- "save",
793
- "katex",
794
- "github",
795
- "catalog",
796
- "mermaid",
797
- "prettier",
798
- "fullscreen",
799
- "htmlPreview",
800
- "pageFullscreen"
801
- ],
802
- "read-only": e.isReadOnly,
838
+ toolbars: e.toolbars,
803
839
  "auto-focus": "",
804
- onOnChange: i[0] || (i[0] = (a) => e.$emit("update:currentContent", a))
805
- }, null, 8, ["model-value", "on-upload-img", "language", "theme", "preview", "toolbars", "read-only"]))
840
+ onOnChange: i[1] || (i[1] = (a) => e.$emit("update:currentContent", a))
841
+ }, {
842
+ defToolbars: w(() => [
843
+ v(c, {
844
+ title: e.showLineNumbers ? e.$gettext("hide line numbers") : e.$gettext("show line numbers"),
845
+ onOnClick: i[0] || (i[0] = (a) => e.showLineNumbers = !e.showLineNumbers)
846
+ }, {
847
+ default: w(() => [
848
+ v(m, {
849
+ class: "!flex items-center justify-center w-[24px] h-[24px]",
850
+ size: "small",
851
+ name: "hashtag",
852
+ "fill-type": "none"
853
+ })
854
+ ]),
855
+ _: 1
856
+ }, 8, ["title"])
857
+ ]),
858
+ _: 1
859
+ }, 8, ["class", "model-value", "on-upload-img", "language", "theme", "preview", "toolbars"]))
806
860
  ]);
807
861
  }
808
- const Le = /* @__PURE__ */ v(B, [["render", G]]);
862
+ const je = /* @__PURE__ */ D(Z, [["render", X]]);
809
863
  export {
810
- Le as default
864
+ je as default
811
865
  };