@maplat/ui 0.11.5 → 0.11.7
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/README.ja.md +204 -0
- package/README.md +154 -76
- package/dist/maplat-ui.es.js +43836 -13527
- package/dist/maplat-ui.umd.js +305 -273
- package/dist/service-worker.js +3348 -0
- package/package.json +6 -6
- package/src/index.ts +1 -1
- package/src/styles/ui.scss +7 -0
- package/src/ui_init.ts +5 -1
- package/src/ui_marker.ts +11 -12
- package/less/bootstrap.less +0 -7010
- package/less/font-awesome.less +0 -51
- package/less/iziToast.less +0 -1733
- package/less/swiper4.css +0 -715
- package/less/ui.less +0 -11
- package/less/ui_packed.less +0 -11
- /package/{less/contextmenu.css → src/styles/contextmenu.scss} +0 -0
- /package/{less/maplat-specific.less → src/styles/maplat-specific.scss} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maplat/ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"description": "Maplat is the cool Historical Map/Illustrated Map Viewer.\nIt can transform each map coordinates with nonlinear but homeomorphic projection and makes possible that the maps can collaborate with GPS/accurate maps, without distorting original maps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/maplat-ui.umd.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"pnpm": ">=9.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@c4h/chuci": "0.2.
|
|
38
|
-
"@c4h/weiwudi": "^0.2.
|
|
39
|
-
"@maplat/core": "0.12.
|
|
37
|
+
"@c4h/chuci": "0.2.5",
|
|
38
|
+
"@c4h/weiwudi": "^0.2.1",
|
|
39
|
+
"@maplat/core": "0.12.4",
|
|
40
40
|
"@turf/turf": "^7.3.1",
|
|
41
41
|
"@types/page": "^1.11.9",
|
|
42
42
|
"bootstrap.native": "^5.1.6",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@types/node": "^20.19.27",
|
|
60
60
|
"@types/ol": "^6.5.3",
|
|
61
61
|
"@types/qrcode": "^1.5.6",
|
|
62
|
+
"bootstrap-sass": "^3.4.3",
|
|
62
63
|
"concurrently": "^9.2.1",
|
|
63
64
|
"cross-env": "^10.1.0",
|
|
64
65
|
"esbuild": "^0.27.2",
|
|
@@ -66,7 +67,6 @@
|
|
|
66
67
|
"eslint-config-prettier": "^9.1.2",
|
|
67
68
|
"globals": "^16.5.0",
|
|
68
69
|
"jsdom": "^24.1.3",
|
|
69
|
-
"less": "^4.5.1",
|
|
70
70
|
"ol": "^10.7.0",
|
|
71
71
|
"prettier": "^3.7.4",
|
|
72
72
|
"typescript": "^5.9.3",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"dev": "concurrently \"pnpm watch:sw\" \"vite --host\"",
|
|
82
82
|
"build:sw": "esbuild src/service-worker/index.ts --bundle --outfile=dist/service-worker.js --format=iife --define:self.__WB_MANIFEST=[] && node -e \"require('fs').copyFileSync('dist/service-worker.js', 'public/service-worker.js')\"",
|
|
83
83
|
"watch:sw": "esbuild src/service-worker/index.ts --bundle --outfile=public/service-worker.js --format=iife --define:self.__WB_MANIFEST=[] --watch",
|
|
84
|
-
"build": "
|
|
84
|
+
"build": "cross-env BUILD_MODE=package tsc && cross-env BUILD_MODE=package vite build && pnpm build:sw",
|
|
85
85
|
"build:demo": "pnpm build:sw && vite build",
|
|
86
86
|
"preview": "vite preview",
|
|
87
87
|
"test": "vitest",
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Navigation, Pagination } from "swiper";
|
|
|
8
8
|
import "swiper/swiper-bundle.css";
|
|
9
9
|
import page from "page";
|
|
10
10
|
import * as bsn from "bootstrap.native";
|
|
11
|
-
import "
|
|
11
|
+
import "./styles/ui.scss";
|
|
12
12
|
|
|
13
13
|
import { uiInit } from "./ui_init";
|
|
14
14
|
import {
|
package/src/ui_init.ts
CHANGED
|
@@ -974,8 +974,12 @@ function initModalHandlers(ui: MaplatUi, appOption: MaplatAppOption) {
|
|
|
974
974
|
const fileName = (val as string)
|
|
975
975
|
.toLowerCase()
|
|
976
976
|
.replace(/ /g, "_");
|
|
977
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
978
|
+
const iconUrl =
|
|
979
|
+
(pointer as any)[`${fileName}.png`] ||
|
|
980
|
+
`assets/parts/${fileName}.png`;
|
|
977
981
|
(contentEl as HTMLElement).innerHTML =
|
|
978
|
-
`<img src="
|
|
982
|
+
`<img src="${iconUrl}" class="license" />`;
|
|
979
983
|
} else {
|
|
980
984
|
(contentEl as HTMLElement).innerHTML =
|
|
981
985
|
ui.core!.translate(val) || "";
|
package/src/ui_marker.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { createElement } from "@maplat/core";
|
|
|
2
2
|
|
|
3
3
|
// import { Swiper } from "./swiper_ex";
|
|
4
4
|
import "@c4h/chuci";
|
|
5
|
+
import QRCode from "qrcode";
|
|
5
6
|
import { point, polygon, booleanPointInPolygon } from "@turf/turf";
|
|
6
7
|
import { resolveRelativeLink, prepareModal } from "./ui_utils";
|
|
7
8
|
|
|
@@ -166,19 +167,17 @@ export function poiWebControl(
|
|
|
166
167
|
|
|
167
168
|
// Auto-generate QR code
|
|
168
169
|
if (qrDiv) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
(err
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
qrDiv.appendChild(canvas);
|
|
178
|
-
}
|
|
170
|
+
QRCode.toCanvas(
|
|
171
|
+
window.location.href,
|
|
172
|
+
{ width: 128, margin: 1 },
|
|
173
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
|
+
(err: any, canvas: any) => {
|
|
175
|
+
if (!err) {
|
|
176
|
+
qrDiv.innerHTML = "";
|
|
177
|
+
qrDiv.appendChild(canvas);
|
|
179
178
|
}
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
}
|
|
180
|
+
);
|
|
182
181
|
}
|
|
183
182
|
} else {
|
|
184
183
|
shareButtons?.classList.add("hide");
|