@pb33f/cowboy-components 0.1.15 → 0.2.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 (79) hide show
  1. package/dist/assets/rule-documentation.worker-D39NS8Lx.js +1 -0
  2. package/dist/components/editor/editor.d.ts +2 -0
  3. package/dist/components/editor/editor.js +6 -4
  4. package/dist/components/error-banner/error-banner.css.js +1 -1
  5. package/dist/components/manage-ruleset/function-option.css.d.ts +2 -0
  6. package/dist/components/manage-ruleset/function-option.css.js +38 -0
  7. package/dist/components/manage-ruleset/function-option.d.ts +19 -0
  8. package/dist/components/manage-ruleset/function-option.js +117 -0
  9. package/dist/components/manage-ruleset/manage-ruleset.css.d.ts +2 -0
  10. package/dist/components/manage-ruleset/manage-ruleset.css.js +75 -0
  11. package/dist/components/manage-ruleset/manage-ruleset.d.ts +62 -0
  12. package/dist/components/manage-ruleset/manage-ruleset.js +575 -0
  13. package/dist/components/manage-ruleset/rule-action.css.d.ts +2 -0
  14. package/dist/components/manage-ruleset/rule-action.css.js +56 -0
  15. package/dist/components/manage-ruleset/rule-action.d.ts +37 -0
  16. package/dist/components/manage-ruleset/rule-action.js +351 -0
  17. package/dist/components/manage-ruleset/rule-input.d.ts +38 -0
  18. package/dist/components/manage-ruleset/rule-input.js +296 -0
  19. package/dist/components/manage-ruleset/rule.css.d.ts +2 -0
  20. package/dist/components/manage-ruleset/rule.css.js +117 -0
  21. package/dist/components/manage-ruleset/rule.d.ts +31 -0
  22. package/dist/components/manage-ruleset/rule.js +153 -0
  23. package/dist/components/problem-list/details-drawer.d.ts +2 -1
  24. package/dist/components/problem-list/details-drawer.js +7 -0
  25. package/dist/components/problem-list/filter.css.js +2 -3
  26. package/dist/components/problem-list/problem-item.css.js +1 -3
  27. package/dist/components/problem-list/problem-item.js +1 -1
  28. package/dist/components/problem-list/problem-list.css.js +0 -10
  29. package/dist/components/problem-list/problem-list.d.ts +1 -1
  30. package/dist/components/problem-list/problem-list.js +1 -2
  31. package/dist/components/problems-overview/document-statistic.css.js +0 -1
  32. package/dist/components/problems-overview/problem-overview-group.css.js +1 -3
  33. package/dist/components/problems-overview/problem-overview-group.js +2 -2
  34. package/dist/components/problems-overview/problem-statistics.css.js +0 -5
  35. package/dist/components/problems-overview/problems-overview.css.js +0 -4
  36. package/dist/components/the-doctor/feedback.js +3 -3
  37. package/dist/components/the-doctor/status-bar.js +1 -1
  38. package/dist/components/the-doctor/the-doctor.css.js +99 -27
  39. package/dist/components/the-doctor/the-doctor.d.ts +65 -8
  40. package/dist/components/the-doctor/the-doctor.js +663 -63
  41. package/dist/components/toast/toast-component.css.d.ts +2 -0
  42. package/dist/components/toast/toast-component.css.js +151 -0
  43. package/dist/components/toast/toast-component.d.ts +19 -0
  44. package/dist/components/toast/toast-component.js +116 -0
  45. package/dist/components/toast/toast-manager.d.ts +13 -0
  46. package/dist/components/toast/toast-manager.js +54 -0
  47. package/dist/cowboy-components.umd.cjs +1375 -372
  48. package/dist/css/button.css.js +46 -0
  49. package/dist/css/dialog.css.d.ts +2 -0
  50. package/dist/css/dialog.css.js +11 -0
  51. package/dist/css/forms.css.d.ts +2 -0
  52. package/dist/css/forms.css.js +123 -0
  53. package/dist/css/modal.css.d.ts +2 -0
  54. package/dist/css/modal.css.js +15 -0
  55. package/dist/css/pb33f-theme.css +1 -0
  56. package/dist/css/radiogroups.css.d.ts +2 -0
  57. package/dist/css/radiogroups.css.js +26 -0
  58. package/dist/css/spinner.css.d.ts +2 -0
  59. package/dist/css/spinner.css.js +42 -0
  60. package/dist/events/doctor.d.ts +57 -3
  61. package/dist/events/doctor.js +13 -1
  62. package/dist/model/errors.d.ts +10 -0
  63. package/dist/model/rule_documentation.d.ts +8 -2
  64. package/dist/model/rule_documentation.js +5 -1
  65. package/dist/model/toast.d.ts +15 -0
  66. package/dist/model/toast.js +9 -0
  67. package/dist/model/vacuum_rule.d.ts +58 -0
  68. package/dist/model/vacuum_rule.js +1 -0
  69. package/dist/services/linting-service.d.ts +1 -1
  70. package/dist/services/linting-service.js +2 -6
  71. package/dist/services/ruleset-service.d.ts +17 -0
  72. package/dist/services/ruleset-service.js +316 -0
  73. package/dist/style.css +1 -1
  74. package/dist/workers/rule-documentation.worker.d.ts +9 -1
  75. package/dist/workers/rule-documentation.worker.js +97 -7
  76. package/dist/workers/search-problems.worker.d.ts +2 -1
  77. package/dist/workers/search-problems.worker.js +1 -2
  78. package/package.json +1 -1
  79. package/dist/assets/rule-documentation.worker-BFIxMBU8.js +0 -1
