@pb33f/cowboy-components 0.6.7 → 0.7.1

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 (186) 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/changelog/changelog.js +1 -1
  4. package/dist/components/charts/beefy-chart.d.ts +21 -0
  5. package/dist/components/charts/beefy-chart.js +159 -0
  6. package/dist/components/charts/chart-colors.d.ts +27 -0
  7. package/dist/components/charts/chart-colors.js +76 -0
  8. package/dist/components/charts/config.d.ts +15 -0
  9. package/dist/components/charts/config.js +35 -0
  10. package/dist/components/charts/doughnut-chart.d.ts +22 -0
  11. package/dist/components/charts/doughnut-chart.js +128 -0
  12. package/dist/components/editor/editor.d.ts +9 -3
  13. package/dist/components/editor/editor.js +115 -60
  14. package/dist/components/editor/init.d.ts +0 -0
  15. package/dist/components/editor/init.js +28 -0
  16. package/dist/components/editor/schemas/openapi3.json +1651 -0
  17. package/dist/components/editor/schemas/openapi31.json +1449 -0
  18. package/dist/components/model-icon/model-icon.js +3 -0
  19. package/dist/components/model-renderer/callback.js +2 -1
  20. package/dist/components/model-renderer/change.css.d.ts +2 -0
  21. package/dist/components/model-renderer/change.css.js +254 -0
  22. package/dist/components/model-renderer/changes.d.ts +19 -0
  23. package/dist/components/model-renderer/changes.js +306 -0
  24. package/dist/components/model-renderer/clickable-ref.d.ts +10 -6
  25. package/dist/components/model-renderer/clickable-ref.js +9 -0
  26. package/dist/components/model-renderer/components.js +1 -0
  27. package/dist/components/model-renderer/contact.js +2 -1
  28. package/dist/components/model-renderer/document.js +11 -9
  29. package/dist/components/model-renderer/encoding.js +1 -0
  30. package/dist/components/model-renderer/example.js +1 -0
  31. package/dist/components/model-renderer/external-docs.js +1 -0
  32. package/dist/components/model-renderer/has-changes.d.ts +8 -0
  33. package/dist/components/model-renderer/has-changes.js +50 -0
  34. package/dist/components/model-renderer/header.js +1 -0
  35. package/dist/components/model-renderer/info.js +3 -1
  36. package/dist/components/model-renderer/license.js +3 -3
  37. package/dist/components/model-renderer/link.js +1 -1
  38. package/dist/components/model-renderer/media-type.js +1 -1
  39. package/dist/components/model-renderer/oauth-flows.js +2 -1
  40. package/dist/components/model-renderer/operation.js +2 -1
  41. package/dist/components/model-renderer/parameter.js +1 -0
  42. package/dist/components/model-renderer/path-item.js +1 -0
  43. package/dist/components/model-renderer/paths.js +1 -0
  44. package/dist/components/model-renderer/rendered-node.js +20 -20
  45. package/dist/components/model-renderer/rendered-property.css.js +4 -0
  46. package/dist/components/model-renderer/rendered-property.js +5 -2
  47. package/dist/components/model-renderer/request-body.js +1 -1
  48. package/dist/components/model-renderer/response.js +1 -1
  49. package/dist/components/model-renderer/schema.js +57 -54
  50. package/dist/components/model-renderer/security-scheme.js +1 -1
  51. package/dist/components/model-renderer/server.js +1 -0
  52. package/dist/components/model-renderer/tag.js +3 -1
  53. package/dist/components/model-tree/tree.d.ts +7 -4
  54. package/dist/components/model-tree/tree.js +54 -25
  55. package/dist/components/paginator/paginator.css.js +5 -2
  56. package/dist/components/problem-list/problem-mainview.js +8 -1
  57. package/dist/components/rodeo/npm/download-statistic.d.ts +41 -0
  58. package/dist/components/rodeo/npm/download-statistic.js +634 -0
  59. package/dist/components/rodeo/rodeo-nav.js +1 -0
  60. package/dist/components/rodeo/rodeo.d.ts +1 -0
  61. package/dist/components/rodeo/rodeo.js +9 -2
  62. package/dist/components/rodeo/statistic.css.js +17 -0
  63. package/dist/components/rodeo/statistic.d.ts +4 -2
  64. package/dist/components/rodeo/statistic.js +15 -4
  65. package/dist/components/the-doctor/settings.css.d.ts +2 -0
  66. package/dist/components/the-doctor/settings.css.js +28 -0
  67. package/dist/components/the-doctor/settings.d.ts +13 -0
  68. package/dist/components/the-doctor/settings.js +83 -2
  69. package/dist/components/the-doctor/the-doctor.css.js +80 -47
  70. package/dist/components/the-doctor/the-doctor.d.ts +24 -6
  71. package/dist/components/the-doctor/the-doctor.js +345 -110
  72. package/dist/components/the-doctor/upload-archive.js +1 -1
  73. package/dist/components/theme-switcher/theme-switcher.d.ts +1 -1
  74. package/dist/components/theme-switcher/theme-switcher.js +5 -2
  75. package/dist/components/time-vortex/change-list-item.css.d.ts +2 -0
  76. package/dist/components/time-vortex/change-list-item.css.js +96 -0
  77. package/dist/components/time-vortex/change-list-item.d.ts +10 -0
  78. package/dist/components/time-vortex/change-list-item.js +58 -0
  79. package/dist/components/time-vortex/history-picker.css.d.ts +2 -0
  80. package/dist/components/time-vortex/history-picker.css.js +90 -0
  81. package/dist/components/time-vortex/history-picker.d.ts +18 -0
  82. package/dist/components/time-vortex/history-picker.js +143 -0
  83. package/dist/components/time-vortex/spec-summary-timeline-item.css.d.ts +2 -0
  84. package/dist/components/time-vortex/spec-summary-timeline-item.css.js +144 -0
  85. package/dist/components/time-vortex/spec-summary-timeline-item.d.ts +11 -0
  86. package/dist/components/time-vortex/spec-summary-timeline-item.js +153 -0
  87. package/dist/components/time-vortex/tardis-control.css.d.ts +2 -0
  88. package/dist/components/time-vortex/tardis-control.css.js +103 -0
  89. package/dist/components/time-vortex/tardis-control.d.ts +31 -0
  90. package/dist/components/time-vortex/tardis-control.js +286 -0
  91. package/dist/components/time-vortex/time-vortex.d.ts +17 -0
  92. package/dist/components/time-vortex/time-vortex.js +75 -0
  93. package/dist/components/time-vortex/timeline-view.css.d.ts +2 -0
  94. package/dist/components/time-vortex/timeline-view.css.js +28 -0
  95. package/dist/components/time-vortex/timeline-view.d.ts +32 -0
  96. package/dist/components/time-vortex/timeline-view.js +233 -0
  97. package/dist/components/timeline/timeline-item.css.js +95 -48
  98. package/dist/components/timeline/timeline-item.d.ts +1 -0
  99. package/dist/components/timeline/timeline-item.js +20 -1
  100. package/dist/components/timeline/timeline.css.js +46 -40
  101. package/dist/components/timeline/timeline.d.ts +1 -0
  102. package/dist/components/timeline/timeline.js +9 -5
  103. package/dist/components/toast/toast-component.css.js +4 -0
  104. package/dist/components/visualizer/equalizer.d.ts +2 -0
  105. package/dist/components/visualizer/equalizer.js +13 -5
  106. package/dist/components/visualizer/explorer.d.ts +5 -0
  107. package/dist/components/visualizer/explorer.js +41 -37
  108. package/dist/components/visualizer/foreign-object.js +3 -0
  109. package/dist/components/visualizer/nodes/callback.js +3 -1
  110. package/dist/components/visualizer/nodes/changes.css.d.ts +2 -0
  111. package/dist/components/visualizer/nodes/changes.css.js +33 -0
  112. package/dist/components/visualizer/nodes/components.js +3 -1
  113. package/dist/components/visualizer/nodes/contact.js +3 -1
  114. package/dist/components/visualizer/nodes/document.js +1 -0
  115. package/dist/components/visualizer/nodes/graph-node.d.ts +8 -7
  116. package/dist/components/visualizer/nodes/graph-node.js +55 -1
  117. package/dist/components/visualizer/nodes/header.js +3 -1
  118. package/dist/components/visualizer/nodes/info.js +3 -1
  119. package/dist/components/visualizer/nodes/license.js +8 -1
  120. package/dist/components/visualizer/nodes/link.js +3 -1
  121. package/dist/components/visualizer/nodes/media-type.js +3 -1
  122. package/dist/components/visualizer/nodes/operation.js +4 -1
  123. package/dist/components/visualizer/nodes/parameter.js +3 -1
  124. package/dist/components/visualizer/nodes/path-item.js +3 -1
  125. package/dist/components/visualizer/nodes/request-body.js +3 -1
  126. package/dist/components/visualizer/nodes/response.js +3 -1
  127. package/dist/components/visualizer/nodes/schema.js +3 -1
  128. package/dist/components/visualizer/nodes/security-scheme.js +3 -1
  129. package/dist/components/visualizer/nodes/server.js +3 -1
  130. package/dist/components/visualizer/nodes/tag.js +3 -1
  131. package/dist/components/visualizer/nodes/xml.js +3 -1
  132. package/dist/components/visualizer/orientation-controls.d.ts +1 -0
  133. package/dist/components/visualizer/orientation-controls.js +31 -16
  134. package/dist/components/visualizer/search.js +4 -3
  135. package/dist/components/warning-stripe/warning-stripe.d.ts +20 -0
  136. package/dist/components/warning-stripe/warning-stripe.js +124 -0
  137. package/dist/cowboy-components.umd.cjs +3840 -2216
  138. package/dist/css/panels.css.d.ts +2 -0
  139. package/dist/css/panels.css.js +44 -0
  140. package/dist/css/pb33f-theme.css +8 -1
  141. package/dist/css/scrollbar.css.d.ts +2 -0
  142. package/dist/css/scrollbar.css.js +16 -0
  143. package/dist/css/tabs.css.js +1 -1
  144. package/dist/events/doctor.d.ts +15 -1
  145. package/dist/events/doctor.js +5 -0
  146. package/dist/model/api-response.d.ts +6 -0
  147. package/dist/model/api-response.js +2 -0
  148. package/dist/model/chart-data.d.ts +15 -0
  149. package/dist/model/chart-data.js +1 -0
  150. package/dist/model/diagnostic-report.d.ts +5 -0
  151. package/dist/model/diagnostic-report.js +3 -0
  152. package/dist/model/document.d.ts +1 -0
  153. package/dist/model/graph.d.ts +26 -0
  154. package/dist/model/media-type.d.ts +2 -0
  155. package/dist/model/media-type.js +7 -0
  156. package/dist/model/node_type.d.ts +2 -0
  157. package/dist/model/node_type.js +2 -0
  158. package/dist/model/settings.d.ts +5 -0
  159. package/dist/model/settings.js +1 -0
  160. package/dist/model/timeline.d.ts +33 -0
  161. package/dist/model/timeline.js +1 -0
  162. package/dist/monacoeditorwork/css.worker.bundle.js +53460 -0
  163. package/dist/monacoeditorwork/editor.worker.bundle.js +13517 -0
  164. package/dist/monacoeditorwork/html.worker.bundle.js +29660 -0
  165. package/dist/monacoeditorwork/json.worker.bundle.js +21318 -0
  166. package/dist/monacoeditorwork/yaml.worker..bundle.js +37321 -0
  167. package/dist/services/color-service.d.ts +1 -0
  168. package/dist/services/color-service.js +13 -0
  169. package/dist/services/linting-service.d.ts +1 -3
  170. package/dist/services/linting-service.js +21 -29
  171. package/dist/services/model-service.d.ts +1 -1
  172. package/dist/services/model-service.js +35 -8
  173. package/dist/services/rodeo-service.d.ts +6 -0
  174. package/dist/services/rodeo-service.js +134 -0
  175. package/dist/services/timeline-service.d.ts +8 -0
  176. package/dist/services/timeline-service.js +85 -0
  177. package/dist/style.css +1 -1
  178. package/dist/workers/equalizer.worker.js +1 -1
  179. package/dist/workers/search-problems.worker.js +1 -1
  180. package/package.json +6 -1
  181. package/dist/assets/css.worker-Byh--afc.js +0 -84
  182. package/dist/assets/editor.worker-CYC0jP-p.js +0 -12
  183. package/dist/assets/equalizer.worker-CdIiiqfH.js +0 -1
  184. package/dist/assets/html.worker-DArWg-Dy.js +0 -461
  185. package/dist/assets/json.worker-heCfXoJw.js +0 -49
  186. package/dist/assets/search-problems.worker-VJi4P9Gj.js +0 -1
