@textbus/xnote 0.3.1 → 0.3.2

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.
@@ -4162,11 +4162,17 @@ const isSupportFont = (function () {
4162
4162
  const data = context.getImageData(0, 0, width, height).data;
4163
4163
  return Array.from(data).filter(n => n !== 0);
4164
4164
  }
4165
+ const cache = new Map();
4165
4166
  return function (fontName) {
4166
4167
  if (fontName.toLowerCase() === fullbackFontName.toLowerCase()) {
4167
4168
  return true;
4168
4169
  }
4169
- return checker(fullbackFontName).join('') !== checker(fontName).join('');
4170
+ if (cache.has(fontName)) {
4171
+ return cache.get(fontName);
4172
+ }
4173
+ const b = checker(fullbackFontName).join('') !== checker(fontName).join('');
4174
+ cache.set(fontName, b);
4175
+ return b;
4170
4176
  };
4171
4177
  })();
4172
4178
  function FontFamilyTool() {
package/bundles/index.js CHANGED
@@ -4164,11 +4164,17 @@ const isSupportFont = (function () {
4164
4164
  const data = context.getImageData(0, 0, width, height).data;
4165
4165
  return Array.from(data).filter(n => n !== 0);
4166
4166
  }
4167
+ const cache = new Map();
4167
4168
  return function (fontName) {
4168
4169
  if (fontName.toLowerCase() === fullbackFontName.toLowerCase()) {
4169
4170
  return true;
4170
4171
  }
4171
- return checker(fullbackFontName).join('') !== checker(fontName).join('');
4172
+ if (cache.has(fontName)) {
4173
+ return cache.get(fontName);
4174
+ }
4175
+ const b = checker(fullbackFontName).join('') !== checker(fontName).join('');
4176
+ cache.set(fontName, b);
4177
+ return b;
4172
4178
  };
4173
4179
  })();
4174
4180
  function FontFamilyTool() {
@@ -1,2 +1,2 @@
1
- export declare const isSupportFont: (fontName: string) => boolean;
1
+ export declare const isSupportFont: (fontName: string) => boolean | undefined;
2
2
  export declare function FontFamilyTool(): () => import("@viewfly/core/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/xnote",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A high-performance rich text editor that supports multiplayer online collaboration.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@tanbo/color": "^0.1.1",
30
- "@textbus/adapter-viewfly": "^4.3.2",
31
- "@textbus/collaborate": "^4.3.2",
32
- "@textbus/core": "^4.3.2",
33
- "@textbus/platform-browser": "^4.3.2",
30
+ "@textbus/adapter-viewfly": "^4.3.3",
31
+ "@textbus/collaborate": "^4.3.3",
32
+ "@textbus/core": "^4.3.3",
33
+ "@textbus/platform-browser": "^4.3.3",
34
34
  "@viewfly/core": "^1.1.2",
35
35
  "@viewfly/hooks": "^1.1.2",
36
36
  "@viewfly/platform-browser": "^1.1.5",