@memberjunction/ng-artifacts 5.37.0 → 5.39.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 (44) 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/image-artifact-viewer.component.d.ts +129 -0
  30. package/dist/lib/components/plugins/image-artifact-viewer.component.d.ts.map +1 -0
  31. package/dist/lib/components/plugins/image-artifact-viewer.component.js +413 -0
  32. package/dist/lib/components/plugins/image-artifact-viewer.component.js.map +1 -0
  33. package/dist/lib/components/plugins/save-query-dialog.component.d.ts.map +1 -1
  34. package/dist/lib/components/plugins/save-query-dialog.component.js +0 -2
  35. package/dist/lib/components/plugins/save-query-dialog.component.js.map +1 -1
  36. package/dist/lib/services/interactive-form-apply.service.d.ts +46 -0
  37. package/dist/lib/services/interactive-form-apply.service.d.ts.map +1 -0
  38. package/dist/lib/services/interactive-form-apply.service.js +219 -0
  39. package/dist/lib/services/interactive-form-apply.service.js.map +1 -0
  40. package/dist/public-api.d.ts +2 -0
  41. package/dist/public-api.d.ts.map +1 -1
  42. package/dist/public-api.js +2 -0
  43. package/dist/public-api.js.map +1 -1
  44. package/package.json +18 -16
@@ -1 +1 @@
1
- {"version":3,"file":"component-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/component-artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAU,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5H,OAAO,EAAE,iCAAiC,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAA8B,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;;AAIlE;;;;;;;GAOG;AACH,qBAOa,gCAAiC,SAAQ,iCAAkC,YAAW,MAAM,EAAE,aAAa,EAAE,SAAS;IA6CrH,OAAO,CAAC,OAAO;IA5CE,cAAc,CAAC,EAAE,gBAAgB,CAAC;IACrD,WAAW,qBAA4B;IACvC,gBAAgB;oBAAiC,MAAM;sBAAgB,YAAY;OAAK;IAG3F,SAAS,EAAE,aAAa,GAAG,IAAI,CAAQ;IACvC,aAAa,EAAE,MAAM,CAAM;IAC3B,aAAa,EAAE,MAAM,CAAM;IAElC;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAA8B;IAEzD,IAAW,qBAAqB,IAAI,aAAa,GAAG,IAAI,CAKvD;IAGM,iBAAiB,UAAS;IAG1B,QAAQ,UAAS;IACjB,YAAY,SAAM;IAClB,YAAY,SAAM;IAEzB;;;;;;;;OAQG;IACH,IAAoB,iBAAiB,IAAI,OAAO,CAG/C;gBAEmB,OAAO,EAAE,qBAAqB;IAI5C,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxD;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAYzB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC;;OAEG;IACI,iBAAiB,IAAI,iBAAiB,EAAE;IA+D/C;;;OAGG;IACI,sBAAsB,IAAI,MAAM,EAAE;IAIzC,OAAO,CAAC,qBAAqB;IAS7B;;;;;;OAMG;IACH,2BAA2B,IAAI,IAAI;IASnC,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAYtC;;;OAGG;IACH,kBAAkB,CAAC,KAAK,EAAE;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,YAAY,CAAA;KAAC,GAAG,IAAI;IAQxD,uBAAuB,IAAI,YAAY,GAAG,IAAI;IA8B9D;;OAEG;IACH,IAAoB,gBAAgB,IAAI,OAAO,CAE9C;IAED;;OAEG;IACa,kBAAkB,IAAI,IAAI;yCAlR/B,gCAAgC;2CAAhC,gCAAgC;CAqR5C"}
1
+ {"version":3,"file":"component-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/component-artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAU,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5H,OAAO,EAAE,iCAAiC,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAA8B,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAExG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAC;;AAG7G;;;;;;;GAOG;AACH,qBAOa,gCAAiC,SAAQ,iCAAkC,YAAW,MAAM,EAAE,aAAa,EAAE,SAAS;IA4ErH,OAAO,CAAC,OAAO;IA3EE,cAAc,CAAC,EAAE,gBAAgB,CAAC;IACrD,WAAW,qBAA4B;IACvC,gBAAgB;oBAAiC,MAAM;sBAAgB,YAAY;OAAK;IAElG;;;;;OAKG;IACO,kBAAkB;cAA4B,aAAa;oBAAc,MAAM;OAAM;IAI/F,uEAAuE;IAChE,cAAc,UAAS;IAE9B,kFAAkF;IAC3E,cAAc,EAAE,UAAU,GAAG,IAAI,CAAQ;IAEhD,sEAAsE;IAC/D,UAAU,EAAE,UAAU,GAAG,IAAI,CAAQ;IAE5C,yEAAyE;IAClE,gBAAgB,UAAS;IAEhC,yDAAyD;IAClD,eAAe,SAAM;IAE5B,uBAAuB;IAChB,gBAAgB,UAAS;IACzB,gBAAgB,SAAM;IACtB,mBAAmB,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAM;IAC/D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGpC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAQ;IACvC,aAAa,EAAE,MAAM,CAAM;IAC3B,aAAa,EAAE,MAAM,CAAM;IAElC;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAA8B;IAEzD,IAAW,qBAAqB,IAAI,aAAa,GAAG,IAAI,CAKvD;IAGM,iBAAiB,UAAS;IAG1B,QAAQ,UAAS;IACjB,YAAY,SAAM;IAClB,YAAY,SAAM;IAEzB;;;;;;;;OAQG;IACH,IAAoB,iBAAiB,IAAI,OAAO,CAG/C;gBAEmB,OAAO,EAAE,qBAAqB;IAI5C,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxD;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAwBzB;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAYzB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC;;OAEG;IACI,iBAAiB,IAAI,iBAAiB,EAAE;IA+D/C;;;OAGG;IACI,sBAAsB,IAAI,MAAM,EAAE;IAIzC,OAAO,CAAC,qBAAqB;IAS7B;;;;;;OAMG;IACH,2BAA2B,IAAI,IAAI;IASnC,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAYtC;;;OAGG;IACH,kBAAkB,CAAC,KAAK,EAAE;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,YAAY,CAAA;KAAC,GAAG,IAAI;IAQxD,uBAAuB,IAAI,YAAY,GAAG,IAAI;IA8B9D;;OAEG;IACH,IAAoB,gBAAgB,IAAI,OAAO,CAE9C;IAED;;OAEG;IACa,kBAAkB,IAAI,IAAI;IAgB1C;;;;;OAKG;YACW,yBAAyB;IA0CvC;;;;;OAKG;YACW,gBAAgB;IAqB9B,gFAAgF;YAClE,kBAAkB;IAWhC,mFAAmF;IACnF,OAAO,CAAC,kBAAkB;IAU1B;;;OAGG;IACU,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC7D,gFAAgF;IACnE,cAAc,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB/E,+EAA+E;IACxE,cAAc,IAAI,IAAI;yCAtelB,gCAAgC;2CAAhC,gCAAgC;CA6e5C"}
@@ -8,13 +8,16 @@ import { Component, ViewChild, Output, EventEmitter } from '@angular/core';
8
8
  import { RegisterClass, SafeJSONParse } from '@memberjunction/global';
9
9
  import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
10
10
  import { BuildComponentCompleteCode } from '@memberjunction/interactive-component-types';
