@memberjunction/ng-artifacts 5.36.0 → 5.38.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 (50) hide show
  1. package/README.md +31 -0
  2. package/dist/__tests__/image-artifact-viewer.test.d.ts +2 -0
  3. package/dist/__tests__/image-artifact-viewer.test.d.ts.map +1 -0
  4. package/dist/__tests__/image-artifact-viewer.test.js +62 -0
  5. package/dist/__tests__/image-artifact-viewer.test.js.map +1 -0
  6. package/dist/lib/__tests__/interactive-form-apply.service.test.d.ts +2 -0
  7. package/dist/lib/__tests__/interactive-form-apply.service.test.d.ts.map +1 -0
  8. package/dist/lib/__tests__/interactive-form-apply.service.test.js +206 -0
  9. package/dist/lib/__tests__/interactive-form-apply.service.test.js.map +1 -0
  10. package/dist/lib/artifacts.module.d.ts +14 -12
  11. package/dist/lib/artifacts.module.d.ts.map +1 -1
  12. package/dist/lib/artifacts.module.js +14 -2
  13. package/dist/lib/artifacts.module.js.map +1 -1
  14. package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts +11 -1
  15. package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts.map +1 -1
  16. package/dist/lib/components/artifact-type-plugin-viewer.component.js +18 -1
  17. package/dist/lib/components/artifact-type-plugin-viewer.component.js.map +1 -1
  18. package/dist/lib/components/artifact-viewer-panel.component.d.ts +10 -1
  19. package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -1
  20. package/dist/lib/components/artifact-viewer-panel.component.js +11 -3
  21. package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -1
  22. package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts +60 -2
  23. package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts.map +1 -1
  24. package/dist/lib/components/plugins/component-artifact-viewer.component.js +373 -24
  25. package/dist/lib/components/plugins/component-artifact-viewer.component.js.map +1 -1
  26. package/dist/lib/components/plugins/data-artifact-viewer.component.d.ts.map +1 -1
  27. package/dist/lib/components/plugins/data-artifact-viewer.component.js +0 -1
  28. package/dist/lib/components/plugins/data-artifact-viewer.component.js.map +1 -1
  29. package/dist/lib/components/plugins/docx-artifact-viewer.component.js +2 -2
  30. package/dist/lib/components/plugins/docx-artifact-viewer.component.js.map +1 -1
  31. package/dist/lib/components/plugins/image-artifact-viewer.component.d.ts +129 -0
  32. package/dist/lib/components/plugins/image-artifact-viewer.component.d.ts.map +1 -0
  33. package/dist/lib/components/plugins/image-artifact-viewer.component.js +413 -0
  34. package/dist/lib/components/plugins/image-artifact-viewer.component.js.map +1 -0
  35. package/dist/lib/components/plugins/pdf-artifact-viewer.component.js +2 -2
  36. package/dist/lib/components/plugins/pdf-artifact-viewer.component.js.map +1 -1
  37. package/dist/lib/components/plugins/save-query-dialog.component.d.ts.map +1 -1
  38. package/dist/lib/components/plugins/save-query-dialog.component.js +0 -2
  39. package/dist/lib/components/plugins/save-query-dialog.component.js.map +1 -1
  40. package/dist/lib/components/plugins/xlsx-artifact-viewer.component.js +2 -2
  41. package/dist/lib/components/plugins/xlsx-artifact-viewer.component.js.map +1 -1
  42. package/dist/lib/services/interactive-form-apply.service.d.ts +46 -0
  43. package/dist/lib/services/interactive-form-apply.service.d.ts.map +1 -0
  44. package/dist/lib/services/interactive-form-apply.service.js +219 -0
  45. package/dist/lib/services/interactive-form-apply.service.js.map +1 -0
  46. package/dist/public-api.d.ts +2 -0
  47. package/dist/public-api.d.ts.map +1 -1
  48. package/dist/public-api.js +2 -0
  49. package/dist/public-api.js.map +1 -1
  50. package/package.json +18 -16
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Apply-to-my-form service.
3
+ *
4
+ * When the form-aware artifact viewer's "Apply to my form" button fires
5
+ * `applyFormRequested`, the host calls this service. It:
6
+ * 1. Looks up the entity to confirm it's registered.
7
+ * 2. Reads the current Active override for the (entity, user) pair via
8
+ * the `Get Active Form For Entity` action.
9
+ * 3. Shows a confirmation dialog explaining what's about to happen
10
+ * (Create new vs. Modify existing → Pending).
11
+ * 4. On confirmation, runs `Create Interactive Form` or
12
+ * `Modify Interactive Form` accordingly.
13
+ * 5. Surfaces success / failure via the notification service.
14
+ *
15
+ * The service centralizes the Create-vs-Modify decision so every host
16
+ * (standalone artifact viewer in Explorer, chat conversation surfaces,
17
+ * eventually the cockpit's chat-pane Apply flow) follows the same rules.
18
+ */
19
+ import { Injectable, inject } from '@angular/core';
20
+ import { Metadata, LogError } from '@memberjunction/core';
21
+ import { GraphQLActionClient } from '@memberjunction/graphql-dataprovider';
22
+ import { MJNotificationService } from '@memberjunction/ng-notifications';
23
+ import { MJDialogService } from '@memberjunction/ng-ui-components';
24
+ import * as i0 from "@angular/core";
25
+ export class InteractiveFormApplyService {
26
+ dialog = inject(MJDialogService);
27
+ notifications = inject(MJNotificationService);
28
+ /**
29
+ * Confirm with the user and apply the spec. Routes to Create / Modify
30
+ * automatically based on whether an Active override already exists.
31
+ */
32
+ async ConfirmAndApply(spec, entityName, provider) {
33
+ const p = provider ?? Metadata.Provider;
34
+ if (!p) {
35
+ return this.fail('No metadata provider configured.');
36
+ }
37
+ const entity = p.EntityByName(entityName);
38
+ if (!entity) {
39
+ return this.fail(`Entity '${entityName}' is not registered.`);
40
+ }
41
+ const user = p.CurrentUser;
42
+ if (!user) {
43
+ return this.fail('No current user.');
44
+ }
45
+ const gqlProvider = p;
46
+ if (!gqlProvider || typeof gqlProvider.ExecuteGQL !== 'function') {
47
+ return this.fail('Action invocation requires a GraphQL provider.');
48
+ }
49
+ const client = new GraphQLActionClient(gqlProvider);
50
+ // Step 1: detect existing state via Get Active Form For Entity.
51
+ const activeResult = await this.runActionByName(client, 'Get Active Form For Entity', [
52
+ { Name: 'EntityName', Value: entityName, Type: 'Input' },
53
+ ]);
54
+ if (!activeResult.Success) {
55
+ return this.fail(`Could not check for existing override: ${activeResult.Message ?? 'unknown error'}`);
56
+ }
57
+ const payload = this.parseActiveResult(activeResult.Message);
58
+ const hasExistingActive = !!payload?.Active?.OverrideID;
59
+ // Step 2: confirm with the user.
60
+ const proceed = await this.confirm(hasExistingActive, entityName, payload?.Active?.ComponentVersion);
61
+ if (!proceed) {
62
+ return { Success: false, Message: 'Cancelled by user.' };
63
+ }
64
+ // Step 3: run Create or Modify.
65
+ const formName = spec.name ?? 'Custom Form';
66
+ if (hasExistingActive) {
67
+ const modifyResult = await this.runActionByName(client, 'Modify Interactive Form', [
68
+ { Name: 'OverrideID', Value: payload.Active.OverrideID, Type: 'Input' },
69
+ { Name: 'Spec', Value: JSON.stringify(spec), Type: 'Input' },
70
+ { Name: 'Notes', Value: `Applied from chat artifact at ${new Date().toISOString()}`, Type: 'Input' },
71
+ ]);
72
+ return this.summarize(modifyResult, 'modify', user);
73
+ }
74
+ const createResult = await this.runActionByName(client, 'Create Interactive Form', [
75
+ { Name: 'EntityName', Value: entityName, Type: 'Input' },
76
+ { Name: 'Name', Value: formName, Type: 'Input' },
77
+ { Name: 'Spec', Value: JSON.stringify(spec), Type: 'Input' },
78
+ ]);
79
+ return this.summarize(createResult, 'create', user);
80
+ }
81
+ // ── internals ────────────────────────────────────────────────────────
82
+ /**
83
+ * Look up an action by name and run it. The actions module ships with
84
+ * `__CreateInteractiveForm` / `__ModifyInteractiveForm` / etc. as their
85
+ * DriverClass names but registers under the human-readable form name.
86
+ * GraphQLActionClient.RunAction() takes the action ID; we fetch it by
87
+ * name from the action metadata loaded on the provider.
88
+ */
89
+ async runActionByName(client, actionName, params) {
90
+ try {
91
+ // The action ID is required by RunAction. We look it up from the
92
+ // action engine's cached metadata if available; otherwise we ask
93
+ // the GraphQL provider directly.
94
+ const actionId = await this.resolveActionIdByName(actionName);
95
+ if (!actionId) {
96
+ return { Success: false, Message: `Action '${actionName}' not found.` };
97
+ }
98
+ const result = await client.RunAction(actionId, params);
99
+ // ActionResult.Result is the MJActionResultCodeEntity carrying
100
+ // the string ResultCode; surface it on the failure path for
101
+ // diagnostic messaging. ActionResult itself doesn't expose
102
+ // ResultCode directly.
103
+ const resultCode = result?.Result?.ResultCode;
104
+ return {
105
+ Success: !!result.Success,
106
+ Message: result.Message ?? undefined,
107
+ ResultCode: resultCode ?? undefined,
108
+ };
109
+ }
110
+ catch (err) {
111
+ const message = err instanceof Error ? err.message : String(err);
112
+ LogError(`InteractiveFormApplyService.runActionByName(${actionName}): ${message}`);
113
+ return { Success: false, Message: message };
114
+ }
115
+ }
116
+ /**
117
+ * Resolve an action ID by Name. Falls back to a direct RunView against
118
+ * the Action entity when ActionEngine isn't loaded.
119
+ */
120
+ async resolveActionIdByName(name) {
121
+ try {
122
+ // ActionEngine may not be initialised in the chat surface — query directly.
123
+ const { RunView } = await import('@memberjunction/core');
124
+ const rv = new RunView();
125
+ const result = await rv.RunView({
126
+ EntityName: 'Actions',
127
+ ExtraFilter: `Name='${name.replace(/'/g, "''")}'`,
128
+ Fields: ['ID'],
129
+ MaxRows: 1,
130
+ ResultType: 'simple',
131
+ });
132
+ return result.Success ? (result.Results?.[0]?.ID ?? null) : null;
133
+ }
134
+ catch (err) {
135
+ LogError(`InteractiveFormApplyService.resolveActionIdByName(${name}): ${err instanceof Error ? err.message : String(err)}`);
136
+ return null;
137
+ }
138
+ }
139
+ /** Show a confirmation dialog explaining what's about to happen. */
140
+ async confirm(hasExistingActive, entityName, currentVersion) {
141
+ const content = hasExistingActive
142
+ ? `You already have an active custom form for <strong>${escape(entityName)}</strong> (v${escape(currentVersion ?? '?')}). Applying this artifact will create a <strong>new Pending version</strong> — your live form stays active until you explicitly activate the new version in Form Builder.`
143
+ : `This will create a custom form for <strong>${escape(entityName)}</strong> scoped to your user. Other users will continue to see the default form.`;
144
+ // MJDialogAction surface is {text, primary?, themeColor?}; the
145
+ // dialog's Result observable emits the entire clicked action (or
146
+ // undefined for backdrop/X dismissal). Detect intent via the
147
+ // `primary` flag — Apply / Create Pending are the primary actions;
148
+ // Cancel and dismissal both resolve false.
149
+ const ref = this.dialog.Open({
150
+ title: hasExistingActive ? 'Apply as new Pending version?' : 'Apply this form?',
151
+ content,
152
+ width: 540,
153
+ actions: [
154
+ { text: hasExistingActive ? 'Create Pending' : 'Apply', primary: true, themeColor: 'primary' },
155
+ { text: 'Cancel' },
156
+ ],
157
+ });
158
+ return new Promise(resolve => {
159
+ ref.Result.subscribe((res) => {
160
+ resolve(res?.primary === true);
161
+ });
162
+ });
163
+ }
164
+ parseActiveResult(message) {
165
+ if (!message)
166
+ return null;
167
+ try {
168
+ return JSON.parse(message);
169
+ }
170
+ catch {
171
+ return null;
172
+ }
173
+ }
174
+ summarize(result, kind, _user) {
175
+ if (!result.Success) {
176
+ this.notifications.CreateSimpleNotification(`Apply failed: ${result.Message ?? result.ResultCode ?? 'unknown error'}`, 'error', 5000);
177
+ return { Success: false, Message: result.Message };
178
+ }
179
+ let payload = {};
180
+ try {
181
+ payload = JSON.parse(result.Message ?? '{}');
182
+ }
183
+ catch { /* best effort */ }
184
+ const mode = kind === 'create'
185
+ ? 'create'
186
+ : (payload.Mode === 'in-place' ? 'modify-in-place' : 'modify-new-version');
187
+ const note = kind === 'create'
188
+ ? 'Custom form is now active for your user.'
189
+ : (mode === 'modify-in-place'
190
+ ? 'Pending version updated. Activate it from Form Builder when ready.'
191
+ : `Pending v${payload.Version ?? '?'} created. Activate it from Form Builder when ready.`);
192
+ this.notifications.CreateSimpleNotification(note, 'success', 4000);
193
+ return {
194
+ Success: true,
195
+ Mode: mode,
196
+ OverrideID: payload.OverrideID,
197
+ ComponentID: payload.ComponentID,
198
+ Version: payload.Version,
199
+ Message: result.Message,
200
+ };
201
+ }
202
+ fail(message) {
203
+ this.notifications.CreateSimpleNotification(`Apply failed: ${message}`, 'error', 5000);
204
+ return { Success: false, Message: message };
205
+ }
206
+ static ɵfac = function InteractiveFormApplyService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InteractiveFormApplyService)(); };
207
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: InteractiveFormApplyService, factory: InteractiveFormApplyService.ɵfac, providedIn: 'root' });
208
+ }
209
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InteractiveFormApplyService, [{
210
+ type: Injectable,
211
+ args: [{ providedIn: 'root' }]
212
+ }], null, null); })();
213
+ /** Minimal HTML escape — the dialog content goes through `[innerHTML]` upstream. */
214
+ function escape(s) {
215
+ return s.replace(/[&<>"']/g, c => ({
216
+ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;',
217
+ }[c] ?? c));
218
+ }
219
+ //# sourceMappingURL=interactive-form-apply.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-form-apply.service.js","sourceRoot":"","sources":["../../../src/lib/services/interactive-form-apply.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAyC,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;;AAkBnE,MAAM,OAAO,2BAA2B;IACnB,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IACjC,aAAa,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAE/D;;;OAGG;IACI,KAAK,CAAC,eAAe,CACxB,IAAmB,EACnB,UAAkB,EAClB,QAA4B;QAE5B,MAAM,CAAC,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;QACxC,IAAI,CAAC,CAAC,EAAE,CAAC;YACL,OAAO,IAAI,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,O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C,IAAI,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Apply-to-my-form service.\n *\n * When the form-aware artifact viewer's \"Apply to my form\" button fires\n * `applyFormRequested`, the host calls this service. It:\n * 1. Looks up the entity to confirm it's registered.\n * 2. Reads the current Active override for the (entity, user) pair via\n * the `Get Active Form For Entity` action.\n * 3. Shows a confirmation dialog explaining what's about to happen\n * (Create new vs. Modify existing → Pending).\n * 4. On confirmation, runs `Create Interactive Form` or\n * `Modify Interactive Form` accordingly.\n * 5. Surfaces success / failure via the notification service.\n *\n * The service centralizes the Create-vs-Modify decision so every host\n * (standalone artifact viewer in Explorer, chat conversation surfaces,\n * eventually the cockpit's chat-pane Apply flow) follows the same rules.\n */\nimport { Injectable, inject } from '@angular/core';\nimport { Metadata, LogError, type IMetadataProvider, type UserInfo } from '@memberjunction/core';\nimport { GraphQLActionClient, GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJDialogService } from '@memberjunction/ng-ui-components';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\n\n/** Result of an apply attempt — surfaced to the caller for any post-apply UI. */\nexport interface InteractiveFormApplyResult {\n Success: boolean;\n /** Mode the server ran: 'create' / 'modify-new-version' / 'modify-in-place'. */\n Mode?: 'create' | 'modify-new-version' | 'modify-in-place';\n /** OverrideID the user can now reference. */\n OverrideID?: string;\n /** ComponentID that now holds the spec. */\n ComponentID?: string;\n /** Version string (e.g. '1.0.0' for create, '1.1.0' for modify-new). */\n Version?: string;\n Message?: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class InteractiveFormApplyService {\n private readonly dialog = inject(MJDialogService);\n private readonly notifications = inject(MJNotificationService);\n\n /**\n * Confirm with the user and apply the spec. Routes to Create / Modify\n * automatically based on whether an Active override already exists.\n */\n public async ConfirmAndApply(\n spec: ComponentSpec,\n entityName: string,\n provider?: IMetadataProvider,\n ): Promise<InteractiveFormApplyResult> {\n const p = provider ?? Metadata.Provider;\n if (!p) {\n return this.fail('No metadata provider configured.');\n }\n const entity = p.EntityByName(entityName);\n if (!entity) {\n return this.fail(`Entity '${entityName}' is not registered.`);\n }\n const user = p.CurrentUser;\n if (!user) {\n return this.fail('No current user.');\n }\n const gqlProvider = p as unknown as GraphQLDataProvider;\n if (!gqlProvider || typeof (gqlProvider as { ExecuteGQL?: unknown }).ExecuteGQL !== 'function') {\n return this.fail('Action invocation requires a GraphQL provider.');\n }\n\n const client = new GraphQLActionClient(gqlProvider);\n\n // Step 1: detect existing state via Get Active Form For Entity.\n const activeResult = await this.runActionByName(client, 'Get Active Form For Entity', [\n { Name: 'EntityName', Value: entityName, Type: 'Input' },\n ]);\n if (!activeResult.Success) {\n return this.fail(`Could not check for existing override: ${activeResult.Message ?? 'unknown error'}`);\n }\n const payload = this.parseActiveResult(activeResult.Message);\n const hasExistingActive = !!payload?.Active?.OverrideID;\n\n // Step 2: confirm with the user.\n const proceed = await this.confirm(hasExistingActive, entityName, payload?.Active?.ComponentVersion);\n if (!proceed) {\n return { Success: false, Message: 'Cancelled by user.' };\n }\n\n // Step 3: run Create or Modify.\n const formName = (spec as unknown as { name?: string }).name ?? 'Custom Form';\n if (hasExistingActive) {\n const modifyResult = await this.runActionByName(client, 'Modify Interactive Form', [\n { Name: 'OverrideID', Value: payload!.Active!.OverrideID!, Type: 'Input' },\n { Name: 'Spec', Value: JSON.stringify(spec), Type: 'Input' },\n { Name: 'Notes', Value: `Applied from chat artifact at ${new Date().toISOString()}`, Type: 'Input' },\n ]);\n return this.summarize(modifyResult, 'modify', user);\n }\n const createResult = await this.runActionByName(client, 'Create Interactive Form', [\n { Name: 'EntityName', Value: entityName, Type: 'Input' },\n { Name: 'Name', Value: formName, Type: 'Input' },\n { Name: 'Spec', Value: JSON.stringify(spec), Type: 'Input' },\n ]);\n return this.summarize(createResult, 'create', user);\n }\n\n // ── internals ────────────────────────────────────────────────────────\n\n /**\n * Look up an action by name and run it. The actions module ships with\n * `__CreateInteractiveForm` / `__ModifyInteractiveForm` / etc. as their\n * DriverClass names but registers under the human-readable form name.\n * GraphQLActionClient.RunAction() takes the action ID; we fetch it by\n * name from the action metadata loaded on the provider.\n */\n private async runActionByName(\n client: GraphQLActionClient,\n actionName: string,\n params: Array<{ Name: string; Value: string; Type: 'Input' }>,\n ): Promise<{ Success: boolean; Message?: string; ResultCode?: string }> {\n try {\n // The action ID is required by RunAction. We look it up from the\n // action engine's cached metadata if available; otherwise we ask\n // the GraphQL provider directly.\n const actionId = await this.resolveActionIdByName(actionName);\n if (!actionId) {\n return { Success: false, Message: `Action '${actionName}' not found.` };\n }\n const result = await client.RunAction(actionId, params);\n // ActionResult.Result is the MJActionResultCodeEntity carrying\n // the string ResultCode; surface it on the failure path for\n // diagnostic messaging. ActionResult itself doesn't expose\n // ResultCode directly.\n const resultCode = (result as { Result?: { ResultCode?: string } })?.Result?.ResultCode;\n return {\n Success: !!result.Success,\n Message: result.Message ?? undefined,\n ResultCode: resultCode ?? undefined,\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n LogError(`InteractiveFormApplyService.runActionByName(${actionName}): ${message}`);\n return { Success: false, Message: message };\n }\n }\n\n /**\n * Resolve an action ID by Name. Falls back to a direct RunView against\n * the Action entity when ActionEngine isn't loaded.\n */\n private async resolveActionIdByName(name: string): Promise<string | null> {\n try {\n // ActionEngine may not be initialised in the chat surface — query directly.\n const { RunView } = await import('@memberjunction/core');\n const rv = new RunView();\n const result = await rv.RunView<{ ID: string }>({\n EntityName: 'Actions',\n ExtraFilter: `Name='${name.replace(/'/g, \"''\")}'`,\n Fields: ['ID'],\n MaxRows: 1,\n ResultType: 'simple',\n });\n return result.Success ? (result.Results?.[0]?.ID ?? null) : null;\n } catch (err) {\n LogError(`InteractiveFormApplyService.resolveActionIdByName(${name}): ${err instanceof Error ? err.message : String(err)}`);\n return null;\n }\n }\n\n /** Show a confirmation dialog explaining what's about to happen. */\n private async confirm(\n hasExistingActive: boolean,\n entityName: string,\n currentVersion: string | null | undefined,\n ): Promise<boolean> {\n const content = hasExistingActive\n ? `You already have an active custom form for <strong>${escape(entityName)}</strong> (v${escape(currentVersion ?? '?')}). Applying this artifact will create a <strong>new Pending version</strong> — your live form stays active until you explicitly activate the new version in Form Builder.`\n : `This will create a custom form for <strong>${escape(entityName)}</strong> scoped to your user. Other users will continue to see the default form.`;\n // MJDialogAction surface is {text, primary?, themeColor?}; the\n // dialog's Result observable emits the entire clicked action (or\n // undefined for backdrop/X dismissal). Detect intent via the\n // `primary` flag — Apply / Create Pending are the primary actions;\n // Cancel and dismissal both resolve false.\n const ref = this.dialog.Open({\n title: hasExistingActive ? 'Apply as new Pending version?' : 'Apply this form?',\n content,\n width: 540,\n actions: [\n { text: hasExistingActive ? 'Create Pending' : 'Apply', primary: true, themeColor: 'primary' },\n { text: 'Cancel' },\n ],\n });\n return new Promise<boolean>(resolve => {\n ref.Result.subscribe((res: unknown) => {\n resolve((res as { primary?: boolean })?.primary === true);\n });\n });\n }\n\n private parseActiveResult(message: string | undefined): {\n Active?: { OverrideID?: string; ComponentVersion?: string };\n } | null {\n if (!message) return null;\n try {\n return JSON.parse(message) as { Active?: { OverrideID?: string; ComponentVersion?: string } };\n } catch {\n return null;\n }\n }\n\n private summarize(\n result: { Success: boolean; Message?: string; ResultCode?: string },\n kind: 'create' | 'modify',\n _user: UserInfo,\n ): InteractiveFormApplyResult {\n if (!result.Success) {\n this.notifications.CreateSimpleNotification(\n `Apply failed: ${result.Message ?? result.ResultCode ?? 'unknown error'}`,\n 'error', 5000,\n );\n return { Success: false, Message: result.Message };\n }\n let payload: Record<string, unknown> = {};\n try { payload = JSON.parse(result.Message ?? '{}'); } catch { /* best effort */ }\n const mode: InteractiveFormApplyResult['Mode'] = kind === 'create'\n ? 'create'\n : (payload.Mode === 'in-place' ? 'modify-in-place' : 'modify-new-version');\n const note = kind === 'create'\n ? 'Custom form is now active for your user.'\n : (mode === 'modify-in-place'\n ? 'Pending version updated. Activate it from Form Builder when ready.'\n : `Pending v${payload.Version ?? '?'} created. Activate it from Form Builder when ready.`);\n this.notifications.CreateSimpleNotification(note, 'success', 4000);\n return {\n Success: true,\n Mode: mode,\n OverrideID: payload.OverrideID as string | undefined,\n ComponentID: payload.ComponentID as string | undefined,\n Version: payload.Version as string | undefined,\n Message: result.Message,\n };\n }\n\n private fail(message: string): InteractiveFormApplyResult {\n this.notifications.CreateSimpleNotification(`Apply failed: ${message}`, 'error', 5000);\n return { Success: false, Message: message };\n }\n}\n\n/** Minimal HTML escape — the dialog content goes through `[innerHTML]` upstream. */\nfunction escape(s: string): string {\n return s.replace(/[&<>\"']/g, c => ({\n '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;',\n }[c] ?? c));\n}\n"]}
@@ -2,6 +2,7 @@ export * from './lib/artifacts.module';
2
2
  export * from './lib/services/artifact-icon.service';
