@pb33f/cowboy-components 0.6.6 → 0.7.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 (191) hide show
  1. package/dist/assets/equalizer.worker-DyLD5JTU.js +1 -0
  2. package/dist/assets/search-problems.worker-BAF8L2rX.js +1 -0
  3. package/dist/components/auth/oauth-login.js +0 -1
  4. package/dist/components/changelog/changelog.js +1 -1
  5. package/dist/components/charts/beefy-chart.d.ts +21 -0
  6. package/dist/components/charts/beefy-chart.js +159 -0
  7. package/dist/components/charts/chart-colors.d.ts +27 -0
  8. package/dist/components/charts/chart-colors.js +76 -0
  9. package/dist/components/charts/config.d.ts +15 -0
  10. package/dist/components/charts/config.js +35 -0
  11. package/dist/components/charts/doughnut-chart.d.ts +22 -0
  12. package/dist/components/charts/doughnut-chart.js +128 -0
  13. package/dist/components/editor/editor.d.ts +9 -3
  14. package/dist/components/editor/editor.js +115 -60
  15. package/dist/components/editor/init.d.ts +0 -0
  16. package/dist/components/editor/init.js +28 -0
  17. package/dist/components/editor/schemas/openapi3.json +1651 -0
  18. package/dist/components/editor/schemas/openapi31.json +1449 -0
  19. package/dist/components/model-icon/model-icon.js +3 -0
  20. package/dist/components/model-renderer/callback.js +2 -1
  21. package/dist/components/model-renderer/change.css.d.ts +2 -0
  22. package/dist/components/model-renderer/change.css.js +254 -0
  23. package/dist/components/model-renderer/changes.d.ts +19 -0
  24. package/dist/components/model-renderer/changes.js +306 -0
  25. package/dist/components/model-renderer/clickable-ref.d.ts +10 -6
  26. package/dist/components/model-renderer/clickable-ref.js +9 -0
  27. package/dist/components/model-renderer/components.js +1 -0
  28. package/dist/components/model-renderer/contact.js +2 -1
  29. package/dist/components/model-renderer/document.js +11 -9
  30. package/dist/components/model-renderer/encoding.js +1 -0
  31. package/dist/components/model-renderer/example.js +1 -0
  32. package/dist/components/model-renderer/external-docs.js +1 -0
  33. package/dist/components/model-renderer/has-changes.d.ts +8 -0
  34. package/dist/components/model-renderer/has-changes.js +50 -0
  35. package/dist/components/model-renderer/header.js +1 -0
  36. package/dist/components/model-renderer/info.js +3 -1
  37. package/dist/components/model-renderer/license.js +3 -3
  38. package/dist/components/model-renderer/link.js +1 -1
  39. package/dist/components/model-renderer/media-type.js +1 -1
  40. package/dist/components/model-renderer/oauth-flows.js +2 -1
  41. package/dist/components/model-renderer/operation.js +2 -1
  42. package/dist/components/model-renderer/parameter.js +1 -0
  43. package/dist/components/model-renderer/path-item.js +1 -0
  44. package/dist/components/model-renderer/paths.js +1 -0
  45. package/dist/components/model-renderer/rendered-node.js +20 -20
  46. package/dist/components/model-renderer/rendered-property.css.js +4 -0
  47. package/dist/components/model-renderer/rendered-property.js +5 -2
  48. package/dist/components/model-renderer/request-body.js +1 -1
  49. package/dist/components/model-renderer/response.js +1 -1
  50. package/dist/components/model-renderer/schema.js +57 -54
  51. package/dist/components/model-renderer/security-scheme.js +1 -1
  52. package/dist/components/model-renderer/server.js +1 -0
  53. package/dist/components/model-renderer/tag.js +3 -1
  54. package/dist/components/model-tree/tree.d.ts +7 -4
  55. package/dist/components/model-tree/tree.js +54 -25
  56. package/dist/components/paginator/paginator.css.js +6 -3
  57. package/dist/components/paginator/paginator.d.ts +1 -0
  58. package/dist/components/paginator/paginator.js +26 -7
  59. package/dist/components/problem-list/problem-mainview.js +8 -1
  60. package/dist/components/rodeo/npm/download-statistic.d.ts +41 -0
  61. package/dist/components/rodeo/npm/download-statistic.js +634 -0
  62. package/dist/components/rodeo/rodeo-nav.js +1 -0
  63. package/dist/components/rodeo/rodeo.d.ts +1 -0
  64. package/dist/components/rodeo/rodeo.js +9 -2
  65. package/dist/components/rodeo/statistic.css.js +17 -0
  66. package/dist/components/rodeo/statistic.d.ts +4 -2
  67. package/dist/components/rodeo/statistic.js +15 -4
  68. package/dist/components/the-doctor/settings.css.d.ts +2 -0
  69. package/dist/components/the-doctor/settings.css.js +28 -0
  70. package/dist/components/the-doctor/settings.d.ts +13 -0
  71. package/dist/components/the-doctor/settings.js +83 -2
  72. package/dist/components/the-doctor/sparks.d.ts +3 -0
  73. package/dist/components/the-doctor/sparks.js +16 -5
  74. package/dist/components/the-doctor/the-doctor.css.js +80 -47
  75. package/dist/components/the-doctor/the-doctor.d.ts +24 -6
  76. package/dist/components/the-doctor/the-doctor.js +344 -109
  77. package/dist/components/the-doctor/upload-archive.js +1 -1
  78. package/dist/components/theme-switcher/theme-switcher.d.ts +1 -1
  79. package/dist/components/theme-switcher/theme-switcher.js +5 -2
  80. package/dist/components/time-vortex/change-list-item.css.d.ts +2 -0
  81. package/dist/components/time-vortex/change-list-item.css.js +96 -0
  82. package/dist/components/time-vortex/change-list-item.d.ts +10 -0
  83. package/dist/components/time-vortex/change-list-item.js +58 -0
  84. package/dist/components/time-vortex/history-picker.css.d.ts +2 -0
  85. package/dist/components/time-vortex/history-picker.css.js +90 -0
  86. package/dist/components/time-vortex/history-picker.d.ts +18 -0
  87. package/dist/components/time-vortex/history-picker.js +143 -0
  88. package/dist/components/time-vortex/spec-summary-timeline-item.css.d.ts +2 -0
  89. package/dist/components/time-vortex/spec-summary-timeline-item.css.js +144 -0
  90. package/dist/components/time-vortex/spec-summary-timeline-item.d.ts +11 -0
  91. package/dist/components/time-vortex/spec-summary-timeline-item.js +153 -0
  92. package/dist/components/time-vortex/tardis-control.css.d.ts +2 -0
  93. package/dist/components/time-vortex/tardis-control.css.js +103 -0
  94. package/dist/components/time-vortex/tardis-control.d.ts +32 -0
  95. package/dist/components/time-vortex/tardis-control.js +286 -0
  96. package/dist/components/time-vortex/time-vortex.d.ts +17 -0
  97. package/dist/components/time-vortex/time-vortex.js +75 -0
  98. package/dist/components/time-vortex/timeline-view.css.d.ts +2 -0
  99. package/dist/components/time-vortex/timeline-view.css.js +28 -0
  100. package/dist/components/time-vortex/timeline-view.d.ts +32 -0
  101. package/dist/components/time-vortex/timeline-view.js +233 -0
  102. package/dist/components/timeline/timeline-item.css.js +95 -48
  103. package/dist/components/timeline/timeline-item.d.ts +1 -0
  104. package/dist/components/timeline/timeline-item.js +20 -1
  105. package/dist/components/timeline/timeline.css.js +46 -40
  106. package/dist/components/timeline/timeline.d.ts +1 -0
  107. package/dist/components/timeline/timeline.js +9 -5
  108. package/dist/components/toast/toast-component.css.js +4 -0
  109. package/dist/components/visualizer/equalizer.d.ts +2 -0
  110. package/dist/components/visualizer/equalizer.js +13 -5
  111. package/dist/components/visualizer/explorer.d.ts +5 -0
  112. package/dist/components/visualizer/explorer.js +41 -37
  113. package/dist/components/visualizer/foreign-object.js +3 -0
  114. package/dist/components/visualizer/nodes/callback.js +3 -1
  115. package/dist/components/visualizer/nodes/changes.css.d.ts +2 -0
  116. package/dist/components/visualizer/nodes/changes.css.js +33 -0
  117. package/dist/components/visualizer/nodes/components.js +3 -1
  118. package/dist/components/visualizer/nodes/contact.js +3 -1
  119. package/dist/components/visualizer/nodes/document.js +1 -0
  120. package/dist/components/visualizer/nodes/graph-node.d.ts +8 -7
  121. package/dist/components/visualizer/nodes/graph-node.js +55 -1
  122. package/dist/components/visualizer/nodes/header.js +3 -1
  123. package/dist/components/visualizer/nodes/info.js +3 -1
  124. package/dist/components/visualizer/nodes/license.js +8 -1
  125. package/dist/components/visualizer/nodes/link.js +3 -1
  126. package/dist/components/visualizer/nodes/media-type.js +3 -1
  127. package/dist/components/visualizer/nodes/operation.js +4 -1
  128. package/dist/components/visualizer/nodes/parameter.js +3 -1
  129. package/dist/components/visualizer/nodes/path-item.js +3 -1
  130. package/dist/components/visualizer/nodes/request-body.js +3 -1
  131. package/dist/components/visualizer/nodes/response.js +3 -1
  132. package/dist/components/visualizer/nodes/schema.js +3 -1
  133. package/dist/components/visualizer/nodes/security-scheme.js +3 -1
  134. package/dist/components/visualizer/nodes/server.js +3 -1
  135. package/dist/components/visualizer/nodes/tag.js +3 -1
  136. package/dist/components/visualizer/nodes/xml.js +3 -1
  137. package/dist/components/visualizer/orientation-controls.d.ts +1 -0
  138. package/dist/components/visualizer/orientation-controls.js +31 -16
  139. package/dist/components/visualizer/search.js +4 -3
  140. package/dist/components/warning-stripe/warning-stripe.d.ts +20 -0
  141. package/dist/components/warning-stripe/warning-stripe.js +124 -0
  142. package/dist/cowboy-components.umd.cjs +3849 -2221
  143. package/dist/css/panels.css.d.ts +2 -0
  144. package/dist/css/panels.css.js +44 -0
  145. package/dist/css/pb33f-theme.css +8 -1
  146. package/dist/css/scrollbar.css.d.ts +2 -0
  147. package/dist/css/scrollbar.css.js +16 -0
  148. package/dist/css/tabs.css.js +1 -1
  149. package/dist/events/doctor.d.ts +15 -1
  150. package/dist/events/doctor.js +5 -0
  151. package/dist/model/api-response.d.ts +6 -0
  152. package/dist/model/api-response.js +2 -0
  153. package/dist/model/chart-data.d.ts +15 -0
  154. package/dist/model/chart-data.js +1 -0
  155. package/dist/model/diagnostic-report.d.ts +5 -0
  156. package/dist/model/diagnostic-report.js +3 -0
  157. package/dist/model/document.d.ts +1 -0
  158. package/dist/model/graph.d.ts +26 -0
  159. package/dist/model/media-type.d.ts +2 -0
  160. package/dist/model/media-type.js +7 -0
  161. package/dist/model/node_type.d.ts +2 -0
  162. package/dist/model/node_type.js +2 -0
  163. package/dist/model/settings.d.ts +5 -0
  164. package/dist/model/settings.js +1 -0
  165. package/dist/model/timeline.d.ts +33 -0
  166. package/dist/model/timeline.js +1 -0
  167. package/dist/monacoeditorwork/css.worker.bundle.js +53460 -0
  168. package/dist/monacoeditorwork/editor.worker.bundle.js +13517 -0
  169. package/dist/monacoeditorwork/html.worker.bundle.js +29660 -0
  170. package/dist/monacoeditorwork/json.worker.bundle.js +21318 -0
  171. package/dist/monacoeditorwork/yaml.worker..bundle.js +37321 -0
  172. package/dist/services/color-service.d.ts +1 -0
  173. package/dist/services/color-service.js +13 -0
  174. package/dist/services/linting-service.d.ts +1 -3
  175. package/dist/services/linting-service.js +21 -29
  176. package/dist/services/model-service.d.ts +1 -1
  177. package/dist/services/model-service.js +35 -8
  178. package/dist/services/rodeo-service.d.ts +6 -0
  179. package/dist/services/rodeo-service.js +134 -0
  180. package/dist/services/timeline-service.d.ts +8 -0
  181. package/dist/services/timeline-service.js +85 -0
  182. package/dist/style.css +1 -1
  183. package/dist/workers/equalizer.worker.js +1 -1
  184. package/dist/workers/search-problems.worker.js +1 -1
  185. package/package.json +6 -1
  186. package/dist/assets/css.worker-Byh--afc.js +0 -84
  187. package/dist/assets/editor.worker-CYC0jP-p.js +0 -12
  188. package/dist/assets/equalizer.worker-CdIiiqfH.js +0 -1
  189. package/dist/assets/html.worker-DArWg-Dy.js +0 -461
  190. package/dist/assets/json.worker-heCfXoJw.js +0 -49
  191. package/dist/assets/search-problems.worker-VJi4P9Gj.js +0 -1
