@strands.gg/accui 2.17.58 → 2.17.60
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/dist/StrandsUIPlugin-B1Gl61ax.cjs.js +143 -0
- package/dist/StrandsUIPlugin-BNU_Ayly.es.js +20577 -0
- package/dist/accui.css +1 -0
- package/dist/index.cjs.js +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +12931 -0
- package/dist/nuxt/module.cjs.js +23 -0
- package/dist/nuxt/module.d.ts +4 -0
- package/dist/nuxt/module.es.js +182 -0
- package/dist/nuxt/runtime/composables/useAuthenticatedFetch.cjs.js +1 -0
- package/dist/nuxt/runtime/composables/useAuthenticatedFetch.d.ts +20 -0
- package/dist/nuxt/runtime/composables/useAuthenticatedFetch.es.js +103 -0
- package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js +1 -0
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +111 -0
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +100 -0
- package/dist/nuxt/runtime/composables/useStrandsOAuth.d.ts +8 -0
- package/dist/nuxt/runtime/middleware/auth.d.ts +6 -0
- package/dist/nuxt/runtime/middleware/auth.global.cjs.js +1 -0
- package/dist/nuxt/runtime/middleware/auth.global.d.ts +2 -0
- package/dist/nuxt/runtime/middleware/auth.global.es.js +35 -0
- package/dist/nuxt/runtime/middleware/guest.d.ts +6 -0
- package/dist/nuxt/runtime/plugin.client.cjs.js +1 -0
- package/dist/nuxt/runtime/plugin.client.d.ts +2 -0
- package/dist/nuxt/runtime/plugin.client.es.js +21 -0
- package/dist/nuxt/runtime/plugin.server.cjs.js +1 -0
- package/dist/nuxt/runtime/plugin.server.d.ts +2 -0
- package/dist/nuxt/runtime/plugin.server.es.js +15 -0
- package/dist/nuxt/runtime/plugins/auth-interceptor.client.cjs.js +1 -0
- package/dist/nuxt/runtime/plugins/auth-interceptor.client.d.ts +9 -0
- package/dist/nuxt/runtime/plugins/auth-interceptor.client.es.js +46 -0
- package/dist/nuxt/types.d.ts +51 -0
- package/dist/nuxt.cjs.js +1 -0
- package/dist/nuxt.d.ts +4 -0
- package/dist/nuxt.es.js +11 -0
- package/dist/robots.txt +4 -0
- package/dist/shared/defaults.d.ts +2 -0
- package/dist/sitemap.xml +9 -0
- package/dist/types/composables.d.ts +97 -0
- package/dist/types/index.d.ts +263 -0
- package/dist/types/oauth.d.ts +420 -0
- package/dist/useDarkMode-BdG1G2mj.es.js +102 -0
- package/dist/useDarkMode-Dd0Q5Nnz.cjs.js +1 -0
- package/dist/useStrandsAuth-CetpoBNk.cjs.js +1 -0
- package/dist/useStrandsAuth-wzl2F9DE.es.js +702 -0
- package/dist/useStrandsConfig-B2UXxIbT.es.js +213 -0
- package/dist/useStrandsConfig-BYOAEt9d.cjs.js +1 -0
- package/dist/utils/colors.d.ts +10 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/slots.d.ts +1 -0
- package/dist/utils/validation.d.ts +12 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/plugin.d.ts +68 -0
- package/dist/vite.cjs.js +29 -0
- package/dist/vite.d.ts +6 -0
- package/dist/vite.es.js +92 -0
- package/dist/vue/components/SignedIn.vue.d.ts +35 -0
- package/dist/vue/components/StrandsAuth.vue.d.ts +24 -0
- package/dist/vue/components/StrandsBackupCodesModal.vue.d.ts +11 -0
- package/dist/vue/components/StrandsCompleteSignUp.vue.d.ts +20 -0
- package/dist/vue/components/StrandsConfigProvider.vue.d.ts +21 -0
- package/dist/vue/components/StrandsConfirmModal.vue.d.ts +21 -0
- package/dist/vue/components/StrandsEmailMfaSetupModal.vue.d.ts +11 -0
- package/dist/vue/components/StrandsHardwareKeySetupModal.vue.d.ts +14 -0
- package/dist/vue/components/StrandsLogo.vue.d.ts +9 -0
- package/dist/vue/components/StrandsMFASetup.vue.d.ts +15 -0
- package/dist/vue/components/StrandsMfaModal.vue.d.ts +11 -0
- package/dist/vue/components/StrandsMfaVerification.vue.d.ts +16 -0
- package/dist/vue/components/StrandsNav/StrandsNav.vue.d.ts +43 -0
- package/dist/vue/components/StrandsNav/StrandsNavItem.vue.d.ts +26 -0
- package/dist/vue/components/StrandsNav/index.d.ts +8 -0
- package/dist/vue/components/StrandsNav/types.d.ts +12 -0
- package/dist/vue/components/StrandsOAuthButton.vue.d.ts +18 -0
- package/dist/vue/components/StrandsOAuthCallback.vue.d.ts +12 -0
- package/dist/vue/components/StrandsPasswordReset.vue.d.ts +14 -0
- package/dist/vue/components/StrandsSecuredFooter.vue.d.ts +21 -0
- package/dist/vue/components/StrandsSessionsModal.vue.d.ts +11 -0
- package/dist/vue/components/StrandsSettingsModal.vue.d.ts +32 -0
- package/dist/vue/components/StrandsSignIn.vue.d.ts +20 -0
- package/dist/vue/components/StrandsSignUp.vue.d.ts +18 -0
- package/dist/vue/components/StrandsTotpSetupModal.vue.d.ts +11 -0
- package/dist/vue/components/StrandsUserButton.vue.d.ts +54 -0
- package/dist/vue/components/StrandsUserProfile.vue.d.ts +25 -0
- package/dist/vue/components/SvgIcon.vue.d.ts +16 -0
- package/dist/vue/components/VirtualList.vue.d.ts +36 -0
- package/dist/vue/components/icons/IconGithub.vue.d.ts +2 -0
- package/dist/vue/components/icons/IconGoogle.vue.d.ts +2 -0
- package/dist/vue/components/icons/index.d.ts +2 -0
- package/dist/vue/components/index.d.ts +29 -0
- package/dist/vue/composables/useAuthenticatedFetch.d.ts +22 -0
- package/dist/vue/composables/useDarkMode.d.ts +53 -0
- package/dist/vue/composables/useFloatingPosition.d.ts +22 -0
- package/dist/vue/composables/useModalStack.d.ts +86 -0
- package/dist/vue/composables/useOAuthProviders.d.ts +73 -0
- package/dist/vue/composables/useStrandsAuth.d.ts +2 -0
- package/dist/vue/composables/useStrandsConfig.d.ts +5 -0
- package/dist/vue/composables/useStrandsMfa.d.ts +36 -0
- package/dist/vue/composables/useStrandsOAuth.d.ts +10 -0
- package/dist/vue/composables/useTheme.d.ts +18 -0
- package/dist/vue/index.d.ts +16 -0
- package/dist/vue/plugins/StrandsUIPlugin.d.ts +19 -0
- package/dist/vue/ui/UiAlert.vue.d.ts +30 -0
- package/dist/vue/ui/UiApp.vue.d.ts +26 -0
- package/dist/vue/ui/UiAvatarEditor.vue.d.ts +24 -0
- package/dist/vue/ui/UiButton/UiButton.Anchor.vue.d.ts +42 -0
- package/dist/vue/ui/UiButton/UiButton.Content.vue.d.ts +32 -0
- package/dist/vue/ui/UiButton/UiButton.Nuxt.vue.d.ts +39 -0
- package/dist/vue/ui/UiButton/index.d.ts +11 -0
- package/dist/vue/ui/UiButton.vue.d.ts +77 -0
- package/dist/vue/ui/UiCard.vue.d.ts +38 -0
- package/dist/vue/ui/UiCheckboxGroup.vue.d.ts +46 -0
- package/dist/vue/ui/UiColorPicker/UiColorPicker.Button.vue.d.ts +19 -0
- package/dist/vue/ui/UiColorPicker/UiColorPicker.Picker.vue.d.ts +31 -0
- package/dist/vue/ui/UiColorPicker.vue.d.ts +34 -0
- package/dist/vue/ui/UiDateTimePicker.vue.d.ts +36 -0
- package/dist/vue/ui/UiDivider.vue.d.ts +43 -0
- package/dist/vue/ui/UiHero.vue.d.ts +53 -0
- package/dist/vue/ui/UiInput/UiInput.Date.vue.d.ts +30 -0
- package/dist/vue/ui/UiInput/UiInput.DateTime.vue.d.ts +34 -0
- package/dist/vue/ui/UiInput/UiInput.File.vue.d.ts +59 -0
- package/dist/vue/ui/UiInput/UiInput.Pincode.vue.d.ts +58 -0
- package/dist/vue/ui/UiInput/UiInput.RichText.vue.d.ts +66 -0
- package/dist/vue/ui/UiInput/UiInput.Select.vue.d.ts +806 -0
- package/dist/vue/ui/UiInput/UiInput.Text.vue.d.ts +51 -0
- package/dist/vue/ui/UiInput/UiInput.Textarea.vue.d.ts +60 -0
- package/dist/vue/ui/UiInput/UiInput.Time.vue.d.ts +30 -0
- package/dist/vue/ui/UiInput.vue.d.ts +84 -0
- package/dist/vue/ui/UiLevelProgress.vue.d.ts +18 -0
- package/dist/vue/ui/UiLink.vue.d.ts +42 -0
- package/dist/vue/ui/UiLoader.vue.d.ts +18 -0
- package/dist/vue/ui/UiMegaMenu/UiMegaMenu.Group.vue.d.ts +20 -0
- package/dist/vue/ui/UiMegaMenu/UiMegaMenu.Item.vue.d.ts +35 -0
- package/dist/vue/ui/UiMegaMenu/UiMegaMenu.Panel.vue.d.ts +28 -0
- package/dist/vue/ui/UiMegaMenu/index.d.ts +4 -0
- package/dist/vue/ui/UiMegaMenu.vue.d.ts +48 -0
- package/dist/vue/ui/UiModal.vue.d.ts +71 -0
- package/dist/vue/ui/UiPill.vue.d.ts +43 -0
- package/dist/vue/ui/UiRadioGroup.vue.d.ts +40 -0
- package/dist/vue/ui/UiSlider.vue.d.ts +53 -0
- package/dist/vue/ui/UiTable.vue.d.ts +114 -0
- package/dist/vue/ui/UiTabs.vue.d.ts +87 -0
- package/dist/vue/ui/UiThemeToggle.vue.d.ts +13 -0
- package/dist/vue/ui/UiToggle.vue.d.ts +20 -0
- package/dist/vue/ui/UiTooltip.vue.d.ts +41 -0
- package/dist/vue/ui/index.d.ts +62 -0
- package/dist/vue/utils/contrast.d.ts +75 -0
- package/dist/vue/utils/debounce.d.ts +12 -0
- package/dist/vue/utils/fontPreloader.d.ts +11 -0
- package/dist/vue/utils/iconProps.d.ts +9 -0
- package/dist/vue/utils/lazyComponents.d.ts +4 -0
- package/dist/vue/utils/levels.d.ts +27 -0
- package/dist/vue/utils/modalStack.d.ts +34 -0
- package/dist/vue/utils/performanceInit.d.ts +40 -0
- package/dist/vue/utils/requestCache.d.ts +49 -0
- package/dist/vue/utils/slots.d.ts +9 -0
- package/dist/vue/utils/sounds.d.ts +57 -0
- package/dist/webcomponents/define-element.d.ts +19 -0
- package/dist/webcomponents/entries/strands-alert.d.ts +2 -0
- package/dist/webcomponents/entries/strands-button.d.ts +2 -0
- package/dist/webcomponents/entries/strands-card.d.ts +2 -0
- package/dist/webcomponents/entries/strands-checkbox-group.d.ts +2 -0
- package/dist/webcomponents/entries/strands-divider.d.ts +2 -0
- package/dist/webcomponents/entries/strands-input.d.ts +2 -0
- package/dist/webcomponents/entries/strands-link.d.ts +2 -0
- package/dist/webcomponents/entries/strands-loader-spinner.d.ts +2 -0
- package/dist/webcomponents/entries/strands-modal.d.ts +2 -0
- package/dist/webcomponents/entries/strands-pill.d.ts +2 -0
- package/dist/webcomponents/entries/strands-radio-group.d.ts +2 -0
- package/dist/webcomponents/entries/strands-slider.d.ts +2 -0
- package/dist/webcomponents/entries/strands-table.d.ts +2 -0
- package/dist/webcomponents/entries/strands-tabs.d.ts +2 -0
- package/dist/webcomponents/entries/strands-theme-toggle.d.ts +2 -0
- package/dist/webcomponents/entries/strands-toggle.d.ts +2 -0
- package/dist/webcomponents/entries/strands-tooltip.d.ts +2 -0
- package/dist/webcomponents/index.d.ts +8 -0
- package/dist/webcomponents/loader.d.ts +57 -0
- package/dist/webcomponents/registry.d.ts +41 -0
- package/package.json +1 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ref as g, getCurrentInstance as h, inject as S, computed as f, provide as y } from "vue";
|
|
2
|
+
const w = {
|
|
3
|
+
baseUrl: "https://your-api.example.com",
|
|
4
|
+
accentColor: "#EA00A8",
|
|
5
|
+
autoRefresh: !0,
|
|
6
|
+
refreshInterval: 4,
|
|
7
|
+
protectedRoutes: [],
|
|
8
|
+
guestOnlyRoutes: ["/auth", "/login", "/register"],
|
|
9
|
+
devMode: !1,
|
|
10
|
+
styles: !0,
|
|
11
|
+
endpoints: {},
|
|
12
|
+
useSquircle: !0,
|
|
13
|
+
theme: "system"
|
|
14
|
+
};
|
|
15
|
+
let d = !1;
|
|
16
|
+
const a = {
|
|
17
|
+
signIn: "/api/v1/auth/sign-in",
|
|
18
|
+
signUp: "/api/v1/auth/sign-up",
|
|
19
|
+
signOut: "/api/v1/auth/sign-out",
|
|
20
|
+
refresh: "/api/v1/auth/refresh",
|
|
21
|
+
authStatus: "/api/v1/auth/status",
|
|
22
|
+
passwordReset: "/api/v1/auth/password-reset",
|
|
23
|
+
passwordResetConfirm: "/api/v1/auth/password-reset/confirm",
|
|
24
|
+
completeRegistration: "/api/v1/auth/complete-registration",
|
|
25
|
+
profile: "/api/v1/user/profile",
|
|
26
|
+
verifyEmail: "/api/v1/auth/verify-email",
|
|
27
|
+
oauthProviders: "/api/v1/oauth/providers",
|
|
28
|
+
oauthProvider: "/api/v1/oauth/providers/{provider_id}",
|
|
29
|
+
changeEmail: "/api/v1/user/change-email",
|
|
30
|
+
avatar: "/api/v1/user/avatar",
|
|
31
|
+
settings: "/api/v1/user/settings",
|
|
32
|
+
// Username endpoints
|
|
33
|
+
changeUsername: "/api/v1/user/username",
|
|
34
|
+
usernameCooldown: "/api/v1/user/username/cooldown",
|
|
35
|
+
checkUsernameAvailability: "/api/v1/username/{username}/available",
|
|
36
|
+
// MFA endpoints
|
|
37
|
+
mfaDevices: "/api/v1/mfa/devices",
|
|
38
|
+
mfaTotpSetup: "/api/v1/mfa/totp/setup",
|
|
39
|
+
mfaTotpVerify: "/api/v1/mfa/totp/verify",
|
|
40
|
+
mfaEmailSetup: "/api/v1/mfa/email/setup",
|
|
41
|
+
mfaEmailSend: "/api/v1/mfa/email/send",
|
|
42
|
+
mfaEmailVerify: "/api/v1/mfa/email/verify",
|
|
43
|
+
mfaDeviceDisable: "/api/v1/mfa/device/disable",
|
|
44
|
+
mfaBackupCodes: "/api/v1/mfa/backup-codes/regenerate",
|
|
45
|
+
// Hardware key endpoints
|
|
46
|
+
mfaHardwareStartRegistration: "/api/v1/mfa/hardware/start-registration",
|
|
47
|
+
mfaHardwareCompleteRegistration: "/api/v1/mfa/hardware/complete-registration",
|
|
48
|
+
// MFA sign-in specific endpoints
|
|
49
|
+
mfaSigninSendEmail: "/api/v1/auth/mfa/email/send",
|
|
50
|
+
mfaSigninVerify: "/api/v1/auth/mfa/verify",
|
|
51
|
+
mfaBackupCodeVerify: "/api/v1/auth/mfa/backup-code/verify",
|
|
52
|
+
mfaWebAuthnChallenge: "/api/v1/auth/mfa/webauthn/challenge",
|
|
53
|
+
// Session management endpoints
|
|
54
|
+
sessions: "/api/v1/sessions",
|
|
55
|
+
sessionsStats: "/api/v1/sessions/stats",
|
|
56
|
+
sessionRevoke: "/api/v1/sessions/{session_id}/revoke",
|
|
57
|
+
sessionsRevokeAll: "/api/v1/sessions/revoke-all"
|
|
58
|
+
}, p = /* @__PURE__ */ Symbol("strands-config"), l = g(null);
|
|
59
|
+
function v(s) {
|
|
60
|
+
if (typeof window > "u" || !document.documentElement) return;
|
|
61
|
+
if (typeof CSS < "u" && CSS.registerProperty)
|
|
62
|
+
try {
|
|
63
|
+
CSS.registerProperty({
|
|
64
|
+
name: "--strands-accent",
|
|
65
|
+
syntax: "<color>",
|
|
66
|
+
inherits: !0,
|
|
67
|
+
initialValue: s
|
|
68
|
+
});
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
document.documentElement.style.setProperty("--strands-accent", s), document.documentElement.style.setProperty("--accui-strands-accent", s);
|
|
72
|
+
const i = {
|
|
73
|
+
"--accui-strands-50": `color-mix(in srgb, ${s} 10%, white)`,
|
|
74
|
+
"--accui-strands-100": `color-mix(in srgb, ${s} 20%, white)`,
|
|
75
|
+
"--accui-strands-200": `color-mix(in srgb, ${s} 30%, white)`,
|
|
76
|
+
"--accui-strands-300": `color-mix(in srgb, ${s} 40%, white)`,
|
|
77
|
+
"--accui-strands-400": `color-mix(in srgb, ${s} 70%, white)`,
|
|
78
|
+
"--accui-strands-500": s,
|
|
79
|
+
"--accui-strands-600": `color-mix(in srgb, ${s} 85%, black)`,
|
|
80
|
+
"--accui-strands-700": `color-mix(in srgb, ${s} 70%, black)`,
|
|
81
|
+
"--accui-strands-800": `color-mix(in srgb, ${s} 55%, black)`,
|
|
82
|
+
"--accui-strands-900": `color-mix(in srgb, ${s} 40%, black)`,
|
|
83
|
+
"--accui-strands-950": `color-mix(in srgb, ${s} 25%, black)`
|
|
84
|
+
};
|
|
85
|
+
for (const [r, n] of Object.entries(i))
|
|
86
|
+
document.documentElement.style.setProperty(r, n);
|
|
87
|
+
}
|
|
88
|
+
function b(s) {
|
|
89
|
+
if (l.value = s, typeof window < "u" && document.documentElement) {
|
|
90
|
+
const i = s.useSquircle !== void 0 ? s.useSquircle : !0;
|
|
91
|
+
document.documentElement.style.setProperty("--strands-allow-squircle", i ? "1" : "0"), s.accentColor && v(s.accentColor);
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
y(p, s);
|
|
95
|
+
} catch (i) {
|
|
96
|
+
console.warn("[Strands Auth] Could not provide config via Vue provide/inject. Config available via global state only.", i);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function E(s) {
|
|
100
|
+
let i = null;
|
|
101
|
+
try {
|
|
102
|
+
h() && (i = S(p, null));
|
|
103
|
+
} catch {
|
|
104
|
+
i = null;
|
|
105
|
+
}
|
|
106
|
+
let r = null;
|
|
107
|
+
try {
|
|
108
|
+
if (typeof window < "u") {
|
|
109
|
+
if (window.__STRANDS_CONFIG__)
|
|
110
|
+
r = window.__STRANDS_CONFIG__;
|
|
111
|
+
else if (window.__NUXT__) {
|
|
112
|
+
const t = window.__NUXT__;
|
|
113
|
+
r = t?.config?.public?.strandsAuth || t?.public?.strandsAuth || t?.strandsAuth;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} catch (t) {
|
|
117
|
+
console.error("[Strands Auth] Error accessing runtime configuration:", t);
|
|
118
|
+
}
|
|
119
|
+
const n = f(() => {
|
|
120
|
+
const t = {
|
|
121
|
+
...w,
|
|
122
|
+
...s || {},
|
|
123
|
+
...i || {},
|
|
124
|
+
...l.value || {},
|
|
125
|
+
...r || {}
|
|
126
|
+
};
|
|
127
|
+
if (typeof window < "u" && document.documentElement) {
|
|
128
|
+
const e = t.useSquircle !== void 0 ? t.useSquircle : !0;
|
|
129
|
+
document.documentElement.style.setProperty("--strands-allow-squircle", e ? "1" : "0"), t.accentColor && document.documentElement.style.setProperty("--strands-accent", t.accentColor);
|
|
130
|
+
}
|
|
131
|
+
return t;
|
|
132
|
+
});
|
|
133
|
+
typeof window > "u" && !d && (l.value?.baseUrl || i?.baseUrl || s?.baseUrl || (d = !0, console.warn("[Strands Auth] No baseUrl configured for SSR. Please provide a baseUrl in your strandsAuth configuration.")));
|
|
134
|
+
const u = f(() => {
|
|
135
|
+
const e = n.value.endpoints || {};
|
|
136
|
+
return {
|
|
137
|
+
signIn: e.signIn || a.signIn,
|
|
138
|
+
signUp: e.signUp || a.signUp,
|
|
139
|
+
signOut: e.signOut || a.signOut,
|
|
140
|
+
refresh: e.refresh || a.refresh,
|
|
141
|
+
authStatus: e.authStatus || a.authStatus,
|
|
142
|
+
passwordReset: e.passwordReset || a.passwordReset,
|
|
143
|
+
passwordResetConfirm: e.passwordResetConfirm || a.passwordResetConfirm,
|
|
144
|
+
completeRegistration: e.completeRegistration || a.completeRegistration,
|
|
145
|
+
profile: e.profile || a.profile,
|
|
146
|
+
verifyEmail: e.verifyEmail || a.verifyEmail,
|
|
147
|
+
oauthProviders: e.oauthProviders || a.oauthProviders,
|
|
148
|
+
oauthProvider: e.oauthProvider || a.oauthProvider,
|
|
149
|
+
changeEmail: e.changeEmail || a.changeEmail,
|
|
150
|
+
avatar: e.avatar || a.avatar,
|
|
151
|
+
settings: e.settings || a.settings,
|
|
152
|
+
// Username endpoints
|
|
153
|
+
changeUsername: e.changeUsername || a.changeUsername,
|
|
154
|
+
usernameCooldown: e.usernameCooldown || a.usernameCooldown,
|
|
155
|
+
checkUsernameAvailability: e.checkUsernameAvailability || a.checkUsernameAvailability,
|
|
156
|
+
// MFA endpoints
|
|
157
|
+
mfaDevices: e.mfaDevices || a.mfaDevices,
|
|
158
|
+
mfaTotpSetup: e.mfaTotpSetup || a.mfaTotpSetup,
|
|
159
|
+
mfaTotpVerify: e.mfaTotpVerify || a.mfaTotpVerify,
|
|
160
|
+
mfaEmailSetup: e.mfaEmailSetup || a.mfaEmailSetup,
|
|
161
|
+
mfaEmailSend: e.mfaEmailSend || a.mfaEmailSend,
|
|
162
|
+
mfaEmailVerify: e.mfaEmailVerify || a.mfaEmailVerify,
|
|
163
|
+
mfaDeviceDisable: e.mfaDeviceDisable || a.mfaDeviceDisable,
|
|
164
|
+
mfaBackupCodes: e.mfaBackupCodes || a.mfaBackupCodes,
|
|
165
|
+
// Hardware key endpoints
|
|
166
|
+
mfaHardwareStartRegistration: e.mfaHardwareStartRegistration || a.mfaHardwareStartRegistration,
|
|
167
|
+
mfaHardwareCompleteRegistration: e.mfaHardwareCompleteRegistration || a.mfaHardwareCompleteRegistration,
|
|
168
|
+
// MFA sign-in specific endpoints
|
|
169
|
+
mfaSigninSendEmail: e.mfaSigninSendEmail || a.mfaSigninSendEmail,
|
|
170
|
+
mfaSigninVerify: e.mfaSigninVerify || a.mfaSigninVerify,
|
|
171
|
+
mfaBackupCodeVerify: e.mfaBackupCodeVerify || a.mfaBackupCodeVerify,
|
|
172
|
+
mfaWebAuthnChallenge: e.mfaWebAuthnChallenge || a.mfaWebAuthnChallenge,
|
|
173
|
+
// Session management endpoints
|
|
174
|
+
sessions: e.sessions || a.sessions,
|
|
175
|
+
sessionsStats: e.sessionsStats || a.sessionsStats,
|
|
176
|
+
sessionRevoke: e.sessionRevoke || a.sessionRevoke,
|
|
177
|
+
sessionsRevokeAll: e.sessionsRevokeAll || a.sessionsRevokeAll
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
return {
|
|
181
|
+
config: n,
|
|
182
|
+
endpoints: u,
|
|
183
|
+
getUrl: (t) => {
|
|
184
|
+
const e = n.value;
|
|
185
|
+
if (!e.baseUrl)
|
|
186
|
+
throw new Error("Base URL is required in configuration");
|
|
187
|
+
let o;
|
|
188
|
+
typeof t == "string" && t in u.value ? o = u.value[t] : typeof t == "string" ? o = t : o = u.value[t];
|
|
189
|
+
const m = e.baseUrl.replace(/\/$/, ""), c = o.startsWith("/") ? o : `/${o}`;
|
|
190
|
+
return console.debug(`[Strands Auth] Constructing URL for endpoint "${t}": ${m}${c}`), `${m}${c}`;
|
|
191
|
+
},
|
|
192
|
+
getSupportEmail: () => n.value.supportEmail || null
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function C(s) {
|
|
196
|
+
if (l.value = s, typeof window < "u" && document.documentElement) {
|
|
197
|
+
const i = s.useSquircle !== void 0 ? s.useSquircle : !0;
|
|
198
|
+
document.documentElement.style.setProperty("--strands-allow-squircle", i ? "1" : "0"), s.accentColor && v(s.accentColor);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
202
|
+
__proto__: null,
|
|
203
|
+
provideStrandsConfig: b,
|
|
204
|
+
setStrandsConfig: C,
|
|
205
|
+
useStrandsConfig: E
|
|
206
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
207
|
+
export {
|
|
208
|
+
w as S,
|
|
209
|
+
_ as a,
|
|
210
|
+
b as p,
|
|
211
|
+
C as s,
|
|
212
|
+
E as u
|
|
213
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("vue"),p={baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0,endpoints:{},useSquircle:!0,theme:"system"};let d=!1;const a={signIn:"/api/v1/auth/sign-in",signUp:"/api/v1/auth/sign-up",signOut:"/api/v1/auth/sign-out",refresh:"/api/v1/auth/refresh",authStatus:"/api/v1/auth/status",passwordReset:"/api/v1/auth/password-reset",passwordResetConfirm:"/api/v1/auth/password-reset/confirm",completeRegistration:"/api/v1/auth/complete-registration",profile:"/api/v1/user/profile",verifyEmail:"/api/v1/auth/verify-email",oauthProviders:"/api/v1/oauth/providers",oauthProvider:"/api/v1/oauth/providers/{provider_id}",changeEmail:"/api/v1/user/change-email",avatar:"/api/v1/user/avatar",settings:"/api/v1/user/settings",changeUsername:"/api/v1/user/username",usernameCooldown:"/api/v1/user/username/cooldown",checkUsernameAvailability:"/api/v1/username/{username}/available",mfaDevices:"/api/v1/mfa/devices",mfaTotpSetup:"/api/v1/mfa/totp/setup",mfaTotpVerify:"/api/v1/mfa/totp/verify",mfaEmailSetup:"/api/v1/mfa/email/setup",mfaEmailSend:"/api/v1/mfa/email/send",mfaEmailVerify:"/api/v1/mfa/email/verify",mfaDeviceDisable:"/api/v1/mfa/device/disable",mfaBackupCodes:"/api/v1/mfa/backup-codes/regenerate",mfaHardwareStartRegistration:"/api/v1/mfa/hardware/start-registration",mfaHardwareCompleteRegistration:"/api/v1/mfa/hardware/complete-registration",mfaSigninSendEmail:"/api/v1/auth/mfa/email/send",mfaSigninVerify:"/api/v1/auth/mfa/verify",mfaBackupCodeVerify:"/api/v1/auth/mfa/backup-code/verify",mfaWebAuthnChallenge:"/api/v1/auth/mfa/webauthn/challenge",sessions:"/api/v1/sessions",sessionsStats:"/api/v1/sessions/stats",sessionRevoke:"/api/v1/sessions/{session_id}/revoke",sessionsRevokeAll:"/api/v1/sessions/revoke-all"},v=Symbol("strands-config"),c=u.ref(null);function g(s){if(typeof window>"u"||!document.documentElement)return;if(typeof CSS<"u"&&CSS.registerProperty)try{CSS.registerProperty({name:"--strands-accent",syntax:"<color>",inherits:!0,initialValue:s})}catch{}document.documentElement.style.setProperty("--strands-accent",s),document.documentElement.style.setProperty("--accui-strands-accent",s);const i={"--accui-strands-50":`color-mix(in srgb, ${s} 10%, white)`,"--accui-strands-100":`color-mix(in srgb, ${s} 20%, white)`,"--accui-strands-200":`color-mix(in srgb, ${s} 30%, white)`,"--accui-strands-300":`color-mix(in srgb, ${s} 40%, white)`,"--accui-strands-400":`color-mix(in srgb, ${s} 70%, white)`,"--accui-strands-500":s,"--accui-strands-600":`color-mix(in srgb, ${s} 85%, black)`,"--accui-strands-700":`color-mix(in srgb, ${s} 70%, black)`,"--accui-strands-800":`color-mix(in srgb, ${s} 55%, black)`,"--accui-strands-900":`color-mix(in srgb, ${s} 40%, black)`,"--accui-strands-950":`color-mix(in srgb, ${s} 25%, black)`};for(const[r,n]of Object.entries(i))document.documentElement.style.setProperty(r,n)}function h(s){if(c.value=s,typeof window<"u"&&document.documentElement){const i=s.useSquircle!==void 0?s.useSquircle:!0;document.documentElement.style.setProperty("--strands-allow-squircle",i?"1":"0"),s.accentColor&&g(s.accentColor)}try{u.provide(v,s)}catch(i){console.warn("[Strands Auth] Could not provide config via Vue provide/inject. Config available via global state only.",i)}}function S(s){let i=null;try{u.getCurrentInstance()&&(i=u.inject(v,null))}catch{i=null}let r=null;try{if(typeof window<"u"){if(window.__STRANDS_CONFIG__)r=window.__STRANDS_CONFIG__;else if(window.__NUXT__){const t=window.__NUXT__;r=t?.config?.public?.strandsAuth||t?.public?.strandsAuth||t?.strandsAuth}}}catch(t){console.error("[Strands Auth] Error accessing runtime configuration:",t)}const n=u.computed(()=>{const t={...p,...s||{},...i||{},...c.value||{},...r||{}};if(typeof window<"u"&&document.documentElement){const e=t.useSquircle!==void 0?t.useSquircle:!0;document.documentElement.style.setProperty("--strands-allow-squircle",e?"1":"0"),t.accentColor&&document.documentElement.style.setProperty("--strands-accent",t.accentColor)}return t});typeof window>"u"&&!d&&(c.value?.baseUrl||i?.baseUrl||s?.baseUrl||(d=!0,console.warn("[Strands Auth] No baseUrl configured for SSR. Please provide a baseUrl in your strandsAuth configuration.")));const l=u.computed(()=>{const e=n.value.endpoints||{};return{signIn:e.signIn||a.signIn,signUp:e.signUp||a.signUp,signOut:e.signOut||a.signOut,refresh:e.refresh||a.refresh,authStatus:e.authStatus||a.authStatus,passwordReset:e.passwordReset||a.passwordReset,passwordResetConfirm:e.passwordResetConfirm||a.passwordResetConfirm,completeRegistration:e.completeRegistration||a.completeRegistration,profile:e.profile||a.profile,verifyEmail:e.verifyEmail||a.verifyEmail,oauthProviders:e.oauthProviders||a.oauthProviders,oauthProvider:e.oauthProvider||a.oauthProvider,changeEmail:e.changeEmail||a.changeEmail,avatar:e.avatar||a.avatar,settings:e.settings||a.settings,changeUsername:e.changeUsername||a.changeUsername,usernameCooldown:e.usernameCooldown||a.usernameCooldown,checkUsernameAvailability:e.checkUsernameAvailability||a.checkUsernameAvailability,mfaDevices:e.mfaDevices||a.mfaDevices,mfaTotpSetup:e.mfaTotpSetup||a.mfaTotpSetup,mfaTotpVerify:e.mfaTotpVerify||a.mfaTotpVerify,mfaEmailSetup:e.mfaEmailSetup||a.mfaEmailSetup,mfaEmailSend:e.mfaEmailSend||a.mfaEmailSend,mfaEmailVerify:e.mfaEmailVerify||a.mfaEmailVerify,mfaDeviceDisable:e.mfaDeviceDisable||a.mfaDeviceDisable,mfaBackupCodes:e.mfaBackupCodes||a.mfaBackupCodes,mfaHardwareStartRegistration:e.mfaHardwareStartRegistration||a.mfaHardwareStartRegistration,mfaHardwareCompleteRegistration:e.mfaHardwareCompleteRegistration||a.mfaHardwareCompleteRegistration,mfaSigninSendEmail:e.mfaSigninSendEmail||a.mfaSigninSendEmail,mfaSigninVerify:e.mfaSigninVerify||a.mfaSigninVerify,mfaBackupCodeVerify:e.mfaBackupCodeVerify||a.mfaBackupCodeVerify,mfaWebAuthnChallenge:e.mfaWebAuthnChallenge||a.mfaWebAuthnChallenge,sessions:e.sessions||a.sessions,sessionsStats:e.sessionsStats||a.sessionsStats,sessionRevoke:e.sessionRevoke||a.sessionRevoke,sessionsRevokeAll:e.sessionsRevokeAll||a.sessionsRevokeAll}});return{config:n,endpoints:l,getUrl:t=>{const e=n.value;if(!e.baseUrl)throw new Error("Base URL is required in configuration");let o;typeof t=="string"&&t in l.value?o=l.value[t]:typeof t=="string"?o=t:o=l.value[t];const m=e.baseUrl.replace(/\/$/,""),f=o.startsWith("/")?o:`/${o}`;return console.debug(`[Strands Auth] Constructing URL for endpoint "${t}": ${m}${f}`),`${m}${f}`},getSupportEmail:()=>n.value.supportEmail||null}}function y(s){if(c.value=s,typeof window<"u"&&document.documentElement){const i=s.useSquircle!==void 0?s.useSquircle:!0;document.documentElement.style.setProperty("--strands-allow-squircle",i?"1":"0"),s.accentColor&&g(s.accentColor)}}const w=Object.freeze(Object.defineProperty({__proto__:null,provideStrandsConfig:h,setStrandsConfig:y,useStrandsConfig:S},Symbol.toStringTag,{value:"Module"}));exports.STRANDS_AUTH_DEFAULTS=p;exports.provideStrandsConfig=h;exports.setStrandsConfig=y;exports.useStrandsConfig=S;exports.useStrandsConfig$1=w;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complete Tailwind CSS color palette with shades
|
|
3
|
+
* Provides all 22 Tailwind colors with their full shade ranges (50-950)
|
|
4
|
+
*/
|
|
5
|
+
interface SwatchConfig {
|
|
6
|
+
label?: string;
|
|
7
|
+
shades?: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare const tailwindColors: Record<string, SwatchConfig>;
|
|
10
|
+
export type { SwatchConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const slotHasContent: (slotName: string, slots: any) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const isValidEmail: (email: string) => boolean;
|
|
2
|
+
export declare const validatePassword: (password: string) => {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
strength: "weak" | "medium" | "strong";
|
|
5
|
+
errors: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const isValidName: (name: string) => boolean;
|
|
8
|
+
export declare const isRequired: (value: string) => boolean;
|
|
9
|
+
export declare const passwordsMatch: (password: string, confirmation: string) => boolean;
|
|
10
|
+
export declare const getInitials: (firstName?: string, lastName?: string) => string;
|
|
11
|
+
export declare const formatDate: (date: string | Date) => string;
|
|
12
|
+
export declare const debounce: <T extends (...args: any[]) => any>(func: T, wait: number) => ((...args: Parameters<T>) => void);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { App } from 'vue';
|
|
3
|
+
import { StrandsAuthConfig } from '../types';
|
|
4
|
+
export type { StrandsAuthConfig, StrandsAuthEndpoints } from '../types';
|
|
5
|
+
export interface StrandsVitePluginOptions extends StrandsAuthConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Auto-import styles
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
styles?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Vite plugin for Strands Auth UI
|
|
14
|
+
*
|
|
15
|
+
* Automatically configures the Strands Auth system with your settings
|
|
16
|
+
* and optionally auto-imports styles.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // vite.config.ts
|
|
21
|
+
* import { defineConfig } from 'vite'
|
|
22
|
+
* import vue from '@vitejs/plugin-vue'
|
|
23
|
+
* import StrandsAuth from '@strands.gg/accui/vite'
|
|
24
|
+
*
|
|
25
|
+
* export default defineConfig({
|
|
26
|
+
* plugins: [
|
|
27
|
+
* vue(),
|
|
28
|
+
* StrandsAuth({
|
|
29
|
+
* baseUrl: 'http://localhost:8000',
|
|
30
|
+
* accentColor: '#EA00A8',
|
|
31
|
+
* useSquircle: true,
|
|
32
|
+
* styles: true, // Auto-import styles
|
|
33
|
+
* })
|
|
34
|
+
* ]
|
|
35
|
+
* })
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function StrandsAuthVitePlugin(options?: StrandsVitePluginOptions): Plugin;
|
|
39
|
+
/**
|
|
40
|
+
* Vue plugin installer for Strands Auth
|
|
41
|
+
*
|
|
42
|
+
* Use this in your main.ts file to install the Strands Auth components
|
|
43
|
+
* and configure the system.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { createApp } from 'vue'
|
|
48
|
+
* import { createStrandsAuth } from '@strands.gg/accui/vite'
|
|
49
|
+
*
|
|
50
|
+
* const app = createApp(App)
|
|
51
|
+
*
|
|
52
|
+
* app.use(createStrandsAuth({
|
|
53
|
+
* baseUrl: 'http://localhost:8000',
|
|
54
|
+
* accentColor: '#EA00A8',
|
|
55
|
+
* }))
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function createStrandsAuth(config?: StrandsAuthConfig): {
|
|
59
|
+
install(app: App): void;
|
|
60
|
+
};
|
|
61
|
+
export default StrandsAuthVitePlugin;
|
|
62
|
+
export { StrandsAuthVitePlugin as StrandsAuth, StrandsAuthVitePlugin as strandsAuth, };
|
|
63
|
+
declare global {
|
|
64
|
+
interface Window {
|
|
65
|
+
__STRANDS_CONFIG__?: StrandsAuthConfig;
|
|
66
|
+
__STRANDS_INJECTED__?: boolean;
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/vite.cjs.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(i={}){const{styles:a=!0,accentColor:n="#EA00A8",useSquircle:r=!0,...u}=i;let c;return{name:"@strands.gg/accui:vite-plugin",enforce:"pre",config(s,{command:t}){return c={accentColor:n,useSquircle:r,...u},{define:{__STRANDS_CONFIG__:JSON.stringify(c)}}},transformIndexHtml:{order:"pre",handler(s){if(n&&n!=="#EA00A8"){const o=`<style data-strands-accent>${`
|
|
2
|
+
:root {
|
|
3
|
+
--strands-accent: ${n};
|
|
4
|
+
--accui-strands-accent: ${n};
|
|
5
|
+
--accui-strands-50: color-mix(in srgb, ${n} 10%, white);
|
|
6
|
+
--accui-strands-100: color-mix(in srgb, ${n} 20%, white);
|
|
7
|
+
--accui-strands-200: color-mix(in srgb, ${n} 30%, white);
|
|
8
|
+
--accui-strands-300: color-mix(in srgb, ${n} 40%, white);
|
|
9
|
+
--accui-strands-400: color-mix(in srgb, ${n} 70%, white);
|
|
10
|
+
--accui-strands-500: ${n};
|
|
11
|
+
--accui-strands-600: color-mix(in srgb, ${n} 85%, black);
|
|
12
|
+
--accui-strands-700: color-mix(in srgb, ${n} 70%, black);
|
|
13
|
+
--accui-strands-800: color-mix(in srgb, ${n} 55%, black);
|
|
14
|
+
--accui-strands-900: color-mix(in srgb, ${n} 40%, black);
|
|
15
|
+
--accui-strands-950: color-mix(in srgb, ${n} 25%, black);
|
|
16
|
+
}`}</style>`;return s.replace("</head>",` ${o}
|
|
17
|
+
</head>`)}return s}},async transform(s,t){return(a&&t.endsWith("main.ts")||t.endsWith("main.js"))&&!s.includes("@strands.gg/accui/style.css")?{code:`import '@strands.gg/accui/style.css'
|
|
18
|
+
${s}`,map:null}:(t.endsWith("main.ts")||t.endsWith("main.js"))&&!s.includes("setStrandsConfig")&&!s.includes("__STRANDS_INJECTED__")?{code:`${`
|
|
19
|
+
// Auto-injected by @strands.gg/accui Vite plugin
|
|
20
|
+
import { setStrandsConfig } from '@strands.gg/accui'
|
|
21
|
+
|
|
22
|
+
if (typeof window !== 'undefined') {
|
|
23
|
+
const strandsConfig = ${JSON.stringify(c)}
|
|
24
|
+
setStrandsConfig(strandsConfig)
|
|
25
|
+
window.__STRANDS_CONFIG__ = strandsConfig
|
|
26
|
+
window.__STRANDS_INJECTED__ = true
|
|
27
|
+
}
|
|
28
|
+
`}
|
|
29
|
+
${s}`,map:null}:null}}}function d(i={}){return{install(a){Promise.resolve().then(()=>require("./StrandsUIPlugin-B1Gl61ax.cjs.js")).then(n=>n.StrandsUIPlugin$1).then(n=>{const r=n.default;a.use(r)}),Promise.resolve().then(()=>require("./useStrandsConfig-BYOAEt9d.cjs.js")).then(n=>n.useStrandsConfig$1).then(n=>{const{setStrandsConfig:r}=n;r(i),typeof window<"u"&&(window.__STRANDS_CONFIG__=i)})}}}exports.StrandsAuth=e;exports.StrandsAuthVitePlugin=e;exports.createStrandsAuth=d;exports.default=e;exports.strandsAuth=e;
|
package/dist/vite.d.ts
ADDED
package/dist/vite.es.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
function u(r = {}) {
|
|
2
|
+
const {
|
|
3
|
+
styles: a = !0,
|
|
4
|
+
accentColor: n = "#EA00A8",
|
|
5
|
+
useSquircle: i = !0,
|
|
6
|
+
...o
|
|
7
|
+
} = r;
|
|
8
|
+
let c;
|
|
9
|
+
return {
|
|
10
|
+
name: "@strands.gg/accui:vite-plugin",
|
|
11
|
+
enforce: "pre",
|
|
12
|
+
config(s, { command: t }) {
|
|
13
|
+
return c = {
|
|
14
|
+
accentColor: n,
|
|
15
|
+
useSquircle: i,
|
|
16
|
+
...o
|
|
17
|
+
}, {
|
|
18
|
+
define: {
|
|
19
|
+
// Make config available at build time
|
|
20
|
+
__STRANDS_CONFIG__: JSON.stringify(c)
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
transformIndexHtml: {
|
|
25
|
+
order: "pre",
|
|
26
|
+
handler(s) {
|
|
27
|
+
if (n && n !== "#EA00A8") {
|
|
28
|
+
const e = `<style data-strands-accent>${`
|
|
29
|
+
:root {
|
|
30
|
+
--strands-accent: ${n};
|
|
31
|
+
--accui-strands-accent: ${n};
|
|
32
|
+
--accui-strands-50: color-mix(in srgb, ${n} 10%, white);
|
|
33
|
+
--accui-strands-100: color-mix(in srgb, ${n} 20%, white);
|
|
34
|
+
--accui-strands-200: color-mix(in srgb, ${n} 30%, white);
|
|
35
|
+
--accui-strands-300: color-mix(in srgb, ${n} 40%, white);
|
|
36
|
+
--accui-strands-400: color-mix(in srgb, ${n} 70%, white);
|
|
37
|
+
--accui-strands-500: ${n};
|
|
38
|
+
--accui-strands-600: color-mix(in srgb, ${n} 85%, black);
|
|
39
|
+
--accui-strands-700: color-mix(in srgb, ${n} 70%, black);
|
|
40
|
+
--accui-strands-800: color-mix(in srgb, ${n} 55%, black);
|
|
41
|
+
--accui-strands-900: color-mix(in srgb, ${n} 40%, black);
|
|
42
|
+
--accui-strands-950: color-mix(in srgb, ${n} 25%, black);
|
|
43
|
+
}`}</style>`;
|
|
44
|
+
return s.replace("</head>", ` ${e}
|
|
45
|
+
</head>`);
|
|
46
|
+
}
|
|
47
|
+
return s;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
async transform(s, t) {
|
|
51
|
+
return (a && t.endsWith("main.ts") || t.endsWith("main.js")) && !s.includes("@strands.gg/accui/style.css") ? {
|
|
52
|
+
code: `import '@strands.gg/accui/style.css'
|
|
53
|
+
${s}`,
|
|
54
|
+
map: null
|
|
55
|
+
} : (t.endsWith("main.ts") || t.endsWith("main.js")) && !s.includes("setStrandsConfig") && !s.includes("__STRANDS_INJECTED__") ? {
|
|
56
|
+
code: `${`
|
|
57
|
+
// Auto-injected by @strands.gg/accui Vite plugin
|
|
58
|
+
import { setStrandsConfig } from '@strands.gg/accui'
|
|
59
|
+
|
|
60
|
+
if (typeof window !== 'undefined') {
|
|
61
|
+
const strandsConfig = ${JSON.stringify(c)}
|
|
62
|
+
setStrandsConfig(strandsConfig)
|
|
63
|
+
window.__STRANDS_CONFIG__ = strandsConfig
|
|
64
|
+
window.__STRANDS_INJECTED__ = true
|
|
65
|
+
}
|
|
66
|
+
`}
|
|
67
|
+
${s}`,
|
|
68
|
+
map: null
|
|
69
|
+
} : null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function d(r = {}) {
|
|
74
|
+
return {
|
|
75
|
+
install(a) {
|
|
76
|
+
import("./StrandsUIPlugin-BNU_Ayly.es.js").then((n) => n.m).then((n) => {
|
|
77
|
+
const i = n.default;
|
|
78
|
+
a.use(i);
|
|
79
|
+
}), import("./useStrandsConfig-B2UXxIbT.es.js").then((n) => n.a).then((n) => {
|
|
80
|
+
const { setStrandsConfig: i } = n;
|
|
81
|
+
i(r), typeof window < "u" && (window.__STRANDS_CONFIG__ = r);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
u as StrandsAuth,
|
|
88
|
+
u as StrandsAuthVitePlugin,
|
|
89
|
+
d as createStrandsAuth,
|
|
90
|
+
u as default,
|
|
91
|
+
u as strandsAuth
|
|
92
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
showFallback?: boolean;
|
|
3
|
+
inline?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
loading?(_: {}): any;
|
|
9
|
+
default?(_: {
|
|
10
|
+
user: import('../..').User;
|
|
11
|
+
signOut: () => Promise<void>;
|
|
12
|
+
}): any;
|
|
13
|
+
fallback?(_: {
|
|
14
|
+
signIn: () => void;
|
|
15
|
+
}): any;
|
|
16
|
+
};
|
|
17
|
+
refs: {};
|
|
18
|
+
rootEl: any;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
+
"sign-in-required": () => any;
|
|
23
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
24
|
+
"onSign-in-required"?: () => any;
|
|
25
|
+
}>, {
|
|
26
|
+
inline: boolean;
|
|
27
|
+
showFallback: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StrandsAuthConfig } from '../composables/useStrandsConfig';
|
|
2
|
+
interface Props {
|
|
3
|
+
mode?: 'signin' | 'signup' | 'reset-password';
|
|
4
|
+
redirectUrl?: string;
|
|
5
|
+
inModal?: boolean;
|
|
6
|
+
config?: StrandsAuthConfig;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
9
|
+
error: (error: string) => any;
|
|
10
|
+
success: (user: any) => any;
|
|
11
|
+
"forgot-password": () => any;
|
|
12
|
+
"password-reset-sent": (email: string) => any;
|
|
13
|
+
"mode-changed": (mode: "signin" | "signup" | "reset-password") => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
15
|
+
onError?: (error: string) => any;
|
|
16
|
+
onSuccess?: (user: any) => any;
|
|
17
|
+
"onForgot-password"?: () => any;
|
|
18
|
+
"onPassword-reset-sent"?: (email: string) => any;
|
|
19
|
+
"onMode-changed"?: (mode: "signin" | "signup" | "reset-password") => any;
|
|
20
|
+
}>, {
|
|
21
|
+
mode: "signin" | "signup" | "reset-password";
|
|
22
|
+
inModal: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MfaDevice } from '../../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
show: boolean;
|
|
4
|
+
device?: MfaDevice | null;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
7
|
+
close: () => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
9
|
+
onClose?: () => any;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StrandsAuthConfig } from '../composables/useStrandsConfig';
|
|
2
|
+
interface Props {
|
|
3
|
+
token?: string;
|
|
4
|
+
redirectUrl?: string;
|
|
5
|
+
config?: StrandsAuthConfig;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
|
+
error: (error: string) => any;
|
|
9
|
+
success: (result: any) => any;
|
|
10
|
+
"invalid-token": () => any;
|
|
11
|
+
"request-new-link": () => any;
|
|
12
|
+
"start-registration": () => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
14
|
+
onError?: (error: string) => any;
|
|
15
|
+
onSuccess?: (result: any) => any;
|
|
16
|
+
"onInvalid-token"?: () => any;
|
|
17
|
+
"onRequest-new-link"?: () => any;
|
|
18
|
+
"onStart-registration"?: () => any;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StrandsAuthConfig } from '../composables/useStrandsConfig';
|
|
2
|
+
interface Props {
|
|
3
|
+
config: StrandsAuthConfig;
|
|
4
|
+
}
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline';
|
|
2
|
+
interface Props {
|
|
3
|
+
show: boolean;
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
confirmText?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
11
|
+
cancel: () => any;
|
|
12
|
+
confirm: () => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
14
|
+
onCancel?: () => any;
|
|
15
|
+
onConfirm?: () => any;
|
|
16
|
+
}>, {
|
|
17
|
+
variant: ButtonVariant;
|
|
18
|
+
confirmText: string;
|
|
19
|
+
cancelText: string;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
show: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
5
|
+
close: () => any;
|
|
6
|
+
success: () => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
8
|
+
onClose?: () => any;
|
|
9
|
+
onSuccess?: () => any;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
show: boolean;
|
|
3
|
+
deviceType?: 'passkey' | 'hardware';
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
6
|
+
close: () => any;
|
|
7
|
+
success: () => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
9
|
+
onClose?: () => any;
|
|
10
|
+
onSuccess?: () => any;
|
|
11
|
+
}>, {
|
|
12
|
+
deviceType: "passkey" | "hardware";
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
class?: string;
|
|
3
|
+
variant?: 'default' | 'secured' | 'powered' | 'accounts';
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
6
|
+
class: string;
|
|
7
|
+
variant: "default" | "secured" | "powered" | "accounts";
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export default _default;
|