3
3
  export * from './lib/services/artifact-file.service';
4
4
  export * from './lib/services/analyze-artifact.service';
5
+ export * from './lib/services/interactive-form-apply.service';
5
6
  export * from './lib/interfaces/artifact-viewer-plugin.interface';
6
7
  export * from './lib/components/base-artifact-viewer.component';
7
8
  export * from './lib/snapshot-helpers';
@@ -21,4 +22,5 @@ export * from './lib/components/file-artifact-toolbar.component';
21
22
  export * from './lib/components/plugins/pdf-artifact-viewer.component';
22
23
  export * from './lib/components/plugins/xlsx-artifact-viewer.component';
23
24
  export * from './lib/components/plugins/docx-artifact-viewer.component';
25
+ export * from './lib/components/plugins/image-artifact-viewer.component';
24
26
  //# sourceMappingURL=public-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,wBAAwB,CAAC;AAGvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,mDAAmD,CAAC;AAGlE,cAAc,iDAAiD,CAAC;AAGhE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ts.module';
7
7
  export * from './lib/services/artifact-icon.service';
8
8
  export * from './lib/services/artifact-file.service';
9
9
  export * from './lib/services/analyze-artifact.service';
10
+ export * from './lib/services/interactive-form-apply.service';
10
11
  // Interfaces