@@ -16,7 +16,7 @@ import '@shoelace-style/shoelace/dist/components/avatar/avatar.js';
16
16
  import { customElement, property, query, state } from "lit/decorators.js";
17
17
  import { html, LitElement } from "lit";
18
18
  import { SpecEditor } from "../editor/editor.js";
19
- import { ActiveView, AddToast, ArchiveURLRequested, BuiltInRulesetChanged, CustomRulesetEnabled, DocumentReferenceClicked, EditorClicked, EditorUpdated, ExplorerEqualizerChanged, ExplorerEqualizerFiltered, ExplorerNodeClicked, ExportRuleset, ModelTreeNodeClicked, NodeReferenceClicked, OpenProblemDrawer, ProblemClicked, ProblemRuleFilterChangedManual, RolodexRootFileSelected, RolodexTreeNodeClicked, RuleClicked, RulesetSaved, RuleViolationClicked, NukeWorkspaceEvent } from "../../events/doctor.js";
19
+ import { ActiveView, AddToast, ArchiveURLRequested, BuiltInRulesetChanged, CustomRulesetEnabled, DocumentReferenceClicked, EditorClicked, EditorUpdated, ExplorerEqualizerChanged, ExplorerEqualizerFiltered, ExplorerNodeClicked, ExportRuleset, LoadRenderedNodeIntoInspector, ModelTreeNodeClicked, NodeReferenceClicked, NukeWorkspaceEvent, OpenProblemDrawer, OpenSettings, ProblemClicked, ProblemRuleFilterChangedManual, RolodexRootFileSelected, RolodexTreeNodeClicked, RuleClicked, RulesetSaved, RuleViolationClicked, } from "../../events/doctor.js";
20
20
  import { ProblemDetailsDrawer, ProblemDrawerEventType } from "../problem-list/details-drawer.js";