@@ -33,11 +33,11 @@ let EqualizerComponent = EqualizerComponent_1 = class EqualizerComponent extends
33
33
  { type: NodeType.OPERATION, label: 'Operations', enabled: true },
34
34
  { type: NodeType.PARAMETER, label: 'Parameters', enabled: true },
35
35
  { type: NodeType.SCHEMA, label: 'Schemas', enabled: true },
36
- { type: NodeType.INFO, label: 'Information' },
36
+ { type: NodeType.INFO, label: 'Information', enabled: true },
37
37
  { type: NodeType.CONTACT, label: 'Contact' },
38
38
  { type: NodeType.LICENSE, label: 'License' },
39
39
  { type: NodeType.RESPONSE, label: 'Responses', enabled: true },
40
- { type: NodeType.SERVER, label: 'Servers' },
40
+ { type: NodeType.SERVER, label: 'Servers', enabled: true },
41
41
  { type: NodeType.SERVER_VARIABLE, label: 'Server Variables' },
42
42
  { type: NodeType.PATH_ITEM, label: 'Paths', enabled: true },
43
43
  { type: NodeType.MEDIA_TYPE, label: 'Media Types', enabled: true },
@@ -48,8 +48,8 @@ let EqualizerComponent = EqualizerComponent_1 = class EqualizerComponent extends
48
48
  { type: NodeType.ENCODING, label: 'Encodings' },
