@shrfe/assets 1.0.65-alpha.1 → 1.0.65-alpha.3

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/css/ds/brands.css CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by @shrfe/dt — every brand overlay; load once, switch via [data-brand]. */
1
+ /* Generated by @shrfe/dt — [data-brand] overlays (excludes the default, already in sfe-styles.css). */
2
2
  @import './brand/accelerex.css';
3
3
  @import './brand/access-pension.css';
4
4
  @import './brand/arm.css';
@@ -12,7 +12,6 @@
12
12
  @import './brand/julius-berger.css';
13
13
  @import './brand/providus.css';
14
14
  @import './brand/sterling.css';
15
- @import './brand/system.css';
16
15
  @import './brand/titan-trust.css';
17
16
  @import './brand/vdl.css';
18
17
  @import './brand/wema-bank.css';
@@ -18613,6 +18613,7 @@ __webpack_require__.r(__webpack_exports__);
18613
18613
  // EXPORTS
18614
18614
  __webpack_require__.d(__webpack_exports__, {
18615
18615
  AlertService: function() { return /* reexport */ alert_service_namespaceObject; },
18616
+ BrandService: function() { return /* reexport */ brand_service_namespaceObject; },
18616
18617
  DataModifierService: function() { return /* reexport */ data_modifier_service_namespaceObject; },
18617
18618
  DraggableService: function() { return /* reexport */ draggable_service; },
18618
18619
  EventBus: function() { return /* reexport */ EventBus; },
@@ -18681,6 +18682,14 @@ __webpack_require__.r(data_modifier_service_namespaceObject);
18681
18682
  __webpack_require__.d(data_modifier_service_namespaceObject, {
18682
18683
  alterUsersForProfileStrip: function() { return alterUsersForProfileStrip; } });
18683
18684
 
18685
+ // NAMESPACE OBJECT: ./src/services/brand-service.ts
18686
+ var brand_service_namespaceObject = {};
18687
+ __webpack_require__.r(brand_service_namespaceObject);
18688
+ __webpack_require__.d(brand_service_namespaceObject, {
18689
+ isBrand: function() { return isBrand; },
18690
+ resolveBrand: function() { return resolveBrand; },
18691
+ setBrand: function() { return setBrand; } });
18692
+
18684
18693
 
18685
18694
  ;// CONCATENATED MODULE: ./src/services/draggable-service.ts
18686
18695
  /*
@@ -26027,7 +26036,7 @@ class HTTPBaseService {
26027
26036
  // Add this temporarily for breeze to work
26028
26037
  if (!refreshTokenPath) {
26029
26038
  setLocalStorageItem('refresh-token-path-not-found', true);
26030
- refreshTokenPath = `${location.origin}/api/v2/auth/refresh-token-web`;
26039
+ //refreshTokenPath = `${location.origin}/api/v2/auth/refresh-token-web`
26031
26040
  }
26032
26041
  const refreshTokenRequest = {
26033
26042
  refresh_token: this.tokenService.getRefreshToken(),
@@ -28605,6 +28614,60 @@ function traverse(value, depth = Infinity, seen) {
28605
28614
  }
28606
28615
  };
28607
28616
 
28617
+ ;// CONCATENATED MODULE: ./src/services/brand-service.ts
28618
+ const DEFAULT_BRAND = 'system';
28619
+ // Must match design-tokens/raw/brand/<slug>.json (each builds ds/brand/<slug>.css).
28620
+ const BRANDS = [
28621
+ 'system',
28622
+ 'accelerex',
28623
+ 'access-pension',
28624
+ 'arm',
28625
+ 'asiko-energy',
28626
+ 'brand-star',
28627
+ 'chapel-hill-denham',
28628
+ 'coronation',
28629
+ 'custodian',
28630
+ 'fmdq',
28631
+ 'grant-thornton',
28632
+ 'julius-berger',
28633
+ 'providus',
28634
+ 'sterling',
28635
+ 'titan-trust',
28636
+ 'vdl',
28637
+ 'wema-bank',
28638
+ 'zebet'
28639
+ ];
28640
+ // Full-hostname match: covers clients on their own domains, and subdomains that don't equal the slug.
28641
+ // A client's branch hosts all map to the same brand.
28642
+ const BRAND_HOSTS = {
28643
+ 'globalaccelerex.seamlesshrms.com': 'accelerex',
28644
+ 'gt.seamlesshrms.com': 'grant-thornton',
28645
+ 'nairabet.seamlesshrms.com': 'brand-star',
28646
+ 'asikoenergy.seamlesshrms.com': 'asiko-energy',
28647
+ 'custodian.seamlesshrms.com': 'custodian',
28648
+ 'access-armpensions.seamlesshrms.com': 'access-pension',
28649
+ 'arm.seamlesshrms.com': 'arm',
28650
+ 'jbnrecruitment.seamlesshiring.com': 'julius-berger',
28651
+ 'hrms.providusbank.com': 'providus',
28652
+ 'vdl.seamlesshrms.com': 'vdl',
28653
+ 'coronation.seamlesshrms.com': 'coronation',
28654
+ 'hchub.sterling.ng': 'sterling',
28655
+ 'wemabank.seamlesshrms.com': 'wema-bank',
28656
+ 'humancapital.chapelhilldenham.com': 'chapel-hill-denham'
28657
+ };
28658
+ function isBrand(slug) {
28659
+ return !!slug && BRANDS.includes(slug);
28660
+ }
28661
+ function resolveBrand(slug, hostname = globalThis.location?.hostname) {
28662
+ if (isBrand(slug)) return slug;
28663
+ return BRAND_HOSTS[hostname?.toLowerCase() ?? ''] ?? DEFAULT_BRAND;
28664
+ }
28665
+ function setBrand(slug) {
28666
+ const brand = resolveBrand(slug);
28667
+ document.documentElement.dataset.brand = brand;
28668
+ return brand;
28669
+ }
28670
+
28608
28671
  ;// CONCATENATED MODULE: ./src/services/event-bus.ts
28609
28672
  /*
28610
28673
  import {ShrEventBus} from '....'
@@ -60276,6 +60339,9 @@ MixpanelService.trackEvent = (nodeEnv, eventName, payload)=>{
60276
60339
 
60277
60340
 
60278
60341
 
60342
+ // Runs synchronously from the <head> script tag, so data-brand is set before first paint.
60343
+ setBrand();
60344
+
60279
60345
  /* export default */ var main_umd = ({});
60280
60346
 
60281
60347
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrfe/assets",
3
- "version": "1.0.65-alpha.1",
3
+ "version": "1.0.65-alpha.3",
4
4
  "description": "The assets used in SeamlessHR products",
5
5
  "author": "SeamlessHR LTD <oludayo@seamlesshr.com>",
6
6
  "license": "ISC",