21
21
  import { CreateBagManager } from "@pb33f/saddlebag";
22
22
  import { LintingService } from "../../services/linting-service.js";
@@ -46,16 +46,20 @@ import { ExplorerComponent } from "../visualizer/explorer.js";
46
46
  import { RenderedNodeComponent } from "../model-renderer/rendered-node.js";
47
47
  import tabsCss from "../../css/tabs.css.js";
48
48
  import { CreateBus } from "@pb33f/ranch";
49
- import { Command, CreditStreamChannel, DoctorServiceChannel, isBrokerResponse, QueuePrefix, SpecStreamChannel } from "../../model/channels";
50
- import formsCss from "../../css/forms.css";
51
- import spinnerCss from "../../css/spinner.css";
52
- import { UploadArchiveComponent } from "./upload-archive";
53
- import { NodeType } from "../../model/node_type";
54
- import tooltipCss from "../../css/tooltip.css";
55
- import { NukeWorkspaceComponent } from "./nuke-workspace";
56
- import { CreditTicker } from "../credit-ticker/credit-ticker";
57
- import { AuthController } from "../../controllers/auth";
58
- import { AuthService } from "../../services/auth-service";
49
+ import { Command, CreditStreamChannel, DoctorServiceChannel, isBrokerResponse, QueuePrefix, SpecStreamChannel } from "../../model/channels.js";
50
+ import formsCss from "../../css/forms.css.js";
51
+ import spinnerCss from "../../css/spinner.css.js";
52
+ import { UploadArchiveComponent } from "./upload-archive.js";
53
+ import { NodeType } from "../../model/node_type.js";
54
+ import tooltipCss from "../../css/tooltip.css.js";
55
+ import { NukeWorkspaceComponent } from "./nuke-workspace.js";
56
+ import { CreditTicker } from "../credit-ticker/credit-ticker.js";
57
+ import { AuthController } from "../../controllers/auth.js";
58
+ import { AuthService } from "../../services/auth-service.js";
59
+ import { TimeVortex } from "../time-vortex/time-vortex.js";
60
+ import { TimelineService } from "../../services/timeline-service.js";
61
+ import { DoctorSettings } from "./settings.js";
62
+ import panelsCss from "../../css/panels.css.js";
59
63
  export const GraphBag = "pb33f-doctor-graph";
60
64
  export const PanelStateBag = "pb33f-doctor-panel-state";
61
65
  export const RolodexResponseBag = "pb33f-doctor-rolodex-response";
@@ -76,19 +80,35 @@ export const FunctionsSchemaBag = "pb33f-doctor-function-schema";
76
80
  export const CustomRulesetBag = "pb33f-doctor-custom-ruleset";
77
81
  export const RuleConfigurationBag = "pb33f-doctor-rule-configuration";
78
82
  export const SessionRulesetMapBag = "pb33f-doctor-session-rulesetmap";
83
+ export const SettingsBag = "pb33f-doctor-settings";
79
84
  export const DefaultDocument = "pb33f-doctor-document";
80
85
  export const DocumentProblems = "pb33f-doctor-problems";
81
86
  export const DoctorEndpoint = "doctor-endpoint";
