@mapxus/mapxus-map-jp 9.3.0 → 10.0.1
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.md +13 -13
- package/dist/index.css +1 -1
- package/dist/index.umd.js +2 -19
- package/dist/mapxus-map-10.0.1-jp.css +0 -0
- package/dist/mapxus-map-10.0.1-jp.js +0 -0
- package/dist/utils.cjs +1 -13
- package/es/index.d.ts +1121 -1167
- package/es/index.mjs +2320 -4472
- package/es/languages-D7yV3lDz.mjs +110 -0
- package/es/style.d.ts +1 -1
- package/es/utils/index.d.ts +0 -53
- package/es/utils/index.mjs +17 -33
- package/package.json +3 -6
- package/es/context-DqAvnxfX.mjs +0 -8301
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { dispatch as a } from "d3-dispatch";
|
|
2
|
+
import { HTTPSession as c, SDKName as o, base64Encode as I, reportLog as l } from "@mapxus/mapxus-auth-jp";
|
|
3
|
+
const S = "10.0.1", E = {
|
|
4
|
+
version: S
|
|
5
|
+
}, h = E.version, p = "https://map-api.mapxus.co.jp/bms", K = 10, L = 1, G = "api/v5/venues", $ = "api/v5/buildings", B = "api/v5/pois", P = "api/v5/categories/group", U = "api/v4/route/query", z = "api/v3/tiles/styles";
|
|
6
|
+
class e {
|
|
7
|
+
static instance;
|
|
8
|
+
_globalDispatcher;
|
|
9
|
+
_httpSession;
|
|
10
|
+
_theme = null;
|
|
11
|
+
_isSDKInitialized = !1;
|
|
12
|
+
constructor() {
|
|
13
|
+
}
|
|
14
|
+
static getInstance() {
|
|
15
|
+
return e.instance || (e.instance = new e()), e.instance;
|
|
16
|
+
}
|
|
17
|
+
setGlobalDispatcher(t) {
|
|
18
|
+
this._globalDispatcher = t;
|
|
19
|
+
}
|
|
20
|
+
getGlobalDispatcher() {
|
|
21
|
+
return this._globalDispatcher;
|
|
22
|
+
}
|
|
23
|
+
async getHttpSession() {
|
|
24
|
+
return this._httpSession || (this.registerSDK(), this._httpSession = await c.create(
|
|
25
|
+
o.MapSDK,
|
|
26
|
+
I(`version-${h}`)
|
|
27
|
+
), this._httpSession.setBaseURL(p), this._httpSession.setRetryConfig(3)), this._httpSession;
|
|
28
|
+
}
|
|
29
|
+
registerSDK() {
|
|
30
|
+
this._isSDKInitialized || (this._isSDKInitialized = !0, l(`${o.MapSDK} initialized`));
|
|
31
|
+
}
|
|
32
|
+
get theme() {
|
|
33
|
+
return this._theme;
|
|
34
|
+
}
|
|
35
|
+
setTheme(t) {
|
|
36
|
+
this._theme = t;
|
|
37
|
+
}
|
|
38
|
+
clear() {
|
|
39
|
+
this._httpSession.destroy(), this._globalDispatcher = null, e.instance = null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const A = ["unauthorized", "initError"], n = globalThis, r = a(...A);
|
|
43
|
+
e.getInstance().setGlobalDispatcher(r);
|
|
44
|
+
n.MapxusMapEvents = n.MapxusMapEvents || {};
|
|
45
|
+
n.MapxusMapEvents.on = function(s, t) {
|
|
46
|
+
return r.on(s, t), { off: () => r.on(s, null) };
|
|
47
|
+
};
|
|
48
|
+
const C = "reserve_mapxus-level-fill", F = "reserve_mapxus-shared-level-fill", V = "reserve_mapxus-building-fill";
|
|
49
|
+
var i = /* @__PURE__ */ ((s) => (s.ENGLISH = "en", s.CHINESE_SIMPLIFIED = "zh-Hans", s.CHINESE_TRADITIONAL = "zh-Hant", s.CHINESE_TRADITIONAL_TW = "zh-Hant-TW", s.JAPANESE = "ja", s.KOREAN = "ko", s.FILIPINO = "fil", s.INDONESIAN = "id", s.PORTUGUESE = "pt", s.THAI = "th", s.VIETNAMESE = "vi", s.ARABIC = "ar", s))(i || {});
|
|
50
|
+
function Y(s) {
|
|
51
|
+
let t = null;
|
|
52
|
+
return f(s) ? t = i.ENGLISH : T(s) ? t = i.CHINESE_SIMPLIFIED : _(s) ? t = i.CHINESE_TRADITIONAL : N(s) ? t = i.CHINESE_TRADITIONAL_TW : u(s) ? t = i.JAPANESE : D(s) ? t = i.KOREAN : O(s) ? t = i.FILIPINO : R(s) ? t = i.INDONESIAN : H(s) ? t = i.PORTUGUESE : v(s) ? t = i.THAI : d(s) ? t = i.VIETNAMESE : m(s) && (t = i.ARABIC), t;
|
|
53
|
+
}
|
|
54
|
+
function f(s) {
|
|
55
|
+
return /^en(-(US|GB|AU))?$/.test(s);
|
|
56
|
+
}
|
|
57
|
+
function T(s) {
|
|
58
|
+
return /^zh(-(Hans|CN))?$/.test(s);
|
|
59
|
+
}
|
|
60
|
+
function _(s) {
|
|
61
|
+
return /^zh-(Hant|HK|MO)$/.test(s);
|
|
62
|
+
}
|
|
63
|
+
function N(s) {
|
|
64
|
+
return s === "zh-TW";
|
|
65
|
+
}
|
|
66
|
+
function u(s) {
|
|
67
|
+
return /^ja(-JP)?$/.test(s);
|
|
68
|
+
}
|
|
69
|
+
function D(s) {
|
|
70
|
+
return /^ko(-KR)?$/.test(s);
|
|
71
|
+
}
|
|
72
|
+
function O(s) {
|
|
73
|
+
return /^(fil|tl)(-PH)?$/.test(s);
|
|
74
|
+
}
|
|
75
|
+
function R(s) {
|
|
76
|
+
return /^id(-ID)?$/.test(s);
|
|
77
|
+
}
|
|
78
|
+
function H(s) {
|
|
79
|
+
return /^pt(-(BR|PT))?$/.test(s);
|
|
80
|
+
}
|
|
81
|
+
function v(s) {
|
|
82
|
+
return /^th(-TH)?$/.test(s);
|
|
83
|
+
}
|
|
84
|
+
function d(s) {
|
|
85
|
+
return /^vi(-VN)?$/.test(s);
|
|
86
|
+
}
|
|
87
|
+
function m(s) {
|
|
88
|
+
return /^ar(-(DZ|BH|EG|IQ|JO|KW|LB|LY|MA|OM|QA|SA|SY|TN|AE|YE))?$/.test(
|
|
89
|
+
s
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
C as A,
|
|
94
|
+
$ as B,
|
|
95
|
+
e as C,
|
|
96
|
+
A as E,
|
|
97
|
+
K as O,
|
|
98
|
+
i as P,
|
|
99
|
+
U as R,
|
|
100
|
+
z as S,
|
|
101
|
+
G as V,
|
|
102
|
+
B as a,
|
|
103
|
+
L as b,
|
|
104
|
+
Y as c,
|
|
105
|
+
P as d,
|
|
106
|
+
F as e,
|
|
107
|
+
V as f,
|
|
108
|
+
p as g,
|
|
109
|
+
h
|
|
110
|
+
};
|
package/es/style.d.ts
CHANGED
package/es/utils/index.d.ts
CHANGED
|
@@ -26,55 +26,8 @@ declare enum PresetLanguage {
|
|
|
26
26
|
* @param language {string} window.navigator.language
|
|
27
27
|
*/
|
|
28
28
|
export declare function convertBrowserLangToPresetLang(language: string): PresetLanguage | null;
|
|
29
|
-
export interface IPlatformCommon {
|
|
30
|
-
sdkVersion: string;
|
|
31
|
-
identifier: string;
|
|
32
|
-
}
|
|
33
|
-
export interface IPlatformIos extends IPlatformCommon {
|
|
34
|
-
bundleId: string;
|
|
35
|
-
}
|
|
36
|
-
export interface IPlatformAndroid extends IPlatformCommon {
|
|
37
|
-
sha1: string;
|
|
38
|
-
packageName: string;
|
|
39
|
-
}
|
|
40
|
-
export type TPlatform = IPlatformIos | IPlatformAndroid;
|
|
41
|
-
/**
|
|
42
|
-
* Get access token
|
|
43
|
-
* @param appId
|
|
44
|
-
* @param secret
|
|
45
|
-
* @param platform get accessToken of the specific platform(ios or android), optional
|
|
46
|
-
* @param origin the reference of appId, optional
|
|
47
|
-
* @returns {accessToken: string; expiresIn: number;} expiresIn means the valid time of accessToken
|
|
48
|
-
*/
|
|
49
|
-
export declare function getAccessToken(appId: string, secret: string, platform?: TPlatform, origin?: string): Promise<{
|
|
50
|
-
accessToken: string;
|
|
51
|
-
expiredTime: number;
|
|
52
|
-
}>;
|
|
53
|
-
export interface ITokenResponse {
|
|
54
|
-
accessToken: string;
|
|
55
|
-
/** timestamp */
|
|
56
|
-
expiredTime: number;
|
|
57
|
-
identifier?: string;
|
|
58
|
-
sdkVersion?: string;
|
|
59
|
-
}
|
|
60
|
-
export type TAccessTokenGetter = () => Promise<ITokenResponse>;
|
|
61
|
-
export type InputProduct = "UI_SDK" | "ANYWHERE";
|
|
62
|
-
/**
|
|
63
|
-
* @private
|
|
64
|
-
* This method is internal and should not be exposed in the documentation.
|
|
65
|
-
*/
|
|
66
|
-
export declare const __internal: {
|
|
67
|
-
[x: symbol]: (names: InputProduct[]) => void;
|
|
68
|
-
};
|
|
69
29
|
export interface IMapxusUtils {
|
|
70
30
|
convertBrowserLangToPresetLang: (lang: string) => PresetLanguage | null;
|
|
71
|
-
getAccessToken: (appId: string, secret: string, platform?: TPlatform, origin?: string) => Promise<{
|
|
72
|
-
accessToken: string;
|
|
73
|
-
expiredTime: number;
|
|
74
|
-
}>;
|
|
75
|
-
getIdentifier: () => Promise<string>;
|
|
76
|
-
setGetTokenAsync: (fn: TAccessTokenGetter) => void;
|
|
77
|
-
setupTokenManager: () => Promise<void>;
|
|
78
31
|
VERSION: string;
|
|
79
32
|
OFFSET: number;
|
|
80
33
|
PAGE: number;
|
|
@@ -84,15 +37,9 @@ export interface IMapxusUtils {
|
|
|
84
37
|
];
|
|
85
38
|
ASSISTANT_LAYER_INDOOR_FLOORS: string;
|
|
86
39
|
ASSISTANT_LAYER_SHARED_FLOORS: string;
|
|
87
|
-
__internal: {
|
|
88
|
-
[x: symbol]: (names: InputProduct[]) => void;
|
|
89
|
-
};
|
|
90
40
|
}
|
|
91
41
|
export declare const ASSISTANT_LAYER_INDOOR_FLOORS = "reserve_mapxus-level-fill";
|
|
92
42
|
export declare const ASSISTANT_LAYER_SHARED_FLOORS = "reserve_mapxus-shared-level-fill";
|
|
93
|
-
export declare function getIdentifier(): Promise<string>;
|
|
94
|
-
export declare function setGetTokenAsync(fn: TAccessTokenGetter): void;
|
|
95
|
-
export declare function setupTokenManager(): Promise<void>;
|
|
96
43
|
declare const mapxusUtils: IMapxusUtils;
|
|
97
44
|
|
|
98
45
|
export {
|
package/es/utils/index.mjs
CHANGED
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getAccessToken: g,
|
|
11
|
-
getIdentifier: O,
|
|
12
|
-
setGetTokenAsync: E,
|
|
13
|
-
setupTokenManager: A,
|
|
14
|
-
VERSION: T,
|
|
15
|
-
OFFSET: u,
|
|
16
|
-
PAGE: l,
|
|
17
|
-
ERRORS: e,
|
|
18
|
-
ASSISTANT_LAYER_INDOOR_FLOORS: S,
|
|
19
|
-
ASSISTANT_LAYER_SHARED_FLOORS: i,
|
|
20
|
-
__internal: p
|
|
1
|
+
import { e as s, A as a, E as S, b as O, O as R, h as A, c as E } from "../languages-D7yV3lDz.mjs";
|
|
2
|
+
const o = {
|
|
3
|
+
convertBrowserLangToPresetLang: E,
|
|
4
|
+
VERSION: A,
|
|
5
|
+
OFFSET: R,
|
|
6
|
+
PAGE: O,
|
|
7
|
+
ERRORS: S,
|
|
8
|
+
ASSISTANT_LAYER_INDOOR_FLOORS: a,
|
|
9
|
+
ASSISTANT_LAYER_SHARED_FLOORS: s
|
|
21
10
|
};
|
|
22
11
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
f as default,
|
|
32
|
-
g as getAccessToken,
|
|
33
|
-
O as getIdentifier,
|
|
34
|
-
E as setGetTokenAsync,
|
|
35
|
-
A as setupTokenManager
|
|
12
|
+
a as ASSISTANT_LAYER_INDOOR_FLOORS,
|
|
13
|
+
s as ASSISTANT_LAYER_SHARED_FLOORS,
|
|
14
|
+
S as ERRORS,
|
|
15
|
+
R as OFFSET,
|
|
16
|
+
O as PAGE,
|
|
17
|
+
A as VERSION,
|
|
18
|
+
E as convertBrowserLangToPresetLang,
|
|
19
|
+
o as default
|
|
36
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapxus/mapxus-map-jp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"description": "mapxus map web sdk - kawasaki-prod",
|
|
5
5
|
"main": "dist/utils.cjs",
|
|
6
6
|
"unpkg": "dist/index.umd.js",
|
|
@@ -38,15 +38,12 @@
|
|
|
38
38
|
"author": "Maphive Technology Limited",
|
|
39
39
|
"license": "BSD-3-Clause",
|
|
40
40
|
"peerDependencies": {
|
|
41
|
+
"@mapxus/mapxus-auth-jp": ">=0.1.0 <1.0.0",
|
|
41
42
|
"maplibre-gl": "^5.2.0"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@fingerprintjs/fingerprintjs": "^4.6.1",
|
|
45
|
-
"axios": "^1.6.8",
|
|
46
|
-
"buffer": "^6.0.3",
|
|
47
45
|
"d3-dispatch": "^3.0.1",
|
|
48
|
-
"
|
|
49
|
-
"jwt-decode": "^4.0.0",
|
|
46
|
+
"geojson": "^0.5.0",
|
|
50
47
|
"lodash-es": "^4.17.21",
|
|
51
48
|
"tiny-emitter": "^2.1.0"
|
|
52
49
|
}
|