goatdee-canvas 0.0.76 → 0.0.77

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.
package/dist/index.cjs CHANGED
@@ -5255,7 +5255,7 @@ const debug = () => {
5255
5255
  if (typeof window === "undefined") {
5256
5256
  return;
5257
5257
  }
5258
- window.__gd = { ...ManagerAPI };
5258
+ window.__gd = { ...window.__gd, ...ManagerAPI };
5259
5259
  };
5260
5260
 
5261
5261
  /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -6143,6 +6143,9 @@ const TGFXBind = (module) => {
6143
6143
  setTGFXModule(module);
6144
6144
  module.module = module;
6145
6145
  module.ScalerContext = ScalerContext;
6146
+ // tgfx 升级后 WebPathRasterizer.cpp 通过 val::module_property("PathRasterizer") 查找
6147
+ // 这里必须用 PathRasterizer 这个 key 注册;保留 WebMask 作为兼容回退。
6148
+ module.PathRasterizer = PathRasterizer;
6146
6149
  module.WebMask = PathRasterizer;
6147
6150
  module.Matrix = Matrix;
6148
6151
  module.tgfx = { ...tgfx };
@@ -6161,19 +6164,19 @@ const TGFXBind = (module) => {
6161
6164
  * 解析出的 URL 通过 emscripten `locateFile` 钩子注入,覆盖默认 sibling 推断。
6162
6165
  */
6163
6166
  async function loadWasmModule() {
6167
+ // @ts-ignore - 构建时会被替换为实际值
6164
6168
  let wasmModule = null;
6165
- let wasmBinaryUrl = null;
6166
- {
6167
- wasmModule = await Promise.resolve().then(function () { return ZHCanvasCore; });
6168
- try {
6169
- wasmBinaryUrl = new URL("../../wasm/ZHCanvasCore.wasm", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href;
6170
- }
6171
- catch (_b) {
6172
- wasmBinaryUrl = null;
6173
- }
6174
- }
6175
- // 使用单例:避免多线程下重复创建 pthread workers
6176
- let infiniteCanvas;
6169
+ let wasmBinaryUrl = null;
6170
+ wasmModule = await Promise.resolve().then(function () { return ZHCanvasCore; });
6171
+ try {
6172
+ wasmBinaryUrl = new URL(
6173
+ "../../wasm/ZHCanvasCore.wasm",
6174
+ (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),
6175
+ ).href;
6176
+ } catch (_e) {
6177
+ wasmBinaryUrl = null;
6178
+ }
6179
+ let infiniteCanvas;
6177
6180
  try {
6178
6181
  infiniteCanvas = manager.getModule();
6179
6182
  }