11
- import { DataSnapshot } from '@memberjunction/core';
11
+ import { isFormRole, getDeclaredFormEntityName } from '@memberjunction/interactive-component-types/forms';
12
+ import { CompositeKey, DataSnapshot, LogError, RunView } from '@memberjunction/core';
12
13
  import { DataRequirementsViewerComponent } from './data-requirements-viewer/data-requirements-viewer.component';
13
14
  import * as i0 from "@angular/core";
14
15
  import * as i1 from "@memberjunction/ng-react";
15
16
  import * as i2 from "@angular/common";
16
- import * as i3 from "./component-feedback-panel/component-feedback-panel.component";
17
+ import * as i3 from "@memberjunction/ng-base-forms";
18
+ import * as i4 from "./component-feedback-panel/component-feedback-panel.component";
17
19
  const _c0 = ["reactComponent"];
20
+ const _forTrack0 = ($index, $item) => $item.ID;
18
21
  function ComponentArtifactViewerComponent_Conditional_2_Conditional_13_Template(rf, ctx) { if (rf & 1) {
19
22
  i0.ɵɵelementStart(0, "details", 7)(1, "summary");
20
23
  i0.ɵɵtext(2, "Technical Details");
@@ -54,18 +57,159 @@ function ComponentArtifactViewerComponent_Conditional_2_Template(rf, ctx) { if (
54
57
  i0.ɵɵadvance(10);
55
58
  i0.ɵɵconditional(ctx_r0.errorDetails ? 13 : -1);
56
59
  } }
57
- function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
60
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_8_Template(rf, ctx) { if (rf & 1) {
61
+ i0.ɵɵelementStart(0, "span", 13);
62
+ i0.ɵɵtext(1, "Mock");
63
+ i0.ɵɵelementEnd();
64
+ } }
65
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_10_Template(rf, ctx) { if (rf & 1) {
66
+ i0.ɵɵelementStart(0, "span", 15);
67
+ i0.ɵɵtext(1);
68
+ i0.ɵɵelementEnd();
69
+ } if (rf & 2) {
70
+ const ctx_r0 = i0.ɵɵnextContext(2);
71
+ i0.ɵɵadvance();
72
+ i0.ɵɵtextInterpolate(ctx_r0.formEntityInfo.DisplayName || ctx_r0.formEntityInfo.Name);
73
+ } }
74
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_11_Template(rf, ctx) { if (rf & 1) {
75
+ i0.ɵɵelementStart(0, "span", 16);
76
+ i0.ɵɵelement(1, "i", 21);
77
+ i0.ɵɵelementEnd();
78
+ } if (rf & 2) {
79
+ const ctx_r0 = i0.ɵɵnextContext(2);
80
+ i0.ɵɵproperty("title", ctx_r0.formInitError);
81
+ } }
82
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_13_Template(rf, ctx) { if (rf & 1) {
83
+ const _r3 = i0.ɵɵgetCurrentView();
84
+ i0.ɵɵelementStart(0, "button", 22);
85
+ i0.ɵɵlistener("click", function ComponentArtifactViewerComponent_Conditional_3_Conditional_13_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onApplyClicked()); });
86
+ i0.ɵɵelement(1, "i", 23);
87
+ i0.ɵɵtext(2, " Apply to my form ");
88
+ i0.ɵɵelementEnd();
89
+ } }
90
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_2_For_2_Template(rf, ctx) { if (rf & 1) {
91
+ const _r5 = i0.ɵɵgetCurrentView();
92
+ i0.ɵɵelementStart(0, "li", 29);
93
+ i0.ɵɵlistener("click", function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_2_For_2_Template_li_click_0_listener() { const r_r6 = i0.ɵɵrestoreView(_r5).$implicit; const ctx_r0 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r0.onPickerSelect(r_r6)); });
94
+ i0.ɵɵelement(1, "i", 30);
95
+ i0.ɵɵelementStart(2, "span");
96
+ i0.ɵɵtext(3);
97
+ i0.ɵɵelementEnd()();
98
+ } if (rf & 2) {
99
+ const r_r6 = ctx.$implicit;
100
+ i0.ɵɵadvance(3);
101
+ i0.ɵɵtextInterpolate(r_r6.Label);
102
+ } }
103
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_2_Template(rf, ctx) { if (rf & 1) {
104
+ i0.ɵɵelementStart(0, "ul", 26);
105
+ i0.ɵɵrepeaterCreate(1, ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_2_For_2_Template, 4, 1, "li", 28, _forTrack0);
106
+ i0.ɵɵelementEnd();
107
+ } if (rf & 2) {
108
+ const ctx_r0 = i0.ɵɵnextContext(3);
109
+ i0.ɵɵadvance();
110
+ i0.ɵɵrepeater(ctx_r0.recordSearchResults);
111
+ } }
112
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_3_Template(rf, ctx) { if (rf & 1) {
113
+ i0.ɵɵelementStart(0, "div", 27);
114
+ i0.ɵɵtext(1, "No matches.");
115
+ i0.ɵɵelementEnd();
116
+ } }
117
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_4_Template(rf, ctx) { if (rf & 1) {
118
+ i0.ɵɵelementStart(0, "div", 27);
119
+ i0.ɵɵtext(1, "Start typing to search.");
120
+ i0.ɵɵelementEnd();
121
+ } }
122
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Template(rf, ctx) { if (rf & 1) {
123
+ const _r4 = i0.ɵɵgetCurrentView();
124
+ i0.ɵɵelementStart(0, "div", 24);
125
+ i0.ɵɵlistener("click", function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r4); return i0.ɵɵresetView($event.stopPropagation()); });
126
+ i0.ɵɵelementStart(1, "input", 25);
127
+ i0.ɵɵlistener("input", function ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Template_input_input_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onPickerSearchInput($event.target.value)); });
128
+ i0.ɵɵelementEnd();
129
+ i0.ɵɵconditionalCreate(2, ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_2_Template, 3, 0, "ul", 26)(3, ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_3_Template, 2, 0, "div", 27)(4, ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Conditional_4_Template, 2, 0, "div", 27);
130
+ i0.ɵɵelementEnd();
131
+ } if (rf & 2) {
132
+ const ctx_r0 = i0.ɵɵnextContext(2);
133
+ i0.ɵɵadvance();
134
+ i0.ɵɵproperty("value", ctx_r0.recordSearchTerm);
135
+ i0.ɵɵadvance();
136
+ i0.ɵɵconditional(ctx_r0.recordSearchResults.length > 0 ? 2 : ctx_r0.recordSearchTerm.length > 0 ? 3 : 4);
137
+ } }
138
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_15_Template(rf, ctx) { if (rf & 1) {
139
+ i0.ɵɵelementStart(0, "div", 20);
140
+ i0.ɵɵelement(1, "mj-interactive-form", 31);
141
+ i0.ɵɵelementEnd();
142
+ } if (rf & 2) {
143
+ const ctx_r0 = i0.ɵɵnextContext(2);
144
+ i0.ɵɵadvance();
145
+ i0.ɵɵproperty("componentSpec", ctx_r0.component)("record", ctx_r0.formRecord);
146
+ } }
147
+ function ComponentArtifactViewerComponent_Conditional_3_Conditional_16_Template(rf, ctx) { if (rf & 1) {
148
+ i0.ɵɵelementStart(0, "div", 3);
149
+ i0.ɵɵelement(1, "i", 32);
150
+ i0.ɵɵelementStart(2, "h3");
151
+ i0.ɵɵtext(3, "Form preview unavailable");
152
+ i0.ɵɵelementEnd();
153
+ i0.ɵɵelementStart(4, "p");
154
+ i0.ɵɵtext(5);
155
+ i0.ɵɵelementEnd()();
156
+ } if (rf & 2) {
157
+ const ctx_r0 = i0.ɵɵnextContext(2);
158
+ i0.ɵɵadvance(5);
159
+ i0.ɵɵtextInterpolate(ctx_r0.formInitError || "Could not bind a record to this form.");
160
+ } }
161
+ function ComponentArtifactViewerComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
58
162
  const _r2 = i0.ɵɵgetCurrentView();
