@geolonia/embed 5.2.2 → 6.0.0-pre.3
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/.github/workflows/build.yml +25 -1
- package/CHANGELOG.md +15 -0
- package/README.md +24 -1
- package/dist/embed +1 -1
- package/dist/embed-chunks/4ada77b78cc0cc5ccef9.js +1 -0
- package/dist/embed-chunks/8176630945512b29f294.js +2 -0
- package/dist/embed-chunks/c783fffcd28083f7d5cb.js +2 -0
- package/dist/embed-chunks/f2124097fda51d0079ee.js +1 -0
- package/dist/embed-core.d.ts +6 -7
- package/dist/embed-core.js +1 -1
- package/dist/embed.d.ts +2 -4
- package/dist/embed.js +1 -1
- package/dist/lib/parse-atts.d.ts +19 -0
- package/dist/lib/render.d.ts +1 -1
- package/dist/lib/util.d.ts +14 -55
- package/dist/types.d.ts +155 -1
- package/dist/version.d.ts +1 -1
- package/e2e/auto-render.spec.ts +44 -0
- package/e2e/basic.spec.ts +10 -74
- package/e2e/cleanup.spec.ts +43 -0
- package/e2e/data-attributes.spec.ts +56 -0
- package/e2e/globals.spec.ts +51 -0
- package/e2e/helper.ts +170 -4
- package/e2e/iframe.spec.ts +35 -0
- package/e2e/lazy-loading.spec.ts +32 -0
- package/e2e/legacy-constructor.spec.ts +102 -0
- package/e2e/plugin.spec.ts +25 -0
- package/e2e/pmtiles.spec.ts +13 -0
- package/package.json +8 -11
- package/playwright.config.ts +6 -32
- package/src/embed-core.ts +12 -14
- package/src/embed.ts +2 -4
- package/src/lib/parse-atts.test.ts +186 -18
- package/src/lib/parse-atts.ts +151 -5
- package/src/lib/render.ts +50 -12
- package/src/lib/util.ts +37 -350
- package/src/types.ts +155 -1
- package/src/version.ts +1 -1
- package/typedoc.json +13 -0
- package/vitest.config.ts +7 -0
- package/dist/embed-chunks/12cbd0d1cb4cf744c32f.js +0 -2
- package/dist/embed-chunks/8a521e8312a5b4da123d.js +0 -2
- package/dist/lib/CustomAttributionControl.d.ts +0 -47
- package/dist/lib/controls/geolonia-control.d.ts +0 -7
- package/dist/lib/geolonia-map.d.ts +0 -30
- package/dist/lib/geolonia-marker.d.ts +0 -9
- package/dist/lib/keyring.d.ts +0 -45
- package/dist/lib/maplibre-util.d.ts +0 -25
- package/dist/lib/simplestyle-vector.d.ts +0 -26
- package/dist/lib/simplestyle.d.ts +0 -31
- package/e2e/external-style.spec.ts +0 -25
- package/e2e/map.spec.ts +0 -69
- package/src/lib/CustomAttributionControl.ts +0 -394
- package/src/lib/controls/geolonia-control.ts +0 -38
- package/src/lib/geolonia-map.ts +0 -429
- package/src/lib/geolonia-marker.ts +0 -53
- package/src/lib/keyring.test.ts +0 -127
- package/src/lib/keyring.ts +0 -136
- package/src/lib/maplibre-util.ts +0 -137
- package/src/lib/marker.svg +0 -1
- package/src/lib/simplestyle-vector.ts +0 -257
- package/src/lib/simplestyle.test.ts +0 -289
- package/src/lib/simplestyle.ts +0 -435
- package/src/lib/util.test.ts +0 -364
- /package/dist/embed-chunks/{12cbd0d1cb4cf744c32f.js.LICENSE.txt → 8176630945512b29f294.js.LICENSE.txt} +0 -0
- /package/dist/embed-chunks/{8a521e8312a5b4da123d.js.LICENSE.txt → c783fffcd28083f7d5cb.js.LICENSE.txt} +0 -0
|
@@ -49,6 +49,29 @@ jobs:
|
|
|
49
49
|
dist/
|
|
50
50
|
docs/
|
|
51
51
|
|
|
52
|
+
e2e:
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
timeout-minutes: 30
|
|
55
|
+
needs: build
|
|
56
|
+
steps:
|
|
57
|
+
- uses: actions/checkout@v6
|
|
58
|
+
- uses: actions/setup-node@v6
|
|
59
|
+
with:
|
|
60
|
+
node-version: '22.x'
|
|
61
|
+
cache: 'npm'
|
|
62
|
+
- run: npm ci
|
|
63
|
+
- name: Install Playwright
|
|
64
|
+
run: npx playwright install --with-deps chromium
|
|
65
|
+
- name: Run e2e tests
|
|
66
|
+
run: npm run e2e
|
|
67
|
+
- name: Upload Playwright report
|
|
68
|
+
uses: actions/upload-artifact@v7
|
|
69
|
+
if: ${{ !cancelled() }}
|
|
70
|
+
with:
|
|
71
|
+
name: playwright-report
|
|
72
|
+
path: playwright-report/
|
|
73
|
+
retention-days: 7
|
|
74
|
+
|
|
52
75
|
gh-pages:
|
|
53
76
|
name: 'Host with GitHub Pages'
|
|
54
77
|
runs-on: ubuntu-latest
|
|
@@ -87,6 +110,7 @@ jobs:
|
|
|
87
110
|
contents: read
|
|
88
111
|
needs:
|
|
89
112
|
- build
|
|
113
|
+
- e2e
|
|
90
114
|
- act-test
|
|
91
115
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
92
116
|
steps:
|
|
@@ -113,7 +137,7 @@ jobs:
|
|
|
113
137
|
run: npm publish --access=public --tag=next
|
|
114
138
|
|
|
115
139
|
deploy:
|
|
116
|
-
needs: build
|
|
140
|
+
needs: [build, e2e]
|
|
117
141
|
runs-on: ubuntu-latest
|
|
118
142
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
119
143
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## @geolonia/embed
|
|
4
4
|
|
|
5
|
+
### v6.0.0-pre.3
|
|
6
|
+
|
|
7
|
+
- **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 側は依存を更新して取り込みます。
|
|
8
|
+
- **Internal**: `@geolonia/maps-core` `^0.5.1` に依存します。
|
|
9
|
+
|
|
10
|
+
### v6.0.0-pre.2
|
|
11
|
+
|
|
12
|
+
コア実装を `@geolonia/maps-core` に委譲し、embed は「HTML 埋め込みラッパー」に専念する構成へ移行しました。
|
|
13
|
+
|
|
14
|
+
- **Refactor**: 地図コア(`GeoloniaMap` / `GeoloniaMarker` / `SimpleStyle` / `SimpleStyleVector` / `keyring` / attribution・logo コントロール等)を [`@geolonia/maps-core`](https://github.com/geolonia/maps-core) に移管。embed 側には `data-*` 属性のパースと DOM 自動走査・遅延読み込み・プラグイン機構といったラッパー機能のみを残しました。
|
|
15
|
+
- **Compat**: `GeoloniaMap` コンストラクタは `GeoloniaMapOptions` オブジェクト形式(`new geolonia.Map({ container })`)を推奨しますが、旧 embed 互換として CSS セレクタ文字列(`new geolonia.Map('#map')`)や HTMLElement の直接指定も引き続き受け付けます([maps-core#90](https://github.com/geolonia/maps-core/issues/90))。legacy 形式ではコンテナの `data-*` 属性を読み取って options に反映します。
|
|
16
|
+
- **Breaking**: `keyring.parse()`(DOM スキャン)は廃止されました。API キーは `<script src="...?geolonia-api-key=KEY">` から embed が読み取り、`keyring.setApiKey()` で maps-core に渡します(既存の script タグ方式は引き続き動作します)。
|
|
17
|
+
- **Internal**: maps-core が内包する依存(pmtiles / sanitize-html / tinycolor2 / turf / gesture-handling 等)を embed の直接依存から削除しました。
|
|
18
|
+
- **Internal**: `@geolonia/maps-core` `^0.4.3` に依存します。
|
|
19
|
+
|
|
5
20
|
### nightly
|
|
6
21
|
|
|
7
22
|
- **Feature**: Added support for external style.json URLs in `data-style` attribute
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ npm install @geolonia/embed
|
|
|
51
51
|
```typescript
|
|
52
52
|
import { GeoloniaMap, keyring } from "@geolonia/embed/core";
|
|
53
53
|
|
|
54
|
-
keyring.
|
|
54
|
+
keyring.setApiKey("YOUR-API-KEY");
|
|
55
55
|
|
|
56
56
|
const map = new GeoloniaMap({
|
|
57
57
|
container: "#map",
|
|
@@ -108,6 +108,29 @@ The `data-style` attribute accepts:
|
|
|
108
108
|
- **Relative paths**: `./custom-style.json`, `/styles/my-style.json`
|
|
109
109
|
- **Files ending in .json**: Automatically resolved to absolute URLs
|
|
110
110
|
|
|
111
|
+
#### data-lang attribute
|
|
112
|
+
|
|
113
|
+
The `data-lang` attribute controls the language of map labels:
|
|
114
|
+
|
|
115
|
+
- `ja` — Japanese labels
|
|
116
|
+
- `en` (or any other non-Japanese value) — English labels
|
|
117
|
+
- `auto` — follow the browser language (`navigator.languages`)
|
|
118
|
+
- **omitted** — same as `auto` (follows the browser language)
|
|
119
|
+
|
|
120
|
+
Only `ja` / `ja-jp` resolve to Japanese; every other value resolves to English.
|
|
121
|
+
|
|
122
|
+
**Important:** when neither `data-lang` nor `lang` is specified, the language follows the browser setting. On a non-Japanese browser this loads the English style (`en.json`). Set it explicitly to force a language:
|
|
123
|
+
|
|
124
|
+
```html
|
|
125
|
+
<div class="geolonia" data-lang="ja" ...></div>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
When using the JavaScript API (`new GeoloniaMap({...})`), pass `lang` in the options instead of a `data-lang` attribute:
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
const map = new GeoloniaMap({ container: "#map", lang: "ja" });
|
|
132
|
+
```
|
|
133
|
+
|
|
111
134
|
You can see more examples at [https://geolonia.github.io/embed/](https://geolonia.github.io/embed/).
|
|
112
135
|
|
|
113
136
|
# Contributing
|