firstly 0.0.13 → 0.0.15

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 (109) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/ROUTES.d.ts +2 -0
  3. package/esm/ROUTES.js +1 -0
  4. package/esm/auth/AuthController.d.ts +12 -23
  5. package/esm/auth/AuthController.js +12 -31
  6. package/esm/auth/server/AuthController.server.d.ts +11 -11
  7. package/esm/auth/server/AuthController.server.js +84 -18
  8. package/esm/auth/server/helperFirstly.d.ts +1 -1
  9. package/esm/auth/server/helperFirstly.js +1 -0
  10. package/esm/auth/server/module.d.ts +4 -7
  11. package/esm/auth/server/module.js +1 -1
  12. package/esm/auth/server/providers/github.d.ts +2 -1
  13. package/esm/auth/server/providers/github.js +1 -1
  14. package/esm/auth/static/assets/Page-B1GE_oYi.d.ts +6 -0
  15. package/esm/auth/static/assets/Page-B1GE_oYi.js +1 -0
  16. package/esm/auth/static/assets/Page-CDHFtYuN.d.ts +6 -0
  17. package/esm/auth/static/assets/Page-CDHFtYuN.js +1 -0
  18. package/esm/auth/static/assets/Page-Dh8pvAo6.d.ts +6 -0
  19. package/esm/auth/static/assets/Page-Dh8pvAo6.js +20 -0
  20. package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
  21. package/esm/auth/static/assets/index-7Nh2ct-y.d.ts +151 -0
  22. package/esm/auth/static/assets/index-7Nh2ct-y.js +42 -0
  23. package/esm/auth/static/index.html +3 -3
  24. package/esm/auth/types.d.ts +26 -3
  25. package/esm/bin/cmd.js +343 -143
  26. package/esm/changeLog/server/index.d.ts +1 -1
  27. package/esm/changeLog/server/index.js +1 -1
  28. package/esm/cron/server/index.d.ts +1 -1
  29. package/esm/cron/server/index.js +1 -1
  30. package/esm/feedback/FeedbackController.js +57 -51
  31. package/esm/feedback/server/index.d.ts +7 -16
  32. package/esm/feedback/server/index.js +5 -6
  33. package/esm/feedback/types.d.ts +14 -0
  34. package/esm/feedback/types.js +4 -0
  35. package/esm/feedback/ui/DialogIssue.svelte +78 -62
  36. package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
  37. package/esm/feedback/ui/DialogIssues.svelte +37 -28
  38. package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
  39. package/esm/feedback/ui/DialogMilestones.svelte +18 -12
  40. package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
  41. package/esm/feedback/ui/Feedback.svelte +11 -9
  42. package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
  43. package/esm/mail/server/index.d.ts +9 -2
  44. package/esm/mail/server/index.js +6 -2
  45. package/esm/mail/templates/DefaultMail.svelte +64 -44
  46. package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
  47. package/esm/{api → server}/index.d.ts +8 -0
  48. package/esm/storeItem.d.ts +1 -1
  49. package/esm/storeList.d.ts +1 -1
  50. package/esm/sveltekit/server/index.d.ts +1 -10
  51. package/esm/sveltekit/server/index.js +1 -1
  52. package/esm/ui/Button.svelte +79 -56
  53. package/esm/ui/Button.svelte.d.ts +34 -24
  54. package/esm/ui/Clipboardable.svelte +18 -11
  55. package/esm/ui/Clipboardable.svelte.d.ts +34 -23
  56. package/esm/ui/Field.svelte +189 -136
  57. package/esm/ui/Field.svelte.d.ts +13 -6
  58. package/esm/ui/FieldGroup.svelte +74 -53
  59. package/esm/ui/FieldGroup.svelte.d.ts +17 -6
  60. package/esm/ui/Grid.svelte +110 -86
  61. package/esm/ui/Grid.svelte.d.ts +17 -6
  62. package/esm/ui/GridLoading.svelte +10 -5
  63. package/esm/ui/GridLoading.svelte.d.ts +19 -17
  64. package/esm/ui/GridPaginate.svelte +30 -23
  65. package/esm/ui/GridPaginate.svelte.d.ts +21 -19
  66. package/esm/ui/Icon.svelte +67 -32
  67. package/esm/ui/Icon.svelte.d.ts +52 -43
  68. package/esm/ui/Loading.svelte +5 -3
  69. package/esm/ui/Loading.svelte.d.ts +29 -18
  70. package/esm/ui/Tooltip.svelte +22 -19
  71. package/esm/ui/Tooltip.svelte.d.ts +30 -20
  72. package/esm/ui/dialog/DialogForm.svelte +48 -41
  73. package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
  74. package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
  75. package/esm/ui/dialog/DialogPrimitive.svelte +32 -26
  76. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
  77. package/esm/ui/dialog/FormEditAction.svelte +20 -12
  78. package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
  79. package/esm/ui/dialog/dialog.d.ts +1 -1
  80. package/esm/ui/internals/FieldContainer.svelte +13 -6
  81. package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
  82. package/esm/ui/internals/Input.svelte +110 -76
  83. package/esm/ui/internals/Input.svelte.d.ts +34 -32
  84. package/esm/ui/internals/Textarea.svelte +39 -31
  85. package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
  86. package/esm/ui/internals/select/MultiSelectMelt.svelte +174 -126
  87. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
  88. package/esm/ui/internals/select/SelectMelt.svelte +168 -133
  89. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
  90. package/esm/ui/internals/select/SelectRadio.svelte +17 -11
  91. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
  92. package/esm/ui/link/Link.svelte +11 -6
  93. package/esm/ui/link/Link.svelte.d.ts +31 -22
  94. package/esm/ui/link/LinkPlus.svelte +19 -16
  95. package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
  96. package/esm/vite/index.d.ts +2 -3
  97. package/esm/vite/index.js +33 -26
  98. package/package.json +14 -14
  99. package/esm/auth/static/assets/Page-BUfjaN-D.d.ts +0 -5
  100. package/esm/auth/static/assets/Page-BUfjaN-D.js +0 -19
  101. package/esm/auth/static/assets/Page-CJ58H1vl.css +0 -1
  102. package/esm/auth/static/assets/Page-CaDAqmBS.d.ts +0 -5
  103. package/esm/auth/static/assets/Page-CaDAqmBS.js +0 -1
  104. package/esm/auth/static/assets/Page-DhdZddzJ.d.ts +0 -5
  105. package/esm/auth/static/assets/Page-DhdZddzJ.js +0 -1
  106. package/esm/auth/static/assets/index-D-Ztdt2o.d.ts +0 -54
  107. package/esm/auth/static/assets/index-D-Ztdt2o.js +0 -2
  108. /package/esm/auth/static/assets/{index-BDy4A_14.css → index-DKWpA6v7.css} +0 -0
  109. /package/esm/{api → server}/index.js +0 -0