59
- i0.ɵɵelementStart(0, "mj-react-component", 10, 0);
60
- i0.ɵɵlistener("componentEvent", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_componentEvent_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onComponentEvent($event)); })("openEntityRecord", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_openEntityRecord_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onOpenEntityRecord($event)); })("initialized", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_initialized_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onReactComponentInitialized()); });
163
+ i0.ɵɵelementStart(0, "div", 8);
164
+ i0.ɵɵelement(1, "i", 9);
165
+ i0.ɵɵelementStart(2, "span", 10);
166
+ i0.ɵɵtext(3, "Previewing record:");
167
+ i0.ɵɵelementEnd();
168
+ i0.ɵɵelementStart(4, "button", 11);
169
+ i0.ɵɵlistener("click", function ComponentArtifactViewerComponent_Conditional_3_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.showRecordPicker = !ctx_r0.showRecordPicker); });
170
+ i0.ɵɵelement(5, "i", 12);
171
+ i0.ɵɵelementStart(6, "strong");
172
+ i0.ɵɵtext(7);
173
+ i0.ɵɵelementEnd();
174
+ i0.ɵɵconditionalCreate(8, ComponentArtifactViewerComponent_Conditional_3_Conditional_8_Template, 2, 0, "span", 13);
175
+ i0.ɵɵelement(9, "i", 14);
176
+ i0.ɵɵelementEnd();
177
+ i0.ɵɵconditionalCreate(10, ComponentArtifactViewerComponent_Conditional_3_Conditional_10_Template, 2, 1, "span", 15);
178
+ i0.ɵɵconditionalCreate(11, ComponentArtifactViewerComponent_Conditional_3_Conditional_11_Template, 2, 1, "span", 16);
179
+ i0.ɵɵelement(12, "span", 17);
180
+ i0.ɵɵconditionalCreate(13, ComponentArtifactViewerComponent_Conditional_3_Conditional_13_Template, 3, 0, "button", 18);
181
+ i0.ɵɵelementEnd();
182
+ i0.ɵɵconditionalCreate(14, ComponentArtifactViewerComponent_Conditional_3_Conditional_14_Template, 5, 2, "div", 19);
183
+ i0.ɵɵconditionalCreate(15, ComponentArtifactViewerComponent_Conditional_3_Conditional_15_Template, 2, 2, "div", 20)(16, ComponentArtifactViewerComponent_Conditional_3_Conditional_16_Template, 6, 1, "div", 3);
184
+ } if (rf & 2) {
185
+ const ctx_r0 = i0.ɵɵnextContext();
186
+ i0.ɵɵadvance(7);
187
+ i0.ɵɵtextInterpolate(ctx_r0.formRecordLabel || "No record");
188
+ i0.ɵɵadvance();
189
+ i0.ɵɵconditional(!ctx_r0.formRecordIsReal ? 8 : -1);
190
+ i0.ɵɵadvance(2);
191
+ i0.ɵɵconditional(ctx_r0.formEntityInfo ? 10 : -1);
192
+ i0.ɵɵadvance();
193
+ i0.ɵɵconditional(ctx_r0.formInitError ? 11 : -1);
194
+ i0.ɵɵadvance(2);
195
+ i0.ɵɵconditional(ctx_r0.formEntityInfo ? 13 : -1);
196
+ i0.ɵɵadvance();
197
+ i0.ɵɵconditional(ctx_r0.showRecordPicker && ctx_r0.formEntityInfo ? 14 : -1);
198
+ i0.ɵɵadvance();
199
+ i0.ɵɵconditional(ctx_r0.formRecord && ctx_r0.component ? 15 : 16);
200
+ } }
201
+ function ComponentArtifactViewerComponent_Conditional_4_Conditional_0_Template(rf, ctx) { if (rf & 1) {
202
+ const _r7 = i0.ɵɵgetCurrentView();
203
+ i0.ɵɵelementStart(0, "mj-react-component", 35, 0);
204
+ i0.ɵɵlistener("componentEvent", function ComponentArtifactViewerComponent_Conditional_4_Conditional_0_Template_mj_react_component_componentEvent_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onComponentEvent($event)); })("openEntityRecord", function ComponentArtifactViewerComponent_Conditional_4_Conditional_0_Template_mj_react_component_openEntityRecord_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onOpenEntityRecord($event)); })("initialized", function ComponentArtifactViewerComponent_Conditional_4_Conditional_0_Template_mj_react_component_initialized_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onReactComponentInitialized()); });
61
205
  i0.ɵɵelementEnd();
62
206
  } if (rf & 2) {
63
207
  const ctx_r0 = i0.ɵɵnextContext(2);
64
208
  i0.ɵɵproperty("component", ctx_r0.component);
65
209
  } }
