@pablo2410/shared-ui 0.29.0 → 0.29.1

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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  OpiTourHost,
3
3
  TakeTheTourButton
4
- } from "./chunk-BG4DVZAY.js";
4
+ } from "./chunk-L54JNSVS.js";
5
5
  import {
6
6
  platformUrl,
7
7
  portalUrl
8
- } from "./chunk-7LI4Y6WT.js";
8
+ } from "./chunk-IK3B4YWQ.js";
9
9
  import {
10
10
  readActiveEnterpriseCookie
11
11
  } from "./chunk-5YS2PQN3.js";
@@ -1257,4 +1257,4 @@ export {
1257
1257
  policyDeploymentConfig,
1258
1258
  SERVICE_CONFIGS
1259
1259
  };
1260
- //# sourceMappingURL=chunk-ZVAS2BMF.js.map
1260
+ //# sourceMappingURL=chunk-32NHRLWI.js.map
@@ -9,6 +9,13 @@ var SANDBOX_LOCALHOST_PORTS = {
9
9
  businesshub: 3004,
10
10
  connect: 3005,
11
11
  "policy-deployment": 3006,
12
+ // Policy Deployment's actual subdomainLabel (catalog.ts) and the label
13
+ // SharedFooter.tsx calls platformUrl() with are both "policy", not
14
+ // "policy-deployment" - that mismatch left those two callers falling
15
+ // through to production on localhost (#128). Same port as the
16
+ // "policy-deployment" key above; kept both since nothing calls
17
+ // platformUrl() with "policy-deployment" to make that key worth removing.
18
+ policy: 3006,
12
19
  "marketing-site": 3007
13
20
  };
