@skillcdn/console 0.1.12 → 0.1.14

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 (72) hide show
  1. package/README.md +6 -4
  2. package/dist/cli/cli.d.ts.map +1 -1
  3. package/dist/cli/cli.js +260 -6
  4. package/dist/cli/cli.js.map +1 -1
  5. package/dist/cli/format.d.ts +7 -1
  6. package/dist/cli/format.d.ts.map +1 -1
  7. package/dist/cli/format.js +22 -0
  8. package/dist/cli/format.js.map +1 -1
  9. package/dist/cli/help.d.ts.map +1 -1
  10. package/dist/cli/help.js +69 -2
  11. package/dist/cli/help.js.map +1 -1
  12. package/dist/components/calendar.d.ts +15 -0
  13. package/dist/components/calendar.d.ts.map +1 -1
  14. package/dist/components/calendar.js +57 -30
  15. package/dist/components/calendar.js.map +1 -1
  16. package/dist/components/decision-list.d.ts.map +1 -1
  17. package/dist/components/decision-list.js +1 -1
  18. package/dist/components/decision-list.js.map +1 -1
  19. package/dist/components/skills.d.ts.map +1 -1
  20. package/dist/components/skills.js +1 -1
  21. package/dist/components/skills.js.map +1 -1
  22. package/dist/components/work.d.ts +4 -0
  23. package/dist/components/work.d.ts.map +1 -1
  24. package/dist/components/work.js +8 -3
  25. package/dist/components/work.js.map +1 -1
  26. package/dist/connect-page.d.ts.map +1 -1
  27. package/dist/connect-page.js +1 -1
  28. package/dist/connect-page.js.map +1 -1
  29. package/dist/console.css +35 -1
  30. package/dist/console.d.ts +3 -2
  31. package/dist/console.d.ts.map +1 -1
  32. package/dist/console.js +24 -58
  33. package/dist/console.js.map +1 -1
  34. package/dist/dates.d.ts +4 -0
  35. package/dist/dates.d.ts.map +1 -1
  36. package/dist/dates.js +26 -0
  37. package/dist/dates.js.map +1 -1
  38. package/dist/i18n/en.d.ts +7 -19
  39. package/dist/i18n/en.d.ts.map +1 -1
  40. package/dist/i18n/en.js +10 -22
  41. package/dist/i18n/en.js.map +1 -1
  42. package/dist/i18n/ko.d.ts.map +1 -1
  43. package/dist/i18n/ko.js +10 -22
  44. package/dist/i18n/ko.js.map +1 -1
  45. package/dist/index.d.ts +3 -3
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +3 -3
  48. package/dist/index.js.map +1 -1
  49. package/dist/router.d.ts +4 -0
  50. package/dist/router.d.ts.map +1 -1
  51. package/dist/router.js +10 -2
  52. package/dist/router.js.map +1 -1
  53. package/docs/specs/cli.md +15 -2
  54. package/docs/specs/rest.md +13 -13
  55. package/package.json +1 -1
  56. package/skills/building-a-console/SKILL.md +2 -2
  57. package/skills/working-the-board/SKILL.md +5 -1
  58. package/src/cli/cli.ts +333 -5
  59. package/src/cli/format.ts +27 -0
  60. package/src/cli/help.ts +86 -1
  61. package/src/components/calendar.tsx +219 -91
  62. package/src/components/decision-list.tsx +0 -1
  63. package/src/components/skills.tsx +0 -1
  64. package/src/components/work.tsx +66 -46
  65. package/src/connect-page.tsx +0 -1
  66. package/src/console.tsx +22 -74
  67. package/src/dates.ts +28 -0
  68. package/src/i18n/en.ts +10 -28
  69. package/src/i18n/ko.ts +10 -28
  70. package/src/index.ts +5 -0
  71. package/src/router.ts +15 -5
  72. package/src/styles/console.css +35 -1
package/src/router.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { isFolderPath, isSignInFailure, SIGN_IN_PARAM, type SignInFailure } from "./api.js";
2
- import { isMonth } from "./dates.js";
2
+ import { isDay, isMonth } from "./dates.js";
3
3
 
4
4
  // The addresses of the default console (ADR-0010): the router is a function from a URL to a
5
5
  // route, and the hrefs below are its inverse. A project's pages live under `/projects/<key>`,
6
6
  // the word the REST API uses; an address names what it shows (a task by its number, a decision
