@copilotz/work 0.0.0-stage → 1.0.0-rc.34

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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -2
  3. package/boards/actions/create-board.d.ts +1 -0
  4. package/boards/actions/create-board.js +47 -0
  5. package/boards/actions/create-card.d.ts +1 -0
  6. package/boards/actions/create-card.js +83 -0
  7. package/boards/actions/delete-board.d.ts +1 -0
  8. package/boards/actions/delete-board.js +30 -0
  9. package/boards/actions/delete-card.d.ts +1 -0
  10. package/boards/actions/delete-card.js +24 -0
  11. package/boards/actions/move-card.d.ts +1 -0
  12. package/boards/actions/move-card.js +85 -0
  13. package/boards/actions/update-board.d.ts +1 -0
  14. package/boards/actions/update-board.js +110 -0
  15. package/boards/actions/update-card.d.ts +1 -0
  16. package/boards/actions/update-card.js +67 -0
  17. package/boards/collections/board.d.ts +71 -0
  18. package/boards/collections/board.js +32 -0
  19. package/boards/collections/card.d.ts +74 -0
  20. package/boards/collections/card.js +29 -0
  21. package/boards/contract.d.ts +67 -0
  22. package/boards/contract.js +20 -0
  23. package/boards/mod.d.ts +34 -0
  24. package/boards/mod.js +72 -0
  25. package/boards/resources/tools.d.ts +2 -0
  26. package/boards/resources/tools.js +414 -0
  27. package/boards/shared/columns.d.ts +39 -0
  28. package/boards/shared/columns.js +88 -0
  29. package/boards/shared/dates.d.ts +11 -0
  30. package/boards/shared/dates.js +22 -0
  31. package/boards/shared/errors.d.ts +24 -0
  32. package/boards/shared/errors.js +20 -0
  33. package/boards/shared/fields.d.ts +65 -0
  34. package/boards/shared/fields.js +44 -0
  35. package/boards/shared/load.d.ts +22 -0
  36. package/boards/shared/load.js +32 -0
  37. package/boards/shared/order.d.ts +30 -0
  38. package/boards/shared/order.js +47 -0
  39. package/boards/shared/people.d.ts +30 -0
  40. package/boards/shared/people.js +87 -0
  41. package/boards/shared/said.d.ts +28 -0
  42. package/boards/shared/said.js +30 -0
  43. package/boards/views/web/board-head.d.ts +62 -0
  44. package/boards/views/web/board-head.js +170 -0
  45. package/boards/views/web/board-page.d.ts +17 -0
  46. package/boards/views/web/board-page.js +97 -0
  47. package/boards/views/web/board-view.d.ts +40 -0
  48. package/boards/views/web/board-view.js +341 -0
  49. package/boards/views/web/boards-tab.d.ts +13 -0
  50. package/boards/views/web/boards-tab.js +109 -0
  51. package/boards/views/web/card-sheet.d.ts +47 -0
  52. package/boards/views/web/card-sheet.js +314 -0
  53. package/boards/views/web/card-tile.d.ts +29 -0
  54. package/boards/views/web/card-tile.js +20 -0
  55. package/boards/views/web/column.d.ts +38 -0
  56. package/boards/views/web/column.js +171 -0
  57. package/boards/views/web/drag.d.ts +36 -0
  58. package/boards/views/web/drag.js +276 -0
  59. package/boards/views/web/glyphs.d.ts +29 -0
  60. package/boards/views/web/glyphs.js +25 -0
  61. package/boards/views/web/load.d.ts +32 -0
  62. package/boards/views/web/load.js +33 -0
  63. package/boards/views/web/palette.d.ts +15 -0
  64. package/boards/views/web/palette.js +180 -0
  65. package/boards/views/web/pickers.d.ts +45 -0
  66. package/boards/views/web/pickers.js +83 -0
  67. package/boards/views/web/shown.d.ts +77 -0
  68. package/boards/views/web/shown.js +136 -0
  69. package/boards/views/web/step.d.ts +13 -0
  70. package/boards/views/web/step.js +41 -0
  71. package/boards/views/web/style.d.ts +10 -0
  72. package/boards/views/web/style.js +380 -0
  73. package/boards/views/web/toolbar.d.ts +21 -0
  74. package/boards/views/web/toolbar.js +39 -0
  75. package/boards/web.d.ts +26 -0
  76. package/boards/web.js +52 -0
  77. package/contract.d.ts +7 -0
  78. package/contract.js +7 -0
  79. package/documents/actions/create.d.ts +1 -0
  80. package/documents/actions/create.js +28 -0
  81. package/documents/actions/delete.d.ts +1 -0
  82. package/documents/actions/delete.js +32 -0
  83. package/documents/actions/presence.d.ts +1 -0
  84. package/documents/actions/presence.js +45 -0
  85. package/documents/actions/rename.d.ts +1 -0
  86. package/documents/actions/rename.js +33 -0
  87. package/documents/actions/restore.d.ts +1 -0
  88. package/documents/actions/restore.js +39 -0
  89. package/documents/actions/save.d.ts +1 -0
  90. package/documents/actions/save.js +78 -0
  91. package/documents/collections/document-presence.d.ts +79 -0
  92. package/documents/collections/document-presence.js +25 -0
  93. package/documents/collections/document-version.d.ts +166 -0
  94. package/documents/collections/document-version.js +60 -0
  95. package/documents/collections/document.d.ts +131 -0
  96. package/documents/collections/document.js +72 -0
  97. package/documents/contract.d.ts +17 -0
  98. package/documents/contract.js +1 -0
  99. package/documents/mod.d.ts +38 -0
  100. package/documents/mod.js +75 -0
  101. package/documents/resources/tools.d.ts +2 -0
  102. package/documents/resources/tools.js +253 -0
  103. package/documents/shared/diff.d.ts +37 -0
  104. package/documents/shared/diff.js +148 -0
  105. package/documents/shared/merge.d.ts +29 -0
  106. package/documents/shared/merge.js +120 -0
  107. package/documents/shared/presence.d.ts +7 -0
  108. package/documents/shared/presence.js +7 -0
  109. package/documents/shared/text.d.ts +36 -0
  110. package/documents/shared/text.js +67 -0
  111. package/documents/shared/who.d.ts +23 -0
  112. package/documents/shared/who.js +39 -0
  113. package/documents/shared/write.d.ts +54 -0
  114. package/documents/shared/write.js +123 -0
  115. package/documents/views/web/changes.d.ts +22 -0
  116. package/documents/views/web/changes.js +57 -0
  117. package/documents/views/web/conflict.d.ts +38 -0
  118. package/documents/views/web/conflict.js +96 -0
  119. package/documents/views/web/draft.d.ts +18 -0
  120. package/documents/views/web/draft.js +32 -0
  121. package/documents/views/web/editor.d.ts +57 -0
  122. package/documents/views/web/editor.js +268 -0
  123. package/documents/views/web/format.d.ts +56 -0
  124. package/documents/views/web/format.js +245 -0
  125. package/documents/views/web/history.d.ts +23 -0
  126. package/documents/views/web/history.js +118 -0
  127. package/documents/views/web/list.d.ts +37 -0
  128. package/documents/views/web/list.js +211 -0
  129. package/documents/views/web/page.d.ts +35 -0
  130. package/documents/views/web/page.js +416 -0
  131. package/documents/views/web/palette.d.ts +16 -0
  132. package/documents/views/web/palette.js +168 -0
  133. package/documents/views/web/people.d.ts +60 -0
  134. package/documents/views/web/people.js +63 -0
  135. package/documents/views/web/presence.d.ts +30 -0
  136. package/documents/views/web/presence.js +75 -0
  137. package/documents/views/web/step.d.ts +25 -0
  138. package/documents/views/web/step.js +81 -0
  139. package/documents/views/web/style.d.ts +7 -0
  140. package/documents/views/web/style.js +266 -0
  141. package/documents/web.d.ts +18 -0
  142. package/documents/web.js +46 -0
  143. package/mod.d.ts +18 -0
  144. package/mod.js +18 -0
  145. package/package.json +61 -4
  146. package/web.d.ts +13 -0
  147. package/web.js +13 -0
