@shotstack/shotstack-canvas 1.4.4 → 1.4.6

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.
@@ -315,17 +315,6 @@ function setupWasmInterceptors(wasmBinary) {
315
315
  };
316
316
  }
317
317
  }
318
- async function importHarfBuzzJS() {
319
- try {
320
- const dynamicImport = new Function("specifier", "return import(specifier)");
321
- return await dynamicImport("harfbuzzjs");
322
- } catch (err) {
323
- console.error("Failed to import harfbuzzjs:", err);
324
- throw new Error(
325
- `Cannot import harfbuzzjs. This library requires harfbuzzjs to be installed. Error: ${err instanceof Error ? err.message : String(err)}`
326
- );
327
- }
328
- }
329
318
  async function initHB(wasmBaseURL) {
330
319
  if (hbSingleton) return hbSingleton;
331
320
  try {
@@ -342,7 +331,7 @@ async function initHB(wasmBaseURL) {
342
331
  if (!isNode()) {
343
332
  setupWasmInterceptors(wasmBinary);
344
333
  }
345
- const mod = await importHarfBuzzJS();
334
+ const mod = await import("harfbuzzjs");
346
335
  let hb;
347
336
  const candidate = mod.default || mod;
348
337
  if (typeof candidate === "function") {
@@ -276,17 +276,6 @@ function setupWasmInterceptors(wasmBinary) {
276
276
  };
277
277
  }
278
278
  }
279
- async function importHarfBuzzJS() {
280
- try {
281
- const dynamicImport = new Function("specifier", "return import(specifier)");
282
- return await dynamicImport("harfbuzzjs");
283
- } catch (err) {
284
- console.error("Failed to import harfbuzzjs:", err);
285
- throw new Error(
286
- `Cannot import harfbuzzjs. This library requires harfbuzzjs to be installed. Error: ${err instanceof Error ? err.message : String(err)}`
287
- );
288
- }
289
- }
290
279
  async function initHB(wasmBaseURL) {
291
280
  if (hbSingleton) return hbSingleton;
292
281
  try {
@@ -303,7 +292,7 @@ async function initHB(wasmBaseURL) {
303
292
  if (!isNode()) {
304
293
  setupWasmInterceptors(wasmBinary);
305
294
  }
306
- const mod = await importHarfBuzzJS();
295
+ const mod = await import("harfbuzzjs");
307
296
  let hb;
308
297
  const candidate = mod.default || mod;
309
298
  if (typeof candidate === "function") {
package/dist/entry.web.js CHANGED
@@ -280,17 +280,6 @@ function setupWasmInterceptors(wasmBinary) {
280
280
  };
281
281
  }
282
282
  }
283
- async function importHarfBuzzJS() {
284
- try {
285
- const dynamicImport = new Function("specifier", "return import(specifier)");
286
- return await dynamicImport("harfbuzzjs");
287
- } catch (err) {
288
- console.error("Failed to import harfbuzzjs:", err);
289
- throw new Error(
290
- `Cannot import harfbuzzjs. This library requires harfbuzzjs to be installed. Error: ${err instanceof Error ? err.message : String(err)}`
291
- );
292
- }
293
- }
294
283
  async function initHB(wasmBaseURL) {
295
284
  if (hbSingleton) return hbSingleton;
296
285
  try {
@@ -307,7 +296,7 @@ async function initHB(wasmBaseURL) {
307
296
  if (!isNode()) {
308
297
  setupWasmInterceptors(wasmBinary);
309
298
  }
310
- const mod = await importHarfBuzzJS();
299
+ const mod = await import("harfbuzzjs");
311
300
  let hb;
312
301
  const candidate = mod.default || mod;
313
302
  if (typeof candidate === "function") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/shotstack-canvas",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Text layout & animation engine (HarfBuzz) for Node & Web - fully self-contained.",
5
5
  "type": "module",
6
6
  "main": "./dist/entry.node.cjs",