@datalayer/core 1.2.21 → 1.2.22

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.
@@ -46,7 +46,7 @@ export function IAMMixin(Base) {
46
46
  email_s: response.profile.email_s || response.profile.email,
47
47
  first_name_t: response.profile.first_name_t || response.profile.first_name || '',
48
48
  last_name_t: response.profile.last_name_t || response.profile.last_name || '',
49
- // Use avatar_url_s if available, otherwise leave undefined for fallback
49
+ // The avatar's URL when the profile has one; without, the user's avatarUrl is ''.
50
50
  avatar_url_s: response.profile.avatar_url_s || response.profile.avatar_url,
51
51
  };
52
52
  }
@@ -68,6 +68,7 @@ export declare class UserDTO {
68
68
  get firstName(): string;
69
69
  get lastName(): string;
70
70
  get displayName(): string;
71
+ /** The avatar's URL, or `''` when the profile has none: a person without a picture is still a user. */
71
72
  get avatarUrl(): string;
72
73
  get avatarIcon(): string | undefined;
73
74
  get banner(): string | undefined;
@@ -40,8 +40,9 @@ export class UserDTO {
40
40
  get displayName() {
41
41
  return `${this.firstName} ${this.lastName}`.trim();
42
42
  }
43
+ /** The avatar's URL, or `''` when the profile has none: a person without a picture is still a user. */
43
44
  get avatarUrl() {
44
- return this._data.avatar_url_s;
45
+ return this._data.avatar_url_s ?? '';
45
46
  }
46
47
  get avatarIcon() {
47
48
  return this._data.avatar_icon_s;
@@ -70,6 +70,12 @@ export type NavigationState = {
70
70
  * through or on a page that belongs to no shell.
71
71
  */
72
72
  export declare function isRememberableRoute(route: string): boolean;
73
+ /**
74
+ * Whether a page is a hosted application, run at its address, rather than a
75
+ * page of the Apps shell. It is visited, not returned to: the Apps shell
76
+ * never reopens on one, and one remembered before is dropped on load.
77
+ */
78
+ export declare function isHostedAppRoute(route: string): boolean;
73
79
  /**
74
80
  * Whether a page belongs to no shell: the settings, the documentation and
75
81
  * the decks.
@@ -199,7 +199,48 @@ export function isRememberableRoute(route) {
199
199
  '/oauth',
200
200
  '/join',
201
201
  ].some(prefix => path === prefix || path.startsWith(`${prefix}/`)) &&
202
- !isShellNeutralRoute(route));
202
+ !isShellNeutralRoute(route) &&
203
+ !isHostedAppRoute(route));
204
+ }
205
+ /**
206
+ * The Apps shell's own pages under `/apps/<section>`. Any other first segment
207
+ * is an application's hosted address (`/apps/<slug>`, its preview at
208
+ * `/apps/<slug>/preview/<version>`).
209
+ */
210
+ const APPS_SHELL_SECTIONS = new Set([
211
+ 'activity',
212
+ 'agents',
213
+ 'apps',
214
+ 'components',
215
+ 'connections',
216
+ 'contents',
217
+ 'context',
218
+ 'deployments',
219
+ 'evalsets',
220
+ 'examples',
221
+ 'home',
222
+ 'models',
223
+ 'readiness',
224
+ 'reports',
225
+ 'rules',
226
+ 'runs',
227
+ 'shared',
228
+ 'skills',
229
+ 'usage',
230
+ 'workspace',
231
+ ]);
232
+ /**
233
+ * Whether a page is a hosted application, run at its address, rather than a
234
+ * page of the Apps shell. It is visited, not returned to: the Apps shell
235
+ * never reopens on one, and one remembered before is dropped on load.
236
+ */
237
+ export function isHostedAppRoute(route) {
238
+ const segments = pathOf(route).split('/').filter(Boolean);
239
+ return (segments[0] === 'apps' &&
240
+ segments.length >= 2 &&
241
+ !APPS_SHELL_SECTIONS.has(segments[1]) &&
242
+ (segments.length === 2 ||
243
+ (segments.length === 4 && segments[2] === 'preview')));
203
244
  }
204
245
  /**
205
246
  * Whether a page belongs to no shell: the settings, the documentation and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/core",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",