@@ -1,17 +1,17 @@
1
1
  import { css } from "lit";
2
2
  export default css `
3
-
4
-
3
+
4
+
5
5
  .doctor {
6
6
  width: 100%;
7
7
  height: 100%;
8
8
  position: relative;
9
-
10
-
9
+
10
+
11
11
  }
12
-
12
+
13
13
  .editor {
14
-
14
+
15
15
  width: 100%;
16
16
  height: 100%;
17
17
  min-width: 500px;
@@ -19,14 +19,18 @@ export default css `
19
19
  position: relative;
20
20
  display: block;
21
21
  }
22
-
22
+
23
23
  .problems {
24
24
  position: relative;
25
25
  display: block;
26
26
  margin-left: 10px;
27
27
  overflow: hidden;
28
28
  width: 100%;
29
+ }
30
+
31
+ .problems-data {
29
32
  height: min-content;
33
+ max-height: calc(100vh - 50px);
30
34
  }
31
35
 
32
36
  .problems::-webkit-scrollbar {
@@ -42,8 +46,8 @@ export default css `
42
46
  background: var(--secondary-color-lowalpha);
43
47
  padding: var(--global-padding);
44
48
  }
45
-
46
-
49
+
50
+
47
51
  sl-split-panel {
48
52
  width: calc(100% - 9px);
49
53
  height: 100%;
@@ -63,10 +67,10 @@ export default css `
63
67
  color: var(--background-color);
64
68
  padding: 0;
65
69
  width: 10px;
66
- height:40px;
70
+ height: 40px;
67
71
  }
68
72
 