82
87
  let TheDoctor = class TheDoctor extends LitElement {
83
88
  constructor(doctorEndpoint = "https://doctor.pb33f.io") {
84
89
  super();
85
- this.debounceTime = 400;
90
+ this.debounceTime = 1000;
86
91
  this.debounceTimeRuleset = 900;
87
92
  this.bounceId = 0;
88
93
  this.useTLS = false;
89
94
  // rolodex divider state (because it may not exist)
90
95
  this.rolodexDividerPosition = 40;
91
96
  this._firstRun = true;
97
+ // extract the doctor endpoint from session storage.
98
+ const sessionEndpoint = sessionStorage.getItem(DoctorEndpoint);
99
+ if (sessionEndpoint) {
100
+ this.doctorEndpoint = sessionEndpoint;
101
+ }
102
+ else {
103
+ this.doctorEndpoint = doctorEndpoint;
104
+ }
105
+ LintingService.doctorEndpoint = this.doctorEndpoint;
106
+ FeedbackService.doctorEndpoint = this.doctorEndpoint;
107
+ RulesetService.doctorEndpoint = this.doctorEndpoint;
108
+ ModelService.doctorEndpoint = this.doctorEndpoint;
109
+ AuthService.doctorEndpoint = this.doctorEndpoint;
110
+ TimelineService.doctorEndpoint = this.doctorEndpoint;
111
+ this.timeVortex = new TimeVortex();
92
112
  //this.authController = new AuthController(this)
93
113
  // bus it up
94
114
  this.bus = CreateBus();
@@ -120,6 +140,7 @@ let TheDoctor = class TheDoctor extends LitElement {
120
140
  this.manageRuleset = new ManageRuleset();
121
141
  this.toastManager = new ToastManager();
122
142
  this.creditTicker = new CreditTicker();
143
+ this.settingsComponent = new DoctorSettings();
123
144
  this.editorMap = new Map();
124
145
  this.editorMap.set("spec", this.editor);
125
146
  this.editorMap.set("ruleset-editor", this.rulesetEditor);
@@ -133,6 +154,8 @@ let TheDoctor = class TheDoctor extends LitElement {
133
154
  this.rolodexRootPath = "";
134
155
  this.importDisabled = false;
135
156
  this.pendingLine = 0;
157
+ this.autoDiagnose = true;
158
+ this.skipTimeline = false;
136
159
  this.nodeMap = new Map();
137
160
  this.nodeIdMap = new Map();
138
161
  this.nodeIdHashMap = new Map();
@@ -146,21 +169,9 @@ let TheDoctor = class TheDoctor extends LitElement {
146
169
  this.references = [];
147
170
  this.minimapVisible = true;
148
171
  this.minimapIconVisible = true;
172
+ this.showDiagnosisButton = false;
149
173
  this.nodeLimit = 150;
150
174
  this.randomTicker = 0;
151
- // extract the doctor endpoint from session storage.
152
- const sessionEndpoint = sessionStorage.getItem(DoctorEndpoint);
153
- if (sessionEndpoint) {
154
- this.doctorEndpoint = sessionEndpoint;
155
- }
156
- else {
157
- this.doctorEndpoint = doctorEndpoint;
158
- }
159
- LintingService.doctorEndpoint = this.doctorEndpoint;
160
- FeedbackService.doctorEndpoint = this.doctorEndpoint;
161
- RulesetService.doctorEndpoint = this.doctorEndpoint;
162
- ModelService.doctorEndpoint = this.doctorEndpoint;
163
- AuthService.doctorEndpoint = this.doctorEndpoint;
164
175
  // session call back for when we're online.
165
176
  const sessionCallback = (session) => {
166
177
  if (session.creditsRemaining) {
@@ -214,6 +225,9 @@ let TheDoctor = class TheDoctor extends LitElement {
214
225
  //@ts-ignore
215
226
  this.explorer.equalizer.addEventListener(ExplorerEqualizerFiltered, this.filterTreeModel.bind(this));
216
227
  this.nukeWorkspace.addEventListener(NukeWorkspaceEvent, this.nukeWorkspaceHandler.bind(this));
228
+ this.timeVortex.historyPicker.addEventListener(OpenSettings, this.openSettings.bind(this));
229
+ //@ts-ignore
230
+ this.addEventListener(LoadRenderedNodeIntoInspector, this.loadRenderedNodeIntoInspector.bind(this));
217
231
  // extract port from session storage.
218
232
  this.busPort = sessionStorage.getItem("pb33f-doctor-port");
219
233
  this.busHost = sessionStorage.getItem("pb33f-doctor-host");
@@ -250,11 +264,45 @@ let TheDoctor = class TheDoctor extends LitElement {
250
264
  }
251
265
  });
252
266
  }
267
+ openSettings() {
268
+ this.settingsComponent.open();
269
+ }
270
+ settingsChanged(_, config) {
271
+ if (config) {
272
+ this.autoDiagnose = config.autoDiagnose;
273
+ this.skipTimeline = config.skipTimeline;
274
+ this.showDiagnosisButton = !config.autoDiagnose;
275
+ // if the time vortex is not available, enable skipsState
276
+ this.timeVortex.historyPicker.skipChanges = config.skipTimeline;
277
+ if (config.applicationVersion == this.currentVersion) {
278
+ return;
279
+ }
280
+ if (this.currentVersion && this.currentVersion != 'bootstrap' &&
281
+ config.applicationVersion &&
282
+ config.applicationVersion != 'bootstrap' &&
283
+ this.currentVersion != config.applicationVersion) {
284
+ console.warn('version changed, reloading', this.currentVersion, config.applicationVersion);
285
+ this.nukeWorkspaceHandler();
286
+ }
287
+ else {
288
+ config.applicationVersion = this.currentVersion;
289
+ this.settingsBag?.set(SettingsBag, config);
290
+ }
291
+ }
292
+ }
293
+ loadRenderedNodeIntoInspector(evt) {
294
+ const rn = new RenderedNodeComponent();
295
+ rn.node = evt.detail.renderedNode;
296
+ this.renderedNode = rn;
297
+ this.requestUpdate();
298
+ this.viewerPanel.click();
299
+ }
253
300
  tickRandomly() {
254
301
  this.randomTicker = Math.floor(Math.random() * 9999999);
255
302
  }
256
303
  nukeWorkspaceHandler() {
257
304
  this.bagManager.resetBags();
305
+ localStorage.removeItem("pb33f-doctor-version");
258
306
  ModelService.resetWorkspace().then(() => {
259
307
  window.location.reload();
260
308
  });
@@ -305,8 +353,22 @@ let TheDoctor = class TheDoctor extends LitElement {
305
353
  if (isBrokerResponse(msg.payload.payload)) {
306
354
  this.brokerConnectionId = msg.payload.payload.broker;
307
355
  this.authController.associateBroker(this.brokerConnectionId).then(() => {
308
- console.log('broker connection', this.brokerConnectionId);
309
- console.log("💊 Welcome to the clinic, the %cdoctor %cis ready to see you.", 'color: #62C4FFFF; font-weight: bold', 'color: default');
356
+ // check version from the server
357
+ const version = msg.payload.payload.version;
358
+ if (version !== "") {
359
+ this.currentVersion = version;
360
+ }
361
+ const memVersion = localStorage.getItem("pb33f-doctor-version");
362
+ if (memVersion) {
363
+ if (this.currentVersion != memVersion) {
364
+ this.nukeWorkspaceHandler();
365
+ return;
366
+ }
367
+ }
368
+ else {
369
+ localStorage.setItem("pb33f-doctor-version", this.currentVersion);
370
+ }
371
+ console.log("💊 Welcome to the clinic, the %cdoctor %cis ready to see you. [" + "v" + version + "]", 'color: #62C4FFFF; font-weight: bold', 'color: default');
310
372
  this.startTheDoctor();
311
373
  });
312
374
  }
@@ -344,7 +406,7 @@ let TheDoctor = class TheDoctor extends LitElement {
344
406
  filterTreeModel(event) {
345
407
  this.filteredNodes = new Map();
346
408
  event.detail.graph.nodes.forEach((node) => {
347
- this.filteredNodes.set(node.idHash, node);
409
+ this.filteredNodes.set(node.id, node);
348
410
  });
349
411
  this.modelTree.filteredNodes = this.filteredNodes;
350
412
  this.modelTree.renderedNodes = this.renderedNodeMap;
@@ -374,10 +436,10 @@ let TheDoctor = class TheDoctor extends LitElement {
374
436
  const node = this.nodeIdMap.get(path);
375
437
  if (node) {
376
438
  if (this.nodeIdHashMap.has(node.idHash)) {
377
- const renderedNode = this.renderedNodeMap.get(node.idHash);
439
+ const renderedNode = this.renderedNodeMap.get(node.id);
378
440
  if (renderedNode) {
379
441
  this.renderedNode.node = renderedNode;
380
- this.modelTree.explorerClicked(node.idHash);
442
+ this.modelTree.explorerClicked(node.id);
381
443
  // add a ref click
382
444
  if (!evt.detail.noState) {
383
445
  this.addRefTrack(evt.detail.jsonPath);
@@ -421,15 +483,15 @@ let TheDoctor = class TheDoctor extends LitElement {
421
483
  }
422
484
  }
423
485
  explorerReferenceClicked(evt) {
424
- let hashId = '';
486
+ let nodeId = '';
425
487
  this.explorer.nodeComponents.forEach((node) => {
426
488
  if (node.body.node.nodePath === evt.detail.nodePath) {
427
- const renderedNode = this.renderedNodeMap.get(node.body.node.idHash);
489
+ const renderedNode = this.renderedNodeMap.get(node.body.node.id);
428
490
  if (renderedNode) {
429
491
  this.editor.editor?.setPosition({ lineNumber: renderedNode.keyLine, column: 0 });
430
492
  this.editor.editor?.revealLineInCenter(renderedNode.keyLine);
431
493
  this.renderedNode.node = renderedNode;
432
- hashId = node.body.node.idHash;
494
+ nodeId = node.body.node.id;
433
495
  this.explorer.moveToNode(node.body.node);
434
496
  this.activeNode = node.body.node;
435
497
  this.explorer.activeNode = node.body.node;
@@ -441,8 +503,8 @@ let TheDoctor = class TheDoctor extends LitElement {
441
503
  node.body.active = false;
442
504
  }
443
505
  });
444
- if (hashId) {
445
- this.modelTree.explorerClicked(hashId);
506
+ if (nodeId) {
507
+ this.modelTree.explorerClicked(nodeId);
446
508
  this.explorer.requestUpdate();
447
509
  this.viewerPanel.click();
448
510
  }
@@ -610,7 +672,10 @@ let TheDoctor = class TheDoctor extends LitElement {
610
672
  }
611
673
  }
612
674
  modelTreeNodeClicked(evt) {
613
- const node = this.nodeIdHashMap.get(evt.detail.nodeHashId);
675
+ let node = this.nodeIdMap.get(evt.detail.nodeId);
676
+ if (!node) {
677
+ node = this.nodeIdHashMap.get(evt.detail.nodeId);
678
+ }
614
679
  if (node) {
615
680
  if (node.origin && node.origin != this.rolodexActivePath && (node.origin != '/root.yaml' && node.origin != 'root.yaml')) {
616
681
  // extract the rolodex id using the path
@@ -630,23 +695,36 @@ let TheDoctor = class TheDoctor extends LitElement {
630
695
  }));
631
696
  return;
632
697
  }
633
- this.editor.editor?.setPosition({ lineNumber: node.keyLine, column: 0 });
634
- this.editor.editor?.revealLineInCenter(node.keyLine);
698
+ // don't jump to the root in the editor if the root is selected
699
+ if (node.idHash !== 'root') {
700
+ this.editor.editor?.setPosition({ lineNumber: node.keyLine, column: 0 });
701
+ this.editor.editor?.revealLineInCenter(node.keyLine);
702
+ }
635
703
  if (this.explorerVisible) {
636
704
  this.explorer.moveToNode(node, evt.detail.first);
637
705
  }
638
706
  this.activeNode = node;
707
+ // add changes to active node.
708
+ if (evt.detail.changes) {
709
+ node.timeline = evt.detail.changes;
710
+ }
639
711
  this.explorer.activeNode = node;
640
712
  this.explorer.equalizer.activeNode = node;
641
- const renderedNode = this.renderedNodeMap.get(node.idHash);
713
+ const renderedNode = structuredClone(this.renderedNodeMap.get(node.id));
642
714
  if (renderedNode) {
715
+ if (evt.detail.changes) {
716
+ renderedNode.timeline = evt.detail.changes;
717
+ }
643
718
  this.renderedNode.node = renderedNode;
644
719
  }
720
+ else {
721
+ alert('no id found');
722
+ }
645
723
  if (!evt.detail.noState) {
646
724
  this.addClickTrack(node);
647
725
  evt.detail.noState = true;
648
726
  }
649
- this.explorerNodeClicked(evt);
727
+ this.explorerNodeClicked(evt, false);
650
728
  if (this._firstRun) {
651
729
  this._firstRun = false;
652
730
  }
@@ -654,22 +732,36 @@ let TheDoctor = class TheDoctor extends LitElement {
654
732
  this.viewerPanel.click();
655
733
  }
656
734
  }
735
+ else {
736
+ this.sendToast({
737
+ id: crypto.randomUUID(),
738
+ title: 'Unable to load change model',
739
+ type: ToastType.WARNING,
740
+ body: 'There is no-longer a model with the path `' + evt.detail.nodeId + '` in the document',
741
+ });
742
+ console.error('cannot navigate to node, path not found', evt.detail.nodeId);
743
+ }
657
744
  }
658
- explorerNodeClicked(evt) {
745
+ explorerNodeClicked(evt, replaceRenderedNode = true) {
659
746
  let found = false;
660
747
  let foundRenderedNode;
661
748
  this.explorer.nodeComponents.forEach((node) => {
662
- if (node.id === evt.detail.nodeHashId) {
663
- const renderedNode = this.renderedNodeMap.get(node.id);
664
- if (renderedNode && !this._firstRun) {
665
- this.renderedNode.node = renderedNode;
749
+ if (node.id === evt.detail.nodeId) {
750
+ let renderedNode;
751
+ if (replaceRenderedNode) {
752
+ renderedNode = this.renderedNodeMap.get(node.id);
753
+ if (renderedNode && !this._firstRun) {
754
+ this.renderedNode.node = renderedNode;
755
+ }
666
756
  }
667
757
  this.selectedNodeHashId = node.body.node.idHash;
668
758
  node.body.active = true;
669
759
  this.activeNode = node.body.node;
670
760
  this.explorer.activeNode = node.body.node;
671
761
  found = true;
672
- foundRenderedNode = renderedNode;
762
+ if (replaceRenderedNode) {
763
+ foundRenderedNode = renderedNode;
764
+ }
673
765
  if (!evt.detail.noState) {
674
766
  this.addClickTrack(node.body.node);
675
767
  }
@@ -680,9 +772,9 @@ let TheDoctor = class TheDoctor extends LitElement {
680
772
  });
681
773
  if (!found) {
682
774
  // might be filtered, check the filtered nodes
683
- const node = this.nodeIdHashMap.get(evt.detail.nodeHashId);
775
+ const node = this.nodeIdMap.get(evt.detail.nodeId);
684
776
  if (node) {
685
- this.selectedNodeHashId = evt.detail.nodeHashId;
777
+ this.selectedNodeHashId = node.idHash;
686
778
  this.activeNode = node;
687
779
  this.explorer.activeNode = node;
688
780
  this.explorer.equalizer.activeNode = node;
@@ -692,7 +784,7 @@ let TheDoctor = class TheDoctor extends LitElement {
692
784
  // when jumping back to the spec view, we need to set the line
693
785
  this.pendingLine = foundRenderedNode.keyLine;
694
786
  }
695
- this.modelTree.explorerClicked(evt.detail.nodeHashId);
787
+ this.modelTree.explorerClicked(evt.detail.nodeId);
696
788
  if (!this._firstRun) {
697
789
  this.viewerPanel.click();
698
790
  }
@@ -810,6 +902,7 @@ let TheDoctor = class TheDoctor extends LitElement {
810
902
  }
811
903
  }
812
904
  buildRolodexResultMap(results) {
905
+ // TODO: optimize this, it's a bit slow.
813
906
  this.rolodexProblemMap.clear();
814
907
  results.forEach((problem) => {
815
908
  // check if the source location is '/root.yaml'
@@ -839,10 +932,24 @@ let TheDoctor = class TheDoctor extends LitElement {
839
932
  }
840
933
  else {
841
934
  if (!this.rolodexRootPath) {
842
- this.rolodexProblemMap.set("root", [problem]);
935
+ const currProblems = this.rolodexProblemMap.get("root");
936
+ if (currProblems) {
937
+ currProblems.push(problem);
938
+ this.rolodexProblemMap.set("root", currProblems);
939
+ }
940
+ else {
941
+ this.rolodexProblemMap.set("root", [problem]);
942
+ }
843
943
  }
844
944
  else {
845
- this.rolodexProblemMap.set(this.rolodexRootPath, [problem]);
945
+ const currProblems = this.rolodexProblemMap.get(this.rolodexRootPath);
946
+ if (currProblems) {
947
+ currProblems.push(problem);
948
+ this.rolodexProblemMap.set(this.rolodexRootPath, currProblems);
949
+ }
950
+ else {
951
+ this.rolodexProblemMap.set(this.rolodexRootPath, [problem]);
952
+ }
846
953
  }
847
954
  }
848
955
  }
@@ -915,7 +1022,7 @@ let TheDoctor = class TheDoctor extends LitElement {
915
1022
  }
916
1023
  }
917
1024
  let revive = true;
918
- LintingService.lintFile(value, this.brokerConnectionId, url, currentPath).then((result) => {
1025
+ LintingService.lintFile(value, this.brokerConnectionId, url, currentPath, this.skipTimeline).then((result) => {
919
1026
  //if (replaceResults) {
920
1027
  this.activitySpinner.hide();
921
1028
  const map = this.buildRolodexResultMap(result);
@@ -1024,7 +1131,7 @@ let TheDoctor = class TheDoctor extends LitElement {
1024
1131
  }
1025
1132
  // fetch graph
1026
1133
  if ((this.rolodexRootPath == this.rolodexActivePath || this.rolodexActivePath == 'root') || url) {
1027
- ModelService.createGraph().then((result) => {
1134
+ ModelService.fetchLatestGraph().then((result) => {
1028
1135
  this.extractGraph(result);
1029
1136
  });
1030
1137
  }
@@ -1059,6 +1166,7 @@ let TheDoctor = class TheDoctor extends LitElement {
1059
1166
  }
1060
1167
  else {
1061
1168
  this.fetchRefMap(currentPath);
1169
+ this.timeVortex.tardisControl.fetchHistory();
1062
1170
  }
1063
1171
  // update the overview statistics
1064
1172
  LintingService.fetchStatistics().then((result) => {
@@ -1106,6 +1214,7 @@ let TheDoctor = class TheDoctor extends LitElement {
1106
1214
  this.explorerBooted = true;
1107
1215
  }
1108
1216
  }).catch((e) => {
1217
+ this.activitySpinner.hide();
1109
1218
  if (!url) {
1110
1219
  //this.platformUnavailable(e);
1111
1220
  console.error("so sorry, the doctor cannot see you right now, the clinic is closed.");
@@ -1121,6 +1230,14 @@ let TheDoctor = class TheDoctor extends LitElement {
1121
1230
  title: "Credit exhausted!",
1122
1231
  });
1123
1232
  }
1233
+ else {
1234
+ this.sendToast({
1235
+ id: crypto.randomUUID(),
1236
+ type: ToastType.ERROR,
1237
+ body: e.detail,
1238
+ title: "Platform Error",
1239
+ });
1240
+ }
1124
1241
  }
1125
1242
  }
1126
1243
  else {
@@ -1293,6 +1410,14 @@ let TheDoctor = class TheDoctor extends LitElement {
1293
1410
  this.referenceMapBag = this.bagManager.getBag(ReferenceMapBag);
1294
1411
  this.docExpirationBag = this.bagManager.getBag(DocumentationExpirationBag);
1295
1412
  this.panelStateBag = this.bagManager.getBag(PanelStateBag);
1413
+ this.settingsBag = this.bagManager.getBag(SettingsBag);
1414
+ // register a handler for settings bag changes.
1415
+ this.settingsBag?.onAllChanges(this.settingsChanged.bind(this));
1416
+ this.settingsComponent.settingsBag = this.settingsBag;
1417
+ if (this.settingsBag) {
1418
+ this.settingsChanged('', this.settingsBag.get(SettingsBag));
1419
+ }
1420
+ this.settingsComponent.bootstrap();
1296
1421
  // load the rolodex
1297
1422
  if (this.rolodexResponseBag) {
1298
1423
  const response = this.rolodexResponseBag.get(RolodexResponseBag);
@@ -1545,20 +1670,26 @@ let TheDoctor = class TheDoctor extends LitElement {
1545
1670
  const renderedNodes = new Map();
1546
1671
  graph?.nodesRendered?.forEach((node) => {
1547
1672
  this.explorer.renderedNodeMap.set(node.id, node);
1548
- renderedNodes.set(node.idHash, node);
1673
+ renderedNodes.set(node.id, node);
1549
1674
  });
1550
1675
  for (let i = 0; i < graph?.nodesRendered?.length; i++) {
1551
- this.renderedNodeMap.set(graph.nodesRendered[i].idHash, graph.nodesRendered[i]);
1676
+ this.renderedNodeMap.set(graph.nodesRendered[i].id, graph.nodesRendered[i]);
1552
1677
  }
1553
1678
  graph?.nodes?.forEach((node) => {
1554
- this.nodeMap.set('model-' + node.idHash, node);
1555
- this.nodeIdMap.set(node.id, node);
1556
- this.nodeIdHashMap.set(node.idHash, node);
1679
+ this.nodeMap.set(node.id, node);
1680
+ if (node.idHash.includes('root')) {
1681
+ this.nodeIdMap.set('root', node);
1682
+ this.nodeIdHashMap.set(node.id, node);
1683
+ }
1684
+ else {
1685
+ this.nodeIdMap.set(node.id, node);
1686
+ this.nodeIdHashMap.set(node.idHash, node);
1687
+ }
1557
1688
  if (node.filtered) {
1558
- this.filteredNodes.set(node.idHash, node);
1689
+ this.filteredNodes.set(node.id, node);
1559
1690
  }
1560
- const renderedNode = this.renderedNodeMap.get(node.idHash);
1561
- if (this.activeNode?.id === node.id && this.renderedNodeMap.get(node.idHash)) {
1691
+ const renderedNode = this.renderedNodeMap.get(node.id);
1692
+ if (this.activeNode?.id === node.id && this.renderedNodeMap.get(node.id)) {
1562
1693
  if (this.renderedNode && renderedNode) {
1563
1694
  this.renderedNode.node = renderedNode;
1564
1695
  }
@@ -1567,7 +1698,7 @@ let TheDoctor = class TheDoctor extends LitElement {
1567
1698
  this.graphBag?.set(GraphBag, graph);
1568
1699
  this.explorer.updateGraphResponse(graph);
1569
1700
  if (graph && graph.nodes) {
1570
- this.modelTree.node = graph?.nodes[0]; // update tree
1701
+ this.modelTree.node = graph?.nodesRendered[0]; // update tree
1571
1702
  }
1572
1703
  if (!this.explorer.equalizer.isInitialized()) {
1573
1704
  this.explorer.equalizer.initializeEqualizer();
@@ -1575,6 +1706,8 @@ let TheDoctor = class TheDoctor extends LitElement {
1575
1706
  else {
1576
1707
  this.explorer.equalizer.runEQ(true);
1577
1708
  }
1709
+ // sync timeline
1710
+ this.timeVortex.checkHistory();
1578
1711
  }
1579
1712
  customRulesetEnabled(event) {
1580
1713
  const customRS = { rules: new Map() };
@@ -1713,7 +1846,6 @@ let TheDoctor = class TheDoctor extends LitElement {
1713
1846
  this.ruleDocsWorker.addEventListener("message", (event) => {
1714
1847
  const data = event.data;
1715
1848
  if (data) {
1716
- this.docExpirationBag?.set(DocumentationExpirationBag, new Date().toISOString());
1717
1849
  data.forEach((doc) => {
1718
1850
  if (doc.ruleId) {
1719
1851
  this.ruleDocsBag?.set(doc.ruleId, doc);
@@ -1725,20 +1857,20 @@ let TheDoctor = class TheDoctor extends LitElement {
1725
1857
  this.activitySpinner.hide();
1726
1858
  }
1727
1859
  });
1728
- let ruleDocs = [];
1729
- let functionDocs = [];
1730
- if (this.ruleDocsBag) {
1731
- ruleDocs = Array.from(this.ruleDocsBag.export().keys());
1732
- }
1733
- if (this.functionDocsBag) {
1734
- functionDocs = Array.from(this.functionDocsBag.export().keys());
1735
- }
1860
+ // let ruleDocs: string[] = [];
1861
+ // let functionDocs: string[] = [];
1862
+ // if (this.ruleDocsBag) {
1863
+ // ruleDocs = Array.from(this.ruleDocsBag.export().keys());
1864
+ // }
1865
+ // if (this.functionDocsBag) {
1866
+ // functionDocs = Array.from(this.functionDocsBag.export().keys());
1867
+ // }
1736
1868
  const fetchDocs = () => {
1737
1869
  this.ruleDocsWorker.postMessage({
1738
1870
  start: true,
1739
1871
  endpoint: this.doctorEndpoint,
1740
- existingRules: ruleDocs,
1741
- existingFunctions: functionDocs
1872
+ existingRules: [],
1873
+ existingFunctions: []
1742
1874
  });
1743
1875
  };
1744
1876
  // check expiration
@@ -1748,12 +1880,12 @@ let TheDoctor = class TheDoctor extends LitElement {
1748
1880
  if (expiration) {
1749
1881
  const now = new Date().getTime();
1750
1882
  const then = new Date(expiration).getTime();
1751
- if (now - then > 1296000000) {
1752
- fetchDocs();
1753
- }
1754
- else {
1755
- this.activitySpinner.hide();
1756
- }
1883
+ // if (now - then > 1296000000) {
1884
+ // fetchDocs();
1885
+ // } else {
1886
+ // this.activitySpinner.hide();
1887
+ // }
1888
+ fetchDocs(); // always fetch for now.
1757
1889
  }
1758
1890
  else {
1759
1891
  fetchDocs();
@@ -1877,10 +2009,17 @@ let TheDoctor = class TheDoctor extends LitElement {
1877
2009
  if (this.docBag) {
1878
2010
  this.docBag.set(DefaultDocument, event.detail.content);
1879
2011
  }
1880
- clearTimeout(this.bounceId);
1881
- this.bounceId = window.setTimeout(() => {
1882
- this.lintSpec(event.detail.content);
1883
- }, this.debounceTime);
2012
+ if (this.autoDiagnose) {
2013
+ clearTimeout(this.bounceId);
2014
+ this.bounceId = window.setTimeout(() => {
2015
+ this.lintSpec(event.detail.content);
2016
+ }, this.debounceTime);
2017
+ }
2018
+ }
2019
+ runDiagnostics() {
2020
+ if (!this.autoDiagnose) {
2021
+ this.lintSpec(this.editor.getValue());
2022
+ }
1884
2023
  }
1885
2024
  boostrap() {
1886
2025
  // if the url is set in the query string, fetch it and run a lint with the URL
@@ -1892,18 +2031,24 @@ let TheDoctor = class TheDoctor extends LitElement {
1892
2031
  this.lintSpec('', urlParam);
1893
2032
  return;
1894
2033
  }
1895
- if (this.editor.getValue() === '' || !this.problems) {
1896
- LintingService.bootstrapEditor().then((result) => {
1897
- this.editor.setValue(result, true);
1898
- this.rolodexActivePath = "";
1899
- this.specChanged(new CustomEvent(EditorUpdated, {
1900
- detail: {
1901
- content: result,
1902
- id: "spec"
1903
- }
1904
- }));
1905
- });
1906
- }
2034
+ setTimeout(() => {
2035
+ // check for a history
2036
+ this.timeVortex.doctor = this;
2037
+ this.timeVortex.checkHistory();
2038
+ const editorValue = this.docBag?.get(DefaultDocument);
2039
+ if (!editorValue) {
2040
+ LintingService.bootstrapEditor().then((result) => {
2041
+ this.editor.setValue(result, true);
2042
+ this.rolodexActivePath = "";
2043
+ this.specChanged(new CustomEvent(EditorUpdated, {
2044
+ detail: {
2045
+ content: result,
2046
+ id: "spec"
2047
+ }
2048
+ }));
2049
+ });
2050
+ }
2051
+ }, 200);
1907
2052
  }
1908
2053
  exportJSON() {
1909
2054
  let jsonRS;
@@ -1959,10 +2104,10 @@ let TheDoctor = class TheDoctor extends LitElement {
1959
2104
  switch (event.detail.name) {
1960
2105
  case ActiveView.Problems:
1961
2106
  case ActiveView.Overview:
1962
- if (this.selectedEditorTab != "spec") {
1963
- this.selectedEditorTab = "spec";
1964
- this.editorTabGroup.show("spec");
1965
- }
2107
+ // if (this.selectedEditorTab != "spec") {
2108
+ // this.selectedEditorTab = "spec";
2109
+ // this.editorTabGroup.show("spec");
2110
+ // }
1966
2111
  break;
1967
2112
  case ActiveView.Ruleset:
1968
2113
  if (this.selectedEditorTab != ActiveView.Ruleset) {
@@ -2000,12 +2145,18 @@ let TheDoctor = class TheDoctor extends LitElement {
2000
2145
  }
2001
2146
  this.sidebarClosed = !this.sidebarClosed;
2002
2147
  }
2148
+ showHistory() {
2149
+ this.closeExplorer();
2150
+ this.hideMinimapIcon();
2151
+ this.requestUpdate();
2152
+ }
2003
2153
  toggleExplorer() {
2004
2154
  this.explorerVisible = !this.explorerVisible;
2005
2155
  if (this.explorerVisible && this.activeNode) {
2006
2156
  this.explorer.moveToNode(this.activeNode);
2007
2157
  }
2008
2158
  this.hideMinimapIcon();
2159
+ this.showDiagnosisButton = false;
2009
2160
  this.explorerBooted = true;
2010
2161
  // check if ths is safari and fire a warning toast!
2011
2162
  const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
@@ -2019,16 +2170,23 @@ let TheDoctor = class TheDoctor extends LitElement {
2019
2170
  }
2020
2171
  }
2021
2172
  hideMinimapIcon() {
2022
- console.log('hiding minimap icon');
2023
2173
  this.minimapIconVisible = false;
2024
2174
  }
2175
+ hideDiagnosisButton() {
2176
+ this.showDiagnosisButton = false;
2177
+ }
2178
+ enableDiagnosisButton() {
2179
+ if (!this.autoDiagnose) {
2180
+ this.showDiagnosisButton = true;
2181
+ }
2182
+ }
2025
2183
  showMinimapIcon() {
2026
- console.log('showing minimap icon');
2027
2184
  this.minimapIconVisible = true;
2028
2185
  }
2029
2186
  closeExplorer() {
2030
2187
  this.explorerVisible = false;
2031
2188
  this.showMinimapIcon();
2189
+ this.showDiagnosisButton = true;
2032
2190
  setTimeout(() => {
2033
2191
  if (this.pendingLine > 0) {
2034
2192
  this.editor.editor?.setPosition({ lineNumber: this.pendingLine, column: 1 });
@@ -2098,6 +2256,25 @@ let TheDoctor = class TheDoctor extends LitElement {
2098
2256
  </div>
2099
2257
  </sl-split-panel>`;
2100
2258
  }
2259
+ // if the timeVortex is on and the picker is visible, we need to wrap the model tree in a tab view.
2260
+ if (this.timeVortex.pickerVisible) {
2261
+ modelTree = html `
2262
+ <sl-tab-group class="tab-group timevortex" @sl-tab-show="${this.selectEditorTab}">
2263
+ <sl-tab slot="nav" panel="model-tree" class="tab" id="model-tree">
2264
+ Document
2265
+ </sl-tab>
2266
+ <sl-tab slot="nav" panel="timeline" class="tab" id="timeline-view">
2267
+ Timeline
2268
+ </sl-tab>
2269
+ <sl-tab-panel name="model-tree" class="tab-panel model-tree-panel">
2270
+ ${modelTree}
2271
+ </sl-tab-panel>
2272
+ <sl-tab-panel name="timeline" class="tab-panel">
2273
+ ${this.timeVortex.historyPicker}
2274
+ </sl-tab-panel>
2275
+ </sl-tab-group>
2276
+ `;
2277
+ }
2101
2278
  return html `
2102
2279
  ${this.uploadArchive}
2103
2280
  ${this.nukeWorkspace}
@@ -2165,33 +2342,73 @@ let TheDoctor = class TheDoctor extends LitElement {
2165
2342
  class="divider-vert"></sl-icon>
2166
2343
  <div class="editor" slot="start">
2167
2344
 
2168
- <sl-tooltip class="minimap-tip" content="Toggle source mini-map" hoist style="${!this.minimapIconVisible ? 'display: none' : ''}">
2345
+ ${this.settingsComponent}
2346
+
2347
+ <sl-tooltip class="minimap-tip" content="Toggle source mini-map" hoist
2348
+ style="${!this.minimapIconVisible ? 'display: none' : ''}">
2169
2349
  <sl-icon-button @click="${this.minimapToggled}"
2170
2350
  name="map"
2171
- class="minimap-toggle ${this.minimapVisible ? 'active' : ''}"
2351
+ class="minimap-toggle ${this.minimapVisible ? 'active' : ''}"
2172
2352
  style="${!this.minimapIconVisible ? 'display: none' : ''}"></sl-icon-button>
2173
2353
  </sl-tooltip>
2174
2354
 
2355
+ <sl-tooltip class="settings-tip" content="Open settings for the doctor" hoist>
2356
+ <sl-icon-button @click="${() => {
2357
+ this.settingsComponent.open();
2358
+ }}"
2359
+ name="gear"
2360
+ class="settings-toggle ${!this.settingsComponent.opened ? 'active' : ''}"></sl-icon-button>
2361
+ </sl-tooltip>
2362
+
2363
+ <sl-button class="diagnose-button" @click="${this.runDiagnostics}"
2364
+ size="small"
2365
+ style="${(this.autoDiagnose || !this.showDiagnosisButton) ? 'display: none' : ''}">
2366
+ make diagnosis
2367
+ </sl-button>
2368
+
2369
+
2175
2370
  ${this.detailsDrawer}
2176
2371
  <sl-tab-group class="tab-group" @sl-tab-show="${this.selectEditorTab}"
2177
2372
  id="editor-controls">
2178
2373
 
2179
2374
  <sl-tab slot="nav" panel="spec" class="tab" id="spec"
2180
- @click="${this.closeExplorer}">
2375
+ @click="${() => {
2376
+ this.closeExplorer();
2377
+ this.enableDiagnosisButton();
2378
+ }}">
2181
2379
  OpenAPI Spec
2182
2380
  </sl-tab>
2183
2381
  <sl-tab slot="nav" panel="explorer" class="tab" id="explorer"
2184
- @click="${this.toggleExplorer}">Explorer
2382
+ @click="${() => {
2383
+ this.toggleExplorer();
2384
+ this.hideDiagnosisButton();
2385
+ }}">Explorer
2185
2386
  </sl-tab>
2387
+
2388
+
2389
+ <sl-tab slot="nav" panel="tardis" class="tab" id="history"
2390
+ @click="${() => {
2391
+ this.showHistory();
2392
+ this.hideDiagnosisButton();
2393
+ }}">History
2394
+ </sl-tab>
2395
+
2186
2396
  <sl-tab slot="nav" panel="ruleset" class="tab" id="ruleset"
2187
- @click="${this.closeExplorer}">
2397
+ @click="${() => {
2398
+ this.closeExplorer();
2399
+ this.hideDiagnosisButton();
2400
+ }}">
2188
2401
  Ruleset ${rulesetPulsePill}
2189
2402
  </sl-tab>
2190
2403
 
2191
- <sl-tab slot="nav" panel="docs" class="tab" id="docs" @click="${this.hideMinimapIcon}">
2404
+ <sl-tab slot="nav" panel="docs" class="tab" id="docs"
2405
+ @click="${() => {
2406
+ this.hideMinimapIcon();
2407
+ this.hideDiagnosisButton();
2408
+ }}">
2192
2409
  API Docs
2193
2410
  </sl-tab>
2194
-
2411
+
2195
2412
 
2196
2413
  <sl-tab-panel name="spec" class="tab-panel">
2197
2414
  <div class="main-view">
@@ -2231,6 +2448,10 @@ let TheDoctor = class TheDoctor extends LitElement {
2231
2448
  @mouseleave="${this.ungrabExplorer}">${this.explorer}
2232
2449
  </sl-tab-panel>
2233
2450
 
2451
+ <sl-tab-panel name="tardis" class="tab-panel">
2452
+ ${this.timeVortex.tardisControl}
2453
+ </sl-tab-panel>
2454
+
2234
2455
  <sl-tab-panel name="docs" class="tab-panel" style="height: calc(100vh - 100px)">
2235
2456
  <iframe src="${this.doctorEndpoint}/model/scalar-template?z=${this.randomTicker}" width="100%" height="100%" style="border: none"></iframe>
2236
2457
  </sl-tab-panel>
@@ -2244,6 +2465,7 @@ let TheDoctor = class TheDoctor extends LitElement {
2244
2465
 
2245
2466
  </div>`;
2246
2467
  }
2468
+ // <iframe src="${this.doctorEndpoint}/model/scalar-template?z=${this.randomTicker}" width="100%" height="100%" style="border: none"></iframe>
2247
2469
  fetchUrl(event) {
2248
2470
  this.activeURL = event.detail.url;
2249
2471
  this.rolodexNeedsReset = true;
@@ -2268,8 +2490,12 @@ let TheDoctor = class TheDoctor extends LitElement {
2268
2490
  ungrabExplorer() {
2269
2491
  this.explorer.grabbed = false;
2270
2492
  }
2493
+ selectTardis() {
2494
+ this.closeExplorer();
2495
+ this.historyPanel.click();
2496
+ }
2271
2497
  };
2272
- TheDoctor.styles = [theDoctorCss, linksCss, dialogCss, buttonCss, radioGroupsCss, tabsCss, formsCss, spinnerCss, tooltipCss];
2498
+ TheDoctor.styles = [theDoctorCss, linksCss, dialogCss, buttonCss, radioGroupsCss, tabsCss, formsCss, spinnerCss, tooltipCss, panelsCss];
2273
2499
  __decorate([
2274
2500
  query('#overviewPanel')
2275
2501
  ], TheDoctor.prototype, "overviewPanel", void 0);
@@ -2282,6 +2508,9 @@ __decorate([
2282
2508
  __decorate([
2283
2509
  query('#explorer')
2284
2510
  ], TheDoctor.prototype, "explorerPanel", void 0);
2511
+ __decorate([
2512
+ query('#history')
2513
+ ], TheDoctor.prototype, "historyPanel", void 0);
2285
2514
  __decorate([
2286
2515
  query('sl-tab-group#manager-controls')
2287
2516
  ], TheDoctor.prototype, "controlTabGroup", void 0);
@@ -2366,6 +2595,12 @@ __decorate([
2366
2595
  __decorate([
2367
2596
  state()
2368
2597
  ], TheDoctor.prototype, "rolodexNeedsReset", void 0);
2598
+ __decorate([
2599
+ state()
2600
+ ], TheDoctor.prototype, "autoDiagnose", void 0);
2601
+ __decorate([
2602
+ state()
2603
+ ], TheDoctor.prototype, "showDiagnosisButton", void 0);
2369
2604
  TheDoctor = __decorate([
2370
2605
  customElement("pb33f-doctor")
2371
2606
  ], TheDoctor);