@mce/bigesj 0.15.13 → 0.15.14

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.
@@ -3,6 +3,6 @@ export type BigeFont = Record<string, any>;
3
3
  export declare function useFonts(): {
4
4
  bigeFonts: import("vue").Ref<BigeFont[], BigeFont[]>;
5
5
  searchBigeFont: (keyword: string, fonts?: BigeFont[]) => BigeFont | undefined;
6
- loadBigeFonts: (url: string) => Promise<BigeFont[]>;
6
+ loadBigeFonts: (url: string, init?: boolean) => Promise<BigeFont[]>;
7
7
  loadFont: (name: string | string[]) => Promise<(FontLoadedResult | undefined)[]>;
8
8
  };
package/dist/index.js CHANGED
@@ -27,9 +27,9 @@ function useFonts() {
27
27
  loadFont: baseLoadFont
28
28
  } = useEditor();
29
29
  const fontPromises = ref(/* @__PURE__ */ new Map());
30
- async function loadBigeFonts(url) {
30
+ async function loadBigeFonts(url, init = false) {
31
31
  let result = bigeFonts.value;
32
- if (!result.length) {
32
+ if (!init || !result.length) {
33
33
  result = await fetch(url).then((rep) => rep.json()).then((res) => res.data.datalist);
34
34
  bigeFonts.value = result;
35
35
  }
@@ -1864,7 +1864,7 @@ async function setupFonts(editor, api) {
1864
1864
  });
1865
1865
  on("setDoc", preload);
1866
1866
  renderEngine.value.on("nodeEnter", preloadNode);
1867
- await loadBigeFonts(api.fonts);
1867
+ await loadBigeFonts(api.fonts, true);
1868
1868
  }
1869
1869
  export {
1870
1870
  bidTidLoader,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mce/bigesj",
3
3
  "type": "module",
4
- "version": "0.15.13",
4
+ "version": "0.15.14",
5
5
  "description": "Plugin for mce",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "modern-openxml": "^1.10.1"
50
50
  },
51
51
  "devDependencies": {
52
- "mce": "0.15.13"
52
+ "mce": "0.15.14"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "mce": "^0"