Compare commits

...

4 Commits

Author SHA1 Message Date
dependabot[bot]
0b1c709fc3 chore(deps): Bump cypress-io/github-action from 7.1.10 to 7.2.0
Bumps [cypress-io/github-action](https://github.com/cypress-io/github-action) from 7.1.10 to 7.2.0.
- [Release notes](https://github.com/cypress-io/github-action/releases)
- [Changelog](https://github.com/cypress-io/github-action/blob/master/CHANGELOG.md)
- [Commits](c495c3ddff...b7a7441d77)

---
updated-dependencies:
- dependency-name: cypress-io/github-action
  dependency-version: 7.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-07 13:49:51 +00:00
dependabot[bot]
5862d81a81 chore(deps): Bump actions/setup-go from 6.3.0 to 6.4.0 (#1767)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.3.0
to 6.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/setup-go/releases">actions/setup-go's
releases</a>.</em></p>
<blockquote>
<h2>v6.4.0</h2>
<h2>What's Changed</h2>
<h3>Enhancement</h3>
<ul>
<li>Add go-download-base-url input for custom Go distributions by <a
href="https://github.com/gdams"><code>@​gdams</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/721">actions/setup-go#721</a></li>
</ul>
<h3>Dependency update</h3>
<ul>
<li>Upgrade minimatch from 3.1.2 to 3.1.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/727">actions/setup-go#727</a></li>
</ul>
<h3>Documentation update</h3>
<ul>
<li>Rearrange README.md, add advanced-usage.md by <a
href="https://github.com/priyagupta108"><code>@​priyagupta108</code></a>
in <a
href="https://redirect.github.com/actions/setup-go/pull/724">actions/setup-go#724</a></li>
<li>Fix Microsoft build of Go link by <a
href="https://github.com/gdams"><code>@​gdams</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/734">actions/setup-go#734</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/gdams"><code>@​gdams</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/setup-go/pull/721">actions/setup-go#721</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/setup-go/compare/v6...v6.4.0">https://github.com/actions/setup-go/compare/v6...v6.4.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4a3601121d"><code>4a36011</code></a>
docs: fix Microsoft build of Go link (<a
href="https://redirect.github.com/actions/setup-go/issues/734">#734</a>)</li>
<li><a
href="8f19afcc70"><code>8f19afc</code></a>
feat: add go-download-base-url input for custom Go distributions (<a
href="https://redirect.github.com/actions/setup-go/issues/721">#721</a>)</li>
<li><a
href="27fdb267c1"><code>27fdb26</code></a>
Bump minimatch from 3.1.2 to 3.1.5 (<a
href="https://redirect.github.com/actions/setup-go/issues/727">#727</a>)</li>
<li><a
href="def8c394e3"><code>def8c39</code></a>
Rearrange README.md, add advanced-usage.md (<a
href="https://redirect.github.com/actions/setup-go/issues/724">#724</a>)</li>
<li>See full diff in <a
href="4b73464bb3...4a3601121d">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-go&package-manager=github_actions&previous-version=6.3.0&new-version=6.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-06 17:12:36 +03:00
dependabot[bot]
58c84f510b chore(deps): Bump @maplibre/maplibre-gl-style-spec from 24.8.4 to 24.8.5 (#1862)
Bumps
[@maplibre/maplibre-gl-style-spec](https://github.com/maplibre/maplibre-style-spec)
from 24.8.4 to 24.8.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/maplibre/maplibre-style-spec/releases">@​maplibre/maplibre-gl-style-spec's
releases</a>.</em></p>
<blockquote>
<h2>v24.8.5</h2>
<h3>🐞 Bug fixes</h3>
<ul>
<li>Added missing exported types (<a
href="https://redirect.github.com/maplibre/maplibre-style-spec/pull/1638">#1638</a>)
(by <a
href="https://github.com/scottg521"><code>@​scottg521</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/maplibre/maplibre-style-spec/blob/main/CHANGELOG.md">@​maplibre/maplibre-gl-style-spec's
changelog</a>.</em></p>
<blockquote>
<h2>24.8.5</h2>
<h3>🐞 Bug fixes</h3>
<ul>
<li>Added missing exported types (<a
href="https://redirect.github.com/maplibre/maplibre-style-spec/pull/1638">#1638</a>)
(by <a
href="https://github.com/scottg521"><code>@​scottg521</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="52a69cae43"><code>52a69ca</code></a>
Bump js version to 24.8.5 (<a
href="https://redirect.github.com/maplibre/maplibre-style-spec/issues/1639">#1639</a>)</li>
<li><a
href="c9501632a8"><code>c950163</code></a>
add missing imports and exports to index.ts (<a
href="https://redirect.github.com/maplibre/maplibre-style-spec/issues/1638">#1638</a>)</li>
<li>See full diff in <a
href="https://github.com/maplibre/maplibre-style-spec/compare/v24.8.4...v24.8.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@maplibre/maplibre-gl-style-spec&package-manager=npm_and_yarn&previous-version=24.8.4&new-version=24.8.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-06 17:12:09 +03:00
Kanish Jeba Mathew M
93596b3540 feat: add drag and drop support to Upload Style area (#1852)
## Feat: Add drag and drop support to Upload Style area

Closes #911

---

### Problem
The Upload Style area only supported click-to-upload. Users could not
drag and drop a JSON file directly onto it.

### Fix
Added `onDragOver` and `onDrop` event handlers to the Upload Style area.
The dropped file is passed to the existing file reading logic already
used by the Upload button. A visual highlight is shown when dragging
over the area.
2026-05-06 17:11:17 +03:00
18 changed files with 154 additions and 33 deletions

View File

@@ -56,7 +56,7 @@ jobs:
# Build and upload desktop CLI artifacts
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ^1.23.x
cache-dependency-path: desktop/go.sum
@@ -118,7 +118,7 @@ jobs:
node-version-file: '.nvmrc'
- run: npm ci
- name: Cypress run
uses: cypress-io/github-action@c495c3ddffba403ba11be95fffb67e25203b3799 # v7.1.10
uses: cypress-io/github-action@b7a7441d775af8f8b9d19945c10dd689a51dba68 # v7.2.0
with:
build: npm run build
start: npm run start
@@ -142,7 +142,7 @@ jobs:
node-version-file: '.nvmrc'
- run: npm ci
- name: Cypress run
uses: cypress-io/github-action@c495c3ddffba403ba11be95fffb67e25203b3799 # v7.1.10
uses: cypress-io/github-action@b7a7441d775af8f8b9d19945c10dd689a51dba68 # v7.2.0
with:
build: docker build -t maputnik .
start: docker run --rm --network host maputnik --port=8888

View File

@@ -54,7 +54,7 @@ jobs:
registry-url: "https://registry.npmjs.org"
- name: Set up Go for desktop build
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ^1.23.x
cache-dependency-path: desktop/go.sum

View File

@@ -18,6 +18,7 @@
### 🐞 Bug fixes
- Improved the local style open modal and local file upload.
- Fixed the Expression editor (for long expressions) being able to be float under other components further down
- Fixed an issue when clicking on a popup and then clicking on the map again
- Fix modal close button position

View File

@@ -43,6 +43,12 @@ export default class MaputnikCypressHelper {
}
});
},
dropFileByFixture: (fixture: string, dropzoneTestId: string) => {
this.helper.get.elementByTestId(dropzoneTestId).selectFile("cypress/fixtures/" + fixture, {
action: "drag-drop",
force: true,
});
},
...this.helper.when,
};

View File

@@ -143,7 +143,12 @@ export class MaputnikDriver {
},
chooseExampleFile: () => {
this.helper.given.fixture("example-style.json", "example-style.json");
this.helper.when.openFileByFixture("example-style.json", "modal:open.file.button", "modal:open.file.input");
this.helper.when.openFileByFixture("example-style.json", "modal:open.dropzone", "modal:open.file.input");
this.helper.when.wait(200);
},
dropExampleFile: () => {
this.helper.given.fixture("example-style.json", "example-style.json");
this.helper.when.dropFileByFixture("example-style.json", "modal:open.dropzone");
this.helper.when.wait(200);
},
setStyle: (

View File

@@ -23,6 +23,11 @@ describe("modals", () => {
then(get.fixture("example-style.json")).shouldEqualToStoredStyle();
});
it("upload via drag and drop", () => {
when.dropExampleFile();
then(get.fixture("example-style.json")).shouldEqualToStoredStyle();
});
describe("when click open url", () => {
beforeEach(() => {
const styleFileUrl = get.exampleFileUrl();

8
package-lock.json generated
View File

@@ -20,7 +20,7 @@
"@mapbox/mapbox-gl-rtl-text": "^0.4.0",
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
"@maplibre/maplibre-gl-inspect": "^1.8.2",
"@maplibre/maplibre-gl-style-spec": "^24.8.4",
"@maplibre/maplibre-gl-style-spec": "^24.8.5",
"array-move": "^4.0.0",
"buffer": "^6.0.3",
"classnames": "^2.5.1",
@@ -2033,9 +2033,9 @@
}
},
"node_modules/@maplibre/maplibre-gl-style-spec": {
"version": "24.8.4",
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-24.8.4.tgz",
"integrity": "sha512-kvtUcthzQGn7nzwiwIggB7lzHbXIprMboLdsem8yNCRIZluyxs7aNzvMHgmdl/lAuX8bkGrSUMiy/lIBysajmg==",
"version": "24.8.5",
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-24.8.5.tgz",
"integrity": "sha512-EzEJmMt6thioRH7GI9LWS7ahXTcAhAPGWCe6oTP2Ps4YnsXOOAfeqx854lZaiDnwURfHmcCKV1mr6oo0i23x6w==",
"license": "ISC",
"dependencies": {
"@mapbox/jsonlint-lines-primitives": "~2.0.2",

View File

@@ -37,7 +37,7 @@
"@mapbox/mapbox-gl-rtl-text": "^0.4.0",
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
"@maplibre/maplibre-gl-inspect": "^1.8.2",
"@maplibre/maplibre-gl-style-spec": "^24.8.4",
"@maplibre/maplibre-gl-style-spec": "^24.8.5",
"array-move": "^4.0.0",
"buffer": "^6.0.3",
"classnames": "^2.5.1",

View File

@@ -1,4 +1,4 @@
import React, { type FormEvent } from "react";
import React, { type DragEvent, type FormEvent } from "react";
import { MdFileUpload } from "react-icons/md";
import { MdAddCircleOutline } from "react-icons/md";
import { Trans, type WithTranslation, withTranslation } from "react-i18next";
@@ -51,16 +51,20 @@ type ModalOpenInternalProps = {
type ModalOpenState = {
styleUrl: string
isDragOver: boolean
error?: string | null
activeRequest?: any
activeRequestUrl?: string | null
};
class ModalOpenInternal extends React.Component<ModalOpenInternalProps, ModalOpenState> {
private fileInputRef = React.createRef<HTMLInputElement>();
constructor(props: ModalOpenInternalProps) {
super(props);
this.state = {
styleUrl: ""
styleUrl: "",
isDragOver: false,
};
}
@@ -198,12 +202,45 @@ class ModalOpenInternal extends React.Component<ModalOpenInternalProps, ModalOpe
onOpenToggle() {
this.setState({
styleUrl: ""
styleUrl: "",
isDragOver: false,
});
this.clearError();
this.props.onOpenToggle();
}
onBrowseClick = async () => {
if (typeof window.showOpenFilePicker === "function") {
await this.onOpenFile();
return;
}
this.fileInputRef.current?.click();
};
onFileDragOver = (e: DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
if (!this.state.isDragOver) {
this.setState({ isDragOver: true });
}
};
onFileDragLeave = (e: DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
this.setState({ isDragOver: false });
};
onFileDrop = (e: DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
this.setState({ isDragOver: false });
this.onFileChanged(e.dataTransfer.files);
};
onChangeUrl = (url: string) => {
this.setState({
styleUrl: url,
@@ -244,19 +281,35 @@ class ModalOpenInternal extends React.Component<ModalOpenInternalProps, ModalOpe
<section className="maputnik-modal-section">
<h1>{t("Open local Style")}</h1>
<p>{t("Open a local JSON style from your computer.")}</p>
<div>
{typeof window.showOpenFilePicker === "function" ? (
<InputButton
data-wd-key="modal:open.file.button"
className="maputnik-big-button"
onClick={this.onOpenFile}><MdFileUpload /> {t("Open Style")}
</InputButton>
) : (
<label>
<a className="maputnik-button maputnik-upload-button" aria-label={t("Open Style")}><MdFileUpload /> {t("Open Style")}</a>
<input data-wd-key="modal:open.file.input" type="file" style={{ display: "none" }} onChange={(e) => this.onFileChanged(e.target.files)} />
</label>
)}
<div
data-wd-key="modal:open.dropzone"
className={`maputnik-upload-dropzone${this.state.isDragOver ? " maputnik-upload-dropzone--active" : ""}`}
role="button"
tabIndex={0}
onDragOver={this.onFileDragOver}
onDragLeave={this.onFileDragLeave}
onDrop={this.onFileDrop}
onClick={() => void this.onBrowseClick()}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
void this.onBrowseClick();
}
}}
>
<div className="maputnik-upload-dropzone-content">
<MdFileUpload className="maputnik-upload-dropzone-icon" aria-hidden="true" />
<p className="maputnik-upload-dropzone-text">
{t("Drag and drop a style JSON file here or click to browse")}
</p>
</div>
<input
ref={this.fileInputRef}
data-wd-key="modal:open.file.input"
type="file"
style={{ display: "none" }}
onChange={(e) => this.onFileChanged(e.target.files)}
/>
</div>
</section>

View File

@@ -199,5 +199,6 @@
"Video URL": "Video-URL",
"View": "Ansicht",
"You've entered an old style filter.": "Du hast einen alten Filter-Stil eingegeben.",
"Zoom": "Zoom"
"Zoom": "Zoom",
"Drag and drop a style JSON file here or click to browse": "Ziehen Sie eine Style-JSON-Datei hierher oder klicken Sie, um zu durchsuchen"
}

View File

@@ -0,0 +1,3 @@
{
"Drag and drop a style JSON file here or click to browse": "Drag and drop a style JSON file here or click to browse"
}

View File

@@ -199,5 +199,6 @@
"Video URL": "URL de la vidéo",
"View": "Vue",
"You've entered an old style filter.": "Vous avez entré un ancien style de filtre.",
"Zoom": "Zoom"
"Zoom": "Zoom",
"Drag and drop a style JSON file here or click to browse": "Faites glisser un fichier JSON de style ici ou cliquez pour parcourir"
}

View File

@@ -199,5 +199,6 @@
"Video URL": "כתובת וידאו",
"View": "תצוגה",
"You've entered an old style filter.": "הכנסתם סינון מסוג ישן,",
"Zoom": "זום"
"Zoom": "זום",
"Drag and drop a style JSON file here or click to browse": "גרור ושחרר כאן קובץ JSON של סגנון או לחץ כדי לעיין"
}

View File

@@ -199,5 +199,6 @@
"Video URL": "Indirizzo video",
"View": "Vista",
"You've entered an old style filter.": "Hai inserito uno stile filtro obsoleto.",
"Zoom": "Zoom"
"Zoom": "Zoom",
"Drag and drop a style JSON file here or click to browse": "Trascina e rilascia qui un file JSON dello stile o fai clic per sfogliare"
}

View File

@@ -199,5 +199,6 @@
"Video URL": "動画URL",
"View": "表示",
"You've entered an old style filter.": "旧型フィルタを使用しております。",
"Zoom": "ズーム"
"Zoom": "ズーム",
"Drag and drop a style JSON file here or click to browse": "ここにスタイルのJSONファイルをドラッグドロップするか、クリックして参照してください"
}

View File

@@ -199,5 +199,6 @@
"Video URL": "비디오 URL",
"View": "보기",
"You've entered an old style filter.": "이전 스타일 필터를 입력했습니다.",
"Zoom": "줌"
"Zoom": "줌",
"Drag and drop a style JSON file here or click to browse": "여기에 스타일 JSON 파일을 끌어다 놓거나 클릭하여 찾아보세요"
}

View File

@@ -199,5 +199,6 @@
"Video URL": "视频URL",
"View": "视图",
"You've entered an old style filter.": "您输入了一个旧风格的过滤器。",
"Zoom": "缩放"
"Zoom": "缩放",
"Drag and drop a style JSON file here or click to browse": "将样式 JSON 文件拖放到此处或点击以浏览"
}

View File

@@ -88,6 +88,47 @@
@extend .maputnik-big-button !optional; /* stylelint-disable-line */
}
.maputnik-upload-dropzone {
border: 2px dashed vars.$color-midgray;
border-radius: 6px;
padding: vars.$margin-4 vars.$margin-3;
text-align: center;
cursor: pointer;
transition: border-color 120ms ease, background-color 120ms ease;
&:hover,
&:focus-visible {
border-color: vars.$color-lowgray;
background-color: rgba(255, 255, 255, 0.03);
}
&:focus-visible {
outline: 2px solid vars.$color-lowgray;
outline-offset: 2px;
}
}
.maputnik-upload-dropzone--active {
border-color: vars.$color-lowgray;
background-color: rgba(255, 255, 255, 0.04);
}
.maputnik-upload-dropzone-content {
display: flex;
flex-direction: column;
align-items: center;
}
.maputnik-upload-dropzone-icon {
font-size: 28px;
color: vars.$color-midgray;
}
.maputnik-upload-dropzone-text {
margin: vars.$margin-2 0 0;
color: vars.$color-lowgray;
}
.maputnik-style-gallery-container {
flex-shrink: 1;
}