69
- sl-split-panel::part(divider):focus-visible {
73
+ sl-split-panel::part(divider):focus-visible {
70
74
  background-color: var(--primary-color);
71
75
  }
72
76
 
@@ -74,7 +78,7 @@ export default css `
74
78
  background-color: var(--primary-color);
75
79
  color: var(--background-color);
76
80
  }
77
-
81
+
78
82
  sl-tab-group::part(tabs) {
79
83
  height: 30px;
80
84
  }
@@ -82,7 +86,7 @@ export default css `
82
86
  sl-tab::part(base) {
83
87
  padding-top: 0;
84
88
  }
85
-
89
+
86
90
  .tab-group {
87
91
  --indicator-color: var(--secondary-color);
88
92
 
@@ -91,23 +95,24 @@ export default css `
91
95
  sl-tab-panel::part(base) {
92
96
  padding-top: 10px;
93
97
  overflow-y: hidden;
94
-
98
+
95
99
  }
96
-
100
+
97
101
  .tab::part(base) {
98
102
  font: var(--font-stack);
99
103
  font-size: 0.9rem;
100
104
  }
101
-
105
+
102
106
  .unavailable {
103
107
  opacity: 0.4;
104
108
  transition: all 0.5s;
105
109
  }
106
-
110
+
107
111
  .split-panel {
108
- --min: 600px; --max: calc(100vw - 600px);
112
+ --min: 550px;
113
+ --max: calc(100vw - 550px);
109
114
  }
110
-
115
+
111
116
  .overlay {
112
117
  width: 100%;
113
118
  opacity: 1;
@@ -120,25 +125,41 @@ export default css `
120
125
  z-index: 100;
121
126
  //backdrop-filter: blur(2px);
122
127
  }
123
-
128
+
124
129
  .ruleset {
125
130
  font-size: 0.9rem;
126
131
  margin-left: 10px;
127
132
  margin-right: 10px;
128
133
  }
129
134
 
135
+ h3.loading {
136
+ margin-top: 20px;
137
+ padding-top: 0;
138
+ text-align: center;
139
+ }
140
+
141
+ .tab-panel {
142
+ height: calc(100vh - 110px);
143
+ }
144
+
145
+ sl-tab-panel::part(base) {
146
+ height: 100%;
147
+ }
148
+
130
149
  sl-switch::part(label) {
131
150
  font-family: var(--font-stack), monospace;
132
151
  }
133
152
 
134
- sl-switch a {
153
+ sl-switch a {
135
154
  color: var(--primary-color);
136
155
  text-decoration: none;
137
156
  }
138
- sl-switch a:visited {
157
+
158
+ sl-switch a:visited {
139
159
  color: var(--primary-color);
140
160
  }
141
- sl-switch a:hover {
161
+
162
+ sl-switch a:hover {
142
163
  color: var(--primary-color);
143
164
  text-decoration: underline;
144
165
  }
@@ -147,14 +168,65 @@ export default css `
147
168
  color: var(--error-color);
148
169
  text-decoration: underline;
149
170
  }
150
-
171
+
151
172
  pb33f-activity-spinner {
152
173
  position: absolute;
153
- top: 0;
154
- right: 0;
155
-
174
+ top: 3px;
175
+ right: 25px;
176
+ }
177
+
178
+ .spinner-draw-closed {
179
+ top: 35px;
180
+ right: 2px;
156
181
  }
157
182
 
183
+ pb33f-toast-manager {
158
184
 
185
+ position: absolute;
186
+ top: 10px;
187
+ right: 0;
188
+ z-index: 101;
189
+ height: calc(100vh - 50px);
190
+ width: 500px;
191
+ overflow: hidden;
192
+ pointer-events: none;
193
+ }
159
194
 
195
+ .export {
196
+ display: flex;
197
+ margin-bottom: 20px;
198
+ }
199
+
200
+ .right {
201
+ text-align: right;
202
+ }
203
+
204
+ .export-block {
205
+ width: 50%;
206
+ }
207
+
208
+ .export sl-button {
209
+ margin-left: 20px;
210
+ padding-top: 3px;
211
+ }
212
+
213
+ sl-badge::part(base) {
214
+ width: 10px;
215
+ padding: 0;
216
+ margin-left: 5px;
217
+ margin-top: 2px;
218
+ height: 10px;
219
+ }
220
+ .collapse-side {
221
+ position: absolute;
222
+ right: 0;
223
+ top: 0;
224
+ padding: 0;
225
+ color: var(--secondary-color);
226
+ font-size: 1.4rem;
227
+ }
228
+ sl-icon-button.collapse-side::part(base) {
229
+ padding: 0;
230
+ }
231
+
160
232
  `;
@@ -5,16 +5,27 @@ import '@shoelace-style/shoelace/dist/components/tab/tab.js';
5
5
  import '@shoelace-style/shoelace/dist/components/switch/switch.js';
6
6
  import '@shoelace-style/shoelace/dist/components/dialog/dialog.js';
7
7
  import '@shoelace-style/shoelace/dist/components/alert/alert.js';
8
+ import '@shoelace-style/shoelace/dist/components/badge/badge.js';
8
9
  import { LitElement } from "lit";
9
- import { EditorUpdatedEvent, ProblemRuleFilterChangedEvent } from "../../events/doctor.js";
10
+ import { AddToastEvent, EditorUpdatedEvent, ProblemRuleFilterChangedEvent, RulesetSavedEvent, RuleClickedEvent } from "../../events/doctor.js";
10
11
  import { ProblemDrawerEvent } from "../problem-list/details-drawer.js";
11
- import { SlSwitch, SlTab, SlTabGroup } from "@shoelace-style/shoelace";
12
+ import { SlDialog, SlIcon, SlRadioGroup, SlTab, SlTabGroup } from "@shoelace-style/shoelace";
12
13
  import { AttentionBox } from "../attention-box/attention-box.js";
14
+ import { Toast } from "../../model/toast.js";
15
+ import SlIconButton from "@shoelace-style/shoelace/dist/components/icon-button/icon-button.js";
13
16
  export declare const DoctorDocumentBag = "pb33f-doctor-editor";
14
17
  export declare const HowToFixBag = "pb33f-doctor-howtofix";
18
+ export declare const FunctionDocumentationBag = "pb33f-doctor-funcdocs";
15
19
  export declare const RuleDocumentationBag = "pb33f-doctor-ruledocs";
16
20
  export declare const DiagnosticBag = "pb33f-doctor-diagnostic";
17
- export declare const OWASPBag = "pb33f-doctor-owasp";
21
+ export declare const DefaultRulesetBag = "pb33f-doctor-default-ruleset";
22
+ export declare const OWASPRulesetBag = "pb33f-doctor-owasp-ruleset";
23
+ export declare const AllRulesetBag = "pb33f-doctor-all-ruleset";
24
+ export declare const FunctionsBag = "pb33f-doctor-functions";
25
+ export declare const FunctionsSchemaBag = "pb33f-doctor-function-schema";
26
+ export declare const CustomRulesetBag = "pb33f-doctor-custom-ruleset";
27
+ export declare const RuleConfigurationBag = "pb33f-doctor-rule-configuration";
28
+ export declare const SessionRulesetMapBag = "pb33f-doctor-session-rulesetmap";
18
29
  export declare const DefaultDocument = "document";
19
30
  export declare const DocumentProblems = "problems";
20
31
  export declare const DoctorEndpoint = "doctor-endpoint";
@@ -22,44 +33,90 @@ export declare class TheDoctor extends LitElement {
22
33
  static styles: import("lit").CSSResult[];
23
34
  overviewPanel: SlTab;
24
35
  problemsPanel: SlTab;
25
- tabGroup: SlTabGroup;
26
- owaspSwitch: SlSwitch;
36
+ controlTabGroup: SlTabGroup;
37
+ editorTabGroup: SlTabGroup;
27
38
  welcomeBox: AttentionBox;
39
+ exportSelection: SlRadioGroup;
40
+ downloadRulesetLink: HTMLAnchorElement;
41
+ loadingOverlay: SlDialog;
42
+ problemsDataDiv: HTMLDivElement;
28
43
  private unavailable;
29
44
  doctorEndpoint: string;
45
+ exportRulesetDialog: SlDialog;
46
+ collapseButton: SlIconButton;
47
+ splitDivider: SlIcon;
48
+ private rulesetPulse;
30
49
  private readonly errorBanner;
31
50
  private bagManager;
32
51
  private readonly editor;
52
+ private readonly rulesetEditor;
33
53
  private docBag;
34
54
  private problemBag;
35
55
  private diagnosticBag;
36
- private OWASPBag;
56
+ private DefaultRulesetBag;
57
+ private OWASPRulesetBag;
58
+ private AllRulesetBag;
59
+ private CustomRulesetBag;
60
+ private FunctionsBag;
61
+ private FunctionSchemaBag;
62
+ private RuleConfigBag;
37
63
  private howToFixBag;
38
64
  private ruleDocsBag;
65
+ private functionDocsBag;
66
+ private sessionRulesetMapBag;
39
67
  private readonly problemsOverview;
40
68
  private readonly problemList;
41
69
  private readonly detailsDrawer;
42
70
  private ruleDocsWorker;
43
71
  private debounceTime;
72
+ private debounceTimeRuleset;
44
73
  private bounceId;
45
74
  private problems;
46
- private OWASPEnabled;
47
75
  private readonly statusBar;
48
76
  private session;
49
77
  private readonly feedback;
50
78
  private readonly activitySpinner;
79
+ private readonly manageRuleset;
80
+ private defaultRuleset;
81
+ private OWASPRuleset;
82
+ private AllRuleset;
83
+ private CustomRuleset;
84
+ private functions;
85
+ private readonly toastManager;
86
+ private editorMap;
87
+ private selectedEditorTab;
88
+ private sidebarClosed;
51
89
  constructor(doctorEndpoint?: string);
90
+ exportRuleset(): void;
91
+ addToastEvent(event: CustomEvent<AddToastEvent>): void;
92
+ sendToast(toast: Toast): void;
52
93
  ruleGroupClicked(event: CustomEvent<ProblemRuleFilterChangedEvent>): void;
53
94
  ruleDocsClicked(event: CustomEvent<ProblemDrawerEvent>): void;
95
+ rulesetSaved(evt: CustomEvent<RulesetSavedEvent>): void;
54
96
  private lintSpec;
55
97
  private platformUnavailable;
56
98
  private specClicked;
57
99
  private problemClicked;
58
100
  private loadState;
101
+ private customRulesetEnabled;
102
+ private fetchSessionRulesetAsYaml;
103
+ private fetchFunctions;
104
+ private fetchFunctionSchema;
105
+ private fetchDefaultRuleset;
106
+ private fetchOWASPRuleset;
107
+ private fetchAllRuleset;
59
108
  private fetchDocs;
109
+ fetchRulesetMap(): void;
110
+ ruleClicked(evt: CustomEvent<RuleClickedEvent>): void;
111
+ rulesetChanged(): void;
60
112
  specChanged(event: CustomEvent<EditorUpdatedEvent>): void;
61
- toggleOWASP(): void;
62
113
  boostrap(): void;
114
+ exportJSON(): void;
115
+ exportYAML(): void;
116
+ confirmExport(): void;
63
117
  closeWelcome(): void;
118
+ selectEditorTab(event: CustomEvent): void;
119
+ selectControlTab(event: CustomEvent): void;
120
+ toggleSidebar(): void;
64
121
  render(): import("lit-html").TemplateResult<1>;
65
122
  }