@@ -0,0 +1,380 @@
1
+ /**
2
+ * Boards' layout on the web, on the theme's variables: a board (its header,
3
+ * filters, and columns side by side, scrolling sideways; stacked in a side
4
+ * panel), its cards (labels, title, due date, a mark for a description, who
5
+ * owns it), the slot a dragged card would land in and the copy that follows
6
+ * the pointer, a card's details (a dialog; a sheet on a phone), a space's
7
+ * boards (none yet, one, several), and an agent's call to a board's tool in
8
+ * a conversation. Only layout: the pieces are the toolkit's.
9
+ */
10
+ export const STYLE = `
11
+ .board, .board-ghost, .card-sheet, .boards, .board-step {
12
+ --board-lane: color-mix(in oklab, var(--muted) 72%, var(--background));
13
+ --board-hue-0: var(--chart-1);
14
+ --board-hue-1: var(--chart-2);
15
+ --board-hue-2: var(--chart-3);
16
+ --board-hue-3: var(--chart-4);
17
+ --board-hue-4: var(--chart-5);
18
+ --board-hue-5: color-mix(in oklab, var(--chart-1) 55%, var(--chart-5));
19
+ --board-hue-6: color-mix(in oklab, var(--chart-3) 50%, var(--chart-1));
20
+ --board-hue-7: color-mix(in oklab, var(--chart-2) 50%, var(--chart-5));
21
+ }
22
+ @media (prefers-color-scheme: dark) {
23
+ .board, .board-ghost, .card-sheet, .boards, .board-step {
24
+ --board-lane: color-mix(in oklab, var(--muted) 55%, var(--background));
25
+ }
26
+ }
27
+ .board-glyph { flex: none; display: inline-block; vertical-align: middle; }
28
+ .board-stage { flex: none; color: var(--muted-foreground); }
29
+ .board-stage[data-stage=todo] { color: color-mix(in oklab, var(--foreground) 50%, var(--background)); }
30
+ .board-stage[data-stage=doing] { color: var(--warning); }
31
+ .board-stage[data-stage=review] { color: var(--info); }
32
+ .board-stage[data-stage=blocked] { color: var(--destructive); }
33
+ .board-stage[data-stage=done] { color: var(--success); }
34
+ .board-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
35
+ clip-path: inset(50%); white-space: nowrap; border: 0; }
36
+
37
+ /* A board: its head, its filters, then its columns */
38
+ .board { --board-col: 284px; container: board / inline-size; display: flex; flex-direction: column; gap: 14px;
39
+ min-width: 0; min-height: 0; }
40
+ .board[data-mode=page] { flex: 1; }
41
+ .board-head { display: grid; gap: 4px; min-width: 0; }
42
+ .board-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
43
+ .board-head-title { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0;
44
+ font-family: var(--font-display); font-size: 19px; font-weight: 660; letter-spacing: -.015em; }
45
+ .board-head-title > a { min-width: 0; overflow: hidden; color: inherit; text-decoration: none; text-overflow: ellipsis;
46
+ white-space: nowrap; }
47
+ .board-head-title > a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
48
+ .board-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
49
+ .board-name { position: relative; display: inline; isolation: isolate; max-width: 100%; margin: 0; padding: 0; border: 0;
50
+ background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: text; }
51
+ .board-name::before { content: ""; position: absolute; inset: -2px -7px; z-index: -1; border-radius: var(--radius-md);
52
+ transition: background-color .12s; }
53
+ .board-name:hover::before { background: var(--accent); }
54
+ .board-name:focus-visible { outline: none; }
55
+ .board-name:focus-visible::before { outline: 2px solid var(--ring); }
56
+ .board-about { display: block; max-width: 72ch; margin: 2px -8px 0; padding: 4px 8px; border: 0; border-radius: var(--radius-md);
57
+ background: transparent; color: var(--muted-foreground); font: inherit; font-size: 14px; line-height: 1.5;
58
+ text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; transition: background-color .12s; }
59
+ button.board-about:hover { background: var(--accent); color: var(--foreground); }
60
+ .board-about[data-empty] { color: color-mix(in oklab, var(--muted-foreground) 80%, transparent); font-style: normal; }
61
+ .board-about-edit { display: grid; gap: 8px; max-width: 72ch; }
62
+ .board-about-edit-end { display: flex; justify-content: flex-end; gap: 6px; }
63
+ .board-error { margin: 0; color: var(--destructive-text); font-size: 13px; }
64
+
65
+ .board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
66
+ .board-search { width: 230px; }
67
+ .board-filter[data-on] { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-text); }
68
+ .board-filter-faces { display: inline-flex; margin-left: 2px; }
69
+ .board-filter-faces > * + * { margin-left: -6px; }
70
+ .board-filter-faces .copilotz-avatar { outline: 2px solid var(--card); }
71
+ .board-toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted-foreground);
72
+ font-size: 12.5px; font-variant-numeric: tabular-nums; }
73
+
74
+ /* The columns, side by side */
75
+ .board-scroller { display: flex; align-items: flex-start; gap: 12px; min-height: 0; margin: 0 -4px; padding: 2px 4px 14px;
76
+ overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-padding-inline: 4px;
77
+ scrollbar-width: thin; }
78
+ .board[data-mode=page] .board-scroller { flex: 1; align-items: stretch; min-height: 300px; }
79
+ .board-column { flex: 0 0 var(--board-col); display: flex; flex-direction: column; width: var(--board-col); min-height: 0;
80
+ max-height: 100%; border-radius: var(--radius-xl); background: var(--board-lane); scroll-snap-align: start;
81
+ transition: background-color .15s, outline-color .15s; }
82
+ .board-column[data-over] { background: color-mix(in oklab, var(--ring) 7%, var(--board-lane));
83
+ outline: 1px solid color-mix(in oklab, var(--ring) 30%, transparent); outline-offset: -1px; }
84
+ .board-column-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 6px 6px 12px; }
85
+ .board-column-name { flex: 0 1 auto; min-width: 0; margin: 0; padding: 2px 4px; margin-left: -4px; overflow: hidden;
86
+ border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--foreground); font: inherit;
87
+ font-size: 13.5px; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
88
+ button.board-column-name { cursor: text; }
89
+ button.board-column-name:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); }
90
+ .board-column-name:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
91
+ .board-column-rename { flex: 1; min-width: 0; }
92
+ .board-column-rename .copilotz-input { height: 30px; }
93
+ .board-column-count { color: var(--muted-foreground); font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
94
+ .board-column-tools { display: flex; align-items: center; gap: 0; margin-left: auto; opacity: 0; transition: opacity .12s; }
95
+ .board-column:is(:hover, :focus-within) .board-column-tools, .board-column-tools:has([aria-expanded=true]) { opacity: 1; }
96
+ .board-list { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 8px; margin: 0;
97
+ padding: 2px 8px 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; list-style: none;
98
+ scrollbar-width: thin; }
99
+ .board-list:empty::after { content: ""; display: block; min-height: 40px; }
100
+ .board-column-foot { padding: 2px 8px 8px; }
101
+ .board-add { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 0 8px; border: 0;
102
+ border-radius: var(--radius-md); background: transparent; color: var(--muted-foreground); font: inherit; font-size: 13px;
103
+ font-weight: 560; text-align: left; cursor: pointer; transition: background-color .12s, color .12s; }
104
+ .board-add:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); color: var(--foreground); }
105
+ .board-add:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
106
+ .board-quick { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--ring); border-radius: var(--radius-lg);
107
+ background: var(--card); box-shadow: var(--shadow-sm); }
108
+ .board-quick .copilotz-textarea { font-size: 14px; font-weight: 520; }
109
+ .board-quick-end { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
110
+ .board-quick-hint { color: var(--muted-foreground); font-size: 12px; }
111
+ .board-quick-hint .copilotz-kbd { margin: 0 1px; }
112
+ .board-quick-buttons { display: flex; gap: 4px; }
113
+ .board-grow { margin-right: auto; }
114
+ .board-column-error { padding: 0 12px 6px; }
115
+ .card-sheet-say { margin: 0; }
116
+ .board-new-column { flex: 0 0 var(--board-col); display: grid; align-content: start; gap: 8px; width: var(--board-col); }
117
+ .board-new-column > button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
118
+ border: 1.5px dashed var(--input); border-radius: var(--radius-xl); background: transparent; color: var(--muted-foreground);
119
+ font: inherit; font-size: 13.5px; font-weight: 560; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
120
+ .board-new-column > button:hover { border-color: var(--ring); background: var(--board-lane); color: var(--foreground); }
121
+ .board-new-column > button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
122
+ .board-new-column form { display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-xl); background: var(--board-lane); }
123
+ .board-new-column-end { display: flex; justify-content: flex-end; gap: 6px; }
124
+
125
+ /* A card */
126
+ .board-card { position: relative; flex: none; border: 1px solid var(--border); border-radius: var(--radius-lg);
127
+ background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-sm); cursor: grab;
128
+ touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
129
+ transition: border-color .15s, box-shadow .15s, opacity .15s; }
130
+ .board-card:hover { border-color: var(--input); box-shadow: var(--shadow-md); }
131
+ .board-card[data-lifted] { display: none; }
132
+ .board-card[data-held] { z-index: 1; border-color: var(--ring); box-shadow: var(--shadow-lg);
133
+ outline: 2px solid color-mix(in oklab, var(--ring) 40%, transparent); outline-offset: 2px; rotate: .8deg; }
134
+ .board-card[data-busy] { opacity: .7; }
135
+ .board-card-open { display: grid; gap: 7px; width: 100%; padding: 10px 12px; border: 0; border-radius: inherit;
136
+ background: transparent; color: inherit; font: inherit; text-align: left; cursor: inherit; }
137
+ .board-card-open:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
138
+ .board-card-open > :first-child { padding-right: 22px; }
139
+ .board-card-labels { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
140
+ .board-label { --hue: var(--board-hue-0); display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 20px;
141
+ padding: 0 8px 0 7px; border-radius: var(--radius-full); background: color-mix(in oklab, var(--hue) 13%, var(--card));
142
+ color: color-mix(in oklab, var(--hue) 70%, var(--foreground)); font-size: 11.5px; font-weight: 620; line-height: 1;
143
+ white-space: nowrap; }
144
+ .board-label::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--hue); }
145
+ .board-label > span { min-width: 0; overflow: hidden; line-height: 1.4; text-overflow: ellipsis; }
146
+ .board-label[data-hue="1"] { --hue: var(--board-hue-1); }
147
+ .board-label[data-hue="2"] { --hue: var(--board-hue-2); }
148
+ .board-label[data-hue="3"] { --hue: var(--board-hue-3); }
149
+ .board-label[data-hue="4"] { --hue: var(--board-hue-4); }
150
+ .board-label[data-hue="5"] { --hue: var(--board-hue-5); }
151
+ .board-label[data-hue="6"] { --hue: var(--board-hue-6); }
152
+ .board-label[data-hue="7"] { --hue: var(--board-hue-7); }
153
+ .board-card-title { display: -webkit-box; overflow: hidden; font-size: 14px; font-weight: 560; line-height: 1.42;
154
+ overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
155
+ .board-card-meta { display: flex; align-items: center; gap: 8px; min-height: 22px; color: var(--muted-foreground);
156
+ font-size: 12px; }
157
+ .board-card-mark { display: inline-flex; align-items: center; color: var(--muted-foreground); }
158
+ .board-card-who { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
159
+ .board-due { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px 0 6px;
160
+ border-radius: var(--radius-sm); background: var(--muted); color: var(--muted-foreground); font-size: 11.5px;
161
+ font-weight: 620; white-space: nowrap; font-variant-numeric: tabular-nums; }
162
+ .board-due[data-tone=overdue] { background: var(--destructive-soft); color: var(--destructive-text); }
163
+ .board-due[data-tone=today] { background: var(--warning-soft); color: var(--warning-text); }
164
+ .board-due[data-tone=soon] { color: var(--foreground); }
165
+ .board-due[data-tone=done] { background: transparent; padding-left: 0; text-decoration: line-through;
166
+ text-decoration-color: color-mix(in oklab, var(--muted-foreground) 60%, transparent); }
167
+ .board-card-menu { position: absolute; top: 5px; right: 5px; opacity: 0; transition: opacity .12s; }
168
+ .board-card:is(:hover, :focus-within) .board-card-menu, .board-card-menu:has([aria-expanded=true]) { opacity: 1; }
169
+ @media (pointer: coarse) {
170
+ .board-card-menu { opacity: .75; }
171
+ .board-column-tools { opacity: 1; }
172
+ }
173
+
174
+ /* Where a dragged card would land, and the copy that follows the pointer */
175
+ .board-slot { flex: none; border: 1.5px dashed color-mix(in oklab, var(--ring) 60%, transparent); border-radius: var(--radius-lg);
176
+ background: color-mix(in oklab, var(--ring) 9%, transparent); animation: board-slot .16s cubic-bezier(.2, .8, .2, 1); }
177
+ @keyframes board-slot { from { height: 0; opacity: 0; } }
178
+ .board-ghost { position: fixed; top: 0; left: 0; z-index: 2147483000; margin: 0; list-style: none; pointer-events: none;
179
+ cursor: grabbing; border-color: var(--input); box-shadow: var(--shadow-lg); rotate: 2.2deg; scale: 1.035;
180
+ animation: board-lift .16s cubic-bezier(.2, .8, .2, 1); will-change: translate; }
181
+ @keyframes board-lift { from { rotate: 0deg; scale: 1; box-shadow: var(--shadow-sm); } }
182
+ .board-ghost .board-card-menu { display: none; }
183
+ .board-ghost-settling { rotate: 0deg; scale: 1; box-shadow: var(--shadow-md);
184
+ transition: translate .17s cubic-bezier(.2, .8, .2, 1), rotate .17s, scale .17s, width .17s, box-shadow .17s; }
185
+ :root[data-board-dragging], :root[data-board-dragging] * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
186
+ @media (prefers-reduced-motion: reduce) {
187
+ .board-slot, .board-ghost { animation: none; }
188
+ .board-ghost { rotate: 0deg; scale: 1; }
189
+ }
190
+
191
+ /* In a side panel: the columns stacked, each folding */
192
+ .board[data-mode=panel] { --board-col: auto; gap: 10px; }
193
+ .board[data-mode=panel] .board-scroller { flex-direction: column; align-items: stretch; gap: 8px; margin: 0; padding: 0;
194
+ overflow: visible; scroll-snap-type: none; }
195
+ .board[data-mode=panel] .board-column { flex: none; width: auto; max-height: none; }
196
+ .board[data-mode=panel] .board-list { overflow: visible; }
197
+ .board[data-mode=panel] .board-list[data-folded] { display: none; }
198
+ .board[data-mode=panel] .board-column-head { min-height: 38px; padding: 4px 4px 4px 6px; }
199
+ .board[data-mode=panel] .board-search { flex: 1 1 140px; width: auto; }
200
+ .board[data-mode=panel] .board-new-column { width: auto; flex: none; }
201
+ .board-fold { display: grid; place-items: center; width: 24px; height: 24px; margin-right: -2px; padding: 0; border: 0;
202
+ border-radius: var(--radius-sm); background: transparent; color: var(--muted-foreground); cursor: pointer;
203
+ transition: rotate .15s, background-color .12s; }
204
+ .board-fold:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); color: var(--foreground); }
205
+ .board-fold[aria-expanded=false] { rotate: -90deg; }
206
+ .board-fold:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
207
+
208
+ @container board (max-width: 640px) {
209
+ .board { --board-col: min(82cqi, 310px); }
210
+ .board:not([data-mode=panel]) .board-scroller { scroll-snap-type: x proximity; }
211
+ .board-search { flex: 1 1 100%; width: auto; }
212
+ .board-count { display: none; }
213
+ }
214
+
215
+ /* Choosing among people, labels, columns: a popover's list */
216
+ .board-options { display: grid; gap: 1px; max-height: 320px; overflow: auto; }
217
+ .board-options-head { margin: 6px 8px 2px; color: var(--muted-foreground); font-size: 11px; font-weight: 680;
218
+ letter-spacing: .05em; text-transform: uppercase; }
219
+ .board-options-search { padding: 2px 2px 6px; }
220
+ .board-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 8px; border: 0;
221
+ border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit; font-size: 13.5px;
222
+ text-align: left; cursor: pointer; }
223
+ .board-option:is(:hover, :focus-visible) { background: var(--accent); outline: none; }
224
+ .board-option-text { flex: 1; display: grid; min-width: 0; }
225
+ .board-option-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
226
+ .board-option-note { color: var(--muted-foreground); font-size: 12px; }
227
+ .board-option-count { color: var(--muted-foreground); font-size: 12px; font-variant-numeric: tabular-nums; }
228
+ .board-option-check { flex: none; color: var(--primary-text); visibility: hidden; }
229
+ .board-option[aria-checked=true] .board-option-check, .board-option[aria-selected=true] .board-option-check { visibility: visible; }
230
+ .board-option-none { margin: 10px 8px; color: var(--muted-foreground); font-size: 13px; }
231
+ .board-unassigned { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px dashed var(--input);
232
+ border-radius: var(--radius-full); color: var(--muted-foreground); }
233
+
234
+ /* A card's details: a dialog, a sheet on a phone */
235
+ .card-sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; max-height: min(88dvh, 880px); }
236
+ .copilotz-drawer .card-sheet { max-height: 88dvh; }
237
+ .card-sheet-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 2px 18px; }
238
+ .card-sheet-where { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground);
239
+ font-size: 13px; }
240
+ .card-sheet-where a { overflow: hidden; color: inherit; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
241
+ .card-sheet-where a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
242
+ .card-sheet-head-end { display: flex; align-items: center; gap: 2px; margin-left: auto; }
243
+ .card-sheet-body { display: grid; align-content: start; gap: 18px; flex: 1; min-height: 0; padding: 6px 22px 20px;
244
+ overflow: auto; overscroll-behavior: contain; }
245
+ .card-sheet-title.copilotz-textarea { font-family: var(--font-display); font-size: 22px; font-weight: 650; line-height: 1.3;
246
+ letter-spacing: -.015em; }
247
+ .card-props { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 4px 12px; margin: 0; }
248
+ .card-props dt { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; font-weight: 560; }
249
+ .card-props dt .board-glyph, .card-props dt .copilotz-icon { opacity: .85; }
250
+ .card-props dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; min-height: 36px;
251
+ margin: 0 0 0 -8px; }
252
+ .card-prop { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 32px;
253
+ padding: 0 10px 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit;
254
+ font-size: 13.5px; font-weight: 540; text-align: left; cursor: pointer; transition: background-color .12s; }
255
+ .card-prop:hover { background: var(--accent); }
256
+ .card-prop:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
257
+ .card-prop[data-empty] { color: var(--muted-foreground); font-weight: 500; }
258
+ .card-prop > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
259
+ .card-prop-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
260
+ .card-prop-labels .board-label { height: 24px; padding-right: 3px; }
261
+ .card-label-x { display: grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; padding: 0; border: 0;
262
+ border-radius: var(--radius-full); background: transparent; color: inherit; cursor: pointer; opacity: .7; }
263
+ .card-label-x:hover { background: color-mix(in oklab, var(--hue) 22%, transparent); opacity: 1; }
264
+ .card-label-x:focus-visible { outline: 2px solid var(--ring); }
265
+ .card-due { display: flex; align-items: center; gap: 6px; padding-left: 8px; }
266
+ .card-due .copilotz-input { height: 34px; width: 170px; }
267
+ .card-due-said { color: var(--muted-foreground); font-size: 12.5px; }
268
+ .card-due-said[data-tone=overdue] { color: var(--destructive-text); font-weight: 600; }
269
+ .card-due-said[data-tone=today] { color: var(--warning-text); font-weight: 600; }
270
+ .card-desc { display: grid; gap: 8px; }
271
+ .card-desc-head { display: flex; align-items: center; gap: 10px; min-height: 30px; }
272
+ .card-desc-head h3 { flex: 1; margin: 0; font-size: 13px; font-weight: 650; color: var(--muted-foreground);
273
+ letter-spacing: .02em; }
274
+ .card-desc-view { display: block; width: calc(100% + 24px); min-height: 64px; margin: 0 -12px; padding: 10px 12px; border: 0;
275
+ border-radius: var(--radius-lg); background: transparent; color: inherit; font: inherit; text-align: left; cursor: text;
276
+ transition: background-color .12s; }
277
+ .card-desc-view:hover { background: color-mix(in oklab, var(--muted) 70%, transparent); }
278
+ .card-desc-view:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
279
+ .card-desc-view[data-empty] { color: var(--muted-foreground); font-size: 14px; }
280
+ .card-desc-view .copilotz-md { font-size: 14.5px; }
281
+ .card-desc .copilotz-textarea { min-height: 160px; font-size: 14.5px; line-height: 1.6; }
282
+ .card-desc-preview { min-height: 160px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg);
283
+ background: var(--card); }
284
+ .card-desc-end { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
285
+ .card-desc-end .board-quick-hint { flex: 1; }
286
+ .card-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px 12px 22px;
287
+ border-top: 1px solid var(--border); background: color-mix(in oklab, var(--muted) 45%, var(--popover));
288
+ color: var(--muted-foreground); font-size: 12.5px; }
289
+ .card-sheet-foot .copilotz-time { font-size: 12.5px; }
290
+ .card-sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; flex: 1; min-width: 0; }
291
+ .card-sheet-meta > span + span::before { content: "·"; margin-right: 8px; }
292
+ .card-sheet-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
293
+ .card-sheet-error { margin: 0; color: var(--destructive-text); font-size: 13px; }
294
+ @media (max-width: 640px) {
295
+ .card-sheet-body { padding: 4px 16px 18px; }
296
+ .card-props { grid-template-columns: 92px minmax(0, 1fr); }
297
+ .card-sheet-title.copilotz-textarea { font-size: 20px; }
298
+ .card-sheet-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
299
+ }
300
+
301
+ /* A board's page */
302
+ .board-page.copilotz-page-full > .copilotz-page-inner { display: flex; flex-direction: column; height: 100%; padding-bottom: 8px; }
303
+ .board-page .copilotz-page-body { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 14px; }
304
+ .board-page .copilotz-page-description { max-width: none; margin-top: 2px; }
305
+ .board-missing, .board-loading { display: grid; gap: 14px; }
306
+ .board-missing { min-height: 60vh; place-items: center; padding: 24px; }
307
+ .board-loading-columns { display: flex; gap: 12px; overflow: hidden; }
308
+ .board-loading-columns > * { flex: 0 0 284px; }
309
+
310
+ /* A space's boards */
311
+ .boards { container: boards / inline-size; display: grid; gap: 18px; }
312
+ .boards-empty { display: grid; justify-items: center; gap: 20px; padding: 28px 0 8px; }
313
+ .boards-empty .copilotz-empty-text { max-width: 50ch; }
314
+ .boards-preview { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: min(100%, 720px);
315
+ padding: 12px; border-radius: var(--radius-2xl); background: var(--board-lane); }
316
+ .boards-preview-column { display: grid; align-content: start; gap: 6px; min-width: 0; }
317
+ .boards-preview-column b { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 2px 2px 4px; overflow: hidden;
318
+ font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
319
+ .boards-preview-card { height: 30px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card);
320
+ box-shadow: var(--shadow-sm); }
321
+ .boards-preview-card:nth-child(3) { height: 22px; opacity: .7; }
322
+ .boards-teach { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 720px); margin: 0;
323
+ padding: 0; list-style: none; }
324
+ .boards-teach li { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);
325
+ background: var(--card); font-size: 13px; line-height: 1.45; }
326
+ .boards-teach b { font-size: 13px; }
327
+ .boards-teach span { color: var(--muted-foreground); }
328
+ .boards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
329
+ .boards-head > .copilotz-select { flex: 1; }
330
+ .boards-intro { flex: 1 1 320px; margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
331
+ .boards-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0;
332
+ list-style: none; }
333
+ .boards-item { display: grid; gap: 10px; height: 100%; padding: 14px 16px; border: 1px solid var(--border);
334
+ border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none;
335
+ transition: border-color .15s, box-shadow .15s; }
336
+ .boards-item:hover { border-color: var(--input); box-shadow: var(--shadow-md); }
337
+ .boards-item:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
338
+ .boards-item-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 650; }
339
+ .boards-item-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
340
+ .boards-item-about { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted-foreground); font-size: 13px;
341
+ line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
342
+ .boards-bar { display: flex; height: 6px; overflow: hidden; border-radius: var(--radius-full); background: var(--muted); gap: 2px; }
343
+ .boards-bar > span { min-width: 4px; background: currentColor; }
344
+ .boards-bar > [data-stage=backlog] { color: color-mix(in oklab, var(--muted-foreground) 45%, var(--muted)); }
345
+ .boards-bar > [data-stage=todo] { color: color-mix(in oklab, var(--foreground) 35%, var(--muted)); }
346
+ .boards-bar > [data-stage=doing] { color: var(--warning); }
347
+ .boards-bar > [data-stage=review] { color: var(--info); }
348
+ .boards-bar > [data-stage=blocked] { color: var(--destructive); }
349
+ .boards-bar > [data-stage=done] { color: var(--success); }
350
+ .boards-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted-foreground);
351
+ font-size: 12.5px; }
352
+ .boards-item-meta .copilotz-time { font-size: 12.5px; }
353
+ .boards-archived summary { cursor: pointer; color: var(--muted-foreground); font-size: 13px; font-weight: 600; }
354
+ .boards-archived[open] summary { margin-bottom: 10px; }
355
+ .boards-new { display: grid; gap: 14px; }
356
+ .boards-new-end { display: flex; justify-content: flex-end; gap: 8px; }
357
+ @container boards (max-width: 560px) {
358
+ .boards-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
359
+ .boards-preview-column:nth-child(n + 4) { display: none; }
360
+ .boards-teach { grid-template-columns: 1fr; }
361
+ }
362
+
363
+ /* A call to a board's tool, in a conversation */
364
+ .board-step { display: inline-flex; align-items: flex-start; gap: 8px; max-width: 100%; color: var(--muted-foreground);
365
+ font-size: 13px; line-height: 24px; }
366
+ .board-step-mark { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px;
367
+ border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-text); }
368
+ .board-step-mark[data-failed] { background: var(--warning-soft); color: var(--warning-text); }
369
+ .board-step-head { min-width: 0; color: var(--foreground); overflow-wrap: anywhere; }
370
+ .board-step-head b { font-weight: 640; }
371
+ .board-step-head[data-failed] { color: var(--muted-foreground); }
372
+ .board-step-link { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 22px; margin-left: 2px;
373
+ padding: 0 9px 0 7px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--card);
374
+ color: var(--foreground); font-size: 12.5px; font-weight: 600; line-height: 1.2; text-decoration: none;
375
+ vertical-align: middle; box-shadow: var(--shadow-sm); transition: border-color .12s, background-color .12s; }
376
+ .board-step-link + .board-step-link { margin-left: 4px; }
377
+ .board-step-note { margin-left: 6px; color: var(--muted-foreground); }
378
+ .board-step-link:hover { border-color: var(--input); background: var(--muted); }
379
+ .board-step-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
380
+ `;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * What a board shows, chosen above its columns: a search (words in a card's
3
+ * title, description, labels or owner), owners and labels (several at once;
4
+ * "Nobody yet" for cards without an owner), how many cards show, and "New
5
+ * card". Filters are the viewer's own: they change nothing for anyone else.
6
+ */
7
+ import type { ReactNode } from "react";
8
+ import type { Card } from "../../contract.js";
9
+ import { type Filters, type Someone } from "./shown.js";
10
+ export declare function Toolbar({ cards, people, filters, onFilters, shown, can, compact, onNew }: {
11
+ cards: Card[];
12
+ /** Who cards can go to, and who they already have. */
13
+ people: Someone[];
14
+ filters: Filters;
15
+ onFilters(filters: Filters): void;
16
+ /** How many cards the filters show. */
17
+ shown: number;
18
+ can: boolean;
19
+ compact: boolean;
20
+ onNew(): void;
21
+ }): ReactNode;
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Badge, Button, IconButton, Input } from "copilotz/web";
3
+ import { Glyph } from "./glyphs.js";
4
+ import { Face, ManyPicker } from "./pickers.js";
5
+ import { filtering, hueOf, labelsOn, NO_FILTERS } from "./shown.js";
6
+ export function Toolbar({ cards, people, filters, onFilters, shown, can, compact, onNew }) {
7
+ const count = (key) => cards.filter((c) => (c.assignee ?? "none") === key).length;
8
+ const owners = [
9
+ { value: "none", label: "Nobody yet", leading: _jsx(Face, { size: 22 }), count: count("none") },
10
+ ...people.map((p) => ({
11
+ value: p.key,
12
+ label: p.name,
13
+ leading: _jsx(Face, { someone: p, size: 22 }),
14
+ count: count(p.key),
15
+ })),
16
+ ].filter((o) => o.count > 0 || o.value !== "none");
17
+ const labels = labelsOn(cards);
18
+ const chosen = people.filter((p) => filters.assignees.includes(p.key));
19
+ return (_jsxs("div", { className: "board-toolbar", role: "group", "aria-label": "Filter the board", children: [_jsx(Input, { size: "sm", icon: "search", type: "search", className: "board-search", placeholder: "Filter cards", "aria-label": "Filter cards by words", value: filters.search, onChange: (event) => onFilters({ ...filters, search: event.target.value }) }), _jsx(ManyPicker, { label: "Owners", search: owners.length > 8 ? "Find someone" : undefined, options: owners, value: filters.assignees, onChange: (assignees) => onFilters({ ...filters, assignees }), trigger: (props) => (_jsxs(Button, { size: "sm", className: "board-filter", "data-on": filters.assignees.length ? "" : undefined, icon: filters.assignees.length ? undefined : "person", ...props, children: [filters.assignees.length
20
+ ? (_jsxs("span", { className: "board-filter-faces", children: [chosen.slice(0, 3).map((p) => _jsx(Face, { someone: p, size: 18 }, p.key)), filters.assignees.includes("none") && chosen.length < 3
21
+ ? _jsx(Face, { size: 18 })
22
+ : null] }))
23
+ : null, compact ? null : "Owner"] })) }), labels.length
24
+ ? (_jsx(ManyPicker, { label: "Labels", search: labels.length > 8 ? "Find a label" : undefined, options: labels.map(({ label, count }) => ({
25
+ value: label,
26
+ label,
27
+ leading: _jsx("span", { className: "board-label", "data-hue": hueOf(label), "aria-hidden": "true" }),
28
+ count,
29
+ })), value: filters.labels, onChange: (chosenLabels) => onFilters({ ...filters, labels: chosenLabels }), trigger: (props) => (_jsxs(Button, { size: "sm", className: "board-filter", "data-on": filters.labels.length ? "" : undefined, ...props, children: [_jsx(Glyph, { name: "label", size: 14 }), compact ? null : "Label", filters.labels.length
30
+ ? _jsx(Badge, { tone: "primary", children: filters.labels.length })
31
+ : null] })) }))
32
+ : null, filtering(filters)
33
+ ? (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => onFilters(NO_FILTERS), children: "Clear" }))
34
+ : null, _jsxs("span", { className: "board-toolbar-end", children: [compact ? null : (_jsxs("span", { className: "board-count", "aria-live": "polite", children: [filtering(filters) ? `${shown} of ${cards.length}` : `${cards.length}`, " card", (filtering(filters) ? shown : cards.length) === 1 ? "" : "s"] })), can
35
+ ? compact
36
+ ? _jsx(IconButton, { icon: "plus", label: "New card", variant: "outline", onClick: onNew })
37
+ : _jsx(Button, { size: "sm", variant: "primary", icon: "plus", onClick: onNew, children: "New card" })
38
+ : null] })] }));
39
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Boards' web front end, for the browser:
3
+ *
4
+ * - **A space's Board tab** (spaces' `spaceTabs`): its boards; with one, the
5
+ * board itself; with none, what a board is for and one made in a click.
6
+ * Beside a chat (the side panel), the same, compact: columns stacked.
7
+ * - **A board's page** (`/board/<id>`, kind `board`; `?card=` opens a card):
8
+ * its name renamed in place, what it's for, filters (owner, label, words),
9
+ * "New card", and its columns side by side, cards dragged within and
10
+ * across them by pointer (touch too) or moved by keyboard, a quick add at
11
+ * each column's foot, columns added, renamed, moved and removed.
12
+ * - **A card's details:** a dialog (a sheet on a phone): its title, column,
13
+ * owner, labels, due date and Markdown description, deleting it.
14
+ * - **The command palette** (the web shell's `palette`): a board to go to, a
15
+ * new card on the one open, a new board.
16
+ * - **In a conversation** (chat's `toolViews`): an agent's call to a board's
17
+ * tool, as what it changed, linking to the board.
18
+ *
19
+ * The empty tab's line about agents is the app's: `boardsText: { agentHint: "…" }` (a resource).
20
+ *
21
+ * ```ts
22
+ * await web({ plugins: [webShell, chatWeb, spacesWeb, boardsWeb], root });
23
+ * ```
24
+ */
25
+ import { type Plugin } from "copilotz";
26
+ export declare const boardsWeb: Plugin;
package/boards/web.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Boards' web front end, for the browser:
3
+ *
4
+ * - **A space's Board tab** (spaces' `spaceTabs`): its boards; with one, the
5
+ * board itself; with none, what a board is for and one made in a click.
6
+ * Beside a chat (the side panel), the same, compact: columns stacked.
7
+ * - **A board's page** (`/board/<id>`, kind `board`; `?card=` opens a card):
8
+ * its name renamed in place, what it's for, filters (owner, label, words),
9
+ * "New card", and its columns side by side, cards dragged within and
10
+ * across them by pointer (touch too) or moved by keyboard, a quick add at
11
+ * each column's foot, columns added, renamed, moved and removed.
12
+ * - **A card's details:** a dialog (a sheet on a phone): its title, column,
13
+ * owner, labels, due date and Markdown description, deleting it.
14
+ * - **The command palette** (the web shell's `palette`): a board to go to, a
15
+ * new card on the one open, a new board.
16
+ * - **In a conversation** (chat's `toolViews`): an agent's call to a board's
17
+ * tool, as what it changed, linking to the board.
18
+ *
19
+ * The empty tab's line about agents is the app's: `boardsText: { agentHint: "…" }` (a resource).
20
+ *
21
+ * ```ts
22
+ * await web({ plugins: [webShell, chatWeb, spacesWeb, boardsWeb], root });
23
+ * ```
24
+ */
25
+ import { definePlugin } from "copilotz";
26
+ import { boardInlineView, boardPageView } from "./views/web/board-page.js";
27
+ import { boardsTabView } from "./views/web/boards-tab.js";
28
+ import { boardsPaletteView } from "./views/web/palette.js";
29
+ import { boardStepView } from "./views/web/step.js";
30
+ export const boardsWeb = definePlugin({
31
+ name: "boards-web",
32
+ requires: ["web-shell"],
33
+ views: {
34
+ board: boardPageView,
35
+ "board.inline": boardInlineView,
36
+ "boards.tab": boardsTabView,
37
+ "boards.palette": boardsPaletteView,
38
+ "board.step": boardStepView,
39
+ },
40
+ resources: {
41
+ spaceTabs: { board: { title: "Board", view: "boards.tab", icon: "check-circle", order: 20 } },
42
+ palette: { boards: { view: "boards.palette", order: 30 } },
43
+ toolViews: {
44
+ list_boards: "board.step",
45
+ read_board: "board.step",
46
+ create_board: "board.step",
47
+ create_card: "board.step",
48
+ update_card: "board.step",
49
+ move_card: "board.step",
50
+ },
51
+ },
52
+ });
package/contract.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Work's contract (`@copilotz/work/contract`): boards' and documents', the
3
+ * shapes of their documents and where each is on the web, for other plugins
4
+ * built on them. The rest is reached by name, through the runtime.
5
+ */
6
+ export * from "./boards/contract.js";
7
+ export * from "./documents/contract.js";
package/contract.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Work's contract (`@copilotz/work/contract`): boards' and documents', the
3
+ * shapes of their documents and where each is on the web, for other plugins
4
+ * built on them. The rest is reached by name, through the runtime.
5
+ */
6
+ export * from "./boards/contract.js";
7
+ export * from "./documents/contract.js";
@@ -0,0 +1 @@
1
+ export declare const createAction: import("copilotz").ActionDef;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `document.create`: a new document in a space the person may write in (the
3
+ * rules say), its first version: a title ("Untitled" until they name it)
4
+ * and, if they start from something, its text.
5
+ */
6
+ import { defineAction, people } from "copilotz";
7
+ import { keyOf, LIMIT, TITLE, UNTITLED } from "../shared/text.js";
8
+ import { create, plainly } from "../shared/write.js";
9
+ export const createAction = defineAction({
10
+ description: "Makes a document in a space",
11
+ input: {
12
+ type: "object",
13
+ properties: {
14
+ in: { type: "string", minLength: 1 },
15
+ title: { type: "string", maxLength: TITLE },
16
+ text: { type: "string", maxLength: 4 * LIMIT },
17
+ },
18
+ required: ["in"],
19
+ additionalProperties: false,
20
+ },
21
+ allow: people,
22
+ run: async (ctx, input) => {
23
+ const title = input.title?.trim() || UNTITLED;
24
+ return await ctx.transaction((tx) => create(tx, input.in, title, input.text ?? "", { by: keyOf(ctx.actor) })).catch((error) => {
25
+ throw plainly(error);
26
+ });
27
+ },
28
+ });
@@ -0,0 +1 @@
1
+ export declare const deleteAction: import("copilotz").ActionDef;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `document.delete`: a document gone, with every version of it and who had
3
+ * it open, by someone who may change it (the rules say). In one commit.
4
+ */
5
+ import { defineAction, people } from "copilotz";
6
+ import { fail, load, plainly } from "../shared/write.js";
7
+ export const deleteAction = defineAction({
8
+ description: "Deletes a document and its history",
9
+ input: {
10
+ type: "object",
11
+ properties: { document: { type: "string", minLength: 1 } },
12
+ required: ["document"],
13
+ additionalProperties: false,
14
+ },
15
+ allow: people,
16
+ run: async (ctx, input) => {
17
+ return await ctx.transaction(async (tx) => {
18
+ const doc = await load(tx.db, input.document);
19
+ const gone = await tx.db.collection("document").deleteOne({ _id: doc._id });
20
+ if (!gone.deletedCount) {
21
+ throw fail("You can read this document but not delete it: an editor or a manager of its space can.", "forbidden");
22
+ }
23
+ const { deletedCount } = await tx.db.collection("documentVersion").deleteMany({
24
+ document: doc._id,
25
+ });
26
+ await tx.db.collection("documentPresence").deleteMany({ document: doc._id });
27
+ return { deleted: true, title: doc.title, versions: deletedCount };
28
+ }).catch((error) => {
29
+ throw plainly(error);
30
+ });
31
+ },
32
+ });
@@ -0,0 +1 @@
1
+ export declare const presenceAction: import("copilotz").ActionDef;