11
12
  export * from './lib/interfaces/artifact-viewer-plugin.interface';
12
13
  // Base component
@@ -33,4 +34,5 @@ export * from './lib/components/file-artifact-toolbar.component';
33
34
  export * from './lib/components/plugins/pdf-artifact-viewer.component';
34
35
  export * from './lib/components/plugins/xlsx-artifact-viewer.component';
35
36
  export * from './lib/components/plugins/docx-artifact-viewer.component';
37
+ export * from './lib/components/plugins/image-artifact-viewer.component';
36
38
  //# sourceMappingURL=public-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,wBAAwB,CAAC;AAEvC,WAAW;AACX,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AAExD,aAAa;AACb,cAAc,mDAAmD,CAAC;AAElE,iBAAiB;AACjB,cAAc,iDAAiD,CAAC;AAEhE,qFAAqF;AACrF,cAAc,wBAAwB,CAAC;AAEvC,8EAA8E;AAC9E,cAAc,wDAAwD,CAAC;AAEvE,gCAAgC;AAChC,cAAc,kDAAkD,CAAC;AACjE,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AAEjE,oBAAoB;AACpB,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,yDAAyD,CAAC;AACxE,cAAc,wDAAwD,CAAC;AACvE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,yDAAyD,CAAC;AACxE,cAAc,sFAAsF,CAAC;AAErG,kCAAkC;AAClC,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC","sourcesContent":["/*\n * Public API Surface of @memberjunction/ng-artifacts\n */\n\n// Module\nexport * from './lib/artifacts.module';\n\n// Services\nexport * from './lib/services/artifact-icon.service';\nexport * from './lib/services/artifact-file.service';\nexport * from './lib/services/analyze-artifact.service';\n\n// Interfaces\nexport * from './lib/interfaces/artifact-viewer-plugin.interface';\n\n// Base component\nexport * from './lib/components/base-artifact-viewer.component';\n\n// Snapshot helpers (pure functions for creating DataSnapshots from artifact content)\nexport * from './lib/snapshot-helpers';\n\n// Artifact type plugin viewer (loads appropriate plugin based on DriverClass)\nexport * from './lib/components/artifact-type-plugin-viewer.component';\n\n// Artifact viewer UI components\nexport * from './lib/components/artifact-viewer-panel.component';\nexport * from './lib/components/artifact-version-history.component';\nexport * from './lib/components/artifact-message-card.component';\n\n// Plugin components\nexport * from './lib/components/plugins/json-artifact-viewer.component';\nexport * from './lib/components/plugins/code-artifact-viewer.component';\nexport * from './lib/components/plugins/markdown-artifact-viewer.component';\nexport * from './lib/components/plugins/html-artifact-viewer.component';\nexport * from './lib/components/plugins/svg-artifact-viewer.component';\nexport * from './lib/components/plugins/component-artifact-viewer.component';\nexport * from './lib/components/plugins/data-artifact-viewer.component';\nexport * from './lib/components/plugins/component-feedback-panel/component-feedback-panel.component';\n\n// File viewer toolbar and plugins\nexport * from './lib/components/file-artifact-toolbar.component';\nexport * from './lib/components/plugins/pdf-artifact-viewer.component';\nexport * from './lib/components/plugins/xlsx-artifact-viewer.component';\nexport * from './lib/components/plugins/docx-artifact-viewer.component';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,wBAAwB,CAAC;AAEvC,WAAW;AACX,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAE9D,aAAa;AACb,cAAc,mDAAmD,CAAC;AAElE,iBAAiB;AACjB,cAAc,iDAAiD,CAAC;AAEhE,qFAAqF;AACrF,cAAc,wBAAwB,CAAC;AAEvC,8EAA8E;AAC9E,cAAc,wDAAwD,CAAC;AAEvE,gCAAgC;AAChC,cAAc,kDAAkD,CAAC;AACjE,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AAEjE,oBAAoB;AACpB,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,yDAAyD,CAAC;AACxE,cAAc,wDAAwD,CAAC;AACvE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,yDAAyD,CAAC;AACxE,cAAc,sFAAsF,CAAC;AAErG,kCAAkC;AAClC,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC","sourcesContent":["/*\n * Public API Surface of @memberjunction/ng-artifacts\n */\n\n// Module\nexport * from './lib/artifacts.module';\n\n// Services\nexport * from './lib/services/artifact-icon.service';\nexport * from './lib/services/artifact-file.service';\nexport * from './lib/services/analyze-artifact.service';\nexport * from './lib/services/interactive-form-apply.service';\n\n// Interfaces\nexport * from './lib/interfaces/artifact-viewer-plugin.interface';\n\n// Base component\nexport * from './lib/components/base-artifact-viewer.component';\n\n// Snapshot helpers (pure functions for creating DataSnapshots from artifact content)\nexport * from './lib/snapshot-helpers';\n\n// Artifact type plugin viewer (loads appropriate plugin based on DriverClass)\nexport * from './lib/components/artifact-type-plugin-viewer.component';\n\n// Artifact viewer UI components\nexport * from './lib/components/artifact-viewer-panel.component';\nexport * from './lib/components/artifact-version-history.component';\nexport * from './lib/components/artifact-message-card.component';\n\n// Plugin components\nexport * from './lib/components/plugins/json-artifact-viewer.component';\nexport * from './lib/components/plugins/code-artifact-viewer.component';\nexport * from './lib/components/plugins/markdown-artifact-viewer.component';\nexport * from './lib/components/plugins/html-artifact-viewer.component';\nexport * from './lib/components/plugins/svg-artifact-viewer.component';\nexport * from './lib/components/plugins/component-artifact-viewer.component';\nexport * from './lib/components/plugins/data-artifact-viewer.component';\nexport * from './lib/components/plugins/component-feedback-panel/component-feedback-panel.component';\n\n// File viewer toolbar and plugins\nexport * from './lib/components/file-artifact-toolbar.component';\nexport * from './lib/components/plugins/pdf-artifact-viewer.component';\nexport * from './lib/components/plugins/xlsx-artifact-viewer.component';\nexport * from './lib/components/plugins/docx-artifact-viewer.component';\nexport * from './lib/components/plugins/image-artifact-viewer.component';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-artifacts",