66
- function ComponentArtifactViewerComponent_Conditional_3_Conditional_1_Template(rf, ctx) { if (rf & 1) {
67
- i0.ɵɵelementStart(0, "div", 9);
68
- i0.ɵɵelement(1, "i", 11);
210
+ function ComponentArtifactViewerComponent_Conditional_4_Conditional_1_Template(rf, ctx) { if (rf & 1) {
211
+ i0.ɵɵelementStart(0, "div", 34);
212
+ i0.ɵɵelement(1, "i", 36);
69
213
  i0.ɵɵelementStart(2, "h3");
70
214
  i0.ɵɵtext(3, "Component Specification");
71
215
  i0.ɵɵelementEnd();
@@ -76,9 +220,9 @@ function ComponentArtifactViewerComponent_Conditional_3_Conditional_1_Template(r
76
220
  i0.ɵɵtext(7, "View the Functional, Data, or Spec tabs for details.");
77
221
  i0.ɵɵelementEnd()();
78
222
  } }
79
- function ComponentArtifactViewerComponent_Conditional_3_Conditional_2_Template(rf, ctx) { if (rf & 1) {
223
+ function ComponentArtifactViewerComponent_Conditional_4_Conditional_2_Template(rf, ctx) { if (rf & 1) {
80
224
  i0.ɵɵelementStart(0, "div", 3);
81
- i0.ɵɵelement(1, "i", 12);
225
+ i0.ɵɵelement(1, "i", 32);
82
226
  i0.ɵɵelementStart(2, "h3");
83
227
  i0.ɵɵtext(3, "No Component Loaded");
84
228
  i0.ɵɵelementEnd();
@@ -86,16 +230,16 @@ function ComponentArtifactViewerComponent_Conditional_3_Conditional_2_Template(r
86
230
  i0.ɵɵtext(5, "The component data is missing or invalid.");
87
231
  i0.ɵɵelementEnd()();
88
232
  } }
89
- function ComponentArtifactViewerComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
90
- i0.ɵɵconditionalCreate(0, ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template, 2, 1, "mj-react-component", 8)(1, ComponentArtifactViewerComponent_Conditional_3_Conditional_1_Template, 8, 0, "div", 9)(2, ComponentArtifactViewerComponent_Conditional_3_Conditional_2_Template, 6, 0, "div", 3);
233
+ function ComponentArtifactViewerComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
234
+ i0.ɵɵconditionalCreate(0, ComponentArtifactViewerComponent_Conditional_4_Conditional_0_Template, 2, 1, "mj-react-component", 33)(1, ComponentArtifactViewerComponent_Conditional_4_Conditional_1_Template, 8, 0, "div", 34)(2, ComponentArtifactViewerComponent_Conditional_4_Conditional_2_Template, 6, 0, "div", 3);
91
235
  } if (rf & 2) {
92
236
  const ctx_r0 = i0.ɵɵnextContext();
93
237
  i0.ɵɵconditional(ctx_r0.component && (ctx_r0.component.code || ctx_r0.component.namespace) ? 0 : ctx_r0.component ? 1 : 2);
94
238
  } }
95
- function ComponentArtifactViewerComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
96
- const _r3 = i0.ɵɵgetCurrentView();
97
- i0.ɵɵelementStart(0, "mj-component-feedback-panel", 13);
98
- i0.ɵɵlistener("Closed", function ComponentArtifactViewerComponent_Conditional_4_Template_mj_component_feedback_panel_Closed_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.ShowFeedbackPanel = false); });
239
+ function ComponentArtifactViewerComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
240
+ const _r8 = i0.ɵɵgetCurrentView();
241
+ i0.ɵɵelementStart(0, "mj-component-feedback-panel", 37);
242
+ i0.ɵɵlistener("Closed", function ComponentArtifactViewerComponent_Conditional_5_Template_mj_component_feedback_panel_Closed_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.ShowFeedbackPanel = false); });
99
243
  i0.ɵɵelementEnd();
