m2m-components 3.3.0 → 3.3.1-alpha-aef9a40.0
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/MenuBaseElement.d.mts +24 -0
- package/MenuBaseElement.d.ts +12 -8
- package/MenuBaseElement.js +177 -102
- package/MenuBaseElement.js.map +1 -1
- package/MenuBaseElement.mjs +9 -0
- package/MenuBaseElement.mjs.map +1 -0
- package/{cjs/storage/lib/hub.js → chunk-2X6HV5XJ.mjs} +21 -40
- package/chunk-2X6HV5XJ.mjs.map +1 -0
- package/chunk-3YQYBFME.mjs +102 -0
- package/chunk-3YQYBFME.mjs.map +1 -0
- package/chunk-5FHEMJGG.mjs +97 -0
- package/chunk-5FHEMJGG.mjs.map +1 -0
- package/{cjs/domains.js → chunk-B7STDXYN.mjs} +8 -8
- package/chunk-B7STDXYN.mjs.map +1 -0
- package/chunk-BFPL6AIR.mjs +74 -0
- package/chunk-BFPL6AIR.mjs.map +1 -0
- package/chunk-CB56CZRA.mjs +8491 -0
- package/chunk-CB56CZRA.mjs.map +1 -0
- package/chunk-CEBJL6ZD.mjs +22 -0
- package/chunk-CEBJL6ZD.mjs.map +1 -0
- package/{cjs/endpoints/matsuri-forms.v1.js → chunk-DYNNGZMQ.mjs} +94 -185
- package/chunk-DYNNGZMQ.mjs.map +1 -0
- package/chunk-FDRD4YS4.mjs +34 -0
- package/chunk-FDRD4YS4.mjs.map +1 -0
- package/{cjs/endpoints/m2m-users.v1.js → chunk-GMPQV5TL.mjs} +136 -267
- package/chunk-GMPQV5TL.mjs.map +1 -0
- package/chunk-H66U7VZB.mjs +9 -0
- package/chunk-H66U7VZB.mjs.map +1 -0
- package/chunk-IH72EYIB.mjs +9 -0
- package/chunk-IH72EYIB.mjs.map +1 -0
- package/chunk-IOZIVEOV.mjs +2 -0
- package/chunk-IOZIVEOV.mjs.map +1 -0
- package/{cjs/endpoints/m2m-notifications.v1.js → chunk-ISOF65DB.mjs} +42 -63
- package/chunk-ISOF65DB.mjs.map +1 -0
- package/chunk-JUBOAWNR.mjs +61 -0
- package/chunk-JUBOAWNR.mjs.map +1 -0
- package/chunk-LDSJ6KYP.mjs +28 -0
- package/chunk-LDSJ6KYP.mjs.map +1 -0
- package/chunk-LYVJL4T5.mjs +78 -0
- package/chunk-LYVJL4T5.mjs.map +1 -0
- package/chunk-M4ZBTA6A.mjs +19 -0
- package/chunk-M4ZBTA6A.mjs.map +1 -0
- package/chunk-NO6ZGO5P.mjs +17 -0
- package/chunk-NO6ZGO5P.mjs.map +1 -0
- package/chunk-UCJSCAN5.mjs +45 -0
- package/chunk-UCJSCAN5.mjs.map +1 -0
- package/chunk-UM6FAKR4.mjs +152 -0
- package/chunk-UM6FAKR4.mjs.map +1 -0
- package/{cjs/storage/lib/client.js → chunk-UOPEIK22.mjs} +45 -50
- package/chunk-UOPEIK22.mjs.map +1 -0
- package/chunk-V4ROE7DI.mjs +54 -0
- package/chunk-V4ROE7DI.mjs.map +1 -0
- package/chunk-VNCVFELM.mjs +83 -0
- package/chunk-VNCVFELM.mjs.map +1 -0
- package/chunk-YUHXVW6K.mjs +2 -0
- package/chunk-YUHXVW6K.mjs.map +1 -0
- package/domains.d.mts +11 -0
- package/domains.d.ts +3 -2
- package/domains.js +31 -1
- package/domains.js.map +1 -1
- package/domains.mjs +9 -0
- package/domains.mjs.map +1 -0
- package/endpoints/m2m-notifications.d.mts +7 -0
- package/endpoints/m2m-notifications.d.ts +5 -3
- package/endpoints/m2m-notifications.js +129 -4
- package/endpoints/m2m-notifications.js.map +1 -1
- package/endpoints/m2m-notifications.mjs +12 -0
- package/endpoints/m2m-notifications.mjs.map +1 -0
- package/endpoints/m2m-notifications.v1.d.mts +1 -0
- package/endpoints/m2m-notifications.v1.d.ts +1 -51
- package/endpoints/m2m-notifications.v1.js +95 -102
- package/endpoints/m2m-notifications.v1.js.map +1 -1
- package/endpoints/m2m-notifications.v1.mjs +23 -0
- package/endpoints/m2m-notifications.v1.mjs.map +1 -0
- package/endpoints/m2m-users.d.mts +7 -0
- package/endpoints/m2m-users.d.ts +5 -3
- package/endpoints/m2m-users.js +407 -4
- package/endpoints/m2m-users.js.map +1 -1
- package/endpoints/m2m-users.mjs +12 -0
- package/endpoints/m2m-users.mjs.map +1 -0
- package/endpoints/m2m-users.v1.d.mts +1 -0
- package/endpoints/m2m-users.v1.d.ts +1 -221
- package/endpoints/m2m-users.v1.js +327 -475
- package/endpoints/m2m-users.v1.js.map +1 -1
- package/endpoints/m2m-users.v1.mjs +69 -0
- package/endpoints/m2m-users.v1.mjs.map +1 -0
- package/endpoints/matsuri-forms.d.mts +7 -0
- package/endpoints/matsuri-forms.d.ts +5 -3
- package/endpoints/matsuri-forms.js +291 -4
- package/endpoints/matsuri-forms.js.map +1 -1
- package/endpoints/matsuri-forms.mjs +12 -0
- package/endpoints/matsuri-forms.mjs.map +1 -0
- package/endpoints/matsuri-forms.v1.d.mts +1 -0
- package/endpoints/matsuri-forms.v1.d.ts +1 -177
- package/endpoints/matsuri-forms.v1.js +231 -332
- package/endpoints/matsuri-forms.v1.js.map +1 -1
- package/endpoints/matsuri-forms.v1.mjs +49 -0
- package/endpoints/matsuri-forms.v1.mjs.map +1 -0
- package/feedback/MultipleTextQuestion.d.mts +6 -0
- package/feedback/MultipleTextQuestion.d.ts +6 -3
- package/feedback/MultipleTextQuestion.js +43 -10
- package/feedback/MultipleTextQuestion.js.map +1 -1
- package/feedback/MultipleTextQuestion.mjs +9 -0
- package/feedback/MultipleTextQuestion.mjs.map +1 -0
- package/feedback/SelectQuestion.d.mts +6 -0
- package/feedback/SelectQuestion.d.ts +6 -3
- package/feedback/SelectQuestion.js +55 -18
- package/feedback/SelectQuestion.js.map +1 -1
- package/feedback/SelectQuestion.mjs +9 -0
- package/feedback/SelectQuestion.mjs.map +1 -0
- package/feedback/getRandomId.d.mts +6 -0
- package/feedback/getRandomId.d.ts +3 -2
- package/feedback/getRandomId.js +31 -4
- package/feedback/getRandomId.js.map +1 -1
- package/feedback/getRandomId.mjs +9 -0
- package/feedback/getRandomId.mjs.map +1 -0
- package/feedback/index.d.mts +15 -0
- package/feedback/index.d.ts +7 -5
- package/feedback/index.js +8558 -166
- package/feedback/index.js.map +1 -1
- package/feedback/index.mjs +13 -0
- package/feedback/index.mjs.map +1 -0
- package/global.d.d.mts +4 -0
- package/global.d.d.ts +4 -0
- package/global.d.js +20 -0
- package/global.d.js.map +1 -0
- package/global.d.mjs +2 -0
- package/global.d.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.ts +6 -9
- package/index.js +421 -8
- package/index.js.map +1 -1
- package/index.mjs +23 -0
- package/index.mjs.map +1 -0
- package/initM2mComponents.d.mts +7 -0
- package/initM2mComponents.d.ts +3 -6
- package/initM2mComponents.js +242 -3
- package/initM2mComponents.js.map +1 -1
- package/initM2mComponents.mjs +11 -0
- package/initM2mComponents.mjs.map +1 -0
- package/m2m-apps-menu.d.mts +16 -0
- package/m2m-apps-menu.d.ts +10 -5
- package/m2m-apps-menu.js +265 -43
- package/m2m-apps-menu.js.map +1 -1
- package/m2m-apps-menu.mjs +11 -0
- package/m2m-apps-menu.mjs.map +1 -0
- package/m2m-notifications.v1-0186835d.d.ts +73 -0
- package/m2m-user-menu.d.mts +17 -0
- package/m2m-user-menu.d.ts +10 -5
- package/m2m-user-menu.js +327 -53
- package/m2m-user-menu.js.map +1 -1
- package/m2m-user-menu.mjs +13 -0
- package/m2m-user-menu.mjs.map +1 -0
- package/m2m-users.v1-c78c72cf.d.ts +289 -0
- package/matsuri-forms.v1-0ffee104.d.ts +225 -0
- package/notification/NotificationProvider.d.mts +18 -0
- package/notification/NotificationProvider.d.ts +10 -7
- package/notification/NotificationProvider.js +185 -51
- package/notification/NotificationProvider.js.map +1 -1
- package/notification/NotificationProvider.mjs +15 -0
- package/notification/NotificationProvider.mjs.map +1 -0
- package/notification/ServiceIdProvider.d.mts +10 -0
- package/notification/ServiceIdProvider.d.ts +8 -5
- package/notification/ServiceIdProvider.js +56 -18
- package/notification/ServiceIdProvider.js.map +1 -1
- package/notification/ServiceIdProvider.mjs +11 -0
- package/notification/ServiceIdProvider.mjs.map +1 -0
- package/notification/api.d.mts +7 -0
- package/notification/api.d.ts +7 -5
- package/notification/api.js +157 -59
- package/notification/api.js.map +1 -1
- package/notification/api.mjs +14 -0
- package/notification/api.mjs.map +1 -0
- package/notification/domain.d.mts +24 -0
- package/notification/domain.d.ts +6 -5
- package/notification/domain.js +19 -1
- package/notification/domain.js.map +1 -1
- package/notification/domain.mjs +3 -0
- package/notification/domain.mjs.map +1 -0
- package/notification/index.d.mts +6 -0
- package/notification/index.d.ts +6 -5
- package/notification/index.js +271 -4
- package/notification/index.js.map +1 -1
- package/notification/index.mjs +30 -0
- package/notification/index.mjs.map +1 -0
- package/package.json +43 -103
- package/releases/m2m-releases-link.d.mts +11 -0
- package/releases/m2m-releases-link.d.ts +9 -5
- package/releases/m2m-releases-link.js +97 -54
- package/releases/m2m-releases-link.js.map +1 -1
- package/releases/m2m-releases-link.mjs +69 -0
- package/releases/m2m-releases-link.mjs.map +1 -0
- package/releases/t.d.mts +3 -0
- package/releases/t.d.ts +3 -2
- package/releases/t.js +31 -1
- package/releases/t.js.map +1 -1
- package/releases/t.mjs +9 -0
- package/releases/t.mjs.map +1 -0
- package/storage/client.d.mts +20 -0
- package/storage/client.d.ts +8 -6
- package/storage/client.js +260 -85
- package/storage/client.js.map +1 -1
- package/storage/client.mjs +14 -0
- package/storage/client.mjs.map +1 -0
- package/storage/hub.d.mts +9 -0
- package/storage/hub.d.ts +6 -4
- package/storage/hub.js +120 -7
- package/storage/hub.js.map +1 -1
- package/storage/hub.mjs +10 -0
- package/storage/hub.mjs.map +1 -0
- package/storage/lib/client.d.mts +27 -0
- package/storage/lib/client.d.ts +4 -5
- package/storage/lib/client.js +76 -57
- package/storage/lib/client.js.map +1 -1
- package/storage/lib/client.mjs +9 -0
- package/storage/lib/client.mjs.map +1 -0
- package/storage/lib/hub.d.mts +15 -0
- package/storage/lib/hub.d.ts +4 -4
- package/storage/lib/hub.js +57 -46
- package/storage/lib/hub.js.map +1 -1
- package/storage/lib/hub.mjs +9 -0
- package/storage/lib/hub.mjs.map +1 -0
- package/storage/useM2mAuth.d.mts +25 -0
- package/storage/useM2mAuth.d.ts +10 -8
- package/storage/useM2mAuth.js +184 -74
- package/storage/useM2mAuth.js.map +1 -1
- package/storage/useM2mAuth.mjs +14 -0
- package/storage/useM2mAuth.mjs.map +1 -0
- package/storage/useM2mAuth.test.d.mts +2 -0
- package/storage/useM2mAuth.test.d.ts +2 -0
- package/storage/useM2mAuth.test.js +60906 -0
- package/storage/useM2mAuth.test.js.map +1 -0
- package/storage/useM2mAuth.test.mjs +60682 -0
- package/storage/useM2mAuth.test.mjs.map +1 -0
- package/cjs/MenuBaseElement.js +0 -207
- package/cjs/MenuBaseElement.js.map +0 -1
- package/cjs/domains.js.map +0 -1
- package/cjs/endpoints/m2m-notifications.js +0 -15
- package/cjs/endpoints/m2m-notifications.js.map +0 -1
- package/cjs/endpoints/m2m-notifications.v1.js.map +0 -1
- package/cjs/endpoints/m2m-users.js +0 -15
- package/cjs/endpoints/m2m-users.js.map +0 -1
- package/cjs/endpoints/m2m-users.v1.js.map +0 -1
- package/cjs/endpoints/matsuri-forms.js +0 -15
- package/cjs/endpoints/matsuri-forms.js.map +0 -1
- package/cjs/endpoints/matsuri-forms.v1.js.map +0 -1
- package/cjs/feedback/MultipleTextQuestion.js +0 -19
- package/cjs/feedback/MultipleTextQuestion.js.map +0 -1
- package/cjs/feedback/SelectQuestion.js +0 -27
- package/cjs/feedback/SelectQuestion.js.map +0 -1
- package/cjs/feedback/getRandomId.js +0 -12
- package/cjs/feedback/getRandomId.js.map +0 -1
- package/cjs/feedback/index.js +0 -185
- package/cjs/feedback/index.js.map +0 -1
- package/cjs/index.js +0 -11
- package/cjs/index.js.map +0 -1
- package/cjs/initM2mComponents.js +0 -17
- package/cjs/initM2mComponents.js.map +0 -1
- package/cjs/m2m-apps-menu.js +0 -95
- package/cjs/m2m-apps-menu.js.map +0 -1
- package/cjs/m2m-user-menu.js +0 -91
- package/cjs/m2m-user-menu.js.map +0 -1
- package/cjs/notification/NotificationProvider.js +0 -84
- package/cjs/notification/NotificationProvider.js.map +0 -1
- package/cjs/notification/ServiceIdProvider.js +0 -33
- package/cjs/notification/ServiceIdProvider.js.map +0 -1
- package/cjs/notification/api.js +0 -55
- package/cjs/notification/api.js.map +0 -1
- package/cjs/notification/domain.js +0 -6
- package/cjs/notification/domain.js.map +0 -1
- package/cjs/notification/index.js +0 -50
- package/cjs/notification/index.js.map +0 -1
- package/cjs/releases/m2m-releases-link.js +0 -99
- package/cjs/releases/m2m-releases-link.js.map +0 -1
- package/cjs/releases/t.js +0 -8
- package/cjs/releases/t.js.map +0 -1
- package/cjs/storage/client.js +0 -89
- package/cjs/storage/client.js.map +0 -1
- package/cjs/storage/hub.js +0 -19
- package/cjs/storage/hub.js.map +0 -1
- package/cjs/storage/lib/client.js.map +0 -1
- package/cjs/storage/lib/hub.js.map +0 -1
- package/cjs/storage/useM2mAuth.js +0 -97
- package/cjs/storage/useM2mAuth.js.map +0 -1
- package/endpoints/m2m-notifications.d.ts.map +0 -1
- package/endpoints/m2m-notifications.v1.d.ts.map +0 -1
- package/endpoints/m2m-users.d.ts.map +0 -1
- package/endpoints/m2m-users.v1.d.ts.map +0 -1
- package/endpoints/matsuri-forms.d.ts.map +0 -1
- package/endpoints/matsuri-forms.v1.d.ts.map +0 -1
- package/feedback/MultipleTextQuestion.d.ts.map +0 -1
- package/feedback/SelectQuestion.d.ts.map +0 -1
- package/feedback/getRandomId.d.ts.map +0 -1
- package/feedback/index.d.ts.map +0 -1
- package/notification/NotificationProvider.d.ts.map +0 -1
- package/notification/ServiceIdProvider.d.ts.map +0 -1
- package/notification/api.d.ts.map +0 -1
- package/notification/domain.d.ts.map +0 -1
- package/notification/index.d.ts.map +0 -1
- package/releases/m2m-releases-link.d.ts.map +0 -1
- package/releases/t.d.ts.map +0 -1
- package/storage/client.d.ts.map +0 -1
- package/storage/hub.d.ts.map +0 -1
- package/storage/lib/client.d.ts.map +0 -1
- package/storage/lib/hub.d.ts.map +0 -1
- package/storage/useM2mAuth.d.ts.map +0 -1
package/initM2mComponents.js
CHANGED
|
@@ -1,10 +1,249 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client'
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/initM2mComponents.ts
|
|
22
|
+
var initM2mComponents_exports = {};
|
|
23
|
+
__export(initM2mComponents_exports, {
|
|
24
|
+
initM2mComponents: () => initM2mComponents
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(initM2mComponents_exports);
|
|
27
|
+
|
|
28
|
+
// src/storage/lib/client.ts
|
|
29
|
+
var generateUUID = () => {
|
|
30
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
31
|
+
const r = Math.random() * 16 | 0, v = c == "x" ? r : r & 3 | 8;
|
|
32
|
+
return v.toString(16);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var StorageClient = class {
|
|
36
|
+
constructor(url, opts) {
|
|
37
|
+
opts = opts || {};
|
|
38
|
+
this.id = generateUUID();
|
|
39
|
+
this.frameId = opts.frameId || "CrossStorageClient-" + this.id;
|
|
40
|
+
this.origin = new URL(url).origin;
|
|
41
|
+
this.requests = {};
|
|
42
|
+
this.connected = false;
|
|
43
|
+
this.closed = false;
|
|
44
|
+
this.count = 0;
|
|
45
|
+
this.timeout = opts.timeout || 5e3;
|
|
46
|
+
window.addEventListener("message", this.listener.bind(this), false);
|
|
47
|
+
const frame = this.createFrame(url);
|
|
48
|
+
this.hub = frame.contentWindow;
|
|
49
|
+
}
|
|
50
|
+
onConnect() {
|
|
51
|
+
if (this.connected) {
|
|
52
|
+
return Promise.resolve();
|
|
53
|
+
} else if (this.closed) {
|
|
54
|
+
return Promise.reject(new Error("StorageClient has closed."));
|
|
55
|
+
}
|
|
56
|
+
if (!this.requests.connect) {
|
|
57
|
+
this.requests.connect = [];
|
|
58
|
+
}
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
const timeout = setTimeout(function() {
|
|
61
|
+
reject(new Error("StorageClient could not connect."));
|
|
62
|
+
}, this.timeout);
|
|
63
|
+
this.requests.connect.push((err) => {
|
|
64
|
+
clearTimeout(timeout);
|
|
65
|
+
if (err)
|
|
66
|
+
return reject(err);
|
|
67
|
+
resolve(void 0);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
set(key, value) {
|
|
72
|
+
return this.request("set", {
|
|
73
|
+
key,
|
|
74
|
+
value
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
get(...keys) {
|
|
78
|
+
return this.request("get", { keys });
|
|
79
|
+
}
|
|
80
|
+
del(...keys) {
|
|
81
|
+
return this.request("del", { keys });
|
|
82
|
+
}
|
|
83
|
+
clear() {
|
|
84
|
+
return this.request("clear");
|
|
85
|
+
}
|
|
86
|
+
getKeys() {
|
|
87
|
+
this.request("getKeys");
|
|
88
|
+
}
|
|
89
|
+
close() {
|
|
90
|
+
const frame = document.getElementById(this.frameId);
|
|
91
|
+
if (frame && frame.parentNode) {
|
|
92
|
+
frame.parentNode.removeChild(frame);
|
|
93
|
+
}
|
|
94
|
+
window.removeEventListener("message", this.listener, false);
|
|
95
|
+
this.connected = false;
|
|
96
|
+
this.closed = true;
|
|
97
|
+
}
|
|
98
|
+
listener(message) {
|
|
99
|
+
let i, error, response;
|
|
100
|
+
if (this.closed || !message.data || typeof message.data !== "string") {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const origin = message.origin;
|
|
104
|
+
if (origin !== this.origin)
|
|
105
|
+
return;
|
|
106
|
+
if (message.data === "cross-storage:unavailable") {
|
|
107
|
+
if (!this.closed)
|
|
108
|
+
this.close();
|
|
109
|
+
if (!this.requests.connect)
|
|
110
|
+
return;
|
|
111
|
+
error = new Error(
|
|
112
|
+
"Closing StorageClient. Could not access localStorage in StorageHub."
|
|
113
|
+
);
|
|
114
|
+
for (i = 0; i < this.requests.connect.length; i++) {
|
|
115
|
+
this.requests.connect[i](error);
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (message.data.indexOf("cross-storage:") !== -1 && !this.connected) {
|
|
120
|
+
this.connected = true;
|
|
121
|
+
if (!this.requests.connect)
|
|
122
|
+
return;
|
|
123
|
+
for (i = 0; i < this.requests.connect.length; i++) {
|
|
124
|
+
this.requests.connect[i](error);
|
|
125
|
+
}
|
|
126
|
+
delete this.requests.connect;
|
|
127
|
+
}
|
|
128
|
+
if (message.data === "cross-storage:ready")
|
|
129
|
+
return;
|
|
130
|
+
try {
|
|
131
|
+
response = JSON.parse(message.data);
|
|
132
|
+
} catch (e) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (!response.id)
|
|
136
|
+
return;
|
|
137
|
+
if (this.requests[response.id]) {
|
|
138
|
+
this.requests[response.id](response.error, response.result);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
createFrame(url) {
|
|
142
|
+
const frame = window.document.createElement("iframe");
|
|
143
|
+
frame.id = this.frameId;
|
|
144
|
+
frame.style.display = "none";
|
|
145
|
+
frame.style.position = "absolute";
|
|
146
|
+
frame.style.top = "-999px";
|
|
147
|
+
frame.style.left = "-999px";
|
|
148
|
+
window.document.body.appendChild(frame);
|
|
149
|
+
frame.src = url;
|
|
150
|
+
return frame;
|
|
151
|
+
}
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
153
|
+
request(method, params) {
|
|
154
|
+
if (this.closed) {
|
|
155
|
+
return Promise.reject(new Error("StorageClient has closed."));
|
|
156
|
+
}
|
|
157
|
+
this.count++;
|
|
158
|
+
const req = {
|
|
159
|
+
id: this.id + ":" + this.count,
|
|
160
|
+
method: "cross-storage:" + method,
|
|
161
|
+
params
|
|
162
|
+
};
|
|
163
|
+
return new Promise((resolve, reject) => {
|
|
164
|
+
const timeout = window.setTimeout(() => {
|
|
165
|
+
if (!this.requests[req.id])
|
|
166
|
+
return;
|
|
167
|
+
delete this.requests[req.id];
|
|
168
|
+
reject(
|
|
169
|
+
new Error("Timeout: StorageClient could not perform " + req.method)
|
|
170
|
+
);
|
|
171
|
+
}, this.timeout);
|
|
172
|
+
this.requests[req.id] = (err, result) => {
|
|
173
|
+
clearTimeout(timeout);
|
|
174
|
+
delete this.requests[req.id];
|
|
175
|
+
if (err)
|
|
176
|
+
return reject(new Error(err));
|
|
177
|
+
resolve(result);
|
|
178
|
+
};
|
|
179
|
+
if (this.hub) {
|
|
180
|
+
this.hub.postMessage(JSON.stringify(req), this.origin);
|
|
181
|
+
} else {
|
|
182
|
+
reject(new Error("Not found StorageHub."));
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/storage/client.ts
|
|
189
|
+
var M2mStorageClient = class extends StorageClient {
|
|
190
|
+
};
|
|
191
|
+
var context = {};
|
|
192
|
+
var getStorage = async (timeout = 5e3) => {
|
|
193
|
+
const storage = await new Promise((resolve, reject) => {
|
|
194
|
+
const rejectTimer = window.setTimeout(function() {
|
|
195
|
+
reject(
|
|
196
|
+
new Error(
|
|
197
|
+
"Timeout: M2mStorageClient could not connect. Please call m2mStorageClient.init() before using m2mStorageClient."
|
|
198
|
+
)
|
|
199
|
+
);
|
|
200
|
+
}, timeout);
|
|
201
|
+
const storage2 = context.storage;
|
|
202
|
+
if (storage2) {
|
|
203
|
+
window.clearTimeout(rejectTimer);
|
|
204
|
+
resolve(storage2);
|
|
205
|
+
}
|
|
206
|
+
const timer = window.setInterval(() => {
|
|
207
|
+
const storage3 = context.storage;
|
|
208
|
+
if (storage3) {
|
|
209
|
+
window.clearTimeout(rejectTimer);
|
|
210
|
+
window.clearInterval(timer);
|
|
211
|
+
resolve(storage3);
|
|
212
|
+
}
|
|
213
|
+
}, 200);
|
|
214
|
+
});
|
|
215
|
+
await storage.onConnect();
|
|
216
|
+
return storage;
|
|
217
|
+
};
|
|
218
|
+
var M2M_STORAGE_HUB_URL = "https://hub.m2msystems.cloud/";
|
|
219
|
+
var M2M_STORAGE_HUB_URL_DEV = "https://m2m-components-storage-hub-dev.netlify.app/";
|
|
220
|
+
var initStorageClient = (options) => {
|
|
221
|
+
if (context.storage) {
|
|
222
|
+
throw new Error(
|
|
223
|
+
"M2mStorageClient already initialized. Do not call m2mStorageClient.init multiple times."
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
const storage = new M2mStorageClient(
|
|
227
|
+
(options == null ? void 0 : options.env) === "production" ? M2M_STORAGE_HUB_URL : M2M_STORAGE_HUB_URL_DEV
|
|
228
|
+
);
|
|
229
|
+
context.storage = storage;
|
|
230
|
+
};
|
|
231
|
+
var m2mStorageClient = {
|
|
232
|
+
init: initStorageClient,
|
|
233
|
+
getStorage
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/initM2mComponents.ts
|
|
237
|
+
var initM2mComponents = (args) => {
|
|
3
238
|
m2mStorageClient.init({
|
|
4
239
|
env: args.env === "production" ? "production" : "development"
|
|
5
240
|
});
|
|
6
|
-
if (globalThis.M2M_COMPONENTS_ENV ===
|
|
241
|
+
if (globalThis.M2M_COMPONENTS_ENV === void 0) {
|
|
7
242
|
globalThis.M2M_COMPONENTS_ENV = args.env;
|
|
8
243
|
}
|
|
9
244
|
};
|
|
245
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
246
|
+
0 && (module.exports = {
|
|
247
|
+
initM2mComponents
|
|
248
|
+
});
|
|
10
249
|
//# sourceMappingURL=initM2mComponents.js.map
|
package/initM2mComponents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initM2mComponents.js","names":["m2mStorageClient","initM2mComponents","args","init","env","globalThis","M2M_COMPONENTS_ENV","undefined"],"sources":["src/initM2mComponents.ts"],"sourcesContent":["import { m2mStorageClient } from \"./storage/client\";\n\ntype Env = \"development\" | \"production\" | \"local\" | \"localDev\";\n\ninterface InitM2mComponentsArgs {\n env: Env;\n}\n\ndeclare global {\n // To define global variables in a module, we need to use the global keyword\n // eslint-disable-next-line no-var\n var M2M_COMPONENTS_ENV: Env;\n}\n\nexport const initM2mComponents = (args: InitM2mComponentsArgs) => {\n m2mStorageClient.init({\n env: args.env === \"production\" ? \"production\" : \"development\",\n });\n if (globalThis.M2M_COMPONENTS_ENV === undefined) {\n globalThis.M2M_COMPONENTS_ENV = args.env;\n }\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,kBAAkB;AAcnD,OAAO,IAAMC,iBAAiB,GAAIC,IAA2B,IAAK;EAChEF,gBAAgB,CAACG,IAAI,CAAC;IACpBC,GAAG,EAAEF,IAAI,CAACE,GAAG,KAAK,YAAY,GAAG,YAAY,GAAG;EAClD,CAAC,CAAC;EACF,IAAIC,UAAU,CAACC,kBAAkB,KAAKC,SAAS,EAAE;IAC/CF,UAAU,CAACC,kBAAkB,GAAGJ,IAAI,CAACE,GAAG;EAC1C;AACF,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../src/initM2mComponents.ts","../src/storage/lib/client.ts","../src/storage/client.ts"],"sourcesContent":["import { m2mStorageClient } from \"./storage/client\";\n\ntype Env = \"development\" | \"production\" | \"local\" | \"localDev\";\n\ninterface InitM2mComponentsArgs {\n env: Env;\n}\n\nexport const initM2mComponents = (args: InitM2mComponentsArgs) => {\n m2mStorageClient.init({\n env: args.env === \"production\" ? \"production\" : \"development\",\n });\n if (globalThis.M2M_COMPONENTS_ENV === undefined) {\n globalThis.M2M_COMPONENTS_ENV = args.env;\n }\n};\n","/**\n * この実装はcross-storageほぼそのままです。\n */\nconst generateUUID = () => {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n\n return v.toString(16);\n });\n};\nexport class StorageClient {\n id: string;\n frameId: string;\n origin: string;\n requests: Record<string, any>;\n connected: boolean;\n closed: boolean;\n count: number;\n timeout: number;\n hub: null | Window;\n\n constructor(url: string, opts?: { frameId?: string; timeout?: number }) {\n opts = opts || {};\n\n this.id = generateUUID();\n this.frameId = opts.frameId || \"CrossStorageClient-\" + this.id;\n this.origin = new URL(url).origin;\n this.requests = {};\n this.connected = false;\n this.closed = false;\n this.count = 0;\n this.timeout = opts.timeout || 5000;\n\n window.addEventListener(\"message\", this.listener.bind(this), false);\n\n const frame = this.createFrame(url);\n this.hub = frame.contentWindow;\n }\n\n onConnect() {\n if (this.connected) {\n return Promise.resolve();\n } else if (this.closed) {\n return Promise.reject(new Error(\"StorageClient has closed.\"));\n }\n\n if (!this.requests.connect) {\n this.requests.connect = [];\n }\n\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(function () {\n reject(new Error(\"StorageClient could not connect.\"));\n }, this.timeout);\n\n this.requests.connect.push((err: string) => {\n clearTimeout(timeout);\n if (err) return reject(err);\n\n resolve(undefined);\n });\n });\n }\n\n set(key: string, value: string) {\n return this.request(\"set\", {\n key: key,\n value: value,\n });\n }\n\n get(...keys: string[]) {\n return this.request(\"get\", { keys });\n }\n\n del(...keys: string[]) {\n return this.request(\"del\", { keys });\n }\n\n clear() {\n return this.request(\"clear\");\n }\n\n getKeys() {\n this.request(\"getKeys\");\n }\n\n close() {\n const frame = document.getElementById(this.frameId);\n if (frame && frame.parentNode) {\n frame.parentNode.removeChild(frame);\n }\n\n window.removeEventListener(\"message\", this.listener, false);\n\n this.connected = false;\n this.closed = true;\n }\n\n private listener(message: MessageEvent) {\n let i, error, response;\n\n if (this.closed || !message.data || typeof message.data !== \"string\") {\n return;\n }\n\n const origin = message.origin;\n\n if (origin !== this.origin) return;\n\n if (message.data === \"cross-storage:unavailable\") {\n if (!this.closed) this.close();\n if (!this.requests.connect) return;\n\n error = new Error(\n \"Closing StorageClient. Could not access localStorage in StorageHub.\"\n );\n for (i = 0; i < this.requests.connect.length; i++) {\n this.requests.connect[i](error);\n }\n\n return;\n }\n\n if (message.data.indexOf(\"cross-storage:\") !== -1 && !this.connected) {\n this.connected = true;\n if (!this.requests.connect) return;\n\n for (i = 0; i < this.requests.connect.length; i++) {\n this.requests.connect[i](error);\n }\n delete this.requests.connect;\n }\n\n if (message.data === \"cross-storage:ready\") return;\n\n try {\n response = JSON.parse(message.data);\n } catch (e) {\n return;\n }\n\n if (!response.id) return;\n\n if (this.requests[response.id]) {\n this.requests[response.id](response.error, response.result);\n }\n }\n\n private createFrame(url: string) {\n const frame = window.document.createElement(\"iframe\");\n frame.id = this.frameId;\n\n frame.style.display = \"none\";\n frame.style.position = \"absolute\";\n frame.style.top = \"-999px\";\n frame.style.left = \"-999px\";\n\n window.document.body.appendChild(frame);\n frame.src = url;\n\n return frame;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n private request(method: string, params?: {}) {\n if (this.closed) {\n return Promise.reject(new Error(\"StorageClient has closed.\"));\n }\n\n this.count++;\n\n const req = {\n id: this.id + \":\" + this.count,\n method: \"cross-storage:\" + method,\n params: params,\n };\n\n return new Promise((resolve, reject) => {\n const timeout = window.setTimeout(() => {\n if (!this.requests[req.id]) return;\n\n delete this.requests[req.id];\n reject(\n new Error(\"Timeout: StorageClient could not perform \" + req.method)\n );\n }, this.timeout);\n\n this.requests[req.id] = (err: string, result: string) => {\n clearTimeout(timeout);\n delete this.requests[req.id];\n if (err) return reject(new Error(err));\n resolve(result);\n };\n\n if (this.hub) {\n this.hub.postMessage(JSON.stringify(req), this.origin);\n } else {\n reject(new Error(\"Not found StorageHub.\"));\n }\n });\n }\n}\n","import { StorageClient } from \"./lib/client\";\n\nclass M2mStorageClient extends StorageClient {}\n\nexport type { M2mStorageClient };\n\nconst context: {\n storage?: M2mStorageClient;\n} = {};\n\n/**\n * Get the connected storage client.\n * @param timeout\n * @default 5000\n */\nconst getStorage = async (timeout = 5000) => {\n const storage = await new Promise<M2mStorageClient>((resolve, reject) => {\n const rejectTimer = window.setTimeout(function () {\n reject(\n new Error(\n \"Timeout: M2mStorageClient could not connect. Please call m2mStorageClient.init() before using m2mStorageClient.\"\n )\n );\n }, timeout);\n\n const storage = context.storage;\n if (storage) {\n window.clearTimeout(rejectTimer);\n resolve(storage);\n }\n\n const timer = window.setInterval(() => {\n const storage = context.storage;\n if (storage) {\n window.clearTimeout(rejectTimer);\n window.clearInterval(timer);\n resolve(storage);\n }\n }, 200);\n });\n\n await storage.onConnect();\n\n return storage;\n};\n\nconst M2M_STORAGE_HUB_URL = \"https://hub.m2msystems.cloud/\";\n\nconst M2M_STORAGE_HUB_URL_DEV =\n \"https://m2m-components-storage-hub-dev.netlify.app/\";\n\nconst initStorageClient = (options?: {\n env?: \"development\" | \"production\";\n}) => {\n if (context.storage) {\n throw new Error(\n \"M2mStorageClient already initialized. Do not call m2mStorageClient.init multiple times.\"\n );\n }\n const storage = new M2mStorageClient(\n options?.env === \"production\"\n ? M2M_STORAGE_HUB_URL\n : M2M_STORAGE_HUB_URL_DEV\n );\n context.storage = storage;\n};\n\nexport const m2mStorageClient = {\n init: initStorageClient,\n getStorage: getStorage,\n};\n\nexport const M2M_AUTH_TOKEN_KEY = \"M2M_APP_AUTH_TOKEN\";\n\nconst getAuthTokenCache = () => {\n return window.localStorage.getItem(M2M_AUTH_TOKEN_KEY);\n};\n\nconst getAuthToken = async () => {\n try {\n const storage = await getStorage();\n const autuToken = (await storage.get(M2M_AUTH_TOKEN_KEY)) as string;\n return autuToken || getAuthTokenCache();\n } catch (error) {\n console.warn(error);\n return getAuthTokenCache();\n }\n};\n\nconst setAuthToken = async (token: string) => {\n window.localStorage.setItem(M2M_AUTH_TOKEN_KEY, token);\n try {\n const storage = await getStorage();\n await storage.set(M2M_AUTH_TOKEN_KEY, token);\n } catch (error) {\n console.warn(error);\n }\n};\n\nconst clearAuthToken = async () => {\n window.localStorage.removeItem(M2M_AUTH_TOKEN_KEY);\n try {\n const storage = await getStorage();\n await storage.del(M2M_AUTH_TOKEN_KEY);\n } catch (error) {\n console.warn(error);\n }\n};\n\nexport const m2mAuthTokenApi = {\n get: getAuthToken,\n getCache: getAuthTokenCache,\n set: setAuthToken,\n clear: clearAuthToken,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,IAAM,eAAe,MAAM;AACzB,SAAO,uCAAuC,QAAQ,SAAS,SAAU,GAAG;AAC1E,UAAM,IAAK,KAAK,OAAO,IAAI,KAAM,GAC/B,IAAI,KAAK,MAAM,IAAK,IAAI,IAAO;AAEjC,WAAO,EAAE,SAAS,EAAE;AAAA,EACtB,CAAC;AACH;AACO,IAAM,gBAAN,MAAoB;AAAA,EAWzB,YAAY,KAAa,MAA+C;AACtE,WAAO,QAAQ,CAAC;AAEhB,SAAK,KAAK,aAAa;AACvB,SAAK,UAAU,KAAK,WAAW,wBAAwB,KAAK;AAC5D,SAAK,SAA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
+
import "./chunk-5FHEMJGG.mjs";
|
|
6
|
+
import "./chunk-UOPEIK22.mjs";
|
|
7
|
+
import "./chunk-JUBOAWNR.mjs";
|
|
8
|
+
export {
|
|
9
|
+
initM2mComponents
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=initM2mComponents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { MenuBaseElementProps, MenuBaseElement } from './MenuBaseElement.mjs';
|
|
3
|
+
import 'lit-html/directives/ref';
|
|
4
|
+
import 'lit';
|
|
5
|
+
|
|
6
|
+
type M2MAppsMenuProps = MenuBaseElementProps;
|
|
7
|
+
declare class M2MAppsMenu extends MenuBaseElement {
|
|
8
|
+
render(): lit_html.TemplateResult<1>;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
"m2m-apps-menu": M2MAppsMenu;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { M2MAppsMenu, M2MAppsMenuProps };
|
package/m2m-apps-menu.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { MenuBaseElementProps, MenuBaseElement } from './MenuBaseElement.js';
|
|
3
|
+
import 'lit-html/directives/ref';
|
|
4
|
+
import 'lit';
|
|
5
|
+
|
|
6
|
+
type M2MAppsMenuProps = MenuBaseElementProps;
|
|
7
|
+
declare class M2MAppsMenu extends MenuBaseElement {
|
|
8
|
+
render(): lit_html.TemplateResult<1>;
|
|
5
9
|
}
|
|
6
10
|
declare global {
|
|
7
11
|
interface HTMLElementTagNameMap {
|
|
8
12
|
"m2m-apps-menu": M2MAppsMenu;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
|
-
|
|
15
|
+
|
|
16
|
+
export { M2MAppsMenu, M2MAppsMenuProps };
|