3
- "version": "5.36.0",
3
+ "version": "5.38.0",
4
4
  "description": "MemberJunction: Artifact viewer plugin system for rendering different artifact types (JSON, Code, Markdown, HTML, SVG, Components)",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -32,21 +32,23 @@
32
32
  "dependencies": {
33
33
  "@angular/cdk": "21.1.3",
34
34
  "@angular/forms": "21.1.3",
35
- "@memberjunction/core": "5.36.0",
36
- "@memberjunction/core-entities": "5.36.0",
37
- "@memberjunction/global": "5.36.0",
38
- "@memberjunction/interactive-component-types": "5.36.0",
39
- "@memberjunction/ng-base-types": "5.36.0",
40
- "@memberjunction/ng-code-editor": "5.36.0",
41
- "@memberjunction/ng-notifications": "5.36.0",
42
- "@memberjunction/ng-react": "5.36.0",
43
- "@memberjunction/ng-pagination": "5.36.0",
44
- "@memberjunction/ng-shared-generic": "5.36.0",
45
- "@memberjunction/ng-query-viewer": "5.36.0",
46
- "@memberjunction/ng-trees": "5.36.0",
47
- "@memberjunction/ng-export-service": "5.36.0",
48
- "@memberjunction/ng-markdown": "5.36.0",
49
- "@memberjunction/graphql-dataprovider": "5.36.0",
35
+ "@memberjunction/core": "5.38.0",
36
+ "@memberjunction/core-entities": "5.38.0",
37
+ "@memberjunction/global": "5.38.0",
38
+ "@memberjunction/graphql-dataprovider": "5.38.0",
39
+ "@memberjunction/interactive-component-types": "5.38.0",
40
+ "@memberjunction/ng-base-forms": "5.38.0",
41
+ "@memberjunction/ng-base-types": "5.38.0",
42
+ "@memberjunction/ng-code-editor": "5.38.0",
43
+ "@memberjunction/ng-export-service": "5.38.0",
44
+ "@memberjunction/ng-markdown": "5.38.0",
45
+ "@memberjunction/ng-notifications": "5.38.0",
46
+ "@memberjunction/ng-pagination": "5.38.0",
47
+ "@memberjunction/ng-query-viewer": "5.38.0",
48
+ "@memberjunction/ng-react": "5.38.0",
49
+ "@memberjunction/ng-shared-generic": "5.38.0",
50
+ "@memberjunction/ng-trees": "5.38.0",
51
+ "@memberjunction/ng-ui-components": "5.38.0",
50
52
  "mammoth": "^1.8.0",
51
53
  "pdfjs-dist": "^4.10.38",
52
54
  "rxjs": "^7.8.2",