100
244
  } if (rf & 2) {
101
245
  const ctx_r0 = i0.ɵɵnextContext();
@@ -114,6 +258,29 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
114
258
  reactComponent;
115
259
  tabsChanged = new EventEmitter();
116
260
  openEntityRecord = new EventEmitter();
261
+ /**
262
+ * Emitted when the user clicks "Apply to my form" on a form-role artifact.
263
+ * Carries the spec (ready to hand to the agent's Create/Modify action) and
264
+ * the entity name. The host is responsible for confirming + invoking the
265
+ * actual server action.
266
+ */
267
+ applyFormRequested = new EventEmitter();
268
+ // ── Form-aware state (only populated when componentRole === 'form') ──
269
+ /** True when this artifact's spec declares `componentRole: 'form'`. */
270
+ isFormArtifact = false;
271
+ /** Entity the form targets — resolved from spec.entityName / dataRequirements. */
272
+ formEntityInfo = null;
273
+ /** The real or fixture record currently bound to the form preview. */
274
+ formRecord = null;
275
+ /** True iff `formRecord` is a real DB row (vs a fixture NewRecord()). */
276
+ formRecordIsReal = false;
277
+ /** Label for the chip (e.g. the record's Name field). */
278
+ formRecordLabel = '';
279
+ /** Picker UI state. */
280
+ showRecordPicker = false;
281
+ recordSearchTerm = '';
282
+ recordSearchResults = [];
283
+ formInitError = null;
117
284
  // Component data
118
285
  component = null;
119
286
  componentCode = "";
@@ -179,6 +346,11 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
179
346
  if (this.artifactVersion?.Content) {
180
347
  this.component = SafeJSONParse(this.artifactVersion.Content);
181
348
  this.extractComponentParts();
349
+ // Form-aware detection. Done here (not in ngAfterViewInit) so the
350
+ // template's `@if (isFormArtifact)` branch decides which preview
351
+ // to mount on the very first render — no flash of the non-form
352
+ // path before the form-aware UI takes over.
353
+ this.detectAndInitFormArtifact();
182
354
  }
183
355
  else {
184
356
  throw new Error('Artifact content is empty');
@@ -360,25 +532,200 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
360
532
  AskUserForFeedback() {
361
533
  this.ShowFeedbackPanel = !this.ShowFeedbackPanel;
362
534
  }
535
+ // ════════════════════════════════════════════════════════════════════
536
+ // FORM-AWARE BRANCH
537
+ //
538
+ // When the artifact's spec declares `componentRole: 'form'`, the viewer
539
+ // delegates rendering to `<mj-interactive-form>` instead of the raw
540
+ // `<mj-react-component>` path. This gives the React form a proper
541
+ // FormHostProps binding (bound to a real DB record by default) and lets
542
+ // the user swap records via a search picker before applying.
543
+ //
544
+ // Triggered from `loadComponentSpec()` after the spec parses.
545
+ // ════════════════════════════════════════════════════════════════════
546
+ /**
547
+ * Detect form-role and kick off entity + record resolution. Failure modes
548
+ * (missing entity, RunView failure, entity has no rows) fall back to a
549
+ * synthetic record from `BaseEntity.NewRecord()` so the form still mounts
550
+ * against type-appropriate empty values.
551
+ */
552
+ async detectAndInitFormArtifact() {
553
+ this.isFormArtifact = false;
554
+ this.formEntityInfo = null;
555
+ this.formRecord = null;
556
+ this.formRecordIsReal = false;
557
+ this.formRecordLabel = '';
558
+ this.formInitError = null;
559
+ const spec = this.component;
560
+ if (!spec || !isFormRole(spec))
561
+ return;
562
+ this.isFormArtifact = true;
563
+ const entityName = getDeclaredFormEntityName(spec);
564
+ if (!entityName) {
565
+ this.formInitError = 'Form artifact has no declared entity. Showing without record context.';
566
+ return;
567
+ }
568
+ const provider = this.ProviderToUse;
569
+ const entity = provider?.EntityByName(entityName);
570
+ if (!entity) {
571
+ this.formInitError = `Entity "${entityName}" not registered with the active provider.`;
572
+ return;
573
+ }
574
+ this.formEntityInfo = entity;
575
+ // Load Top-1 record by default. If empty / fails, fall back to a fresh
576
+ // synthetic record. Either way the form mounts — failure to find a real
577
+ // record is informational, not fatal.
578
+ const record = await this.loadTopOneRecord(entity);
579
+ if (record) {
580
+ this.formRecord = record;
581
+ this.formRecordIsReal = true;
582
+ this.formRecordLabel = this.computeRecordLabel(record);
583
+ }
584
+ else {
585
+ this.formRecord = await this.buildFixtureRecord(entity);
586
+ this.formRecordIsReal = false;
587
+ this.formRecordLabel = 'Mock data';
588
+ }
589
+ }
590
+ /**
591
+ * Load the first row by NameField (then __mj_CreatedAt) so different users
592
+ * opening the same form-role artifact see the same record bound to the
593
+ * preview. (Retrospective fix #7 — un-ordered Top-1 was physical-order
594
+ * and non-deterministic.)
595
+ */
596
+ async loadTopOneRecord(entity) {
597
+ try {
598
+ const orderBy = entity.NameField?.Name
599
+ ? `${entity.NameField.Name} ASC`
600
+ : `__mj_CreatedAt DESC`;
601
+ const rv = RunView.FromMetadataProvider(this.ProviderToUse);
602
+ const result = await rv.RunView({
603
+ EntityName: entity.Name,
604
+ MaxRows: 1,
605
+ OrderBy: orderBy,
606
+ ResultType: 'entity_object',
607
+ }, this.ProviderToUse.CurrentUser);
608
+ if (result.Success && (result.Results?.length ?? 0) > 0) {
609
+ return result.Results[0];
610
+ }
611
+ }
612
+ catch (err) {
613
+ LogError(`ComponentArtifactViewer: Top-1 RunView failed for ${entity.Name}: ${err instanceof Error ? err.message : String(err)}`);
614
+ }
615
+ return null;
616
+ }
617
+ /** Synthetic "create-mode" record when no real row exists or RunView failed. */
618
+ async buildFixtureRecord(entity) {
619
+ try {
620
+ const fresh = await this.ProviderToUse.GetEntityObject(entity.Name, this.ProviderToUse.CurrentUser);
621
+ fresh.NewRecord();
622
+ return fresh;
623
+ }
624
+ catch (err) {
625
+ LogError(`ComponentArtifactViewer: failed to build fixture record for ${entity.Name}: ${err instanceof Error ? err.message : String(err)}`);
626
+ return null;
627
+ }
628
+ }
629
+ /** Pull a human-readable label from the record's NameField or first text field. */
630
+ computeRecordLabel(record) {
631
+ const nameField = record.EntityInfo.NameField?.Name;
632
+ if (nameField) {
633
+ const v = record.Get(nameField);
634
+ if (v != null && String(v).trim().length > 0)
635
+ return String(v);
636
+ }
637
+ if (record.PrimaryKey?.HasValue)
638
+ return record.PrimaryKey.ToConcatenatedString();
639
+ return record.EntityInfo.Name;
640
+ }
641
+ /**
642
+ * Search-as-you-type for the picker. Queries by name field (or any
643
+ * indexed string field, best-effort). Limits to 8 hits for tightness.
644
+ */
645
+ async onPickerSearchInput(term) {
646
+ this.recordSearchTerm = term;
647
+ if (!this.formEntityInfo || term.trim().length === 0) {
648
+ this.recordSearchResults = [];
649
+ return;
650
+ }
651
+ const nameField = this.formEntityInfo.NameField?.Name;
652
+ if (!nameField) {
653
+ this.recordSearchResults = [];
654
+ return;
655
+ }
656
+ try {
657
+ const rv = RunView.FromMetadataProvider(this.ProviderToUse);
658
+ // Best-effort LIKE filter against the entity's name field. Wrap the
659
+ // term so we don't break SQL — RunView passes ExtraFilter as-is.
660
+ const safe = term.replace(/'/g, "''");
661
+ const result = await rv.RunView({
662
+ EntityName: this.formEntityInfo.Name,
663
+ ExtraFilter: `${nameField} LIKE '%${safe}%'`,
664
+ MaxRows: 8,
665
+ ResultType: 'entity_object',
666
+ }, this.ProviderToUse.CurrentUser);
667
+ if (result.Success) {
668
+ this.recordSearchResults = (result.Results ?? []).map(r => ({
669
+ ID: r.PrimaryKey?.ToConcatenatedString() ?? '',
670
+ Label: this.computeRecordLabel(r),
671
+ }));
672
+ }
673
+ }
674
+ catch (err) {
675
+ LogError(`ComponentArtifactViewer: picker search failed: ${err instanceof Error ? err.message : String(err)}`);
676
+ this.recordSearchResults = [];
677
+ }
678
+ }
679
+ /** User picked a different record from the search results. Re-bind the form. */
680
+ async onPickerSelect(item) {
681
+ if (!this.formEntityInfo)
682
+ return;
683
+ try {
684
+ const rec = await this.ProviderToUse.GetEntityObject(this.formEntityInfo.Name, this.ProviderToUse.CurrentUser);
685
+ const pk = new CompositeKey();
686
+ pk.LoadFromURLSegment(this.formEntityInfo, item.ID);
687
+ const loaded = await rec.InnerLoad(pk);
688
+ if (loaded) {
689
+ this.formRecord = rec;
690
+ this.formRecordIsReal = true;
691
+ this.formRecordLabel = item.Label;
692
+ this.showRecordPicker = false;
693
+ this.recordSearchTerm = '';
694
+ this.recordSearchResults = [];
695
+ }
696
+ }
697
+ catch (err) {
698
+ LogError(`ComponentArtifactViewer: failed to load picked record ${item.ID}: ${err instanceof Error ? err.message : String(err)}`);
699
+ }
700
+ }
701
+ /** Bubble Apply intent up to the host (Form Builder dashboard / Sage chat). */
702
+ onApplyClicked() {
703
+ if (!this.component || !this.formEntityInfo)
704
+ return;
705
+ this.applyFormRequested.emit({
706
+ spec: this.component,
707
+ entityName: this.formEntityInfo.Name,
708
+ });
709
+ }
363
710
  static ɵfac = function ComponentArtifactViewerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComponentArtifactViewerComponent)(i0.ɵɵdirectiveInject(i1.AngularAdapterService)); };
364
711
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ComponentArtifactViewerComponent, selectors: [["mj-component-artifact-viewer"]], viewQuery: function ComponentArtifactViewerComponent_Query(rf, ctx) { if (rf & 1) {
365
712
  i0.ɵɵviewQuery(_c0, 5);
366
713
  } if (rf & 2) {
367
714
  let _t;
368
715
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.reactComponent = _t.first);
369
- } }, outputs: { tabsChanged: "tabsChanged", openEntityRecord: "openEntityRecord" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 5, vars: 3, consts: [["reactComponent", ""], [1, "component-artifact-viewer", 3, "ngClass"], [1, "component-preview"], [1, "error-state"], [3, "ComponentSpec", "ReactContainerElement"], [1, "fa-solid", "fa-exclamation-triangle"], [2, "text-align", "left", "max-width", "500px", "color", "var(--mj-text-muted)", "line-height", "1.6"], [2, "margin-top", "20px"], [3, "component"], [1, "no-code-state"], [3, "componentEvent", "openEntityRecord", "initialized", "component"], [1, "fa-solid", "fa-file-lines"], [1, "fa-solid", "fa-exclamation-circle"], [3, "Closed", "ComponentSpec", "ReactContainerElement"]], template: function ComponentArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
716
+ } }, outputs: { tabsChanged: "tabsChanged", openEntityRecord: "openEntityRecord", applyFormRequested: "applyFormRequested" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 6, vars: 3, consts: [["reactComponent", ""], [1, "component-artifact-viewer", 3, "ngClass"], [1, "component-preview"], [1, "error-state"], [3, "ComponentSpec", "ReactContainerElement"], [1, "fa-solid", "fa-exclamation-triangle"], [2, "text-align", "left", "max-width", "500px", "color", "var(--mj-text-muted)", "line-height", "1.6"], [2, "margin-top", "20px"], [1, "form-artifact-toolstrip"], ["aria-hidden", "true", 1, "fa-solid", "fa-circle-info"], [1, "form-artifact-toolstrip-label"], ["type", "button", 1, "form-artifact-picker-chip", 3, "click"], [1, "fa-solid", "fa-magnifying-glass"], [1, "form-artifact-picker-chip-badge"], [1, "fa-solid", "fa-chevron-down"], [1, "form-artifact-toolstrip-entity"], [1, "form-artifact-toolstrip-warning", 3, "title"], [2, "flex", "1"], ["type", "button", 1, "form-artifact-apply-btn"], [1, "form-artifact-picker-panel"], [1, "form-artifact-form-host"], [1, "fa-solid", "fa-triangle-exclamation"], ["type", "button", 1, "form-artifact-apply-btn", 3, "click"], [1, "fa-solid", "fa-circle-check"], [1, "form-artifact-picker-panel", 3, "click"], ["type", "text", "placeholder", "Search records by name\u2026", 1, "form-artifact-picker-search", 3, "input", "value"], [1, "form-artifact-picker-results"], [1, "form-artifact-picker-empty"], [1, "form-artifact-picker-row"], [1, "form-artifact-picker-row", 3, "click"], [1, "fa-solid", "fa-circle-dot"], [3, "componentSpec", "record"], [1, "fa-solid", "fa-exclamation-circle"], [3, "component"], [1, "no-code-state"], [3, "componentEvent", "openEntityRecord", "initialized", "component"], [1, "fa-solid", "fa-file-lines"], [3, "Closed", "ComponentSpec", "ReactContainerElement"]], template: function ComponentArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
370
717
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
371
- i0.ɵɵconditionalCreate(2, ComponentArtifactViewerComponent_Conditional_2_Template, 14, 2, "div", 3)(3, ComponentArtifactViewerComponent_Conditional_3_Template, 3, 1);
718
+ i0.ɵɵconditionalCreate(2, ComponentArtifactViewerComponent_Conditional_2_Template, 14, 2, "div", 3)(3, ComponentArtifactViewerComponent_Conditional_3_Template, 17, 7)(4, ComponentArtifactViewerComponent_Conditional_4_Template, 3, 1);
372
719
  i0.ɵɵelementEnd();
373
- i0.ɵɵconditionalCreate(4, ComponentArtifactViewerComponent_Conditional_4_Template, 1, 2, "mj-component-feedback-panel", 4);
720
+ i0.ɵɵconditionalCreate(5, ComponentArtifactViewerComponent_Conditional_5_Template, 1, 2, "mj-component-feedback-panel", 4);
374
721
  i0.ɵɵelementEnd();
375
722
  } if (rf & 2) {
376
723
  i0.ɵɵproperty("ngClass", ctx.cssClass);
377
724
  i0.ɵɵadvance(2);
378
- i0.ɵɵconditional(ctx.hasError ? 2 : 3);
379
- i0.ɵɵadvance(2);
380
- i0.ɵɵconditional(ctx.ShowFeedbackPanel && ctx.resolvedComponentSpec ? 4 : -1);
381
- } }, dependencies: [i2.NgClass, i1.MJReactComponent, i3.ComponentFeedbackPanelComponent], styles: [".component-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: var(--mj-bg-surface);\n}\n\n.component-preview[_ngcontent-%COMP%] {\n flex: 1;\n padding: 15px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n\n\n.component-preview[_ngcontent-%COMP%] mj-react-component[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-status-error);\n flex: 1;\n min-height: 300px;\n}\n.error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n margin-bottom: 16px;\n}\n.error-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n font-size: 20px;\n}\n.error-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0 0 12px 0;\n color: var(--mj-text-muted);\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] {\n cursor: pointer;\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-bottom: 8px;\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:hover {\n color: var(--mj-text-primary);\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: var(--mj-text-secondary);\n margin: 0;\n}\n\n\n\n.no-code-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-muted);\n flex: 1;\n}\n.no-code-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n margin-bottom: 16px;\n color: var(--mj-brand-primary);\n}\n.no-code-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n font-size: 20px;\n color: var(--mj-text-secondary);\n}\n.no-code-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n color: var(--mj-text-muted);\n}"] });
725
+ i0.ɵɵconditional(ctx.hasError ? 2 : ctx.isFormArtifact ? 3 : 4);
726
+ i0.ɵɵadvance(3);
727
+ i0.ɵɵconditional(ctx.ShowFeedbackPanel && ctx.resolvedComponentSpec ? 5 : -1);
728
+ } }, dependencies: [i2.NgClass, i1.MJReactComponent, i3.InteractiveFormComponent, i4.ComponentFeedbackPanelComponent], styles: [".component-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: var(--mj-bg-surface);\n}\n\n.component-preview[_ngcontent-%COMP%] {\n flex: 1;\n padding: 15px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n\n\n.component-preview[_ngcontent-%COMP%] mj-react-component[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-status-error);\n flex: 1;\n min-height: 300px;\n}\n.error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n margin-bottom: 16px;\n}\n.error-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n font-size: 20px;\n}\n.error-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0 0 12px 0;\n color: var(--mj-text-muted);\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] {\n cursor: pointer;\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-bottom: 8px;\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:hover {\n color: var(--mj-text-primary);\n}\n.error-state[_ngcontent-%COMP%] details[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: var(--mj-text-secondary);\n margin: 0;\n}\n\n\n\n.no-code-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-muted);\n flex: 1;\n}\n.no-code-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n margin-bottom: 16px;\n color: var(--mj-brand-primary);\n}\n.no-code-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n font-size: 20px;\n color: var(--mj-text-secondary);\n}\n.no-code-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n color: var(--mj-text-muted);\n}\n\n\n\n\n\n\n\n\n\n\n.form-artifact-toolstrip[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 14px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n.form-artifact-toolstrip-label[_ngcontent-%COMP%] {\n font-weight: 600;\n}\n.form-artifact-toolstrip-entity[_ngcontent-%COMP%] {\n margin-left: 4px;\n padding: 2px 8px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 30%, var(--mj-bg-surface));\n border-radius: 999px;\n font-size: 11px;\n font-weight: 600;\n}\n.form-artifact-toolstrip-warning[_ngcontent-%COMP%] {\n color: var(--mj-status-warning-text);\n}\n\n.form-artifact-picker-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n padding: 4px 10px;\n font-size: 12px;\n color: var(--mj-text-primary);\n cursor: pointer;\n}\n.form-artifact-picker-chip[_ngcontent-%COMP%]:hover, \n.form-artifact-picker-chip[_ngcontent-%COMP%]:focus {\n border-color: var(--mj-border-focus);\n outline: none;\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.form-artifact-picker-chip[_ngcontent-%COMP%] strong[_ngcontent-%COMP%] {\n color: var(--mj-text-primary);\n font-weight: 600;\n}\n.form-artifact-picker-chip-badge[_ngcontent-%COMP%] {\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning-text);\n border: 1px solid var(--mj-status-warning-border);\n font-size: 10px;\n font-weight: 700;\n padding: 1px 6px;\n border-radius: 999px;\n}\n\n.form-artifact-apply-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #ffffff);\n border: 1px solid var(--mj-brand-primary);\n border-radius: var(--mj-radius-md, 8px);\n padding: 5px 12px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.form-artifact-apply-btn[_ngcontent-%COMP%]:hover {\n background: var(--mj-brand-primary-hover, var(--mj-brand-primary));\n}\n\n.form-artifact-picker-panel[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface);\n border-bottom: 1px solid var(--mj-border-default);\n padding: 10px 14px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.form-artifact-picker-search[_ngcontent-%COMP%] {\n width: 100%;\n padding: 7px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface);\n font-size: 13px;\n color: var(--mj-text-primary);\n}\n.form-artifact-picker-search[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--mj-border-focus);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.form-artifact-picker-results[_ngcontent-%COMP%] {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.form-artifact-picker-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 13px;\n}\n.form-artifact-picker-row[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n.form-artifact-picker-row[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 10px;\n}\n.form-artifact-picker-empty[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 12px;\n font-style: italic;\n}\n\n.form-artifact-form-host[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n background: var(--mj-bg-page);\n}"] });
382
729
  };
