@treasuryspatial/surface-kit 0.1.0 → 0.1.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { DeepPartial, UiBrandProfile, UiManifest } from '@treasuryspatial/ui-manifest';
1
+ import type { DeepPartial, UiBrandProfile, UiManifest, UiManifestImage } from '@treasuryspatial/ui-manifest';
2
2
  export type SurfaceKitId = 'composer' | 'transit' | 'courtyard';
3
3
  export type SurfaceSkinId = 'transitguy';
4
4
  export type SurfaceCompatibilityMode = 'direct-tenant' | 'tenant-subtenant-bridge';
@@ -29,6 +29,65 @@ export type SurfaceHostResolverOptions = {
29
29
  marketingSlugs?: string[];
30
30
  hostPresets?: Record<string, SurfaceHostPreset>;
31
31
  };
32
+ export type SurfaceBrandingPayload = {
33
+ slug?: string | null;
34
+ tenant?: {
35
+ displayName?: string | null;
36
+ } | null;
37
+ logos?: {
38
+ primary?: string | null;
39
+ [key: string]: unknown;
40
+ } | null;
41
+ organization?: {
42
+ logoUrl?: string | null;
43
+ } | null;
44
+ subtenant?: {
45
+ slug?: string | null;
46
+ name?: string | null;
47
+ logoUrl?: string | null;
48
+ logo_url?: string | null;
49
+ logos?: {
50
+ primary?: string | null;
51
+ [key: string]: unknown;
52
+ } | null;
53
+ branding?: {
54
+ name?: string | null;
55
+ logos?: {
56
+ primary?: string | null;
57
+ [key: string]: unknown;
58
+ } | null;
59
+ colors?: Record<string, string> | null;
60
+ typography?: Record<string, string> | null;
61
+ theme?: Record<string, string> | null;
62
+ } | null;
63
+ } | null;
64
+ branding?: {
65
+ name?: string | null;
66
+ logos?: {
67
+ primary?: string | null;
68
+ [key: string]: unknown;
69
+ } | null;
70
+ colors?: Record<string, string> | null;
71
+ typography?: Record<string, string> | null;
72
+ theme?: Record<string, string> | null;
73
+ } | null;
74
+ logoUrl?: string | null;
75
+ logo_url?: string | null;
76
+ invalidSubdomain?: boolean;
77
+ isEnvironment?: boolean;
78
+ };
79
+ export type SurfaceBrandingTarget = {
80
+ brandingProfile?: UiBrandProfile;
81
+ title?: string;
82
+ surfaceLabel?: string;
83
+ existingLogoAlt?: string | null;
84
+ existingSubtenantLogoAlt?: string | null;
85
+ };
86
+ export type ResolvedSurfaceBrandingImages = {
87
+ topbarLogo: UiManifestImage | null;
88
+ subtenantLogo: UiManifestImage | null;
89
+ scaffoldPrimaryLogo: UiManifestImage | null;
90
+ };
32
91
  export declare const DEFAULT_MARKETING_SLUGS: string[];
