@pb33f/cowboy-components 0.7.4 → 0.7.6

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 (53) hide show
  1. package/dist/components/auth/login-button.d.ts +2 -0
  2. package/dist/components/auth/login-button.js +15 -3
  3. package/dist/components/auth/login-panel.js +1 -1
  4. package/dist/components/auth/oauth-login.d.ts +1 -0
  5. package/dist/components/auth/oauth-login.js +11 -5
  6. package/dist/components/editor/editor-breadcrumb.css.js +1 -1
  7. package/dist/components/model-renderer/rendered-node.d.ts +2 -0
  8. package/dist/components/model-renderer/rendered-node.js +18 -0
  9. package/dist/components/model-renderer/responses.d.ts +11 -0
  10. package/dist/components/model-renderer/responses.js +46 -0
  11. package/dist/components/model-tree/tree.js +1 -1
  12. package/dist/components/rodeo/rodeo.js +1 -1
  13. package/dist/components/the-doctor/the-doctor.css.js +1 -1
  14. package/dist/components/the-doctor/the-doctor.d.ts +112 -120
  15. package/dist/components/the-doctor/the-doctor.js +134 -1735
  16. package/dist/components/the-doctor/upload-archive.d.ts +1 -0
  17. package/dist/components/the-doctor/upload-archive.js +36 -13
  18. package/dist/controllers/auth-controller.d.ts +25 -0
  19. package/dist/controllers/auth-controller.js +154 -0
  20. package/dist/controllers/broker-controller.d.ts +22 -0
  21. package/dist/controllers/broker-controller.js +107 -0
  22. package/dist/controllers/diagnostic-controller.d.ts +6 -0
  23. package/dist/controllers/diagnostic-controller.js +262 -0
  24. package/dist/controllers/docs-controller.d.ts +8 -0
  25. package/dist/controllers/docs-controller.js +143 -0
  26. package/dist/controllers/model-controller.d.ts +8 -0
  27. package/dist/controllers/model-controller.js +87 -0
  28. package/dist/controllers/node-clicker-controller.d.ts +11 -0
  29. package/dist/controllers/node-clicker-controller.js +362 -0
  30. package/dist/controllers/problem-controller.d.ts +7 -0
  31. package/dist/controllers/problem-controller.js +46 -0
  32. package/dist/controllers/rolodex-controller.d.ts +10 -0
  33. package/dist/controllers/rolodex-controller.js +126 -0
  34. package/dist/controllers/rule-controller.d.ts +19 -0
  35. package/dist/controllers/rule-controller.js +264 -0
  36. package/dist/controllers/spec-controller.d.ts +8 -0
  37. package/dist/controllers/spec-controller.js +78 -0
  38. package/dist/controllers/state-controller.d.ts +9 -0
  39. package/dist/controllers/state-controller.js +279 -0
  40. package/dist/cowboy-components.umd.cjs +1152 -1121
  41. package/dist/css/shared.css.js +5 -0
  42. package/dist/events/doctor.d.ts +10 -0
  43. package/dist/events/doctor.js +2 -0
  44. package/dist/model/api-response.d.ts +7 -0
  45. package/dist/model/api-response.js +2 -0
  46. package/dist/services/auth-service.d.ts +1 -0
  47. package/dist/services/auth-service.js +28 -0
  48. package/dist/services/linting-service.js +11 -2
  49. package/dist/services/model-service.d.ts +2 -1
  50. package/dist/services/model-service.js +31 -5
  51. package/package.json +1 -1
  52. package/dist/controllers/auth.d.ts +0 -20
  53. package/dist/controllers/auth.js +0 -101
