@strands.gg/accui 2.2.2 → 2.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/accui.css +1 -1
- package/dist/nuxt/module.cjs.js +1 -1
- package/dist/nuxt/module.es.js +14 -30
- package/dist/nuxt/runtime/plugin.client.es.js +1 -1
- package/dist/nuxt/runtime/plugin.server.es.js +1 -1
- package/dist/nuxt-v4/module.cjs.js +1 -1
- package/dist/nuxt-v4/module.es.js +13 -29
- package/dist/nuxt-v4/runtime/plugin.client.es.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.es.js +1 -1
- package/dist/strands-auth-ui.cjs.js +1 -1
- package/dist/strands-auth-ui.es.js +290 -333
- package/package.json +1 -1
package/dist/nuxt/module.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@nuxt/kit");var
|
|
1
|
+
"use strict";const t=require("@nuxt/kit");var s="undefined"!=typeof document?document.currentScript:null;const e=t.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:1,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:0,styles:1,supportEmail:"",oauth2RedirectUrl:""},async setup(e,n){const r=t.createResolver("undefined"==typeof document?require("url").pathToFileURL(__filename).href:s&&"SCRIPT"===s.tagName.toUpperCase()&&s.src||new URL("nuxt/module.cjs.js",document.baseURI).href);if(n.options.runtimeConfig.public=n.options.runtimeConfig.public||{},n.options.runtimeConfig.public.strandsAuth={...e,styles:0!=e.styles},0!=e.styles&&n.options.css.push("@strands.gg/accui/style.css"),e.accentColor&&"#EA00A8"!==e.accentColor){const t=e.accentColor,s=`\n :root {\n --strands-custom-accent: ${t};\n --strands-custom-50: color-mix(in srgb, ${t} 10%, white);\n --strands-custom-100: color-mix(in srgb, ${t} 20%, white);\n --strands-custom-200: color-mix(in srgb, ${t} 30%, white);\n --strands-custom-300: color-mix(in srgb, ${t} 40%, white);\n --strands-custom-400: color-mix(in srgb, ${t} 70%, white);\n --strands-custom-500: ${t};\n --strands-custom-600: color-mix(in srgb, ${t} 85%, black);\n --strands-custom-700: color-mix(in srgb, ${t} 70%, black);\n --strands-custom-800: color-mix(in srgb, ${t} 55%, black);\n --strands-custom-900: color-mix(in srgb, ${t} 40%, black);\n --strands-custom-950: color-mix(in srgb, ${t} 25%, black);\n }\n `;n.options.app.head=n.options.app.head||{},n.options.app.head.style=n.options.app.head.style||[],n.options.app.head.style.unshift({innerHTML:s,key:"strands-accent-override"})}const a="es.js";t.addPlugin({src:r.resolve(`./runtime/plugin.client.${a}`),mode:"client"}),t.addPlugin({src:r.resolve(`./runtime/plugin.server.${a}`),mode:"server"}),t.addPlugin({src:r.resolve(`./runtime/plugins/auth-interceptor.client.${a}`),mode:"client"}),t.addRouteMiddleware({name:"auth",path:r.resolve(`./runtime/middleware/auth.global.${a}`),global:1}),n.hook("pages:extend",()=>{}),t.addImports([{name:"useStrandsAuth",as:"useStrandsAuth",from:r.resolve(`./runtime/composables/useStrandsAuth.${a}`)},{name:"useAuthUser",as:"useAuthUser",from:r.resolve(`./runtime/composables/useStrandsAuth.${a}`)},{name:"useAuthState",as:"useAuthState",from:r.resolve(`./runtime/composables/useStrandsAuth.${a}`)},{name:"useAuthenticatedFetch",as:"useAuthenticatedFetch",from:r.resolve(`./runtime/composables/useAuthenticatedFetch.${a}`)}]);const o=["StrandsAuth","StrandsSignIn","StrandsSignUp","StrandsCompleteSignUp","StrandsUserProfile","StrandsUserButton","StrandsPasswordReset","StrandsMFASetup","StrandsConfigProvider","SignedIn","SignedOut","StrandsLogo","StrandsSecuredFooter","StrandsUiAlert","StrandsUiButton","StrandsUiCard","StrandsUiInput","StrandsUiLink","StrandsUiTabs","StrandsUiLoader"];for(const s of o)t.addComponent({name:s,export:s,filePath:"@strands.gg/accui"});n.hook("prepare:types",t=>{t.references.push({types:"@strands.gg/auth-nuxt"})})}});module.exports=e;
|
package/dist/nuxt/module.es.js
CHANGED
|
@@ -37,40 +37,24 @@ const module = defineNuxtModule({
|
|
|
37
37
|
const accentColor = options.accentColor;
|
|
38
38
|
const cssVariables = `
|
|
39
39
|
:root {
|
|
40
|
-
--strands-accent: ${accentColor}
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
--
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--accui-strands-950: color-mix(in srgb, ${accentColor} 25%, black) !important;
|
|
53
|
-
}
|
|
54
|
-
[data-theme="dark"] {
|
|
55
|
-
--accui-strands-accent: ${accentColor} !important;
|
|
56
|
-
--accui-strands-50: color-mix(in srgb, ${accentColor} 10%, white) !important;
|
|
57
|
-
--accui-strands-100: color-mix(in srgb, ${accentColor} 20%, white) !important;
|
|
58
|
-
--accui-strands-200: color-mix(in srgb, ${accentColor} 30%, white) !important;
|
|
59
|
-
--accui-strands-300: color-mix(in srgb, ${accentColor} 40%, white) !important;
|
|
60
|
-
--accui-strands-400: color-mix(in srgb, ${accentColor} 70%, white) !important;
|
|
61
|
-
--accui-strands-500: ${accentColor} !important;
|
|
62
|
-
--accui-strands-600: color-mix(in srgb, ${accentColor} 85%, black) !important;
|
|
63
|
-
--accui-strands-700: color-mix(in srgb, ${accentColor} 70%, black) !important;
|
|
64
|
-
--accui-strands-800: color-mix(in srgb, ${accentColor} 55%, black) !important;
|
|
65
|
-
--accui-strands-900: color-mix(in srgb, ${accentColor} 40%, black) !important;
|
|
66
|
-
--accui-strands-950: color-mix(in srgb, ${accentColor} 25%, black) !important;
|
|
40
|
+
--strands-custom-accent: ${accentColor};
|
|
41
|
+
--strands-custom-50: color-mix(in srgb, ${accentColor} 10%, white);
|
|
42
|
+
--strands-custom-100: color-mix(in srgb, ${accentColor} 20%, white);
|
|
43
|
+
--strands-custom-200: color-mix(in srgb, ${accentColor} 30%, white);
|
|
44
|
+
--strands-custom-300: color-mix(in srgb, ${accentColor} 40%, white);
|
|
45
|
+
--strands-custom-400: color-mix(in srgb, ${accentColor} 70%, white);
|
|
46
|
+
--strands-custom-500: ${accentColor};
|
|
47
|
+
--strands-custom-600: color-mix(in srgb, ${accentColor} 85%, black);
|
|
48
|
+
--strands-custom-700: color-mix(in srgb, ${accentColor} 70%, black);
|
|
49
|
+
--strands-custom-800: color-mix(in srgb, ${accentColor} 55%, black);
|
|
50
|
+
--strands-custom-900: color-mix(in srgb, ${accentColor} 40%, black);
|
|
51
|
+
--strands-custom-950: color-mix(in srgb, ${accentColor} 25%, black);
|
|
67
52
|
}
|
|
68
53
|
`;
|
|
69
54
|
nuxt.options.app.head = nuxt.options.app.head || {};
|
|
70
55
|
nuxt.options.app.head.style = nuxt.options.app.head.style || [];
|
|
71
56
|
nuxt.options.app.head.style.unshift({
|
|
72
|
-
|
|
73
|
-
type: "text/css",
|
|
57
|
+
innerHTML: cssVariables,
|
|
74
58
|
key: "strands-accent-override"
|
|
75
59
|
});
|
|
76
60
|
}
|
|
@@ -92,7 +76,7 @@ const module = defineNuxtModule({
|
|
|
92
76
|
path: resolver.resolve(`./runtime/middleware/auth.global.${ext}`),
|
|
93
77
|
global: true
|
|
94
78
|
});
|
|
95
|
-
nuxt.hook("pages:extend", (
|
|
79
|
+
nuxt.hook("pages:extend", () => {
|
|
96
80
|
});
|
|
97
81
|
addImports([
|
|
98
82
|
{
|
|
@@ -4,7 +4,7 @@ const plugin_client = defineNuxtPlugin({
|
|
|
4
4
|
name: "strands-auth-client",
|
|
5
5
|
async setup() {
|
|
6
6
|
const config = useRuntimeConfig();
|
|
7
|
-
const strandsConfig = config.public
|
|
7
|
+
const strandsConfig = config.public["strandsAuth"];
|
|
8
8
|
const mergedConfig = {
|
|
9
9
|
...STRANDS_AUTH_DEFAULTS,
|
|
10
10
|
...strandsConfig
|
|
@@ -4,7 +4,7 @@ const plugin_server = defineNuxtPlugin({
|
|
|
4
4
|
name: "strands-auth-server",
|
|
5
5
|
setup() {
|
|
6
6
|
const config = useRuntimeConfig();
|
|
7
|
-
const strandsConfig = config.public
|
|
7
|
+
const strandsConfig = config.public["strandsAuth"];
|
|
8
8
|
const mergedConfig = {
|
|
9
9
|
...STRANDS_AUTH_DEFAULTS,
|
|
10
10
|
...strandsConfig
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@nuxt/kit");var
|
|
1
|
+
"use strict";const t=require("@nuxt/kit");var s="undefined"!=typeof document?document.currentScript:null;const e=t.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:1,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:0,styles:1,supportEmail:"",oauth2RedirectUrl:""},async setup(e,n){const r=t.createResolver("undefined"==typeof document?require("url").pathToFileURL(__filename).href:s&&"SCRIPT"===s.tagName.toUpperCase()&&s.src||new URL("nuxt-v4/module.cjs.js",document.baseURI).href);n.options.runtimeConfig.public=n.options.runtimeConfig.public||{};const o={...e,styles:0!=e.styles};if(n.options.runtimeConfig.public.strandsAuth=o,n.options.appConfig.strandsAuth=o,0!=e.styles&&n.options.css.push("@strands.gg/accui/style.css"),e.accentColor&&"#EA00A8"!==e.accentColor){const t=e.accentColor,s=`\n :root {\n --strands-custom-accent: ${t};\n --strands-custom-50: color-mix(in srgb, ${t} 10%, white);\n --strands-custom-100: color-mix(in srgb, ${t} 20%, white);\n --strands-custom-200: color-mix(in srgb, ${t} 30%, white);\n --strands-custom-300: color-mix(in srgb, ${t} 40%, white);\n --strands-custom-400: color-mix(in srgb, ${t} 70%, white);\n --strands-custom-500: ${t};\n --strands-custom-600: color-mix(in srgb, ${t} 85%, black);\n --strands-custom-700: color-mix(in srgb, ${t} 70%, black);\n --strands-custom-800: color-mix(in srgb, ${t} 55%, black);\n --strands-custom-900: color-mix(in srgb, ${t} 40%, black);\n --strands-custom-950: color-mix(in srgb, ${t} 25%, black);\n }\n `;n.options.app.head=n.options.app.head||{},n.options.app.head.style=n.options.app.head.style||[],n.options.app.head.style.unshift({innerHTML:s,key:"strands-accent-override"})}const a="es.js",u=r.resolve(`./runtime/plugin.client.${a}`),i=r.resolve(`./runtime/plugin.server.${a}`),c=r.resolve(`./runtime/middleware/auth.global.${a}`);t.addPlugin({src:u,mode:"client"}),t.addPlugin({src:i,mode:"server"}),t.addPlugin({src:r.resolve(`./runtime/plugins/auth-interceptor.client.${a}`),mode:"client"}),t.addRouteMiddleware({name:"auth",path:c,global:1}),t.addImports([{name:"useStrandsAuth",as:"useStrandsAuth",from:r.resolve(`./runtime/composables/useStrandsAuth.${a}`)},{name:"useAuthUser",as:"useAuthUser",from:r.resolve(`./runtime/composables/useStrandsAuth.${a}`)},{name:"useAuthState",as:"useAuthState",from:r.resolve(`./runtime/composables/useStrandsAuth.${a}`)},{name:"useAuthenticatedFetch",as:"useAuthenticatedFetch",from:r.resolve(`./runtime/composables/useAuthenticatedFetch.${a}`)}]);const d=["StrandsAuth","StrandsSignIn","StrandsSignUp","StrandsCompleteSignUp","StrandsUserProfile","StrandsUserButton","StrandsPasswordReset","StrandsMFASetup","StrandsConfigProvider","SignedIn","SignedOut","StrandsLogo","StrandsSecuredFooter","StrandsUiAlert","StrandsUiButton","StrandsUiCard","StrandsUiInput","StrandsUiLink","StrandsUiTabs","StrandsUiLoader"];for(const s of d)t.addComponent({name:s,export:s,filePath:"@strands.gg/accui"});n.hook("prepare:types",t=>{t.references.push({types:"@strands.gg/auth-nuxt-v4"}),t.declarations.push(`\n declare global {\n const useStrandsAuth: typeof import('${r.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useStrandsAuth']\n const useAuthUser: typeof import('${r.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthUser']\n const useAuthState: typeof import('${r.resolve("./runtime/composables/useStrandsAuth.d.ts")}')['useAuthState']\n }\n `)})}});module.exports=e;
|
|
@@ -39,40 +39,24 @@ const module = defineNuxtModule({
|
|
|
39
39
|
const accentColor = options.accentColor;
|
|
40
40
|
const cssVariables = `
|
|
41
41
|
:root {
|
|
42
|
-
--strands-accent: ${accentColor}
|
|
43
|
-
--
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
--
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--
|
|
53
|
-
--
|
|
54
|
-
--accui-strands-950: color-mix(in srgb, ${accentColor} 25%, black) !important;
|
|
55
|
-
}
|
|
56
|
-
[data-theme="dark"] {
|
|
57
|
-
--accui-strands-accent: ${accentColor} !important;
|
|
58
|
-
--accui-strands-50: color-mix(in srgb, ${accentColor} 10%, white) !important;
|
|
59
|
-
--accui-strands-100: color-mix(in srgb, ${accentColor} 20%, white) !important;
|
|
60
|
-
--accui-strands-200: color-mix(in srgb, ${accentColor} 30%, white) !important;
|
|
61
|
-
--accui-strands-300: color-mix(in srgb, ${accentColor} 40%, white) !important;
|
|
62
|
-
--accui-strands-400: color-mix(in srgb, ${accentColor} 70%, white) !important;
|
|
63
|
-
--accui-strands-500: ${accentColor} !important;
|
|
64
|
-
--accui-strands-600: color-mix(in srgb, ${accentColor} 85%, black) !important;
|
|
65
|
-
--accui-strands-700: color-mix(in srgb, ${accentColor} 70%, black) !important;
|
|
66
|
-
--accui-strands-800: color-mix(in srgb, ${accentColor} 55%, black) !important;
|
|
67
|
-
--accui-strands-900: color-mix(in srgb, ${accentColor} 40%, black) !important;
|
|
68
|
-
--accui-strands-950: color-mix(in srgb, ${accentColor} 25%, black) !important;
|
|
42
|
+
--strands-custom-accent: ${accentColor};
|
|
43
|
+
--strands-custom-50: color-mix(in srgb, ${accentColor} 10%, white);
|
|
44
|
+
--strands-custom-100: color-mix(in srgb, ${accentColor} 20%, white);
|
|
45
|
+
--strands-custom-200: color-mix(in srgb, ${accentColor} 30%, white);
|
|
46
|
+
--strands-custom-300: color-mix(in srgb, ${accentColor} 40%, white);
|
|
47
|
+
--strands-custom-400: color-mix(in srgb, ${accentColor} 70%, white);
|
|
48
|
+
--strands-custom-500: ${accentColor};
|
|
49
|
+
--strands-custom-600: color-mix(in srgb, ${accentColor} 85%, black);
|
|
50
|
+
--strands-custom-700: color-mix(in srgb, ${accentColor} 70%, black);
|
|
51
|
+
--strands-custom-800: color-mix(in srgb, ${accentColor} 55%, black);
|
|
52
|
+
--strands-custom-900: color-mix(in srgb, ${accentColor} 40%, black);
|
|
53
|
+
--strands-custom-950: color-mix(in srgb, ${accentColor} 25%, black);
|
|
69
54
|
}
|
|
70
55
|
`;
|
|
71
56
|
nuxt.options.app.head = nuxt.options.app.head || {};
|
|
72
57
|
nuxt.options.app.head.style = nuxt.options.app.head.style || [];
|
|
73
58
|
nuxt.options.app.head.style.unshift({
|
|
74
|
-
|
|
75
|
-
type: "text/css",
|
|
59
|
+
innerHTML: cssVariables,
|
|
76
60
|
key: "strands-accent-override"
|
|
77
61
|
});
|
|
78
62
|
}
|
|
@@ -4,7 +4,7 @@ const plugin_client = defineNuxtPlugin({
|
|
|
4
4
|
name: "strands-auth-client-v4",
|
|
5
5
|
async setup() {
|
|
6
6
|
const config = useRuntimeConfig();
|
|
7
|
-
const strandsConfig = config.public
|
|
7
|
+
const strandsConfig = config.public["strandsAuth"];
|
|
8
8
|
const mergedConfig = {
|
|
9
9
|
...STRANDS_AUTH_DEFAULTS,
|
|
10
10
|
...strandsConfig
|
|
@@ -5,7 +5,7 @@ const plugin_server = defineNuxtPlugin({
|
|
|
5
5
|
setup() {
|
|
6
6
|
try {
|
|
7
7
|
const config = useRuntimeConfig();
|
|
8
|
-
const strandsConfig = config.public?.strandsAuth;
|
|
8
|
+
const strandsConfig = config.public?.["strandsAuth"];
|
|
9
9
|
const mergedConfig = {
|
|
10
10
|
...STRANDS_AUTH_DEFAULTS,
|
|
11
11
|
...strandsConfig || {}
|