@fleet-frontend/mower-maps 0.2.5-beta.22 → 0.2.5-beta.23

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.esm.js CHANGED
@@ -23208,7 +23208,19 @@ function bytesToWebSafeBase64(bytes) {
23208
23208
  return makeWebSafe(globalThis.btoa(binary));
23209
23209
  }
23210
23210
  function utf8Encode(text) {
23211
- return new globalThis.TextEncoder().encode(text);
23211
+ if (typeof globalThis.TextEncoder !== 'undefined') {
23212
+ return new globalThis.TextEncoder().encode(text);
23213
+ }
23214
+ // Static Map URL 仅含 ASCII;兼容无 TextEncoder 的旧 WebView / Jest jsdom
23215
+ const bytes = new Uint8Array(text.length);
23216
+ for (let i = 0; i < text.length; i++) {
23217
+ const code = text.charCodeAt(i);
23218
+ if (code > 127) {
23219
+ throw new Error('signGoogleStaticMapUrl: non-ASCII URL is not supported in this environment');
23220
+ }
23221
+ bytes[i] = code;
23222
+ }
23223
+ return bytes;
23212
23224
  }
23213
23225
  function concatBytes(...parts) {
23214
23226
  const total = parts.reduce((sum, part) => sum + part.length, 0);
package/dist/index.js CHANGED
@@ -23228,7 +23228,19 @@ function bytesToWebSafeBase64(bytes) {
23228
23228
  return makeWebSafe(globalThis.btoa(binary));
23229
23229
  }
23230
23230
  function utf8Encode(text) {
23231
- return new globalThis.TextEncoder().encode(text);
23231
+ if (typeof globalThis.TextEncoder !== 'undefined') {
23232
+ return new globalThis.TextEncoder().encode(text);
23233
+ }
23234
+ // Static Map URL 仅含 ASCII;兼容无 TextEncoder 的旧 WebView / Jest jsdom
23235
+ const bytes = new Uint8Array(text.length);
23236
+ for (let i = 0; i < text.length; i++) {
23237
+ const code = text.charCodeAt(i);
23238
+ if (code > 127) {
23239
+ throw new Error('signGoogleStaticMapUrl: non-ASCII URL is not supported in this environment');
23240
+ }
23241
+ bytes[i] = code;
23242
+ }
23243
+ return bytes;
23232
23244
  }
23233
23245
  function concatBytes(...parts) {
23234
23246
  const total = parts.reduce((sum, part) => sum + part.length, 0);
@@ -1 +1 @@
1
- {"version":3,"file":"googleStaticMapSign.d.ts","sourceRoot":"","sources":["../../src/utils/googleStaticMapSign.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4JH;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAU7F;AAED,wDAAwD;AACxD,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
1
+ {"version":3,"file":"googleStaticMapSign.d.ts","sourceRoot":"","sources":["../../src/utils/googleStaticMapSign.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwKH;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAU7F;AAED,wDAAwD;AACxD,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleet-frontend/mower-maps",
3
- "version": "0.2.5-beta.22",
3
+ "version": "0.2.5-beta.23",
4
4
  "type": "module",
5
5
  "description": "a mower maps in google maps",
6
6
  "main": "dist/index.js",