@memberjunction/ng-dashboards 5.32.0 → 5.34.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.
- package/dist/AI/components/agents/agent-editor.component.js +2 -2
- package/dist/AI/components/agents/agent-editor.component.js.map +1 -1
- package/dist/Admin/admin-data-schema.component.d.ts +16 -0
- package/dist/Admin/admin-data-schema.component.d.ts.map +1 -0
- package/dist/Admin/admin-data-schema.component.js +136 -0
- package/dist/Admin/admin-data-schema.component.js.map +1 -0
- package/dist/Admin/admin-dev-tools-resource.component.d.ts +14 -0
- package/dist/Admin/admin-dev-tools-resource.component.d.ts.map +1 -0
- package/dist/Admin/admin-dev-tools-resource.component.js +162 -0
- package/dist/Admin/admin-dev-tools-resource.component.js.map +1 -0
- package/dist/Admin/admin-identity-access.component.d.ts +15 -0
- package/dist/Admin/admin-identity-access.component.d.ts.map +1 -0
- package/dist/Admin/admin-identity-access.component.js +156 -0
- package/dist/Admin/admin-identity-access.component.js.map +1 -0
- package/dist/Admin/admin-monitoring.component.d.ts +15 -0
- package/dist/Admin/admin-monitoring.component.d.ts.map +1 -0
- package/dist/Admin/admin-monitoring.component.js +130 -0
- package/dist/Admin/admin-monitoring.component.js.map +1 -0
- package/dist/Admin/base-admin-container.component.d.ts +80 -0
- package/dist/Admin/base-admin-container.component.d.ts.map +1 -0
- package/dist/Admin/base-admin-container.component.js +198 -0
- package/dist/Admin/base-admin-container.component.js.map +1 -0
- package/dist/Admin/index.d.ts +6 -0
- package/dist/Admin/index.d.ts.map +1 -0
- package/dist/Admin/index.js +6 -0
- package/dist/Admin/index.js.map +1 -0
- package/dist/ComponentStudio/components/workspace/component-preview.component.js +1 -1
- package/dist/ComponentStudio/components/workspace/component-preview.component.js.map +1 -1
- package/dist/ComponentStudio/services/component-studio-state.service.d.ts +28 -8
- package/dist/ComponentStudio/services/component-studio-state.service.d.ts.map +1 -1
- package/dist/ComponentStudio/services/component-studio-state.service.js +45 -27
- package/dist/ComponentStudio/services/component-studio-state.service.js.map +1 -1
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.d.ts +18 -3
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.d.ts.map +1 -1
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.js +51 -11
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.js.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.js +2 -2
- package/dist/DataExplorer/data-explorer-dashboard.component.js.map +1 -1
- package/dist/DevTools/app-state-inspector.component.d.ts +53 -0
- package/dist/DevTools/app-state-inspector.component.d.ts.map +1 -0
- package/dist/DevTools/app-state-inspector.component.js +301 -0
- package/dist/DevTools/app-state-inspector.component.js.map +1 -0
- package/dist/DevTools/class-registry.component.d.ts +64 -0
- package/dist/DevTools/class-registry.component.d.ts.map +1 -0
- package/dist/DevTools/class-registry.component.js +423 -0
- package/dist/DevTools/class-registry.component.js.map +1 -0
- package/dist/DevTools/dev-tools-prefs.d.ts +21 -0
- package/dist/DevTools/dev-tools-prefs.d.ts.map +1 -0
- package/dist/DevTools/dev-tools-prefs.js +48 -0
- package/dist/DevTools/dev-tools-prefs.js.map +1 -0
- package/dist/DevTools/event-monitor.component.d.ts +78 -0
- package/dist/DevTools/event-monitor.component.d.ts.map +1 -0
- package/dist/DevTools/event-monitor.component.js +659 -0
- package/dist/DevTools/event-monitor.component.js.map +1 -0
- package/dist/DevTools/graphql-console.component.d.ts +153 -0
- package/dist/DevTools/graphql-console.component.d.ts.map +1 -0
- package/dist/DevTools/graphql-console.component.js +1463 -0
- package/dist/DevTools/graphql-console.component.js.map +1 -0
- package/dist/DevTools/index.d.ts +8 -0
- package/dist/DevTools/index.d.ts.map +1 -0
- package/dist/DevTools/index.js +8 -0
- package/dist/DevTools/index.js.map +1 -0
- package/dist/DevTools/layout-inspector.component.d.ts +42 -0
- package/dist/DevTools/layout-inspector.component.d.ts.map +1 -0
- package/dist/DevTools/layout-inspector.component.js +208 -0
- package/dist/DevTools/layout-inspector.component.js.map +1 -0
- package/dist/DevTools/lazy-module-status.component.d.ts +65 -0
- package/dist/DevTools/lazy-module-status.component.d.ts.map +1 -0
- package/dist/DevTools/lazy-module-status.component.js +388 -0
- package/dist/DevTools/lazy-module-status.component.js.map +1 -0
- package/dist/DevTools/settings-explorer.component.d.ts +55 -0
- package/dist/DevTools/settings-explorer.component.d.ts.map +1 -0
- package/dist/DevTools/settings-explorer.component.js +394 -0
- package/dist/DevTools/settings-explorer.component.js.map +1 -0
- package/dist/Integration/components/widgets/integration-card.component.js +2 -2
- package/dist/Integration/components/widgets/integration-card.component.js.map +1 -1
- package/dist/Integration/components/widgets/run-history-panel.component.js +2 -2
- package/dist/Integration/components/widgets/run-history-panel.component.js.map +1 -1
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.d.ts +134 -1
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.d.ts.map +1 -1
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.js +1227 -24
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.js.map +1 -1
- package/dist/SystemDiagnostics/system-diagnostics.component.js +4 -4
- package/dist/SystemDiagnostics/system-diagnostics.component.js.map +1 -1
- package/dist/Testing/components/testing-runs.component.js +3 -3
- package/dist/Testing/components/testing-runs.component.js.map +1 -1
- package/dist/core-dashboards.module.d.ts +45 -34
- package/dist/core-dashboards.module.d.ts.map +1 -1
- package/dist/core-dashboards.module.js +57 -0
- package/dist/core-dashboards.module.js.map +1 -1
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +52 -52
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-monitoring.component.js","sourceRoot":"","sources":["../../src/Admin/admin-monitoring.component.ts","../../src/Admin/admin-container.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,C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AE,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE;SAC9D;KACJ,CAAC;6QAtBO,wBAAwB,yBAAxB,wBAAwB;6DAAxB,wBAAwB;YCd7B,AADJ,AADJ,8BAA6B,gBACe,aACM;YAAA,oBAA+B;YAAA,iBAAM;YAE3E,AADJ,2BAAK,YACyC;YAAA,YAAoB;YAAA,iBAAK;YACnE,8BAAyC;YAAA,YAAuB;YAExE,AADI,AADoE,iBAAM,EACpE,EACD;YAGL,AADJ,8BAAmC,gBACK;YAChC,gGAaC;YACL,iBAAQ;YAER,gCAAuC;YAMjC,AALF,6FAAiB,uEAKO;YAMxB,gCAAkG;YAC9F,kCAA0C;YAI1D,AADI,AADI,AADI,iBAAM,EACH,EACL,EACJ;;YA1C+C,eAAuB;YAAvB,gCAAuB;YAEtB,eAAoB;YAApB,wCAAoB;YACrB,eAAuB;YAAvB,2CAAuB;YAMhE,eAaC;YAbD,2BAaC;YAID,eAUC;YAVD,8DAUC;YACkC,eAA8D;YAA9D,+EAA8D;;;ADvBhG,wBAAwB;IAPpC,aAAa,CAAC,qBAAqB,EAAE,iBAAiB,CAAC;GAO3C,wBAAwB,CAuBpC;;iFAvBY,wBAAwB;cANpC,SAAS;6BACM,KAAK,YACP,qBAAqB;;kFAItB,wBAAwB","sourcesContent":["import { Component } from '@angular/core';\nimport { BaseResourceComponent } from '@memberjunction/ng-shared';\nimport { RegisterClass } from '@memberjunction/global';\nimport { AdminSection, BaseAdminContainerComponent } from './base-admin-container.component';\n\n/**\n * Admin → Monitoring. System health, SQL execution logs, and outbound\n * communication delivery monitoring.\n */\n@RegisterClass(BaseResourceComponent, 'AdminMonitoring')\n@Component({\n standalone: false,\n selector: 'mj-admin-monitoring',\n templateUrl: './admin-container.component.html',\n styleUrls: ['./admin-container.component.css']\n})\nexport class AdminMonitoringComponent extends BaseAdminContainerComponent {\n public readonly ContainerTitle = 'Monitoring';\n public readonly ContainerIcon = 'fa-solid fa-stethoscope';\n public readonly ContainerSubtitle = 'System health and query execution logs';\n\n // Communication Monitor intentionally NOT included here — outbound delivery\n // monitoring belongs in the Communications app, not in the Admin app.\n public readonly Sections: AdminSection[] = [\n {\n id: 'diagnostics',\n label: 'Diagnostics',\n icon: 'fa-solid fa-stethoscope',\n description: 'Runtime health and connectivity',\n source: { kind: 'resource', driverClass: 'SystemDiagnosticsResource' }\n },\n {\n id: 'sql-logging',\n label: 'SQL Logging',\n icon: 'fa-solid fa-file-code',\n description: 'Captured SQL execution logs',\n source: { kind: 'dashboard', dashboardName: 'SQL Logging' }\n }\n ];\n}\n","<div class=\"admin-container\">\n <header class=\"admin-container__header\">\n <div class=\"admin-container__header-icon\"><i [class]=\"ContainerIcon\"></i></div>\n <div>\n <h3 class=\"admin-container__header-title\">{{ ContainerTitle }}</h3>\n <div class=\"admin-container__header-sub\">{{ ContainerSubtitle }}</div>\n </div>\n </header>\n\n <div class=\"admin-container__body\">\n <aside class=\"admin-container__nav\">\n @for (section of Sections; track section.id) {\n <button type=\"button\"\n class=\"admin-container__nav-item\"\n [class.admin-container__nav-item--active]=\"ActiveSection === section.id\"\n (click)=\"OnSectionClick(section)\">\n <i class=\"admin-container__nav-icon\" [class]=\"section.icon\"></i>\n <div class=\"admin-container__nav-text\">\n <div class=\"admin-container__nav-label\">{{ section.label }}</div>\n @if (section.description) {\n <div class=\"admin-container__nav-desc\">{{ section.description }}</div>\n }\n </div>\n </button>\n }\n </aside>\n\n <main class=\"admin-container__content\">\n @if (LoadError) {\n <div class=\"admin-container__error\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n <span>{{ LoadError }}</span>\n </div>\n } @else if (IsLoading) {\n <div class=\"admin-container__loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading…</span>\n </div>\n }\n <div class=\"admin-container__host\" [class.admin-container__host--hidden]=\"LoadError || IsLoading\">\n <ng-container #contentHost></ng-container>\n </div>\n </main>\n </div>\n</div>\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { OnInit, OnDestroy, ChangeDetectorRef, ViewContainerRef, ComponentRef } from '@angular/core';
|
|
2
|
+
import { BaseResourceComponent } from '@memberjunction/ng-shared';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** A single sub-section inside an admin container's left-nav. */
|
|
5
|
+
export interface AdminSection {
|
|
6
|
+
/** Stable identifier — used in the URL `?section=` deep-link. */
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
description: string;
|
|
11
|
+
source: AdminSectionSource;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* How to resolve and instantiate the component for this sub-section.
|
|
15
|
+
*
|
|
16
|
+
* - `resource`: looks up `@RegisterClass(BaseResourceComponent, driverClass)` and renders it directly.
|
|
17
|
+
* - `dashboard`: looks up the MJ Dashboard record by name, then renders its `DriverClass` via the
|
|
18
|
+
* BaseDashboard registry with a synthetic `{ dashboard }` config (mirrors the shell's flow for
|
|
19
|
+
* `ResourceType: "Dashboards"` nav items).
|
|
20
|
+
*/
|
|
21
|
+
export type AdminSectionSource = {
|
|
22
|
+
kind: 'resource';
|
|
23
|
+
driverClass: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'dashboard';
|
|
26
|
+
dashboardName: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Shared base for all Admin app container resources. Subclasses declare:
|
|
30
|
+
* - ContainerTitle / ContainerIcon / ContainerSubtitle
|
|
31
|
+
* - Sections[]
|
|
32
|
+
* - @RegisterClass(BaseResourceComponent, '...')
|
|
33
|
+
*
|
|
34
|
+
* The base handles: left-nav state, URL deep-linking via NavigationService,
|
|
35
|
+
* dynamic component instantiation for both resource and dashboard sections,
|
|
36
|
+
* teardown on switch.
|
|
37
|
+
*/
|
|
38
|
+
export declare abstract class BaseAdminContainerComponent extends BaseResourceComponent implements OnInit, OnDestroy {
|
|
39
|
+
abstract readonly ContainerTitle: string;
|
|
40
|
+
abstract readonly ContainerIcon: string;
|
|
41
|
+
abstract readonly ContainerSubtitle: string;
|
|
42
|
+
abstract readonly Sections: AdminSection[];
|
|
43
|
+
protected contentHost: ViewContainerRef;
|
|
44
|
+
ActiveSection: string;
|
|
45
|
+
LoadError: string | null;
|
|
46
|
+
IsLoading: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Cache of section.id → ComponentRef. Once a sub-section is rendered we
|
|
49
|
+
* keep its component alive across switches by detaching + reattaching the
|
|
50
|
+
* view (instead of destroying + recreating). This preserves state — Event
|
|
51
|
+
* Monitor's captured events, GraphQL Console's history, query inputs,
|
|
52
|
+
* scroll position, etc. — and avoids expensive re-init.
|
|
53
|
+
*/
|
|
54
|
+
protected cache: Map<string, ComponentRef<unknown>>;
|
|
55
|
+
protected currentSectionId: string | null;
|
|
56
|
+
protected readonly cdr: ChangeDetectorRef;
|
|
57
|
+
ngOnInit(): Promise<void>;
|
|
58
|
+
ngOnDestroy(): void;
|
|
59
|
+
GetResourceDisplayName(): Promise<string>;
|
|
60
|
+
GetResourceIconClass(): Promise<string>;
|
|
61
|
+
/** Called by the framework on browser back/forward + deep-link entry. */
|
|
62
|
+
protected OnQueryParamsChanged(params: Record<string, string>, _source: 'popstate' | 'deeplink'): void;
|
|
63
|
+
OnSectionClick(section: AdminSection): Promise<void>;
|
|
64
|
+
private selectSection;
|
|
65
|
+
private renderSection;
|
|
66
|
+
private detachCurrent;
|
|
67
|
+
private createResourceRef;
|
|
68
|
+
private createDashboardRef;
|
|
69
|
+
/**
|
|
70
|
+
* Force the rendered sub-component's host element to fill the container
|
|
71
|
+
* cell. Mirrors what `tab-container` does for top-level resources — many
|
|
72
|
+
* dashboards rely on inline `height: 100%` to bound their internal layout
|
|
73
|
+
* (so their own `overflow-y: auto` regions actually scroll).
|
|
74
|
+
*/
|
|
75
|
+
private applyHostSizing;
|
|
76
|
+
private findSection;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseAdminContainerComponent, never>;
|
|
78
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseAdminContainerComponent, never, never, {}, {}, never, never, true, never>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=base-admin-container.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-admin-container.component.d.ts","sourceRoot":"","sources":["../../src/Admin/base-admin-container.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,MAAM,EACN,SAAS,EACT,iBAAiB,EAEjB,gBAAgB,EAChB,YAAY,EAGf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAiB,MAAM,2BAA2B,CAAC;;AAIjF,iEAAiE;AACjE,MAAM,WAAW,YAAY;IACzB,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GACxB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD;;;;;;;;;GASG;AACH,8BACsB,2BAA4B,SAAQ,qBAAsB,YAAW,MAAM,EAAE,SAAS;IACxG,kBAAyB,cAAc,EAAE,MAAM,CAAC;IAChD,kBAAyB,aAAa,EAAE,MAAM,CAAC;IAC/C,kBAAyB,iBAAiB,EAAE,MAAM,CAAC;IACnD,kBAAyB,QAAQ,EAAE,YAAY,EAAE,CAAC;IAGlD,SAAS,CAAC,WAAW,EAAG,gBAAgB,CAAC;IAElC,aAAa,SAAM;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,SAAS,UAAS;IAEzB;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,qCAA4C;IAC3D,SAAS,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjD,SAAS,CAAC,QAAQ,CAAC,GAAG,oBAA6B;IAE7B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB/B,WAAW,IAAI,IAAI;IASb,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IACzC,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;IAE7D,yEAAyE;cACtD,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IASlG,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;YAOnD,aAAa;YAoBb,aAAa;IAyB3B,OAAO,CAAC,aAAa;YAQP,iBAAiB;YAYjB,kBAAkB;IA2BhC;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,WAAW;yCApLD,2BAA2B;2CAA3B,2BAA2B;CAwLhD"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Directive, ChangeDetectorRef, ViewChild, ViewContainerRef, inject } from '@angular/core';
|
|
2
|
+
import { BaseResourceComponent, BaseDashboard } from '@memberjunction/ng-shared';
|
|
3
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
4
|
+
import { DashboardEngine } from '@memberjunction/core-entities';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
const _c0 = ["contentHost"];
|
|
7
|
+
/**
|
|
8
|
+
* Shared base for all Admin app container resources. Subclasses declare:
|
|
9
|
+
* - ContainerTitle / ContainerIcon / ContainerSubtitle
|
|
10
|
+
* - Sections[]
|
|
11
|
+
* - @RegisterClass(BaseResourceComponent, '...')
|
|
12
|
+
*
|
|
13
|
+
* The base handles: left-nav state, URL deep-linking via NavigationService,
|
|
14
|
+
* dynamic component instantiation for both resource and dashboard sections,
|
|
15
|
+
* teardown on switch.
|
|
16
|
+
*/
|
|
17
|
+
export class BaseAdminContainerComponent extends BaseResourceComponent {
|
|
18
|
+
contentHost;
|
|
19
|
+
ActiveSection = '';
|
|
20
|
+
LoadError = null;
|
|
21
|
+
IsLoading = false;
|
|
22
|
+
/**
|
|
23
|
+
* Cache of section.id → ComponentRef. Once a sub-section is rendered we
|
|
24
|
+
* keep its component alive across switches by detaching + reattaching the
|
|
25
|
+
* view (instead of destroying + recreating). This preserves state — Event
|
|
26
|
+
* Monitor's captured events, GraphQL Console's history, query inputs,
|
|
27
|
+
* scroll position, etc. — and avoids expensive re-init.
|
|
28
|
+
*/
|
|
29
|
+
cache = new Map();
|
|
30
|
+
currentSectionId = null;
|
|
31
|
+
cdr = inject(ChangeDetectorRef);
|
|
32
|
+
async ngOnInit() {
|
|
33
|
+
super.ngOnInit();
|
|
34
|
+
const params = this.GetQueryParams();
|
|
35
|
+
const requested = params['section'];
|
|
36
|
+
const initial = this.findSection(requested)?.id ?? this.Sections[0]?.id ?? '';
|
|
37
|
+
const target = this.findSection(initial);
|
|
38
|
+
if (target) {
|
|
39
|
+
await this.selectSection(target, /*syncUrl*/ false);
|
|
40
|
+
}
|
|
41
|
+
if (!requested && this.ActiveSection) {
|
|
42
|
+
this.UpdateQueryParams({ section: this.ActiveSection });
|
|
43
|
+
}
|
|
44
|
+
this.NotifyLoadComplete();
|
|
45
|
+
}
|
|
46
|
+
ngOnDestroy() {
|
|
47
|
+
for (const ref of this.cache.values()) {
|
|
48
|
+
try {
|
|
49
|
+
ref.destroy();
|
|
50
|
+
}
|
|
51
|
+
catch { /* ignore */ }
|
|
52
|
+
}
|
|
53
|
+
this.cache.clear();
|
|
54
|
+
this.currentSectionId = null;
|
|
55
|
+
super.ngOnDestroy();
|
|
56
|
+
}
|
|
57
|
+
async GetResourceDisplayName() { return this.ContainerTitle; }
|
|
58
|
+
async GetResourceIconClass() { return this.ContainerIcon; }
|
|
59
|
+
/** Called by the framework on browser back/forward + deep-link entry. */
|
|
60
|
+
OnQueryParamsChanged(params, _source) {
|
|
61
|
+
const section = params['section'];
|
|
62
|
+
if (!section || section === this.ActiveSection)
|
|
63
|
+
return;
|
|
64
|
+
const target = this.findSection(section);
|
|
65
|
+
if (target) {
|
|
66
|
+
void this.selectSection(target, /*syncUrl*/ false);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async OnSectionClick(section) {
|
|
70
|
+
if (section.id === this.ActiveSection)
|
|
71
|
+
return;
|
|
72
|
+
await this.selectSection(section, /*syncUrl*/ true);
|
|
73
|
+
}
|
|
74
|
+
// ---------- protected ----------
|
|
75
|
+
async selectSection(section, syncUrl) {
|
|
76
|
+
this.ActiveSection = section.id;
|
|
77
|
+
this.IsLoading = true;
|
|
78
|
+
this.LoadError = null;
|
|
79
|
+
this.cdr.markForCheck();
|
|
80
|
+
if (syncUrl) {
|
|
81
|
+
this.UpdateQueryParams({ section: section.id });
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
await this.renderSection(section);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
this.LoadError = err instanceof Error ? err.message : String(err);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
this.IsLoading = false;
|
|
91
|
+
this.cdr.markForCheck();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async renderSection(section) {
|
|
95
|
+
// Detach (don't destroy) the currently visible sub-component so it
|
|
96
|
+
// stays alive in memory with its state intact.
|
|
97
|
+
this.detachCurrent();
|
|
98
|
+
// Reattach if cached
|
|
99
|
+
const cached = this.cache.get(section.id);
|
|
100
|
+
if (cached) {
|
|
101
|
+
this.contentHost.insert(cached.hostView);
|
|
102
|
+
this.currentSectionId = section.id;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// Otherwise, create fresh
|
|
106
|
+
const ref = section.source.kind === 'resource'
|
|
107
|
+
? await this.createResourceRef(section.source.driverClass)
|
|
108
|
+
: await this.createDashboardRef(section.source.dashboardName);
|
|
109
|
+
if (ref) {
|
|
110
|
+
this.applyHostSizing(ref);
|
|
111
|
+
this.cache.set(section.id, ref);
|
|
112
|
+
this.currentSectionId = section.id;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
detachCurrent() {
|
|
116
|
+
if (!this.currentSectionId)
|
|
117
|
+
return;
|
|
118
|
+
const cur = this.cache.get(this.currentSectionId);
|
|
119
|
+
if (!cur)
|
|
120
|
+
return;
|
|
121
|
+
const idx = this.contentHost.indexOf(cur.hostView);
|
|
122
|
+
if (idx >= 0)
|
|
123
|
+
this.contentHost.detach(idx);
|
|
124
|
+
}
|
|
125
|
+
async createResourceRef(driverClass) {
|
|
126
|
+
const reg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(BaseResourceComponent, driverClass);
|
|
127
|
+
if (!reg) {
|
|
128
|
+
this.LoadError = `Component "${driverClass}" is not registered. Make sure its module is imported.`;
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const ref = this.contentHost.createComponent(reg.SubClass);
|
|
132
|
+
const instance = ref.instance;
|
|
133
|
+
if (this.Data)
|
|
134
|
+
instance.Data = this.Data;
|
|
135
|
+
return ref;
|
|
136
|
+
}
|
|
137
|
+
async createDashboardRef(dashboardName) {
|
|
138
|
+
await DashboardEngine.Instance.Config(false);
|
|
139
|
+
const dashboard = DashboardEngine.Instance.Dashboards.find(d => d.Name === dashboardName);
|
|
140
|
+
if (!dashboard) {
|
|
141
|
+
this.LoadError = `Dashboard "${dashboardName}" was not found in metadata.`;
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
if (dashboard.Type !== 'Code') {
|
|
145
|
+
this.LoadError = `Dashboard "${dashboardName}" has type "${dashboard.Type}" — only Code dashboards can be embedded here.`;
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
if (!dashboard.DriverClass) {
|
|
149
|
+
this.LoadError = `Dashboard "${dashboardName}" has no DriverClass set.`;
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
const reg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(BaseDashboard, dashboard.DriverClass);
|
|
153
|
+
if (!reg) {
|
|
154
|
+
this.LoadError = `Driver class "${dashboard.DriverClass}" is not registered against BaseDashboard.`;
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
const ref = this.contentHost.createComponent(reg.SubClass);
|
|
158
|
+
const instance = ref.instance;
|
|
159
|
+
instance.Config = { dashboard, userState: undefined };
|
|
160
|
+
instance.Refresh();
|
|
161
|
+
return ref;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Force the rendered sub-component's host element to fill the container
|
|
165
|
+
* cell. Mirrors what `tab-container` does for top-level resources — many
|
|
166
|
+
* dashboards rely on inline `height: 100%` to bound their internal layout
|
|
167
|
+
* (so their own `overflow-y: auto` regions actually scroll).
|
|
168
|
+
*/
|
|
169
|
+
applyHostSizing(ref) {
|
|
170
|
+
const hostEl = ref.hostView.rootNodes[0];
|
|
171
|
+
if (!hostEl || !(hostEl instanceof HTMLElement))
|
|
172
|
+
return;
|
|
173
|
+
hostEl.style.height = '100%';
|
|
174
|
+
hostEl.style.minHeight = '0';
|
|
175
|
+
hostEl.style.display = 'flex';
|
|
176
|
+
hostEl.style.flexDirection = 'column';
|
|
177
|
+
hostEl.style.flex = '1 1 auto';
|
|
178
|
+
}
|
|
179
|
+
findSection(id) {
|
|
180
|
+
if (!id)
|
|
181
|
+
return undefined;
|
|
182
|
+
return this.Sections.find(s => s.id === id);
|
|
183
|
+
}
|
|
184
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵBaseAdminContainerComponent_BaseFactory; return function BaseAdminContainerComponent_Factory(__ngFactoryType__) { return (ɵBaseAdminContainerComponent_BaseFactory || (ɵBaseAdminContainerComponent_BaseFactory = i0.ɵɵgetInheritedFactory(BaseAdminContainerComponent)))(__ngFactoryType__ || BaseAdminContainerComponent); }; })();
|
|
185
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: BaseAdminContainerComponent, viewQuery: function BaseAdminContainerComponent_Query(rf, ctx) { if (rf & 1) {
|
|
186
|
+
i0.ɵɵviewQuery(_c0, 7, ViewContainerRef);
|
|
187
|
+
} if (rf & 2) {
|
|
188
|
+
let _t;
|
|
189
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.contentHost = _t.first);
|
|
190
|
+
} }, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
191
|
+
}
|
|
192
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseAdminContainerComponent, [{
|
|
193
|
+
type: Directive
|
|
194
|
+
}], null, { contentHost: [{
|
|
195
|
+
type: ViewChild,
|
|
196
|
+
args: ['contentHost', { read: ViewContainerRef, static: true }]
|
|
197
|
+
}] }); })();
|
|
198
|
+
//# sourceMappingURL=base-admin-container.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-admin-container.component.js","sourceRoot":"","sources":["../../src/Admin/base-admin-container.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAGT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAGhB,MAAM,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;;;AAwBhE;;;;;;;;;GASG;AAEH,MAAM,OAAgB,2BAA4B,SAAQ,qBAAqB;IAOjE,WAAW,CAAoB;IAElC,aAAa,GAAG,EAAE,CAAC;IACnB,SAAS,GAAkB,IAAI,CAAC;IAChC,SAAS,GAAG,KAAK,CAAC;IAEzB;;;;;;OAMG;IACO,KAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;IACjD,gBAAgB,GAAkB,IAAI,CA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,CAAC;IACnC,CAAC;IAEO,WAAW,CAAC,EAA6B;QAC7C,IAAI,CAAC,EAAE;YAAE,OAAO,SAAS,CAAC;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;yRAvLiB,2BAA2B,yBAA3B,2BAA2B;6DAA3B,2BAA2B;mCAMX,gBAAgB;;;;;;iFANhC,2BAA2B;cADhD,SAAS;;kBAOL,SAAS;mBAAC,aAAa,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE","sourcesContent":["import {\n Directive,\n OnInit,\n OnDestroy,\n ChangeDetectorRef,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n Type,\n inject\n} from '@angular/core';\nimport { BaseResourceComponent, BaseDashboard } from '@memberjunction/ng-shared';\nimport { MJGlobal } from '@memberjunction/global';\nimport { DashboardEngine } from '@memberjunction/core-entities';\n\n/** A single sub-section inside an admin container's left-nav. */\nexport interface AdminSection {\n /** Stable identifier — used in the URL `?section=` deep-link. */\n id: string;\n label: string;\n icon: string;\n description: string;\n source: AdminSectionSource;\n}\n\n/**\n * How to resolve and instantiate the component for this sub-section.\n *\n * - `resource`: looks up `@RegisterClass(BaseResourceComponent, driverClass)` and renders it directly.\n * - `dashboard`: looks up the MJ Dashboard record by name, then renders its `DriverClass` via the\n * BaseDashboard registry with a synthetic `{ dashboard }` config (mirrors the shell's flow for\n * `ResourceType: \"Dashboards\"` nav items).\n */\nexport type AdminSectionSource =\n | { kind: 'resource'; driverClass: string }\n | { kind: 'dashboard'; dashboardName: string };\n\n/**\n * Shared base for all Admin app container resources. Subclasses declare:\n * - ContainerTitle / ContainerIcon / ContainerSubtitle\n * - Sections[]\n * - @RegisterClass(BaseResourceComponent, '...')\n *\n * The base handles: left-nav state, URL deep-linking via NavigationService,\n * dynamic component instantiation for both resource and dashboard sections,\n * teardown on switch.\n */\n@Directive()\nexport abstract class BaseAdminContainerComponent extends BaseResourceComponent implements OnInit, OnDestroy {\n public abstract readonly ContainerTitle: string;\n public abstract readonly ContainerIcon: string;\n public abstract readonly ContainerSubtitle: string;\n public abstract readonly Sections: AdminSection[];\n\n @ViewChild('contentHost', { read: ViewContainerRef, static: true })\n protected contentHost!: ViewContainerRef;\n\n public ActiveSection = '';\n public LoadError: string | null = null;\n public IsLoading = false;\n\n /**\n * Cache of section.id → ComponentRef. Once a sub-section is rendered we\n * keep its component alive across switches by detaching + reattaching the\n * view (instead of destroying + recreating). This preserves state — Event\n * Monitor's captured events, GraphQL Console's history, query inputs,\n * scroll position, etc. — and avoids expensive re-init.\n */\n protected cache = new Map<string, ComponentRef<unknown>>();\n protected currentSectionId: string | null = null;\n\n protected readonly cdr = inject(ChangeDetectorRef);\n\n public override async ngOnInit(): Promise<void> {\n super.ngOnInit();\n\n const params = this.GetQueryParams();\n const requested = params['section'];\n const initial = this.findSection(requested)?.id ?? this.Sections[0]?.id ?? '';\n const target = this.findSection(initial);\n if (target) {\n await this.selectSection(target, /*syncUrl*/ false);\n }\n\n if (!requested && this.ActiveSection) {\n this.UpdateQueryParams({ section: this.ActiveSection });\n }\n\n this.NotifyLoadComplete();\n }\n\n public override ngOnDestroy(): void {\n for (const ref of this.cache.values()) {\n try { ref.destroy(); } catch { /* ignore */ }\n }\n this.cache.clear();\n this.currentSectionId = null;\n super.ngOnDestroy();\n }\n\n public override async GetResourceDisplayName(): Promise<string> { return this.ContainerTitle; }\n public override async GetResourceIconClass(): Promise<string> { return this.ContainerIcon; }\n\n /** Called by the framework on browser back/forward + deep-link entry. */\n protected override OnQueryParamsChanged(params: Record<string, string>, _source: 'popstate' | 'deeplink'): void {\n const section = params['section'];\n if (!section || section === this.ActiveSection) return;\n const target = this.findSection(section);\n if (target) {\n void this.selectSection(target, /*syncUrl*/ false);\n }\n }\n\n public async OnSectionClick(section: AdminSection): Promise<void> {\n if (section.id === this.ActiveSection) return;\n await this.selectSection(section, /*syncUrl*/ true);\n }\n\n // ---------- protected ----------\n\n private async selectSection(section: AdminSection, syncUrl: boolean): Promise<void> {\n this.ActiveSection = section.id;\n this.IsLoading = true;\n this.LoadError = null;\n this.cdr.markForCheck();\n\n if (syncUrl) {\n this.UpdateQueryParams({ section: section.id });\n }\n\n try {\n await this.renderSection(section);\n } catch (err) {\n this.LoadError = err instanceof Error ? err.message : String(err);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n private async renderSection(section: AdminSection): Promise<void> {\n // Detach (don't destroy) the currently visible sub-component so it\n // stays alive in memory with its state intact.\n this.detachCurrent();\n\n // Reattach if cached\n const cached = this.cache.get(section.id);\n if (cached) {\n this.contentHost.insert(cached.hostView);\n this.currentSectionId = section.id;\n return;\n }\n\n // Otherwise, create fresh\n const ref = section.source.kind === 'resource'\n ? await this.createResourceRef(section.source.driverClass)\n : await this.createDashboardRef(section.source.dashboardName);\n\n if (ref) {\n this.applyHostSizing(ref);\n this.cache.set(section.id, ref);\n this.currentSectionId = section.id;\n }\n }\n\n private detachCurrent(): void {\n if (!this.currentSectionId) return;\n const cur = this.cache.get(this.currentSectionId);\n if (!cur) return;\n const idx = this.contentHost.indexOf(cur.hostView);\n if (idx >= 0) this.contentHost.detach(idx);\n }\n\n private async createResourceRef(driverClass: string): Promise<ComponentRef<unknown> | null> {\n const reg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(BaseResourceComponent, driverClass);\n if (!reg) {\n this.LoadError = `Component \"${driverClass}\" is not registered. Make sure its module is imported.`;\n return null;\n }\n const ref = this.contentHost.createComponent(reg.SubClass as Type<BaseResourceComponent>);\n const instance = ref.instance as BaseResourceComponent;\n if (this.Data) instance.Data = this.Data;\n return ref;\n }\n\n private async createDashboardRef(dashboardName: string): Promise<ComponentRef<unknown> | null> {\n await DashboardEngine.Instance.Config(false);\n const dashboard = DashboardEngine.Instance.Dashboards.find(d => d.Name === dashboardName);\n if (!dashboard) {\n this.LoadError = `Dashboard \"${dashboardName}\" was not found in metadata.`;\n return null;\n }\n if (dashboard.Type !== 'Code') {\n this.LoadError = `Dashboard \"${dashboardName}\" has type \"${dashboard.Type}\" — only Code dashboards can be embedded here.`;\n return null;\n }\n if (!dashboard.DriverClass) {\n this.LoadError = `Dashboard \"${dashboardName}\" has no DriverClass set.`;\n return null;\n }\n const reg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(BaseDashboard, dashboard.DriverClass);\n if (!reg) {\n this.LoadError = `Driver class \"${dashboard.DriverClass}\" is not registered against BaseDashboard.`;\n return null;\n }\n const ref = this.contentHost.createComponent(reg.SubClass as Type<BaseDashboard>);\n const instance = ref.instance as BaseDashboard;\n instance.Config = { dashboard, userState: undefined };\n instance.Refresh();\n return ref;\n }\n\n /**\n * Force the rendered sub-component's host element to fill the container\n * cell. Mirrors what `tab-container` does for top-level resources — many\n * dashboards rely on inline `height: 100%` to bound their internal layout\n * (so their own `overflow-y: auto` regions actually scroll).\n */\n private applyHostSizing(ref: ComponentRef<unknown>): void {\n const hostEl = (ref.hostView as unknown as { rootNodes: HTMLElement[] }).rootNodes[0];\n if (!hostEl || !(hostEl instanceof HTMLElement)) return;\n hostEl.style.height = '100%';\n hostEl.style.minHeight = '0';\n hostEl.style.display = 'flex';\n hostEl.style.flexDirection = 'column';\n hostEl.style.flex = '1 1 auto';\n }\n\n private findSection(id: string | undefined | null): AdminSection | undefined {\n if (!id) return undefined;\n return this.Sections.find(s => s.id === id);\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './base-admin-container.component';
|
|
2
|
+
export * from './admin-dev-tools-resource.component';
|
|
3
|
+
export * from './admin-identity-access.component';
|
|
4
|
+
export * from './admin-data-schema.component';
|
|
5
|
+
export * from './admin-monitoring.component';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Admin/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './base-admin-container.component';
|
|
2
|
+
export * from './admin-dev-tools-resource.component';
|
|
3
|
+
export * from './admin-identity-access.component';
|
|
4
|
+
export * from './admin-data-schema.component';
|
|
5
|
+
export * from './admin-monitoring.component';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Admin/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './base-admin-container.component';\nexport * from './admin-dev-tools-resource.component';\nexport * from './admin-identity-access.component';\nexport * from './admin-data-schema.component';\nexport * from './admin-monitoring.component';\n"]}
|
|
@@ -289,7 +289,7 @@ export class ComponentPreviewComponent {
|
|
|
289
289
|
refreshPreview() {
|
|
290
290
|
if (!this.State.SelectedComponent)
|
|
291
291
|
return;
|
|
292
|
-
const spec = this.State.
|
|
292
|
+
const spec = this.State.ComponentSpec;
|
|
293
293
|
// Null out to force React to unmount
|
|
294
294
|
this.LocalComponentSpec = null;
|
|
295
295
|
this.cdr.detectChanges();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-preview.component.js","sourceRoot":"","sources":["../../../../src/ComponentStudio/components/workspace/component-preview.component.ts","../../../../src/ComponentStudio/components/workspace/component-preview.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,YAAY,EAGZ,SAAS,EAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,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Init,\n OnDestroy,\n ViewChild,\n ChangeDetectorRef\n} from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport { ReactComponentEvent, MJReactComponent } from '@memberjunction/ng-react';\nimport { CompositeKey } from '@memberjunction/core';\nimport { SharedService } from '@memberjunction/ng-shared';\nimport {\n ComponentStudioStateService,\n ComponentError\n} from '../../services/component-studio-state.service';\n\n/**\n * Viewport size preset for the component preview\n */\nexport type ViewportSize = 'mobile' | 'tablet' | 'desktop';\n\ninterface ViewportPreset {\n Size: ViewportSize;\n Label: string;\n Icon: string;\n MaxWidth: string;\n}\n\n/**\n * Component Preview - TOP section of CENTER panel.\n * Renders the live React component preview with toolbar controls.\n */\n@Component({\n standalone: false,\n selector: 'mj-component-preview',\n templateUrl: './component-preview.component.html',\n styleUrls: ['./component-preview.component.css']\n})\nexport class ComponentPreviewComponent implements OnInit, OnDestroy {\n\n @ViewChild('reactComponent') ReactComponentRef?: MJReactComponent;\n\n @Output() AskAIToFix = new EventEmitter<ComponentError>();\n\n // --- Viewport ---\n public ActiveViewport: ViewportSize = 'desktop';\n\n public readonly ViewportPresets: ViewportPreset[] = [\n { Size: 'mobile', Label: 'Mobile (375px)', Icon: 'fa-mobile-screen', MaxWidth: '375px' },\n { Size: 'tablet', Label: 'Tablet (768px)', Icon: 'fa-tablet-screen-button', MaxWidth: '768px' },\n { Size: 'desktop', Label: 'Desktop (100%)', Icon: 'fa-desktop', MaxWidth: '100%' }\n ];\n\n // --- Local spec for refresh cycle ---\n public LocalComponentSpec: ComponentSpec | null = null;\n\n private destroy$ = new Subject<void>();\n\n constructor(\n public State: ComponentStudioStateService,\n private cdr: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n this.syncSpecFromState();\n\n this.State.StateChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.syncSpecFromState();\n this.cdr.detectChanges();\n });\n\n this.State.RefreshComponent\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.refreshPreview();\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n // ============================================================\n // TOOLBAR ACTIONS\n // ============================================================\n\n public RunSelectedComponent(): void {\n if (this.State.SelectedComponent) {\n this.State.RunComponent(this.State.SelectedComponent);\n }\n }\n\n public StopComponent(): void {\n MJReactComponent.forceClearRegistries();\n this.State.StopComponent();\n }\n\n public RefreshComponent(): void {\n if (this.State.SelectedComponent && this.State.IsRunning) {\n MJReactComponent.forceClearRegistries();\n this.refreshPreview();\n }\n }\n\n public SetViewport(size: ViewportSize): void {\n this.ActiveViewport = size;\n this.cdr.detectChanges();\n }\n\n public SendErrorToAI(): void {\n if (this.State.CurrentError) {\n this.AskAIToFix.emit(this.State.CurrentError);\n this.State.SendErrorToAI.emit(this.State.CurrentError);\n }\n }\n\n // ============================================================\n // VIEWPORT HELPERS\n // ============================================================\n\n public GetActivePreset(): ViewportPreset {\n return this.ViewportPresets.find(p => p.Size === this.ActiveViewport) || this.ViewportPresets[2];\n }\n\n public GetPreviewContainerMaxWidth(): string {\n return this.GetActivePreset().MaxWidth;\n }\n\n // ============================================================\n // REACT COMPONENT EVENTS\n // ============================================================\n\n public OnComponentEvent(event: ReactComponentEvent): void {\n if (event.type === 'error') {\n this.State.CurrentError = {\n type: event.payload?.source || 'Component Error',\n message: event.payload?.error || 'An error occurred while rendering the component',\n technicalDetails: event.payload?.errorInfo || event.payload\n };\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Fires once the React bridge has resolved the full component hierarchy from the\n * registry. The bridge stores the resolved spec (with real dependency code, not\n * registry-reference stubs) on its public `resolvedComponentSpec` field — pull it\n * across so the code-editor tabs can render actual source instead of \"No code available\".\n */\n public OnReactInitialized(): void {\n const resolvedSpec = this.ReactComponentRef?.resolvedComponentSpec;\n if (resolvedSpec) {\n this.State.UpdateWithResolvedSpec(resolvedSpec);\n this.cdr.detectChanges();\n }\n }\n\n public OnOpenEntityRecord(event: { entityName: string; key: CompositeKey }): void {\n SharedService.Instance.OpenEntityRecord(event.entityName, event.key);\n }\n\n // ============================================================\n // STATE HELPERS\n // ============================================================\n\n public GetComponentName(): string {\n if (!this.State.SelectedComponent) return '';\n return this.State.GetComponentName(this.State.SelectedComponent);\n }\n\n public GetComponentDescription(): string | undefined {\n if (!this.State.SelectedComponent) return undefined;\n return this.State.GetComponentDescription(this.State.SelectedComponent);\n }\n\n // ============================================================\n // PRIVATE\n // ============================================================\n\n private syncSpecFromState(): void {\n this.LocalComponentSpec = this.State.ComponentSpec;\n }\n\n /**\n * Refresh the preview by nulling the spec, detecting changes,\n * then restoring the spec after a short delay. The bridge's own\n * `initializeComponent` purges the runtime registry + manager fetch cache\n * for the new spec's keys, so consumers don't need to clear anything here.\n */\n private refreshPreview(): void {\n if (!this.State.SelectedComponent) return;\n\n const spec = this.State.GetComponentSpec(this.State.SelectedComponent);\n\n // Null out to force React to unmount\n this.LocalComponentSpec = null;\n this.cdr.detectChanges();\n\n // Re-set after a brief pause to force fresh mount\n setTimeout(() => {\n this.LocalComponentSpec = spec;\n this.State.ComponentSpec = spec;\n this.State.CurrentError = null;\n try {\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Error during refresh detectChanges:', error);\n }\n }, 10);\n }\n}\n","<div class=\"component-preview\">\n <!-- Toolbar -->\n <div class=\"preview-toolbar\">\n <div class=\"toolbar-left\">\n @if (State.SelectedComponent) {\n @if (State.IsRunning) {\n <button class=\"toolbar-btn stop-btn\" (click)=\"StopComponent()\" title=\"Stop component\">\n <i class=\"fa-solid fa-stop\"></i>\n <span>Stop</span>\n </button>\n <button class=\"toolbar-btn\" (click)=\"RefreshComponent()\" title=\"Refresh component\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n <span>Refresh</span>\n </button>\n } @else {\n <button class=\"toolbar-btn run-btn\" (click)=\"RunSelectedComponent()\" title=\"Run component\">\n <i class=\"fa-solid fa-play\"></i>\n <span>Run</span>\n </button>\n }\n }\n </div>\n\n <div class=\"toolbar-center\">\n <!-- Viewport Size Selector (segmented control) -->\n @if (State.IsRunning) {\n <div class=\"viewport-selector\">\n @for (preset of ViewportPresets; track preset.Size) {\n <button\n class=\"viewport-btn\"\n [class.active]=\"ActiveViewport === preset.Size\"\n (click)=\"SetViewport(preset.Size)\"\n [title]=\"preset.Label\">\n <i class=\"fa-solid\" [ngClass]=\"preset.Icon\"></i>\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"toolbar-right\">\n @if (State.CurrentError) {\n <button class=\"toolbar-btn ai-fix-btn\" (click)=\"SendErrorToAI()\" title=\"Ask AI to fix this error\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Ask AI to Fix</span>\n </button>\n }\n @if (State.IsRunning && State.SelectedComponent) {\n <span class=\"running-indicator\">\n <i class=\"fa-solid fa-circle running-dot\"></i>\n {{ GetComponentName() }}\n </span>\n }\n </div>\n </div>\n\n <!-- Preview Area -->\n <div class=\"preview-area\">\n @if (!State.SelectedComponent) {\n <!-- Empty State: No component selected -->\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-eye fa-3x\"></i>\n <h3>Select a component to preview</h3>\n <p>Choose a component from the sidebar to see its live preview here.</p>\n </div>\n } @else if (!State.IsRunning) {\n <!-- Component selected but not running -->\n <div class=\"empty-state run-state\">\n <i class=\"fa-solid fa-play-circle fa-3x\"></i>\n <h3>{{ GetComponentName() }}</h3>\n <p>{{ GetComponentDescription() || 'No description available' }}</p>\n <button class=\"run-component-btn\" (click)=\"RunSelectedComponent()\">\n <i class=\"fa-solid fa-play\"></i> Run Component\n </button>\n </div>\n } @else if (LocalComponentSpec) {\n <!-- Live Preview Container -->\n <div class=\"preview-container\"\n [style.max-width]=\"GetPreviewContainerMaxWidth()\"\n [class.mobile]=\"ActiveViewport === 'mobile'\"\n [class.tablet]=\"ActiveViewport === 'tablet'\"\n [class.desktop]=\"ActiveViewport === 'desktop'\">\n <mj-react-component\n #reactComponent\n [component]=\"LocalComponentSpec\"\n (componentEvent)=\"OnComponentEvent($event)\"\n (initialized)=\"OnReactInitialized()\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n </div>\n\n <!-- Error Overlay (inline, does not replace the component) -->\n @if (State.CurrentError) {\n <div class=\"error-overlay\">\n <div class=\"error-overlay-content\">\n <div class=\"error-overlay-header\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span class=\"error-overlay-title\">{{ State.CurrentError.type }}</span>\n </div>\n <p class=\"error-overlay-message\">{{ State.CurrentError.message }}</p>\n <div class=\"error-overlay-actions\">\n <button class=\"toolbar-btn\" (click)=\"RefreshComponent()\">\n <i class=\"fa-solid fa-rotate-right\"></i> Retry\n </button>\n <button class=\"toolbar-btn ai-fix-btn\" (click)=\"SendErrorToAI()\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i> Ask AI to Fix\n </button>\n </div>\n </div>\n </div>\n }\n }\n </div>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"component-preview.component.js","sourceRoot":"","sources":["../../../../src/ComponentStudio/components/workspace/component-preview.component.ts","../../../../src/ComponentStudio/components/workspace/component-preview.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,YAAY,EAGZ,SAAS,EAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAuB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;;;;;;;;;ICPhD,kCAAsF;IAAjD,4MAAS,sBAAe,KAAC;IAC5D,wBAAgC;IAChC,4BAAM;IAAA,oBAAI;IACZ,AADY,iBAAO,EACV;IACT,kCAAmF;IAAvD,4MAAS,yBAAkB,KAAC;IACtD,wBAAwC;IACxC,4BAAM;IAAA,uBAAO;IACf,AADe,iBAAO,EACb;;;;IAET,kCAA2F;IAAvD,4MAAS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,CAAC,aAAa,EAAE,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;mHA9KU,yBAAyB;6DAAzB,yBAAyB;;;;;;YCtClC,AADF,AAFF,8BAA+B,aAEA,aACD;YACxB,iFAA+B;YAiBjC,iBAAM;YAEN,8BAA4B;YAE1B,2FAAuB;YAazB,iBAAM;YAEN,8BAA2B;YACzB,8FAA0B;YAM1B,4FAAkD;YAOtD,AADE,iBAAM,EACF;YAGN,8BAA0B;YAkBtB,AAVA,AAPF,8FAAgC,wEAOD,8DAUE;YAsCrC,AADE,iBAAM,EACF;;YA7GA,eAgBC;YAhBD,sDAgBC;YAKD,eAYC;YAZD,8CAYC;YAID,eAKC;YALD,iDAKC;YACD,cAKC;YALD,6EAKC;YAMH,eAqDC;YArDD,kHAqDC;;;iFDtEQ,yBAAyB;cANrC,SAAS;6BACI,KAAK,YACP,sBAAsB;;kBAM/B,SAAS;mBAAC,gBAAgB;;kBAE1B,MAAM;;kFAJI,yBAAyB","sourcesContent":["import {\n Component,\n Output,\n EventEmitter,\n OnInit,\n OnDestroy,\n ViewChild,\n ChangeDetectorRef\n} from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport { ReactComponentEvent, MJReactComponent } from '@memberjunction/ng-react';\nimport { CompositeKey } from '@memberjunction/core';\nimport { SharedService } from '@memberjunction/ng-shared';\nimport {\n ComponentStudioStateService,\n ComponentError\n} from '../../services/component-studio-state.service';\n\n/**\n * Viewport size preset for the component preview\n */\nexport type ViewportSize = 'mobile' | 'tablet' | 'desktop';\n\ninterface ViewportPreset {\n Size: ViewportSize;\n Label: string;\n Icon: string;\n MaxWidth: string;\n}\n\n/**\n * Component Preview - TOP section of CENTER panel.\n * Renders the live React component preview with toolbar controls.\n */\n@Component({\n standalone: false,\n selector: 'mj-component-preview',\n templateUrl: './component-preview.component.html',\n styleUrls: ['./component-preview.component.css']\n})\nexport class ComponentPreviewComponent implements OnInit, OnDestroy {\n\n @ViewChild('reactComponent') ReactComponentRef?: MJReactComponent;\n\n @Output() AskAIToFix = new EventEmitter<ComponentError>();\n\n // --- Viewport ---\n public ActiveViewport: ViewportSize = 'desktop';\n\n public readonly ViewportPresets: ViewportPreset[] = [\n { Size: 'mobile', Label: 'Mobile (375px)', Icon: 'fa-mobile-screen', MaxWidth: '375px' },\n { Size: 'tablet', Label: 'Tablet (768px)', Icon: 'fa-tablet-screen-button', MaxWidth: '768px' },\n { Size: 'desktop', Label: 'Desktop (100%)', Icon: 'fa-desktop', MaxWidth: '100%' }\n ];\n\n // --- Local spec for refresh cycle ---\n public LocalComponentSpec: ComponentSpec | null = null;\n\n private destroy$ = new Subject<void>();\n\n constructor(\n public State: ComponentStudioStateService,\n private cdr: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n this.syncSpecFromState();\n\n this.State.StateChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.syncSpecFromState();\n this.cdr.detectChanges();\n });\n\n this.State.RefreshComponent\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.refreshPreview();\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n // ============================================================\n // TOOLBAR ACTIONS\n // ============================================================\n\n public RunSelectedComponent(): void {\n if (this.State.SelectedComponent) {\n this.State.RunComponent(this.State.SelectedComponent);\n }\n }\n\n public StopComponent(): void {\n MJReactComponent.forceClearRegistries();\n this.State.StopComponent();\n }\n\n public RefreshComponent(): void {\n if (this.State.SelectedComponent && this.State.IsRunning) {\n MJReactComponent.forceClearRegistries();\n this.refreshPreview();\n }\n }\n\n public SetViewport(size: ViewportSize): void {\n this.ActiveViewport = size;\n this.cdr.detectChanges();\n }\n\n public SendErrorToAI(): void {\n if (this.State.CurrentError) {\n this.AskAIToFix.emit(this.State.CurrentError);\n this.State.SendErrorToAI.emit(this.State.CurrentError);\n }\n }\n\n // ============================================================\n // VIEWPORT HELPERS\n // ============================================================\n\n public GetActivePreset(): ViewportPreset {\n return this.ViewportPresets.find(p => p.Size === this.ActiveViewport) || this.ViewportPresets[2];\n }\n\n public GetPreviewContainerMaxWidth(): string {\n return this.GetActivePreset().MaxWidth;\n }\n\n // ============================================================\n // REACT COMPONENT EVENTS\n // ============================================================\n\n public OnComponentEvent(event: ReactComponentEvent): void {\n if (event.type === 'error') {\n this.State.CurrentError = {\n type: event.payload?.source || 'Component Error',\n message: event.payload?.error || 'An error occurred while rendering the component',\n technicalDetails: event.payload?.errorInfo || event.payload\n };\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Fires once the React bridge has resolved the full component hierarchy from the\n * registry. The bridge stores the resolved spec (with real dependency code, not\n * registry-reference stubs) on its public `resolvedComponentSpec` field — pull it\n * across so the code-editor tabs can render actual source instead of \"No code available\".\n */\n public OnReactInitialized(): void {\n const resolvedSpec = this.ReactComponentRef?.resolvedComponentSpec;\n if (resolvedSpec) {\n this.State.UpdateWithResolvedSpec(resolvedSpec);\n this.cdr.detectChanges();\n }\n }\n\n public OnOpenEntityRecord(event: { entityName: string; key: CompositeKey }): void {\n SharedService.Instance.OpenEntityRecord(event.entityName, event.key);\n }\n\n // ============================================================\n // STATE HELPERS\n // ============================================================\n\n public GetComponentName(): string {\n if (!this.State.SelectedComponent) return '';\n return this.State.GetComponentName(this.State.SelectedComponent);\n }\n\n public GetComponentDescription(): string | undefined {\n if (!this.State.SelectedComponent) return undefined;\n return this.State.GetComponentDescription(this.State.SelectedComponent);\n }\n\n // ============================================================\n // PRIVATE\n // ============================================================\n\n private syncSpecFromState(): void {\n this.LocalComponentSpec = this.State.ComponentSpec;\n }\n\n /**\n * Refresh the preview by nulling the spec, detecting changes,\n * then restoring the spec after a short delay. The bridge's own\n * `initializeComponent` purges the runtime registry + manager fetch cache\n * for the new spec's keys, so consumers don't need to clear anything here.\n */\n private refreshPreview(): void {\n if (!this.State.SelectedComponent) return;\n\n const spec = this.State.ComponentSpec;\n\n // Null out to force React to unmount\n this.LocalComponentSpec = null;\n this.cdr.detectChanges();\n\n // Re-set after a brief pause to force fresh mount\n setTimeout(() => {\n this.LocalComponentSpec = spec;\n this.State.ComponentSpec = spec;\n this.State.CurrentError = null;\n try {\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Error during refresh detectChanges:', error);\n }\n }, 10);\n }\n}\n","<div class=\"component-preview\">\n <!-- Toolbar -->\n <div class=\"preview-toolbar\">\n <div class=\"toolbar-left\">\n @if (State.SelectedComponent) {\n @if (State.IsRunning) {\n <button class=\"toolbar-btn stop-btn\" (click)=\"StopComponent()\" title=\"Stop component\">\n <i class=\"fa-solid fa-stop\"></i>\n <span>Stop</span>\n </button>\n <button class=\"toolbar-btn\" (click)=\"RefreshComponent()\" title=\"Refresh component\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n <span>Refresh</span>\n </button>\n } @else {\n <button class=\"toolbar-btn run-btn\" (click)=\"RunSelectedComponent()\" title=\"Run component\">\n <i class=\"fa-solid fa-play\"></i>\n <span>Run</span>\n </button>\n }\n }\n </div>\n\n <div class=\"toolbar-center\">\n <!-- Viewport Size Selector (segmented control) -->\n @if (State.IsRunning) {\n <div class=\"viewport-selector\">\n @for (preset of ViewportPresets; track preset.Size) {\n <button\n class=\"viewport-btn\"\n [class.active]=\"ActiveViewport === preset.Size\"\n (click)=\"SetViewport(preset.Size)\"\n [title]=\"preset.Label\">\n <i class=\"fa-solid\" [ngClass]=\"preset.Icon\"></i>\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"toolbar-right\">\n @if (State.CurrentError) {\n <button class=\"toolbar-btn ai-fix-btn\" (click)=\"SendErrorToAI()\" title=\"Ask AI to fix this error\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Ask AI to Fix</span>\n </button>\n }\n @if (State.IsRunning && State.SelectedComponent) {\n <span class=\"running-indicator\">\n <i class=\"fa-solid fa-circle running-dot\"></i>\n {{ GetComponentName() }}\n </span>\n }\n </div>\n </div>\n\n <!-- Preview Area -->\n <div class=\"preview-area\">\n @if (!State.SelectedComponent) {\n <!-- Empty State: No component selected -->\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-eye fa-3x\"></i>\n <h3>Select a component to preview</h3>\n <p>Choose a component from the sidebar to see its live preview here.</p>\n </div>\n } @else if (!State.IsRunning) {\n <!-- Component selected but not running -->\n <div class=\"empty-state run-state\">\n <i class=\"fa-solid fa-play-circle fa-3x\"></i>\n <h3>{{ GetComponentName() }}</h3>\n <p>{{ GetComponentDescription() || 'No description available' }}</p>\n <button class=\"run-component-btn\" (click)=\"RunSelectedComponent()\">\n <i class=\"fa-solid fa-play\"></i> Run Component\n </button>\n </div>\n } @else if (LocalComponentSpec) {\n <!-- Live Preview Container -->\n <div class=\"preview-container\"\n [style.max-width]=\"GetPreviewContainerMaxWidth()\"\n [class.mobile]=\"ActiveViewport === 'mobile'\"\n [class.tablet]=\"ActiveViewport === 'tablet'\"\n [class.desktop]=\"ActiveViewport === 'desktop'\">\n <mj-react-component\n #reactComponent\n [component]=\"LocalComponentSpec\"\n (componentEvent)=\"OnComponentEvent($event)\"\n (initialized)=\"OnReactInitialized()\"\n (openEntityRecord)=\"OnOpenEntityRecord($event)\">\n </mj-react-component>\n </div>\n\n <!-- Error Overlay (inline, does not replace the component) -->\n @if (State.CurrentError) {\n <div class=\"error-overlay\">\n <div class=\"error-overlay-content\">\n <div class=\"error-overlay-header\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span class=\"error-overlay-title\">{{ State.CurrentError.type }}</span>\n </div>\n <p class=\"error-overlay-message\">{{ State.CurrentError.message }}</p>\n <div class=\"error-overlay-actions\">\n <button class=\"toolbar-btn\" (click)=\"RefreshComponent()\">\n <i class=\"fa-solid fa-rotate-right\"></i> Retry\n </button>\n <button class=\"toolbar-btn ai-fix-btn\" (click)=\"SendErrorToAI()\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i> Ask AI to Fix\n </button>\n </div>\n </div>\n </div>\n }\n }\n </div>\n</div>\n"]}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { IMetadataProvider } from '@memberjunction/core';
|
|
3
|
-
import { MJComponentEntityExtended } from '@memberjunction/core-entities';
|
|
4
3
|
import { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Lightweight summary of a database component for the browser list.
|
|
7
|
+
* Only contains fields needed for display — Specification and other heavy
|
|
8
|
+
* columns are fetched on demand when a component is selected.
|
|
9
|
+
*/
|
|
10
|
+
export interface DbComponentSummary {
|
|
11
|
+
ID: string;
|
|
12
|
+
Name: string;
|
|
13
|
+
Namespace: string | null;
|
|
14
|
+
Version: string | null;
|
|
15
|
+
Type: string | null;
|
|
16
|
+
Status: string | null;
|
|
17
|
+
Description: string | null;
|
|
18
|
+
HasRequiredCustomProps: boolean;
|
|
19
|
+
__mj_UpdatedAt: Date | null;
|
|
20
|
+
isFileLoaded?: false;
|
|
21
|
+
}
|
|
6
22
|
/**
|
|
7
23
|
* Interface for components loaded from files, text, or artifacts (not from database)
|
|
8
24
|
*/
|
|
@@ -22,9 +38,7 @@ export interface FileLoadedComponent {
|
|
|
22
38
|
/**
|
|
23
39
|
* Union type for both database and file-loaded components
|
|
24
40
|
*/
|
|
25
|
-
export type DisplayComponent =
|
|
26
|
-
isFileLoaded?: false;
|
|
27
|
-
}) | FileLoadedComponent;
|
|
41
|
+
export type DisplayComponent = DbComponentSummary | FileLoadedComponent;
|
|
28
42
|
/**
|
|
29
43
|
* Category for filtering
|
|
30
44
|
*/
|
|
@@ -58,7 +72,7 @@ export interface CodeSection {
|
|
|
58
72
|
export declare class ComponentStudioStateService {
|
|
59
73
|
private _dbComponents;
|
|
60
74
|
private _fileLoadedComponents;
|
|
61
|
-
get DbComponents():
|
|
75
|
+
get DbComponents(): DbComponentSummary[];
|
|
62
76
|
get FileLoadedComponents(): FileLoadedComponent[];
|
|
63
77
|
/** Combined list of all components (file-loaded first, then DB) */
|
|
64
78
|
get AllComponents(): DisplayComponent[];
|
|
@@ -162,15 +176,21 @@ export declare class ComponentStudioStateService {
|
|
|
162
176
|
GetComponentType(component: DisplayComponent): string | undefined;
|
|
163
177
|
GetComponentStatus(component: DisplayComponent): string | undefined;
|
|
164
178
|
GetComponentVersion(component: DisplayComponent): string;
|
|
165
|
-
|
|
179
|
+
/**
|
|
180
|
+
* Fetches the full component specification. For file-loaded components, returns
|
|
181
|
+
* the in-memory spec. For database components, loads the full entity record
|
|
182
|
+
* on demand via ComponentMetadataEngine.FindComponentByID() — the lightweight
|
|
183
|
+
* summary loaded at startup does not include the Specification column.
|
|
184
|
+
*/
|
|
185
|
+
GetComponentSpec(component: DisplayComponent): Promise<ComponentSpec>;
|
|
166
186
|
GetComponentId(component: DisplayComponent): string;
|
|
167
187
|
GetComponentNamespace(component: DisplayComponent): string | undefined;
|
|
168
188
|
GetComponentFilename(component: DisplayComponent): string | undefined;
|
|
169
189
|
GetComponentLoadedAt(component: DisplayComponent): Date | undefined;
|
|
170
190
|
GetComponentUpdatedAt(component: DisplayComponent): Date | undefined;
|
|
171
|
-
StartComponent(component: DisplayComponent): void
|
|
191
|
+
StartComponent(component: DisplayComponent): Promise<void>;
|
|
172
192
|
StopComponent(): void;
|
|
173
|
-
RunComponent(component: DisplayComponent): void
|
|
193
|
+
RunComponent(component: DisplayComponent): Promise<void>;
|
|
174
194
|
InitializeEditors(): void;
|
|
175
195
|
BuildCodeSections(): void;
|
|
176
196
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-studio-state.service.d.ts","sourceRoot":"","sources":["../../../src/ComponentStudio/services/component-studio-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAmC,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"component-studio-state.service.d.ts","sourceRoot":"","sources":["../../../src/ComponentStudio/services/component-studio-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAmC,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;;AAI5E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,IAAI,CAAC;IACf,YAAY,EAAE,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,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