@shellui/core 0.7.0-alpha.5 → 0.7.0-alpha.6
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 +2 -2
- package/schemas/shellui.config.schema.json +11 -4
- package/src/features/auth/appBackend/childFrames.spec.ts +99 -0
- package/src/features/auth/appBackend/childFrames.ts +45 -2
- package/src/features/auth/appBackend/frameAuth.ts +9 -2
- package/src/features/config/types.ts +13 -4
- package/src/features/settings/SettingsProvider.tsx +8 -0
- package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +8 -7
- package/src/features/settings/utils/buildSettingsForPropagation.ts +4 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.7.0-alpha.
|
|
3
|
+
"version": "0.7.0-alpha.6",
|
|
4
4
|
"description": "Shellui Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"workbox-routing": "^7.4.0",
|
|
74
74
|
"workbox-strategies": "^7.4.0",
|
|
75
75
|
"workbox-window": "^7.4.0",
|
|
76
|
-
"@shellui/sdk": "0.7.0-alpha.
|
|
76
|
+
"@shellui/sdk": "0.7.0-alpha.6"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"email": {
|
|
81
81
|
"$ref": "#/definitions/EmailConfig",
|
|
82
|
-
"description": "Email-service connection. Propagated to iframes via SDK settings.
|
|
82
|
+
"description": "Email-service connection. Propagated to iframes via SDK settings. Without `url`, the shell sends no email service (`null`). `showInAdmin: false` hides Admin → Email."
|
|
83
83
|
},
|
|
84
84
|
"theme": {
|
|
85
85
|
"$ref": "#/definitions/ThemeRef",
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
},
|
|
329
329
|
"provider": {
|
|
330
330
|
"type": "string",
|
|
331
|
-
"description": "OAuth
|
|
331
|
+
"description": "`upstream`: the shell gets the app session by OAuth token exchange (RFC 8693), trading its own access token at this server. Recommended for Shellui regions. Any other value, such as `google`, is the OAuth provider for silent sign-in. When omitted, the shell uses the first `backend.login.oauthProviders` entry."
|
|
332
332
|
}
|
|
333
333
|
},
|
|
334
334
|
"required": ["url"],
|
|
@@ -356,6 +356,13 @@
|
|
|
356
356
|
"type": "string"
|
|
357
357
|
},
|
|
358
358
|
"description": "Exact origins of identity servers a child may sign in to, such as `https://id.eu.shellui.com`. The shell keeps a separate session per server and never sends its own token to a child. Omit to give children no token."
|
|
359
|
+
},
|
|
360
|
+
"serviceOrigins": {
|
|
361
|
+
"type": "array",
|
|
362
|
+
"items": {
|
|
363
|
+
"type": "string"
|
|
364
|
+
},
|
|
365
|
+
"description": "Exact origins of service URLs (email, storage, hosting) a host may pass to a child with `ShelluiFrame` or `createAppFrame`, such as `https://storage.eu.shellui.com`. No wildcards. A URL outside this list, or a missing one, reaches the child as `null`. Omit to send children no service URLs."
|
|
359
366
|
}
|
|
360
367
|
},
|
|
361
368
|
"required": ["origins"],
|
|
@@ -367,7 +374,7 @@
|
|
|
367
374
|
"properties": {
|
|
368
375
|
"url": {
|
|
369
376
|
"type": "string",
|
|
370
|
-
"description": "Base URL of email-service.
|
|
377
|
+
"description": "Base URL of email-service. Required for apps to get email. There is no built-in default. Local: `http://localhost:8003`."
|
|
371
378
|
},
|
|
372
379
|
"showInAdmin": {
|
|
373
380
|
"type": "boolean",
|
|
@@ -375,7 +382,7 @@
|
|
|
375
382
|
}
|
|
376
383
|
},
|
|
377
384
|
"additionalProperties": false,
|
|
378
|
-
"description": "Optional email-service wiring for Admin → Email and iframe apps.
|
|
385
|
+
"description": "Optional email-service wiring for Admin → Email and iframe apps. The shell never invents a URL: without `url`, apps get no email service."
|
|
379
386
|
},
|
|
380
387
|
"StorageConfig": {
|
|
381
388
|
"type": "object",
|
|
@@ -170,3 +170,102 @@ describe('childFrameAuthPropagationOptions', () => {
|
|
|
170
170
|
expect(options.settingsUser).toBeNull();
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
|
+
|
|
174
|
+
describe('child frame service URLs', () => {
|
|
175
|
+
const withServices: ShellUIConfig = {
|
|
176
|
+
...config,
|
|
177
|
+
navigation: [
|
|
178
|
+
{
|
|
179
|
+
label: 'Dashboard',
|
|
180
|
+
path: '',
|
|
181
|
+
url: 'https://dashboard.example.com/',
|
|
182
|
+
childFrames: {
|
|
183
|
+
origins: ['https://admin.example.com'],
|
|
184
|
+
backendOrigins: ['https://id.eu.example.com'],
|
|
185
|
+
serviceOrigins: [
|
|
186
|
+
'https://email.eu.example.com',
|
|
187
|
+
'https://storage.eu.example.com',
|
|
188
|
+
'https://*.example.com',
|
|
189
|
+
'*',
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
const register = (services: unknown, cfg: ShellUIConfig = withServices) =>
|
|
196
|
+
validateChildFrameRegistration({
|
|
197
|
+
from: ['h1'],
|
|
198
|
+
hostSrc: host,
|
|
199
|
+
payload: { ...good, services },
|
|
200
|
+
config: cfg,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('forwards allowed service URLs to the child settings', () => {
|
|
204
|
+
const result = register({
|
|
205
|
+
email: 'https://email.eu.example.com/',
|
|
206
|
+
storage: 'https://storage.eu.example.com',
|
|
207
|
+
});
|
|
208
|
+
expect(result.ok).toBe(true);
|
|
209
|
+
if (!result.ok) return;
|
|
210
|
+
expect(result.entry.services).toEqual({
|
|
211
|
+
email: 'https://email.eu.example.com',
|
|
212
|
+
storage: 'https://storage.eu.example.com',
|
|
213
|
+
hosting: null,
|
|
214
|
+
});
|
|
215
|
+
expect(result.entry.rejectedServices).toEqual([]);
|
|
216
|
+
const options = childFrameAuthPropagationOptions({
|
|
217
|
+
identity: result.entry.identity,
|
|
218
|
+
getAppSession: () => null,
|
|
219
|
+
services: result.entry.services,
|
|
220
|
+
});
|
|
221
|
+
expect(options.email).toEqual({ url: 'https://email.eu.example.com' });
|
|
222
|
+
expect(options.storage).toEqual({ url: 'https://storage.eu.example.com' });
|
|
223
|
+
expect(options.hosting).toBeNull();
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it('drops a service URL whose origin is not allowed', () => {
|
|
227
|
+
const result = register({
|
|
228
|
+
storage: 'https://evil.example.org',
|
|
229
|
+
hosting: 'javascript:alert(1)',
|
|
230
|
+
});
|
|
231
|
+
expect(result.ok).toBe(true);
|
|
232
|
+
if (!result.ok) return;
|
|
233
|
+
expect(result.entry.services).toEqual({ email: null, storage: null, hosting: null });
|
|
234
|
+
expect(result.entry.rejectedServices).toEqual(['storage', 'hosting']);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it('never matches a wildcard entry', () => {
|
|
238
|
+
const result = register({ hosting: 'https://hosting.example.com' });
|
|
239
|
+
expect(result.ok).toBe(true);
|
|
240
|
+
if (!result.ok) return;
|
|
241
|
+
expect(result.entry.services.hosting).toBeNull();
|
|
242
|
+
expect(result.entry.rejectedServices).toEqual(['hosting']);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('sends null for missing services, without falling back to the shell', () => {
|
|
246
|
+
const shellWithServices: ShellUIConfig = {
|
|
247
|
+
...withServices,
|
|
248
|
+
email: { url: 'https://email.example.com' },
|
|
249
|
+
storage: { url: 'https://storage.example.com' },
|
|
250
|
+
hosting: { url: 'https://hosting.example.com' },
|
|
251
|
+
};
|
|
252
|
+
const result = register(undefined, shellWithServices);
|
|
253
|
+
expect(result.ok).toBe(true);
|
|
254
|
+
if (!result.ok) return;
|
|
255
|
+
expect(result.entry.services).toEqual({ email: null, storage: null, hosting: null });
|
|
256
|
+
const options = childFrameAuthPropagationOptions({
|
|
257
|
+
identity: result.entry.identity,
|
|
258
|
+
getAppSession: () => null,
|
|
259
|
+
services: result.entry.services,
|
|
260
|
+
});
|
|
261
|
+
expect(options).toMatchObject({ email: null, storage: null, hosting: null });
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
it('drops every service URL when serviceOrigins is not configured', () => {
|
|
265
|
+
const result = register({ email: 'https://email.eu.example.com' }, config);
|
|
266
|
+
expect(result.ok).toBe(true);
|
|
267
|
+
if (!result.ok) return;
|
|
268
|
+
expect(result.entry.services.email).toBeNull();
|
|
269
|
+
expect(result.entry.rejectedServices).toEqual(['email']);
|
|
270
|
+
});
|
|
271
|
+
});
|
|
@@ -11,8 +11,16 @@ export type ChildFrameEntry = {
|
|
|
11
11
|
frameId: string;
|
|
12
12
|
url: string;
|
|
13
13
|
identity: ResolvedAppBackend | null;
|
|
14
|
+
/** Host-supplied service URLs that passed `childFrames.serviceOrigins`. Others are `null`. */
|
|
15
|
+
services: ChildFrameServices;
|
|
16
|
+
/** Service keys dropped because the URL was invalid or its origin not allowed. */
|
|
17
|
+
rejectedServices: ChildFrameServiceKey[];
|
|
14
18
|
};
|
|
15
19
|
|
|
20
|
+
export type ChildFrameServiceKey = 'email' | 'storage' | 'hosting';
|
|
21
|
+
export type ChildFrameServices = Record<ChildFrameServiceKey, string | null>;
|
|
22
|
+
const SERVICE_KEYS: readonly ChildFrameServiceKey[] = ['email', 'storage', 'hosting'];
|
|
23
|
+
|
|
16
24
|
export type ChildFrameRegistration =
|
|
17
25
|
| { ok: true; entry: ChildFrameEntry }
|
|
18
26
|
| { ok: false; reason: string };
|
|
@@ -45,6 +53,32 @@ function originList(values: unknown): Set<string> {
|
|
|
45
53
|
return out;
|
|
46
54
|
}
|
|
47
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Keep each host-supplied service URL only when it is http(s) and its origin is
|
|
58
|
+
* exactly in `allowed`. Missing or rejected values become `null`: the child never
|
|
59
|
+
* falls back to the shell's own services or to a built-in default.
|
|
60
|
+
*/
|
|
61
|
+
export function resolveChildFrameServices(
|
|
62
|
+
input: unknown,
|
|
63
|
+
allowedOrigins: unknown,
|
|
64
|
+
): { services: ChildFrameServices; rejected: ChildFrameServiceKey[] } {
|
|
65
|
+
const allowed = originList(allowedOrigins);
|
|
66
|
+
const raw = (input && typeof input === 'object' ? input : {}) as Record<string, unknown>;
|
|
67
|
+
const services: ChildFrameServices = { email: null, storage: null, hosting: null };
|
|
68
|
+
const rejected: ChildFrameServiceKey[] = [];
|
|
69
|
+
for (const key of SERVICE_KEYS) {
|
|
70
|
+
const value = raw[key];
|
|
71
|
+
if (value === undefined || value === null || value === '') continue;
|
|
72
|
+
const origin = exactOrigin(value);
|
|
73
|
+
if (origin && allowed.has(origin)) {
|
|
74
|
+
services[key] = `${value}`.trim().replace(/\/+$/, '');
|
|
75
|
+
} else {
|
|
76
|
+
rejected.push(key);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return { services, rejected };
|
|
80
|
+
}
|
|
81
|
+
|
|
48
82
|
/**
|
|
49
83
|
* Check a `SHELLUI_CHILD_FRAME_REGISTER` message. `from` must be exactly one hop:
|
|
50
84
|
* a child app cannot register frames by sending the message through its host.
|
|
@@ -59,7 +93,7 @@ export function validateChildFrameRegistration(input: {
|
|
|
59
93
|
if (from.length !== 1) return { ok: false, reason: 'not sent by a direct app frame' };
|
|
60
94
|
if (!input.hostSrc) return { ok: false, reason: 'unknown host frame' };
|
|
61
95
|
const payload = input.payload as
|
|
62
|
-
| { frameId?: unknown; url?: unknown; backend?: unknown }
|
|
96
|
+
| { frameId?: unknown; url?: unknown; backend?: unknown; services?: unknown }
|
|
63
97
|
| null
|
|
64
98
|
| undefined;
|
|
65
99
|
const frameId = typeof payload?.frameId === 'string' ? payload.frameId.trim() : '';
|
|
@@ -102,9 +136,18 @@ export function validateChildFrameRegistration(input: {
|
|
|
102
136
|
if (!identity) return { ok: false, reason: 'child identity server is invalid' };
|
|
103
137
|
}
|
|
104
138
|
|
|
139
|
+
const { services, rejected } = resolveChildFrameServices(payload?.services, rules.serviceOrigins);
|
|
140
|
+
|
|
105
141
|
return {
|
|
106
142
|
ok: true,
|
|
107
|
-
entry: {
|
|
143
|
+
entry: {
|
|
144
|
+
hostUuid: from[0],
|
|
145
|
+
frameId,
|
|
146
|
+
url: payload?.url as string,
|
|
147
|
+
identity,
|
|
148
|
+
services,
|
|
149
|
+
rejectedServices: rejected,
|
|
150
|
+
},
|
|
108
151
|
};
|
|
109
152
|
}
|
|
110
153
|
|
|
@@ -174,13 +174,16 @@ export function frameAuthPropagationOptions(input: {
|
|
|
174
174
|
/**
|
|
175
175
|
* Auth fields for a child app hosted inside an embedded app (`createAppFrame`).
|
|
176
176
|
* The shell token is never sent. With no allowed identity server the child gets
|
|
177
|
-
* no token
|
|
177
|
+
* no token and no user. Service URLs are the ones the host passed and the shell
|
|
178
|
+
* allowed (`childFrames.serviceOrigins`); any other service is `null`.
|
|
178
179
|
*/
|
|
179
180
|
export function childFrameAuthPropagationOptions(input: {
|
|
180
181
|
identity: ResolvedAppBackend | null;
|
|
181
182
|
getAppSession: (key: string) => AuthSession | null;
|
|
183
|
+
services?: Partial<Record<'email' | 'storage' | 'hosting', string | null>> | null;
|
|
182
184
|
}): FrameAuthPropagationOptions {
|
|
183
185
|
const { identity, getAppSession } = input;
|
|
186
|
+
const allowed = input.services ?? {};
|
|
184
187
|
const session = identity ? getAppSession(identity.key) : null;
|
|
185
188
|
return toPropagationOptions({
|
|
186
189
|
includeAuthAccessToken: Boolean(identity),
|
|
@@ -189,6 +192,10 @@ export function childFrameAuthPropagationOptions(input: {
|
|
|
189
192
|
authBackendBaseUrl: identity?.type === 'shellui' ? identity.url : null,
|
|
190
193
|
overrideUser: true,
|
|
191
194
|
settingsUser: settingsUserFromSession(session),
|
|
192
|
-
services:
|
|
195
|
+
services: {
|
|
196
|
+
email: allowed.email ? { url: allowed.email } : null,
|
|
197
|
+
storage: allowed.storage ? { url: allowed.storage } : null,
|
|
198
|
+
hosting: allowed.hosting ? { url: allowed.hosting } : null,
|
|
199
|
+
},
|
|
193
200
|
});
|
|
194
201
|
}
|
|
@@ -252,6 +252,13 @@ export interface ChildFramesConfig {
|
|
|
252
252
|
* and never sends its own token to a child. Omit to give children no token.
|
|
253
253
|
*/
|
|
254
254
|
backendOrigins?: string[];
|
|
255
|
+
/**
|
|
256
|
+
* Exact origins of service URLs (email, storage, hosting) a host may pass to
|
|
257
|
+
* a child with `ShelluiFrame` or `createAppFrame`, such as
|
|
258
|
+
* `https://storage.eu.shellui.com`. No wildcards. A URL outside this list, or
|
|
259
|
+
* a missing one, reaches the child as `null`. Omit to send children no service URLs.
|
|
260
|
+
*/
|
|
261
|
+
serviceOrigins?: string[];
|
|
255
262
|
}
|
|
256
263
|
|
|
257
264
|
/**
|
|
@@ -268,7 +275,9 @@ export interface AppBackendConfig {
|
|
|
268
275
|
/** Public key when `type` is `supabase`. */
|
|
269
276
|
publishableKey?: string;
|
|
270
277
|
/**
|
|
271
|
-
*
|
|
278
|
+
* `upstream`: the shell gets the app session by OAuth token exchange (RFC 8693),
|
|
279
|
+
* trading its own access token at this server. Recommended for Shellui regions.
|
|
280
|
+
* Any other value, such as `google`, is the OAuth provider for silent sign-in.
|
|
272
281
|
* When omitted, the shell uses the first `backend.login.oauthProviders` entry.
|
|
273
282
|
*/
|
|
274
283
|
provider?: string;
|
|
@@ -357,12 +366,12 @@ export interface HostingConfig {
|
|
|
357
366
|
|
|
358
367
|
/**
|
|
359
368
|
* Optional email-service wiring for Admin → Email and iframe apps.
|
|
360
|
-
*
|
|
369
|
+
* The shell never invents a URL: without `url`, apps get no email service.
|
|
361
370
|
*/
|
|
362
371
|
export interface EmailConfig {
|
|
363
372
|
/**
|
|
364
373
|
* Base URL of email-service.
|
|
365
|
-
*
|
|
374
|
+
* Required for apps to get email. There is no built-in default.
|
|
366
375
|
* Local: `http://localhost:8003`.
|
|
367
376
|
*/
|
|
368
377
|
url?: string;
|
|
@@ -447,7 +456,7 @@ export interface ShellUIConfig {
|
|
|
447
456
|
hosting?: HostingConfig;
|
|
448
457
|
/**
|
|
449
458
|
* Email-service connection. Propagated to iframes via SDK settings.
|
|
450
|
-
*
|
|
459
|
+
* Without `url`, the shell sends no email service (`null`).
|
|
451
460
|
* `showInAdmin: false` hides Admin → Email.
|
|
452
461
|
*/
|
|
453
462
|
email?: EmailConfig;
|
|
@@ -244,6 +244,7 @@ export function SettingsProvider({ children }: { children: ReactNode }) {
|
|
|
244
244
|
...childFrameAuthPropagationOptions({
|
|
245
245
|
identity: entry?.identity ?? null,
|
|
246
246
|
getAppSession: getAppBackendSession,
|
|
247
|
+
services: entry?.services ?? null,
|
|
247
248
|
}),
|
|
248
249
|
includeLayoutChrome: false,
|
|
249
250
|
frameUuid: path[path.length - 1],
|
|
@@ -688,6 +689,13 @@ export function SettingsProvider({ children }: { children: ReactNode }) {
|
|
|
688
689
|
}
|
|
689
690
|
addChildFrame(result.entry);
|
|
690
691
|
const { entry } = result;
|
|
692
|
+
if (entry.rejectedServices.length) {
|
|
693
|
+
// Keys only: the URLs themselves stay out of the log.
|
|
694
|
+
logger.warn('Dropped child app service URLs not in childFrames.serviceOrigins', {
|
|
695
|
+
origin: safeOrigin(entry.url),
|
|
696
|
+
services: entry.rejectedServices,
|
|
697
|
+
});
|
|
698
|
+
}
|
|
691
699
|
logger.info('Child app frame registered', {
|
|
692
700
|
origin: safeOrigin(entry.url),
|
|
693
701
|
identity: entry.identity?.url ?? null,
|
|
@@ -287,25 +287,26 @@ describe('buildSettingsForPropagation', () => {
|
|
|
287
287
|
expect(result.email).toEqual({ url: 'http://localhost:8003' });
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
it('
|
|
290
|
+
it('sends no email when email is set without url (no built-in default)', () => {
|
|
291
291
|
const config = {
|
|
292
292
|
email: {},
|
|
293
293
|
} as ShellUIConfig;
|
|
294
294
|
|
|
295
295
|
const result = buildSettingsForPropagation(baseSettings, config, 'en');
|
|
296
|
-
expect(result.email).
|
|
296
|
+
expect(result.email).toBeNull();
|
|
297
297
|
});
|
|
298
298
|
|
|
299
|
-
it('propagates showInAdmin false for email
|
|
299
|
+
it('propagates showInAdmin false for email', () => {
|
|
300
300
|
const config = {
|
|
301
301
|
email: {
|
|
302
|
+
url: 'http://localhost:8003',
|
|
302
303
|
showInAdmin: false,
|
|
303
304
|
},
|
|
304
305
|
} as ShellUIConfig;
|
|
305
306
|
|
|
306
307
|
const result = buildSettingsForPropagation(baseSettings, config, 'en');
|
|
307
308
|
expect(result.email).toEqual({
|
|
308
|
-
url: '
|
|
309
|
+
url: 'http://localhost:8003',
|
|
309
310
|
showInAdmin: false,
|
|
310
311
|
});
|
|
311
312
|
});
|
|
@@ -560,7 +561,7 @@ describe('buildSettingsForPropagation', () => {
|
|
|
560
561
|
expect(json).not.toContain('https://email.shellui.com');
|
|
561
562
|
});
|
|
562
563
|
|
|
563
|
-
it('
|
|
564
|
+
it('sends no email when a foreign app sets an empty email object', () => {
|
|
564
565
|
const withEmptyEmail = {
|
|
565
566
|
...appConfig,
|
|
566
567
|
navigation: (appConfig.navigation ?? []).map((item) =>
|
|
@@ -580,7 +581,7 @@ describe('buildSettingsForPropagation', () => {
|
|
|
580
581
|
'en',
|
|
581
582
|
options,
|
|
582
583
|
);
|
|
583
|
-
expect(result.email).
|
|
584
|
+
expect(result.email).toBeNull();
|
|
584
585
|
expect(result.storage).toBeNull();
|
|
585
586
|
expect(result.hosting).toBeNull();
|
|
586
587
|
const json = JSON.stringify(result);
|
|
@@ -618,7 +619,7 @@ describe('buildSettingsForPropagation', () => {
|
|
|
618
619
|
);
|
|
619
620
|
expect(result.accessToken).toBe(shellToken);
|
|
620
621
|
expect(result.authBackendBaseUrl).toBe('https://id.example.com');
|
|
621
|
-
expect(result.email).
|
|
622
|
+
expect(result.email).toBeNull();
|
|
622
623
|
expect(result.storage).toEqual(shellServices.storage);
|
|
623
624
|
expect(result.hosting).toEqual(shellServices.hosting);
|
|
624
625
|
});
|
|
@@ -15,15 +15,13 @@ import {
|
|
|
15
15
|
getPublishedLayoutChrome,
|
|
16
16
|
} from '../../layouts/floating/layoutChromeStore';
|
|
17
17
|
|
|
18
|
-
/** Production email-service origin. No trailing slash. */
|
|
19
|
-
const DEFAULT_EMAIL_SERVICE_URL = 'https://email.shellui.com';
|
|
20
|
-
|
|
21
18
|
const propagateEmail = (email: EmailConfig | null | undefined): SettingsEmail | null => {
|
|
22
|
-
|
|
23
|
-
const url = email
|
|
19
|
+
// No built-in default: email must come from config or the host app.
|
|
20
|
+
const url = email?.url?.trim().replace(/\/+$/, '') || null;
|
|
21
|
+
if (!url) return null;
|
|
24
22
|
return {
|
|
25
23
|
url,
|
|
26
|
-
...(email
|
|
24
|
+
...(email?.showInAdmin === false ? { showInAdmin: false } : {}),
|
|
27
25
|
};
|
|
28
26
|
};
|
|
29
27
|
|