7
7
  // by its id, a document by its path, a goal by its id), every form has one, and the query says
8
- // how a page is shown (`?edit`, `?ask`, `?new`, `?version=`, `?q=`, `?month=`, and the board's
9
- // filters). The old addresses are taken to the new.
8
+ // how a page is shown (`?edit`, `?ask`, `?new`, `?version=`, `?q=`, `?month=`, `?week=`, and the
9
+ // board's filters). The old addresses are taken to the new.
10
10
 
11
11
  /** How a task's page is shown: as it is, or with one of its forms open. */
12
12
  export type TaskFormKind = "edit" | "ask";
@@ -77,7 +77,8 @@ export type Route =
77
77
  | { readonly name: "agents" }
78
78
  | { readonly name: "new-token" }
79
79
  /** What is on the person's plate across their projects. */
80
- | { readonly name: "work" }
80
+ /** What is on the person's plate: a day of the week shown at the top, or today's when the address names none. */
81
+ | { readonly name: "work"; readonly week: string | undefined }
81
82
  /** The categories tasks are sorted into; an administrator keeps them here. */
82
83
  | { readonly name: "categories" }
83
84
  /** Where a person approves an agent's connection, by the code it showed, or types one. */
@@ -206,7 +207,11 @@ export function matchRoute(pathname: string, search = ""): Route {
206
207
  return { name: "new-project" };
207
208
  }
208
209
  if (path === PATHS.work) {
209
- return { name: "work" };
210
+ const week = params.get("week");
211
+ if (week !== null && !isDay(week)) {
212
+ return NOT_FOUND;
213
+ }
214
+ return { name: "work", week: week ?? undefined };
210
215
  }
211
216
  if (path === PATHS.people) {
212
217
  return { name: "people" };
@@ -377,6 +382,11 @@ export function decisionHref(key: string, id: string): string {
377
382
  return `${PATHS.project}/${key}/decisions/${id}`;
378
383
  }
379
384
 
385
+ /** Where the person's own work is, with the week of a day at the top, or this week's when none is named. */
386
+ export function workHref(week?: string): string {
387
+ return week === undefined ? PATHS.work : `${PATHS.work}?week=${week}`;
388
+ }
389
+
380
390
  /** Where a project's calendar is, on a month, or on this one when none is named, narrowed as the filter says. */
381
391
  export function calendarHref(key: string, month?: string, filter: BoardFilter = {}): string {
382
392
  const base = projectHref(key, "calendar");
@@ -2974,10 +2974,31 @@ table {
2974
2974
  flex: 1 1 10rem;
2975
2975
  }
2976
2976
 
2977
- /* What is on a person's plate. */
2977
+ /* One week on its own, the only row there is: its days are taller than a month's. */
2978
+ .sc-week .sc-calendar-cell {
2979
+ height: 9rem;
2980
+ }
2981
+
2982
+ /* A project's mark before a task on a day: the cell's own gap keeps it off the title. */
2983
+ .sc-calendar-task .sc-mark,
2984
+ .sc-calendar-bar .sc-mark {
2985
+ flex: none;
2986
+ margin-right: var(--sc-space-1);
2987
+ }
2988
+
2989
+ .sc-calendar-task .sc-mark {
2990
+ margin-right: 0;
2991
+ }
2992
+
2993
+ /* What is on a person's plate: the week across the page, the lists below it at reading width. */
2978
2994
  .sc-work {
2979
2995
  display: grid;
2980
2996
  gap: var(--sc-space-6);
2997
+ }
2998
+
2999
+ .sc-work-lists {
3000
+ display: grid;
3001
+ gap: var(--sc-space-6);
2981
3002
  max-width: var(--sc-width-prose);
2982
3003
  }
2983
3004
 
@@ -3068,6 +3089,19 @@ table {
3068
3089
  border: 0;
3069
3090
  }
3070
3091
 
3092
+ .sc-week .sc-calendar-cell {
3093
+ height: 4.5rem;
3094
+ }
3095
+
3096
+ /* A bar is a line here, too thin for a mark; a task on its day keeps its mark as its dot. */
3097
+ .sc-calendar-bar .sc-mark {
3098
+ display: none;
3099
+ }
3100
+
3101
+ .sc-calendar-task .sc-mark {
3102
+ margin: 0;
3103
+ }
3104
+
3071
3105
  .sc-feed-item {
3072
3106
  grid-template-columns: 1fr;
3073
3107
  gap: var(--sc-space-1);