@memberjunction/ng-base-application 5.51.0 → 6.1.0-edge.0

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.
Files changed (38) hide show
  1. package/LICENSE +7 -0
  2. package/dist/lib/__tests__/base-application.test.js +163 -0
  3. package/dist/lib/__tests__/base-application.test.js.map +1 -1
  4. package/dist/lib/__tests__/layout-transforms.test.d.ts +2 -0
  5. package/dist/lib/__tests__/layout-transforms.test.d.ts.map +1 -0
  6. package/dist/lib/__tests__/layout-transforms.test.js +188 -0
  7. package/dist/lib/__tests__/layout-transforms.test.js.map +1 -0
  8. package/dist/lib/application-manager.d.ts +13 -0
  9. package/dist/lib/application-manager.d.ts.map +1 -1
  10. package/dist/lib/application-manager.js +23 -0
  11. package/dist/lib/application-manager.js.map +1 -1
  12. package/dist/lib/base-application.d.ts +3 -1
  13. package/dist/lib/base-application.d.ts.map +1 -1
  14. package/dist/lib/base-application.js +4 -2
  15. package/dist/lib/base-application.js.map +1 -1
  16. package/dist/lib/golden-layout-manager.d.ts +65 -3
  17. package/dist/lib/golden-layout-manager.d.ts.map +1 -1
  18. package/dist/lib/golden-layout-manager.js +276 -65
  19. package/dist/lib/golden-layout-manager.js.map +1 -1
  20. package/dist/lib/interfaces/tab-request.interface.d.ts +9 -0
  21. package/dist/lib/interfaces/tab-request.interface.d.ts.map +1 -1
  22. package/dist/lib/interfaces/tab-request.interface.js.map +1 -1
  23. package/dist/lib/interfaces/workspace-configuration.interface.d.ts +7 -0
  24. package/dist/lib/interfaces/workspace-configuration.interface.d.ts.map +1 -1
  25. package/dist/lib/interfaces/workspace-configuration.interface.js.map +1 -1
  26. package/dist/lib/layout-transforms.d.ts +40 -0
  27. package/dist/lib/layout-transforms.d.ts.map +1 -0
  28. package/dist/lib/layout-transforms.js +91 -0
  29. package/dist/lib/layout-transforms.js.map +1 -0
  30. package/dist/lib/workspace-state-manager.d.ts +33 -0
  31. package/dist/lib/workspace-state-manager.d.ts.map +1 -1
  32. package/dist/lib/workspace-state-manager.js +71 -7
  33. package/dist/lib/workspace-state-manager.js.map +1 -1
  34. package/dist/public-api.d.ts +1 -0
  35. package/dist/public-api.d.ts.map +1 -1
  36. package/dist/public-api.js +1 -0
  37. package/dist/public-api.js.map +1 -1
  38. package/package.json +11 -10
