@geolonia/embed 6.0.0-pre.3 → 6.0.0-pre.4

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +11 -2
  3. package/dist/embed +1 -1
  4. package/dist/embed-chunks/18a79c1f77cc6894d617.js +1 -0
  5. package/dist/embed-chunks/88308c97950af0326501.js +1 -0
  6. package/dist/embed-chunks/b50d8f9685823588d639.js +1 -0
  7. package/dist/embed-chunks/c22ad704365fc721df0a.js +2 -0
  8. package/dist/embed-chunks/cfb9cc05d697ae310f6a.js +1 -0
  9. package/dist/embed-chunks/ec26dd45d3c0fe2695b2.js +2 -0
  10. package/dist/embed-core.d.ts +4 -1
  11. package/dist/embed-core.js +1 -2
  12. package/dist/embed.js +1 -1
  13. package/dist/embed.js.LICENSE.txt +3 -3
  14. package/dist/lib/maplibre-worker.d.ts +26 -0
  15. package/dist/version.d.ts +1 -1
  16. package/e2e/umd-worker.spec.ts +27 -0
  17. package/package.json +6 -5
  18. package/src/embed-core.ts +8 -1
  19. package/src/embed.ts +5 -0
  20. package/src/lib/maplibre-worker.ts +52 -0
  21. package/src/testability.test.ts +2 -1
  22. package/src/version.ts +1 -1
  23. package/webpack.config.js +35 -0
  24. package/dist/embed-chunks/1492645e3d07fd3de940.js +0 -1
  25. package/dist/embed-chunks/4ada77b78cc0cc5ccef9.js +0 -1
  26. package/dist/embed-chunks/6e05bbf5f391fda5b858.js +0 -1
  27. package/dist/embed-chunks/8176630945512b29f294.js +0 -2
  28. package/dist/embed-chunks/c783fffcd28083f7d5cb.js +0 -2
  29. package/dist/embed-chunks/f2124097fda51d0079ee.js +0 -1
  30. package/dist/embed-core.js.LICENSE.txt +0 -4
  31. /package/dist/embed-chunks/{8176630945512b29f294.js.LICENSE.txt → c22ad704365fc721df0a.js.LICENSE.txt} +0 -0
  32. /package/dist/embed-chunks/{c783fffcd28083f7d5cb.js.LICENSE.txt → ec26dd45d3c0fe2695b2.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## @geolonia/embed
4
4
 
5
+ ### v6.0.0-pre.4
6
+
7
+ - **Breaking**: バンドルする maplibre-gl を v6 系(`6.11.2`)へ更新しました([#518](https://github.com/geolonia/embed/issues/518))。`@geolonia/maps-core` `^0.6.0` の `peerDependencies` が `maplibre-gl: ^6.0.0` になったことへの追従です。maplibre-gl v6 にデフォルトエクスポートはありません。`window.geolonia` 経由で maplibre の API を直接触っている場合は [maplibre-gl v6 の変更点](https://github.com/maplibre/maplibre-gl-js/releases) を確認してください。
8
+ - **Fix**: UMD バンドルで地図が表示されない問題に対処しました。maplibre-gl v6 は worker を `import.meta.url` 基準で解決しますが、UMD 出力では webpack が `import.meta.url` をビルド時に解決してしまうため、実行時に worker を読み込めません。embed は 1 ファイルで完結する配布形態を保つため、worker を esbuild で自己完結する 1 ファイルへ束ねてバンドルへ埋め込み、実行時に Blob URL 化して maplibre に渡します。
9
+ - **Note**: このため worker は `blob:` URL から起動します。Content-Security-Policy を設定しているページでは `worker-src blob:` の許可が必要です。
10
+ - **Note**: worker を埋め込むぶん配布ファイルが大きくなります。`dist/embed.js` は gzip で約 297 KB → 455 KB になりました。
11
+ - **Internal**: `@geolonia/maps-core` `^0.6.0` に依存します。0.6.0 は ESM-only(`main` と `exports.require` を廃止)ですが、embed は webpack で `exports.import` を解決するため影響はありません。
12
+ - **Internal**: dependabot の [#498](https://github.com/geolonia/embed/pull/498) 相当のセキュリティ更新を取り込みました(`jsdom` `^29.1.1`、`webpack-dev-server` `^5.2.6` と、webpack / postcss / js-yaml / follow-redirects / shell-quote 等の推移的依存)。いずれも開発時のみの依存で、配布物には含まれません。
13
+
5
14
  ### v6.0.0-pre.3
6
15
 
7
16
  - **Fix**: maplibre-gl 5.11.0 以降で帰属表示が空になる問題を修正しました([#512](https://github.com/geolonia/embed/issues/512))。ソースに指定した `attribution` だけでなく、ベーススタイルの `© Geolonia` / `© OpenStreetMap` も表示されない状態でした。修正の実体は [maps-core#102](https://github.com/geolonia/maps-core/pull/102) で、embed 側は依存を更新して取り込みます。
package/README.md CHANGED
@@ -42,7 +42,7 @@ Or
42
42
 
43
43
  ### Using with npm (for React, Next.js, Astro, Fresh, etc.)
44
44
 
45
- For modern web frameworks, use `@geolonia/embed/core` — a side-effect-free entry point designed for programmatic use.
45
+ For modern web frameworks, use `@geolonia/embed/core` — an entry point designed for programmatic use.
46
46
 
47
47
  ```shell
48
48
  npm install @geolonia/embed
@@ -61,7 +61,16 @@ const map = new GeoloniaMap({
61
61
  });
62
62
  ```
63
63
 
64
- Unlike the default `@geolonia/embed` entry point, `/core` does **not** automatically scan the DOM or set `window.geolonia`. This makes it safe to use in SSR environments and avoids double-initialization issues in frameworks like React, Preact, and Vue.
64
+ Unlike the default `@geolonia/embed` entry point, `/core` does **not** automatically scan the DOM or set `window.geolonia`. This makes it safe to use in SSR environments and avoids double-initialization issues in frameworks like React, Preact, and Vue. (Its only import-time side effect is registering the bundled MapLibre worker, which is skipped outside the browser.)
65
+
66
+ ### Content Security Policy
67
+
68
+ `@geolonia/embed` ships as a single file, so the MapLibre worker is embedded in the bundle and started from a `blob:` URL.
69
+ If your page sets a Content Security Policy, allow `blob:` as a worker source:
70
+
71
+ ```
72
+ Content-Security-Policy: worker-src blob:;
73
+ ```
65
74
 
66
75
  ### Using External Styles Without API Key
67
76