49
49
  { type: NodeType.TAG, label: 'Tags', enabled: true },
50
50
  { type: NodeType.SECURITY, label: 'Security', enabled: true },
51
- { type: NodeType.CALLBACK, label: 'Callbacks' },
52
- { type: NodeType.WEBHOOK, label: 'Webhooks' },
51
+ { type: NodeType.CALLBACK, label: 'Callbacks', enabled: true },
52
+ { type: NodeType.WEBHOOK, label: 'Webhooks', enabled: true },
53
53
  ];
54
54
  }
55
55
  constructor() {
@@ -57,6 +57,7 @@ let EqualizerComponent = EqualizerComponent_1 = class EqualizerComponent extends
57
57
  this.configuredObjects = new Set();
58
58
  this.initialized = false;
59
59
  this._allChecked = false;
60
+ this.renderEqualizer = true;
60
61
  this.controls = new OrientationControlsComponent();
61
62
  this.keyComponent = new ExplorerKeyComponent();
62
63
  this.controls.searchComponent.graphResponse = this.graphResponse;
@@ -66,6 +67,7 @@ let EqualizerComponent = EqualizerComponent_1 = class EqualizerComponent extends
66
67
  this.equalizerWorker.addEventListener("message", (event) => {
67
68
  this.controls.searchComponent.graphResponse = event.data;
68
69
  this.controls.searchComponent.currentObjects = this.currentObjects;
70
+ this.controls.searchComponent.currentObjects = this.currentObjects;
69
71
  if (!this.firstBoot) {
70
72
  this.dispatchEvent(new CustomEvent(ExplorerEqualizerFiltered, {
71
73
  bubbles: true,
@@ -139,12 +141,15 @@ let EqualizerComponent = EqualizerComponent_1 = class EqualizerComponent extends
139
141
  this.buildRenderObjectFilters();
140
142
  this.firstBoot = true;
141
143
  }
144
+ updated() {
145
+ this.controls.renderEqualizer = this.renderEqualizer;
146
+ }
142
147
  navigateToRoot() {
143
148
  this.dispatchEvent(new CustomEvent(ModelTreeNodeClicked, {
144
149
  bubbles: true,
145
150
  composed: true,
146
151
  detail: {
147
- nodeHashId: 'root',
152
+ nodeId: 'root',
148
153
  first: true
149
154
  }
150
155
  }));
@@ -542,6 +547,9 @@ __decorate([
542
547
  __decorate([
543
548
  property({ type: Boolean })
544
549
  ], EqualizerComponent.prototype, "dimDependencies", void 0);
550
+ __decorate([
551
+ property({ type: Boolean })
552
+ ], EqualizerComponent.prototype, "renderEqualizer", void 0);
545
553
  EqualizerComponent = EqualizerComponent_1 = __decorate([
546
554
  customElement('pb33f-explorer-equalizer')
547
555
  ], EqualizerComponent);
@@ -22,10 +22,15 @@ export declare class ExplorerComponent extends HasEyes {
22
22
  paths: SVGPathElement[];
23
23
  foreignObjects: SVGForeignObjectElement[];
24
24
  ready: boolean;
25
+ renderEqualizer: boolean;
25
26
  models: Node[];
26
27
  private elk;
27
28
  private startX;
28
29
  private startY;
30
+ private zoomX;
31
+ private zoomY;
32
+ private zoomW;
33
+ private zoomH;
29
34
  private readonly graphDependentWorker;
30
35
  nodes: ExplorerNode[];
31
36
  edges: ExplorerEdge[];
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import '../';
8
- import { queryAll, customElement, query, state } from "lit/decorators.js";
8
+ import { queryAll, customElement, query, state, property } from "lit/decorators.js";
9
9
  import { html, svg } from "lit";
10
10
  import visualizerCss from "./visualizer.css.js";
11
11
  import { ForeignObjectComponent } from "./foreign-object.js";
@@ -77,6 +77,8 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
77
77
  this.nodeLimitExceeded = false;
78
78
  this.nodeLimit = -1;
79
79
  this.equalizer = new EqualizerComponent();
80
+ this.renderEqualizer = true;
81
+ this.equalizer.renderEqualizer = this.renderEqualizer;
80
82
  this.equalizer.nodeNodeBetweenLayers = parseInt(this.nodeNodeBetweenLayers);
81
83
  this.equalizer.nodeNode = parseInt(this.nodeNode);
82
84
  this.equalizer.edgeNodeBetweenLayers = parseInt(this.edgeNodeBetweenLayers);
@@ -86,6 +88,10 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
86
88
  this.equalizer.renderRefs = this.renderRefs;
87
89
  this.equalizer.renderPoly = this.renderPoly;
88
90
  this.dimDependencies = false;
91
+ this.zoomX = 0;
92
+ this.zoomY = 0;
93
+ this.zoomW = 0;
94
+ this.zoomH = 0;
89
95
  this.graphDependentWorker = new GraphDependentWorker();
90
96
  this.equalizer.addEventListener(ExplorerZoomIn, this.zoomIn.bind(this));
91
97
  this.equalizer.addEventListener(ExplorerZoomOut, this.zoomOut.bind(this));
@@ -103,21 +109,19 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
103
109
  }
104
110
  toggleNodeVisibility(nodes, edges, collapse) {
105
111
  nodes.forEach((node) => {
106
- // extract node component
107
- const nodeComponent = this.nodeComponents.find((nc) => nc.id === node.idHash);
112
+ const nodeComponent = this.nodeComponents.find((nc) => nc.id === node.id);
108
113
  if (nodeComponent) {
109
114
  if (nodeComponent.visible && collapse) {
110
115
  nodeComponent.visible = false;
111
- this.collapsedNodes.set(node.idHash, true);
116
+ this.collapsedNodes.set(node.id, true);
112
117
  }
113
118
  if (!nodeComponent.visible && !collapse) {
114
119
  nodeComponent.visible = true;
115
- this.collapsedNodes.delete(node.idHash);
120
+ this.collapsedNodes.delete(node.id);
116
121
  }
117
122
  }
118
123
  });
119
124
  edges.forEach((edge) => {
120
- // extract edge component
121
125
  const edgeComponent = this.edgeComponents.find((ec) => ec.edge.id === edge.id);
122
126
  if (edgeComponent) {
123
127
  if (edgeComponent.visible && collapse) {
@@ -146,6 +150,7 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
146
150
  this.graphResponse = graphResponse;
147
151
  this.equalizer.graphResponse = graphResponse;
148
152
  this.equalizer.controls.searchComponent.graphResponse = graphResponse;
153
+ this.buildGraph();
149
154
  }
150
155
  rotate() {
151
156
  switch (this.direction) {
@@ -170,7 +175,7 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
170
175
  bubbles: true,
171
176
  composed: true,
172
177
  detail: {
173
- nodeHashId: this.activeNode.idHash,
178
+ nodeId: this.activeNode.id,
174
179
  }
175
180
  }));
176
181
  return;
@@ -200,47 +205,39 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
200
205
  this.grabbed = false;
201
206
  }
202
207
  zoom(scale) {
203
- // Prevent scaling below a certain threshold
204
208
  scale = Math.abs(scale) < 0.02 ? (scale / Math.abs(scale)) * 0.02 : scale;
205
- // Get the current viewBox transform
206
209
  //@ts-ignore
207
210
  let [x, y, width, height] = this.svgItem.getAttribute('viewBox')?.split(' ').map(Number);
208
- // Calculate the center of the current viewBox
209
211
  let centerX = x + width / 2;
210
212
  let centerY = y + height / 2;
211
- // Calculate new width and height
212
213
  let [width2, height2] = [width + width * scale, height + height * scale];
213
- // Calculate new x and y to keep the zoom centered around the viewBox center
214
214
  let x2 = centerX - (width2 / 2);
215
215
  let y2 = centerY - (height2 / 2);
216
216
  if (width2 >= this.zoomMax || width2 <= this.zoomMin) {
217
217
  return;
218
218
  }
219
- // Set the new viewBox
220
219
  this.svgItem.setAttribute('viewBox', `${x2} ${y2} ${width2} ${height2}`);
220
+ this.zoomX = x2;
221
+ this.zoomY = y2;
222
+ this.zoomW = width2;
223
+ this.zoomH = height2;
221
224
  }
222
225
  zoomIn() {
223
- this.zoom(-0.1); // Decrease the viewBox size to zoom in
226
+ this.zoom(-0.1);
224
227
  }
225
228
  zoomOut() {
226
- this.zoom(0.1); // Increase the viewBox size to zoom out
229
+ this.zoom(0.1);
227
230
  }
228
231
  onWheel(evt) {
229
232
  evt.preventDefault();
230
- // I lifted this directly from here:
231
- // https://stackoverflow.com/questions/76150884/how-to-use-the-mouse-wheel-to-zoom-on-an-svg-using-the-viewbox
232
- // set the scaling factor (and make sure it's at least 10%)
233
233
  //@ts-ignore
234
234
  let scale = evt.deltaY / 1000;
235
235
  //@ts-ignore
236
236
  scale = Math.abs(scale) < .02 ? .02 * evt.deltaY / Math.abs(evt.deltaY) : scale;
237
237
  let pt = new DOMPoint(evt.clientX, evt.clientY);
238
238
  pt = pt.matrixTransform(this.svgItem.getScreenCTM()?.inverse());
239
- // @ts-ignore
240
239
  let [x, y, width, height] = this.svgItem.getAttribute('viewBox')?.split(' ').map(Number);
241
- // get pt.x as a proportion of width and pt.y as proportion of height
242
240
  let [xPropW, yPropH] = [(pt.x - x) / width, (pt.y - y) / height];
243
- // calc new width and height, new x2, y2 (using proportions and new width and height)
244
241
  let [width2, height2] = [width + width * scale, height + height * scale];
245
242
  let x2 = pt.x - xPropW * width2;
246
243
  let y2 = pt.y - yPropH * height2;
@@ -251,6 +248,10 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
251
248
  return;
252
249
  }
253
250
  requestAnimationFrame(() => {
251
+ this.zoomX = x2;
252
+ this.zoomY = y2;
253
+ this.zoomW = width2;
254
+ this.zoomH = height2;
254
255
  this.svgItem.setAttribute('viewBox', `${x2} ${y2} ${width2} ${height2}`);
255
256
  });
256
257
  }
@@ -290,13 +291,12 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
290
291
  bubbles: true,
291
292
  composed: true,
292
293
  detail: {
293
- nodeHashId: this.activeNode.idHash,
294
+ nodeId: this.activeNode.id,
294
295
  first: true
295
296
  }
296
297
  }));
297
298
  return;
298
299
  }
299
- //this.navigateToRoot();
300
300
  }, 150);
301
301
  }
302
302
  buildLayout() {
@@ -345,7 +345,6 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
345
345
  edges: this.graphResponse.edges
346
346
  };
347
347
  this.graph = graph;
348
- // build node map
349
348
  this.nodeMap.clear();
350
349
  this.buildLayout();
351
350
  if (!this.equalizer.graphResponse) {
@@ -408,17 +407,19 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
408
407
  this.graph.children?.forEach((c) => {
409
408
  const child = c;
410
409
  const nc = new ForeignObjectComponent();
411
- nc.id = child.idHash;
410
+ nc.id = child.id;
412
411
  if (child.x && child.y) {
413
- nc.x = child.x;
414
- nc.y = child.y;
412
+ child.x = Math.round(child.x);
413
+ child.y = Math.round(child.y);
414
+ nc.x = Math.round(child.x);
415
+ nc.y = Math.round(child.y);
415
416
  }
416
417
  nc.width = child.width;
417
418
  nc.height = child.height;
418
419
  const op = this.generateNodeType(child.type);
419
420
  op.height = child.height;
420
421
  op.width = child.width - 2;
421
- op.id = child.idHash;
422
+ op.id = child.id;
422
423
  op.label = child.label;
423
424
  op.isLeaf = !(child.nodes && child.nodes.length > 0);
424
425
  op.node = child;
@@ -426,7 +427,7 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
426
427
  op.active = child.active;
427
428
  nc.active = child.active;
428
429
  }
429
- if (!child.active && this.activeNode && this.activeNode.idHash === child.idHash) {
430
+ if (!child.active && this.activeNode && this.activeNode.id === child.id) {
430
431
  op.active = true;
431
432
  nc.active = true;
432
433
  }
@@ -436,14 +437,12 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
436
437
  op.dim = true;
437
438
  }
438
439
  }
439
- // check if this node was collapsed
440
- if (this.collapsedNodes.has(child.idHash)) {
440
+ if (this.collapsedNodes.has(child.id)) {
441
441
  nc.visible = false;
442
442
  }
443
443
  op.nodeInstance = this.renderedNodeMap.get(child.id)?.instance;
444
444
  child.results = this.renderedNodeMap.get(child.id)?.results;
445
445
  this.renderGraphMap.set(child.id, op);
446
- // set the node component body to the operation
447
446
  nc.body = op;
448
447
  this.nodeComponents.push(nc);
449
448
  this.nodes.push(child);
@@ -463,7 +462,6 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
463
462
  s.isRef = true;
464
463
  }
465
464
  const edgeComponent = new EdgeComponent(edge);
466
- // check if this edge was collapsed
467
465
  if (this.collapsedEdges.has(edge.id)) {
468
466
  edgeComponent.visible = false;
469
467
  }
@@ -492,7 +490,6 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
492
490
  });
493
491
  }
494
492
  else {
495
- // could be refs
496
493
  node.outputs.forEach((edge) => {
497
494
  if (edge.ref != '') {
498
495
  const e = this.edgeComponentMap.get(edge.id);
@@ -515,7 +512,11 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
515
512
  reset() {
516
513
  this.direction = Direction.RIGHT;
517
514
  const box = this.buildBaseViewBox();
518
- this.svgItem.setAttribute('viewBox', `${box.offset} 80 ${box.base} ${box.base}`);
515
+ this.zoomH = null;
516
+ this.zoomW = null;
517
+ this.zoomX = null;
518
+ this.zoomY = null;
519
+ this.svgItem.setAttribute('viewBox', `0 0 ${box.base} ${box.base}`);
519
520
  this.resetNodes();
520
521
  this.buildGraph();
521
522
  setTimeout(() => {
@@ -524,7 +525,7 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
524
525
  bubbles: true,
525
526
  composed: true,
526
527
  detail: {
527
- nodeHashId: this.activeNode.idHash,
528
+ nodeId: this.activeNode.id,
528
529
  first: true
529
530
  }
530
531
  }));
@@ -568,7 +569,7 @@ let ExplorerComponent = class ExplorerComponent extends HasEyes {
568
569
  moveToNode(node, first = false) {
569
570
  if (this.svgItem) {
570
571
  const viewBox = this.svgItem.viewBox.baseVal;
571
- const found = this.graphResponse.nodes.find((n) => n.idHash === node.idHash);
572
+ const found = this.graphResponse.nodes.find((n) => n.id === node.id);
572
573
  if (found != undefined) {
573
574
  if (found.x && found.y && !found.filtered) {
574
575
  if (!first) {
@@ -710,6 +711,9 @@ __decorate([
710
711
  __decorate([
711
712
  state()
712
713
  ], ExplorerComponent.prototype, "ready", void 0);
714
+ __decorate([
715
+ property()
716
+ ], ExplorerComponent.prototype, "renderEqualizer", void 0);
713
717
  __decorate([
714
718
  state()
715
719
  ], ExplorerComponent.prototype, "models", void 0);
@@ -23,6 +23,9 @@ let ForeignObjectComponent = class ForeignObjectComponent extends LitElement {
23
23
  else {
24
24
  body = "Object Node";
25
25
  }
26
+ if (this.x == undefined || this.y == undefined) {
27
+ return svg ``;
28
+ }
26
29
  return svg `
27
30
  <rect id="node-${this.id}" x="${this.x}" y="${this.y}" width="${this.width}" height="${this.height}" class="node"/>
28
31
  <foreignObject x="${this.x}" y="${this.y}" width="${this.width}" height="${this.height + 30}" class="fo">
@@ -10,6 +10,7 @@ import sharedCss from "../shared.css.js";
10
10
  import { GraphNodeComponent } from "./graph-node.js";
11
11
  import { IconColor, IconSize } from "../../model-icon/model-icon.js";
12
12
  import { NodeType } from "../../../model/node_type.js";
13
+ import changesCss from "./changes.css";
13
14
  let CallbackNodeComponent = class CallbackNodeComponent extends GraphNodeComponent {
14
15
  constructor() {
15
16
  super();
@@ -40,11 +41,12 @@ let CallbackNodeComponent = class CallbackNodeComponent extends GraphNodeCompone
40
41
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
41
42
  ${this.renderNode()}
42
43
  ${this.renderUpArrow()}
44
+ ${this.renderChanges()}
43
45
  </div>
44
46
  `;
45
47
  }
46
48
  };
47
- CallbackNodeComponent.styles = [sharedCss];
49
+ CallbackNodeComponent.styles = [sharedCss, changesCss];
48
50
  CallbackNodeComponent = __decorate([
49
51
  customElement('pb33f-explorer-callback-node')
50
52
  ], CallbackNodeComponent);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult;
2
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import { css } from "lit";
2
+ export default css `
3
+ .change-icon {
4
+ display: inline-block;
5
+ margin-left: 6px;
6
+ margin-right: 1px;
7
+ padding-right: 2px;
8
+ padding-left: 2px;
9
+ border: 1px solid var(--font-color-sub2);
10
+ }
11
+
12
+ sl-icon {
13
+ vertical-align: middle;
14
+ margin-right: 1px;
15
+ }
16
+
17
+ .breaking, .removed {
18
+ color: var(--error-color);
19
+ border: 1px solid var(--error-color);
20
+ }
21
+
22
+ .added {
23
+ color: var(--terminal-text);
24
+ border: 1px solid var(--terminal-text);
25
+ }
26
+
27
+ .modified {
28
+ color: var(--font-color-sub1)
29
+ }
30
+
31
+ .change-div {
32
+ }
33
+ `;
@@ -10,6 +10,7 @@ import sharedCss from "../shared.css.js";
10
10
  import { GraphNodeComponent } from "./graph-node.js";
11
11
  import { IconColor, IconSize } from "../../model-icon/model-icon.js";
12
12
  import { NodeType } from "../../../model/node_type.js";
13
+ import changesCss from "./changes.css";
13
14
  let ComponentsNodeComponent = class ComponentsNodeComponent extends GraphNodeComponent {
14
15
  constructor() {
15
16
  super();
@@ -112,11 +113,12 @@ let ComponentsNodeComponent = class ComponentsNodeComponent extends GraphNodeCom
112
113
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
113
114
  ${this.renderDocument()}
114
115
  ${this.renderUpArrow()}
116
+ ${this.renderChanges()}
115
117
  </div>
116
118
  `;
117
119
  }
118
120
  };
119
- ComponentsNodeComponent.styles = [sharedCss];
121
+ ComponentsNodeComponent.styles = [sharedCss, changesCss];
120
122
  ComponentsNodeComponent = __decorate([
121
123
  customElement('pb33f-explorer-components-node')
122
124
  ], ComponentsNodeComponent);
@@ -10,6 +10,7 @@ import sharedCss from "../shared.css.js";
10
10
  import { GraphNodeComponent } from "./graph-node.js";
11
11
  import { IconColor, IconSize } from "../../model-icon/model-icon.js";
12
12
  import { NodeType } from "../../../model/node_type.js";
13
+ import changesCss from "./changes.css";
13
14
  let ContactNodeComponent = class ContactNodeComponent extends GraphNodeComponent {
14
15
  constructor() {
15
16
  super();
@@ -35,11 +36,12 @@ let ContactNodeComponent = class ContactNodeComponent extends GraphNodeComponent
35
36
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
36
37
  ${this.renderNode()}
37
38
  ${this.renderUpArrow()}
39
+ ${this.renderChanges()}
38
40
  </div>
39
41
  `;
40
42
  }
41
43
  };
42
- ContactNodeComponent.styles = [sharedCss];
44
+ ContactNodeComponent.styles = [sharedCss, changesCss];
43
45
  ContactNodeComponent = __decorate([
44
46
  customElement('pb33f-explorer-contact-node')
45
47
  ], ContactNodeComponent);
@@ -75,6 +75,7 @@ let DocumentNodeComponent = class DocumentNodeComponent extends GraphNodeCompone
75
75
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
76
76
  ${this.renderDocument()}
77
77
  ${this.renderUpArrow()}
78
+ ${this.renderChanges()}
78
79
  </div>
79
80
  `;
80
81
  }
@@ -1,4 +1,4 @@
1
- import { LitElement } from "lit";
1
+ import { LitElement, TemplateResult } from "lit";
2
2
  import { ExplorerEdge, ExplorerNode } from "../explorer.js";
3
3
  import { Node } from "../../../model/graph.js";
4
4
  export declare class GraphNodeComponent extends LitElement {
@@ -20,17 +20,18 @@ export declare class GraphNodeComponent extends LitElement {
20
20
  outputs: ExplorerEdge[];
21
21
  constructor();
22
22
  expandDependents(node: Node): void;
23
- renderDependentControl(): import("lit-html").TemplateResult<1>;
24
- renderArrayType(): import("lit-html").TemplateResult<1> | null;
25
- renderUpArrow(): import("lit-html").TemplateResult<1>;
23
+ renderDependentControl(): TemplateResult<1>;
24
+ renderArrayType(): TemplateResult<1> | null;
25
+ renderUpArrow(): TemplateResult<1>;
26
26
  countResults(): {
27
27
  errors: number;
28
28
  warnings: number;
29
29
  info: number;
30
30
  };
31
- renderVacuumResults(): import("lit-html").TemplateResult<1> | undefined;
32
- renderExtensions(): import("lit-html").TemplateResult<1> | undefined;
31
+ renderVacuumResults(): TemplateResult<1> | undefined;
32
+ renderExtensions(): TemplateResult<1> | undefined;
33
33
  clicked(): void;
34
34
  renderClasses(defaultString?: string): string;
35
- render(): import("lit-html").TemplateResult<1>;
35
+ renderChanges(): TemplateResult;
36
+ render(): TemplateResult<1>;
36
37
  }
@@ -124,7 +124,7 @@ let GraphNodeComponent = class GraphNodeComponent extends LitElement {
124
124
  bubbles: true,
125
125
  composed: true,
126
126
  detail: {
127
- nodeHashId: this.id
127
+ nodeId: this.id
128
128
  }
129
129
  }));
130
130
  }
@@ -141,6 +141,60 @@ let GraphNodeComponent = class GraphNodeComponent extends LitElement {
141
141
  }
142
142
  return classes.join(' ');
143
143
  }
144
+ renderChanges() {
145
+ if (!this.node.timeline) {
146
+ return html ``;
147
+ }
148
+ let breaking = 0;
149
+ let mods = 0;
150
+ let adds = 0;
151
+ let removals = 0;
152
+ this.node.timeline.forEach((change) => {
153
+ if (change.breaking) {
154
+ breaking++;
155
+ }
156
+ switch (change.change) {
157
+ case 1:
158
+ mods++;
159
+ break;
160
+ case 2:
161
+ case 3:
162
+ adds++;
163
+ break;
164
+ case 4:
165
+ case 5:
166
+ removals++;
167
+ break;
168
+ }
169
+ });
170
+ const total = mods + adds + removals;
171
+ let blocks = [];
172
+ if (breaking > 0) {
173
+ blocks.push(html `
174
+ <span class="change-icon breaking"><sl-icon name="heartbreak-fill"></sl-icon>${breaking}</span>
175
+ `);
176
+ }
177
+ if (mods > 0) {
178
+ blocks.push(html `
179
+ <span class="change-icon modified"><sl-icon name="pencil"></sl-icon>${mods}</span>
180
+ `);
181
+ }
182
+ if (adds > 0) {
183
+ blocks.push(html `
184
+ <span class="change-icon added"><sl-icon name="plus-lg"></sl-icon>${adds}</span>
185
+ `);
186
+ }
187
+ if (removals > 0) {
188
+ blocks.push(html `
189
+ <span class="change-icon removed"><sl-icon name="x-lg"></sl-icon>${removals}</span>
190
+ `);
191
+ }
192
+ return html `
193
+ <div class="row-node change-div">
194
+ ${blocks}
195
+ </div>
196
+ `;
197
+ }
144
198
  render() {
145
199
  let arrayValues = html ``;
146
200
  if (this.node.isArray) {
@@ -10,6 +10,7 @@ import sharedCss from "../shared.css.js";
10
10
  import { GraphNodeComponent } from "./graph-node.js";
11
11
  import { IconColor, IconSize } from "../../model-icon/model-icon.js";
12
12
  import { NodeType } from "../../../model/node_type.js";
13
+ import changesCss from "./changes.css";
13
14
  let HeaderNodeComponent = class HeaderNodeComponent extends GraphNodeComponent {
14
15
  constructor() {
15
16
  super();
@@ -73,11 +74,12 @@ let HeaderNodeComponent = class HeaderNodeComponent extends GraphNodeComponent {
73
74
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
74
75
  ${this.renderNode()}
75
76
  ${this.renderUpArrow()}
77
+ ${this.renderChanges()}
76
78
  </div>
77
79
  `;
78
80
  }
79
81
  };
80
- HeaderNodeComponent.styles = [sharedCss];
82
+ HeaderNodeComponent.styles = [sharedCss, changesCss];
81
83
  HeaderNodeComponent = __decorate([
82
84
  customElement('pb33f-explorer-header-node')
83
85
  ], HeaderNodeComponent);
@@ -10,6 +10,7 @@ import sharedCss from "../shared.css.js";
10
10
  import { GraphNodeComponent } from "./graph-node.js";
11
11
  import { IconColor, IconSize } from "../../model-icon/model-icon.js";
12
12
  import { NodeType } from "../../../model/node_type.js";
13
+ import changesCss from "./changes.css";
13
14
  let InfoNodeComponent = class InfoNodeComponent extends GraphNodeComponent {
14
15
  constructor() {
15
16
  super();
@@ -41,11 +42,12 @@ let InfoNodeComponent = class InfoNodeComponent extends GraphNodeComponent {
41
42
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
42
43
  ${this.renderNode()}
43
44
  ${this.renderUpArrow()}
45
+ ${this.renderChanges()}
44
46
  </div>
45
47
  `;
46
48
  }
47
49
  };
48
- InfoNodeComponent.styles = [sharedCss];
50
+ InfoNodeComponent.styles = [sharedCss, changesCss, changesCss];
49
51
  InfoNodeComponent = __decorate([
50
52
  customElement('pb33f-explorer-info-node')
51
53
  ], InfoNodeComponent);
@@ -10,6 +10,7 @@ import sharedCss from "../shared.css.js";
10
10
  import { GraphNodeComponent } from "./graph-node.js";
11
11
  import { IconColor, IconSize } from "../../model-icon/model-icon.js";
12
12
  import { NodeType } from "../../../model/node_type.js";
13
+ import changesCss from "./changes.css";
13
14
  let LicenseNodeComponent = class LicenseNodeComponent extends GraphNodeComponent {
14
15
  constructor() {
15
16
  super();
@@ -20,6 +21,11 @@ let LicenseNodeComponent = class LicenseNodeComponent extends GraphNodeComponent
20
21
  <pb33f-model-icon color="${IconColor.secondary}" size="${IconSize.small}" icon="${NodeType.LICENSE}"></pb33f-model-icon>
21
22
  <span class="header-text">License</span>
22
23
  </div>`);
24
+ if (this.license?.name) {
25
+ values.push(html `<div class="row"><span class="chevron">&nbsp;&gt;</span>
26
+ ${this.license.name}
27
+ </div>`);
28
+ }
23
29
  if (this.license?.url || this.license?.identifier) {
24
30
  if (this.license?.identifier) {
25
31
  values.push(html `<div class="row"><span class="chevron">&nbsp;&gt;</span>
@@ -40,11 +46,12 @@ let LicenseNodeComponent = class LicenseNodeComponent extends GraphNodeComponent
40
46
  style="height: ${this.height}px; width: ${this.width}px" @click="${this.clicked}">
41
47
  ${this.renderNode()}
42
48
  ${this.renderUpArrow()}
49
+ ${this.renderChanges()}
43
50
  </div>
44
51
  `;
45
52
  }
46
53
  };
47
- LicenseNodeComponent.styles = [sharedCss];
54
+ LicenseNodeComponent.styles = [sharedCss, changesCss];
48
55
  LicenseNodeComponent = __decorate([
49
56
  customElement('pb33f-explorer-license-node')
50
57
  ], LicenseNodeComponent);