@strands.gg/accui 0.2.3 → 0.2.4
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/nuxt/module.cjs.js +1 -1
- package/dist/nuxt/module.cjs.js.map +1 -1
- package/dist/nuxt/module.d.ts +1 -1
- package/dist/nuxt/module.d.ts.map +1 -1
- package/dist/nuxt/module.es.js +15 -15
- package/dist/nuxt/module.es.js.map +1 -1
- package/dist/nuxt-v4/module.cjs.js +4 -4
- package/dist/nuxt-v4/module.cjs.js.map +1 -1
- package/dist/nuxt-v4/module.d.ts +1 -1
- package/dist/nuxt-v4/module.d.ts.map +1 -1
- package/dist/nuxt-v4/module.es.js +8 -8
- package/dist/nuxt-v4/module.es.js.map +1 -1
- package/package.json +1 -1
package/dist/nuxt/module.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("@nuxt/kit");var u=typeof document<"u"?document.currentScript:null;const o=r.defineNuxtModule({meta:{name:"@strands.gg/accui/nuxt",configKey:"strandsAuth",compatibility:{nuxt:"^3.0.0"}},defaults:{baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",redirectUrl:"/",onSignInUrl:"/dashboard",onSignOutUrl:"/",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0},async setup(e,s){const t=r.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:u&&u.tagName.toUpperCase()==="SCRIPT"&&u.src||new URL("nuxt/module.cjs.js",document.baseURI).href)
|
|
1
|
+
"use strict";const r=require("@nuxt/kit");var u=typeof document<"u"?document.currentScript:null;const o=r.defineNuxtModule({meta:{name:"@strands.gg/accui/nuxt",configKey:"strandsAuth",compatibility:{nuxt:"^3.0.0"}},defaults:{baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",redirectUrl:"/",onSignInUrl:"/dashboard",onSignOutUrl:"/",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0},async setup(e,s){const t=r.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:u&&u.tagName.toUpperCase()==="SCRIPT"&&u.src||new URL("nuxt/module.cjs.js",document.baseURI).href);s.options.runtimeConfig.public=s.options.runtimeConfig.public||{},s.options.runtimeConfig.public.strandsAuth={baseUrl:e.baseUrl,clientId:e.clientId,accentColor:e.accentColor,redirectUrl:e.redirectUrl,onSignInUrl:e.onSignInUrl,onSignOutUrl:e.onSignOutUrl,autoRefresh:e.autoRefresh,refreshInterval:e.refreshInterval,protectedRoutes:e.protectedRoutes,guestOnlyRoutes:e.guestOnlyRoutes,devMode:e.devMode,styles:e.styles!==!1},e.styles!==!1&&(s.options.css.push("@strands.gg/accui/style.css"),s.options.css.push(t.resolve("./runtime/styles.css"))),r.addPlugin({src:t.resolve("./runtime/plugin.client.es.js"),mode:"client"}),r.addPlugin({src:t.resolve("./runtime/plugin.server.es.js"),mode:"server"}),r.addRouteMiddleware({name:"auth",path:t.resolve("./runtime/middleware/auth.global.es.js"),global:!0}),s.hook("pages:extend",n=>{}),r.addImports([{name:"useStrandsAuth",as:"useStrandsAuth",from:t.resolve("./runtime/composables/useStrandsAuth.es.js")},{name:"useAuthUser",as:"useAuthUser",from:t.resolve("./runtime/composables/useStrandsAuth.es.js")},{name:"useAuthState",as:"useAuthState",from:t.resolve("./runtime/composables/useStrandsAuth.es.js")}]);const a=["StrandsAuth","StrandsSignIn","StrandsSignUp","StrandsUserProfile","StrandsPasswordReset","StrandsMFASetup","StrandsConfigProvider","SignedIn","SignedOut","StrandsLogo","StrandsSecuredFooter"];for(const n of a)r.addComponent({name:n,export:n,filePath:"@strands.gg/accui"});s.hook("prepare:types",n=>{n.references.push({types:"@strands.gg/auth-nuxt"})})}});module.exports=o;
|
|
2
2
|
//# sourceMappingURL=module.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^3.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n //
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication (optional - authentication is now based on domain)\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^3.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n // Note: clientId is now optional as authentication is based on domain\n\n // Add runtime config with proper typing\n nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}\n ;(nuxt.options.runtimeConfig.public as any).strandsAuth = {\n baseUrl: options.baseUrl,\n clientId: options.clientId,\n accentColor: options.accentColor,\n redirectUrl: options.redirectUrl,\n onSignInUrl: options.onSignInUrl,\n onSignOutUrl: options.onSignOutUrl,\n autoRefresh: options.autoRefresh,\n refreshInterval: options.refreshInterval,\n protectedRoutes: options.protectedRoutes,\n guestOnlyRoutes: options.guestOnlyRoutes,\n devMode: options.devMode,\n styles: options.styles !== false // Default to true, allow disabling\n }\n\n // Conditionally add CSS for styling based on autoImportStyles setting\n if (options.styles !== false) {\n nuxt.options.css.push('@strands.gg/accui/style.css')\n nuxt.options.css.push(resolver.resolve('./runtime/styles.css'))\n }\n\n // Add the main plugin\n addPlugin({\n src: resolver.resolve('./runtime/plugin.client.es.js'),\n mode: 'client'\n })\n\n // Add server plugin for SSR support\n addPlugin({\n src: resolver.resolve('./runtime/plugin.server.es.js'),\n mode: 'server'\n })\n\n // Add middleware for route protection\n addRouteMiddleware({\n name: 'auth',\n path: resolver.resolve('./runtime/middleware/auth.global.es.js'),\n global: true\n })\n\n // Add route middleware\n nuxt.hook('pages:extend', (pages) => {\n // This will be handled in the global middleware instead\n })\n\n // Auto-import composables\n addImports([\n {\n name: 'useStrandsAuth',\n as: 'useStrandsAuth',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthUser',\n as: 'useAuthUser', \n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthState',\n as: 'useAuthState',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n }\n ])\n\n // Auto-register components from the main bundle export\n const components = [\n 'StrandsAuth',\n 'StrandsSignIn', \n 'StrandsSignUp',\n 'StrandsUserProfile',\n 'StrandsPasswordReset',\n 'StrandsMFASetup',\n 'StrandsConfigProvider',\n 'SignedIn',\n 'SignedOut',\n 'StrandsLogo',\n 'StrandsSecuredFooter'\n ]\n\n for (const component of components) {\n addComponent({\n name: component,\n export: component,\n filePath: '@strands.gg/accui'\n })\n }\n\n // Add type declarations\n nuxt.hook('prepare:types', (opts) => {\n opts.references.push({\n types: '@strands.gg/auth-nuxt'\n })\n })\n }\n})"],"names":["module$1","defineNuxtModule","options","nuxt","resolver","createResolver","addPlugin","addRouteMiddleware","pages","addImports","components","component","addComponent","opts"],"mappings":"gGA4EA,MAAAA,EAAeC,mBAAoC,CACjD,KAAM,CACJ,KAAM,yBACN,UAAW,cACX,cAAe,CACb,KAAM,QAAA,CACR,EAEF,SAAU,CACR,QAAS,+BACT,YAAa,UACb,YAAa,IACb,YAAa,aACb,aAAc,IACd,YAAa,GACb,gBAAiB,EACjB,gBAAiB,CAAA,EACjB,gBAAiB,CAAC,QAAS,SAAU,WAAW,EAChD,QAAS,GACT,OAAQ,EAAA,EAEV,MAAM,MAAMC,EAASC,EAAM,CACzB,MAAMC,EAAWC,EAAAA,kLAA8B,EAK/CF,EAAK,QAAQ,cAAc,OAASA,EAAK,QAAQ,cAAc,QAAU,CAAA,EACvEA,EAAK,QAAQ,cAAc,OAAe,YAAc,CACxD,QAASD,EAAQ,QACjB,SAAUA,EAAQ,SAClB,YAAaA,EAAQ,YACrB,YAAaA,EAAQ,YACrB,YAAaA,EAAQ,YACrB,aAAcA,EAAQ,aACtB,YAAaA,EAAQ,YACrB,gBAAiBA,EAAQ,gBACzB,gBAAiBA,EAAQ,gBACzB,gBAAiBA,EAAQ,gBACzB,QAASA,EAAQ,QACjB,OAAQA,EAAQ,SAAW,EAAA,EAIzBA,EAAQ,SAAW,KACrBC,EAAK,QAAQ,IAAI,KAAK,6BAA6B,EACnDA,EAAK,QAAQ,IAAI,KAAKC,EAAS,QAAQ,sBAAsB,CAAC,GAIhEE,YAAU,CACR,IAAKF,EAAS,QAAQ,+BAA+B,EACrD,KAAM,QAAA,CACP,EAGDE,YAAU,CACR,IAAKF,EAAS,QAAQ,+BAA+B,EACrD,KAAM,QAAA,CACP,EAGDG,qBAAmB,CACjB,KAAM,OACN,KAAMH,EAAS,QAAQ,wCAAwC,EAC/D,OAAQ,EAAA,CACT,EAGDD,EAAK,KAAK,eAAiBK,GAAU,CAErC,CAAC,EAGDC,aAAW,CACT,CACE,KAAM,iBACN,GAAI,iBACJ,KAAML,EAAS,QAAQ,4CAA4C,CAAA,EAErE,CACE,KAAM,cACN,GAAI,cACJ,KAAMA,EAAS,QAAQ,4CAA4C,CAAA,EAErE,CACE,KAAM,eACN,GAAI,eACJ,KAAMA,EAAS,QAAQ,4CAA4C,CAAA,CACrE,CACD,EAGD,MAAMM,EAAa,CACjB,cACA,gBACA,gBACA,qBACA,uBACA,kBACA,wBACA,WACA,YACA,cACA,sBAAA,EAGF,UAAWC,KAAaD,EACtBE,eAAa,CACX,KAAMD,EACN,OAAQA,EACR,SAAU,mBAAA,CACX,EAIHR,EAAK,KAAK,gBAAkBU,GAAS,CACnCA,EAAK,WAAW,KAAK,CACnB,MAAO,uBAAA,CACR,CACH,CAAC,CACH,CACF,CAAC"}
|
package/dist/nuxt/module.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;AAED,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;AAED,wBA0HE"}
|
package/dist/nuxt/module.es.js
CHANGED
|
@@ -21,8 +21,8 @@ const m = o({
|
|
|
21
21
|
styles: !0
|
|
22
22
|
},
|
|
23
23
|
async setup(e, s) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const t = u(import.meta.url);
|
|
25
|
+
s.options.runtimeConfig.public = s.options.runtimeConfig.public || {}, s.options.runtimeConfig.public.strandsAuth = {
|
|
26
26
|
baseUrl: e.baseUrl,
|
|
27
27
|
clientId: e.clientId,
|
|
28
28
|
accentColor: e.accentColor,
|
|
@@ -36,32 +36,32 @@ const m = o({
|
|
|
36
36
|
devMode: e.devMode,
|
|
37
37
|
styles: e.styles !== !1
|
|
38
38
|
// Default to true, allow disabling
|
|
39
|
-
}, e.styles !== !1 && (s.options.css.push("@strands.gg/accui/style.css"), s.options.css.push(
|
|
40
|
-
src:
|
|
39
|
+
}, e.styles !== !1 && (s.options.css.push("@strands.gg/accui/style.css"), s.options.css.push(t.resolve("./runtime/styles.css"))), n({
|
|
40
|
+
src: t.resolve("./runtime/plugin.client.es.js"),
|
|
41
41
|
mode: "client"
|
|
42
42
|
}), n({
|
|
43
|
-
src:
|
|
43
|
+
src: t.resolve("./runtime/plugin.server.es.js"),
|
|
44
44
|
mode: "server"
|
|
45
45
|
}), l({
|
|
46
46
|
name: "auth",
|
|
47
|
-
path:
|
|
47
|
+
path: t.resolve("./runtime/middleware/auth.global.es.js"),
|
|
48
48
|
global: !0
|
|
49
|
-
}), s.hook("pages:extend", (
|
|
49
|
+
}), s.hook("pages:extend", (r) => {
|
|
50
50
|
}), d([
|
|
51
51
|
{
|
|
52
52
|
name: "useStrandsAuth",
|
|
53
53
|
as: "useStrandsAuth",
|
|
54
|
-
from:
|
|
54
|
+
from: t.resolve("./runtime/composables/useStrandsAuth.es.js")
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
name: "useAuthUser",
|
|
58
58
|
as: "useAuthUser",
|
|
59
|
-
from:
|
|
59
|
+
from: t.resolve("./runtime/composables/useStrandsAuth.es.js")
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: "useAuthState",
|
|
63
63
|
as: "useAuthState",
|
|
64
|
-
from:
|
|
64
|
+
from: t.resolve("./runtime/composables/useStrandsAuth.es.js")
|
|
65
65
|
}
|
|
66
66
|
]);
|
|
67
67
|
const a = [
|
|
@@ -77,14 +77,14 @@ const m = o({
|
|
|
77
77
|
"StrandsLogo",
|
|
78
78
|
"StrandsSecuredFooter"
|
|
79
79
|
];
|
|
80
|
-
for (const
|
|
80
|
+
for (const r of a)
|
|
81
81
|
i({
|
|
82
|
-
name:
|
|
83
|
-
export:
|
|
82
|
+
name: r,
|
|
83
|
+
export: r,
|
|
84
84
|
filePath: "@strands.gg/accui"
|
|
85
85
|
});
|
|
86
|
-
s.hook("prepare:types", (
|
|
87
|
-
|
|
86
|
+
s.hook("prepare:types", (r) => {
|
|
87
|
+
r.references.push({
|
|
88
88
|
types: "@strands.gg/auth-nuxt"
|
|
89
89
|
});
|
|
90
90
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.es.js","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^3.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n //
|
|
1
|
+
{"version":3,"file":"module.es.js","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication (optional - authentication is now based on domain)\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^3.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n // Note: clientId is now optional as authentication is based on domain\n\n // Add runtime config with proper typing\n nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}\n ;(nuxt.options.runtimeConfig.public as any).strandsAuth = {\n baseUrl: options.baseUrl,\n clientId: options.clientId,\n accentColor: options.accentColor,\n redirectUrl: options.redirectUrl,\n onSignInUrl: options.onSignInUrl,\n onSignOutUrl: options.onSignOutUrl,\n autoRefresh: options.autoRefresh,\n refreshInterval: options.refreshInterval,\n protectedRoutes: options.protectedRoutes,\n guestOnlyRoutes: options.guestOnlyRoutes,\n devMode: options.devMode,\n styles: options.styles !== false // Default to true, allow disabling\n }\n\n // Conditionally add CSS for styling based on autoImportStyles setting\n if (options.styles !== false) {\n nuxt.options.css.push('@strands.gg/accui/style.css')\n nuxt.options.css.push(resolver.resolve('./runtime/styles.css'))\n }\n\n // Add the main plugin\n addPlugin({\n src: resolver.resolve('./runtime/plugin.client.es.js'),\n mode: 'client'\n })\n\n // Add server plugin for SSR support\n addPlugin({\n src: resolver.resolve('./runtime/plugin.server.es.js'),\n mode: 'server'\n })\n\n // Add middleware for route protection\n addRouteMiddleware({\n name: 'auth',\n path: resolver.resolve('./runtime/middleware/auth.global.es.js'),\n global: true\n })\n\n // Add route middleware\n nuxt.hook('pages:extend', (pages) => {\n // This will be handled in the global middleware instead\n })\n\n // Auto-import composables\n addImports([\n {\n name: 'useStrandsAuth',\n as: 'useStrandsAuth',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthUser',\n as: 'useAuthUser', \n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthState',\n as: 'useAuthState',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n }\n ])\n\n // Auto-register components from the main bundle export\n const components = [\n 'StrandsAuth',\n 'StrandsSignIn', \n 'StrandsSignUp',\n 'StrandsUserProfile',\n 'StrandsPasswordReset',\n 'StrandsMFASetup',\n 'StrandsConfigProvider',\n 'SignedIn',\n 'SignedOut',\n 'StrandsLogo',\n 'StrandsSecuredFooter'\n ]\n\n for (const component of components) {\n addComponent({\n name: component,\n export: component,\n filePath: '@strands.gg/accui'\n })\n }\n\n // Add type declarations\n nuxt.hook('prepare:types', (opts) => {\n opts.references.push({\n types: '@strands.gg/auth-nuxt'\n })\n })\n }\n})"],"names":["module","defineNuxtModule","options","nuxt","resolver","createResolver","addPlugin","addRouteMiddleware","pages","addImports","components","component","addComponent","opts"],"mappings":";AA4EA,MAAAA,IAAeC,EAAoC;AAAA,EACjD,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,eAAe;AAAA,MACb,MAAM;AAAA,IAAA;AAAA,EACR;AAAA,EAEF,UAAU;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,iBAAiB,CAAA;AAAA,IACjB,iBAAiB,CAAC,SAAS,UAAU,WAAW;AAAA,IAChD,SAAS;AAAA,IACT,QAAQ;AAAA,EAAA;AAAA,EAEV,MAAM,MAAMC,GAASC,GAAM;AACzB,UAAMC,IAAWC,EAAe,YAAY,GAAG;AAK/C,IAAAF,EAAK,QAAQ,cAAc,SAASA,EAAK,QAAQ,cAAc,UAAU,CAAA,GACvEA,EAAK,QAAQ,cAAc,OAAe,cAAc;A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;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,eAAWC,KAAaD;AACtB,MAAAE,EAAa;AAAA,QACX,MAAMD;AAAA,QACN,QAAQA;AAAA,QACR,UAAU;AAAA,MAAA,CACX;AAIH,IAAAR,EAAK,KAAK,iBAAiB,CAACU,MAAS;AACnC,MAAAA,EAAK,WAAW,KAAK;AAAA,QACnB,OAAO;AAAA,MAAA,CACR;AAAA,IACH,CAAC;AAAA,EACH;AACF,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("@nuxt/kit");var u=typeof document<"u"?document.currentScript:null;const c=s.defineNuxtModule({meta:{name:"@strands.gg/accui/nuxt-v4",configKey:"strandsAuth",compatibility:{nuxt:"^4.0.0"}},defaults:{baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",redirectUrl:"/",onSignInUrl:"/dashboard",onSignOutUrl:"/",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0},async setup(e,r){const t=s.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:u&&u.tagName.toUpperCase()==="SCRIPT"&&u.src||new URL("nuxt-v4/module.cjs.js",document.baseURI).href);r.options.runtimeConfig.public=r.options.runtimeConfig.public||{};const a={baseUrl:e.baseUrl,clientId:e.clientId,accentColor:e.accentColor,redirectUrl:e.redirectUrl,onSignInUrl:e.onSignInUrl,onSignOutUrl:e.onSignOutUrl,autoRefresh:e.autoRefresh,refreshInterval:e.refreshInterval,protectedRoutes:e.protectedRoutes,guestOnlyRoutes:e.guestOnlyRoutes,devMode:e.devMode,styles:e.styles!==!1,supportEmail:e.supportEmail};r.options.runtimeConfig.public.strandsAuth=a,r.options.appConfig.strandsAuth=a,e.styles!==!1&&r.options.css.push("@strands.gg/accui/style.css");const o=t.resolve("./runtime/plugin.client.es.js"),l=t.resolve("./runtime/plugin.server.es.js"),d=t.resolve("./runtime/middleware/auth.global.es.js");s.addPlugin({src:o,mode:"client"}),s.addPlugin({src:l,mode:"server"}),s.addRouteMiddleware({name:"auth",path:d,global:!0}),s.addImports([{name:"useStrandsAuth",as:"useStrandsAuth",from:t.resolve("./runtime/composables/useStrandsAuth.es.js")},{name:"useAuthUser",as:"useAuthUser",from:t.resolve("./runtime/composables/useStrandsAuth.es.js")},{name:"useAuthState",as:"useAuthState",from:t.resolve("./runtime/composables/useStrandsAuth.es.js")}]);const i=["StrandsAuth","StrandsSignIn","StrandsSignUp","StrandsCompleteSignUp","StrandsUserProfile","StrandsPasswordReset","StrandsMFASetup","StrandsConfigProvider","SignedIn","SignedOut","StrandsLogo","StrandsSecuredFooter"];for(const n of i)s.addComponent({name:n,export:n,filePath:"@strands.gg/accui"});r.hook("prepare:types",n=>{n.references.push({types:"@strands.gg/auth-nuxt-v4"}),n.declarations.push(`
|
|
2
2
|
declare global {
|
|
3
|
-
const useStrandsAuth: typeof import('${t.resolve("./runtime/composables/useStrandsAuth")}')['useStrandsAuth']
|
|
4
|
-
const useAuthUser: typeof import('${t.resolve("./runtime/composables/useStrandsAuth")}')['useAuthUser']
|
|
5
|
-
const useAuthState: typeof import('${t.resolve("./runtime/composables/useStrandsAuth")}')['useAuthState']
|
|
3
|
+
const useStrandsAuth: typeof import('${t.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useStrandsAuth']
|
|
4
|
+
const useAuthUser: typeof import('${t.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthUser']
|
|
5
|
+
const useAuthState: typeof import('${t.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthState']
|
|
6
6
|
}
|
|
7
7
|
`)})}});module.exports=c;
|
|
8
8
|
//# sourceMappingURL=module.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Support email address for contact links\n * @optional\n */\n supportEmail?: string\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt-v4',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^4.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n //
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication (optional - authentication is now based on domain)\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Support email address for contact links\n * @optional\n */\n supportEmail?: string\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt-v4',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^4.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n // Note: clientId is now optional as authentication is based on domain\n\n // Add runtime config with proper typing for Nuxt v4\n nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}\n const runtimeConfig = {\n baseUrl: options.baseUrl,\n clientId: options.clientId,\n accentColor: options.accentColor,\n redirectUrl: options.redirectUrl,\n onSignInUrl: options.onSignInUrl,\n onSignOutUrl: options.onSignOutUrl,\n autoRefresh: options.autoRefresh,\n refreshInterval: options.refreshInterval,\n protectedRoutes: options.protectedRoutes,\n guestOnlyRoutes: options.guestOnlyRoutes,\n devMode: options.devMode,\n styles: options.styles !== false, // Default to true, allow disabling\n supportEmail: options.supportEmail\n }\n ;(nuxt.options.runtimeConfig.public as any).strandsAuth = runtimeConfig\n \n // Also add it to app config for immediate access\n ;(nuxt.options.appConfig as any).strandsAuth = runtimeConfig\n\n // Conditionally add CSS for styling based on autoImportStyles setting\n if (options.styles !== false) {\n nuxt.options.css.push('@strands.gg/accui/style.css')\n }\n\n // Plugin and middleware paths - use built JavaScript files for production compatibility\n const clientPluginPath = resolver.resolve('./runtime/plugin.client.es.js')\n const serverPluginPath = resolver.resolve('./runtime/plugin.server.es.js') \n const middlewarePath = resolver.resolve('./runtime/middleware/auth.global.es.js')\n\n // Add the main plugin with highest priority to ensure config is set early\n addPlugin({\n src: clientPluginPath,\n mode: 'client'\n })\n\n // Add server plugin for SSR support \n addPlugin({\n src: serverPluginPath,\n mode: 'server'\n })\n\n // Add middleware for route protection (updated for Nuxt v4)\n addRouteMiddleware({\n name: 'auth',\n path: middlewarePath,\n global: true\n })\n\n // Auto-import composables - use built JavaScript files for production compatibility\n addImports([\n {\n name: 'useStrandsAuth',\n as: 'useStrandsAuth',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthUser',\n as: 'useAuthUser', \n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthState',\n as: 'useAuthState',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n }\n ])\n\n // Auto-register components from the main bundle export\n const components = [\n 'StrandsAuth',\n 'StrandsSignIn', \n 'StrandsSignUp',\n 'StrandsCompleteSignUp',\n 'StrandsUserProfile',\n 'StrandsPasswordReset',\n 'StrandsMFASetup',\n 'StrandsConfigProvider',\n 'SignedIn',\n 'SignedOut',\n 'StrandsLogo',\n 'StrandsSecuredFooter'\n ]\n\n for (const component of components) {\n addComponent({\n name: component,\n export: component,\n filePath: '@strands.gg/accui'\n })\n }\n\n // Add type declarations (updated for Nuxt v4)\n nuxt.hook('prepare:types', (opts) => {\n opts.references.push({\n types: '@strands.gg/auth-nuxt-v4'\n })\n \n // Add the composables to the auto-imports types\n opts.declarations.push(`\n declare global {\n const useStrandsAuth: typeof import('${resolver.resolve('./runtime/composables/useStrandsAuth.d.ts')}')['useStrandsAuth']\n const useAuthUser: typeof import('${resolver.resolve('./runtime/composables/useStrandsAuth.d.ts')}')['useAuthUser']\n const useAuthState: typeof import('${resolver.resolve('./runtime/composables/useStrandsAuth.d.ts')}')['useAuthState']\n }\n `)\n })\n }\n})\n"],"names":["module$1","defineNuxtModule","options","nuxt","resolver","createResolver","runtimeConfig","clientPluginPath","serverPluginPath","middlewarePath","addPlugin","addRouteMiddleware","addImports","components","component","addComponent","opts"],"mappings":"gGAkFA,MAAAA,EAAeC,mBAAoC,CACjD,KAAM,CACJ,KAAM,4BACN,UAAW,cACX,cAAe,CACb,KAAM,QAAA,CACR,EAEF,SAAU,CACR,QAAS,+BACT,YAAa,UACb,YAAa,IACb,YAAa,aACb,aAAc,IACd,YAAa,GACb,gBAAiB,EACjB,gBAAiB,CAAA,EACjB,gBAAiB,CAAC,QAAS,SAAU,WAAW,EAChD,QAAS,GACT,OAAQ,EAAA,EAEV,MAAM,MAAMC,EAASC,EAAM,CACzB,MAAMC,EAAWC,EAAAA,qLAA8B,EAK/CF,EAAK,QAAQ,cAAc,OAASA,EAAK,QAAQ,cAAc,QAAU,CAAA,EACzE,MAAMG,EAAgB,CACpB,QAASJ,EAAQ,QACjB,SAAUA,EAAQ,SAClB,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8CAChEA,EAAS,QAAQ,2CAA2C,CAAC;AAAA,+CAC5DA,EAAS,QAAQ,2CAA2C,CAAC;AAAA;AAAA,OAErG,CACH,CAAC,CACH,CACF,CAAC"}
|
package/dist/nuxt-v4/module.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;AAED,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;AAED,wBAwIE"}
|
|
@@ -22,7 +22,7 @@ const S = i({
|
|
|
22
22
|
},
|
|
23
23
|
async setup(e, s) {
|
|
24
24
|
const t = c(import.meta.url);
|
|
25
|
-
|
|
25
|
+
s.options.runtimeConfig.public = s.options.runtimeConfig.public || {};
|
|
26
26
|
const n = {
|
|
27
27
|
baseUrl: e.baseUrl,
|
|
28
28
|
clientId: e.clientId,
|
|
@@ -40,7 +40,7 @@ const S = i({
|
|
|
40
40
|
supportEmail: e.supportEmail
|
|
41
41
|
};
|
|
42
42
|
s.options.runtimeConfig.public.strandsAuth = n, s.options.appConfig.strandsAuth = n, e.styles !== !1 && s.options.css.push("@strands.gg/accui/style.css");
|
|
43
|
-
const u = t.resolve("./runtime/plugin.client.
|
|
43
|
+
const u = t.resolve("./runtime/plugin.client.es.js"), o = t.resolve("./runtime/plugin.server.es.js"), l = t.resolve("./runtime/middleware/auth.global.es.js");
|
|
44
44
|
a({
|
|
45
45
|
src: u,
|
|
46
46
|
mode: "client"
|
|
@@ -55,17 +55,17 @@ const S = i({
|
|
|
55
55
|
{
|
|
56
56
|
name: "useStrandsAuth",
|
|
57
57
|
as: "useStrandsAuth",
|
|
58
|
-
from: t.resolve("./runtime/composables/useStrandsAuth")
|
|
58
|
+
from: t.resolve("./runtime/composables/useStrandsAuth.es.js")
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
name: "useAuthUser",
|
|
62
62
|
as: "useAuthUser",
|
|
63
|
-
from: t.resolve("./runtime/composables/useStrandsAuth")
|
|
63
|
+
from: t.resolve("./runtime/composables/useStrandsAuth.es.js")
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
name: "useAuthState",
|
|
67
67
|
as: "useAuthState",
|
|
68
|
-
from: t.resolve("./runtime/composables/useStrandsAuth")
|
|
68
|
+
from: t.resolve("./runtime/composables/useStrandsAuth.es.js")
|
|
69
69
|
}
|
|
70
70
|
]);
|
|
71
71
|
const d = [
|
|
@@ -93,9 +93,9 @@ const S = i({
|
|
|
93
93
|
types: "@strands.gg/auth-nuxt-v4"
|
|
94
94
|
}), r.declarations.push(`
|
|
95
95
|
declare global {
|
|
96
|
-
const useStrandsAuth: typeof import('${t.resolve("./runtime/composables/useStrandsAuth")}')['useStrandsAuth']
|
|
97
|
-
const useAuthUser: typeof import('${t.resolve("./runtime/composables/useStrandsAuth")}')['useAuthUser']
|
|
98
|
-
const useAuthState: typeof import('${t.resolve("./runtime/composables/useStrandsAuth")}')['useAuthState']
|
|
96
|
+
const useStrandsAuth: typeof import('${t.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useStrandsAuth']
|
|
97
|
+
const useAuthUser: typeof import('${t.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthUser']
|
|
98
|
+
const useAuthState: typeof import('${t.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthState']
|
|
99
99
|
}
|
|
100
100
|
`);
|
|
101
101
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.es.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Support email address for contact links\n * @optional\n */\n supportEmail?: string\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt-v4',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^4.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n //
|
|
1
|
+
{"version":3,"file":"module.es.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\nexport interface StrandsAuthConfig {\n /**\n * Base URL for the Strands Auth API\n * @default 'https://your-api.example.com'\n */\n baseUrl?: string\n\n /**\n * Client ID for authentication (optional - authentication is now based on domain)\n */\n clientId?: string\n\n /**\n * Primary accent color for the auth components\n * @default '#EA00A8'\n */\n accentColor?: string\n\n /**\n * Default redirect URL after successful authentication\n * @default '/'\n */\n redirectUrl?: string\n\n /**\n * URL to redirect to after successful sign in\n * @default '/dashboard'\n */\n onSignInUrl?: string\n\n /**\n * URL to redirect to after successful sign out\n * @default '/'\n */\n onSignOutUrl?: string\n\n /**\n * Enable automatic token refresh\n * @default true\n */\n autoRefresh?: boolean\n\n /**\n * Token refresh interval in minutes\n * @default 4\n */\n refreshInterval?: number\n\n /**\n * Pages that should redirect to sign in if user is not authenticated\n * @default []\n */\n protectedRoutes?: string[]\n\n /**\n * Pages that should redirect away if user IS authenticated\n * @default ['/auth', '/login', '/register']\n */\n guestOnlyRoutes?: string[]\n\n /**\n * Enable development mode (shows debug info)\n * @default false\n */\n devMode?: boolean\n\n /**\n * Support email address for contact links\n * @optional\n */\n supportEmail?: string\n\n /**\n * Automatically import CSS styles\n * Set to false if you want to manually import styles or use custom styling\n * @default true\n */\n styles?: boolean\n}\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt-v4',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^4.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n // Note: clientId is now optional as authentication is based on domain\n\n // Add runtime config with proper typing for Nuxt v4\n nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}\n const runtimeConfig = {\n baseUrl: options.baseUrl,\n clientId: options.clientId,\n accentColor: options.accentColor,\n redirectUrl: options.redirectUrl,\n onSignInUrl: options.onSignInUrl,\n onSignOutUrl: options.onSignOutUrl,\n autoRefresh: options.autoRefresh,\n refreshInterval: options.refreshInterval,\n protectedRoutes: options.protectedRoutes,\n guestOnlyRoutes: options.guestOnlyRoutes,\n devMode: options.devMode,\n styles: options.styles !== false, // Default to true, allow disabling\n supportEmail: options.supportEmail\n }\n ;(nuxt.options.runtimeConfig.public as any).strandsAuth = runtimeConfig\n \n // Also add it to app config for immediate access\n ;(nuxt.options.appConfig as any).strandsAuth = runtimeConfig\n\n // Conditionally add CSS for styling based on autoImportStyles setting\n if (options.styles !== false) {\n nuxt.options.css.push('@strands.gg/accui/style.css')\n }\n\n // Plugin and middleware paths - use built JavaScript files for production compatibility\n const clientPluginPath = resolver.resolve('./runtime/plugin.client.es.js')\n const serverPluginPath = resolver.resolve('./runtime/plugin.server.es.js') \n const middlewarePath = resolver.resolve('./runtime/middleware/auth.global.es.js')\n\n // Add the main plugin with highest priority to ensure config is set early\n addPlugin({\n src: clientPluginPath,\n mode: 'client'\n })\n\n // Add server plugin for SSR support \n addPlugin({\n src: serverPluginPath,\n mode: 'server'\n })\n\n // Add middleware for route protection (updated for Nuxt v4)\n addRouteMiddleware({\n name: 'auth',\n path: middlewarePath,\n global: true\n })\n\n // Auto-import composables - use built JavaScript files for production compatibility\n addImports([\n {\n name: 'useStrandsAuth',\n as: 'useStrandsAuth',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthUser',\n as: 'useAuthUser', \n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n },\n {\n name: 'useAuthState',\n as: 'useAuthState',\n from: resolver.resolve('./runtime/composables/useStrandsAuth.es.js')\n }\n ])\n\n // Auto-register components from the main bundle export\n const components = [\n 'StrandsAuth',\n 'StrandsSignIn', \n 'StrandsSignUp',\n 'StrandsCompleteSignUp',\n 'StrandsUserProfile',\n 'StrandsPasswordReset',\n 'StrandsMFASetup',\n 'StrandsConfigProvider',\n 'SignedIn',\n 'SignedOut',\n 'StrandsLogo',\n 'StrandsSecuredFooter'\n ]\n\n for (const component of components) {\n addComponent({\n name: component,\n export: component,\n filePath: '@strands.gg/accui'\n })\n }\n\n // Add type declarations (updated for Nuxt v4)\n nuxt.hook('prepare:types', (opts) => {\n opts.references.push({\n types: '@strands.gg/auth-nuxt-v4'\n })\n \n // Add the composables to the auto-imports types\n opts.declarations.push(`\n declare global {\n const useStrandsAuth: typeof import('${resolver.resolve('./runtime/composables/useStrandsAuth.d.ts')}')['useStrandsAuth']\n const useAuthUser: typeof import('${resolver.resolve('./runtime/composables/useStrandsAuth.d.ts')}')['useAuthUser']\n const useAuthState: typeof import('${resolver.resolve('./runtime/composables/useStrandsAuth.d.ts')}')['useAuthState']\n }\n `)\n })\n }\n})\n"],"names":["module","defineNuxtModule","options","nuxt","resolver","createResolver","runtimeConfig","clientPluginPath","serverPluginPath","middlewarePath","addPlugin","addRouteMiddleware","addImports","components","component","addComponent","opts"],"mappings":";AAkFA,MAAAA,IAAeC,EAAoC;AAAA,EACjD,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,eAAe;AAAA,MACb,MAAM;AAAA,IAAA;AAAA,EACR;AAAA,EAEF,UAAU;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,iBAAiB,CAAA;AAAA,IACjB,iBAAiB,CAAC,SAAS,UAAU,WAAW;AAAA,IAChD,SAAS;AAAA,IACT,QAAQ;AAAA,EAAA;AAAA,EAEV,MAAM,MAAMC,GAASC,GAAM;AACzB,UAAMC,IAAWC,EAAe,YAAY,GA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