@strands.gg/accui 2.16.0 → 2.17.10
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-Bwc7jBcb.cjs.js +143 -0
- package/dist/StrandsUIPlugin-RTFzvRED.es.js +20536 -0
- package/dist/accui.css +1 -1
- package/dist/index.cjs.js +5 -1
- package/dist/index.es.js +8822 -12491
- package/dist/nuxt/module.cjs.js +23 -1
- package/dist/nuxt/module.es.js +58 -82
- package/dist/nuxt/runtime/composables/useAuthenticatedFetch.cjs.js +1 -1
- package/dist/nuxt/runtime/composables/useAuthenticatedFetch.es.js +82 -111
- package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +30 -46
- package/dist/nuxt/runtime/middleware/auth.global.cjs.js +1 -1
- package/dist/nuxt/runtime/middleware/auth.global.es.js +28 -44
- package/dist/nuxt/runtime/plugin.client.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.client.es.js +10 -19
- package/dist/nuxt/runtime/plugin.server.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.server.es.js +8 -10
- package/dist/nuxt/runtime/plugins/auth-interceptor.client.cjs.js +1 -1
- package/dist/nuxt/runtime/plugins/auth-interceptor.client.es.js +27 -48
- package/dist/nuxt/types.d.ts +1 -0
- package/dist/nuxt.cjs.js +1 -1
- package/dist/nuxt.es.js +9 -9
- package/dist/types/index.d.ts +5 -0
- package/dist/useStrandsAuth-DSBvF4ky.es.js +653 -0
- package/dist/useStrandsAuth-EqbzuNAn.cjs.js +1 -0
- package/dist/useStrandsConfig-B5kp4aF9.cjs.js +1 -0
- package/dist/useStrandsConfig-CMKVW1p3.es.js +210 -0
- package/dist/vite.cjs.js +29 -1
- package/dist/vite.es.js +58 -75
- package/dist/vue/utils/modalStack.d.ts +3 -0
- package/dist/webcomponents/define-element.d.ts +3 -2
- package/package.json +2 -2
- package/dist/StrandsUIPlugin-C9rrMU2i.cjs.js +0 -1
- package/dist/StrandsUIPlugin-tl7L52hZ.es.js +0 -26130
- package/dist/useStrandsAuth-BCnUxo-R.es.js +0 -915
- package/dist/useStrandsAuth-DoJxpNLb.cjs.js +0 -1
- package/dist/useStrandsConfig-Sr6NG90B.cjs.js +0 -1
- package/dist/useStrandsConfig-fRu-OG08.es.js +0 -248
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("vue"),c={baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",redirectUrl:"/",onSignInUrl:"/dashboard",onSignOutUrl:"/",authUrl:"/auth",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0,endpoints:{},useSquircle:!0},a={signIn:"/api/v1/auth/sign-in",signUp:"/api/v1/auth/sign-up",signOut:"/api/v1/auth/sign-out",refresh:"/api/v1/auth/refresh",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"},p=Symbol("strands-config"),m=u.ref(null);function v(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 t={"--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(t))document.documentElement.style.setProperty(r,n)}function g(s){if(m.value=s,typeof window<"u"&&document.documentElement){const t=s.useSquircle!==void 0?s.useSquircle:!0;document.documentElement.style.setProperty("--strands-allow-squircle",t?"1":"0"),s.accentColor&&v(s.accentColor)}try{u.provide(p,s)}catch(t){console.warn("[Strands Auth] Could not provide config via Vue provide/inject. Config available via global state only.",t)}}function h(s){let t=null;try{u.getCurrentInstance()&&(t=u.inject(p,null))}catch{t=null}let r=null;try{if(typeof window<"u"){if(window.__STRANDS_CONFIG__)r=window.__STRANDS_CONFIG__;else if(window.__NUXT__){const i=window.__NUXT__;r=i?.config?.public?.strandsAuth||i?.public?.strandsAuth||i?.strandsAuth}}}catch(i){console.error("[Strands Auth] Error accessing runtime configuration:",i)}const n=u.computed(()=>{const i={...c,...s||{},...t||{},...m.value||{},...r||{}};if(i.baseUrl===c.baseUrl&&typeof window>"u"&&console.warn("[Strands Auth] No baseUrl configured for SSR. Please provide a baseUrl in your strandsAuth configuration."),typeof window<"u"&&document.documentElement){const e=i.useSquircle!==void 0?i.useSquircle:!0;document.documentElement.style.setProperty("--strands-allow-squircle",e?"1":"0"),i.accentColor&&document.documentElement.style.setProperty("--strands-accent",i.accentColor)}return i}),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,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:i=>{const e=n.value;if(!e.baseUrl)throw new Error("Base URL is required in configuration");let o;typeof i=="string"&&i in l.value?o=l.value[i]:typeof i=="string"?o=i:o=l.value[i];const f=e.baseUrl.replace(/\/$/,""),d=o.startsWith("/")?o:`/${o}`;return console.debug(`[Strands Auth] Constructing URL for endpoint "${i}": ${f}${d}`),`${f}${d}`},getSupportEmail:()=>n.value.supportEmail||null}}function S(s){if(m.value=s,typeof window<"u"&&document.documentElement){const t=s.useSquircle!==void 0?s.useSquircle:!0;document.documentElement.style.setProperty("--strands-allow-squircle",t?"1":"0"),s.accentColor&&v(s.accentColor)}}const y=Object.freeze(Object.defineProperty({__proto__:null,provideStrandsConfig:g,setStrandsConfig:S,useStrandsConfig:h},Symbol.toStringTag,{value:"Module"}));exports.STRANDS_AUTH_DEFAULTS=c;exports.provideStrandsConfig=g;exports.setStrandsConfig=S;exports.useStrandsConfig=h;exports.useStrandsConfig$1=y;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { ref as g, getCurrentInstance as h, inject as S, computed as f, provide as y } from "vue";
|
|
2
|
+
const d = {
|
|
3
|
+
baseUrl: "https://your-api.example.com",
|
|
4
|
+
accentColor: "#EA00A8",
|
|
5
|
+
redirectUrl: "/",
|
|
6
|
+
onSignInUrl: "/dashboard",
|
|
7
|
+
onSignOutUrl: "/",
|
|
8
|
+
authUrl: "/auth",
|
|
9
|
+
autoRefresh: !0,
|
|
10
|
+
refreshInterval: 4,
|
|
11
|
+
protectedRoutes: [],
|
|
12
|
+
guestOnlyRoutes: ["/auth", "/login", "/register"],
|
|
13
|
+
devMode: !1,
|
|
14
|
+
styles: !0,
|
|
15
|
+
endpoints: {},
|
|
16
|
+
useSquircle: !0
|
|
17
|
+
}, a = {
|
|
18
|
+
signIn: "/api/v1/auth/sign-in",
|
|
19
|
+
signUp: "/api/v1/auth/sign-up",
|
|
20
|
+
signOut: "/api/v1/auth/sign-out",
|
|
21
|
+
refresh: "/api/v1/auth/refresh",
|
|
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 t = {
|
|
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(t))
|
|
86
|
+
document.documentElement.style.setProperty(r, n);
|
|
87
|
+
}
|
|
88
|
+
function w(s) {
|
|
89
|
+
if (l.value = s, typeof window < "u" && document.documentElement) {
|
|
90
|
+
const t = s.useSquircle !== void 0 ? s.useSquircle : !0;
|
|
91
|
+
document.documentElement.style.setProperty("--strands-allow-squircle", t ? "1" : "0"), s.accentColor && v(s.accentColor);
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
y(p, s);
|
|
95
|
+
} catch (t) {
|
|
96
|
+
console.warn("[Strands Auth] Could not provide config via Vue provide/inject. Config available via global state only.", t);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function b(s) {
|
|
100
|
+
let t = null;
|
|
101
|
+
try {
|
|
102
|
+
h() && (t = S(p, null));
|
|
103
|
+
} catch {
|
|
104
|
+
t = 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 i = window.__NUXT__;
|
|
113
|
+
r = i?.config?.public?.strandsAuth || i?.public?.strandsAuth || i?.strandsAuth;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} catch (i) {
|
|
117
|
+
console.error("[Strands Auth] Error accessing runtime configuration:", i);
|
|
118
|
+
}
|
|
119
|
+
const n = f(() => {
|
|
120
|
+
const i = {
|
|
121
|
+
...d,
|
|
122
|
+
...s || {},
|
|
123
|
+
...t || {},
|
|
124
|
+
...l.value || {},
|
|
125
|
+
...r || {}
|
|
126
|
+
};
|
|
127
|
+
if (i.baseUrl === d.baseUrl && typeof window > "u" && console.warn("[Strands Auth] No baseUrl configured for SSR. Please provide a baseUrl in your strandsAuth configuration."), typeof window < "u" && document.documentElement) {
|
|
128
|
+
const e = i.useSquircle !== void 0 ? i.useSquircle : !0;
|
|
129
|
+
document.documentElement.style.setProperty("--strands-allow-squircle", e ? "1" : "0"), i.accentColor && document.documentElement.style.setProperty("--strands-accent", i.accentColor);
|
|
130
|
+
}
|
|
131
|
+
return i;
|
|
132
|
+
}), u = f(() => {
|
|
133
|
+
const e = n.value.endpoints || {};
|
|
134
|
+
return {
|
|
135
|
+
signIn: e.signIn || a.signIn,
|
|
136
|
+
signUp: e.signUp || a.signUp,
|
|
137
|
+
signOut: e.signOut || a.signOut,
|
|
138
|
+
refresh: e.refresh || a.refresh,
|
|
139
|
+
passwordReset: e.passwordReset || a.passwordReset,
|
|
140
|
+
passwordResetConfirm: e.passwordResetConfirm || a.passwordResetConfirm,
|
|
141
|
+
completeRegistration: e.completeRegistration || a.completeRegistration,
|
|
142
|
+
profile: e.profile || a.profile,
|
|
143
|
+
verifyEmail: e.verifyEmail || a.verifyEmail,
|
|
144
|
+
oauthProviders: e.oauthProviders || a.oauthProviders,
|
|
145
|
+
oauthProvider: e.oauthProvider || a.oauthProvider,
|
|
146
|
+
changeEmail: e.changeEmail || a.changeEmail,
|
|
147
|
+
avatar: e.avatar || a.avatar,
|
|
148
|
+
settings: e.settings || a.settings,
|
|
149
|
+
// Username endpoints
|
|
150
|
+
changeUsername: e.changeUsername || a.changeUsername,
|
|
151
|
+
usernameCooldown: e.usernameCooldown || a.usernameCooldown,
|
|
152
|
+
checkUsernameAvailability: e.checkUsernameAvailability || a.checkUsernameAvailability,
|
|
153
|
+
// MFA endpoints
|
|
154
|
+
mfaDevices: e.mfaDevices || a.mfaDevices,
|
|
155
|
+
mfaTotpSetup: e.mfaTotpSetup || a.mfaTotpSetup,
|
|
156
|
+
mfaTotpVerify: e.mfaTotpVerify || a.mfaTotpVerify,
|
|
157
|
+
mfaEmailSetup: e.mfaEmailSetup || a.mfaEmailSetup,
|
|
158
|
+
mfaEmailSend: e.mfaEmailSend || a.mfaEmailSend,
|
|
159
|
+
mfaEmailVerify: e.mfaEmailVerify || a.mfaEmailVerify,
|
|
160
|
+
mfaDeviceDisable: e.mfaDeviceDisable || a.mfaDeviceDisable,
|
|
161
|
+
mfaBackupCodes: e.mfaBackupCodes || a.mfaBackupCodes,
|
|
162
|
+
// Hardware key endpoints
|
|
163
|
+
mfaHardwareStartRegistration: e.mfaHardwareStartRegistration || a.mfaHardwareStartRegistration,
|
|
164
|
+
mfaHardwareCompleteRegistration: e.mfaHardwareCompleteRegistration || a.mfaHardwareCompleteRegistration,
|
|
165
|
+
// MFA sign-in specific endpoints
|
|
166
|
+
mfaSigninSendEmail: e.mfaSigninSendEmail || a.mfaSigninSendEmail,
|
|
167
|
+
mfaSigninVerify: e.mfaSigninVerify || a.mfaSigninVerify,
|
|
168
|
+
mfaBackupCodeVerify: e.mfaBackupCodeVerify || a.mfaBackupCodeVerify,
|
|
169
|
+
mfaWebAuthnChallenge: e.mfaWebAuthnChallenge || a.mfaWebAuthnChallenge,
|
|
170
|
+
// Session management endpoints
|
|
171
|
+
sessions: e.sessions || a.sessions,
|
|
172
|
+
sessionsStats: e.sessionsStats || a.sessionsStats,
|
|
173
|
+
sessionRevoke: e.sessionRevoke || a.sessionRevoke,
|
|
174
|
+
sessionsRevokeAll: e.sessionsRevokeAll || a.sessionsRevokeAll
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
return {
|
|
178
|
+
config: n,
|
|
179
|
+
endpoints: u,
|
|
180
|
+
getUrl: (i) => {
|
|
181
|
+
const e = n.value;
|
|
182
|
+
if (!e.baseUrl)
|
|
183
|
+
throw new Error("Base URL is required in configuration");
|
|
184
|
+
let o;
|
|
185
|
+
typeof i == "string" && i in u.value ? o = u.value[i] : typeof i == "string" ? o = i : o = u.value[i];
|
|
186
|
+
const m = e.baseUrl.replace(/\/$/, ""), c = o.startsWith("/") ? o : `/${o}`;
|
|
187
|
+
return console.debug(`[Strands Auth] Constructing URL for endpoint "${i}": ${m}${c}`), `${m}${c}`;
|
|
188
|
+
},
|
|
189
|
+
getSupportEmail: () => n.value.supportEmail || null
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function E(s) {
|
|
193
|
+
if (l.value = s, typeof window < "u" && document.documentElement) {
|
|
194
|
+
const t = s.useSquircle !== void 0 ? s.useSquircle : !0;
|
|
195
|
+
document.documentElement.style.setProperty("--strands-allow-squircle", t ? "1" : "0"), s.accentColor && v(s.accentColor);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
199
|
+
__proto__: null,
|
|
200
|
+
provideStrandsConfig: w,
|
|
201
|
+
setStrandsConfig: E,
|
|
202
|
+
useStrandsConfig: b
|
|
203
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
204
|
+
export {
|
|
205
|
+
d as S,
|
|
206
|
+
k as a,
|
|
207
|
+
w as p,
|
|
208
|
+
E as s,
|
|
209
|
+
b as u
|
|
210
|
+
};
|
package/dist/vite.cjs.js
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
"use strict";function
|
|
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-Bwc7jBcb.cjs.js")).then(n=>n.StrandsUIPlugin$1).then(n=>{const r=n.default;a.use(r)}),Promise.resolve().then(()=>require("./useStrandsConfig-B5kp4aF9.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.es.js
CHANGED
|
@@ -1,109 +1,92 @@
|
|
|
1
|
-
function
|
|
1
|
+
function u(r = {}) {
|
|
2
2
|
const {
|
|
3
|
-
styles =
|
|
4
|
-
accentColor = "#EA00A8",
|
|
5
|
-
useSquircle =
|
|
6
|
-
...
|
|
7
|
-
} =
|
|
8
|
-
let
|
|
3
|
+
styles: a = !0,
|
|
4
|
+
accentColor: n = "#EA00A8",
|
|
5
|
+
useSquircle: i = !0,
|
|
6
|
+
...o
|
|
7
|
+
} = r;
|
|
8
|
+
let c;
|
|
9
9
|
return {
|
|
10
10
|
name: "@strands.gg/accui:vite-plugin",
|
|
11
11
|
enforce: "pre",
|
|
12
|
-
config(
|
|
13
|
-
|
|
14
|
-
accentColor,
|
|
15
|
-
useSquircle,
|
|
16
|
-
...
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
12
|
+
config(s, { command: t }) {
|
|
13
|
+
return c = {
|
|
14
|
+
accentColor: n,
|
|
15
|
+
useSquircle: i,
|
|
16
|
+
...o
|
|
17
|
+
}, {
|
|
19
18
|
define: {
|
|
20
19
|
// Make config available at build time
|
|
21
|
-
|
|
20
|
+
__STRANDS_CONFIG__: JSON.stringify(c)
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
},
|
|
25
24
|
transformIndexHtml: {
|
|
26
25
|
order: "pre",
|
|
27
|
-
handler(
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
26
|
+
handler(s) {
|
|
27
|
+
if (n && n !== "#EA00A8") {
|
|
28
|
+
const e = `<style data-strands-accent>${`
|
|
30
29
|
:root {
|
|
31
|
-
--strands-accent: ${
|
|
32
|
-
--accui-strands-accent: ${
|
|
33
|
-
--accui-strands-50: color-mix(in srgb, ${
|
|
34
|
-
--accui-strands-100: color-mix(in srgb, ${
|
|
35
|
-
--accui-strands-200: color-mix(in srgb, ${
|
|
36
|
-
--accui-strands-300: color-mix(in srgb, ${
|
|
37
|
-
--accui-strands-400: color-mix(in srgb, ${
|
|
38
|
-
--accui-strands-500: ${
|
|
39
|
-
--accui-strands-600: color-mix(in srgb, ${
|
|
40
|
-
--accui-strands-700: color-mix(in srgb, ${
|
|
41
|
-
--accui-strands-800: color-mix(in srgb, ${
|
|
42
|
-
--accui-strands-900: color-mix(in srgb, ${
|
|
43
|
-
--accui-strands-950: color-mix(in srgb, ${
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return html.replace("</head>", ` ${styleTag}
|
|
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}
|
|
47
45
|
</head>`);
|
|
48
46
|
}
|
|
49
|
-
return
|
|
47
|
+
return s;
|
|
50
48
|
}
|
|
51
49
|
},
|
|
52
|
-
async transform(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (id.endsWith("main.ts") || id.endsWith("main.js")) {
|
|
63
|
-
if (!code.includes("setStrandsConfig") && !code.includes("__STRANDS_INJECTED__")) {
|
|
64
|
-
const configSetup = `
|
|
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: `${`
|
|
65
57
|
// Auto-injected by @strands.gg/accui Vite plugin
|
|
66
58
|
import { setStrandsConfig } from '@strands.gg/accui'
|
|
67
59
|
|
|
68
60
|
if (typeof window !== 'undefined') {
|
|
69
|
-
const strandsConfig = ${JSON.stringify(
|
|
61
|
+
const strandsConfig = ${JSON.stringify(c)}
|
|
70
62
|
setStrandsConfig(strandsConfig)
|
|
71
63
|
window.__STRANDS_CONFIG__ = strandsConfig
|
|
72
64
|
window.__STRANDS_INJECTED__ = true
|
|
73
65
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
map: null
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
66
|
+
`}
|
|
67
|
+
${s}`,
|
|
68
|
+
map: null
|
|
69
|
+
} : null;
|
|
83
70
|
}
|
|
84
71
|
};
|
|
85
72
|
}
|
|
86
|
-
function
|
|
73
|
+
function d(r = {}) {
|
|
87
74
|
return {
|
|
88
|
-
install(
|
|
89
|
-
import("./StrandsUIPlugin-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
setStrandsConfig(config);
|
|
96
|
-
if (typeof window !== "undefined") {
|
|
97
|
-
window.__STRANDS_CONFIG__ = config;
|
|
98
|
-
}
|
|
75
|
+
install(a) {
|
|
76
|
+
import("./StrandsUIPlugin-RTFzvRED.es.js").then((n) => n.n).then((n) => {
|
|
77
|
+
const i = n.default;
|
|
78
|
+
a.use(i);
|
|
79
|
+
}), import("./useStrandsConfig-CMKVW1p3.es.js").then((n) => n.a).then((n) => {
|
|
80
|
+
const { setStrandsConfig: i } = n;
|
|
81
|
+
i(r), typeof window < "u" && (window.__STRANDS_CONFIG__ = r);
|
|
99
82
|
});
|
|
100
83
|
}
|
|
101
84
|
};
|
|
102
85
|
}
|
|
103
86
|
export {
|
|
104
|
-
|
|
105
|
-
StrandsAuthVitePlugin,
|
|
106
|
-
createStrandsAuth,
|
|
107
|
-
|
|
108
|
-
|
|
87
|
+
u as StrandsAuth,
|
|
88
|
+
u as StrandsAuthVitePlugin,
|
|
89
|
+
d as createStrandsAuth,
|
|
90
|
+
u as default,
|
|
91
|
+
u as strandsAuth
|
|
109
92
|
};
|
|
@@ -17,8 +17,11 @@ declare class ModalStack {
|
|
|
17
17
|
private escapeHandlerRegistered;
|
|
18
18
|
private baseZIndex;
|
|
19
19
|
private subscribers;
|
|
20
|
+
private originalBodyOverflow;
|
|
20
21
|
private handleEscape;
|
|
21
22
|
private calculateZIndex;
|
|
23
|
+
private lockBodyScroll;
|
|
24
|
+
private unlockBodyScroll;
|
|
22
25
|
private notifySubscribers;
|
|
23
26
|
add(modal: Omit<ModalInstance, 'zIndex'>): ModalInstance;
|
|
24
27
|
remove(modalId: symbol): void;
|
|
@@ -11,9 +11,10 @@ export declare const baseStyles = "\n :host {\n /* Typography */\n --accu
|
|
|
11
11
|
*
|
|
12
12
|
* @param tagName - The custom element tag name (e.g., 'strands-button')
|
|
13
13
|
* @param component - The Vue component to convert
|
|
14
|
-
* @param
|
|
14
|
+
* @param dependencyStyles - Optional array of CSS strings from dependent components
|
|
15
|
+
* (injected by the Vite build plugin)
|
|
15
16
|
*/
|
|
16
|
-
export declare function registerCustomElement(tagName: string, component: Component,
|
|
17
|
+
export declare function registerCustomElement(tagName: string, component: Component, dependencyStyles?: string[]): void;
|
|
17
18
|
/**
|
|
18
19
|
* Check if a custom element is already registered
|
|
19
20
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strands.gg/accui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.10",
|
|
4
4
|
"description": "Strands Authentication UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@fullhuman/postcss-purgecss": "^7.0.2",
|
|
91
91
|
"@nuxt/kit": "^4.0.3",
|
|
92
92
|
"@nuxt/schema": "^4.0.3",
|
|
93
|
-
"@vitejs/plugin-vue": "^
|
|
93
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
94
94
|
"lightningcss": "^1.30.1",
|
|
95
95
|
"nuxt": "^4.0.3",
|
|
96
96
|
"postcss": "^8.5.6",
|