@pb33f/cowboy-components 0.1.8 → 0.1.10

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 (31) hide show
  1. package/dist/components/attention-box/attention-box.d.ts +5 -0
  2. package/dist/components/attention-box/attention-box.js +28 -5
  3. package/dist/components/footer/footer.css.d.ts +2 -0
  4. package/dist/components/footer/footer.css.js +21 -0
  5. package/dist/components/footer/footer.d.ts +8 -0
  6. package/dist/components/footer/footer.js +36 -0
  7. package/dist/components/header/header.css.js +98 -89
  8. package/dist/components/header/header.d.ts +1 -0
  9. package/dist/components/header/header.js +6 -2
  10. package/dist/components/the-doctor/activity-spinner.d.ts +8 -0
  11. package/dist/components/the-doctor/activity-spinner.js +43 -0
  12. package/dist/components/the-doctor/feedback.css.d.ts +2 -0
  13. package/dist/components/the-doctor/feedback.css.js +30 -0
  14. package/dist/components/the-doctor/feedback.d.ts +14 -0
  15. package/dist/components/the-doctor/feedback.js +83 -0
  16. package/dist/components/the-doctor/status-bar.js +2 -1
  17. package/dist/components/the-doctor/the-doctor.css.js +7 -3
  18. package/dist/components/the-doctor/the-doctor.d.ts +7 -1
  19. package/dist/components/the-doctor/the-doctor.js +58 -7
  20. package/dist/cowboy-components.d.ts +1 -0
  21. package/dist/cowboy-components.js +1 -0
  22. package/dist/cowboy-components.umd.cjs +480 -368
  23. package/dist/css/cowboy-components.css +0 -17
  24. package/dist/model/feedback.d.ts +4 -0
  25. package/dist/model/feedback.js +2 -0
  26. package/dist/services/feedback-service.d.ts +5 -0
  27. package/dist/services/feedback-service.js +30 -0
  28. package/dist/services/linting-service.d.ts +1 -0
  29. package/dist/services/linting-service.js +15 -0
  30. package/dist/style.css +1 -1
  31. package/package.json +1 -1
@@ -79,24 +79,7 @@ pre.chroma code {
79
79
  background-color: transparent;
80
80
  }
81
81
 
82
- footer {
83
- padding: var(--footer-padding);
84
- width: 100vw;
85
- font-size: var(--footer-font-size);
86
- height: var(--footer-height);
87
- position: fixed;
88
- bottom: 0;
89
- background-color: var(--background-color);
90
- z-index: 10;
91
- border-top: 1px dashed var(--secondary-color);
92
- }
93
82
 
94
- footer > .generated-timestamp {
95
- float: right;
96
- margin-right: 15px;
97
- font-weight: normal;
98
- color: var(--font-color-sub2);
99
- }
100
83
 
101
84
  .table-of-contents ul {
102
85
  list-style: none;
@@ -0,0 +1,4 @@
1
+ export declare class FeedbackResult {
2
+ email: string;
3
+ message: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ export class FeedbackResult {
2
+ }
@@ -0,0 +1,5 @@
1
+ import { FeedbackResult } from "@/model/feedback";
2
+ export declare class FeedbackService {
3
+ static doctorEndpoint: string;
4
+ static sendFeedback(email: string, message: string): Promise<FeedbackResult>;
5
+ }
@@ -0,0 +1,30 @@
1
+ export class FeedbackService {
2
+ static async sendFeedback(email, message) {
3
+ return new Promise(async (resolve, reject) => {
4
+ try {
5
+ const feedbackResults = await fetch(FeedbackService.doctorEndpoint + '/feedback', {
6
+ method: 'POST',
7
+ credentials: 'include',
8
+ headers: {
9
+ 'Content-Type': 'application/json'
10
+ },
11
+ body: JSON.stringify({ email: email, message: message })
12
+ });
13
+ const apiResult = await feedbackResults.json();
14
+ if (!apiResult) {
15
+ reject({ details: 'unable to send feedback' });
16
+ return;
17
+ }
18
+ if (apiResult?.type && apiResult?.title && apiResult?.status) {
19
+ reject(apiResult);
20
+ return;
21
+ }
22
+ resolve(apiResult);
23
+ }
24
+ catch (e) {
25
+ reject({ details: 'unable to send feedback: ' + e });
26
+ }
27
+ });
28
+ }
29
+ }
30
+ FeedbackService.doctorEndpoint = 'https://doctor.pb33f.io';
@@ -9,4 +9,5 @@ export declare class LintingService {
9
9
  static fetchAllHowToFix(): Promise<HowToFix[]>;
10
10
  static fetchStatistics(): Promise<DrDiagnostics>;
11
11
  static startSession(): Promise<Session>;
12
+ static bootstrapEditor(): Promise<string>;
12
13
  }
@@ -117,5 +117,20 @@ export class LintingService {
117
117
  }
118
118
  });
119
119
  }
120
+ static async bootstrapEditor() {
121
+ return new Promise(async (resolve, reject) => {
122
+ try {
123
+ const boostrapSpec = await fetch(LintingService.doctorEndpoint + '/bootstrap/train-travel', {
124
+ method: 'GET',
125
+ credentials: 'include',
126
+ });
127
+ const spec = await boostrapSpec.text();
128
+ resolve(spec);
129
+ }
130
+ catch (e) {
131
+ reject({ detail: "the pb33f platform is unresponsive" });
132
+ }
133
+ });
134
+ }
120
135
  }
121
136
  LintingService.doctorEndpoint = 'https://doctor.pb33f.io';