14
21
  function getPlatformDomain() {
@@ -44,4 +51,4 @@ export {
44
51
  platformUrl,
45
52
  portalUrl
46
53
  };
47
- //# sourceMappingURL=chunk-7LI4Y6WT.js.map
54
+ //# sourceMappingURL=chunk-IK3B4YWQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/platformDomain.ts"],"sourcesContent":["/**\n * Platform domain resolution — single source of truth for building\n * cross-service URLs (Service Hub cards, sidebar cross-nav, footers,\n * \"Back to Portal\" links).\n *\n * Every service runs on a sibling subdomain of one parent domain\n * (portal.oplyticsdigital.net, sqdcp.oplyticsdigital.net, …), so the parent\n * domain is derived at runtime from the current hostname: strip the service\n * label, keep the rest. Links therefore stay on whichever domain the app is\n * served from — no per-app build args, and a future domain move needs no\n * code change here.\n *\n * Outside a browser (SSR, tests) or on hosts with no parent domain\n * (raw IPs) the canonical production domain is used.\n *\n * The local MacBook sandbox (docker-compose.sandbox.yml) is a special case:\n * every app is served from bare `localhost` on a fixed port per service,\n * not from sibling subdomains — so there is no domain to derive from the\n * hostname the way there is for sandbox-*.oplyticsdigital.net (the tunnel\n * variant) or real subdomains. Without this map, any cross-service link\n * built from `localhost` silently fell back to production (see incident:\n * Business Hub's sidebar link sent an authenticated sandbox user to\n * businesshub.oplyticsdigital.net instead of localhost:3004). This list\n * must be kept in sync with the port assignments in each sandbox compose\n * file — there is currently no single generated source for both.\n */\n\nexport const DEFAULT_PLATFORM_DOMAIN = \"oplyticsdigital.net\";\n\nconst IPV4 = /^\\d{1,3}(\\.\\d{1,3}){3}$/;\n\n/**\n * Fixed local-sandbox port per service subdomain label. Keys match the\n * actual subdomain label / sandbox compose service name each app uses to\n * call platformUrl(...) (e.g. \"oeemanager\", not the hyphenated\n * \"/oee-manager\" Infisical secrets folder — those two naming schemes are\n * already inconsistent elsewhere in this codebase; don't propagate that\n * inconsistency here).\n */\nexport const SANDBOX_LOCALHOST_PORTS: Record<string, number> = {\n portal: 3000,\n sqdcp: 3001,\n oeemanager: 3002,\n actionmanager: 3003,\n businesshub: 3004,\n connect: 3005,\n \"policy-deployment\": 3006,\n // Policy Deployment's actual subdomainLabel (catalog.ts) and the label\n // SharedFooter.tsx calls platformUrl() with are both \"policy\", not\n // \"policy-deployment\" - that mismatch left those two callers falling\n // through to production on localhost (#128). Same port as the\n // \"policy-deployment\" key above; kept both since nothing calls\n // platformUrl() with \"policy-deployment\" to make that key worth removing.\n policy: 3006,\n \"marketing-site\": 3007,\n};\n\nexport function getPlatformDomain(): string {\n if (typeof window === \"undefined\") return DEFAULT_PLATFORM_DOMAIN;\n const host = window.location.hostname;\n if (!host || IPV4.test(host)) {\n return DEFAULT_PLATFORM_DOMAIN;\n }\n if (host === \"localhost\") {\n // Handled by platformUrl's port-map branch below — a bare domain has no\n // meaning on localhost, since every sandbox service shares the same\n // host and differs only by port. Falling back to the production domain\n // here would be wrong for any localhost caller, so this path should\n // only be reached by code that doesn't also need a port (rare); return\n // the production domain as the least-surprising default for that case.\n return DEFAULT_PLATFORM_DOMAIN;\n }\n const parts = host.split(\".\");\n // sqdcp.oplyticsdigital.net → oplyticsdigital.net\n if (parts.length >= 3) return parts.slice(1).join(\".\");\n // already on the apex (oplyticsdigital.net)\n if (parts.length === 2) return host;\n return DEFAULT_PLATFORM_DOMAIN;\n}\n\n/**\n * Absolute URL for a service subdomain label on the current platform\n * domain, e.g. `platformUrl(\"sqdcp\")` → `https://sqdcp.oplyticsdigital.net`.\n *\n * On the local sandbox (hostname === \"localhost\"), resolves instead to\n * `http://localhost:<port>` using SANDBOX_LOCALHOST_PORTS, so cross-service\n * links (e.g. Portal's sidebar → Business Hub) stay local instead of\n * silently jumping to production.\n */\nexport function platformUrl(subdomainLabel: string, path = \"\"): string {\n if (\n typeof window !== \"undefined\" &&\n window.location.hostname === \"localhost\"\n ) {\n const port = SANDBOX_LOCALHOST_PORTS[subdomainLabel];\n if (port !== undefined) {\n return `http://localhost:${port}${path}`;\n }\n // Unknown label on localhost — no safe local target exists, so fall\n // through to the production URL rather than guessing a port. Better to\n // land on a working page and be visibly wrong (prod) than a broken one.\n }\n return `https://${subdomainLabel}.${getPlatformDomain()}${path}`;\n}\n\n/** Portal URL builder — the portal always lives at the `portal` label. */\nexport function portalUrl(path = \"\"): string {\n return platformUrl(\"portal\", path);\n}\n"],"mappings":";AA2BO,IAAM,0BAA0B;AAEvC,IAAM,OAAO;AAUN,IAAM,0BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,SAAS;AAAA,EACT,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrB,QAAQ;AAAA,EACR,kBAAkB;AACpB;AAEO,SAAS,oBAA4B;AAC1C,MAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAM,OAAO,OAAO,SAAS;AAC7B,MAAI,CAAC,QAAQ,KAAK,KAAK,IAAI,GAAG;AAC5B,WAAO;AAAA,EACT;AACA,MAAI,SAAS,aAAa;AAOxB,WAAO;AAAA,EACT;AACA,QAAM,QAAQ,KAAK,MAAM,GAAG;AAE5B,MAAI,MAAM,UAAU,EAAG,QAAO,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG;AAErD,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SAAO;AACT;AAWO,SAAS,YAAY,gBAAwB,OAAO,IAAY;AACrE,MACE,OAAO,WAAW,eAClB,OAAO,SAAS,aAAa,aAC7B;AACA,UAAM,OAAO,wBAAwB,cAAc;AACnD,QAAI,SAAS,QAAW;AACtB,aAAO,oBAAoB,IAAI,GAAG,IAAI;AAAA,IACxC;AAAA,EAIF;AACA,SAAO,WAAW,cAAc,IAAI,kBAAkB,CAAC,GAAG,IAAI;AAChE;AAGO,SAAS,UAAU,OAAO,IAAY;AAC3C,SAAO,YAAY,UAAU,IAAI;AACnC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  portalUrl
3
- } from "./chunk-7LI4Y6WT.js";
3
+ } from "./chunk-IK3B4YWQ.js";
4
4
  import {
5
5
  cn
6
6
  } from "./chunk-JT3XLKKD.js";
