@memberstack/dom 1.9.28 → 1.9.30
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/lib/auth/index.d.mts +9 -0
- package/lib/auth/index.d.ts +9 -0
- package/lib/auth/index.js +141 -0
- package/lib/auth/index.mjs +104 -0
- package/lib/constants/endpoints.d.mts +5 -0
- package/lib/constants/endpoints.d.ts +5 -0
- package/lib/constants/endpoints.js +31 -0
- package/lib/constants/endpoints.mjs +7 -0
- package/lib/index.d.mts +8 -578
- package/lib/index.d.ts +8 -578
- package/lib/methods/dom/index.d.mts +2 -0
- package/lib/methods/dom/index.d.ts +2 -0
- package/lib/methods/dom/index.js +0 -0
- package/lib/methods/dom/index.mjs +0 -0
- package/lib/methods/dom/main-dom.d.mts +14 -0
- package/lib/methods/dom/main-dom.d.ts +14 -0
- package/lib/methods/dom/main-dom.js +13766 -0
- package/lib/methods/dom/main-dom.mjs +13749 -0
- package/lib/methods/dom/methods.d.mts +12 -0
- package/lib/methods/dom/methods.d.ts +12 -0
- package/lib/methods/dom/methods.js +13972 -0
- package/lib/methods/dom/methods.mjs +13943 -0
- package/lib/methods/index.d.mts +79 -0
- package/lib/methods/index.d.ts +79 -0
- package/lib/methods/index.js +14861 -0
- package/lib/methods/index.mjs +14832 -0
- package/lib/methods/requests/index.d.mts +72 -0
- package/lib/methods/requests/index.d.ts +72 -0
- package/lib/methods/requests/index.js +912 -0
- package/lib/methods/requests/index.mjs +878 -0
- package/lib/methods/requests/requests.d.mts +31 -0
- package/lib/methods/requests/requests.d.ts +31 -0
- package/lib/methods/requests/requests.js +173 -0
- package/lib/methods/requests/requests.mjs +140 -0
- package/lib/types/index.d.mts +3 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +17 -0
- package/lib/types/index.mjs +0 -0
- package/lib/types/params.d.mts +206 -0
- package/lib/types/params.d.ts +206 -0
- package/lib/types/params.js +17 -0
- package/lib/types/params.mjs +0 -0
- package/lib/types/payloads.d.mts +64 -0
- package/lib/types/payloads.d.ts +64 -0
- package/lib/types/payloads.js +17 -0
- package/lib/types/payloads.mjs +0 -0
- package/lib/types/utils/payloads.d.mts +296 -0
- package/lib/types/utils/payloads.d.ts +296 -0
- package/lib/types/utils/payloads.js +17 -0
- package/lib/types/utils/payloads.mjs +0 -0
- package/lib/utils/cookies.d.mts +7 -0
- package/lib/utils/cookies.d.ts +7 -0
- package/lib/utils/cookies.js +120 -0
- package/lib/utils/cookies.mjs +85 -0
- package/lib/utils/defaultMessageBox.d.mts +5 -0
- package/lib/utils/defaultMessageBox.d.ts +5 -0
- package/lib/utils/defaultMessageBox.js +119 -0
- package/lib/utils/defaultMessageBox.mjs +93 -0
- package/package.json +8 -8
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
#ms-status-icon {
|
|
74
|
+
width: 20px;
|
|
75
|
+
height: 20px;
|
|
76
|
+
margin-right: 12px;
|
|
77
|
+
}
|
|
78
|
+
#ms-status-close {
|
|
79
|
+
margin-left: 20px;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
}
|
|
82
|
+
#ms-status-close svg {
|
|
83
|
+
height: 12px;
|
|
84
|
+
}`;
|
|
85
|
+
cssEl.setAttribute("data-ms-style", "");
|
|
86
|
+
cssEl.appendChild(document.createTextNode(css));
|
|
87
|
+
document.head.appendChild(cssEl);
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
addErrorBox,
|
|
91
|
+
addSuccessBox,
|
|
92
|
+
initCSS
|
|
93
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberstack/dom",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.30",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"js-cookie": "^3.0.1"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"dev": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT
|
|
19
|
-
"build": "tsup --format esm,cjs --dts --env.API_ENDPOINT
|
|
18
|
+
"dev": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT https://client.memberstack.com",
|
|
19
|
+
"build": "tsup --format esm,cjs --dts --env.API_ENDPOINT https://client.memberstack.com",
|
|
20
20
|
"prepublishOnly": "yarn workspace prebuilt-uis build && yarn build:local",
|
|
21
|
-
"prepublishOnly:porter-prod": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT
|
|
22
|
-
"prepublishOnly:porter-dev": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT
|
|
21
|
+
"prepublishOnly:porter-prod": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT https://client.memberstack.com",
|
|
22
|
+
"prepublishOnly:porter-dev": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT https://dev-client.memberstack.com",
|
|
23
23
|
"watch": "tsc-watch",
|
|
24
|
-
"watch:dev": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT
|
|
25
|
-
"watch:dev-ngrok": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT
|
|
26
|
-
"watch:dev-api": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT
|
|
24
|
+
"watch:dev": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT http://localhost:3005",
|
|
25
|
+
"watch:dev-ngrok": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT https://client-testing.ngrok.io",
|
|
26
|
+
"watch:dev-api": "tsup --format esm,cjs --dts --watch --env.API_ENDPOINT https://dev-client.memberstack.com",
|
|
27
27
|
"clean": "rm -rf node_modules lib",
|
|
28
28
|
"deploy:latest": "npx np --tag latest --no-tests --any-branch",
|
|
29
29
|
"deploy:next": "npx np --tag next --no-tests --any-branch",
|