@calimero-network/mero-react 9.14.1 → 9.16.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/README.md +32 -1
- package/dist/index.cjs +345 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.js +343 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -28,7 +28,7 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// src/components/styles.css
|
|
31
|
-
styleInject(':root {\n --mero-bg: #0d1117;\n --mero-bg-secondary: #161b22;\n --mero-bg-tertiary: #1c2128;\n --mero-text: #e6edf3;\n --mero-text-secondary: #8b949e;\n --mero-accent: #a5ff11;\n --mero-accent-hover: #8ed40d;\n --mero-on-primary: #0d1117;\n --mero-error: #ff6b6b;\n --mero-border: #30363d;\n --mero-disabled: #555555;\n --mero-shadow: rgba(0, 0, 0, 0.5);\n --mero-overlay: rgba(0, 0, 0, 0.75);\n --mero-radius: 8px;\n}\n.mero-connect-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 20px;\n background-color: var(--mero-accent);\n border: 1px solid var(--mero-accent);\n border-radius: var(--mero-radius);\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.01em;\n color: var(--mero-on-primary);\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n box-shadow 0.15s ease,\n transform 0.1s ease;\n min-width: 140px;\n box-sizing: border-box;\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n line-height: 1;\n}\n.mero-connect-button:hover:not(.mero-connected):not(.mero-reconnecting) {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n box-shadow: 0 0 0 4px rgba(165, 255, 17, 0.18);\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--mero-accent) 18%, transparent);\n}\n.mero-connect-button:active:not(.mero-connected):not(.mero-reconnecting) {\n transform: translateY(1px);\n}\n.mero-connect-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px rgba(165, 255, 17, 0.45);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mero-accent) 45%, transparent);\n}\n.mero-connect-button.mero-logo-only {\n min-width: 0;\n width: 40px;\n height: 40px;\n padding: 0;\n gap: 0;\n}\n.mero-connect-button.mero-connected {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n border-color: var(--mero-accent);\n}\n.mero-connect-button.mero-connected:hover {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n}\n.mero-connect-button.mero-reconnecting {\n background-color: var(--mero-bg-secondary);\n color: var(--mero-text-secondary);\n border-color: var(--mero-border);\n cursor: not-allowed;\n}\n.mero-connect-container {\n position: relative;\n display: inline-block;\n}\n.mero-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n background-color: var(--mero-bg-secondary);\n border: 1px solid var(--mero-border);\n border-radius: var(--mero-radius);\n margin-top: 6px;\n padding: 0;\n z-index: 1001;\n width: 100%;\n min-width: 180px;\n overflow: hidden;\n box-shadow: 0 8px 24px var(--mero-shadow);\n}\n.mero-dropdown-info {\n padding: 10px 16px;\n color: var(--mero-text-secondary);\n font-size: 13px;\n border-bottom: 1px solid var(--mero-border);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n.mero-dropdown-item {\n display: block;\n width: 100%;\n padding: 10px 16px;\n background: none;\n border: none;\n color: var(--mero-text);\n text-align: left;\n cursor: pointer;\n font-size: 14px;\n text-decoration: none;\n font-family: inherit;\n}\n.mero-dropdown-item:hover {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-logo {\n width: 24px;\n height: 24px;\n color: currentColor;\n}\n@keyframes meroFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes meroSlideIn {\n from {\n transform: translateY(-12px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n@keyframes meroSpin {\n to {\n transform: rotate(360deg);\n }\n}\n.mero-invite-overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483646;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n background: var(--mero-overlay);\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n.mero-invite-dialog {\n box-sizing: border-box;\n width: min(420px, 100%);\n padding: 24px;\n border: 1px solid var(--mero-border);\n border-radius: calc(var(--mero-radius) * 1.5);\n background: var(--mero-bg-secondary);\n color: var(--mero-text);\n box-shadow: 0 16px 48px var(--mero-shadow);\n outline: none;\n animation: mero-invite-in 0.16s ease-out;\n}\n.mero-invite-app {\n margin: 0 0 12px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mero-text-secondary);\n}\n.mero-invite-head {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.mero-invite-title {\n margin: 0;\n min-width: 0;\n font-size: 18px;\n font-weight: 600;\n line-height: 1.3;\n overflow-wrap: anywhere;\n}\n.mero-invite-body {\n margin: 12px 0 0;\n font-size: 14px;\n line-height: 1.5;\n color: var(--mero-text-secondary);\n}\n.mero-invite-body-error {\n color: var(--mero-error);\n}\n.mero-invite-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n background: var(--mero-bg-tertiary);\n color: var(--mero-accent);\n}\n.mero-invite-icon-error {\n color: var(--mero-error);\n}\n.mero-invite-spinner {\n box-sizing: border-box;\n width: 36px;\n height: 36px;\n border: 3px solid var(--mero-bg-tertiary);\n border-top-color: var(--mero-accent);\n background: none;\n animation: mero-invite-spin 0.8s linear infinite;\n}\n.mero-invite-progress {\n position: relative;\n height: 3px;\n margin-top: 16px;\n overflow: hidden;\n border-radius: 2px;\n background: var(--mero-bg-tertiary);\n}\n.mero-invite-progress-bar {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 40%;\n border-radius: 2px;\n background: var(--mero-accent);\n animation: mero-invite-progress 1.4s ease-in-out infinite;\n}\n.mero-invite-actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 20px;\n}\n.mero-invite-actions:empty {\n display: none;\n}\n.mero-invite-button {\n padding: 9px 16px;\n border-radius: var(--mero-radius);\n font: inherit;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.2;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n}\n.mero-invite-button:focus-visible {\n outline: 2px solid var(--mero-accent);\n outline-offset: 2px;\n}\n.mero-invite-primary {\n border: 1px solid var(--mero-accent);\n background: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-invite-primary:hover {\n border-color: var(--mero-accent-hover);\n background: var(--mero-accent-hover);\n}\n.mero-invite-secondary {\n border: 1px solid var(--mero-border);\n background: transparent;\n color: var(--mero-text);\n}\n.mero-invite-secondary:hover {\n background: var(--mero-bg-tertiary);\n}\n@keyframes mero-invite-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes mero-invite-progress {\n from {\n left: -40%;\n }\n to {\n left: 100%;\n }\n}\n@keyframes mero-invite-in {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .mero-invite-dialog,\n .mero-invite-spinner,\n .mero-invite-progress-bar {\n animation: none;\n }\n}\n');
|
|
31
|
+
styleInject(':root {\n --mero-bg: #0d1117;\n --mero-bg-secondary: #161b22;\n --mero-bg-tertiary: #1c2128;\n --mero-text: #e6edf3;\n --mero-text-secondary: #8b949e;\n --mero-accent: #a5ff11;\n --mero-accent-hover: #8ed40d;\n --mero-on-primary: #0d1117;\n --mero-error: #ff6b6b;\n --mero-border: #30363d;\n --mero-disabled: #555555;\n --mero-shadow: rgba(0, 0, 0, 0.5);\n --mero-overlay: rgba(0, 0, 0, 0.75);\n --mero-radius: 8px;\n}\n.mero-connect-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 20px;\n background-color: var(--mero-accent);\n border: 1px solid var(--mero-accent);\n border-radius: var(--mero-radius);\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.01em;\n color: var(--mero-on-primary);\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n box-shadow 0.15s ease,\n transform 0.1s ease;\n min-width: 140px;\n box-sizing: border-box;\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n line-height: 1;\n}\n.mero-connect-button:hover:not(.mero-connected):not(.mero-reconnecting) {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n box-shadow: 0 0 0 4px rgba(165, 255, 17, 0.18);\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--mero-accent) 18%, transparent);\n}\n.mero-connect-button:active:not(.mero-connected):not(.mero-reconnecting) {\n transform: translateY(1px);\n}\n.mero-connect-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px rgba(165, 255, 17, 0.45);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mero-accent) 45%, transparent);\n}\n.mero-connect-button.mero-logo-only {\n min-width: 0;\n width: 40px;\n height: 40px;\n padding: 0;\n gap: 0;\n}\n.mero-connect-button.mero-connected {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n border-color: var(--mero-accent);\n}\n.mero-connect-button.mero-connected:hover {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n}\n.mero-connect-button.mero-reconnecting {\n background-color: var(--mero-bg-secondary);\n color: var(--mero-text-secondary);\n border-color: var(--mero-border);\n cursor: not-allowed;\n}\n.mero-connect-container {\n position: relative;\n display: inline-block;\n}\n.mero-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n background-color: var(--mero-bg-secondary);\n border: 1px solid var(--mero-border);\n border-radius: var(--mero-radius);\n margin-top: 6px;\n padding: 0;\n z-index: 1001;\n width: 100%;\n min-width: 180px;\n overflow: hidden;\n box-shadow: 0 8px 24px var(--mero-shadow);\n}\n.mero-dropdown-info {\n padding: 10px 16px;\n color: var(--mero-text-secondary);\n font-size: 13px;\n border-bottom: 1px solid var(--mero-border);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n.mero-dropdown-item {\n display: block;\n width: 100%;\n padding: 10px 16px;\n background: none;\n border: none;\n color: var(--mero-text);\n text-align: left;\n cursor: pointer;\n font-size: 14px;\n text-decoration: none;\n font-family: inherit;\n}\n.mero-dropdown-item:hover {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-logo {\n width: 24px;\n height: 24px;\n color: currentColor;\n}\n@keyframes meroFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes meroSlideIn {\n from {\n transform: translateY(-12px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n@keyframes meroSpin {\n to {\n transform: rotate(360deg);\n }\n}\n.mero-invite-overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483646;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n background: var(--mero-overlay);\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n.mero-invite-dialog {\n box-sizing: border-box;\n width: min(420px, 100%);\n padding: 24px;\n border: 1px solid var(--mero-border);\n border-radius: calc(var(--mero-radius) * 1.5);\n background: var(--mero-bg-secondary);\n color: var(--mero-text);\n box-shadow: 0 16px 48px var(--mero-shadow);\n outline: none;\n animation: mero-invite-in 0.16s ease-out;\n}\n.mero-invite-app {\n margin: 0 0 12px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mero-text-secondary);\n}\n.mero-invite-head {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.mero-invite-title {\n margin: 0;\n min-width: 0;\n font-size: 18px;\n font-weight: 600;\n line-height: 1.3;\n overflow-wrap: anywhere;\n}\n.mero-invite-body {\n margin: 12px 0 0;\n font-size: 14px;\n line-height: 1.5;\n color: var(--mero-text-secondary);\n}\n.mero-invite-body-error {\n color: var(--mero-error);\n}\n.mero-invite-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n background: var(--mero-bg-tertiary);\n color: var(--mero-accent);\n}\n.mero-invite-icon-error {\n color: var(--mero-error);\n}\n.mero-invite-spinner {\n box-sizing: border-box;\n width: 36px;\n height: 36px;\n border: 3px solid var(--mero-bg-tertiary);\n border-top-color: var(--mero-accent);\n background: none;\n animation: mero-invite-spin 0.8s linear infinite;\n}\n.mero-invite-progress {\n position: relative;\n height: 3px;\n margin-top: 16px;\n overflow: hidden;\n border-radius: 2px;\n background: var(--mero-bg-tertiary);\n}\n.mero-invite-progress-bar {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 40%;\n border-radius: 2px;\n background: var(--mero-accent);\n animation: mero-invite-progress 1.4s ease-in-out infinite;\n}\n.mero-invite-actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 20px;\n}\n.mero-invite-actions:empty {\n display: none;\n}\n.mero-invite-button {\n padding: 9px 16px;\n border-radius: var(--mero-radius);\n font: inherit;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.2;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n}\n.mero-invite-button:focus-visible {\n outline: 2px solid var(--mero-accent);\n outline-offset: 2px;\n}\n.mero-invite-primary {\n border: 1px solid var(--mero-accent);\n background: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-invite-primary:hover {\n border-color: var(--mero-accent-hover);\n background: var(--mero-accent-hover);\n}\n.mero-invite-secondary {\n border: 1px solid var(--mero-border);\n background: transparent;\n color: var(--mero-text);\n}\n.mero-invite-secondary:hover {\n background: var(--mero-bg-tertiary);\n}\n.mero-invite-landing {\n position: fixed;\n inset: 0;\n z-index: 9999;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n overflow-y: auto;\n background: var(--mero-bg);\n color: var(--mero-text);\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n.mero-invite-landing-card {\n width: min(460px, 100%);\n}\n.mero-invite-landing-card .mero-invite-title {\n font-size: 22px;\n}\n.mero-invite-landing-login {\n display: inline-flex;\n}\n.mero-invite-landing-login .mero-connect-button {\n min-width: 0;\n padding: 9px 16px;\n line-height: 1.2;\n}\n@keyframes mero-invite-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes mero-invite-progress {\n from {\n left: -40%;\n }\n to {\n left: 100%;\n }\n}\n@keyframes mero-invite-in {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .mero-invite-dialog,\n .mero-invite-spinner,\n .mero-invite-progress-bar {\n animation: none;\n }\n}\n');
|
|
32
32
|
|
|
33
33
|
// src/types.ts
|
|
34
34
|
var AppMode = /* @__PURE__ */ ((AppMode2) => {
|
|
@@ -813,28 +813,46 @@ function AccountSignInPanel({
|
|
|
813
813
|
}
|
|
814
814
|
};
|
|
815
815
|
}, [theme]);
|
|
816
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
"
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
816
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
817
|
+
"div",
|
|
818
|
+
{
|
|
819
|
+
className: "mero-login-account",
|
|
820
|
+
style: styles.root,
|
|
821
|
+
"data-testid": "account-sign-in-panel",
|
|
822
|
+
children: [
|
|
823
|
+
note && /* @__PURE__ */ jsxRuntime.jsx(
|
|
824
|
+
"p",
|
|
825
|
+
{
|
|
826
|
+
className: "mero-login-note",
|
|
827
|
+
style: styles.note,
|
|
828
|
+
role: "status",
|
|
829
|
+
"data-testid": "account-note",
|
|
830
|
+
children: note
|
|
831
|
+
}
|
|
832
|
+
),
|
|
833
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mero-login-info", style: styles.info, children: "You will approve a device key on the wallet's own page, then come back here. The relay never sees your account root \u2014 only the certificate it signed." }),
|
|
834
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mero-login-info", style: styles.info, children: "That one certificate is all of it: finding the relay that serves your account, writing through it, reading your own contexts and namespaces, and live events. Nothing to paste in." }),
|
|
835
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-login-actions", style: styles.buttonGroup, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
836
|
+
"button",
|
|
837
|
+
{
|
|
838
|
+
type: "button",
|
|
839
|
+
className: "mero-login-button mero-login-primary",
|
|
840
|
+
style: styles.button,
|
|
841
|
+
onClick: onEnrol,
|
|
842
|
+
"data-testid": "enrol-button",
|
|
843
|
+
children: "Enrol with your account"
|
|
844
|
+
}
|
|
845
|
+
) }),
|
|
846
|
+
customWallet && walletUrl && /* Shown only when an app overrode it, so a local rig can see at a
|
|
847
|
+
glance that it is not enrolling against the hosted wallet. */
|
|
848
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mero-login-hint", style: styles.hint, children: [
|
|
849
|
+
"Enrolling at ",
|
|
850
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: walletUrl }),
|
|
851
|
+
", not the hosted wallet."
|
|
852
|
+
] })
|
|
853
|
+
]
|
|
854
|
+
}
|
|
855
|
+
);
|
|
838
856
|
}
|
|
839
857
|
var DEVICE_KEY = "calimero.device";
|
|
840
858
|
var STATE_KEY = "calimero.enrol.state";
|
|
@@ -1109,7 +1127,10 @@ function buildStyles(t) {
|
|
|
1109
1127
|
width: "100%",
|
|
1110
1128
|
position: "relative",
|
|
1111
1129
|
border: `1px solid ${border}`,
|
|
1112
|
-
|
|
1130
|
+
// Not a theme token, so an app could not reach it past the inline style:
|
|
1131
|
+
// `--mero-login-shadow` replaces it whole. Unset, it is the shadow and
|
|
1132
|
+
// accent ring the dialog always had.
|
|
1133
|
+
boxShadow: `var(--mero-login-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px ${accentGlow})`,
|
|
1113
1134
|
animation: "meroSlideIn 0.25s ease-out",
|
|
1114
1135
|
color: text
|
|
1115
1136
|
},
|
|
@@ -1432,6 +1453,7 @@ function LoginModal({
|
|
|
1432
1453
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1433
1454
|
"label",
|
|
1434
1455
|
{
|
|
1456
|
+
className: active ? "mero-login-option mero-login-option-active" : "mero-login-option",
|
|
1435
1457
|
"data-testid": `node-option-${value === CUSTOM_SELECTION ? "custom" : displayNodeUrl(value)}`,
|
|
1436
1458
|
style: {
|
|
1437
1459
|
...styles.radioItem,
|
|
@@ -1452,15 +1474,16 @@ function LoginModal({
|
|
|
1452
1474
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1453
1475
|
"span",
|
|
1454
1476
|
{
|
|
1477
|
+
className: "mero-login-option-indicator",
|
|
1455
1478
|
style: {
|
|
1456
1479
|
...styles.radioIndicator,
|
|
1457
1480
|
...active ? styles.radioIndicatorActive : {}
|
|
1458
1481
|
},
|
|
1459
|
-
children: active && /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles.radioDot })
|
|
1482
|
+
children: active && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mero-login-option-dot", style: styles.radioDot })
|
|
1460
1483
|
}
|
|
1461
1484
|
),
|
|
1462
1485
|
label,
|
|
1463
|
-
meta && /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles.nodeMeta, children: meta })
|
|
1486
|
+
meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mero-login-option-meta", style: styles.nodeMeta, children: meta })
|
|
1464
1487
|
]
|
|
1465
1488
|
},
|
|
1466
1489
|
value
|
|
@@ -1469,16 +1492,25 @@ function LoginModal({
|
|
|
1469
1492
|
};
|
|
1470
1493
|
const renderNodeSection = () => {
|
|
1471
1494
|
if (discovering) {
|
|
1472
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1495
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1496
|
+
"div",
|
|
1497
|
+
{
|
|
1498
|
+
className: "mero-login-discovering",
|
|
1499
|
+
style: styles.discovering,
|
|
1500
|
+
"data-testid": "node-discovering",
|
|
1501
|
+
children: [
|
|
1502
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-login-spinner", style: styles.spinnerSmall }),
|
|
1503
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "Searching for local nodes..." })
|
|
1504
|
+
]
|
|
1505
|
+
}
|
|
1506
|
+
);
|
|
1476
1507
|
}
|
|
1477
1508
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1478
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: styles.info, children: hasDiscovered ? "Select your Calimero node to continue." : "No local node found. Enter a node URL to continue." }),
|
|
1509
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mero-login-info", style: styles.info, children: hasDiscovered ? "Select your Calimero node to continue." : "No local node found. Enter a node URL to continue." }),
|
|
1479
1510
|
hasDiscovered && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1480
1511
|
"div",
|
|
1481
1512
|
{
|
|
1513
|
+
className: "mero-login-options",
|
|
1482
1514
|
style: styles.radioList,
|
|
1483
1515
|
role: "radiogroup",
|
|
1484
1516
|
"aria-label": "Available nodes",
|
|
@@ -1497,6 +1529,7 @@ function LoginModal({
|
|
|
1497
1529
|
value: customUrl,
|
|
1498
1530
|
onChange: (e) => setCustomUrl(e.target.value),
|
|
1499
1531
|
placeholder: "https://your-node-url.calimero.network",
|
|
1532
|
+
className: "mero-login-input",
|
|
1500
1533
|
style: styles.input,
|
|
1501
1534
|
"data-testid": "node-url-input",
|
|
1502
1535
|
autoFocus: !hasDiscovered,
|
|
@@ -1507,10 +1540,11 @@ function LoginModal({
|
|
|
1507
1540
|
}
|
|
1508
1541
|
}
|
|
1509
1542
|
),
|
|
1510
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles.toolbar, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1543
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-login-toolbar", style: styles.toolbar, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1511
1544
|
"button",
|
|
1512
1545
|
{
|
|
1513
1546
|
type: "button",
|
|
1547
|
+
className: "mero-login-rescan",
|
|
1514
1548
|
style: styles.rescan,
|
|
1515
1549
|
onClick: () => setScanNonce((n) => n + 1),
|
|
1516
1550
|
"data-testid": "rescan-button",
|
|
@@ -1520,15 +1554,16 @@ function LoginModal({
|
|
|
1520
1554
|
] });
|
|
1521
1555
|
};
|
|
1522
1556
|
const renderNodeBody = () => {
|
|
1523
|
-
const body = loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles.loading, children: [
|
|
1557
|
+
const body = loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mero-login-loading", style: styles.loading, children: [
|
|
1524
1558
|
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "Connecting to node..." }),
|
|
1525
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles.spinner })
|
|
1559
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-login-spinner", style: styles.spinner })
|
|
1526
1560
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1527
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: styles.error, children: error }),
|
|
1561
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mero-login-error", style: styles.error, children: error }),
|
|
1528
1562
|
renderNodeSection(),
|
|
1529
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles.buttonGroup, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1563
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-login-actions", style: styles.buttonGroup, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1530
1564
|
"button",
|
|
1531
1565
|
{
|
|
1566
|
+
className: "mero-login-button mero-login-primary",
|
|
1532
1567
|
onClick: handleConnect,
|
|
1533
1568
|
disabled: !canConnect,
|
|
1534
1569
|
style: {
|
|
@@ -1544,6 +1579,7 @@ function LoginModal({
|
|
|
1544
1579
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1545
1580
|
"div",
|
|
1546
1581
|
{
|
|
1582
|
+
className: "mero-login-panel",
|
|
1547
1583
|
role: "tabpanel",
|
|
1548
1584
|
id: "mero-login-panel-node",
|
|
1549
1585
|
"aria-labelledby": "mero-login-tab-node",
|
|
@@ -1566,62 +1602,105 @@ function LoginModal({
|
|
|
1566
1602
|
e.preventDefault();
|
|
1567
1603
|
selectTab(TABS[next].id);
|
|
1568
1604
|
};
|
|
1569
|
-
const renderTabs = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
"
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1605
|
+
const renderTabs = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1606
|
+
"div",
|
|
1607
|
+
{
|
|
1608
|
+
className: "mero-login-tabs",
|
|
1609
|
+
role: "tablist",
|
|
1610
|
+
"aria-label": "How to connect",
|
|
1611
|
+
style: styles.tabList,
|
|
1612
|
+
children: TABS.map((t) => {
|
|
1613
|
+
const selected2 = activeTab === t.id;
|
|
1614
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1615
|
+
"button",
|
|
1616
|
+
{
|
|
1617
|
+
ref: (el) => {
|
|
1618
|
+
tabRefs.current[t.id] = el;
|
|
1619
|
+
},
|
|
1620
|
+
type: "button",
|
|
1621
|
+
className: selected2 ? "mero-login-tab mero-login-tab-active" : "mero-login-tab",
|
|
1622
|
+
role: "tab",
|
|
1623
|
+
id: `mero-login-tab-${t.id}`,
|
|
1624
|
+
"aria-selected": selected2,
|
|
1625
|
+
"aria-controls": `mero-login-panel-${t.id}`,
|
|
1626
|
+
tabIndex: selected2 ? 0 : -1,
|
|
1627
|
+
onClick: () => setTab(t.id),
|
|
1628
|
+
onKeyDown: onTabKeyDown,
|
|
1629
|
+
style: { ...styles.tab, ...selected2 ? styles.tabActive : {} },
|
|
1630
|
+
"data-testid": `login-tab-${t.id}`,
|
|
1631
|
+
children: t.label
|
|
1632
|
+
},
|
|
1633
|
+
t.id
|
|
1634
|
+
);
|
|
1635
|
+
})
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1592
1638
|
const modalContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1593
1639
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1594
1640
|
@keyframes meroSpin { to { transform: rotate(360deg); } }
|
|
1595
1641
|
@keyframes meroFadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
1596
1642
|
@keyframes meroSlideIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
1597
1643
|
` }),
|
|
1598
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1644
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1645
|
+
"div",
|
|
1646
|
+
{
|
|
1647
|
+
className: "mero-login-overlay",
|
|
1648
|
+
style: { ...themeVars, ...styles.overlay },
|
|
1649
|
+
onClick: onClose,
|
|
1650
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1651
|
+
"div",
|
|
1652
|
+
{
|
|
1653
|
+
className: "mero-login-dialog",
|
|
1654
|
+
style: styles.content,
|
|
1655
|
+
onClick: (e) => e.stopPropagation(),
|
|
1656
|
+
children: [
|
|
1657
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1658
|
+
"button",
|
|
1659
|
+
{
|
|
1660
|
+
className: "mero-login-close",
|
|
1661
|
+
style: styles.closeButton,
|
|
1662
|
+
onClick: onClose,
|
|
1663
|
+
"aria-label": "Close",
|
|
1664
|
+
children: "\xD7"
|
|
1665
|
+
}
|
|
1666
|
+
),
|
|
1667
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mero-login-header", style: styles.header, children: [
|
|
1668
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1669
|
+
CalimeroLogo,
|
|
1670
|
+
{
|
|
1671
|
+
size: 44,
|
|
1672
|
+
color: cssVar(resolved, "primary"),
|
|
1673
|
+
className: "mero-login-logo"
|
|
1674
|
+
}
|
|
1675
|
+
),
|
|
1676
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "mero-login-title", style: styles.title, children: "Connect to Calimero" })
|
|
1677
|
+
] }),
|
|
1678
|
+
cloudTab && renderTabs(),
|
|
1679
|
+
activeTab === "cloud" && cloudTab ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1680
|
+
"div",
|
|
1681
|
+
{
|
|
1682
|
+
className: "mero-login-panel",
|
|
1683
|
+
role: "tabpanel",
|
|
1684
|
+
id: "mero-login-panel-cloud",
|
|
1685
|
+
"aria-labelledby": "mero-login-tab-cloud",
|
|
1686
|
+
tabIndex: 0,
|
|
1687
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1688
|
+
AccountSignInPanel,
|
|
1689
|
+
{
|
|
1690
|
+
onEnrol: cloudTab.onEnrol,
|
|
1691
|
+
note: cloudTab.note,
|
|
1692
|
+
walletUrl: cloudTab.walletUrl,
|
|
1693
|
+
customWallet: cloudTab.customWallet,
|
|
1694
|
+
theme
|
|
1695
|
+
}
|
|
1696
|
+
)
|
|
1697
|
+
}
|
|
1698
|
+
) : renderNodeBody()
|
|
1699
|
+
]
|
|
1700
|
+
}
|
|
1701
|
+
)
|
|
1702
|
+
}
|
|
1703
|
+
)
|
|
1625
1704
|
] });
|
|
1626
1705
|
return reactDom.createPortal(modalContent, document.body);
|
|
1627
1706
|
}
|
|
@@ -3972,6 +4051,10 @@ function buildInviteLink(slug, token, extra = {}) {
|
|
|
3972
4051
|
}
|
|
3973
4052
|
return createLink(slug, JOIN_ACTION, params);
|
|
3974
4053
|
}
|
|
4054
|
+
var watchers = /* @__PURE__ */ new Set();
|
|
4055
|
+
function notifyWatchers() {
|
|
4056
|
+
for (const watcher of watchers) watcher();
|
|
4057
|
+
}
|
|
3975
4058
|
var MAX_AUTO_JOIN_ATTEMPTS = 3;
|
|
3976
4059
|
var listeners = /* @__PURE__ */ new Set();
|
|
3977
4060
|
var buffered = null;
|
|
@@ -4057,6 +4140,7 @@ function urlWithoutInvitation(href) {
|
|
|
4057
4140
|
}
|
|
4058
4141
|
function deliver(invitation) {
|
|
4059
4142
|
current = invitation;
|
|
4143
|
+
notifyWatchers();
|
|
4060
4144
|
if (listeners.size === 0) {
|
|
4061
4145
|
buffered = invitation;
|
|
4062
4146
|
return;
|
|
@@ -4095,8 +4179,12 @@ function ensureController() {
|
|
|
4095
4179
|
params: { ...intent.params, [INVITATION_PARAM]: token },
|
|
4096
4180
|
resolve: () => {
|
|
4097
4181
|
forgetAttempts(token);
|
|
4098
|
-
if (
|
|
4182
|
+
if (buffered?.token === token) buffered = null;
|
|
4099
4183
|
intent.resolve();
|
|
4184
|
+
if (current?.token === token) {
|
|
4185
|
+
current = null;
|
|
4186
|
+
notifyWatchers();
|
|
4187
|
+
}
|
|
4100
4188
|
},
|
|
4101
4189
|
autoJoin: spendAttempt(token)
|
|
4102
4190
|
});
|
|
@@ -4124,6 +4212,13 @@ function peekInvitation() {
|
|
|
4124
4212
|
ensureController();
|
|
4125
4213
|
return current;
|
|
4126
4214
|
}
|
|
4215
|
+
function subscribeInvitation(watcher) {
|
|
4216
|
+
ensureController();
|
|
4217
|
+
watchers.add(watcher);
|
|
4218
|
+
return () => {
|
|
4219
|
+
watchers.delete(watcher);
|
|
4220
|
+
};
|
|
4221
|
+
}
|
|
4127
4222
|
function resetInvitationCaptureForTests() {
|
|
4128
4223
|
controller?.dispose();
|
|
4129
4224
|
controller = null;
|
|
@@ -4132,6 +4227,7 @@ function resetInvitationCaptureForTests() {
|
|
|
4132
4227
|
current = null;
|
|
4133
4228
|
attemptsKey = "calimero:invitation-attempts";
|
|
4134
4229
|
ownSlugs = /* @__PURE__ */ new Set();
|
|
4230
|
+
notifyWatchers();
|
|
4135
4231
|
}
|
|
4136
4232
|
|
|
4137
4233
|
// src/invitations/describeInviteFailure.ts
|
|
@@ -4745,6 +4841,165 @@ function Spinner() {
|
|
|
4745
4841
|
}
|
|
4746
4842
|
);
|
|
4747
4843
|
}
|
|
4844
|
+
function usePendingInvitation() {
|
|
4845
|
+
return react.useSyncExternalStore(subscribeInvitation, peekInvitation, () => null);
|
|
4846
|
+
}
|
|
4847
|
+
function InvitationGate({
|
|
4848
|
+
children,
|
|
4849
|
+
parse,
|
|
4850
|
+
noun = "team",
|
|
4851
|
+
appName,
|
|
4852
|
+
detail,
|
|
4853
|
+
connectButtonProps
|
|
4854
|
+
}) {
|
|
4855
|
+
const session = react.useContext(MeroContext);
|
|
4856
|
+
const pending = usePendingInvitation();
|
|
4857
|
+
const parsed = react.useMemo(() => {
|
|
4858
|
+
if (!pending || !parse) return null;
|
|
4859
|
+
try {
|
|
4860
|
+
const result = parse(pending.token, pending.params);
|
|
4861
|
+
return result?.namespaceId ? result : void 0;
|
|
4862
|
+
} catch {
|
|
4863
|
+
return void 0;
|
|
4864
|
+
}
|
|
4865
|
+
}, [pending, parse]);
|
|
4866
|
+
const state = !pending || !session || session.isAuthenticated ? null : session.isLoading ? "checking" : parsed === void 0 ? "invalid" : "invited";
|
|
4867
|
+
if (!state) return children === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
4868
|
+
const page = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4869
|
+
InvitationScreen,
|
|
4870
|
+
{
|
|
4871
|
+
state,
|
|
4872
|
+
teamName: parsed?.teamName,
|
|
4873
|
+
noun,
|
|
4874
|
+
appName,
|
|
4875
|
+
detail,
|
|
4876
|
+
connectButtonProps,
|
|
4877
|
+
onDecline: () => pending?.resolve()
|
|
4878
|
+
}
|
|
4879
|
+
);
|
|
4880
|
+
if (children !== void 0 || typeof document === "undefined") return page;
|
|
4881
|
+
return reactDom.createPortal(page, document.body);
|
|
4882
|
+
}
|
|
4883
|
+
function InvitationScreen({
|
|
4884
|
+
state,
|
|
4885
|
+
teamName,
|
|
4886
|
+
noun,
|
|
4887
|
+
appName,
|
|
4888
|
+
detail,
|
|
4889
|
+
connectButtonProps,
|
|
4890
|
+
onDecline
|
|
4891
|
+
}) {
|
|
4892
|
+
const titleId = react.useId();
|
|
4893
|
+
const bodyId = react.useId();
|
|
4894
|
+
const cardRef = react.useRef(null);
|
|
4895
|
+
const loginRef = react.useRef(null);
|
|
4896
|
+
const continueRef = react.useRef(null);
|
|
4897
|
+
react.useEffect(() => {
|
|
4898
|
+
if (state === "checking") return;
|
|
4899
|
+
const target = state === "invited" ? loginRef.current?.querySelector("button") : continueRef.current;
|
|
4900
|
+
(target ?? cardRef.current)?.focus();
|
|
4901
|
+
}, [state]);
|
|
4902
|
+
const onKeyDown = (event) => {
|
|
4903
|
+
if (event.key !== "Tab" || !cardRef.current) return;
|
|
4904
|
+
const focusable = cardRef.current.querySelectorAll(
|
|
4905
|
+
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'
|
|
4906
|
+
);
|
|
4907
|
+
if (focusable.length === 0) return;
|
|
4908
|
+
const first = focusable[0];
|
|
4909
|
+
const last = focusable[focusable.length - 1];
|
|
4910
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
4911
|
+
event.preventDefault();
|
|
4912
|
+
last.focus();
|
|
4913
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
4914
|
+
event.preventDefault();
|
|
4915
|
+
first.focus();
|
|
4916
|
+
}
|
|
4917
|
+
};
|
|
4918
|
+
if (state === "checking") {
|
|
4919
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4920
|
+
"div",
|
|
4921
|
+
{
|
|
4922
|
+
className: "mero-invite-landing",
|
|
4923
|
+
role: "status",
|
|
4924
|
+
"aria-busy": "true",
|
|
4925
|
+
"aria-label": "Checking your session",
|
|
4926
|
+
"data-testid": "invite-landing",
|
|
4927
|
+
"data-state": "checking",
|
|
4928
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mero-invite-icon mero-invite-spinner", "aria-hidden": "true" })
|
|
4929
|
+
}
|
|
4930
|
+
);
|
|
4931
|
+
}
|
|
4932
|
+
const invalid = state === "invalid";
|
|
4933
|
+
const title = invalid ? "This invitation can't be read" : teamName ? `You're invited to join \u201C${teamName}\u201D` : `You're invited to join a ${noun}`;
|
|
4934
|
+
const where = appName ? ` in ${appName}` : "";
|
|
4935
|
+
const body = invalid ? "The link may have been cut short when it was shared. Ask whoever sent it for a new one." : `Someone sent you a link to join this ${noun}${where}. Log in to accept it; you'll be asked to confirm before you join.`;
|
|
4936
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-invite-landing", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4937
|
+
"div",
|
|
4938
|
+
{
|
|
4939
|
+
ref: cardRef,
|
|
4940
|
+
className: "mero-invite-dialog mero-invite-landing-card",
|
|
4941
|
+
role: "dialog",
|
|
4942
|
+
"aria-modal": "true",
|
|
4943
|
+
"aria-labelledby": titleId,
|
|
4944
|
+
"aria-describedby": bodyId,
|
|
4945
|
+
tabIndex: -1,
|
|
4946
|
+
"data-testid": "invite-landing",
|
|
4947
|
+
"data-state": state,
|
|
4948
|
+
onKeyDown,
|
|
4949
|
+
children: [
|
|
4950
|
+
appName ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mero-invite-app", children: appName }) : null,
|
|
4951
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mero-invite-head", children: [
|
|
4952
|
+
/* @__PURE__ */ jsxRuntime.jsx(InviteIcon2, { error: invalid }),
|
|
4953
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { id: titleId, className: "mero-invite-title", children: title })
|
|
4954
|
+
] }),
|
|
4955
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { id: bodyId, className: "mero-invite-body", children: body }),
|
|
4956
|
+
detail && !invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mero-invite-body", children: detail }) : null,
|
|
4957
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mero-invite-actions", children: invalid ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4958
|
+
"button",
|
|
4959
|
+
{
|
|
4960
|
+
ref: continueRef,
|
|
4961
|
+
type: "button",
|
|
4962
|
+
className: "mero-invite-button mero-invite-primary",
|
|
4963
|
+
onClick: onDecline,
|
|
4964
|
+
"data-testid": "invite-landing-decline",
|
|
4965
|
+
children: "Continue"
|
|
4966
|
+
}
|
|
4967
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4968
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4969
|
+
"button",
|
|
4970
|
+
{
|
|
4971
|
+
type: "button",
|
|
4972
|
+
className: "mero-invite-button mero-invite-secondary",
|
|
4973
|
+
onClick: onDecline,
|
|
4974
|
+
"data-testid": "invite-landing-decline",
|
|
4975
|
+
children: "Not now"
|
|
4976
|
+
}
|
|
4977
|
+
),
|
|
4978
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4979
|
+
"div",
|
|
4980
|
+
{
|
|
4981
|
+
ref: loginRef,
|
|
4982
|
+
className: "mero-invite-landing-login",
|
|
4983
|
+
"data-testid": "invite-landing-login",
|
|
4984
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ConnectButton, { ...connectButtonProps, label: "Log in to join" })
|
|
4985
|
+
}
|
|
4986
|
+
)
|
|
4987
|
+
] }) })
|
|
4988
|
+
]
|
|
4989
|
+
}
|
|
4990
|
+
) });
|
|
4991
|
+
}
|
|
4992
|
+
function InviteIcon2({ error }) {
|
|
4993
|
+
const path = error ? "M12 7v6m0 4h.01" : "M4 7l8 6 8-6M5 6h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1z";
|
|
4994
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4995
|
+
"span",
|
|
4996
|
+
{
|
|
4997
|
+
className: error ? "mero-invite-icon mero-invite-icon-error" : "mero-invite-icon",
|
|
4998
|
+
"aria-hidden": "true",
|
|
4999
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: path }) })
|
|
5000
|
+
}
|
|
5001
|
+
);
|
|
5002
|
+
}
|
|
4748
5003
|
function statusOf(err) {
|
|
4749
5004
|
if (!err || typeof err !== "object") return void 0;
|
|
4750
5005
|
const e = err;
|
|
@@ -4997,6 +5252,7 @@ exports.DEFAULT_MIGRATION_POLL_INTERVAL_MS = DEFAULT_MIGRATION_POLL_INTERVAL_MS;
|
|
|
4997
5252
|
exports.INVITATION_PARAM = INVITATION_PARAM;
|
|
4998
5253
|
exports.INVITATION_READY_MS = INVITATION_READY_MS;
|
|
4999
5254
|
exports.InvitationDialog = InvitationDialog;
|
|
5255
|
+
exports.InvitationGate = InvitationGate;
|
|
5000
5256
|
exports.JOIN_ACTION = JOIN_ACTION;
|
|
5001
5257
|
exports.JOIN_SYNC_MAX_MS = JOIN_SYNC_MAX_MS;
|
|
5002
5258
|
exports.JOIN_SYNC_POLL_MS = JOIN_SYNC_POLL_MS;
|
|
@@ -5043,6 +5299,7 @@ exports.setContextId = setContextId;
|
|
|
5043
5299
|
exports.setContextIdentity = setContextIdentity;
|
|
5044
5300
|
exports.setNodeUrl = setNodeUrl;
|
|
5045
5301
|
exports.setTokenNodeUrl = setTokenNodeUrl;
|
|
5302
|
+
exports.subscribeInvitation = subscribeInvitation;
|
|
5046
5303
|
exports.subscribeJustJoined = subscribeJustJoined;
|
|
5047
5304
|
exports.themeToCssVars = themeToCssVars;
|
|
5048
5305
|
exports.urlWithoutInvitation = urlWithoutInvitation;
|
|
@@ -5096,6 +5353,7 @@ exports.useNamespaceIdentity = useNamespaceIdentity;
|
|
|
5096
5353
|
exports.useNamespaces = useNamespaces;
|
|
5097
5354
|
exports.useNamespacesForApplication = useNamespacesForApplication;
|
|
5098
5355
|
exports.useNodeIdentity = useNodeIdentity;
|
|
5356
|
+
exports.usePendingInvitation = usePendingInvitation;
|
|
5099
5357
|
exports.useRedeemInvitation = useRedeemInvitation;
|
|
5100
5358
|
exports.useRemoveGroupMembers = useRemoveGroupMembers;
|
|
5101
5359
|
exports.useReparentGroup = useReparentGroup;
|