@@ -18,6 +18,38 @@ export class WorkspaceStateManager {
18
18
  loading$ = new BehaviorSubject(false);
19
19
  tabBarVisible$ = new BehaviorSubject(true);
20
20
  initialized = false;
21
+ /**
22
+ * Optional predicate identifying tabs that belong to the MAIN layout.
23
+ * Tabs failing the predicate (e.g. record tabs under the records-style
24
+ * record-open model, which live in their own layout region) are excluded
25
+ * from ALL main-layout semantics: they never force the main tab bar to
26
+ * appear (shouldShowTabs), are never consumed as the replaceable
27
+ * "temporary tab" by OpenTab, and skip the keep-last-tab-alive rule in
28
+ * CloseTab. Null = every tab is a main-layout tab (classic behavior).
29
+ * Kept as a settable predicate (not an import) because this package sits
30
+ * below the package that owns the record-open style.
31
+ * NOTE: record tabs DOCKED to the workspace ("Move to Workspace")
32
+ * intentionally PASS this filter — they are main-layout tabs.
33
+ */
34
+ MainLayoutTabFilter = null;
35
+ /** True when the tab participates in main-layout semantics (see MainLayoutTabFilter) */
36
+ isMainLayoutTab(tab) {
37
+ return this.MainLayoutTabFilter ? this.MainLayoutTabFilter(tab) : true;
38
+ }
39
+ /**
40
+ * Optional predicate identifying tabs that may be CONSUMED as the
41
+ * replaceable "temporary tab" by OpenTab. Record tabs (docked or not) are
42
+ * deliberately unpinned yet must never be silently replaced by the next
43
+ * nav click — the shell sets this to exclude ALL record tabs under the
44
+ * records style. Null = every unpinned main-layout tab is consumable
45
+ * (classic behavior). Settable predicate for the same layering reason as
46
+ * MainLayoutTabFilter.
47
+ */
48
+ TempTabConsumptionFilter = null;
49
+ /** True when the tab may be consumed as OpenTab's replaceable temp tab */
50
+ isTempTabConsumable(tab) {
51
+ return this.TempTabConsumptionFilter ? this.TempTabConsumptionFilter(tab) : true;
52
+ }
21
53
  /**
22
54
  * Optional explicit metadata provider. When set, used instead of falling back
23
55
  * to `Metadata.Provider`. The shell calls `setProvider(this.ProviderToUse)`
@@ -76,7 +108,9 @@ export class WorkspaceStateManager {
76
108
  * - Show if 2+ tabs OR any pinned tabs exist
77
109
  */
78
110
  shouldShowTabs(config) {
79
- const tabs = config.tabs || [];
111
+ // Main-layout tabs only — tabs excluded by the filter (e.g. record tabs
112
+ // living in the separate records region) never force the main bar open.
113
+ const tabs = (config.tabs || []).filter(t => this.isMainLayoutTab(t));
80
114
  // Always hide if no tabs (shouldn't happen, but defensive)
81
115
  if (tabs.length === 0) {
82
116
  return false;
@@ -271,8 +305,10 @@ export class WorkspaceStateManager {
271
305
  configuration: request.Configuration || {}
272
306
  };
273
307
  // CRITICAL: If creating a temporary tab, pin all existing temporary tabs first
274
- // This ensures only ONE temporary tab exists at any time
275
- const updatedTabs = !newTab.isPinned
308
+ // This ensures only ONE temporary tab exists at any time.
309
+ // PreservePinState opts out (records-style record tabs live in a separate
310
+ // layout region and must not disturb the nav tab's temp status).
311
+ const updatedTabs = !newTab.isPinned && !request.PreservePinState
276
312
  ? config.tabs.map(tab => !tab.isPinned ? { ...tab, isPinned: true } : tab)
277
313
  : config.tabs;
278
314
  this.UpdateConfiguration({
@@ -352,8 +388,11 @@ export class WorkspaceStateManager {
352
388
  this.UpdateConfiguration(updatedConfig);
353
389
  return existingTab.id;
354
390
  }
355
- // Find temporary tab (unpinned tab from ANY app) to replace
356
- const tempTab = config.tabs.find(tab => !tab.isPinned);
391
+ // Find temporary tab (unpinned tab from ANY app) to replace.
392
+ // NEVER consume a non-main-layout tab (e.g. an open record under the
393
+ // records style — they're deliberately unpinned, and replacing one here
394
+ // would silently destroy an open record with zero user feedback).
395
+ const tempTab = config.tabs.find(tab => !tab.isPinned && this.isMainLayoutTab(tab) && this.isTempTabConsumable(tab));
357
396
  if (tempTab) {
358
397
  // Replace temporary tab
359
398
  const updatedTabs = config.tabs.map(tab => tab.id === tempTab.id
@@ -400,8 +439,20 @@ export class WorkspaceStateManager {
400
439
  const config = this.configuration$.value;
401
440
  if (!config)
402
441
  return;
403
- // Check if this is the last tab
404
- const wouldBeLastTab = config.tabs.length === 1 && config.tabs[0].id === tabId;
442
+ // No-op when the tab is already gone — layout-driven close events can
443
+ // arrive for tabs a configuration sync already removed; re-emitting an
444
+ // unchanged config from inside a subscription pass invites re-entrancy.
445
+ const closingTab = config.tabs.find(t => t.id === tabId);
446
+ if (!closingTab)
447
+ return;
448
+ // Check if this is the last tab. The keep-alive rule (retain the tab,
449
+ // just unpin) exists so the MAIN region never renders an empty
450
+ // workspace — it must NOT apply to non-main-layout tabs (records):
451
+ // keeping a closed record alive makes the records region re-create the
452
+ // tab the user just closed, forever. Records close outright; the
453
+ // records host is responsible for backfilling an empty workspace.
454
+ const wouldBeLastTab = config.tabs.length === 1 && config.tabs[0].id === tabId
455
+ && this.isMainLayoutTab(closingTab);
405
456
  // CRITICAL: If closing the last tab, keep it in the array but mark as unpinned
406
457
  // This allows single-resource mode to work while preserving tab data for nav highlighting
407
458
  let updatedTabs;
@@ -538,6 +589,19 @@ export class WorkspaceStateManager {
538
589
  layout
539
590
  });
540
591
  }
592
+ /**
593
+ * Update the RECORDS region layout (the separate Golden Layout hosting
594
+ * record tabs under the records-style record-open model).
595
+ */
596
+ UpdateRecordsLayout(recordsLayout) {
597
+ const config = this.configuration$.value;
598
+ if (!config)
599
+ return;
600
+ this.UpdateConfiguration({
601
+ ...config,
602
+ recordsLayout
603
+ });
604
+ }
541
605
  /**
542
606
  * Get tab by ID
543
607
  */
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-state-manager.js","sourceRoot":"","sources":["../../src/lib/workspace-state-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MA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C,cAAc,CAAC,KAAK,EAAE,WAAW,IAAI,IAAI,CAAC;IACxD,CAAC;IAED;;OAEG;IACK,YAAY;QAClB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACnE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;YAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;+GA1tBU,qBAAqB;gEAArB,qBAAqB,WAArB,qBAAqB,mBAFpB,MAAM;;iFAEP,qBAAqB;cAHjC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { Metadata, IMetadataProvider, LogStatus, PermissionConstrainedError } from '@memberjunction/core';\nimport { UserInfoEngine, MJWorkspaceEntity } from '@memberjunction/core-entities';\nimport {\n WorkspaceConfiguration,\n WorkspaceTab,\n createDefaultWorkspaceConfiguration\n} from './interfaces/workspace-configuration.interface';\nimport { TabRequest } from './interfaces/tab-request.interface';\n\n/**\n * Manages workspace state including tabs, layout, and persistence.\n *\n * Uses a single Workspace.Configuration JSON blob for all state,\n * with debounced saves to minimize database writes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class WorkspaceStateManager {\n private workspace$ = new BehaviorSubject<MJWorkspaceEntity | null>(null);\n private configuration$ = new BehaviorSubject<WorkspaceConfiguration | null>(null);\n private saveRequest$ = new Subject<void>();\n private loading$ = new BehaviorSubject<boolean>(false);\n private tabBarVisible$ = new BehaviorSubject<boolean>(true);\n private initialized = false;\n\n /**\n * Optional explicit metadata provider. When set, used instead of falling back\n * to `Metadata.Provider`. The shell calls `setProvider(this.ProviderToUse)`\n * after acquiring this manager from DI.\n */\n private _provider: IMetadataProvider | null = null;\n\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n constructor() {\n // Set up debounced saves\n this.saveRequest$.pipe(\n debounceTime(500) // Wait 500ms after last change\n ).subscribe(() => {\n this.persistConfiguration();\n });\n\n // Update tab bar visibility whenever configuration changes\n this.configuration$.subscribe(config => {\n if (config) {\n const shouldShow = this.shouldShowTabs(config);\n this.tabBarVisible$.next(shouldShow);\n }\n });\n }\n\n /**\n * Observable of the current workspace configuration\n */\n get Configuration(): Observable<WorkspaceConfiguration | null> {\n return this.configuration$.asObservable();\n }\n\n /**\n * Observable of loading state\n */\n get Loading(): Observable<boolean> {\n return this.loading$.asObservable();\n }\n\n /**\n * Observable of tab bar visibility\n * Returns false when only 1 tab exists and no tabs are pinned\n * Returns true when 2+ tabs exist OR any tabs are pinned\n */\n get TabBarVisible(): Observable<boolean> {\n return this.tabBarVisible$.asObservable();\n }\n\n /**\n * Get current configuration synchronously\n */\n GetConfiguration(): WorkspaceConfiguration | null {\n return this.configuration$.value;\n }\n\n /**\n * Determine if tab bar should be visible\n * - Hide if only 1 tab and no pinned tabs (single-resource view)\n * - Show if 2+ tabs OR any pinned tabs exist\n */\n private shouldShowTabs(config: WorkspaceConfiguration): boolean {\n const tabs = config.tabs || [];\n\n // Always hide if no tabs (shouldn't happen, but defensive)\n if (tabs.length === 0) {\n return false;\n }\n\n // Check if any tabs are pinned\n const hasPinnedTabs = tabs.some(tab => tab.isPinned);\n\n // Show tabs if:\n // - 2 or more tabs exist, OR\n // - Any tab is pinned (user wants persistent workspace)\n return tabs.length > 1 || hasPinnedTabs;\n }\n\n /**\n * Initialize the workspace state for a user\n */\n async Initialize(userId: string): Promise<void> {\n if (this.initialized) {\n return;\n }\n\n this.loading$.next(true);\n\n try {\n await this.loadWorkspace(userId);\n this.initialized = true;\n } finally {\n this.loading$.next(false);\n }\n }\n\n /**\n * Ephemeral mode: when `window.__MJ_EPHEMERAL_WORKSPACE__ === true` is set\n * (only baked into the regression test Explorer build via Dockerfile.explorer),\n * the workspace neither loads from nor persists to the server. Every fresh\n * BrowserContext starts from a default workspace configuration, so tab/workspace\n * state can never leak across regression tests sharing a user. Production\n * deployments never set this flag, so behavior is unchanged.\n */\n private isEphemeral(): boolean {\n return typeof window !== 'undefined'\n && (window as Window & { __MJ_EPHEMERAL_WORKSPACE__?: boolean }).__MJ_EPHEMERAL_WORKSPACE__ === true;\n }\n\n /**\n * Load workspace from database using UserInfoEngine for centralized, cached access\n */\n private async loadWorkspace(userId: string): Promise<void> {\n if (this.isEphemeral()) {\n // Test mode — skip server load entirely. Just emit a default config so the\n // workspace starts clean for this BrowserContext. No MJWorkspaceEntity is\n // created or read; the DB row (if any) is ignored.\n this.configuration$.next(createDefaultWorkspaceConfiguration());\n return;\n }\n // Use UserInfoEngine for centralized, cached workspace loading\n const engine = UserInfoEngine.Instance;\n\n // Permission-denied ≠ empty — don't auto-create a workspace for denied users.\n if (engine.IsPermissionConstrained) {\n LogStatus('[WorkspaceStateManager] UserInfoEngine is permission-constrained, using default workspace configuration');\n this.configuration$.next(createDefaultWorkspaceConfiguration());\n return;\n }\n\n const workspaces = engine.Workspaces;\n\n if (workspaces.length > 0) {\n const workspace = workspaces[0];\n this.workspace$.next(workspace);\n\n // Parse configuration or create default\n const configJson = workspace.Configuration;\n\n const config = configJson\n ? JSON.parse(configJson) as WorkspaceConfiguration\n : createDefaultWorkspaceConfiguration();\n\n this.configuration$.next(config);\n }\n else {\n // Create new workspace for user\n const md = this.Provider;\n const workspace = await md.GetEntityObject<MJWorkspaceEntity>('MJ: Workspaces', md.CurrentUser);\n workspace.UserID = userId;\n workspace.Name = 'Default';\n workspace.Configuration = JSON.stringify(createDefaultWorkspaceConfiguration());\n\n const saveResult = await workspace.Save();\n\n if (saveResult) {\n this.workspace$.next(workspace);\n this.configuration$.next(createDefaultWorkspaceConfiguration());\n } else {\n console.error('[WorkspaceStateManager.loadWorkspace] Failed to save workspace');\n throw new Error('Failed to create default workspace');\n }\n }\n }\n\n /**\n * Persist configuration to database (debounced)\n */\n private async persistConfiguration(): Promise<void> {\n if (this.isEphemeral()) {\n // Test mode — no-op. We never persist workspace state in the regression\n // environment so tab/workspace state can't leak across tests.\n return;\n }\n const workspace = this.workspace$.value;\n const config = this.configuration$.value;\n\n if (workspace && config) {\n workspace.Configuration = JSON.stringify(config);\n await workspace.Save();\n }\n }\n\n /**\n * Request a save (will be debounced)\n */\n private requestSave(): void {\n this.saveRequest$.next();\n }\n\n /**\n * Update configuration and request save\n */\n UpdateConfiguration(config: WorkspaceConfiguration): void {\n this.configuration$.next(config);\n this.requestSave();\n }\n\n /**\n * Reset workspace to a clean default configuration and persist immediately.\n * Used for recovery when stale or corrupted workspace data prevents startup.\n */\n async ResetConfiguration(): Promise<void> {\n const defaultConfig = createDefaultWorkspaceConfiguration();\n this.configuration$.next(defaultConfig);\n await this.persistConfiguration();\n }\n\n /**\n * Force creation of a new tab, never replacing temporary tabs\n * Used for Shift+Click behavior - checks for existing tab first, only creates new if none exists\n */\n OpenTabForced(request: TabRequest, appColor: string): string {\n const config = this.configuration$.value;\n if (!config) {\n throw new Error('Configuration not initialized');\n }\n\n // Check for existing tab first - don't allow duplicate tabs\n const existingTab = config.tabs.find(tab => {\n if (tab.applicationId !== request.ApplicationId) return false;\n\n // For resource-based tabs, match by resourceType in configuration\n if (request.Configuration?.resourceType) {\n // Normalize empty/null/undefined to empty string for comparison\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n\n // For Custom resource types, also compare navItemName or driverClass\n if (request.Configuration.resourceType === 'Custom') {\n const requestNavItem = request.Configuration.navItemName || '';\n const tabNavItem = tab.configuration?.navItemName || '';\n const requestDriverClass = request.Configuration.driverClass || '';\n const tabDriverClass = tab.configuration?.driverClass || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n (requestNavItem === tabNavItem || requestDriverClass === tabDriverClass);\n }\n\n // For Records resource type, also match by Entity name to distinguish between different entity records\n if (request.Configuration.resourceType === 'Records') {\n const requestEntity = (request.Configuration.Entity as string)?.trim().toLowerCase() || '';\n const tabEntity = (tab.configuration?.Entity as string)?.trim().toLowerCase() || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n requestEntity === tabEntity;\n }\n\n // For other standard resource types, match by resourceType and recordId\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId;\n }\n\n // Legacy: match by entity and viewId\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n return tab.configuration.entity === request.Configuration?.entity &&\n tab.configuration.viewId === request.Configuration?.viewId &&\n tabRecordId === requestRecordId;\n });\n\n if (existingTab) {\n // Focus existing tab\n const updatedConfig = {\n ...config,\n activeTabId: existingTab.id\n };\n this.UpdateConfiguration(updatedConfig);\n return existingTab.id;\n }\n\n // No existing tab found - create new pinned tab\n const newTab: WorkspaceTab = {\n id: this.generateUUID(),\n applicationId: request.ApplicationId,\n title: request.Title,\n resourceTypeId: request.ResourceTypeId || '',\n resourceRecordId: request.ResourceRecordId || '',\n isPinned: request.IsPinned || false,\n sequence: config.tabs.length,\n lastAccessedAt: new Date().toISOString(),\n configuration: request.Configuration || {}\n };\n\n // CRITICAL: If creating a temporary tab, pin all existing temporary tabs first\n // This ensures only ONE temporary tab exists at any time\n const updatedTabs = !newTab.isPinned\n ? config.tabs.map(tab => !tab.isPinned ? { ...tab, isPinned: true } : tab)\n : config.tabs;\n\n this.UpdateConfiguration({\n ...config,\n tabs: [...updatedTabs, newTab],\n activeTabId: newTab.id\n });\n\n return newTab.id;\n }\n\n /**\n * Open a tab (new or focus existing)\n */\n OpenTab(request: TabRequest, appColor: string): string {\n const config = this.configuration$.value;\n if (!config) {\n throw new Error('Configuration not initialized');\n }\n\n // Check for existing tab - match by resource type and record ID for resource-based tabs\n const existingTab = config.tabs.find(tab => {\n const appIdMatch = tab.applicationId === request.ApplicationId;\n if (!appIdMatch) {\n return false;\n }\n\n // For resource-based tabs, match by resourceType in configuration\n if (request.Configuration?.resourceType) {\n // Normalize empty/null/undefined to empty string for comparison\n // IMPORTANT: Check both ResourceRecordId AND Configuration.recordId\n // because for nav items, the recordId is stored in Configuration, not ResourceRecordId\n const requestRecordId = request.ResourceRecordId || (request.Configuration?.recordId as string) || '';\n const tabRecordId = tab.resourceRecordId || (tab.configuration?.recordId as string) || '';\n\n // For Custom resource types, also compare navItemName or driverClass\n // to distinguish between different custom resources (Monitor vs Prompts vs Agents, etc.)\n if (request.Configuration.resourceType === 'Custom') {\n const requestNavItem = request.Configuration.navItemName || '';\n const tabNavItem = tab.configuration?.navItemName || '';\n const requestDriverClass = request.Configuration.driverClass || '';\n const tabDriverClass = tab.configuration?.driverClass || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n (requestNavItem === tabNavItem || requestDriverClass === tabDriverClass);\n }\n\n // For Records resource type, also match by Entity name to distinguish between different entity records\n if (request.Configuration.resourceType === 'Records') {\n const requestEntity = (request.Configuration.Entity as string)?.trim().toLowerCase() || '';\n const tabEntity = (tab.configuration?.Entity as string)?.trim().toLowerCase() || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n requestEntity === tabEntity;\n }\n\n // For other standard resource types, match by resourceType and recordId\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId;\n }\n\n // Legacy: match by entity and viewId\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n return tab.configuration.entity === request.Configuration?.entity &&\n tab.configuration.viewId === request.Configuration?.viewId &&\n tabRecordId === requestRecordId;\n });\n\n if (existingTab) {\n // Focus existing tab AND update its title and configuration.\n // Title and config must be refreshed because in single-resource mode,\n // the same tab gets reused for different nav items within an app.\n const updatedTabs = config.tabs.map(tab =>\n tab.id === existingTab.id\n ? {\n ...tab,\n title: request.Title,\n configuration: { ...tab.configuration, ...request.Configuration }\n }\n : tab\n );\n const updatedConfig = {\n ...config,\n tabs: updatedTabs,\n activeTabId: existingTab.id\n };\n this.UpdateConfiguration(updatedConfig);\n return existingTab.id;\n }\n\n // Find temporary tab (unpinned tab from ANY app) to replace\n const tempTab = config.tabs.find(tab => !tab.isPinned);\n\n if (tempTab) {\n // Replace temporary tab\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tempTab.id\n ? {\n ...tab,\n applicationId: request.ApplicationId, // Update app ID for cross-app navigation\n title: request.Title,\n resourceTypeId: request.ResourceTypeId || '',\n resourceRecordId: request.ResourceRecordId || '',\n configuration: request.Configuration || {},\n lastAccessedAt: new Date().toISOString()\n }\n : tab\n );\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId: tempTab.id\n });\n\n return tempTab.id;\n }\n\n // Create new tab\n const newTab: WorkspaceTab = {\n id: this.generateUUID(),\n applicationId: request.ApplicationId,\n title: request.Title,\n resourceTypeId: request.ResourceTypeId || '',\n resourceRecordId: request.ResourceRecordId || '',\n isPinned: false,\n sequence: config.tabs.length,\n lastAccessedAt: new Date().toISOString(),\n configuration: request.Configuration || {}\n };\n\n this.UpdateConfiguration({\n ...config,\n tabs: [...config.tabs, newTab],\n activeTabId: newTab.id\n });\n\n return newTab.id;\n }\n\n /**\n * Close a tab\n */\n CloseTab(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n // Check if this is the last tab\n const wouldBeLastTab = config.tabs.length === 1 && config.tabs[0].id === tabId;\n\n // CRITICAL: If closing the last tab, keep it in the array but mark as unpinned\n // This allows single-resource mode to work while preserving tab data for nav highlighting\n let updatedTabs: typeof config.tabs;\n if (wouldBeLastTab) {\n // Keep the tab but ensure it's unpinned (triggers single-resource mode)\n updatedTabs = config.tabs.map(tab =>\n tab.id === tabId ? { ...tab, isPinned: false } : tab\n );\n } else {\n // Normal case: remove the tab from array\n updatedTabs = config.tabs.filter(tab => tab.id !== tabId);\n }\n\n // Update active tab if needed\n let activeTabId = config.activeTabId;\n if (activeTabId === tabId && !wouldBeLastTab) {\n // Find next tab to activate (only when not keeping the last tab)\n const closedIndex = config.tabs.findIndex(tab => tab.id === tabId);\n const nextTab = updatedTabs[closedIndex] || updatedTabs[closedIndex - 1];\n activeTabId = nextTab?.id || null;\n }\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId\n });\n }\n\n /**\n * Close all tabs except the specified one\n */\n CloseOtherTabs(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n // Keep only the specified tab\n const updatedTabs = config.tabs.filter(tab => tab.id === tabId);\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId: tabId\n });\n }\n\n /**\n * Close all tabs to the right of the specified tab\n */\n CloseTabsToRight(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n const tabIndex = config.tabs.findIndex(tab => tab.id === tabId);\n if (tabIndex === -1) return;\n\n // Keep only tabs up to and including the specified tab\n const updatedTabs = config.tabs.slice(0, tabIndex + 1);\n\n // Update active tab if it was closed\n let activeTabId = config.activeTabId;\n if (!updatedTabs.find(tab => tab.id === activeTabId)) {\n activeTabId = tabId;\n }\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId\n });\n }\n\n /**\n * Clear the saved layout structure.\n * This is used to recover from corrupted layouts - tabs will be recreated fresh.\n */\n ClearLayout(): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n this.UpdateConfiguration({\n ...config,\n layout: undefined // Clear the layout, tabs will be recreated fresh\n });\n }\n\n /**\n * Toggle pin state of a tab\n */\n TogglePin(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tabId\n ? { ...tab, isPinned: !tab.isPinned }\n : tab\n );\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Set active tab\n */\n SetActiveTab(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n // Update last accessed time\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tabId\n ? { ...tab, lastAccessedAt: new Date().toISOString() }\n : tab\n );\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId: tabId\n });\n }\n\n /**\n * Update tab sequences after reorder\n */\n UpdateTabSequences(tabIds: string[]): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n const updatedTabs = config.tabs.map(tab => {\n const newSequence = tabIds.indexOf(tab.id);\n return newSequence >= 0 ? { ...tab, sequence: newSequence } : tab;\n }).sort((a, b) => a.sequence - b.sequence);\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Update layout configuration\n */\n UpdateLayout(layout: WorkspaceConfiguration['layout']): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n this.UpdateConfiguration({\n ...config,\n layout\n });\n }\n\n /**\n * Get tab by ID\n */\n GetTab(tabId: string): WorkspaceTab | undefined {\n return this.configuration$.value?.tabs.find(tab => tab.id === tabId);\n }\n\n /**\n * Get tabs for a specific application\n */\n GetAppTabs(appId: string): WorkspaceTab[] {\n return this.configuration$.value?.tabs.filter(tab => tab.applicationId === appId) || [];\n }\n\n /**\n * Update the title of a specific tab\n */\n UpdateTabTitle(tabId: string, newTitle: string): void {\n const config = this.configuration$.value;\n if (!config) {\n return;\n }\n\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tabId ? { ...tab, title: newTitle } : tab\n );\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Update the configuration of a specific tab.\n * Merges the provided partial configuration with the existing tab configuration.\n * @param tabId The ID of the tab to update\n * @param configUpdate Partial configuration to merge with existing configuration\n */\n UpdateTabConfiguration(tabId: string, configUpdate: Partial<WorkspaceTab['configuration']>): void {\n const config = this.configuration$.value;\n if (!config) {\n return;\n }\n\n const updatedTabs = config.tabs.map(tab => {\n if (tab.id === tabId) {\n return {\n ...tab,\n configuration: {\n ...tab.configuration,\n ...configUpdate\n }\n };\n }\n return tab;\n });\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Update a tab's top-level `resourceRecordId` (and mirror it into `configuration.recordId`).\n *\n * Used when a \"new record\" tab transitions to a saved record — the tab was opened with\n * an empty recordId, but once the user saves, the tab now represents an actual record.\n * Without this, the next \"Create New Record\" request would match this tab (both have\n * empty `resourceRecordId`) and focus the stale form instead of opening a fresh one.\n *\n * Also clears `configuration.isNew` since the record now exists.\n */\n UpdateTabResourceRecordId(tabId: string, newRecordId: string): void {\n const config = this.configuration$.value;\n if (!config) {\n return;\n }\n\n const updatedTabs = config.tabs.map(tab => {\n if (tab.id === tabId) {\n const { isNew: _isNew, ...restConfig } = tab.configuration;\n return {\n ...tab,\n resourceRecordId: newRecordId,\n configuration: {\n ...restConfig,\n recordId: newRecordId\n }\n };\n }\n return tab;\n });\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Get the ID of the currently active tab\n */\n GetActiveTabId(): string | null {\n return this.configuration$.value?.activeTabId ?? null;\n }\n\n /**\n * Generate UUID for new tabs\n */\n private generateUUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"workspace-state-manager.js","sourceRoot":"","sources":["../../src/lib/workspace-state-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAc,OAAO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C;QAEH,IAAI,CAAC,mBAAmB,CAAC;YACvB,GAAG,MAAM;YACT,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,IAAI,IAAI,CAAC;IACxD,CAAC;IAED;;OAEG;IACK,YAAY;QAClB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACnE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;YAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;+GA/xBU,qBAAqB;gEAArB,qBAAqB,WAArB,qBAAqB,mBAFpB,MAAM;;iFAEP,qBAAqB;cAHjC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { Metadata, IMetadataProvider, LogStatus, PermissionConstrainedError } from '@memberjunction/core';\nimport { UserInfoEngine, MJWorkspaceEntity } from '@memberjunction/core-entities';\nimport {\n WorkspaceConfiguration,\n WorkspaceTab,\n createDefaultWorkspaceConfiguration\n} from './interfaces/workspace-configuration.interface';\nimport { TabRequest } from './interfaces/tab-request.interface';\n\n/**\n * Manages workspace state including tabs, layout, and persistence.\n *\n * Uses a single Workspace.Configuration JSON blob for all state,\n * with debounced saves to minimize database writes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class WorkspaceStateManager {\n private workspace$ = new BehaviorSubject<MJWorkspaceEntity | null>(null);\n private configuration$ = new BehaviorSubject<WorkspaceConfiguration | null>(null);\n private saveRequest$ = new Subject<void>();\n private loading$ = new BehaviorSubject<boolean>(false);\n private tabBarVisible$ = new BehaviorSubject<boolean>(true);\n private initialized = false;\n\n /**\n * Optional predicate identifying tabs that belong to the MAIN layout.\n * Tabs failing the predicate (e.g. record tabs under the records-style\n * record-open model, which live in their own layout region) are excluded\n * from ALL main-layout semantics: they never force the main tab bar to\n * appear (shouldShowTabs), are never consumed as the replaceable\n * \"temporary tab\" by OpenTab, and skip the keep-last-tab-alive rule in\n * CloseTab. Null = every tab is a main-layout tab (classic behavior).\n * Kept as a settable predicate (not an import) because this package sits\n * below the package that owns the record-open style.\n * NOTE: record tabs DOCKED to the workspace (\"Move to Workspace\")\n * intentionally PASS this filter — they are main-layout tabs.\n */\n public MainLayoutTabFilter: ((tab: WorkspaceTab) => boolean) | null = null;\n\n /** True when the tab participates in main-layout semantics (see MainLayoutTabFilter) */\n private isMainLayoutTab(tab: WorkspaceTab): boolean {\n return this.MainLayoutTabFilter ? this.MainLayoutTabFilter(tab) : true;\n }\n\n /**\n * Optional predicate identifying tabs that may be CONSUMED as the\n * replaceable \"temporary tab\" by OpenTab. Record tabs (docked or not) are\n * deliberately unpinned yet must never be silently replaced by the next\n * nav click — the shell sets this to exclude ALL record tabs under the\n * records style. Null = every unpinned main-layout tab is consumable\n * (classic behavior). Settable predicate for the same layering reason as\n * MainLayoutTabFilter.\n */\n public TempTabConsumptionFilter: ((tab: WorkspaceTab) => boolean) | null = null;\n\n /** True when the tab may be consumed as OpenTab's replaceable temp tab */\n private isTempTabConsumable(tab: WorkspaceTab): boolean {\n return this.TempTabConsumptionFilter ? this.TempTabConsumptionFilter(tab) : true;\n }\n\n /**\n * Optional explicit metadata provider. When set, used instead of falling back\n * to `Metadata.Provider`. The shell calls `setProvider(this.ProviderToUse)`\n * after acquiring this manager from DI.\n */\n private _provider: IMetadataProvider | null = null;\n\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n constructor() {\n // Set up debounced saves\n this.saveRequest$.pipe(\n debounceTime(500) // Wait 500ms after last change\n ).subscribe(() => {\n this.persistConfiguration();\n });\n\n // Update tab bar visibility whenever configuration changes\n this.configuration$.subscribe(config => {\n if (config) {\n const shouldShow = this.shouldShowTabs(config);\n this.tabBarVisible$.next(shouldShow);\n }\n });\n }\n\n /**\n * Observable of the current workspace configuration\n */\n get Configuration(): Observable<WorkspaceConfiguration | null> {\n return this.configuration$.asObservable();\n }\n\n /**\n * Observable of loading state\n */\n get Loading(): Observable<boolean> {\n return this.loading$.asObservable();\n }\n\n /**\n * Observable of tab bar visibility\n * Returns false when only 1 tab exists and no tabs are pinned\n * Returns true when 2+ tabs exist OR any tabs are pinned\n */\n get TabBarVisible(): Observable<boolean> {\n return this.tabBarVisible$.asObservable();\n }\n\n /**\n * Get current configuration synchronously\n */\n GetConfiguration(): WorkspaceConfiguration | null {\n return this.configuration$.value;\n }\n\n /**\n * Determine if tab bar should be visible\n * - Hide if only 1 tab and no pinned tabs (single-resource view)\n * - Show if 2+ tabs OR any pinned tabs exist\n */\n private shouldShowTabs(config: WorkspaceConfiguration): boolean {\n // Main-layout tabs only — tabs excluded by the filter (e.g. record tabs\n // living in the separate records region) never force the main bar open.\n const tabs = (config.tabs || []).filter(t => this.isMainLayoutTab(t));\n\n // Always hide if no tabs (shouldn't happen, but defensive)\n if (tabs.length === 0) {\n return false;\n }\n\n // Check if any tabs are pinned\n const hasPinnedTabs = tabs.some(tab => tab.isPinned);\n\n // Show tabs if:\n // - 2 or more tabs exist, OR\n // - Any tab is pinned (user wants persistent workspace)\n return tabs.length > 1 || hasPinnedTabs;\n }\n\n /**\n * Initialize the workspace state for a user\n */\n async Initialize(userId: string): Promise<void> {\n if (this.initialized) {\n return;\n }\n\n this.loading$.next(true);\n\n try {\n await this.loadWorkspace(userId);\n this.initialized = true;\n } finally {\n this.loading$.next(false);\n }\n }\n\n /**\n * Ephemeral mode: when `window.__MJ_EPHEMERAL_WORKSPACE__ === true` is set\n * (only baked into the regression test Explorer build via Dockerfile.explorer),\n * the workspace neither loads from nor persists to the server. Every fresh\n * BrowserContext starts from a default workspace configuration, so tab/workspace\n * state can never leak across regression tests sharing a user. Production\n * deployments never set this flag, so behavior is unchanged.\n */\n private isEphemeral(): boolean {\n return typeof window !== 'undefined'\n && (window as Window & { __MJ_EPHEMERAL_WORKSPACE__?: boolean }).__MJ_EPHEMERAL_WORKSPACE__ === true;\n }\n\n /**\n * Load workspace from database using UserInfoEngine for centralized, cached access\n */\n private async loadWorkspace(userId: string): Promise<void> {\n if (this.isEphemeral()) {\n // Test mode — skip server load entirely. Just emit a default config so the\n // workspace starts clean for this BrowserContext. No MJWorkspaceEntity is\n // created or read; the DB row (if any) is ignored.\n this.configuration$.next(createDefaultWorkspaceConfiguration());\n return;\n }\n // Use UserInfoEngine for centralized, cached workspace loading\n const engine = UserInfoEngine.Instance;\n\n // Permission-denied ≠ empty — don't auto-create a workspace for denied users.\n if (engine.IsPermissionConstrained) {\n LogStatus('[WorkspaceStateManager] UserInfoEngine is permission-constrained, using default workspace configuration');\n this.configuration$.next(createDefaultWorkspaceConfiguration());\n return;\n }\n\n const workspaces = engine.Workspaces;\n\n if (workspaces.length > 0) {\n const workspace = workspaces[0];\n this.workspace$.next(workspace);\n\n // Parse configuration or create default\n const configJson = workspace.Configuration;\n\n const config = configJson\n ? JSON.parse(configJson) as WorkspaceConfiguration\n : createDefaultWorkspaceConfiguration();\n\n this.configuration$.next(config);\n }\n else {\n // Create new workspace for user\n const md = this.Provider;\n const workspace = await md.GetEntityObject<MJWorkspaceEntity>('MJ: Workspaces', md.CurrentUser);\n workspace.UserID = userId;\n workspace.Name = 'Default';\n workspace.Configuration = JSON.stringify(createDefaultWorkspaceConfiguration());\n\n const saveResult = await workspace.Save();\n\n if (saveResult) {\n this.workspace$.next(workspace);\n this.configuration$.next(createDefaultWorkspaceConfiguration());\n } else {\n console.error('[WorkspaceStateManager.loadWorkspace] Failed to save workspace');\n throw new Error('Failed to create default workspace');\n }\n }\n }\n\n /**\n * Persist configuration to database (debounced)\n */\n private async persistConfiguration(): Promise<void> {\n if (this.isEphemeral()) {\n // Test mode — no-op. We never persist workspace state in the regression\n // environment so tab/workspace state can't leak across tests.\n return;\n }\n const workspace = this.workspace$.value;\n const config = this.configuration$.value;\n\n if (workspace && config) {\n workspace.Configuration = JSON.stringify(config);\n await workspace.Save();\n }\n }\n\n /**\n * Request a save (will be debounced)\n */\n private requestSave(): void {\n this.saveRequest$.next();\n }\n\n /**\n * Update configuration and request save\n */\n UpdateConfiguration(config: WorkspaceConfiguration): void {\n this.configuration$.next(config);\n this.requestSave();\n }\n\n /**\n * Reset workspace to a clean default configuration and persist immediately.\n * Used for recovery when stale or corrupted workspace data prevents startup.\n */\n async ResetConfiguration(): Promise<void> {\n const defaultConfig = createDefaultWorkspaceConfiguration();\n this.configuration$.next(defaultConfig);\n await this.persistConfiguration();\n }\n\n /**\n * Force creation of a new tab, never replacing temporary tabs\n * Used for Shift+Click behavior - checks for existing tab first, only creates new if none exists\n */\n OpenTabForced(request: TabRequest, appColor: string): string {\n const config = this.configuration$.value;\n if (!config) {\n throw new Error('Configuration not initialized');\n }\n\n // Check for existing tab first - don't allow duplicate tabs\n const existingTab = config.tabs.find(tab => {\n if (tab.applicationId !== request.ApplicationId) return false;\n\n // For resource-based tabs, match by resourceType in configuration\n if (request.Configuration?.resourceType) {\n // Normalize empty/null/undefined to empty string for comparison\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n\n // For Custom resource types, also compare navItemName or driverClass\n if (request.Configuration.resourceType === 'Custom') {\n const requestNavItem = request.Configuration.navItemName || '';\n const tabNavItem = tab.configuration?.navItemName || '';\n const requestDriverClass = request.Configuration.driverClass || '';\n const tabDriverClass = tab.configuration?.driverClass || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n (requestNavItem === tabNavItem || requestDriverClass === tabDriverClass);\n }\n\n // For Records resource type, also match by Entity name to distinguish between different entity records\n if (request.Configuration.resourceType === 'Records') {\n const requestEntity = (request.Configuration.Entity as string)?.trim().toLowerCase() || '';\n const tabEntity = (tab.configuration?.Entity as string)?.trim().toLowerCase() || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n requestEntity === tabEntity;\n }\n\n // For other standard resource types, match by resourceType and recordId\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId;\n }\n\n // Legacy: match by entity and viewId\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n return tab.configuration.entity === request.Configuration?.entity &&\n tab.configuration.viewId === request.Configuration?.viewId &&\n tabRecordId === requestRecordId;\n });\n\n if (existingTab) {\n // Focus existing tab\n const updatedConfig = {\n ...config,\n activeTabId: existingTab.id\n };\n this.UpdateConfiguration(updatedConfig);\n return existingTab.id;\n }\n\n // No existing tab found - create new pinned tab\n const newTab: WorkspaceTab = {\n id: this.generateUUID(),\n applicationId: request.ApplicationId,\n title: request.Title,\n resourceTypeId: request.ResourceTypeId || '',\n resourceRecordId: request.ResourceRecordId || '',\n isPinned: request.IsPinned || false,\n sequence: config.tabs.length,\n lastAccessedAt: new Date().toISOString(),\n configuration: request.Configuration || {}\n };\n\n // CRITICAL: If creating a temporary tab, pin all existing temporary tabs first\n // This ensures only ONE temporary tab exists at any time.\n // PreservePinState opts out (records-style record tabs live in a separate\n // layout region and must not disturb the nav tab's temp status).\n const updatedTabs = !newTab.isPinned && !request.PreservePinState\n ? config.tabs.map(tab => !tab.isPinned ? { ...tab, isPinned: true } : tab)\n : config.tabs;\n\n this.UpdateConfiguration({\n ...config,\n tabs: [...updatedTabs, newTab],\n activeTabId: newTab.id\n });\n\n return newTab.id;\n }\n\n /**\n * Open a tab (new or focus existing)\n */\n OpenTab(request: TabRequest, appColor: string): string {\n const config = this.configuration$.value;\n if (!config) {\n throw new Error('Configuration not initialized');\n }\n\n // Check for existing tab - match by resource type and record ID for resource-based tabs\n const existingTab = config.tabs.find(tab => {\n const appIdMatch = tab.applicationId === request.ApplicationId;\n if (!appIdMatch) {\n return false;\n }\n\n // For resource-based tabs, match by resourceType in configuration\n if (request.Configuration?.resourceType) {\n // Normalize empty/null/undefined to empty string for comparison\n // IMPORTANT: Check both ResourceRecordId AND Configuration.recordId\n // because for nav items, the recordId is stored in Configuration, not ResourceRecordId\n const requestRecordId = request.ResourceRecordId || (request.Configuration?.recordId as string) || '';\n const tabRecordId = tab.resourceRecordId || (tab.configuration?.recordId as string) || '';\n\n // For Custom resource types, also compare navItemName or driverClass\n // to distinguish between different custom resources (Monitor vs Prompts vs Agents, etc.)\n if (request.Configuration.resourceType === 'Custom') {\n const requestNavItem = request.Configuration.navItemName || '';\n const tabNavItem = tab.configuration?.navItemName || '';\n const requestDriverClass = request.Configuration.driverClass || '';\n const tabDriverClass = tab.configuration?.driverClass || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n (requestNavItem === tabNavItem || requestDriverClass === tabDriverClass);\n }\n\n // For Records resource type, also match by Entity name to distinguish between different entity records\n if (request.Configuration.resourceType === 'Records') {\n const requestEntity = (request.Configuration.Entity as string)?.trim().toLowerCase() || '';\n const tabEntity = (tab.configuration?.Entity as string)?.trim().toLowerCase() || '';\n\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId &&\n requestEntity === tabEntity;\n }\n\n // For other standard resource types, match by resourceType and recordId\n return tab.configuration.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId;\n }\n\n // Legacy: match by entity and viewId\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n return tab.configuration.entity === request.Configuration?.entity &&\n tab.configuration.viewId === request.Configuration?.viewId &&\n tabRecordId === requestRecordId;\n });\n\n if (existingTab) {\n // Focus existing tab AND update its title and configuration.\n // Title and config must be refreshed because in single-resource mode,\n // the same tab gets reused for different nav items within an app.\n const updatedTabs = config.tabs.map(tab =>\n tab.id === existingTab.id\n ? {\n ...tab,\n title: request.Title,\n configuration: { ...tab.configuration, ...request.Configuration }\n }\n : tab\n );\n const updatedConfig = {\n ...config,\n tabs: updatedTabs,\n activeTabId: existingTab.id\n };\n this.UpdateConfiguration(updatedConfig);\n return existingTab.id;\n }\n\n // Find temporary tab (unpinned tab from ANY app) to replace.\n // NEVER consume a non-main-layout tab (e.g. an open record under the\n // records style — they're deliberately unpinned, and replacing one here\n // would silently destroy an open record with zero user feedback).\n const tempTab = config.tabs.find(tab => !tab.isPinned && this.isMainLayoutTab(tab) && this.isTempTabConsumable(tab));\n\n if (tempTab) {\n // Replace temporary tab\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tempTab.id\n ? {\n ...tab,\n applicationId: request.ApplicationId, // Update app ID for cross-app navigation\n title: request.Title,\n resourceTypeId: request.ResourceTypeId || '',\n resourceRecordId: request.ResourceRecordId || '',\n configuration: request.Configuration || {},\n lastAccessedAt: new Date().toISOString()\n }\n : tab\n );\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId: tempTab.id\n });\n\n return tempTab.id;\n }\n\n // Create new tab\n const newTab: WorkspaceTab = {\n id: this.generateUUID(),\n applicationId: request.ApplicationId,\n title: request.Title,\n resourceTypeId: request.ResourceTypeId || '',\n resourceRecordId: request.ResourceRecordId || '',\n isPinned: false,\n sequence: config.tabs.length,\n lastAccessedAt: new Date().toISOString(),\n configuration: request.Configuration || {}\n };\n\n this.UpdateConfiguration({\n ...config,\n tabs: [...config.tabs, newTab],\n activeTabId: newTab.id\n });\n\n return newTab.id;\n }\n\n /**\n * Close a tab\n */\n CloseTab(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n // No-op when the tab is already gone — layout-driven close events can\n // arrive for tabs a configuration sync already removed; re-emitting an\n // unchanged config from inside a subscription pass invites re-entrancy.\n const closingTab = config.tabs.find(t => t.id === tabId);\n if (!closingTab) return;\n\n // Check if this is the last tab. The keep-alive rule (retain the tab,\n // just unpin) exists so the MAIN region never renders an empty\n // workspace — it must NOT apply to non-main-layout tabs (records):\n // keeping a closed record alive makes the records region re-create the\n // tab the user just closed, forever. Records close outright; the\n // records host is responsible for backfilling an empty workspace.\n const wouldBeLastTab = config.tabs.length === 1 && config.tabs[0].id === tabId\n && this.isMainLayoutTab(closingTab);\n\n // CRITICAL: If closing the last tab, keep it in the array but mark as unpinned\n // This allows single-resource mode to work while preserving tab data for nav highlighting\n let updatedTabs: typeof config.tabs;\n if (wouldBeLastTab) {\n // Keep the tab but ensure it's unpinned (triggers single-resource mode)\n updatedTabs = config.tabs.map(tab =>\n tab.id === tabId ? { ...tab, isPinned: false } : tab\n );\n } else {\n // Normal case: remove the tab from array\n updatedTabs = config.tabs.filter(tab => tab.id !== tabId);\n }\n\n // Update active tab if needed\n let activeTabId = config.activeTabId;\n if (activeTabId === tabId && !wouldBeLastTab) {\n // Find next tab to activate (only when not keeping the last tab)\n const closedIndex = config.tabs.findIndex(tab => tab.id === tabId);\n const nextTab = updatedTabs[closedIndex] || updatedTabs[closedIndex - 1];\n activeTabId = nextTab?.id || null;\n }\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId\n });\n }\n\n /**\n * Close all tabs except the specified one\n */\n CloseOtherTabs(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n // Keep only the specified tab\n const updatedTabs = config.tabs.filter(tab => tab.id === tabId);\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId: tabId\n });\n }\n\n /**\n * Close all tabs to the right of the specified tab\n */\n CloseTabsToRight(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n const tabIndex = config.tabs.findIndex(tab => tab.id === tabId);\n if (tabIndex === -1) return;\n\n // Keep only tabs up to and including the specified tab\n const updatedTabs = config.tabs.slice(0, tabIndex + 1);\n\n // Update active tab if it was closed\n let activeTabId = config.activeTabId;\n if (!updatedTabs.find(tab => tab.id === activeTabId)) {\n activeTabId = tabId;\n }\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId\n });\n }\n\n /**\n * Clear the saved layout structure.\n * This is used to recover from corrupted layouts - tabs will be recreated fresh.\n */\n ClearLayout(): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n this.UpdateConfiguration({\n ...config,\n layout: undefined // Clear the layout, tabs will be recreated fresh\n });\n }\n\n /**\n * Toggle pin state of a tab\n */\n TogglePin(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tabId\n ? { ...tab, isPinned: !tab.isPinned }\n : tab\n );\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Set active tab\n */\n SetActiveTab(tabId: string): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n // Update last accessed time\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tabId\n ? { ...tab, lastAccessedAt: new Date().toISOString() }\n : tab\n );\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs,\n activeTabId: tabId\n });\n }\n\n /**\n * Update tab sequences after reorder\n */\n UpdateTabSequences(tabIds: string[]): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n const updatedTabs = config.tabs.map(tab => {\n const newSequence = tabIds.indexOf(tab.id);\n return newSequence >= 0 ? { ...tab, sequence: newSequence } : tab;\n }).sort((a, b) => a.sequence - b.sequence);\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Update layout configuration\n */\n UpdateLayout(layout: WorkspaceConfiguration['layout']): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n this.UpdateConfiguration({\n ...config,\n layout\n });\n }\n\n /**\n * Update the RECORDS region layout (the separate Golden Layout hosting\n * record tabs under the records-style record-open model).\n */\n UpdateRecordsLayout(recordsLayout: WorkspaceConfiguration['recordsLayout']): void {\n const config = this.configuration$.value;\n if (!config) return;\n\n this.UpdateConfiguration({\n ...config,\n recordsLayout\n });\n }\n\n /**\n * Get tab by ID\n */\n GetTab(tabId: string): WorkspaceTab | undefined {\n return this.configuration$.value?.tabs.find(tab => tab.id === tabId);\n }\n\n /**\n * Get tabs for a specific application\n */\n GetAppTabs(appId: string): WorkspaceTab[] {\n return this.configuration$.value?.tabs.filter(tab => tab.applicationId === appId) || [];\n }\n\n /**\n * Update the title of a specific tab\n */\n UpdateTabTitle(tabId: string, newTitle: string): void {\n const config = this.configuration$.value;\n if (!config) {\n return;\n }\n\n const updatedTabs = config.tabs.map(tab =>\n tab.id === tabId ? { ...tab, title: newTitle } : tab\n );\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Update the configuration of a specific tab.\n * Merges the provided partial configuration with the existing tab configuration.\n * @param tabId The ID of the tab to update\n * @param configUpdate Partial configuration to merge with existing configuration\n */\n UpdateTabConfiguration(tabId: string, configUpdate: Partial<WorkspaceTab['configuration']>): void {\n const config = this.configuration$.value;\n if (!config) {\n return;\n }\n\n const updatedTabs = config.tabs.map(tab => {\n if (tab.id === tabId) {\n return {\n ...tab,\n configuration: {\n ...tab.configuration,\n ...configUpdate\n }\n };\n }\n return tab;\n });\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Update a tab's top-level `resourceRecordId` (and mirror it into `configuration.recordId`).\n *\n * Used when a \"new record\" tab transitions to a saved record — the tab was opened with\n * an empty recordId, but once the user saves, the tab now represents an actual record.\n * Without this, the next \"Create New Record\" request would match this tab (both have\n * empty `resourceRecordId`) and focus the stale form instead of opening a fresh one.\n *\n * Also clears `configuration.isNew` since the record now exists.\n */\n UpdateTabResourceRecordId(tabId: string, newRecordId: string): void {\n const config = this.configuration$.value;\n if (!config) {\n return;\n }\n\n const updatedTabs = config.tabs.map(tab => {\n if (tab.id === tabId) {\n const { isNew: _isNew, ...restConfig } = tab.configuration;\n return {\n ...tab,\n resourceRecordId: newRecordId,\n configuration: {\n ...restConfig,\n recordId: newRecordId\n }\n };\n }\n return tab;\n });\n\n this.UpdateConfiguration({\n ...config,\n tabs: updatedTabs\n });\n }\n\n /**\n * Get the ID of the currently active tab\n */\n GetActiveTabId(): string | null {\n return this.configuration$.value?.activeTabId ?? null;\n }\n\n /**\n * Generate UUID for new tabs\n */\n private generateUUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n}\n"]}
@@ -8,6 +8,7 @@ export * from './lib/base-application';
8
8
  export * from './lib/application-manager';
9
9
  export * from './lib/workspace-state-manager';
10
10
  export * from './lib/golden-layout-manager';
11
+ export * from './lib/layout-transforms';
11
12
  export * from './lib/tab.service';
12
13
  export * from './lib/interfaces/nav-item.interface';
13
14
  export * from './lib/interfaces/tab-request.interface';
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAGlC,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC"}
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC"}
@@ -9,6 +9,7 @@ export * from './lib/base-application';
9
9
  export * from './lib/application-manager';
10
10
  export * from './lib/workspace-state-manager';
11
11
  export * from './lib/golden-layout-manager';
12
+ export * from './lib/layout-transforms';
12
13
  export * from './lib/tab.service';
13
14
  // Interfaces
14
15
  export * from './lib/interfaces/nav-item.interface';
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe;AACf,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAElC,aAAa;AACb,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC","sourcesContent":["/**\n * @memberjunction/ng-base-application\n *\n * BaseApplication class system for app-centric navigation in MemberJunction Explorer.\n * Provides extensible application classes, workspace configuration types, and state management.\n */\n\n// Core classes\nexport * from './lib/base-application';\nexport * from './lib/application-manager';\nexport * from './lib/workspace-state-manager';\nexport * from './lib/golden-layout-manager';\nexport * from './lib/tab.service';\n\n// Interfaces\nexport * from './lib/interfaces/nav-item.interface';\nexport * from './lib/interfaces/tab-request.interface';\nexport * from './lib/interfaces/workspace-configuration.interface';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe;AACf,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAElC,aAAa;AACb,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC","sourcesContent":["/**\n * @memberjunction/ng-base-application\n *\n * BaseApplication class system for app-centric navigation in MemberJunction Explorer.\n * Provides extensible application classes, workspace configuration types, and state management.\n */\n\n// Core classes\nexport * from './lib/base-application';\nexport * from './lib/application-manager';\nexport * from './lib/workspace-state-manager';\nexport * from './lib/golden-layout-manager';\nexport * from './lib/layout-transforms';\nexport * from './lib/tab.service';\n\n// Interfaces\nexport * from './lib/interfaces/nav-item.interface';\nexport * from './lib/interfaces/tab-request.interface';\nexport * from './lib/interfaces/workspace-configuration.interface';\n"]}
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-base-application",
3
- "version": "5.51.0",
3
+ "version": "6.1.0-edge.0",
4
4
  "description": "MemberJunction Explorer: BaseApplication class system for app-centric navigation",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
7
7
  "files": [
8
8
  "/dist"
9
9
  ],
10
- "scripts": {
11
- "test": "vitest run",
12
- "build": "ngc",
13
- "watch": "ngc -w"
14
- },
15
10
  "keywords": [
16
11
  "memberjunction",
17
12
  "angular",
@@ -30,9 +25,9 @@
30
25
  "@angular/core": "21.1.3"
31
26
  },
32
27
  "dependencies": {
33
- "@memberjunction/global": "5.51.0",
34
- "@memberjunction/core": "5.51.0",
35
- "@memberjunction/core-entities": "5.51.0",
28
+ "@memberjunction/global": "6.1.0-edge.0",
29
+ "@memberjunction/core": "6.1.0-edge.0",
30
+ "@memberjunction/core-entities": "6.1.0-edge.0",
36
31
  "golden-layout": "^2.6.0",
37
32
  "rxjs": "~7.8.2",
38
33
  "tslib": "^2.8.1"
@@ -41,5 +36,11 @@
41
36
  "repository": {
42
37
  "type": "git",
43
38
  "url": "https://github.com/MemberJunction/MJ"
39
+ },
40
+ "mjUILayer": "surface",
41
+ "scripts": {
42
+ "test": "vitest run",
43
+ "build": "ngc",
44
+ "watch": "ngc -w"
44
45
  }
45
- }
46
+ }