@@ -1308,4 +1308,4 @@ export {
1308
1308
  useTour,
1309
1309
  OpiTourHost
1310
1310
  };
1311
- //# sourceMappingURL=chunk-BG4DVZAY.js.map
1311
+ //# sourceMappingURL=chunk-L54JNSVS.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  platformUrl
3
- } from "./chunk-7LI4Y6WT.js";
3
+ } from "./chunk-IK3B4YWQ.js";
4
4
  import {
5
5
  appendSelectionParam
6
6
  } from "./chunk-DMUQ5WNO.js";
@@ -174,4 +174,4 @@ export {
174
174
  normalizeServiceSlug,
175
175
  buildCrossServiceLinks
176
176
  };
177
- //# sourceMappingURL=chunk-45ZQDLPA.js.map
177
+ //# sourceMappingURL=chunk-NRA42OCM.js.map
@@ -19,9 +19,9 @@ import {
19
19
  policyDeploymentConfig,
20
20
  sqdcpConfig,
21
21
  useSidebarResize
22
- } from "../chunk-ZVAS2BMF.js";
23
- import "../chunk-BG4DVZAY.js";
24
- import "../chunk-7LI4Y6WT.js";
22
+ } from "../chunk-32NHRLWI.js";
23
+ import "../chunk-L54JNSVS.js";
24
+ import "../chunk-IK3B4YWQ.js";
25
25
  import "../chunk-5YS2PQN3.js";
26
26
  import "../chunk-DMUQ5WNO.js";
27
27
  import "../chunk-A6UTXAPS.js";
@@ -10,13 +10,13 @@ import {
10
10
  liveServices,
11
11
  normalizeServiceSlug,
12
12
  onboardingTourServices
13
- } from "../chunk-45ZQDLPA.js";
13
+ } from "../chunk-NRA42OCM.js";
14
14
  import {
15
15
  DEFAULT_PLATFORM_DOMAIN,
16
16
  getPlatformDomain,
17
17
  platformUrl,
18
18
  portalUrl
19
- } from "../chunk-7LI4Y6WT.js";
19
+ } from "../chunk-IK3B4YWQ.js";
20
20
  import "../chunk-DMUQ5WNO.js";
21
21
  import "../chunk-HLMIR5UV.js";
22
22
  export {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  buildCrossServiceLinks
3
- } from "../chunk-45ZQDLPA.js";
3
+ } from "../chunk-NRA42OCM.js";
4
4
  import {
5
5
  CrossServiceNav,
6
6
  DashboardLayout,
7
7
  HealthFooter
8
- } from "../chunk-ZVAS2BMF.js";
9
- import "../chunk-BG4DVZAY.js";
10
- import "../chunk-7LI4Y6WT.js";
8
+ } from "../chunk-32NHRLWI.js";
9
+ import "../chunk-L54JNSVS.js";
10
+ import "../chunk-IK3B4YWQ.js";
11
11
  import "../chunk-5YS2PQN3.js";
12
12
  import "../chunk-DMUQ5WNO.js";
13
13
  import "../chunk-A6UTXAPS.js";
