@memberstack/dom 2.0.1 → 2.0.2
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 +356 -3
- package/lib/index.d.mts +1912 -64
- package/lib/index.d.ts +1912 -64
- package/lib/index.js +2316 -30656
- package/lib/index.mjs +2302 -30656
- package/lib/{types/utils/payloads.d.mts → models-CFT_ABd5.d.ts} +194 -6
- package/lib/testing/index.d.mts +295 -0
- package/lib/testing/index.d.ts +295 -0
- package/lib/testing/index.js +335 -0
- package/lib/testing/index.mjs +305 -0
- package/package.json +23 -12
- package/lib/auth/index.d.mts +0 -9
- package/lib/auth/index.d.ts +0 -9
- package/lib/auth/index.global.js +0 -244
- package/lib/auth/index.js +0 -158
- package/lib/auth/index.mjs +0 -121
- package/lib/constants/endpoints.d.mts +0 -5
- package/lib/constants/endpoints.d.ts +0 -5
- package/lib/constants/endpoints.global.js +0 -29
- package/lib/constants/endpoints.js +0 -31
- package/lib/constants/endpoints.mjs +0 -7
- package/lib/index.global.js +0 -46364
- package/lib/methods/dom/index.d.mts +0 -2
- package/lib/methods/dom/index.d.ts +0 -2
- package/lib/methods/dom/index.global.js +0 -2
- package/lib/methods/dom/index.js +0 -0
- package/lib/methods/dom/index.mjs +0 -0
- package/lib/methods/dom/main-dom.d.mts +0 -14
- package/lib/methods/dom/main-dom.d.ts +0 -14
- package/lib/methods/dom/main-dom.global.js +0 -30620
- package/lib/methods/dom/main-dom.js +0 -30618
- package/lib/methods/dom/main-dom.mjs +0 -30601
- package/lib/methods/dom/methods.d.mts +0 -18
- package/lib/methods/dom/methods.d.ts +0 -18
- package/lib/methods/dom/methods.global.js +0 -30827
- package/lib/methods/dom/methods.js +0 -30835
- package/lib/methods/dom/methods.mjs +0 -30806
- package/lib/methods/index.d.mts +0 -103
- package/lib/methods/index.d.ts +0 -103
- package/lib/methods/index.global.js +0 -46361
- package/lib/methods/index.js +0 -32125
- package/lib/methods/index.mjs +0 -32096
- package/lib/methods/requests/index.d.mts +0 -92
- package/lib/methods/requests/index.d.ts +0 -92
- package/lib/methods/requests/index.global.js +0 -15553
- package/lib/methods/requests/index.js +0 -1322
- package/lib/methods/requests/index.mjs +0 -1288
- package/lib/methods/requests/requests.d.mts +0 -42
- package/lib/methods/requests/requests.d.ts +0 -42
- package/lib/methods/requests/requests.global.js +0 -14528
- package/lib/methods/requests/requests.js +0 -242
- package/lib/methods/requests/requests.mjs +0 -209
- package/lib/types/index.d.mts +0 -4
- package/lib/types/index.d.ts +0 -4
- package/lib/types/index.global.js +0 -19
- package/lib/types/index.js +0 -17
- package/lib/types/index.mjs +0 -0
- package/lib/types/params.d.mts +0 -322
- package/lib/types/params.d.ts +0 -322
- package/lib/types/params.global.js +0 -19
- package/lib/types/params.js +0 -17
- package/lib/types/params.mjs +0 -0
- package/lib/types/payloads.d.mts +0 -143
- package/lib/types/payloads.d.ts +0 -143
- package/lib/types/payloads.global.js +0 -19
- package/lib/types/payloads.js +0 -17
- package/lib/types/payloads.mjs +0 -0
- package/lib/types/translations.d.mts +0 -43
- package/lib/types/translations.d.ts +0 -43
- package/lib/types/translations.global.js +0 -19
- package/lib/types/translations.js +0 -17
- package/lib/types/translations.mjs +0 -0
- package/lib/types/utils/payloads.d.ts +0 -299
- package/lib/types/utils/payloads.global.js +0 -19
- package/lib/types/utils/payloads.js +0 -17
- package/lib/types/utils/payloads.mjs +0 -0
- package/lib/utils/cookies.d.mts +0 -13
- package/lib/utils/cookies.d.ts +0 -13
- package/lib/utils/cookies.global.js +0 -261
- package/lib/utils/cookies.js +0 -179
- package/lib/utils/cookies.mjs +0 -138
- package/lib/utils/defaultMessageBox.d.mts +0 -5
- package/lib/utils/defaultMessageBox.d.ts +0 -5
- package/lib/utils/defaultMessageBox.global.js +0 -125
- package/lib/utils/defaultMessageBox.js +0 -129
- package/lib/utils/defaultMessageBox.mjs +0 -103
package/lib/utils/cookies.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __export = (target, all) => {
|
|
22
|
-
for (var name in all)
|
|
23
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
|
-
};
|
|
25
|
-
var __copyProps = (to, from, except, desc) => {
|
|
26
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
-
for (let key of __getOwnPropNames(from))
|
|
28
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
-
}
|
|
31
|
-
return to;
|
|
32
|
-
};
|
|
33
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
35
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
36
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
|
-
mod
|
|
40
|
-
));
|
|
41
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
|
-
|
|
43
|
-
// src/utils/cookies.ts
|
|
44
|
-
var cookies_exports = {};
|
|
45
|
-
__export(cookies_exports, {
|
|
46
|
-
extractDomainFromHostname: () => extractDomainFromHostname,
|
|
47
|
-
getMemberToken: () => getMemberToken,
|
|
48
|
-
getSessionId: () => getSessionId,
|
|
49
|
-
removeMemberToken: () => removeMemberToken,
|
|
50
|
-
removeSessionId: () => removeSessionId,
|
|
51
|
-
setApiDomain: () => setApiDomain,
|
|
52
|
-
setMemberToken: () => setMemberToken,
|
|
53
|
-
setMemberTokenIfAvailable: () => setMemberTokenIfAvailable,
|
|
54
|
-
setSessionId: () => setSessionId,
|
|
55
|
-
setUseCookies: () => setUseCookies,
|
|
56
|
-
useCookiesValid: () => useCookiesValid
|
|
57
|
-
});
|
|
58
|
-
module.exports = __toCommonJS(cookies_exports);
|
|
59
|
-
var import_js_cookie = __toESM(require("js-cookie"));
|
|
60
|
-
var memberAuthTokenName = "_ms-mid";
|
|
61
|
-
function isLocalStorageAvailable() {
|
|
62
|
-
try {
|
|
63
|
-
localStorage.setItem("test", "test");
|
|
64
|
-
localStorage.removeItem("test");
|
|
65
|
-
return true;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
var localStorageAvailable = isLocalStorageAvailable();
|
|
71
|
-
var useCookies = false;
|
|
72
|
-
var setCookieOnRootDomain = false;
|
|
73
|
-
var apiDomain;
|
|
74
|
-
var setUseCookies = (setCookieOnRoot) => {
|
|
75
|
-
useCookies = true;
|
|
76
|
-
if (setCookieOnRoot)
|
|
77
|
-
setCookieOnRootDomain = true;
|
|
78
|
-
};
|
|
79
|
-
var setApiDomain = (domain) => {
|
|
80
|
-
apiDomain = domain;
|
|
81
|
-
};
|
|
82
|
-
var extractDomainFromHostname = (hostname) => {
|
|
83
|
-
const hostnameParts = hostname.split(".");
|
|
84
|
-
const isCountryCodeTLD = hostnameParts.length >= 3 && hostnameParts[hostnameParts.length - 2].length <= 3;
|
|
85
|
-
if (isCountryCodeTLD) {
|
|
86
|
-
return hostnameParts.slice(-3).join(".");
|
|
87
|
-
} else {
|
|
88
|
-
return hostnameParts.slice(-2).join(".");
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var useCookiesValid = () => {
|
|
92
|
-
if (!useCookies)
|
|
93
|
-
return false;
|
|
94
|
-
if (setCookieOnRootDomain) {
|
|
95
|
-
const apiDomainHost = extractDomainFromHostname(apiDomain);
|
|
96
|
-
const currentHost = extractDomainFromHostname(window.location.hostname);
|
|
97
|
-
return apiDomainHost === currentHost;
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
};
|
|
101
|
-
var setMemberToken = (token, expires) => {
|
|
102
|
-
if (localStorageAvailable && useCookiesValid() === false) {
|
|
103
|
-
localStorage.setItem(memberAuthTokenName, token);
|
|
104
|
-
} else {
|
|
105
|
-
const domain = extractDomainFromHostname(window.location.hostname);
|
|
106
|
-
import_js_cookie.default.set(memberAuthTokenName, token, __spreadValues({
|
|
107
|
-
expires: expires && Number(expires) || 14,
|
|
108
|
-
sameSite: "strict"
|
|
109
|
-
}, setCookieOnRootDomain && { domain }));
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
var removeMemberToken = () => {
|
|
113
|
-
if (localStorageAvailable) {
|
|
114
|
-
localStorage.removeItem(memberAuthTokenName);
|
|
115
|
-
}
|
|
116
|
-
const domain = extractDomainFromHostname(window.location.hostname);
|
|
117
|
-
import_js_cookie.default.set(memberAuthTokenName, "", __spreadValues({
|
|
118
|
-
expires: -1,
|
|
119
|
-
sameSite: "strict"
|
|
120
|
-
}, setCookieOnRootDomain && { domain }));
|
|
121
|
-
import_js_cookie.default.set(memberAuthTokenName, "", {
|
|
122
|
-
expires: -1,
|
|
123
|
-
sameSite: "strict"
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
var getMemberToken = () => {
|
|
127
|
-
if (localStorageAvailable) {
|
|
128
|
-
const memAuthToken = localStorage.getItem(memberAuthTokenName);
|
|
129
|
-
if (memAuthToken)
|
|
130
|
-
return memAuthToken;
|
|
131
|
-
}
|
|
132
|
-
return import_js_cookie.default.get(memberAuthTokenName);
|
|
133
|
-
};
|
|
134
|
-
var setMemberTokenIfAvailable = () => {
|
|
135
|
-
if (typeof window !== "undefined") {
|
|
136
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
137
|
-
const memberToken = urlParams.get("memberToken");
|
|
138
|
-
if (memberToken)
|
|
139
|
-
setMemberToken(memberToken);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
var getSessionId = () => {
|
|
143
|
-
if (typeof window === "undefined")
|
|
144
|
-
return null;
|
|
145
|
-
const sessionId = window.localStorage.getItem("ms_session_id");
|
|
146
|
-
if (!sessionId || sessionId.length > 26) {
|
|
147
|
-
window.localStorage.removeItem("ms_session_id");
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
return sessionId;
|
|
151
|
-
};
|
|
152
|
-
var setSessionId = (sessionId) => {
|
|
153
|
-
if (typeof window !== "undefined") {
|
|
154
|
-
window.localStorage.setItem("ms_session_id", sessionId);
|
|
155
|
-
} else {
|
|
156
|
-
console.warn("setSessionId: window is not defined");
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
var removeSessionId = () => {
|
|
160
|
-
if (typeof window !== "undefined") {
|
|
161
|
-
window.localStorage.removeItem("ms_session_id");
|
|
162
|
-
} else {
|
|
163
|
-
console.warn("removeSessionId: window is not defined");
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
167
|
-
0 && (module.exports = {
|
|
168
|
-
extractDomainFromHostname,
|
|
169
|
-
getMemberToken,
|
|
170
|
-
getSessionId,
|
|
171
|
-
removeMemberToken,
|
|
172
|
-
removeSessionId,
|
|
173
|
-
setApiDomain,
|
|
174
|
-
setMemberToken,
|
|
175
|
-
setMemberTokenIfAvailable,
|
|
176
|
-
setSessionId,
|
|
177
|
-
setUseCookies,
|
|
178
|
-
useCookiesValid
|
|
179
|
-
});
|
package/lib/utils/cookies.mjs
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// src/utils/cookies.ts
|
|
19
|
-
import Cookie from "js-cookie";
|
|
20
|
-
var memberAuthTokenName = "_ms-mid";
|
|
21
|
-
function isLocalStorageAvailable() {
|
|
22
|
-
try {
|
|
23
|
-
localStorage.setItem("test", "test");
|
|
24
|
-
localStorage.removeItem("test");
|
|
25
|
-
return true;
|
|
26
|
-
} catch (e) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
var localStorageAvailable = isLocalStorageAvailable();
|
|
31
|
-
var useCookies = false;
|
|
32
|
-
var setCookieOnRootDomain = false;
|
|
33
|
-
var apiDomain;
|
|
34
|
-
var setUseCookies = (setCookieOnRoot) => {
|
|
35
|
-
useCookies = true;
|
|
36
|
-
if (setCookieOnRoot)
|
|
37
|
-
setCookieOnRootDomain = true;
|
|
38
|
-
};
|
|
39
|
-
var setApiDomain = (domain) => {
|
|
40
|
-
apiDomain = domain;
|
|
41
|
-
};
|
|
42
|
-
var extractDomainFromHostname = (hostname) => {
|
|
43
|
-
const hostnameParts = hostname.split(".");
|
|
44
|
-
const isCountryCodeTLD = hostnameParts.length >= 3 && hostnameParts[hostnameParts.length - 2].length <= 3;
|
|
45
|
-
if (isCountryCodeTLD) {
|
|
46
|
-
return hostnameParts.slice(-3).join(".");
|
|
47
|
-
} else {
|
|
48
|
-
return hostnameParts.slice(-2).join(".");
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var useCookiesValid = () => {
|
|
52
|
-
if (!useCookies)
|
|
53
|
-
return false;
|
|
54
|
-
if (setCookieOnRootDomain) {
|
|
55
|
-
const apiDomainHost = extractDomainFromHostname(apiDomain);
|
|
56
|
-
const currentHost = extractDomainFromHostname(window.location.hostname);
|
|
57
|
-
return apiDomainHost === currentHost;
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
60
|
-
};
|
|
61
|
-
var setMemberToken = (token, expires) => {
|
|
62
|
-
if (localStorageAvailable && useCookiesValid() === false) {
|
|
63
|
-
localStorage.setItem(memberAuthTokenName, token);
|
|
64
|
-
} else {
|
|
65
|
-
const domain = extractDomainFromHostname(window.location.hostname);
|
|
66
|
-
Cookie.set(memberAuthTokenName, token, __spreadValues({
|
|
67
|
-
expires: expires && Number(expires) || 14,
|
|
68
|
-
sameSite: "strict"
|
|
69
|
-
}, setCookieOnRootDomain && { domain }));
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var removeMemberToken = () => {
|
|
73
|
-
if (localStorageAvailable) {
|
|
74
|
-
localStorage.removeItem(memberAuthTokenName);
|
|
75
|
-
}
|
|
76
|
-
const domain = extractDomainFromHostname(window.location.hostname);
|
|
77
|
-
Cookie.set(memberAuthTokenName, "", __spreadValues({
|
|
78
|
-
expires: -1,
|
|
79
|
-
sameSite: "strict"
|
|
80
|
-
}, setCookieOnRootDomain && { domain }));
|
|
81
|
-
Cookie.set(memberAuthTokenName, "", {
|
|
82
|
-
expires: -1,
|
|
83
|
-
sameSite: "strict"
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
var getMemberToken = () => {
|
|
87
|
-
if (localStorageAvailable) {
|
|
88
|
-
const memAuthToken = localStorage.getItem(memberAuthTokenName);
|
|
89
|
-
if (memAuthToken)
|
|
90
|
-
return memAuthToken;
|
|
91
|
-
}
|
|
92
|
-
return Cookie.get(memberAuthTokenName);
|
|
93
|
-
};
|
|
94
|
-
var setMemberTokenIfAvailable = () => {
|
|
95
|
-
if (typeof window !== "undefined") {
|
|
96
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
97
|
-
const memberToken = urlParams.get("memberToken");
|
|
98
|
-
if (memberToken)
|
|
99
|
-
setMemberToken(memberToken);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var getSessionId = () => {
|
|
103
|
-
if (typeof window === "undefined")
|
|
104
|
-
return null;
|
|
105
|
-
const sessionId = window.localStorage.getItem("ms_session_id");
|
|
106
|
-
if (!sessionId || sessionId.length > 26) {
|
|
107
|
-
window.localStorage.removeItem("ms_session_id");
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
return sessionId;
|
|
111
|
-
};
|
|
112
|
-
var setSessionId = (sessionId) => {
|
|
113
|
-
if (typeof window !== "undefined") {
|
|
114
|
-
window.localStorage.setItem("ms_session_id", sessionId);
|
|
115
|
-
} else {
|
|
116
|
-
console.warn("setSessionId: window is not defined");
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
var removeSessionId = () => {
|
|
120
|
-
if (typeof window !== "undefined") {
|
|
121
|
-
window.localStorage.removeItem("ms_session_id");
|
|
122
|
-
} else {
|
|
123
|
-
console.warn("removeSessionId: window is not defined");
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
extractDomainFromHostname,
|
|
128
|
-
getMemberToken,
|
|
129
|
-
getSessionId,
|
|
130
|
-
removeMemberToken,
|
|
131
|
-
removeSessionId,
|
|
132
|
-
setApiDomain,
|
|
133
|
-
setMemberToken,
|
|
134
|
-
setMemberTokenIfAvailable,
|
|
135
|
-
setSessionId,
|
|
136
|
-
setUseCookies,
|
|
137
|
-
useCookiesValid
|
|
138
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
var MemberstackDOM = (() => {
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils/defaultMessageBox.ts
|
|
21
|
-
var defaultMessageBox_exports = {};
|
|
22
|
-
__export(defaultMessageBox_exports, {
|
|
23
|
-
addErrorBox: () => addErrorBox,
|
|
24
|
-
addSuccessBox: () => addSuccessBox,
|
|
25
|
-
initCSS: () => initCSS
|
|
26
|
-
});
|
|
27
|
-
var closeIcon;
|
|
28
|
-
if (typeof window !== "undefined") {
|
|
29
|
-
closeIcon = document.createElement("div");
|
|
30
|
-
closeIcon.setAttribute("id", "ms-status-close");
|
|
31
|
-
closeIcon.setAttribute("data-ms-message-close", "");
|
|
32
|
-
closeIcon.innerHTML = `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="white"/></svg>`;
|
|
33
|
-
}
|
|
34
|
-
var addSuccessBox = () => {
|
|
35
|
-
const successStatusIcon = document.createElement("div");
|
|
36
|
-
successStatusIcon.setAttribute("id", "ms-status-icon");
|
|
37
|
-
successStatusIcon.innerHTML = `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#62d37f"/><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0Zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8Zm4.59-12.42L8 12.17 5.41 9.59 4 11l4 4 8-8-1.41-1.42Z" fill="#fff"/></svg>`;
|
|
38
|
-
const successHTML = `<div data-ms-message class="ms-error-message">
|
|
39
|
-
${successStatusIcon.outerHTML}
|
|
40
|
-
<div id="ms-message" data-ms-message-text></div>
|
|
41
|
-
${closeIcon.outerHTML}
|
|
42
|
-
</div>`;
|
|
43
|
-
const successdiv = document.createElement("div");
|
|
44
|
-
successdiv.setAttribute("data-ms-message", "success");
|
|
45
|
-
successdiv.innerHTML = successHTML;
|
|
46
|
-
successdiv.style.display = "none";
|
|
47
|
-
document.body.appendChild(successdiv);
|
|
48
|
-
};
|
|
49
|
-
var addErrorBox = () => {
|
|
50
|
-
const errorStatusIcon = document.createElement("div");
|
|
51
|
-
errorStatusIcon.setAttribute("id", "ms-status-icon");
|
|
52
|
-
errorStatusIcon.innerHTML = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z" fill="#E40023"/></svg>`;
|
|
53
|
-
const errorHTML = `<div data-ms-message class="ms-error-message">
|
|
54
|
-
${errorStatusIcon.outerHTML}
|
|
55
|
-
<div id="ms-message" data-ms-message-text></div>
|
|
56
|
-
${closeIcon.outerHTML}
|
|
57
|
-
</div>`;
|
|
58
|
-
const errordiv = document.createElement("div");
|
|
59
|
-
errordiv.setAttribute("data-ms-message", "error");
|
|
60
|
-
errordiv.innerHTML = errorHTML;
|
|
61
|
-
errordiv.style.display = "none";
|
|
62
|
-
document.body.appendChild(errordiv);
|
|
63
|
-
};
|
|
64
|
-
var initCSS = () => {
|
|
65
|
-
const cssEl = document.createElement("style");
|
|
66
|
-
const css = `
|
|
67
|
-
@keyframes fadeIn {
|
|
68
|
-
0% {
|
|
69
|
-
opacity: 0;
|
|
70
|
-
}
|
|
71
|
-
100% {
|
|
72
|
-
opacity: 1;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.ms-error-message {
|
|
76
|
-
position: fixed;
|
|
77
|
-
left: 50%;
|
|
78
|
-
bottom: 3%;
|
|
79
|
-
transform: translate(-50%, -50%);
|
|
80
|
-
margin: 0 auto;
|
|
81
|
-
z-index: 10000000;
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
padding: 12px 16px;
|
|
85
|
-
border-radius: 8px;
|
|
86
|
-
background-color: #0A0A0A;
|
|
87
|
-
color: #fff;
|
|
88
|
-
font-size: 16.8px;
|
|
89
|
-
line-height: 28px;
|
|
90
|
-
font-weight: 500;
|
|
91
|
-
transform-origin: center;
|
|
92
|
-
animation: fadeIn 0.2s ease-in;
|
|
93
|
-
-webkit-animation: fadeIn 0.2s ease-in;
|
|
94
|
-
-moz-animation: fadeIn 0.2s ease-in;
|
|
95
|
-
-o-animation: fadeIn 0.2s ease-in;
|
|
96
|
-
-ms-animation: fadeIn 0.2s ease-in;
|
|
97
|
-
}
|
|
98
|
-
@media screen and (max-width: 768px) {
|
|
99
|
-
.ms-error-message {
|
|
100
|
-
bottom: 12px;
|
|
101
|
-
width: calc(100% - 24px);
|
|
102
|
-
max-width: none;
|
|
103
|
-
padding: 10px 12px;
|
|
104
|
-
font-size: 14px;
|
|
105
|
-
line-height: 20px;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
#ms-status-icon {
|
|
109
|
-
width: 20px;
|
|
110
|
-
height: 20px;
|
|
111
|
-
margin-right: 12px;
|
|
112
|
-
}
|
|
113
|
-
#ms-status-close {
|
|
114
|
-
margin-left: 20px;
|
|
115
|
-
cursor: pointer;
|
|
116
|
-
}
|
|
117
|
-
#ms-status-close svg {
|
|
118
|
-
height: 12px;
|
|
119
|
-
}`;
|
|
120
|
-
cssEl.setAttribute("data-ms-style", "");
|
|
121
|
-
cssEl.appendChild(document.createTextNode(css));
|
|
122
|
-
document.head.appendChild(cssEl);
|
|
123
|
-
};
|
|
124
|
-
return __toCommonJS(defaultMessageBox_exports);
|
|
125
|
-
})();
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/defaultMessageBox.ts
|
|
20
|
-
var defaultMessageBox_exports = {};
|
|
21
|
-
__export(defaultMessageBox_exports, {
|
|
22
|
-
addErrorBox: () => addErrorBox,
|
|
23
|
-
addSuccessBox: () => addSuccessBox,
|
|
24
|
-
initCSS: () => initCSS
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(defaultMessageBox_exports);
|
|
27
|
-
var closeIcon;
|
|
28
|
-
if (typeof window !== "undefined") {
|
|
29
|
-
closeIcon = document.createElement("div");
|
|
30
|
-
closeIcon.setAttribute("id", "ms-status-close");
|
|
31
|
-
closeIcon.setAttribute("data-ms-message-close", "");
|
|
32
|
-
closeIcon.innerHTML = `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="white"/></svg>`;
|
|
33
|
-
}
|
|
34
|
-
var addSuccessBox = () => {
|
|
35
|
-
const successStatusIcon = document.createElement("div");
|
|
36
|
-
successStatusIcon.setAttribute("id", "ms-status-icon");
|
|
37
|
-
successStatusIcon.innerHTML = `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#62d37f"/><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0Zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8Zm4.59-12.42L8 12.17 5.41 9.59 4 11l4 4 8-8-1.41-1.42Z" fill="#fff"/></svg>`;
|
|
38
|
-
const successHTML = `<div data-ms-message class="ms-error-message">
|
|
39
|
-
${successStatusIcon.outerHTML}
|
|
40
|
-
<div id="ms-message" data-ms-message-text></div>
|
|
41
|
-
${closeIcon.outerHTML}
|
|
42
|
-
</div>`;
|
|
43
|
-
const successdiv = document.createElement("div");
|
|
44
|
-
successdiv.setAttribute("data-ms-message", "success");
|
|
45
|
-
successdiv.innerHTML = successHTML;
|
|
46
|
-
successdiv.style.display = "none";
|
|
47
|
-
document.body.appendChild(successdiv);
|
|
48
|
-
};
|
|
49
|
-
var addErrorBox = () => {
|
|
50
|
-
const errorStatusIcon = document.createElement("div");
|
|
51
|
-
errorStatusIcon.setAttribute("id", "ms-status-icon");
|
|
52
|
-
errorStatusIcon.innerHTML = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z" fill="#E40023"/></svg>`;
|
|
53
|
-
const errorHTML = `<div data-ms-message class="ms-error-message">
|
|
54
|
-
${errorStatusIcon.outerHTML}
|
|
55
|
-
<div id="ms-message" data-ms-message-text></div>
|
|
56
|
-
${closeIcon.outerHTML}
|
|
57
|
-
</div>`;
|
|
58
|
-
const errordiv = document.createElement("div");
|
|
59
|
-
errordiv.setAttribute("data-ms-message", "error");
|
|
60
|
-
errordiv.innerHTML = errorHTML;
|
|
61
|
-
errordiv.style.display = "none";
|
|
62
|
-
document.body.appendChild(errordiv);
|
|
63
|
-
};
|
|
64
|
-
var initCSS = () => {
|
|
65
|
-
const cssEl = document.createElement("style");
|
|
66
|
-
const css = `
|
|
67
|
-
@keyframes fadeIn {
|
|
68
|
-
0% {
|
|
69
|
-
opacity: 0;
|
|
70
|
-
}
|
|
71
|
-
100% {
|
|
72
|
-
opacity: 1;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.ms-error-message {
|
|
76
|
-
position: fixed;
|
|
77
|
-
left: 50%;
|
|
78
|
-
bottom: 3%;
|
|
79
|
-
transform: translate(-50%, -50%);
|
|
80
|
-
margin: 0 auto;
|
|
81
|
-
z-index: 10000000;
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
padding: 12px 16px;
|
|
85
|
-
border-radius: 8px;
|
|
86
|
-
background-color: #0A0A0A;
|
|
87
|
-
color: #fff;
|
|
88
|
-
font-size: 16.8px;
|
|
89
|
-
line-height: 28px;
|
|
90
|
-
font-weight: 500;
|
|
91
|
-
transform-origin: center;
|
|
92
|
-
animation: fadeIn 0.2s ease-in;
|
|
93
|
-
-webkit-animation: fadeIn 0.2s ease-in;
|
|
94
|
-
-moz-animation: fadeIn 0.2s ease-in;
|
|
95
|
-
-o-animation: fadeIn 0.2s ease-in;
|
|
96
|
-
-ms-animation: fadeIn 0.2s ease-in;
|
|
97
|
-
}
|
|
98
|
-
@media screen and (max-width: 768px) {
|
|
99
|
-
.ms-error-message {
|
|
100
|
-
bottom: 12px;
|
|
101
|
-
width: calc(100% - 24px);
|
|
102
|
-
max-width: none;
|
|
103
|
-
padding: 10px 12px;
|
|
104
|
-
font-size: 14px;
|
|
105
|
-
line-height: 20px;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
#ms-status-icon {
|
|
109
|
-
width: 20px;
|
|
110
|
-
height: 20px;
|
|
111
|
-
margin-right: 12px;
|
|
112
|
-
}
|
|
113
|
-
#ms-status-close {
|
|
114
|
-
margin-left: 20px;
|
|
115
|
-
cursor: pointer;
|
|
116
|
-
}
|
|
117
|
-
#ms-status-close svg {
|
|
118
|
-
height: 12px;
|
|
119
|
-
}`;
|
|
120
|
-
cssEl.setAttribute("data-ms-style", "");
|
|
121
|
-
cssEl.appendChild(document.createTextNode(css));
|
|
122
|
-
document.head.appendChild(cssEl);
|
|
123
|
-
};
|
|
124
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
-
0 && (module.exports = {
|
|
126
|
-
addErrorBox,
|
|
127
|
-
addSuccessBox,
|
|
128
|
-
initCSS
|
|
129
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// src/utils/defaultMessageBox.ts
|
|
2
|
-
var closeIcon;
|
|
3
|
-
if (typeof window !== "undefined") {
|
|
4
|
-
closeIcon = document.createElement("div");
|
|
5
|
-
closeIcon.setAttribute("id", "ms-status-close");
|
|
6
|
-
closeIcon.setAttribute("data-ms-message-close", "");
|
|
7
|
-
closeIcon.innerHTML = `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="white"/></svg>`;
|
|
8
|
-
}
|
|
9
|
-
var addSuccessBox = () => {
|
|
10
|
-
const successStatusIcon = document.createElement("div");
|
|
11
|
-
successStatusIcon.setAttribute("id", "ms-status-icon");
|
|
12
|
-
successStatusIcon.innerHTML = `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#62d37f"/><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0Zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8Zm4.59-12.42L8 12.17 5.41 9.59 4 11l4 4 8-8-1.41-1.42Z" fill="#fff"/></svg>`;
|
|
13
|
-
const successHTML = `<div data-ms-message class="ms-error-message">
|
|
14
|
-
${successStatusIcon.outerHTML}
|
|
15
|
-
<div id="ms-message" data-ms-message-text></div>
|
|
16
|
-
${closeIcon.outerHTML}
|
|
17
|
-
</div>`;
|
|
18
|
-
const successdiv = document.createElement("div");
|
|
19
|
-
successdiv.setAttribute("data-ms-message", "success");
|
|
20
|
-
successdiv.innerHTML = successHTML;
|
|
21
|
-
successdiv.style.display = "none";
|
|
22
|
-
document.body.appendChild(successdiv);
|
|
23
|
-
};
|
|
24
|
-
var addErrorBox = () => {
|
|
25
|
-
const errorStatusIcon = document.createElement("div");
|
|
26
|
-
errorStatusIcon.setAttribute("id", "ms-status-icon");
|
|
27
|
-
errorStatusIcon.innerHTML = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z" fill="#E40023"/></svg>`;
|
|
28
|
-
const errorHTML = `<div data-ms-message class="ms-error-message">
|
|
29
|
-
${errorStatusIcon.outerHTML}
|
|
30
|
-
<div id="ms-message" data-ms-message-text></div>
|
|
31
|
-
${closeIcon.outerHTML}
|
|
32
|
-
</div>`;
|
|
33
|
-
const errordiv = document.createElement("div");
|
|
34
|
-
errordiv.setAttribute("data-ms-message", "error");
|
|
35
|
-
errordiv.innerHTML = errorHTML;
|
|
36
|
-
errordiv.style.display = "none";
|
|
37
|
-
document.body.appendChild(errordiv);
|
|
38
|
-
};
|
|
39
|
-
var initCSS = () => {
|
|
40
|
-
const cssEl = document.createElement("style");
|
|
41
|
-
const css = `
|
|
42
|
-
@keyframes fadeIn {
|
|
43
|
-
0% {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
}
|
|
46
|
-
100% {
|
|
47
|
-
opacity: 1;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
.ms-error-message {
|
|
51
|
-
position: fixed;
|
|
52
|
-
left: 50%;
|
|
53
|
-
bottom: 3%;
|
|
54
|
-
transform: translate(-50%, -50%);
|
|
55
|
-
margin: 0 auto;
|
|
56
|
-
z-index: 10000000;
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
padding: 12px 16px;
|
|
60
|
-
border-radius: 8px;
|
|
61
|
-
background-color: #0A0A0A;
|
|
62
|
-
color: #fff;
|
|
63
|
-
font-size: 16.8px;
|
|
64
|
-
line-height: 28px;
|
|
65
|
-
font-weight: 500;
|
|
66
|
-
transform-origin: center;
|
|
67
|
-
animation: fadeIn 0.2s ease-in;
|
|
68
|
-
-webkit-animation: fadeIn 0.2s ease-in;
|
|
69
|
-
-moz-animation: fadeIn 0.2s ease-in;
|
|
70
|
-
-o-animation: fadeIn 0.2s ease-in;
|
|
71
|
-
-ms-animation: fadeIn 0.2s ease-in;
|
|
72
|
-
}
|
|
73
|
-
@media screen and (max-width: 768px) {
|
|
74
|
-
.ms-error-message {
|
|
75
|
-
bottom: 12px;
|
|
76
|
-
width: calc(100% - 24px);
|
|
77
|
-
max-width: none;
|
|
78
|
-
padding: 10px 12px;
|
|
79
|
-
font-size: 14px;
|
|
80
|
-
line-height: 20px;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
#ms-status-icon {
|
|
84
|
-
width: 20px;
|
|
85
|
-
height: 20px;
|
|
86
|
-
margin-right: 12px;
|
|
87
|
-
}
|
|
88
|
-
#ms-status-close {
|
|
89
|
-
margin-left: 20px;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
}
|
|
92
|
-
#ms-status-close svg {
|
|
93
|
-
height: 12px;
|
|
94
|
-
}`;
|
|
95
|
-
cssEl.setAttribute("data-ms-style", "");
|
|
96
|
-
cssEl.appendChild(document.createTextNode(css));
|
|
97
|
-
document.head.appendChild(cssEl);
|
|
98
|
-
};
|
|
99
|
-
export {
|
|
100
|
-
addErrorBox,
|
|
101
|
-
addSuccessBox,
|
|
102
|
-
initCSS
|
|
103
|
-
};
|