383
730
  ComponentArtifactViewerComponent = __decorate([
384
731
  RegisterClass(BaseArtifactViewerPluginComponent, 'ComponentArtifactViewerPlugin')
@@ -386,7 +733,7 @@ ComponentArtifactViewerComponent = __decorate([
386
733
  export { ComponentArtifactViewerComponent };
387
734
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentArtifactViewerComponent, [{
388
735
  type: Component,
389
- args: [{ standalone: false, selector: 'mj-component-artifact-viewer', template: "<div class=\"component-artifact-viewer\" [ngClass]=\"cssClass\">\n <!-- Component Preview (full screen) -->\n <div class=\"component-preview\">\n @if (hasError) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <h3>{{ errorMessage }}</h3>\n <p>This component could not be loaded. This usually happens when:</p>\n <ul style=\"text-align: left; max-width: 500px; color: var(--mj-text-muted); line-height: 1.6;\">\n <li>The component registry is unavailable or unreachable</li>\n <li>The component version does not exist in the registry</li>\n <li>There was a network error during component retrieval</li>\n </ul>\n @if (errorDetails) {\n <details style=\"margin-top: 20px;\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n } @else {\n <!-- Only render React component if there's code to execute -->\n @if (component && (component.code || component.namespace)) {\n <mj-react-component\n #reactComponent\n [component]=\"component\"\n (componentEvent)=\"onComponentEvent($event)\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (initialized)=\"onReactComponentInitialized()\">\n </mj-react-component>\n } @else if (component) {\n <!-- Component spec exists but no code - show informational message -->\n <div class=\"no-code-state\">\n <i class=\"fa-solid fa-file-lines\"></i>\n <h3>Component Specification</h3>\n <p>This component has specifications but no executable code yet.</p>\n <p>View the Functional, Data, or Spec tabs for details.</p>\n </div>\n } @else {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n <h3>No Component Loaded</h3>\n <p>The component data is missing or invalid.</p>\n </div>\n }\n }\n </div>\n\n <!-- Feedback overlay panel (invoked from header button via AskUserForFeedback) -->\n @if (ShowFeedbackPanel && resolvedComponentSpec) {\n <mj-component-feedback-panel\n [ComponentSpec]=\"resolvedComponentSpec\"\n [ReactContainerElement]=\"reactComponent?.container?.nativeElement || null\"\n (Closed)=\"ShowFeedbackPanel = false\">\n </mj-component-feedback-panel>\n }\n</div>\n\n", styles: [".component-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: var(--mj-bg-surface);\n}\n\n.component-preview {\n flex: 1;\n padding: 15px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* Ensure React component takes full height */\n.component-preview mj-react-component {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-status-error);\n flex: 1;\n min-height: 300px;\n}\n.error-state i {\n font-size: 48px;\n margin-bottom: 16px;\n}\n.error-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n}\n.error-state p {\n margin: 0 0 12px 0;\n color: var(--mj-text-muted);\n}\n.error-state details {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n}\n.error-state details summary {\n cursor: pointer;\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-bottom: 8px;\n}\n.error-state details summary:hover {\n color: var(--mj-text-primary);\n}\n.error-state details pre {\n background: var(--mj-bg-surface-sunken);\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: var(--mj-text-secondary);\n margin: 0;\n}\n\n/* State for component spec without executable code */\n.no-code-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-muted);\n flex: 1;\n}\n.no-code-state i {\n font-size: 48px;\n margin-bottom: 16px;\n color: var(--mj-brand-primary);\n}\n.no-code-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n color: var(--mj-text-secondary);\n}\n.no-code-state p {\n margin: 0 0 8px 0;\n color: var(--mj-text-muted);\n}\n\n"] }]
736
+ args: [{ standalone: false, selector: 'mj-component-artifact-viewer', template: "<div class=\"component-artifact-viewer\" [ngClass]=\"cssClass\">\n <!-- Component Preview (full screen) -->\n <div class=\"component-preview\">\n @if (hasError) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <h3>{{ errorMessage }}</h3>\n <p>This component could not be loaded. This usually happens when:</p>\n <ul style=\"text-align: left; max-width: 500px; color: var(--mj-text-muted); line-height: 1.6;\">\n <li>The component registry is unavailable or unreachable</li>\n <li>The component version does not exist in the registry</li>\n <li>There was a network error during component retrieval</li>\n </ul>\n @if (errorDetails) {\n <details style=\"margin-top: 20px;\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n } @else if (isFormArtifact) {\n <!-- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n FORM-AWARE BRANCH\n Spec declares componentRole: 'form'. Render via\n <mj-interactive-form> bound to a real Top-1 record\n (or a synthetic NewRecord fallback). Picker chip\n lets the user swap records; Apply promotes the\n spec to an EntityFormOverride.\n \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 -->\n <div class=\"form-artifact-toolstrip\">\n <i class=\"fa-solid fa-circle-info\" aria-hidden=\"true\"></i>\n <span class=\"form-artifact-toolstrip-label\">Previewing record:</span>\n <button\n type=\"button\"\n class=\"form-artifact-picker-chip\"\n (click)=\"showRecordPicker = !showRecordPicker\">\n <i class=\"fa-solid fa-magnifying-glass\"></i>\n <strong>{{ formRecordLabel || 'No record' }}</strong>\n @if (!formRecordIsReal) {\n <span class=\"form-artifact-picker-chip-badge\">Mock</span>\n }\n <i class=\"fa-solid fa-chevron-down\"></i>\n </button>\n @if (formEntityInfo) {\n <span class=\"form-artifact-toolstrip-entity\">{{ formEntityInfo.DisplayName || formEntityInfo.Name }}</span>\n }\n @if (formInitError) {\n <span class=\"form-artifact-toolstrip-warning\" [title]=\"formInitError\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </span>\n }\n <span style=\"flex: 1;\"></span>\n @if (formEntityInfo) {\n <button\n type=\"button\"\n class=\"form-artifact-apply-btn\"\n (click)=\"onApplyClicked()\">\n <i class=\"fa-solid fa-circle-check\"></i>\n Apply to my form\n </button>\n }\n </div>\n\n @if (showRecordPicker && formEntityInfo) {\n <div class=\"form-artifact-picker-panel\" (click)=\"$event.stopPropagation()\">\n <input\n type=\"text\"\n class=\"form-artifact-picker-search\"\n placeholder=\"Search records by name\u2026\"\n [value]=\"recordSearchTerm\"\n (input)=\"onPickerSearchInput($any($event.target).value)\" />\n @if (recordSearchResults.length > 0) {\n <ul class=\"form-artifact-picker-results\">\n @for (r of recordSearchResults; track r.ID) {\n <li\n class=\"form-artifact-picker-row\"\n (click)=\"onPickerSelect(r)\">\n <i class=\"fa-solid fa-circle-dot\"></i>\n <span>{{ r.Label }}</span>\n </li>\n }\n </ul>\n } @else if (recordSearchTerm.length > 0) {\n <div class=\"form-artifact-picker-empty\">No matches.</div>\n } @else {\n <div class=\"form-artifact-picker-empty\">Start typing to search.</div>\n }\n </div>\n }\n\n @if (formRecord && component) {\n <div class=\"form-artifact-form-host\">\n <mj-interactive-form\n [componentSpec]=\"component\"\n [record]=\"formRecord\">\n </mj-interactive-form>\n </div>\n } @else {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n <h3>Form preview unavailable</h3>\n <p>{{ formInitError || 'Could not bind a record to this form.' }}</p>\n </div>\n }\n } @else {\n <!-- Default (non-form) interactive component path -->\n @if (component && (component.code || component.namespace)) {\n <mj-react-component\n #reactComponent\n [component]=\"component\"\n (componentEvent)=\"onComponentEvent($event)\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (initialized)=\"onReactComponentInitialized()\">\n </mj-react-component>\n } @else if (component) {\n <!-- Component spec exists but no code - show informational message -->\n <div class=\"no-code-state\">\n <i class=\"fa-solid fa-file-lines\"></i>\n <h3>Component Specification</h3>\n <p>This component has specifications but no executable code yet.</p>\n <p>View the Functional, Data, or Spec tabs for details.</p>\n </div>\n } @else {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n <h3>No Component Loaded</h3>\n <p>The component data is missing or invalid.</p>\n </div>\n }\n }\n </div>\n\n <!-- Feedback overlay panel (invoked from header button via AskUserForFeedback) -->\n @if (ShowFeedbackPanel && resolvedComponentSpec) {\n <mj-component-feedback-panel\n [ComponentSpec]=\"resolvedComponentSpec\"\n [ReactContainerElement]=\"reactComponent?.container?.nativeElement || null\"\n (Closed)=\"ShowFeedbackPanel = false\">\n </mj-component-feedback-panel>\n }\n</div>\n", styles: [".component-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: var(--mj-bg-surface);\n}\n\n.component-preview {\n flex: 1;\n padding: 15px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* Ensure React component takes full height */\n.component-preview mj-react-component {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-status-error);\n flex: 1;\n min-height: 300px;\n}\n.error-state i {\n font-size: 48px;\n margin-bottom: 16px;\n}\n.error-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n}\n.error-state p {\n margin: 0 0 12px 0;\n color: var(--mj-text-muted);\n}\n.error-state details {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n}\n.error-state details summary {\n cursor: pointer;\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-bottom: 8px;\n}\n.error-state details summary:hover {\n color: var(--mj-text-primary);\n}\n.error-state details pre {\n background: var(--mj-bg-surface-sunken);\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: var(--mj-text-secondary);\n margin: 0;\n}\n\n/* State for component spec without executable code */\n.no-code-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-muted);\n flex: 1;\n}\n.no-code-state i {\n font-size: 48px;\n margin-bottom: 16px;\n color: var(--mj-brand-primary);\n}\n.no-code-state h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n color: var(--mj-text-secondary);\n}\n.no-code-state p {\n margin: 0 0 8px 0;\n color: var(--mj-text-muted);\n}\n\n\n/* ====================================================================\n FORM-AWARE BRANCH (componentRole === 'form')\n Top strip: record-picker chip + Apply button.\n Below: dropdown picker panel.\n Below: <mj-interactive-form> bound to the picked record.\n ==================================================================== */\n\n.form-artifact-toolstrip {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 14px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n.form-artifact-toolstrip-label {\n font-weight: 600;\n}\n.form-artifact-toolstrip-entity {\n margin-left: 4px;\n padding: 2px 8px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 30%, var(--mj-bg-surface));\n border-radius: 999px;\n font-size: 11px;\n font-weight: 600;\n}\n.form-artifact-toolstrip-warning {\n color: var(--mj-status-warning-text);\n}\n\n.form-artifact-picker-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n padding: 4px 10px;\n font-size: 12px;\n color: var(--mj-text-primary);\n cursor: pointer;\n}\n.form-artifact-picker-chip:hover,\n.form-artifact-picker-chip:focus {\n border-color: var(--mj-border-focus);\n outline: none;\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.form-artifact-picker-chip strong {\n color: var(--mj-text-primary);\n font-weight: 600;\n}\n.form-artifact-picker-chip-badge {\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning-text);\n border: 1px solid var(--mj-status-warning-border);\n font-size: 10px;\n font-weight: 700;\n padding: 1px 6px;\n border-radius: 999px;\n}\n\n.form-artifact-apply-btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #ffffff);\n border: 1px solid var(--mj-brand-primary);\n border-radius: var(--mj-radius-md, 8px);\n padding: 5px 12px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.form-artifact-apply-btn:hover {\n background: var(--mj-brand-primary-hover, var(--mj-brand-primary));\n}\n\n.form-artifact-picker-panel {\n background: var(--mj-bg-surface);\n border-bottom: 1px solid var(--mj-border-default);\n padding: 10px 14px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.form-artifact-picker-search {\n width: 100%;\n padding: 7px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface);\n font-size: 13px;\n color: var(--mj-text-primary);\n}\n.form-artifact-picker-search:focus {\n outline: none;\n border-color: var(--mj-border-focus);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n.form-artifact-picker-results {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.form-artifact-picker-row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 13px;\n}\n.form-artifact-picker-row:hover {\n background: var(--mj-bg-surface-hover);\n}\n.form-artifact-picker-row i {\n color: var(--mj-text-muted);\n font-size: 10px;\n}\n.form-artifact-picker-empty {\n color: var(--mj-text-muted);\n font-size: 12px;\n font-style: italic;\n}\n\n.form-artifact-form-host {\n flex: 1;\n overflow: auto;\n background: var(--mj-bg-page);\n}\n"] }]
390
737
  }], () => [{ type: i1.AngularAdapterService }], { reactComponent: [{
391
738
  type: ViewChild,
392
739
  args: ['reactComponent']
@@ -394,6 +741,8 @@ export { ComponentArtifactViewerComponent };
394
741
  type: Output
395
742
  }], openEntityRecord: [{
396
743
  type: Output
744
+ }], applyFormRequested: [{
745
+ type: Output
397
746
  }] }); })();
398
747
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ComponentArtifactViewerComponent, { className: "ComponentArtifactViewerComponent", filePath: "src/lib/components/plugins/component-artifact-viewer.component.ts", lineNumber: 25 }); })();
399
748
  //# sourceMappingURL=component-artifact-viewer.component.js.map