@@ -6,32 +6,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { Allow, BackendMethod, EntityError, remult } from 'remult';
8
8
  import { stry } from '@kitql/helpers';
9
- import { FEEDBACK_OPTIONS } from './server';
10
- const GITHUB_GRAPHQL_ENDPOINT = 'https://api.github.com/graphql';
11
9
  async function getGitHub(query, variables) {
12
- if (!FEEDBACK_OPTIONS.GITHUB_API_TOKEN) {
13
- throw new EntityError({ message: 'GITHUB_API_TOKEN not found in .env' });
14
- }
15
- try {
16
- const headers = new Headers({
17
- Authorization: 'Bearer ' + FEEDBACK_OPTIONS.GITHUB_API_TOKEN,
18
- 'Content-Type': 'application/json',
19
- });
20
- const body = stry({ query, variables }, 0);
21
- const response = await fetch(GITHUB_GRAPHQL_ENDPOINT, { method: 'POST', headers, body });
22
- const result = await response.json();
23
- if (result.errors) {
24
- console.error(`result ERRORS`, body, stry(result));
10
+ if (import.meta.env.SSR) {
11
+ if (!remult.context.feedbackOptions.GITHUB_API_TOKEN) {
12
+ console.error(`GITHUB_API_TOKEN not found in .env`);
13
+ throw new EntityError({ message: 'Feedback module not well configured' });
14
+ }
15
+ try {
16
+ const headers = new Headers({
17
+ Authorization: 'Bearer ' + remult.context.feedbackOptions.GITHUB_API_TOKEN,
18
+ 'Content-Type': 'application/json',
19
+ });
20
+ const body = stry({ query, variables }, 0);
21
+ const GITHUB_GRAPHQL_ENDPOINT = 'https://api.github.com/graphql';
22
+ const response = await fetch(GITHUB_GRAPHQL_ENDPOINT, { method: 'POST', headers, body });
23
+ const result = await response.json();
24
+ if (result.errors) {
25
+ console.error(`result ERRORS`, body, stry(result));
26
+ }
27
+ return result.data;
28
+ }
29
+ catch (error) {
30
+ console.error(`error`, error);
25
31
  }
26
- return result.data;
27
- }
28
- catch (error) {
29
- console.error(`error`, error);
30
32
  }
31
33
  return null;
32
34
  }
33
35
  async function addMetaData(issueId, author, page) {
34
- const commentToMinimize = await getGitHub(`mutation AddComment($input: AddCommentInput!) {
36
+ if (import.meta.env.SSR) {
37
+ const commentToMinimize = await getGitHub(`mutation AddComment($input: AddCommentInput!) {
35
38
  addComment(input: $input) {
36
39
  commentEdge {
37
40
  node {
@@ -41,12 +44,12 @@ async function addMetaData(issueId, author, page) {
41
44
  }
42
45
  }
43
46
  `, {
44
- input: {
45
- subjectId: issueId,
46
- body: `<pre>\n${JSON.stringify({ author, page }, null, 2)}\n</pre>`,
47
- },
48
- });
49
- await getGitHub(`mutation MinimizeComment($input: MinimizeCommentInput!) {
47
+ input: {
48
+ subjectId: issueId,
49
+ body: `<pre>\n${JSON.stringify({ author, page }, null, 2)}\n</pre>`,
50
+ },
51
+ });
52
+ await getGitHub(`mutation MinimizeComment($input: MinimizeCommentInput!) {
50
53
  minimizeComment(input: $input) {
51
54
  minimizedComment {
52
55
  isMinimized
@@ -54,11 +57,12 @@ async function addMetaData(issueId, author, page) {
54
57
  }
55
58
  }
56
59
  `, {
57
- input: {
58
- subjectId: commentToMinimize.addComment.commentEdge.node.id,
59
- classifier: 'OFF_TOPIC',
60
- },
61
- });
60
+ input: {
61
+ subjectId: commentToMinimize.addComment.commentEdge.node.id,
62
+ classifier: 'OFF_TOPIC',
63
+ },
64
+ });
65
+ }
62
66
  }
63
67
  export class FeedbackController {
64
68
  static async getMilestones() {
@@ -83,14 +87,16 @@ export class FeedbackController {
83
87
  }
84
88
  }
85
89
  `, {
86
- repository: FEEDBACK_OPTIONS.repo.name,
87
- owner: FEEDBACK_OPTIONS.repo.owner,
88
- filter: FEEDBACK_OPTIONS.milestones?.title_filter ?? '',
90
+ repository: remult.context.feedbackOptions.repo.name,
91
+ owner: remult.context.feedbackOptions.repo.owner,
92
+ filter: remult.context.feedbackOptions.milestones?.title_filter ?? '',
89
93
  });
90
94
  return data.repository.milestones.nodes.map((c) => {
91
95
  return {
92
96
  ...c,
93
- title: c.title.replaceAll(FEEDBACK_OPTIONS.milestones?.title_filter ?? '', '').trim(),
97
+ title: c.title
98
+ .replaceAll(remult.context.feedbackOptions.milestones?.title_filter ?? '', '')
99
+ .trim(),
94
100
  };
95
101
  });
96
102
  }
@@ -126,18 +132,18 @@ export class FeedbackController {
126
132
  }
127
133
  }
128
134
  `, {
129
- repository: FEEDBACK_OPTIONS.repo.name,
130
- owner: FEEDBACK_OPTIONS.repo.owner,
135
+ repository: remult.context.feedbackOptions.repo.name,
136
+ owner: remult.context.feedbackOptions.repo.owner,
131
137
  milestoneNumber,
132
138
  filters: {
133
- labels: FEEDBACK_OPTIONS.milestones?.labels_filters ?? [],
139
+ labels: remult.context.feedbackOptions.milestones?.labels_filters ?? [],
134
140
  states: [issueState],
135
141
  },
136
142
  issueOrder,
137
143
  });
138
144
  return data.repository.milestone.issues.nodes.map((issue) => {
139
- const hasWaitingForAnswerLabel = FEEDBACK_OPTIONS.highlight_label
140
- ? issue.labels.nodes.some((label) => label.name.includes(FEEDBACK_OPTIONS.highlight_label))
145
+ const hasWaitingForAnswerLabel = remult.context.feedbackOptions.highlight_label
146
+ ? issue.labels.nodes.some((label) => label.name.includes(remult.context.feedbackOptions.highlight_label))
141
147
  : false;
142
148
  return {
143
149
  id: issue.id,
@@ -181,8 +187,8 @@ export class FeedbackController {
181
187
  }
182
188
  }
183
189
  `, {
184
- repository: FEEDBACK_OPTIONS.repo.name,
185
- owner: FEEDBACK_OPTIONS.repo.owner,
190
+ repository: remult.context.feedbackOptions.repo.name,
191
+ owner: remult.context.feedbackOptions.repo.owner,
186
192
  issueNumber,
187
193
  });
188
194
  const items = [];
@@ -208,8 +214,8 @@ export class FeedbackController {
208
214
  });
209
215
  }
210
216
  }
211
- const hasWaitingForAnswerLabel = FEEDBACK_OPTIONS.highlight_label
212
- ? data.repository.issue.labels.nodes.some((label) => label.name.includes(FEEDBACK_OPTIONS.highlight_label))
217
+ const hasWaitingForAnswerLabel = remult.context.feedbackOptions.highlight_label
218
+ ? data.repository.issue.labels.nodes.some((label) => label.name.includes(remult.context.feedbackOptions.highlight_label))
213
219
  : false;
214
220
  const toRet = {
215
221
  id: data.repository.issue.id,
@@ -235,11 +241,11 @@ export class FeedbackController {
235
241
  }
236
242
  }
237
243
  }`, {
238
- repository: FEEDBACK_OPTIONS.repo.name,
239
- owner: FEEDBACK_OPTIONS.repo.owner,
244
+ repository: remult.context.feedbackOptions.repo.name,
245
+ owner: remult.context.feedbackOptions.repo.owner,
240
246
  });
241
247
  const repoInfoData = repoInfo.repository;
242
- const create_label = repoInfoData.labels.nodes.find((c) => c.name === FEEDBACK_OPTIONS.create_label);
248
+ const create_label = repoInfoData.labels.nodes.find((c) => c.name === remult.context.feedbackOptions.create_label);
243
249
  const newIssue = await getGitHub(`mutation CreateIssue($input: CreateIssueInput!) {
244
250
  createIssue(input: $input) {
245
251
  issue {
@@ -268,8 +274,8 @@ export class FeedbackController {
268
274
  };
269
275
  const inputIssue = {
270
276
  id: issueId,
271
- labelIds: (FEEDBACK_OPTIONS.highlight_label
272
- ? labels.filter((c) => c.name !== FEEDBACK_OPTIONS.highlight_label)
277
+ labelIds: (remult.context.feedbackOptions.highlight_label
278
+ ? labels.filter((c) => c.name !== remult.context.feedbackOptions.highlight_label)
273
279
  : labels).map((c) => c.id),
274
280
  };
275
281
  await getGitHub(`mutation AddComment($inputComment: AddCommentInput!, $inputIssue: UpdateIssueInput!) {
@@ -299,8 +305,8 @@ export class FeedbackController {
299
305
  };
300
306
  const inputIssue = {
301
307
  id: issueId,
302
- labelIds: (FEEDBACK_OPTIONS.highlight_label
303
- ? labels.filter((c) => c.name !== FEEDBACK_OPTIONS.highlight_label)
308
+ labelIds: (remult.context.feedbackOptions.highlight_label
309
+ ? labels.filter((c) => c.name !== remult.context.feedbackOptions.highlight_label)
304
310
  : labels).map((c) => c.id),
305
311
  };
306
312
  await getGitHub(`mutation CloseIssue($inputIssue: UpdateIssueInput!, $inputClose: CloseIssueInput!) {
@@ -1,17 +1,8 @@
1
- import { Module } from '../../api';
2
- type FeedbackOptions = {
3
- GITHUB_API_TOKEN: string;
4
- repo: {
5
- owner: string;
6
- name: string;
7
- };
8
- milestones?: {
9
- title_filter?: string;
10
- labels_filters?: string[];
11
- };
12
- highlight_label?: string;
13
- create_label?: string;
14
- };
15
- export declare let FEEDBACK_OPTIONS: FeedbackOptions;
1
+ import { Module } from '../../server';
2
+ import type { FeedbackOptions } from '../types';
16
3
  export declare const feedback: (o: FeedbackOptions) => Module;
17
- export {};
4
+ declare module 'remult' {
5
+ interface RemultContext {
6
+ feedbackOptions: FeedbackOptions;
7
+ }
8
+ }
@@ -1,13 +1,12 @@
1
- import { Module } from '../../api';
1
+ import { remult } from 'remult';
2
+ import { Module } from '../../server';
2
3
  import { FeedbackController } from '../FeedbackController';
3
- export let FEEDBACK_OPTIONS = {
4
- GITHUB_API_TOKEN: '',
5
- repo: { owner: '', name: '' },
6
- };
7
4
  export const feedback = (o) => {
8
- FEEDBACK_OPTIONS = o;
9
5
  return new Module({
10
6
  name: 'feedback',
11
7
  controllers: [FeedbackController],
8
+ initRequest: async (kitEvent, op) => {
9
+ remult.context.feedbackOptions = o;
10
+ },
12
11
  });
13
12
  };
@@ -0,0 +1,14 @@
1
+ export type FeedbackOptions = {
2
+ GITHUB_API_TOKEN: string;
3
+ repo: {
4
+ owner: string;
5
+ name: string;
6
+ };
7
+ milestones?: {
8
+ title_filter?: string;
9
+ labels_filters?: string[];
10
+ };
11
+ highlight_label?: string;
12
+ create_label?: string;
13
+ };
14
+ export declare const FEEDBACK_OPTIONS: FeedbackOptions;
@@ -0,0 +1,4 @@
1
+ export const FEEDBACK_OPTIONS = {
2
+ GITHUB_API_TOKEN: '',
3
+ repo: { owner: '', name: '' },
4
+ };
@@ -1,65 +1,81 @@
1
- <script>import { onMount } from "svelte";
2
- import { repo } from "remult";
3
- import { page } from "$app/stores";
4
- import { FeedbackController } from "..";
5
- import { Button, cellBuildor, Field, FilterEntity, Loading } from "../..";
6
- import Textarea from "../../ui/internals/Textarea.svelte";
7
- export let dialogId;
8
- const rmvWarning = dialogId;
9
- export let milestoneId;
10
- export let issueNumber;
11
- let state = "loading";
12
- let issue;
13
- const update = async () => {
14
- state = "loading";
15
- if (issueNumber) {
16
- issue = await FeedbackController.getIssue(issueNumber);
17
- }
18
- state = "done";
19
- };
20
- onMount(async () => {
21
- await update();
22
- });
23
- let title;
24
- let content;
25
- const send = async () => {
26
- state = "loading";
27
- const p = $page.url.pathname + $page.url.search;
28
- if (!issue?.id) {
29
- const result = await FeedbackController.createIssue(milestoneId, title, content, p);
30
- issueNumber = result.number;
31
- } else {
32
- await FeedbackController.addCommentOnIssue(issue.id, content, p, issue.labels);
33
- }
34
- content = "";
35
- await update();
36
- state = "done";
37
- };
38
- const close = async () => {
39
- state = "loading";
40
- await FeedbackController.close(issue.id, issue.labels);
41
- content = "";
42
- await update();
43
- state = "done";
44
- };
45
- const reOpen = async () => {
46
- state = "loading";
47
- await FeedbackController.reOpen(issue.id);
48
- content = "";
49
- await update();
50
- state = "done";
51
- };
52
- const disableButton = (issueNumber2, title2, content2) => {
53
- if (issueNumber2) {
54
- if (content2?.length > 2) {
55
- return false;
56
- }
57
- }
58
- if (title2?.length > 2 && content2?.length > 2) {
59
- return false;
60
- }
61
- return true;
62
- };
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte'
3
+
4
+ import { repo } from 'remult'
5
+
6
+ import { page } from '$app/stores'
7
+
8
+ import { FeedbackController } from '..'
9
+ import { Button, cellBuildor, Field, FilterEntity, Loading, type ResolvedType } from '../..'
10
+ import Textarea from '../../ui/internals/Textarea.svelte'
11
+
12
+ export let dialogId: number
13
+ const rmvWarning = dialogId
14
+
15
+ export let milestoneId: string
16
+ export let issueNumber: number | null
17
+
18
+ let state: 'loading' | 'done' = 'loading'
19
+
20
+ let issue: ResolvedType<ReturnType<typeof FeedbackController.getIssue>> | undefined
21
+
22
+ const update = async () => {
23
+ state = 'loading'
24
+ if (issueNumber) {
25
+ issue = await FeedbackController.getIssue(issueNumber)
26
+ }
27
+ state = 'done'
28
+ }
29
+
30
+ onMount(async () => {
31
+ await update()
32
+ })
33
+
34
+ let title: ''
35
+ let content: ''
36
+ const send = async () => {
37
+ state = 'loading'
38
+
39
+ const p = $page.url.pathname + $page.url.search
40
+ if (!issue?.id) {
41
+ const result = await FeedbackController.createIssue(milestoneId, title, content, p)
42
+ issueNumber = result.number
43
+ } else {
44
+ await FeedbackController.addCommentOnIssue(issue.id, content, p, issue.labels)
45
+ }
46
+
47
+ content = ''
48
+ await update()
49
+ state = 'done'
50
+ }
51
+
52
+ const close = async () => {
53
+ state = 'loading'
54
+ await FeedbackController.close(issue!.id, issue!.labels)
55
+ content = ''
56
+ await update()
57
+ state = 'done'
58
+ }
59
+
60
+ const reOpen = async () => {
61
+ state = 'loading'
62
+ await FeedbackController.reOpen(issue!.id)
63
+ content = ''
64
+ await update()
65
+ state = 'done'
66
+ }
67
+
68
+ const disableButton = (issueNumber: number | null, title: string, content: string) => {
69
+ if (issueNumber) {
70
+ if (content?.length > 2) {
71
+ return false
72
+ }
73
+ }
74
+ if (title?.length > 2 && content?.length > 2) {
75
+ return false
76
+ }
77
+ return true
78
+ }
63
79
  </script>
64
80
 
65
81
  <div class="mb-4 grid gap-4">
@@ -1,20 +1,22 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- dialogId: number;
5
- milestoneId: string;
6
- issueNumber: number | null;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
7
11
  };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- exports?: {} | undefined;
13
- bindings?: string | undefined;
14
- };
15
- export type DialogIssueProps = typeof __propDef.props;
16
- export type DialogIssueEvents = typeof __propDef.events;
17
- export type DialogIssueSlots = typeof __propDef.slots;
18
- export default class DialogIssue extends SvelteComponent<DialogIssueProps, DialogIssueEvents, DialogIssueSlots> {
12
+ z_$$bindings?: Bindings;
19
13
  }
20
- export {};
14
+ declare const DialogIssue: $$__sveltets_2_IsomorphicComponent<{
15
+ dialogId: number;
16
+ milestoneId: string;
17
+ issueNumber: number | null;
18
+ }, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, string>;
21
+ type DialogIssue = InstanceType<typeof DialogIssue>;
22
+ export default DialogIssue;
@@ -1,31 +1,40 @@
1
- <script>import { onMount } from "svelte";
2
- import { FeedbackController } from "..";
3
- import {
4
- Button,
5
- dialog,
6
- Icon,
7
- LibIcon_Add,
8
- LibIcon_Check,
9
- LibIcon_Search,
10
- Loading
11
- } from "../..";
12
- import DialogIssue from "./DialogIssue.svelte";
13
- export let dialogId;
14
- const rmvWarning = dialogId;
15
- export let milestoneNumber;
16
- export let milestoneId;
17
- let state = "loading";
18
- let issueState = "OPEN";
19
- let issues = [];
20
- const update = async (_issueState) => {
21
- issueState = _issueState;
22
- state = "loading";
23
- issues = await FeedbackController.getIssues(milestoneNumber, issueState);
24
- state = "done";
25
- };
26
- onMount(async () => {
27
- await update(issueState);
28
- });
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte'
3
+
4
+ import { FeedbackController } from '..'
5
+ import {
6
+ Button,
7
+ dialog,
8
+ Icon,
9
+ LibIcon_Add,
10
+ LibIcon_Check,
11
+ LibIcon_Search,
12
+ Loading,
13
+ type ResolvedType,
14
+ } from '../..'
15
+ import DialogIssue from './DialogIssue.svelte'
16
+
17
+ export let dialogId: number
18
+ const rmvWarning = dialogId
19
+
20
+ export let milestoneNumber: number
21
+ export let milestoneId: string
22
+
23
+ let state: 'loading' | 'done' = 'loading'
24
+ let issueState: 'OPEN' | 'CLOSED' = 'OPEN'
25
+
26
+ let issues: ResolvedType<ReturnType<typeof FeedbackController.getIssues>> = []
27
+
28
+ const update = async (_issueState: 'OPEN' | 'CLOSED') => {
29
+ issueState = _issueState
30
+ state = 'loading'
31
+ issues = await FeedbackController.getIssues(milestoneNumber, issueState)
32
+ state = 'done'
33
+ }
34
+
35
+ onMount(async () => {
36
+ await update(issueState)
37
+ })
29
38
  </script>
30
39
 
31
40
  <div class="mb-4 grid gap-4">
@@ -1,20 +1,22 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- dialogId: number;
5
- milestoneNumber: number;
6
- milestoneId: string;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
7
11
  };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- exports?: {} | undefined;
13
- bindings?: string | undefined;
14
- };
15
- export type DialogIssuesProps = typeof __propDef.props;
16
- export type DialogIssuesEvents = typeof __propDef.events;
17
- export type DialogIssuesSlots = typeof __propDef.slots;
18
- export default class DialogIssues extends SvelteComponent<DialogIssuesProps, DialogIssuesEvents, DialogIssuesSlots> {
12
+ z_$$bindings?: Bindings;
19
13
  }
20
- export {};
14
+ declare const DialogIssues: $$__sveltets_2_IsomorphicComponent<{
15
+ dialogId: number;
16
+ milestoneNumber: number;
17
+ milestoneId: string;
18
+ }, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, string>;
21
+ type DialogIssues = InstanceType<typeof DialogIssues>;
22
+ export default DialogIssues;
@@ -1,15 +1,21 @@
1
- <script>import { onMount } from "svelte";
2
- import { FeedbackController } from "..";
3
- import { Button, dialog, Loading } from "../..";
4
- import DialogIssues from "./DialogIssues.svelte";
5
- export let dialogId;
6
- const rmvWarning = dialogId;
7
- let state = "loading";
8
- let milestones = [];
9
- onMount(async () => {
10
- milestones = await FeedbackController.getMilestones();
11
- state = "done";
12
- });
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte'
3
+
4
+ import { FeedbackController } from '..'
5
+ import type { ResolvedType } from '../..'
6
+ import { Button, dialog, Loading } from '../..'
7
+ import DialogIssues from './DialogIssues.svelte'
8
+
9
+ export let dialogId: number
10
+ const rmvWarning = dialogId
11
+
12
+ let state: 'loading' | 'done' = 'loading'
13
+
14
+ let milestones: ResolvedType<ReturnType<typeof FeedbackController.getMilestones>> = []
15
+ onMount(async () => {
16
+ milestones = await FeedbackController.getMilestones()
17
+ state = 'done'
18
+ })
13
19
  </script>
14
20
 
15
21
  <div class="mb-4 grid gap-4">
@@ -1,18 +1,20 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- dialogId: number;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
5
11
  };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {};
10
- exports?: {} | undefined;
11
- bindings?: string | undefined;
12
- };
13
- export type DialogMilestonesProps = typeof __propDef.props;
14
- export type DialogMilestonesEvents = typeof __propDef.events;
15
- export type DialogMilestonesSlots = typeof __propDef.slots;
16
- export default class DialogMilestones extends SvelteComponent<DialogMilestonesProps, DialogMilestonesEvents, DialogMilestonesSlots> {
12
+ z_$$bindings?: Bindings;
17
13
  }
18
- export {};
14
+ declare const DialogMilestones: $$__sveltets_2_IsomorphicComponent<{
15
+ dialogId: number;
16
+ }, {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {}, {}, string>;
19
+ type DialogMilestones = InstanceType<typeof DialogMilestones>;
20
+ export default DialogMilestones;
@@ -1,12 +1,14 @@
1
- <script>import { dialog } from "../../";
2
- import DialogMilestones from "./DialogMilestones.svelte";
3
- const list = async () => {
4
- await dialog.show({
5
- component: DialogMilestones,
6
- classes: { root: "overflow-auto w-[90vh] h-[90vh]" },
7
- detail: { caption: "Feedback" }
8
- });
9
- };
1
+ <script lang="ts">
2
+ import { dialog } from '../../'
3
+ import DialogMilestones from './DialogMilestones.svelte'
4
+
5
+ const list = async () => {
6
+ await dialog.show({
7
+ component: DialogMilestones,
8
+ classes: { root: 'overflow-auto w-[90vh] h-[90vh]' },
9
+ detail: { caption: 'Feedback' },
10
+ })
11
+ }
10
12
  </script>
11
13
 
12
14
  <button class="text-secondary" on:click={list}>Feedback</button>