@memberjunction/ng-agents 0.0.1 → 4.0.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/lib/agents.module.d.ts +37 -0
- package/dist/lib/agents.module.d.ts.map +1 -0
- package/dist/lib/agents.module.js +79 -0
- package/dist/lib/agents.module.js.map +1 -0
- package/dist/lib/components/agent-permissions-dialog.component.d.ts +29 -0
- package/dist/lib/components/agent-permissions-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/agent-permissions-dialog.component.js +135 -0
- package/dist/lib/components/agent-permissions-dialog.component.js.map +1 -0
- package/dist/lib/components/agent-permissions-panel.component.d.ts +52 -0
- package/dist/lib/components/agent-permissions-panel.component.d.ts.map +1 -0
- package/dist/lib/components/agent-permissions-panel.component.js +557 -0
- package/dist/lib/components/agent-permissions-panel.component.js.map +1 -0
- package/dist/lib/components/agent-permissions-slideover.component.d.ts +42 -0
- package/dist/lib/components/agent-permissions-slideover.component.d.ts.map +1 -0
- package/dist/lib/components/agent-permissions-slideover.component.js +176 -0
- package/dist/lib/components/agent-permissions-slideover.component.js.map +1 -0
- package/dist/lib/components/create-agent-dialog.component.d.ts +33 -0
- package/dist/lib/components/create-agent-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/create-agent-dialog.component.js +140 -0
- package/dist/lib/components/create-agent-dialog.component.js.map +1 -0
- package/dist/lib/components/create-agent-panel.component.d.ts +121 -0
- package/dist/lib/components/create-agent-panel.component.d.ts.map +1 -0
- package/dist/lib/components/create-agent-panel.component.js +955 -0
- package/dist/lib/components/create-agent-panel.component.js.map +1 -0
- package/dist/lib/components/create-agent-slidein.component.d.ts +44 -0
- package/dist/lib/components/create-agent-slidein.component.d.ts.map +1 -0
- package/dist/lib/components/create-agent-slidein.component.js +190 -0
- package/dist/lib/components/create-agent-slidein.component.js.map +1 -0
- package/dist/lib/services/agent-permissions.service.d.ts +68 -0
- package/dist/lib/services/agent-permissions.service.d.ts.map +1 -0
- package/dist/lib/services/agent-permissions.service.js +134 -0
- package/dist/lib/services/agent-permissions.service.js.map +1 -0
- package/dist/lib/services/create-agent.service.d.ts +100 -0
- package/dist/lib/services/create-agent.service.d.ts.map +1 -0
- package/dist/lib/services/create-agent.service.js +199 -0
- package/dist/lib/services/create-agent.service.js.map +1 -0
- package/dist/public-api.d.ts +10 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +17 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +42 -7
- package/README.md +0 -45
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./components/agent-permissions-panel.component";
|
|
3
|
+
import * as i2 from "./components/agent-permissions-dialog.component";
|
|
4
|
+
import * as i3 from "./components/agent-permissions-slideover.component";
|
|
5
|
+
import * as i4 from "./components/create-agent-panel.component";
|
|
6
|
+
import * as i5 from "./components/create-agent-dialog.component";
|
|
7
|
+
import * as i6 from "./components/create-agent-slidein.component";
|
|
8
|
+
import * as i7 from "@angular/common";
|
|
9
|
+
import * as i8 from "@angular/forms";
|
|
10
|
+
/**
|
|
11
|
+
* Module providing reusable AI Agent UI components.
|
|
12
|
+
*
|
|
13
|
+
* Components:
|
|
14
|
+
* - `<mj-agent-permissions-panel>` — Embeddable permissions manager
|
|
15
|
+
* - `<mj-agent-permissions-dialog>` — Centered modal dialog wrapper
|
|
16
|
+
* - `<mj-agent-permissions-slideover>` — Right-side slide-over wrapper
|
|
17
|
+
* - `<mj-create-agent-panel>` — Embeddable agent creation form
|
|
18
|
+
* - `<mj-create-agent-dialog>` — Centered modal dialog for agent creation
|
|
19
|
+
* - `<mj-create-agent-slidein>` — Right-side slide-in for agent creation
|
|
20
|
+
*
|
|
21
|
+
* Services:
|
|
22
|
+
* - `CreateAgentService` — Programmatically open create agent dialogs/slide-ins
|
|
23
|
+
*
|
|
24
|
+
* Usage:
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { AgentsModule } from '@memberjunction/ng-agents';
|
|
27
|
+
*
|
|
28
|
+
* @NgModule({ imports: [AgentsModule] })
|
|
29
|
+
* export class MyModule {}
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class AgentsModule {
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgentsModule, never>;
|
|
34
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AgentsModule, [typeof i1.AgentPermissionsPanelComponent, typeof i2.AgentPermissionsDialogComponent, typeof i3.AgentPermissionsSlideoverComponent, typeof i4.CreateAgentPanelComponent, typeof i5.CreateAgentDialogComponent, typeof i6.CreateAgentSlideInComponent], [typeof i7.CommonModule, typeof i8.FormsModule, typeof i8.ReactiveFormsModule], [typeof i1.AgentPermissionsPanelComponent, typeof i2.AgentPermissionsDialogComponent, typeof i3.AgentPermissionsSlideoverComponent, typeof i4.CreateAgentPanelComponent, typeof i5.CreateAgentDialogComponent, typeof i6.CreateAgentSlideInComponent]>;
|
|
35
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AgentsModule>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=agents.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.module.d.ts","sourceRoot":"","sources":["../../src/lib/agents.module.ts"],"names":[],"mappings":";;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAuBa,YAAY;yCAAZ,YAAY;0CAAZ,YAAY;0CAAZ,YAAY;CAAG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { AgentPermissionsPanelComponent } from './components/agent-permissions-panel.component';
|
|
5
|
+
import { AgentPermissionsDialogComponent } from './components/agent-permissions-dialog.component';
|
|
6
|
+
import { AgentPermissionsSlideoverComponent } from './components/agent-permissions-slideover.component';
|
|
7
|
+
import { CreateAgentPanelComponent } from './components/create-agent-panel.component';
|
|
8
|
+
import { CreateAgentDialogComponent } from './components/create-agent-dialog.component';
|
|
9
|
+
import { CreateAgentSlideInComponent } from './components/create-agent-slidein.component';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* Module providing reusable AI Agent UI components.
|
|
13
|
+
*
|
|
14
|
+
* Components:
|
|
15
|
+
* - `<mj-agent-permissions-panel>` — Embeddable permissions manager
|
|
16
|
+
* - `<mj-agent-permissions-dialog>` — Centered modal dialog wrapper
|
|
17
|
+
* - `<mj-agent-permissions-slideover>` — Right-side slide-over wrapper
|
|
18
|
+
* - `<mj-create-agent-panel>` — Embeddable agent creation form
|
|
19
|
+
* - `<mj-create-agent-dialog>` — Centered modal dialog for agent creation
|
|
20
|
+
* - `<mj-create-agent-slidein>` — Right-side slide-in for agent creation
|
|
21
|
+
*
|
|
22
|
+
* Services:
|
|
23
|
+
* - `CreateAgentService` — Programmatically open create agent dialogs/slide-ins
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { AgentsModule } from '@memberjunction/ng-agents';
|
|
28
|
+
*
|
|
29
|
+
* @NgModule({ imports: [AgentsModule] })
|
|
30
|
+
* export class MyModule {}
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export class AgentsModule {
|
|
34
|
+
static ɵfac = function AgentsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AgentsModule)(); };
|
|
35
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AgentsModule });
|
|
36
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
37
|
+
FormsModule,
|
|
38
|
+
ReactiveFormsModule] });
|
|
39
|
+
}
|
|
40
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AgentsModule, [{
|
|
41
|
+
type: NgModule,
|
|
42
|
+
args: [{
|
|
43
|
+
declarations: [
|
|
44
|
+
AgentPermissionsPanelComponent,
|
|
45
|
+
AgentPermissionsDialogComponent,
|
|
46
|
+
AgentPermissionsSlideoverComponent,
|
|
47
|
+
CreateAgentPanelComponent,
|
|
48
|
+
CreateAgentDialogComponent,
|
|
49
|
+
CreateAgentSlideInComponent
|
|
50
|
+
],
|
|
51
|
+
imports: [
|
|
52
|
+
CommonModule,
|
|
53
|
+
FormsModule,
|
|
54
|
+
ReactiveFormsModule
|
|
55
|
+
],
|
|
56
|
+
exports: [
|
|
57
|
+
AgentPermissionsPanelComponent,
|
|
58
|
+
AgentPermissionsDialogComponent,
|
|
59
|
+
AgentPermissionsSlideoverComponent,
|
|
60
|
+
CreateAgentPanelComponent,
|
|
61
|
+
CreateAgentDialogComponent,
|
|
62
|
+
CreateAgentSlideInComponent
|
|
63
|
+
]
|
|
64
|
+
}]
|
|
65
|
+
}], null, null); })();
|
|
66
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AgentsModule, { declarations: [AgentPermissionsPanelComponent,
|
|
67
|
+
AgentPermissionsDialogComponent,
|
|
68
|
+
AgentPermissionsSlideoverComponent,
|
|
69
|
+
CreateAgentPanelComponent,
|
|
70
|
+
CreateAgentDialogComponent,
|
|
71
|
+
CreateAgentSlideInComponent], imports: [CommonModule,
|
|
72
|
+
FormsModule,
|
|
73
|
+
ReactiveFormsModule], exports: [AgentPermissionsPanelComponent,
|
|
74
|
+
AgentPermissionsDialogComponent,
|
|
75
|
+
AgentPermissionsSlideoverComponent,
|
|
76
|
+
CreateAgentPanelComponent,
|
|
77
|
+
CreateAgentDialogComponent,
|
|
78
|
+
CreateAgentSlideInComponent] }); })();
|
|
79
|
+
//# sourceMappingURL=agents.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.module.js","sourceRoot":"","sources":["../../src/lib/agents.module.ts"],"names":[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1,29 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { AIAgentEntityExtended } from '@memberjunction/ai-core-plus';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* A centered modal dialog that wraps the AgentPermissionsPanel.
|
|
6
|
+
* Use this when you want a focused, overlay-based permissions editor.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```html
|
|
10
|
+
* <mj-agent-permissions-dialog
|
|
11
|
+
* *ngIf="showDialog"
|
|
12
|
+
* [Agent]="selectedAgent"
|
|
13
|
+
* (Closed)="showDialog = false"
|
|
14
|
+
* (PermissionsChanged)="onPermsChanged()">
|
|
15
|
+
* </mj-agent-permissions-dialog>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class AgentPermissionsDialogComponent {
|
|
19
|
+
Agent: AIAgentEntityExtended | null;
|
|
20
|
+
Closed: EventEmitter<void>;
|
|
21
|
+
PermissionsChanged: EventEmitter<void>;
|
|
22
|
+
IsVisible: boolean;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
OnEscapeKey(): void;
|
|
25
|
+
OnClose(): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgentPermissionsDialogComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AgentPermissionsDialogComponent, "mj-agent-permissions-dialog", never, { "Agent": { "alias": "Agent"; "required": false; }; }, { "Closed": "Closed"; "PermissionsChanged": "PermissionsChanged"; }, never, never, false, never>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=agent-permissions-dialog.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-permissions-dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/agent-permissions-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAyC,MAAM,eAAe,CAAC;AAE9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;;AAErE;;;;;;;;;;;;;GAaG;AACH,qBAkJa,+BAA+B;IAC/B,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAQ;IAC1C,MAAM,qBAA4B;IAClC,kBAAkB,qBAA4B;IAEjD,SAAS,UAAS;IAEzB,QAAQ,IAAI,IAAI;IAQT,WAAW,IAAI,IAAI;IAInB,OAAO,IAAI,IAAI;yCAnBb,+BAA+B;2CAA/B,+BAA+B;CAuB3C"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, HostListener } from '@angular/core';
|
|
2
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./agent-permissions-panel.component";
|
|
5
|
+
function AgentPermissionsDialogComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵelementStart(0, "p", 6);
|
|
7
|
+
i0.ɵɵtext(1);
|
|
8
|
+
i0.ɵɵelementEnd();
|
|
9
|
+
} if (rf & 2) {
|
|
10
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
11
|
+
i0.ɵɵadvance();
|
|
12
|
+
i0.ɵɵtextInterpolate(ctx_r0.Agent.Name);
|
|
13
|
+
} }
|
|
14
|
+
/**
|
|
15
|
+
* A centered modal dialog that wraps the AgentPermissionsPanel.
|
|
16
|
+
* Use this when you want a focused, overlay-based permissions editor.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* ```html
|
|
20
|
+
* <mj-agent-permissions-dialog
|
|
21
|
+
* *ngIf="showDialog"
|
|
22
|
+
* [Agent]="selectedAgent"
|
|
23
|
+
* (Closed)="showDialog = false"
|
|
24
|
+
* (PermissionsChanged)="onPermsChanged()">
|
|
25
|
+
* </mj-agent-permissions-dialog>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class AgentPermissionsDialogComponent {
|
|
29
|
+
Agent = null;
|
|
30
|
+
Closed = new EventEmitter();
|
|
31
|
+
PermissionsChanged = new EventEmitter();
|
|
32
|
+
IsVisible = false;
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
// Animate in on next microtask
|
|
35
|
+
Promise.resolve().then(() => {
|
|
36
|
+
this.IsVisible = true;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
OnEscapeKey() {
|
|
40
|
+
this.OnClose();
|
|
41
|
+
}
|
|
42
|
+
OnClose() {
|
|
43
|
+
this.IsVisible = false;
|
|
44
|
+
setTimeout(() => this.Closed.emit(), 250);
|
|
45
|
+
}
|
|
46
|
+
static ɵfac = function AgentPermissionsDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AgentPermissionsDialogComponent)(); };
|
|
47
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AgentPermissionsDialogComponent, selectors: [["mj-agent-permissions-dialog"]], hostBindings: function AgentPermissionsDialogComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
48
|
+
i0.ɵɵlistener("keydown.escape", function AgentPermissionsDialogComponent_keydown_escape_HostBindingHandler() { return ctx.OnEscapeKey(); }, i0.ɵɵresolveDocument);
|
|
49
|
+
} }, inputs: { Agent: "Agent" }, outputs: { Closed: "Closed", PermissionsChanged: "PermissionsChanged" }, standalone: false, decls: 13, vars: 6, consts: [[1, "apd-backdrop", 3, "click"], [1, "apd-dialog"], [1, "apd-header"], [1, "apd-title-group"], [1, "fa-solid", "fa-shield-halved", "apd-title-icon"], [1, "apd-title"], [1, "apd-subtitle"], [1, "apd-close-btn", 3, "click"], [1, "fa-solid", "fa-xmark"], [1, "apd-body"], [3, "PermissionsChanged", "Agent"]], template: function AgentPermissionsDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
51
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_Template_div_click_0_listener() { return ctx.OnClose(); });
|
|
52
|
+
i0.ɵɵelementEnd();
|
|
53
|
+
i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "div", 3);
|
|
54
|
+
i0.ɵɵelement(4, "i", 4);
|
|
55
|
+
i0.ɵɵelementStart(5, "div")(6, "h2", 5);
|
|
56
|
+
i0.ɵɵtext(7, "Manage Permissions");
|
|
57
|
+
i0.ɵɵelementEnd();
|
|
58
|
+
i0.ɵɵconditionalCreate(8, AgentPermissionsDialogComponent_Conditional_8_Template, 2, 1, "p", 6);
|
|
59
|
+
i0.ɵɵelementEnd()();
|
|
60
|
+
i0.ɵɵelementStart(9, "button", 7);
|
|
61
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_Template_button_click_9_listener() { return ctx.OnClose(); });
|
|
62
|
+
i0.ɵɵelement(10, "i", 8);
|
|
63
|
+
i0.ɵɵelementEnd()();
|
|
64
|
+
i0.ɵɵelementStart(11, "div", 9)(12, "mj-agent-permissions-panel", 10);
|
|
65
|
+
i0.ɵɵlistener("PermissionsChanged", function AgentPermissionsDialogComponent_Template_mj_agent_permissions_panel_PermissionsChanged_12_listener() { return ctx.PermissionsChanged.emit(); });
|
|
66
|
+
i0.ɵɵelementEnd()()();
|
|
67
|
+
} if (rf & 2) {
|
|
68
|
+
i0.ɵɵclassProp("apd-visible", ctx.IsVisible);
|
|
69
|
+
i0.ɵɵadvance();
|
|
70
|
+
i0.ɵɵclassProp("apd-visible", ctx.IsVisible);
|
|
71
|
+
i0.ɵɵadvance(7);
|
|
72
|
+
i0.ɵɵconditional(ctx.Agent ? 8 : -1);
|
|
73
|
+
i0.ɵɵadvance(4);
|
|
74
|
+
i0.ɵɵproperty("Agent", ctx.Agent);
|
|
75
|
+
} }, dependencies: [i1.AgentPermissionsPanelComponent], styles: [".apd-backdrop[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 1000;\n transition: background 0.25s ease;\n pointer-events: none;\n }\n .apd-backdrop.apd-visible[_ngcontent-%COMP%] {\n background: rgba(0, 0, 0, 0.4);\n pointer-events: auto;\n }\n\n .apd-dialog[_ngcontent-%COMP%] {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.95);\n width: 640px;\n max-width: 95vw;\n max-height: 85vh;\n background: var(--card-background, #ffffff);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n }\n .apd-dialog.apd-visible[_ngcontent-%COMP%] {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n\n .apd-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px 16px;\n border-bottom: 1px solid var(--border-color, #e5e7eb);\n flex-shrink: 0;\n }\n\n .apd-title-group[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .apd-title-icon[_ngcontent-%COMP%] {\n font-size: 20px;\n color: #6366f1;\n }\n\n .apd-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 18px;\n font-weight: 700;\n color: var(--text-primary, #1f2937);\n }\n\n .apd-subtitle[_ngcontent-%COMP%] {\n margin: 2px 0 0 0;\n font-size: 13px;\n color: #6b7280;\n }\n\n .apd-close-btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n background: none;\n border: none;\n border-radius: 8px;\n color: var(--text-secondary, #6b7280);\n cursor: pointer;\n transition: all 0.15s ease;\n font-size: 16px;\n flex-shrink: 0;\n }\n .apd-close-btn[_ngcontent-%COMP%]:hover {\n background: var(--hover-background, #f3f4f6);\n color: var(--text-primary, #1f2937);\n }\n\n .apd-body[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n padding: 24px;\n }\n\n @media (max-width: 768px) {\n .apd-dialog[_ngcontent-%COMP%] {\n width: 95vw;\n max-height: 90vh;\n }\n }"], data: { animation: [
|
|
76
|
+
trigger('fadeIn', [
|
|
77
|
+
transition(':enter', [
|
|
78
|
+
style({ opacity: 0 }),
|
|
79
|
+
animate('200ms ease-out', style({ opacity: 1 }))
|
|
80
|
+
])
|
|
81
|
+
])
|
|
82
|
+
] }, changeDetection: 0 });
|
|
83
|
+
}
|
|
84
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AgentPermissionsDialogComponent, [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{ standalone: false, selector: 'mj-agent-permissions-dialog', template: `
|
|
87
|
+
<!-- Backdrop -->
|
|
88
|
+
<div class="apd-backdrop" [class.apd-visible]="IsVisible" (click)="OnClose()"></div>
|
|
89
|
+
|
|
90
|
+
<!-- Dialog -->
|
|
91
|
+
<div class="apd-dialog" [class.apd-visible]="IsVisible">
|
|
92
|
+
<!-- Header -->
|
|
93
|
+
<div class="apd-header">
|
|
94
|
+
<div class="apd-title-group">
|
|
95
|
+
<i class="fa-solid fa-shield-halved apd-title-icon"></i>
|
|
96
|
+
<div>
|
|
97
|
+
<h2 class="apd-title">Manage Permissions</h2>
|
|
98
|
+
@if (Agent) {
|
|
99
|
+
<p class="apd-subtitle">{{ Agent.Name }}</p>
|
|
100
|
+
}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
<button class="apd-close-btn" (click)="OnClose()">
|
|
104
|
+
<i class="fa-solid fa-xmark"></i>
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!-- Content -->
|
|
109
|
+
<div class="apd-body">
|
|
110
|
+
<mj-agent-permissions-panel
|
|
111
|
+
[Agent]="Agent"
|
|
112
|
+
(PermissionsChanged)="PermissionsChanged.emit()">
|
|
113
|
+
</mj-agent-permissions-panel>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, animations: [
|
|
117
|
+
trigger('fadeIn', [
|
|
118
|
+
transition(':enter', [
|
|
119
|
+
style({ opacity: 0 }),
|
|
120
|
+
animate('200ms ease-out', style({ opacity: 1 }))
|
|
121
|
+
])
|
|
122
|
+
])
|
|
123
|
+
], styles: ["\n .apd-backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 1000;\n transition: background 0.25s ease;\n pointer-events: none;\n }\n .apd-backdrop.apd-visible {\n background: rgba(0, 0, 0, 0.4);\n pointer-events: auto;\n }\n\n .apd-dialog {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.95);\n width: 640px;\n max-width: 95vw;\n max-height: 85vh;\n background: var(--card-background, #ffffff);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n }\n .apd-dialog.apd-visible {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n\n .apd-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px 16px;\n border-bottom: 1px solid var(--border-color, #e5e7eb);\n flex-shrink: 0;\n }\n\n .apd-title-group {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .apd-title-icon {\n font-size: 20px;\n color: #6366f1;\n }\n\n .apd-title {\n margin: 0;\n font-size: 18px;\n font-weight: 700;\n color: var(--text-primary, #1f2937);\n }\n\n .apd-subtitle {\n margin: 2px 0 0 0;\n font-size: 13px;\n color: #6b7280;\n }\n\n .apd-close-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n background: none;\n border: none;\n border-radius: 8px;\n color: var(--text-secondary, #6b7280);\n cursor: pointer;\n transition: all 0.15s ease;\n font-size: 16px;\n flex-shrink: 0;\n }\n .apd-close-btn:hover {\n background: var(--hover-background, #f3f4f6);\n color: var(--text-primary, #1f2937);\n }\n\n .apd-body {\n flex: 1;\n overflow-y: auto;\n padding: 24px;\n }\n\n @media (max-width: 768px) {\n .apd-dialog {\n width: 95vw;\n max-height: 90vh;\n }\n }\n "] }]
|
|
124
|
+
}], null, { Agent: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], Closed: [{
|
|
127
|
+
type: Output
|
|
128
|
+
}], PermissionsChanged: [{
|
|
129
|
+
type: Output
|
|
130
|
+
}], OnEscapeKey: [{
|
|
131
|
+
type: HostListener,
|
|
132
|
+
args: ['document:keydown.escape']
|
|
133
|
+
}] }); })();
|
|
134
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentPermissionsDialogComponent, { className: "AgentPermissionsDialogComponent", filePath: "src/lib/components/agent-permissions-dialog.component.ts", lineNumber: 165 }); })();
|
|
135
|
+
//# sourceMappingURL=agent-permissions-dialog.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-permissions-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/components/agent-permissions-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;;;;IAiCxD,4BAAwB;IAAA,YAAgB;IAAA,iBAAI;;;IAApB,cAAgB;IAAhB,uCAAgB;;AA9B1D;;;;;;;;;;;;;GAaG;AAmJH,MAAM,OAAO,+BAA+B;IAC/B,KAAK,GAAiC,IAAI,CAAC;IAC1C,MAAM,GAAG,IAAI,YAAY,EAAQ,CAAC;IAClC,kBAAkB,GAAG,IAAI,YAAY,EAAQ,CAAC;IAEjD,SAAS,GAAG,KAAK,CAAC;IAEzB,Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA8BL,mBAuGY,uBAAuB,CAAC,MAAM,cACnC;oBACR,OAAO,CAAC,QAAQ,EAAE;wBACd,UAAU,CAAC,QAAQ,EAAE;4BACjB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;4BACrB,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;yBACnD,CAAC;qBACL,CAAC;iBACL;;kBAGA,KAAK;;kBACL,MAAM;;kBACN,MAAM;;kBAWN,YAAY;mBAAC,yBAAyB;;kFAd9B,+BAA+B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { AIAgentEntityExtended } from '@memberjunction/ai-core-plus';
|
|
3
|
+
import { AgentPermissionsService, PermissionRow } from '../services/agent-permissions.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/** Simple name/ID pair for the grantee search-select */
|
|
6
|
+
interface GranteeOption {
|
|
7
|
+
ID: string;
|
|
8
|
+
Name: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class AgentPermissionsPanelComponent implements OnInit {
|
|
11
|
+
private permsSvc;
|
|
12
|
+
private cdr;
|
|
13
|
+
/** The agent whose permissions are being managed */
|
|
14
|
+
private _agent;
|
|
15
|
+
set Agent(value: AIAgentEntityExtended | null);
|
|
16
|
+
get Agent(): AIAgentEntityExtended | null;
|
|
17
|
+
/** Emitted after a permission is saved or deleted */
|
|
18
|
+
PermissionsChanged: EventEmitter<void>;
|
|
19
|
+
IsLoading: boolean;
|
|
20
|
+
IsSaving: boolean;
|
|
21
|
+
Rows: PermissionRow[];
|
|
22
|
+
OwnerName: string | null;
|
|
23
|
+
IsFormOpen: boolean;
|
|
24
|
+
EditingRowId: string | null;
|
|
25
|
+
FormGrantType: 'user' | 'role';
|
|
26
|
+
FormGranteeId: string | null;
|
|
27
|
+
FormCanView: boolean;
|
|
28
|
+
FormCanRun: boolean;
|
|
29
|
+
FormCanEdit: boolean;
|
|
30
|
+
FormCanDelete: boolean;
|
|
31
|
+
FormComments: string;
|
|
32
|
+
SearchQuery: string;
|
|
33
|
+
FilteredGrantees: GranteeOption[];
|
|
34
|
+
constructor(permsSvc: AgentPermissionsService, cdr: ChangeDetectorRef);
|
|
35
|
+
ngOnInit(): void;
|
|
36
|
+
private loadData;
|
|
37
|
+
trackById(_index: number, row: PermissionRow): string;
|
|
38
|
+
OnAddNew(): void;
|
|
39
|
+
OnEditRow(row: PermissionRow): void;
|
|
40
|
+
OnDeleteRow(row: PermissionRow): Promise<void>;
|
|
41
|
+
OnCancelForm(): void;
|
|
42
|
+
OnSearchChanged(): void;
|
|
43
|
+
OnPermToggle(level: 'run' | 'edit' | 'delete'): void;
|
|
44
|
+
get CanSave(): boolean;
|
|
45
|
+
OnSave(): Promise<void>;
|
|
46
|
+
private resetForm;
|
|
47
|
+
private updateFilteredGrantees;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgentPermissionsPanelComponent, never>;
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AgentPermissionsPanelComponent, "mj-agent-permissions-panel", never, { "Agent": { "alias": "Agent"; "required": false; }; }, { "PermissionsChanged": "PermissionsChanged"; }, never, never, false, never>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=agent-permissions-panel.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-permissions-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/agent-permissions-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAA2B,MAAM,eAAe,CAAC;AAE3H,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,EAAE,uBAAuB,EAAE,aAAa,EA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