@geolonia/embed 5.2.2 → 5.2.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.
@@ -5,10 +5,12 @@ name: build
5
5
 
6
6
  on:
7
7
  push:
8
- branches: [master]
8
+ # v5 は LTS なので GitHub Actions でリリースする。
9
+ # maintenance/v1 は手動リリースに移行したため、意図的に含めていない。
10
+ branches: [master, maintenance/v5]
9
11
  tags: ['*']
10
12
  pull_request:
11
- branches: [master]
13
+ branches: [master, maintenance/v5]
12
14
 
13
15
  jobs:
14
16
  act-test:
@@ -79,6 +81,33 @@ jobs:
79
81
  git commit -m "Deploy" > /dev/null 2>&1
80
82
  git push --force origin gh-pages
81
83
 
84
+ check-tag:
85
+ name: 'Check the tag belongs to v5'
86
+ runs-on: ubuntu-latest
87
+ permissions:
88
+ contents: read
89
+ if: startsWith(github.ref, 'refs/tags/v')
90
+ steps:
91
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
92
+ with:
93
+ persist-credentials: false
94
+ # maintenance/v5 は v5.x のタグだけを公開・配信する。npm の公開と S3 への配信の両方がこのジョブを待つ。
95
+ # タグの版が package.json の版と違うまま公開・配信しないことも確かめる。
96
+ - name: 'Check the tag'
97
+ env:
98
+ REF_NAME: ${{ github.ref_name }}
99
+ run: |
100
+ # v5 はメンテナンスモードなので、v5.X.Y 形式のタグだけを受け付ける (-pre. などの付いたタグは受け付けない)。
101
+ if ! printf '%s' "$REF_NAME" | grep -Eq '^v5\.[0-9]+\.[0-9]+$'; then
102
+ echo "maintenance/v5 only publishes v5.X.Y tags: $REF_NAME" >&2
103
+ exit 1
104
+ fi
105
+ PKG_VERSION=$(node -p "require('./package.json').version")
106
+ if [ "${REF_NAME#v}" != "$PKG_VERSION" ]; then
107
+ echo "The tag $REF_NAME does not match package.json version $PKG_VERSION" >&2
108
+ exit 1
109
+ fi
110
+
82
111
  publish:
83
112
  name: 'Publish npm package'
84
113
  runs-on: ubuntu-latest
@@ -88,6 +117,7 @@ jobs:
88
117
  needs:
89
118
  - build
90
119
  - act-test
120
+ - check-tag
91
121
  if: startsWith(github.ref, 'refs/tags/v')
92
122
  steps:
93
123
  - uses: actions/checkout@v6
@@ -104,16 +134,15 @@ jobs:
104
134
  - name: Update npm
105
135
  run: npm install -g npm@latest
106
136
 
107
- - name: 'Publish to NPM (latest)'
108
- if: "!contains(github.ref, '-pre.')"
109
- run: npm publish --access=public
110
-
111
- - name: 'Publish to NPM (next)'
112
- if: "contains(github.ref, '-pre.')"
113
- run: npm publish --access=public --tag=next
137
+ # v6 が npm の `latest` を使っているため、v5 の版は `latest` を動かさない別の dist-tag (`latest-5`) で公開する。
138
+ # `--tag` なしの `npm publish` は公開した版を `latest` にしてしまう。
139
+ - name: 'Publish to NPM (latest-5)'
140
+ run: npm publish --access=public --tag=latest-5
114
141
 
115
142
  deploy:
116
- needs: build
143
+ needs:
144
+ - build
145
+ - check-tag
117
146
  runs-on: ubuntu-latest
118
147
  if: startsWith(github.ref, 'refs/tags/v')
119
148
 
package/CHANGELOG.md CHANGED
@@ -2,8 +2,16 @@
2
2
 
3
3
  ## @geolonia/embed
4
4
 
5
+ ### v5.2.3
6
+
7
+ - **Security**: Fixed the attribution control rendering attribution HTML without sanitizing it, and updated `maplibre-gl` to 5.24.1, which fixes the `DOM.sanitize()` bypass (GHSA-jrc7-96c5-q579 / CVE-2026-85061). Attribution is now filtered with an allow list of tags and attributes: elements outside the list (for example `<font>`) are removed together with their content, and attributes such as `style` and `on*` are removed ([#576](https://github.com/geolonia/embed/issues/576)).
8
+
5
9
  ### nightly
6
10
 
11
+ - **Improvement**: The message shown when the map fails to initialize (typically no WebGL) now tells the visitor what to try (restart the browser, restart the device, try another browser, update the graphics driver, contact the site owner). The developer-tools sentence was removed, and the message is shortened automatically on small map containers.
12
+ - **Feature**: `data-error-message` (`errorMessage` in the programmatic API) replaces that message with your own text, or disables the error display entirely with `off` (`false` in the programmatic API). The value is rendered as plain text.
13
+ - **Fix**: The loading animation is now removed when the map fails to initialize.
14
+
7
15
  - **Feature**: Added support for external style.json URLs in `data-style` attribute
8
16
  - You can now specify full URLs: `data-style="https://tile.openstreetmap.jp/styles/osm-bright/style.json"`
9
17
  - Relative paths are also supported: `data-style="./custom-style.json"`
package/README.md CHANGED
@@ -110,6 +110,33 @@ The `data-style` attribute accepts:
110
110
 
111
111
  You can see more examples at [https://geolonia.github.io/embed/](https://geolonia.github.io/embed/).
112
112
 
113
+ ### Error message when the map fails to initialize
114
+
115
+ When the map cannot be initialized (typically because WebGL is unavailable on the
116
+ device), the embed replaces the map with a message that tells the visitor what to
117
+ try: restart the browser, restart the device, try another browser, update the
118
+ graphics driver, and contact the site owner if it still fails. The message shrinks
119
+ to a shorter version, and finally to the headline alone, as the map container gets
120
+ smaller.
121
+
122
+ Use `data-error-message` to take over that message:
123
+
124
+ ```html
125
+ <!-- Replace the wording -->
126
+ <div
127
+ class="geolonia"
128
+ data-error-message="Sorry, the map is unavailable. Please call 0120-000-000."
129
+ ></div>
130
+
131
+ <!-- Show nothing at all, e.g. when the site renders its own fallback -->
132
+ <div class="geolonia" data-error-message="off"></div>
133
+ ```
134
+
135
+ The value is rendered as plain text; HTML is not interpreted. The same option is
136
+ available to the programmatic API as `errorMessage`, which also accepts `false`
137
+ to disable the error display.
138
+
139
+
113
140
  # Contributing
114
141
 
115
142
  ## Development