@@ -27,8 +27,8 @@ import {
27
27
  useTourProgress,
28
28
  useTourState,
29
29
  validateTourDefinition
30
- } from "../chunk-BG4DVZAY.js";
31
- import "../chunk-7LI4Y6WT.js";
30
+ } from "../chunk-L54JNSVS.js";
31
+ import "../chunk-IK3B4YWQ.js";
32
32
  import "../chunk-JT3XLKKD.js";
33
33
  export {
34
34
  InvalidTourDefinitionError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pablo2410/shared-ui",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "description": "Shared UI component library for all Oplytics.digital subdomains",
5
5
  "type": "module",
6
6
  "exports": {
@@ -85,10 +85,10 @@
85
85
  },
86
86
  "devDependencies": {
87
87
  "@tailwindcss/cli": "^4.3.3",
88
- "@types/google.maps": "^3.66.5",
88
+ "@types/google.maps": "^3.66.6",
89
89
  "@types/react": "^19.3.0",
90
90
  "@types/react-dom": "^19.3.0",
91
- "prettier": "^3.9.9",
91
+ "prettier": "^3.9.10",
92
92
  "react": "^19.3.0",
93
93
  "react-dom": "^19.3.0",
94
94
  "tailwindcss": "^4.3.3",
@@ -129,11 +129,11 @@
129
129
  "cmdk": "^1.1.1",
130
130
  "embla-carousel-react": "^8.6.0",
131
131
  "input-otp": "^1.5.0",
132
- "lucide-react": "^1.54.0",
132
+ "lucide-react": "^1.55.0",
133
133
  "next-themes": "^0.4.6",
134
134
  "react-day-picker": "^10.0.2",
135
135
  "react-hook-form": "^7.89.0",
136
- "react-resizable-panels": "^4.14.3",
136
+ "react-resizable-panels": "^4.14.4",
137
137
  "recharts": "^3.10.1",
138
138
  "sonner": "^2.0.8",
139
139
  "tailwind-merge": "^3.7.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/services/platformDomain.ts"],"sourcesContent":["/**\n * Platform domain resolution — single source of truth for building\n * cross-service URLs (Service Hub cards, sidebar cross-nav, footers,\n * \"Back to Portal\" links).\n *\n * Every service runs on a sibling subdomain of one parent domain\n * (portal.oplyticsdigital.net, sqdcp.oplyticsdigital.net, …), so the parent\n * domain is derived at runtime from the current hostname: strip the service\n * label, keep the rest. Links therefore stay on whichever domain the app is\n * served from — no per-app build args, and a future domain move needs no\n * code change here.\n *\n * Outside a browser (SSR, tests) or on hosts with no parent domain\n * (raw IPs) the canonical production domain is used.\n *\n * The local MacBook sandbox (docker-compose.sandbox.yml) is a special case:\n * every app is served from bare `localhost` on a fixed port per service,\n * not from sibling subdomains — so there is no domain to derive from the\n * hostname the way there is for sandbox-*.oplyticsdigital.net (the tunnel\n * variant) or real subdomains. Without this map, any cross-service link\n * built from `localhost` silently fell back to production (see incident:\n * Business Hub's sidebar link sent an authenticated sandbox user to\n * businesshub.oplyticsdigital.net instead of localhost:3004). This list\n * must be kept in sync with the port assignments in each sandbox compose\n * file — there is currently no single generated source for both.\n */\n\nexport const DEFAULT_PLATFORM_DOMAIN = \"oplyticsdigital.net\";\n\nconst IPV4 = /^\\d{1,3}(\\.\\d{1,3}){3}$/;\n\n/**\n * Fixed local-sandbox port per service subdomain label. Keys match the\n * actual subdomain label / sandbox compose service name each app uses to\n * call platformUrl(...) (e.g. \"oeemanager\", not the hyphenated\n * \"/oee-manager\" Infisical secrets folder — those two naming schemes are\n * already inconsistent elsewhere in this codebase; don't propagate that\n * inconsistency here).\n */\nexport const SANDBOX_LOCALHOST_PORTS: Record<string, number> = {\n portal: 3000,\n sqdcp: 3001,\n oeemanager: 3002,\n actionmanager: 3003,\n businesshub: 3004,\n connect: 3005,\n \"policy-deployment\": 3006,\n \"marketing-site\": 3007,\n};\n\nexport function getPlatformDomain(): string {\n if (typeof window === \"undefined\") return DEFAULT_PLATFORM_DOMAIN;\n const host = window.location.hostname;\n if (!host || IPV4.test(host)) {\n return DEFAULT_PLATFORM_DOMAIN;\n }\n if (host === \"localhost\") {\n // Handled by platformUrl's port-map branch below — a bare domain has no\n // meaning on localhost, since every sandbox service shares the same\n // host and differs only by port. Falling back to the production domain\n // here would be wrong for any localhost caller, so this path should\n // only be reached by code that doesn't also need a port (rare); return\n // the production domain as the least-surprising default for that case.\n return DEFAULT_PLATFORM_DOMAIN;\n }\n const parts = host.split(\".\");\n // sqdcp.oplyticsdigital.net → oplyticsdigital.net\n if (parts.length >= 3) return parts.slice(1).join(\".\");\n // already on the apex (oplyticsdigital.net)\n if (parts.length === 2) return host;\n return DEFAULT_PLATFORM_DOMAIN;\n}\n\n/**\n * Absolute URL for a service subdomain label on the current platform\n * domain, e.g. `platformUrl(\"sqdcp\")` → `https://sqdcp.oplyticsdigital.net`.\n *\n * On the local sandbox (hostname === \"localhost\"), resolves instead to\n * `http://localhost:<port>` using SANDBOX_LOCALHOST_PORTS, so cross-service\n * links (e.g. Portal's sidebar → Business Hub) stay local instead of\n * silently jumping to production.\n */\nexport function platformUrl(subdomainLabel: string, path = \"\"): string {\n if (\n typeof window !== \"undefined\" &&\n window.location.hostname === \"localhost\"\n ) {\n const port = SANDBOX_LOCALHOST_PORTS[subdomainLabel];\n if (port !== undefined) {\n return `http://localhost:${port}${path}`;\n }\n // Unknown label on localhost — no safe local target exists, so fall\n // through to the production URL rather than guessing a port. Better to\n // land on a working page and be visibly wrong (prod) than a broken one.\n }\n return `https://${subdomainLabel}.${getPlatformDomain()}${path}`;\n}\n\n/** Portal URL builder — the portal always lives at the `portal` label. */\nexport function portalUrl(path = \"\"): string {\n return platformUrl(\"portal\", path);\n}\n"],"mappings":";AA2BO,IAAM,0BAA0B;AAEvC,IAAM,OAAO;AAUN,IAAM,0BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,SAAS;AAAA,EACT,qBAAqB;AAAA,EACrB,kBAAkB;AACpB;AAEO,SAAS,oBAA4B;AAC1C,MAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAM,OAAO,OAAO,SAAS;AAC7B,MAAI,CAAC,QAAQ,KAAK,KAAK,IAAI,GAAG;AAC5B,WAAO;AAAA,EACT;AACA,MAAI,SAAS,aAAa;AAOxB,WAAO;AAAA,EACT;AACA,QAAM,QAAQ,KAAK,MAAM,GAAG;AAE5B,MAAI,MAAM,UAAU,EAAG,QAAO,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG;AAErD,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SAAO;AACT;AAWO,SAAS,YAAY,gBAAwB,OAAO,IAAY;AACrE,MACE,OAAO,WAAW,eAClB,OAAO,SAAS,aAAa,aAC7B;AACA,UAAM,OAAO,wBAAwB,cAAc;AACnD,QAAI,SAAS,QAAW;AACtB,aAAO,oBAAoB,IAAI,GAAG,IAAI;AAAA,IACxC;AAAA,EAIF;AACA,SAAO,WAAW,cAAc,IAAI,kBAAkB,CAAC,GAAG,IAAI;AAChE;AAGO,SAAS,UAAU,OAAO,IAAY;AAC3C,SAAO,YAAY,UAAU,IAAI;AACnC;","names":[]}