@@ -0,0 +1,262 @@
1
+ import { DiagnosticBag, DocumentProblems, SettingsBag } from "../components/the-doctor/the-doctor.js";
2
+ import { LintingService } from "../services/linting-service.js";
3
+ import { ModelService } from "../services/model-service.js";
4
+ import { ToastType } from "../model/toast.js";
5
+ export class DiagnosticController extends EventTarget {
6
+ constructor(doc) {
7
+ super();
8
+ this.doc = doc;
9
+ }
10
+ lintSpec(value, url) {
11
+ this.doc.activitySpinner.show();
12
+ this.doc.editor.breadcumb.isInvalid = false;
13
+ if (url) {
14
+ if (url === 'root') {
15
+ url = '';
16
+ }
17
+ else {
18
+ this.doc.urlProblem.style.display = 'none';
19
+ this.doc.urlOverlay.style.display = "block";
20
+ this.doc.urlSpinner.style.display = "block";
21
+ this.doc.referenceMapBag?.reset(); // wipe out refs.
22
+ }
23
+ }
24
+ else {
25
+ this.doc.urlProblem.style.display = 'none';
26
+ this.doc.urlOverlay.style.display = "none";
27
+ this.doc.urlSpinner.style.display = "none";
28
+ }
29
+ let replaceResults = false;
30
+ let currentPath = this.doc.rolodexActivePath;
31
+ if (this.doc.rolodexActivePath === this.doc.rolodexRootPath || this.doc.rolodexActivePath === 'root') {
32
+ replaceResults = true;
33
+ currentPath = '';
34
+ this.doc.editor.showBreadcrumb = false;
35
+ }
36
+ if (url && url != '') {
37
+ try {
38
+ const parsedUrl = new URL(url);
39
+ if (parsedUrl) {
40
+ currentPath = parsedUrl.pathname;
41
+ this.doc.rolodexActivePath = currentPath;
42
+ this.doc.rolodexRootPath = currentPath;
43
+ replaceResults = true;
44
+ }
45
+ }
46
+ catch (e) {
47
+ // do nothing for now.
48
+ }
49
+ }
50
+ let revive = true;
51
+ LintingService.lintFile(value, this.doc.brokerController.brokerConnectionId, url, currentPath, this.doc.skipTimeline).then((result) => {
52
+ //if (replaceResults) {
53
+ this.doc.activitySpinner.hide();
54
+ const map = this.doc.rolodexController.buildRolodexResultMap(result);
55
+ if (url) {
56
+ this.doc.urlOverlay.style.display = "none";
57
+ this.doc.urlSpinner.style.display = "none";
58
+ this.doc.urlProblem.style.display = 'none';
59
+ }
60
+ // extract empty location problems as we are replacing the root results
61
+ let rootProblems = this.doc.rolodexProblemMap.get("root");
62
+ if (!this.doc.rolodexRoot) {
63
+ rootProblems = [];
64
+ }
65
+ if (result && !Array.isArray(result)) {
66
+ const r = [result];
67
+ if (this.doc.rolodexProblemMap.size > 0 && this.doc.rolodexProblemMap.has(this.doc.rolodexActivePath)) {
68
+ const probs = this.doc.rolodexProblemMap.get(this.doc.rolodexActivePath);
69
+ if (probs) {
70
+ if (rootProblems) {
71
+ probs.push(...rootProblems);
72
+ }
73
+ this.doc.editor.setMarkers(probs);
74
+ }
75
+ else {
76
+ if (rootProblems) {
77
+ r.push(...rootProblems);
78
+ }
79
+ this.doc.editor.setMarkers(r);
80
+ }
81
+ }
82
+ else {
83
+ if (rootProblems) {
84
+ r.push(...rootProblems);
85
+ }
86
+ this.doc.editor.setMarkers(r);
87
+ }
88
+ this.doc.problemBag?.set(DocumentProblems, r);
89
+ this.doc.problemList.problems = r;
90
+ this.doc.problems = r;
91
+ this.doc.problemsOverview.problems = this.doc.problemList.problemItems;
92
+ }
93
+ if (result && Array.isArray(result)) {
94
+ if (result.length == 0) {
95
+ this.doc.editor.clearAllMarkers();
96
+ this.doc.editor.breadcumb.isInvalid = false;
97
+ this.doc.editor.showBreadcrumb = false;
98
+ revive = true;
99
+ this.doc.problemList.isInvalid = false;
100
+ }
101
+ // check if this problem is 'unable to parse'
102
+ if (result.length == 1 && result[0].message.startsWith('unable to parse')) {
103
+ // short circuit, we are dead.
104
+ this.doc.editor.clearDecorations();
105
+ this.doc.editor.clearAllMarkers();
106
+ this.doc.editor.setMarkers(result);
107
+ this.doc.editor.breadcumb.isInvalid = true;
108
+ this.doc.editor.showBreadcrumb = true;
109
+ this.doc.editor.dead();
110
+ this.doc.problemList.isInvalid = true;
111
+ revive = false;
112
+ }
113
+ // extract empty location problems as we are replacing the root results
114
+ if (revive && this.doc.rolodexProblemMap.size > 0 && this.doc.rolodexProblemMap.has(this.doc.rolodexActivePath)) {
115
+ const probs = this.doc.rolodexProblemMap.get(this.doc.rolodexActivePath);
116
+ if (probs) {
117
+ if (rootProblems) {
118
+ probs.push(...rootProblems);
119
+ }
120
+ this.doc.editor.setMarkers(probs);
121
+ }
122
+ else {
123
+ if (rootProblems) {
124
+ result.push(...rootProblems);
125
+ }
126
+ this.doc.editor.setMarkers(result);
127
+ }
128
+ }
129
+ else {
130
+ if (replaceResults) {
131
+ this.doc.editor.setMarkers(result);
132
+ }
133
+ else {
134
+ this.doc.modelController.fetchRefMap(currentPath);
135
+ if ((this.doc.rolodexRootPath == this.doc.rolodexActivePath || this.doc.rolodexActivePath == 'root') || url || currentPath != '') {
136
+ ModelService.fetchLatestGraph().then((result) => {
137
+ this.doc.modelController.extractGraph(result);
138
+ this.doc.timeVortex.checkHistory();
139
+ });
140
+ }
141
+ return;
142
+ }
143
+ }
144
+ this.doc.problemBag?.set(DocumentProblems, result);
145
+ this.doc.problemList.problems = result;
146
+ this.doc.problems = result;
147
+ this.doc.problemsOverview.problems = this.doc.problemList.problemItems;
148
+ if (this.doc.problemsOverview.statistics) {
149
+ if (result.length == 1) {
150
+ this.doc.problemsOverview.statistics.statistics.totalErrors = 1;
151
+ this.doc.problemsOverview.statistics.statistics.overallScore = 0;
152
+ this.doc.problemsOverview.statistics.evaluation = 'Useless';
153
+ this.doc.problemsOverview.statistics.diagnosis = '<strong>Specification cannot be used</strong>: <br/><br/>' + result[0].message;
154
+ }
155
+ }
156
+ }
157
+ // enable pb33f theme.
158
+ if (revive) {
159
+ this.doc.editor.revive();
160
+ }
161
+ else {
162
+ return;
163
+ }
164
+ // fetch graph
165
+ if ((this.doc.rolodexRootPath == this.doc.rolodexActivePath || this.doc.rolodexActivePath == 'root') || url || currentPath != '') {
166
+ ModelService.fetchLatestGraph().then((result) => {
167
+ this.doc.modelController.extractGraph(result);
168
+ this.doc.timeVortex.checkHistory();
169
+ });
170
+ }
171
+ if (this.doc.rolodexNeedsReset) {
172
+ this.doc.rolodexController.queryRolodex(currentPath);
173
+ }
174
+ else {
175
+ this.doc.modelController.fetchRefMap(currentPath);
176
+ //this.timeVortex.tardisControl.fetchHistory()
177
+ }
178
+ // update the overview statistics
179
+ LintingService.fetchStatistics().then((result) => {
180
+ let oldScore = 0;
181
+ if (this.doc.problemsOverview.statistics) {
182
+ oldScore = this.doc.problemsOverview.statistics.statistics.overallScore;
183
+ }
184
+ this.doc.diagnosticBag?.set(DiagnosticBag, result);
185
+ this.doc.activitySpinner.hide();
186
+ if (result?.remainingCredit <= 10) {
187
+ this.doc.statusBar.callsRemaining = result.remainingCredit;
188
+ this.doc.statusBar.visible = true;
189
+ console.warn("You are running low on credit, you will need to authenticate soon. " +
190
+ "" + result.remainingCredit + " credits remaining.");
191
+ }
192
+ // determine if the score went up or down and toast it!
193
+ this.doc.problemsOverview.statistics = result;
194
+ const settings = this.doc.settingsBag?.get(SettingsBag);
195
+ // only toast if we're NOT using auto diagnose, otherwise they are a pain in the ass.
196
+ if (!settings?.autoDiagnose) {
197
+ if (this.doc.problemsOverview.statistics) {
198
+ const newScore = result.statistics.overallScore;
199
+ if (oldScore > newScore) {
200
+ this.doc.sendToast({
201
+ id: crypto.randomUUID(),
202
+ type: ToastType.SCOREDOWN,
203
+ body: "Your score has decreased. It is now " + newScore + "%",
204
+ title: "Score went down by " + (oldScore - newScore) + "%"
205
+ });
206
+ }
207
+ if (oldScore < newScore) {
208
+ this.doc.sendToast({
209
+ id: crypto.randomUUID(),
210
+ type: ToastType.SCOREUP,
211
+ body: "Your score has increased to " + newScore + "%",
212
+ title: "Score went up by " + (newScore - oldScore) + "%"
213
+ });
214
+ }
215
+ }
216
+ }
217
+ }).catch((e) => {
218
+ console.error("statistics service is down", e);
219
+ this.doc.sendToast({
220
+ id: crypto.randomUUID(),
221
+ type: ToastType.ERROR,
222
+ body: e.detail,
223
+ title: "Statistics request failed"
224
+ });
225
+ });
226
+ if (!this.doc.explorerBooted) {
227
+ this.doc.explorer.equalizer.initializeEqualizer();
228
+ this.doc.explorerBooted = true;
229
+ }
230
+ }).catch((e) => {
231
+ this.doc.activitySpinner.hide();
232
+ if (!url) {
233
+ //this.platformUnavailable(e);
234
+ console.error("so sorry, the doctor cannot see you right now, the clinic is closed.");
235
+ if (e) {
236
+ console.error(e.detail);
237
+ if (e.instance === 'https://pb33f.io/errors/no-credit-remaining') {
238
+ this.doc.statusBar.callsRemaining = 0;
239
+ this.doc.statusBar.visible = true;
240
+ this.doc.sendToast({
241
+ id: crypto.randomUUID(),
242
+ type: ToastType.ERROR,
243
+ body: "Run out of credit, please authenticate for more or wait 24 hours.",
244
+ title: "Credit exhausted!",
245
+ });
246
+ }
247
+ else {
248
+ this.doc.sendToast({
249
+ id: crypto.randomUUID(),
250
+ type: ToastType.ERROR,
251
+ body: e.detail,
252
+ title: "Platform Error",
253
+ });
254
+ }
255
+ }
256
+ }
257
+ else {
258
+ this.doc.showUrlError(e);
259
+ }
260
+ });
261
+ }
262
+ }
@@ -0,0 +1,8 @@
1
+ import { TheDoctor } from "../components/the-doctor/the-doctor";
2
+ import { ProblemDrawerEvent } from "../components/problem-list/details-drawer";
3
+ export declare class DocsController extends EventTarget {
4
+ doc: TheDoctor;
5
+ constructor(doc: TheDoctor);
6
+ fetchDocs(): void;
7
+ ruleDocsClicked(event: CustomEvent<ProblemDrawerEvent>): void;
8
+ }
@@ -0,0 +1,143 @@
1
+ import { DocumentationExpirationBag, FunctionDocumentationBag, RuleDocumentationBag } from "../components/the-doctor/the-doctor";
2
+ import { LintingService } from "../services/linting-service";
3
+ import { ProblemDrawerEventType } from "../components/problem-list/details-drawer";
4
+ import { ToastType } from "../model/toast";
5
+ export class DocsController extends EventTarget {
6
+ constructor(doc) {
7
+ super();
8
+ this.doc = doc;
9
+ }
10
+ fetchDocs() {
11
+ this.doc.activitySpinner.show();
12
+ const url = new URL(window.location.href);
13
+ const urlParam = url.searchParams.get('url');
14
+ if (urlParam) {
15
+ //this.urlInput.value = urlParam;
16
+ this.doc.activeURL = urlParam;
17
+ this.doc.diagnosticController.lintSpec('', urlParam);
18
+ }
19
+ LintingService.fetchAllHowToFix().then((result) => {
20
+ if (result) {
21
+ result.forEach((howToFix) => {
22
+ this.doc.howToFixBag?.set(howToFix.ruleId, howToFix);
23
+ });
24
+ }
25
+ }).catch((e) => {
26
+ this.doc.platformUnavailable(e);
27
+ console.error("documentation service is down");
28
+ });
29
+ this.doc.ruleDocsBag = this.doc.bagManager.getBag(RuleDocumentationBag);
30
+ this.doc.functionDocsBag = this.doc.bagManager.getBag(FunctionDocumentationBag);
31
+ // populate docs via worker.
32
+ this.doc.ruleDocsWorker.addEventListener("message", (event) => {
33
+ const data = event.data;
34
+ if (data) {
35
+ data.forEach((doc) => {
36
+ if (doc.ruleId) {
37
+ this.doc.ruleDocsBag?.set(doc.ruleId, doc);
38
+ }
39
+ if (doc.functionId) {
40
+ this.doc.functionDocsBag?.set(doc.functionId, doc);
41
+ }
42
+ });
43
+ this.doc.activitySpinner.hide();
44
+ }
45
+ });
46
+ // let ruleDocs: string[] = [];
47
+ // let functionDocs: string[] = [];
48
+ // if (this.ruleDocsBag) {
49
+ // ruleDocs = Array.from(this.ruleDocsBag.export().keys());
50
+ // }
51
+ // if (this.functionDocsBag) {
52
+ // functionDocs = Array.from(this.functionDocsBag.export().keys());
53
+ // }
54
+ const fetchDocs = () => {
55
+ this.doc.ruleDocsWorker.postMessage({
56
+ start: true,
57
+ endpoint: this.doc.doctorEndpoint,
58
+ existingRules: [],
59
+ existingFunctions: []
60
+ });
61
+ };
62
+ // check expiration
63
+ if (this.doc.docExpirationBag) {
64
+ const expiration = this.doc.docExpirationBag.get(DocumentationExpirationBag);
65
+ // if the docs are older than 15 days, refresh them.
66
+ if (expiration) {
67
+ const now = new Date().getTime();
68
+ const then = new Date(expiration).getTime();
69
+ // if (now - then > 1296000000) {
70
+ // fetchDocs();
71
+ // } else {
72
+ // this.activitySpinner.hide();
73
+ // }
74
+ fetchDocs(); // always fetch for now.
75
+ }
76
+ else {
77
+ fetchDocs();
78
+ }
79
+ }
80
+ else {
81
+ fetchDocs();
82
+ }
83
+ }
84
+ ruleDocsClicked(event) {
85
+ const ruleId = event.detail.rule;
86
+ if (ruleId) {
87
+ switch (event.detail.type) {
88
+ case ProblemDrawerEventType.RULE_DOCS:
89
+ const ruleDoc = this.doc.ruleDocsBag?.get(ruleId);
90
+ if (ruleDoc) {
91
+ event.detail.body = ruleDoc.body;
92
+ this.doc.detailsDrawer.open(event.detail);
93
+ }
94
+ else {
95
+ this.doc.sendToast({
96
+ id: crypto.randomUUID(),
97
+ type: ToastType.INFO,
98
+ title: "Rule documentation unavailable",
99
+ body: `Documentation for '${ruleId}' not available`
100
+ });
101
+ }
102
+ break;
103
+ case ProblemDrawerEventType.HOW_TO_FIX:
104
+ const howToFix = this.doc.howToFixBag?.get(ruleId);
105
+ if (howToFix) {
106
+ event.detail.body = howToFix.howToFix;
107
+ this.doc.detailsDrawer.open(event.detail);
108
+ }
109
+ else {
110
+ this.doc.sendToast({
111
+ id: crypto.randomUUID(),
112
+ type: ToastType.INFO,
113
+ title: "How to fix unavailable",
114
+ body: `Information on how to fix '${ruleId}' not available`
115
+ });
116
+ }
117
+ break;
118
+ case ProblemDrawerEventType.FUNCTION_DOCS:
119
+ const funcDocs = this.doc.functionDocsBag?.get(ruleId);
120
+ if (funcDocs) {
121
+ event.detail.body = funcDocs.body;
122
+ this.doc.detailsDrawer.open(event.detail);
123
+ }
124
+ else {
125
+ this.doc.sendToast({
126
+ id: crypto.randomUUID(),
127
+ type: ToastType.INFO,
128
+ title: "Function documentation unavailable",
129
+ body: `Documentation for '${ruleId}' not available`
130
+ });
131
+ }
132
+ break;
133
+ }
134
+ }
135
+ else {
136
+ switch (event.detail.type) {
137
+ case ProblemDrawerEventType.RENDERED_EXAMPLE:
138
+ case ProblemDrawerEventType.MARKDOWN:
139
+ this.doc.detailsDrawer.open(event.detail);
140
+ }
141
+ }
142
+ }
143
+ }
@@ -0,0 +1,8 @@
1
+ import { TheDoctor } from "../components/the-doctor/the-doctor.js";
2
+ import { GraphResponse } from "../model/graph";
3
+ export declare class ModelController extends EventTarget {
4
+ doc: TheDoctor;
5
+ constructor(doc: TheDoctor);
6
+ fetchRefMap(currentPath?: string): void;
7
+ extractGraph(graph: GraphResponse): void;
8
+ }
@@ -0,0 +1,87 @@
1
+ import { GraphBag } from "../components/the-doctor/the-doctor.js";
2
+ import { ModelService } from "../services/model-service";
3
+ import { ToastType } from "../model/toast";
4
+ export class ModelController extends EventTarget {
5
+ constructor(doc) {
6
+ super();
7
+ this.doc = doc;
8
+ }
9
+ fetchRefMap(currentPath = '') {
10
+ ModelService.fetchReferenceMap(currentPath).then((result) => {
11
+ this.doc.editor.clearDecorations();
12
+ this.doc.references = result;
13
+ this.doc.editor.links = result;
14
+ this.doc.editor.applyLinkDecorations();
15
+ // add references to our stateful bag
16
+ this.doc.updateRefmapBag(currentPath, result);
17
+ }).catch((e) => {
18
+ console.error('an error occurred fetching the reference map', currentPath, e);
19
+ this.doc.editor.clearDecorations();
20
+ this.doc.editor.clearAllMarkers();
21
+ this.doc.toastManager.addToastManually({
22
+ id: crypto.randomUUID(),
23
+ type: ToastType.INFO,
24
+ title: "File not analyzed",
25
+ body: "Cannot extract the references from this file.",
26
+ });
27
+ });
28
+ }
29
+ extractGraph(graph) {
30
+ // handled stripped nodes
31
+ if (graph.stripped) {
32
+ this.doc.explorer.nodeLimitExceeded = true;
33
+ this.doc.modelTree.nodeLimitExceeded = true;
34
+ if (graph.strippedCount) {
35
+ this.doc.explorer.nodeLimit = graph.strippedCount;
36
+ this.doc.modelTree.nodeLimit = graph.strippedCount;
37
+ }
38
+ }
39
+ else {
40
+ this.doc.explorer.nodeLimitExceeded = false;
41
+ this.doc.modelTree.nodeLimitExceeded = false;
42
+ }
43
+ this.doc.explorer.renderedNodeMap.clear();
44
+ this.doc.nodeMap.clear();
45
+ this.doc.nodeIdMap.clear();
46
+ this.doc.nodeIdHashMap.clear();
47
+ const renderedNodes = new Map();
48
+ graph?.nodesRendered?.forEach((node) => {
49
+ this.doc.explorer.renderedNodeMap.set(node.id, node);
50
+ renderedNodes.set(node.id, node);
51
+ });
52
+ for (let i = 0; i < graph?.nodesRendered?.length; i++) {
53
+ this.doc.renderedNodeMap.set(graph.nodesRendered[i].id, graph.nodesRendered[i]);
54
+ }
55
+ graph?.nodes?.forEach((node) => {
56
+ this.doc.nodeMap.set(node.id, node);
57
+ if (node.idHash.includes('root')) {
58
+ this.doc.nodeIdMap.set('root', node);
59
+ this.doc.nodeIdHashMap.set(node.id, node);
60
+ }
61
+ else {
62
+ this.doc.nodeIdMap.set(node.id, node);
63
+ this.doc.nodeIdHashMap.set(node.idHash, node);
64
+ }
65
+ if (node.filtered) {
66
+ this.doc.filteredNodes.set(node.id, node);
67
+ }
68
+ const renderedNode = this.doc.renderedNodeMap.get(node.id);
69
+ if (this.doc.activeNode?.id === node.id && this.doc.renderedNodeMap.get(node.id)) {
70
+ if (this.doc.renderedNode && renderedNode) {
71
+ this.doc.renderedNode.node = renderedNode;
72
+ }
73
+ }
74
+ });
75
+ this.doc.graphBag?.set(GraphBag, graph);
76
+ this.doc.explorer.updateGraphResponse(graph);
77
+ if (graph && graph.nodes) {
78
+ this.doc.modelTree.node = graph?.nodesRendered[0]; // update tree
79
+ }
80
+ if (!this.doc.explorer.equalizer.isInitialized()) {
81
+ this.doc.explorer.equalizer.initializeEqualizer();
82
+ }
83
+ else {
84
+ this.doc.explorer.equalizer.runEQ(true);
85
+ }
86
+ }
87
+ }
@@ -0,0 +1,11 @@
1
+ import { TheDoctor } from "../components/the-doctor/the-doctor.js";
2
+ import { DocumentReference, NodeClickedEvent, NodeReferenceEvent } from "../events/doctor.js";
3
+ export declare class NodeClickerController extends EventTarget {
4
+ doc: TheDoctor;
5
+ constructor(doc: TheDoctor);
6
+ rolodexTreeNodeClicked(evt: CustomEvent<NodeClickedEvent>): void;
7
+ explorerNodeClicked(evt: CustomEvent<NodeClickedEvent>, replaceRenderedNode?: boolean): void;
8
+ modelTreeNodeClicked(evt: CustomEvent<NodeClickedEvent>): void;
9
+ explorerReferenceClicked(evt: CustomEvent<NodeReferenceEvent>): void;
10
+ documentReferenceClicked(evt: CustomEvent<DocumentReference>): void;
11
+ }