33
92
  export declare const TREASURY_LOGO: {
34
93
  src: string;
@@ -38,6 +97,9 @@ export declare const TRANSITGUY_LOGO: {
38
97
  src: string;
39
98
  alt: string;
40
99
  };
100
+ export declare const normalizeSurfaceBrandingPayload: (raw: unknown) => SurfaceBrandingPayload | null;
101
+ export declare const resolveSurfaceBrandingImages: (target: SurfaceBrandingTarget, payload?: SurfaceBrandingPayload | null) => ResolvedSurfaceBrandingImages;
102
+ export declare const applySurfaceBrandingToManifest: (manifest: UiManifest, payload?: SurfaceBrandingPayload | null) => UiManifest;
41
103
  export declare const SURFACE_KITS: Record<SurfaceKitId, SurfaceKitProfile>;
42
104
  export declare const SURFACE_SKINS: Record<string, SurfaceSkinProfile>;
43
105
  export declare const SURFACE_HOST_PRESETS: Record<string, SurfaceHostPreset>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE5F,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AACzC,MAAM,MAAM,wBAAwB,GAAG,eAAe,GAAG,yBAAyB,CAAC;AAEnF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,YAAY,CAAC;IACjB,QAAQ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AkB,GAAG,IAG/E,CAAC;AAOF,eAAO,MAAM,qBAAqB,GAAI,YAAW,MAAM,EAAO,gBACmC,CAAC;AAElG,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,IAAI,EAAE,4BAAwC,YAG7F,CAAC;AAcF,eAAO,MAAM,yBAAyB,GAAI,SAAS,0BAA0B;;6BA8ChD,MAAM,GAAG,IAAI;uCAtCE,MAAM,GAAG,IAAI,KAAG,kBAAkB;uCAwCvC,MAAM,GAAG,IAAI;gDAEJ,MAAM,GAAG,IAAI;CAG5D,CAAC"}
package/dist/index.js CHANGED
@@ -15,6 +15,149 @@ export const TRANSITGUY_LOGO = {
15
15
  src: 'https://images.squarespace-cdn.com/content/v1/60074cff46d4c56a53f5b0f8/c9051ab0-28f7-4840-ae97-4d70737abffe/the%2Btransit%2Bgay%2Blogo%2B%281%29.png',
16
16
  alt: 'The Transit Guy',
17
17
  };
18
+ const buildManifestImage = (src, alt) => {
19
+ if (!src)
20
+ return null;
21
+ return { src, alt };
22
+ };
23
+ const cloneRecord = (value) => {
24
+ if (!value || typeof value !== 'object' || Array.isArray(value))
25
+ return null;
26
+ return { ...value };
27
+ };
28
+ const resolvePrimaryLogo = (...candidates) => {
29
+ for (const candidate of candidates) {
30
+ if (typeof candidate === 'string' && candidate.trim())
31
+ return candidate;
32
+ }
33
+ return null;
34
+ };
35
+ const normalizeBrandingRecord = (branding, fallbackLogos, primaryLogo) => {
36
+ const normalizedBranding = cloneRecord(branding);
37
+ const normalizedLogos = {
38
+ ...(fallbackLogos ?? {}),
39
+ ...(cloneRecord(normalizedBranding?.logos ?? null) ?? {}),
40
+ };
41
+ if (primaryLogo) {
42
+ normalizedLogos.primary = primaryLogo;
43
+ }
44
+ if (!normalizedBranding && Object.keys(normalizedLogos).length === 0) {
45
+ return null;
46
+ }
47
+ return {
48
+ ...(normalizedBranding ?? {}),
49
+ ...(Object.keys(normalizedLogos).length > 0 ? { logos: normalizedLogos } : {}),
50
+ };
51
+ };
52
+ export const normalizeSurfaceBrandingPayload = (raw) => {
53
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw))
54
+ return null;
55
+ const source = raw;
56
+ const payload = source.data && typeof source.data === 'object' && !Array.isArray(source.data)
57
+ ? source.data
58
+ : source;
59
+ const rootLogos = cloneRecord(payload.logos);
60
+ const rootBranding = cloneRecord(payload.branding);
61
+ const primaryLogo = resolvePrimaryLogo(rootBranding?.logos?.primary, rootLogos?.primary, payload.logoUrl, payload.logo_url, payload.organization?.logoUrl);
62
+ const normalizedSubtenant = cloneRecord(payload.subtenant);
63
+ const subtenantLogos = cloneRecord(normalizedSubtenant?.logos);
64
+ const subtenantBranding = cloneRecord(normalizedSubtenant?.branding);
65
+ const subtenantPrimaryLogo = resolvePrimaryLogo(subtenantBranding?.logos?.primary, subtenantLogos?.primary, normalizedSubtenant?.logoUrl, normalizedSubtenant?.logo_url);
66
+ return {
67
+ ...payload,
68
+ branding: normalizeBrandingRecord(rootBranding, rootLogos, primaryLogo),
69
+ logos: rootLogos ? { ...rootLogos, ...(primaryLogo ? { primary: primaryLogo } : {}) } : rootLogos,
70
+ logoUrl: primaryLogo,
71
+ subtenant: normalizedSubtenant
72
+ ? {
73
+ ...normalizedSubtenant,
74
+ branding: normalizeBrandingRecord(subtenantBranding, subtenantLogos, subtenantPrimaryLogo),
75
+ logos: subtenantLogos
76
+ ? { ...subtenantLogos, ...(subtenantPrimaryLogo ? { primary: subtenantPrimaryLogo } : {}) }
77
+ : subtenantLogos,
78
+ logoUrl: subtenantPrimaryLogo,
79
+ }
80
+ : null,
81
+ };
82
+ };
83
+ const resolvePrimaryBrandingLogoSrc = (payload) => payload?.branding?.logos?.primary ||
84
+ payload?.logos?.primary ||
85
+ payload?.logoUrl ||
86
+ payload?.logo_url ||
87
+ payload?.organization?.logoUrl ||
88
+ null;
89
+ const resolveSubtenantBrandingLogoSrc = (payload) => payload?.subtenant?.branding?.logos?.primary ||
90
+ payload?.subtenant?.logos?.primary ||
91
+ payload?.subtenant?.logoUrl ||
92
+ payload?.subtenant?.logo_url ||
93
+ null;
94
+ export const resolveSurfaceBrandingImages = (target, payload) => {
95
+ const normalizedPayload = normalizeSurfaceBrandingPayload(payload);
96
+ const primaryLogoSrc = resolvePrimaryBrandingLogoSrc(normalizedPayload);
97
+ const subtenantLogoSrc = resolveSubtenantBrandingLogoSrc(normalizedPayload);
98
+ const resolvedPrimaryAlt = target.existingLogoAlt ||
99
+ normalizedPayload?.branding?.name ||
100
+ normalizedPayload?.tenant?.displayName ||
101
+ target.title ||
102
+ target.surfaceLabel ||
103
+ 'Logo';
104
+ const resolvedSubtenantAlt = target.existingSubtenantLogoAlt ||
105
+ normalizedPayload?.subtenant?.name ||
106
+ target.surfaceLabel ||
107
+ 'Subtenant';
108
+ const topbarLogo = buildManifestImage(primaryLogoSrc, resolvedPrimaryAlt);
109
+ const subtenantLogo = subtenantLogoSrc && subtenantLogoSrc !== primaryLogoSrc
110
+ ? buildManifestImage(subtenantLogoSrc, resolvedSubtenantAlt)
111
+ : null;
112
+ return {
113
+ topbarLogo,
114
+ subtenantLogo,
115
+ scaffoldPrimaryLogo: topbarLogo,
116
+ };
117
+ };
118
+ export const applySurfaceBrandingToManifest = (manifest, payload) => {
119
+ const images = resolveSurfaceBrandingImages({
120
+ brandingProfile: manifest.branding?.profile,
121
+ title: manifest.topbar.title,
122
+ surfaceLabel: manifest.surface?.label,
123
+ existingLogoAlt: manifest.topbar.logo?.alt ?? null,
124
+ existingSubtenantLogoAlt: manifest.topbar.subtenantLogo?.alt ?? null,
125
+ }, payload);
126
+ const isTreasuryNative = manifest.branding?.profile === 'treasury-native';
127
+ const nextTopbar = { ...manifest.topbar };
128
+ const nextSurface = manifest.surface ? { ...manifest.surface } : manifest.surface;
129
+ const nextScaffoldShell = nextSurface?.scaffoldShell ? { ...nextSurface.scaffoldShell } : undefined;
130
+ if (images.topbarLogo) {
131
+ nextTopbar.logo = images.topbarLogo;
132
+ }
133
+ else if (isTreasuryNative) {
134
+ delete nextTopbar.logo;
135
+ }
136
+ if (images.subtenantLogo) {
137
+ nextTopbar.subtenantLogo = images.subtenantLogo;
138
+ }
139
+ else if (isTreasuryNative) {
140
+ delete nextTopbar.subtenantLogo;
141
+ }
142
+ if (nextScaffoldShell) {
143
+ if (images.scaffoldPrimaryLogo) {
144
+ nextScaffoldShell.primaryLogo = images.scaffoldPrimaryLogo;
145
+ }
146
+ else if (isTreasuryNative) {
147
+ delete nextScaffoldShell.primaryLogo;
148
+ }
149
+ }
150
+ return {
151
+ ...manifest,
152
+ topbar: nextTopbar,
153
+ surface: nextSurface
154
+ ? {
155
+ ...nextSurface,
156
+ scaffoldShell: nextScaffoldShell,
157
+ }
158
+ : nextSurface,
159
+ };
160
+ };
18
161
  const TRANSIT_MODE_POLICY = mergeSurfaceModePolicy(DEFAULT_COMPOSER_SURFACE_MODE_POLICY, {
19
162
  defaultMode: 'streetmix',
20
163
  modes: {
@@ -70,8 +213,8 @@ export const SURFACE_KITS = {
70
213
  label: 'Transit',
71
214
  promptFamily: 'transit',
72
215
  brandProfile: 'treasury-native',
73
- summary: 'Treasury-native transit surface built on the Composer runtime.',
74
- description: 'Transit is the packaged Treasury surface for corridor visuals, stop environments, and street-section scaffold workflows.',
216
+ summary: 'Transit surface built on the Composer runtime.',
217
+ description: 'Transit is the packaged surface for corridor visuals, stop environments, and street-section scaffold workflows.',
75
218
  standaloneCapable: true,
76
219
  scaffoldShell: {
77
220
  badge: 'Streetmix',
@@ -86,7 +229,6 @@ export const SURFACE_KITS = {
86
229
  },
87
230
  topbar: {
88
231
  title: 'Treasury',
89
- subtitle: 'Treasury-native transit surface',
90
232
  productLabel: 'Transit Composer',
91
233
  links: [
92
234
  { label: 'Treasury', href: 'https://treasury.space/', target: '_blank' },
@@ -121,7 +263,6 @@ export const SURFACE_KITS = {
121
263
  },
122
264
  topbar: {
123
265
  title: 'Treasury',
124
- subtitle: 'Treasury-native courtyard surface',
125
266
  productLabel: 'Courtyard Composer',
126
267
  links: [
127
268
  { label: 'Treasury', href: 'https://treasury.space/', target: '_blank' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasuryspatial/surface-kit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",
@@ -19,10 +19,11 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@treasuryspatial/mode-policy": "^0.1.5",
22
- "@treasuryspatial/ui-manifest": "^0.1.6"
22
+ "@treasuryspatial/ui-manifest": "^0.1.7"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsc -b",
26
+ "test": "npm run build && node --test test/*.test.mjs",
26
27
  "typecheck": "tsc -b --pretty false --noEmit"
27
28
  }
28
29
  }