@ansiversa/components 0.0.14 → 0.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ansiversa/components",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Shared UI components and layouts for the Ansiversa ecosystem",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,6 +25,12 @@ const classes = ["av-navbar-actions"];
25
25
  if (className) classes.push(className);
26
26
  const classAttr = classes.join(" ");
27
27
 
28
+ const rawDomain = (import.meta.env.ANSIVERSA_COOKIE_DOMAIN || "ansiversa.com").trim();
29
+ const normalizedDomain = rawDomain.replace(/^(https?:\/\/)/i, "").replace(/\/+$/, "");
30
+ const ROOT_URL = rawDomain.startsWith("http")
31
+ ? rawDomain.replace(/\/+$/, "")
32
+ : `https://${normalizedDomain}`;
33
+
28
34
  const iconMap: Record<string, string> = {
29
35
  Apps: `
30
36
  <svg class="av-icon" viewBox='0 0 24 24'>
@@ -60,15 +66,15 @@ function renderIcon(label: string) {
60
66
 
61
67
  // ALWAYS SHOW THESE LINKS
62
68
  const baseLinks: NavLink[] = [
63
- { label: "Apps", href: "https://www.ansiversa.com/apps" },
64
- { label: "Pricing", href: "https://www.ansiversa.com/pricing" },
65
- { label: "About", href: "https://www.ansiversa.com/about" },
69
+ { label: "Apps", href: `${ROOT_URL}/apps` },
70
+ { label: "Pricing", href: `${ROOT_URL}/pricing` },
71
+ { label: "About", href: `${ROOT_URL}/about` },
66
72
  ];
67
73
 
68
74
  // SIGN-IN link only for guests
69
75
  const authLink: NavLink = {
70
76
  label: "Sign in",
71
- href: "https://www.ansiversa.com/login",
77
+ href: `${ROOT_URL}/login`,
72
78
  variant: "primary",
73
79
  };
74
80
 
@@ -125,23 +131,23 @@ const userInitial =
125
131
  <div class="av-user-menu-divider"></div>
126
132
 
127
133
  <div class="av-nav-user-menu">
128
- <a href="https://www.ansiversa.com/dashboard" class="av-user-menu-item av-dropdown-item" role="menuitem">
134
+ <a href={`${ROOT_URL}/dashboard`} class="av-user-menu-item av-dropdown-item" role="menuitem">
129
135
  <span>Dashboard</span>
130
136
  </a>
131
137
 
132
138
  <a
133
- href="https://www.ansiversa.com/change-password"
139
+ href={`${ROOT_URL}/change-password`}
134
140
  class="av-user-menu-item av-dropdown-item"
135
141
  role="menuitem"
136
142
  >
137
143
  <span>Change password</span>
138
144
  </a>
139
145
 
140
- <a href="https://www.ansiversa.com/settings" class="av-user-menu-item av-dropdown-item" role="menuitem">
146
+ <a href={`${ROOT_URL}/settings`} class="av-user-menu-item av-dropdown-item" role="menuitem">
141
147
  <span>Settings</span>
142
148
  </a>
143
149
 
144
- <form method="POST" action="https://www.ansiversa.com/signout">
150
+ {/* <form method="POST" action="https://www.ansiversa.com/signout">
145
151
  <button
146
152
  type="submit"
147
153
  class="av-user-menu-item av-dropdown-item av-user-menu-item--danger"
@@ -149,7 +155,14 @@ const userInitial =
149
155
  >
150
156
  <span>Sign out</span>
151
157
  </button>
152
- </form>
158
+ </form> */}
159
+ <a
160
+ href={`${ROOT_URL}/signout`}
161
+ class="av-user-menu-item av-dropdown-item av-user-menu-item--danger"
162
+ role="menuitem"
163
+ >
164
+ <span>Sign out</span>
165
+ </a>
153
166
  </div>
154
167
  </div>
155
168
  </div>
@@ -8,6 +8,12 @@ const {
8
8
  title = "Ansiversa",
9
9
  description = "Ansiversa – A unified ecosystem of premium Apps designed to feel simple, powerful, and delightful.",
10
10
  } = Astro.props;
11
+
12
+ const rawDomain = (import.meta.env.ANSIVERSA_COOKIE_DOMAIN || "ansiversa.com").trim();
13
+ const normalizedDomain = rawDomain.replace(/^(https?:\/\/)/i, "").replace(/\/+$/, "");
14
+ const ROOT_URL = rawDomain.startsWith("http")
15
+ ? rawDomain.replace(/\/+$/, "")
16
+ : `https://${normalizedDomain}`;
11
17
  ---
12
18
 
13
19
 
@@ -32,7 +38,7 @@ const {
32
38
  <meta property="og:title" content={title} />
33
39
  <meta property="og:description" content={description} />
34
40
  <meta property="og:site_name" content="Ansiversa" />
35
- <meta property="og:url" content="https://ansiversa.com" />
41
+ <meta property="og:url" content={ROOT_URL} />
36
42
 
37
43
  <!-- Twitter -->
38
44
  <meta name="twitter:card" content="summary_large_image" />
@@ -15,6 +15,12 @@ const {
15
15
  } = Astro.props;
16
16
 
17
17
  const user = Astro.locals.user;
18
+
19
+ const rawDomain = (import.meta.env.ANSIVERSA_COOKIE_DOMAIN || "ansiversa.com").trim();
20
+ const normalizedDomain = rawDomain.replace(/^(https?:\/\/)/i, "").replace(/\/+$/, "");
21
+ const ROOT_URL = rawDomain.startsWith("http")
22
+ ? rawDomain.replace(/\/+$/, "")
23
+ : `https://${normalizedDomain}`;
18
24
  ---
19
25
 
20
26
 
@@ -40,7 +46,7 @@ const user = Astro.locals.user;
40
46
  <meta property="og:title" content={title} />
41
47
  <meta property="og:description" content={description} />
42
48
  <meta property="og:site_name" content="Ansiversa" />
43
- <meta property="og:url" content="https://ansiversa.com" />
49
+ <meta property="og:url" content={ROOT_URL} />
44
50
 
45
51
  <!-- Twitter -->
46
52
  <meta name="twitter:card" content="summary_large_image" />