@cratis/showrunner.notes.react 0.0.0-stage → 1.0.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 (297) hide show
  1. package/Buttons/NotesButton.tsx +117 -0
  2. package/Buttons/index.ts +6 -0
  3. package/Buttons/menuItems.ts +55 -0
  4. package/Buttons/notesDialogHeaderActions.tsx +33 -0
  5. package/Context/componentContext.ts +57 -0
  6. package/Context/formatLocation.ts +27 -0
  7. package/Context/index.ts +6 -0
  8. package/Context/noteContext.ts +139 -0
  9. package/Feedback/ComponentFeedbackDialog.tsx +150 -0
  10. package/Feedback/ComponentModeSwitch.tsx +39 -0
  11. package/Feedback/ContextSummary.tsx +31 -0
  12. package/Feedback/FeedbackDialog.tsx +64 -0
  13. package/Feedback/KindAndText.tsx +38 -0
  14. package/Feedback/SliceChooser.tsx +90 -0
  15. package/Feedback/SlicesFeedbackDialog.tsx +63 -0
  16. package/Feedback/index.ts +13 -0
  17. package/Feedback/kindOptions.ts +35 -0
  18. package/Feedback/propertySuggestions.ts +38 -0
  19. package/Feedback/sliceChoice.ts +73 -0
  20. package/Icons.tsx +29 -0
  21. package/Labels/NotesLabels.ts +185 -0
  22. package/Labels/defaultNotesLabels.ts +93 -0
  23. package/Labels/format.ts +13 -0
  24. package/Labels/index.ts +7 -0
  25. package/Labels/resolveLabels.ts +36 -0
  26. package/MyFeedback/MyFeedbackDialog.tsx +51 -0
  27. package/MyFeedback/MyFeedbackList.tsx +62 -0
  28. package/MyFeedback/index.ts +6 -0
  29. package/MyFeedback/noteStates.ts +75 -0
  30. package/Provider/NotesContext.ts +111 -0
  31. package/Provider/NotesProvider.tsx +122 -0
  32. package/Provider/index.ts +6 -0
  33. package/Provider/notesVisibility.ts +13 -0
  34. package/README.md +49 -2
  35. package/dist/cjs/Buttons/NotesButton.d.ts +8 -0
  36. package/dist/cjs/Buttons/NotesButton.d.ts.map +1 -0
  37. package/dist/cjs/Buttons/NotesButton.js +126 -0
  38. package/dist/cjs/Buttons/NotesButton.js.map +1 -0
  39. package/dist/cjs/Buttons/index.d.ts +4 -0
  40. package/dist/cjs/Buttons/index.d.ts.map +1 -0
  41. package/dist/cjs/Buttons/menuItems.d.ts +10 -0
  42. package/dist/cjs/Buttons/menuItems.d.ts.map +1 -0
  43. package/dist/cjs/Buttons/menuItems.js +57 -0
  44. package/dist/cjs/Buttons/menuItems.js.map +1 -0
  45. package/dist/cjs/Buttons/notesDialogHeaderActions.d.ts +4 -0
  46. package/dist/cjs/Buttons/notesDialogHeaderActions.d.ts.map +1 -0
  47. package/dist/cjs/Buttons/notesDialogHeaderActions.js +37 -0
  48. package/dist/cjs/Buttons/notesDialogHeaderActions.js.map +1 -0
  49. package/dist/cjs/Context/componentContext.d.ts +8 -0
  50. package/dist/cjs/Context/componentContext.d.ts.map +1 -0
  51. package/dist/cjs/Context/componentContext.js +56 -0
  52. package/dist/cjs/Context/componentContext.js.map +1 -0
  53. package/dist/cjs/Context/formatLocation.d.ts +7 -0
  54. package/dist/cjs/Context/formatLocation.d.ts.map +1 -0
  55. package/dist/cjs/Context/formatLocation.js +23 -0
  56. package/dist/cjs/Context/formatLocation.js.map +1 -0
  57. package/dist/cjs/Context/index.d.ts +4 -0
  58. package/dist/cjs/Context/index.d.ts.map +1 -0
  59. package/dist/cjs/Context/noteContext.d.ts +22 -0
  60. package/dist/cjs/Context/noteContext.d.ts.map +1 -0
  61. package/dist/cjs/Context/noteContext.js +117 -0
  62. package/dist/cjs/Context/noteContext.js.map +1 -0
  63. package/dist/cjs/Feedback/ComponentFeedbackDialog.d.ts +10 -0
  64. package/dist/cjs/Feedback/ComponentFeedbackDialog.d.ts.map +1 -0
  65. package/dist/cjs/Feedback/ComponentFeedbackDialog.js +183 -0
  66. package/dist/cjs/Feedback/ComponentFeedbackDialog.js.map +1 -0
  67. package/dist/cjs/Feedback/ComponentModeSwitch.d.ts +7 -0
  68. package/dist/cjs/Feedback/ComponentModeSwitch.d.ts.map +1 -0
  69. package/dist/cjs/Feedback/ComponentModeSwitch.js +29 -0
  70. package/dist/cjs/Feedback/ComponentModeSwitch.js.map +1 -0
  71. package/dist/cjs/Feedback/ContextSummary.d.ts +7 -0
  72. package/dist/cjs/Feedback/ContextSummary.d.ts.map +1 -0
  73. package/dist/cjs/Feedback/ContextSummary.js +31 -0
  74. package/dist/cjs/Feedback/ContextSummary.js.map +1 -0
  75. package/dist/cjs/Feedback/FeedbackDialog.d.ts +11 -0
  76. package/dist/cjs/Feedback/FeedbackDialog.d.ts.map +1 -0
  77. package/dist/cjs/Feedback/FeedbackDialog.js +55 -0
  78. package/dist/cjs/Feedback/FeedbackDialog.js.map +1 -0
  79. package/dist/cjs/Feedback/KindAndText.d.ts +7 -0
  80. package/dist/cjs/Feedback/KindAndText.d.ts.map +1 -0
  81. package/dist/cjs/Feedback/KindAndText.js +33 -0
  82. package/dist/cjs/Feedback/KindAndText.js.map +1 -0
  83. package/dist/cjs/Feedback/SliceChooser.d.ts +9 -0
  84. package/dist/cjs/Feedback/SliceChooser.d.ts.map +1 -0
  85. package/dist/cjs/Feedback/SliceChooser.js +113 -0
  86. package/dist/cjs/Feedback/SliceChooser.js.map +1 -0
  87. package/dist/cjs/Feedback/SlicesFeedbackDialog.d.ts +8 -0
  88. package/dist/cjs/Feedback/SlicesFeedbackDialog.d.ts.map +1 -0
  89. package/dist/cjs/Feedback/SlicesFeedbackDialog.js +74 -0
  90. package/dist/cjs/Feedback/SlicesFeedbackDialog.js.map +1 -0
  91. package/dist/cjs/Feedback/index.d.ts +11 -0
  92. package/dist/cjs/Feedback/index.d.ts.map +1 -0
  93. package/dist/cjs/Feedback/kindOptions.d.ts +9 -0
  94. package/dist/cjs/Feedback/kindOptions.d.ts.map +1 -0
  95. package/dist/cjs/Feedback/kindOptions.js +37 -0
  96. package/dist/cjs/Feedback/kindOptions.js.map +1 -0
  97. package/dist/cjs/Feedback/propertySuggestions.d.ts +6 -0
  98. package/dist/cjs/Feedback/propertySuggestions.d.ts.map +1 -0
  99. package/dist/cjs/Feedback/propertySuggestions.js +32 -0
  100. package/dist/cjs/Feedback/propertySuggestions.js.map +1 -0
  101. package/dist/cjs/Feedback/sliceChoice.d.ts +7 -0
  102. package/dist/cjs/Feedback/sliceChoice.d.ts.map +1 -0
  103. package/dist/cjs/Feedback/sliceChoice.js +71 -0
  104. package/dist/cjs/Feedback/sliceChoice.js.map +1 -0
  105. package/dist/cjs/Icons.d.ts +4 -0
  106. package/dist/cjs/Icons.d.ts.map +1 -0
  107. package/dist/cjs/Icons.js +53 -0
  108. package/dist/cjs/Icons.js.map +1 -0
  109. package/dist/cjs/Labels/NotesLabels.d.ts +90 -0
  110. package/dist/cjs/Labels/NotesLabels.d.ts.map +1 -0
  111. package/dist/cjs/Labels/defaultNotesLabels.d.ts +3 -0
  112. package/dist/cjs/Labels/defaultNotesLabels.d.ts.map +1 -0
  113. package/dist/cjs/Labels/defaultNotesLabels.js +94 -0
  114. package/dist/cjs/Labels/defaultNotesLabels.js.map +1 -0
  115. package/dist/cjs/Labels/format.d.ts +2 -0
  116. package/dist/cjs/Labels/format.d.ts.map +1 -0
  117. package/dist/cjs/Labels/format.js +15 -0
  118. package/dist/cjs/Labels/format.js.map +1 -0
  119. package/dist/cjs/Labels/index.d.ts +5 -0
  120. package/dist/cjs/Labels/index.d.ts.map +1 -0
  121. package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
  122. package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
  123. package/dist/cjs/Labels/resolveLabels.js +35 -0
  124. package/dist/cjs/Labels/resolveLabels.js.map +1 -0
  125. package/dist/cjs/MyFeedback/MyFeedbackDialog.d.ts +2 -0
  126. package/dist/cjs/MyFeedback/MyFeedbackDialog.d.ts.map +1 -0
  127. package/dist/cjs/MyFeedback/MyFeedbackDialog.js +55 -0
  128. package/dist/cjs/MyFeedback/MyFeedbackDialog.js.map +1 -0
  129. package/dist/cjs/MyFeedback/MyFeedbackList.d.ts +10 -0
  130. package/dist/cjs/MyFeedback/MyFeedbackList.d.ts.map +1 -0
  131. package/dist/cjs/MyFeedback/MyFeedbackList.js +62 -0
  132. package/dist/cjs/MyFeedback/MyFeedbackList.js.map +1 -0
  133. package/dist/cjs/MyFeedback/index.d.ts +4 -0
  134. package/dist/cjs/MyFeedback/index.d.ts.map +1 -0
  135. package/dist/cjs/MyFeedback/noteStates.d.ts +8 -0
  136. package/dist/cjs/MyFeedback/noteStates.d.ts.map +1 -0
  137. package/dist/cjs/MyFeedback/noteStates.js +90 -0
  138. package/dist/cjs/MyFeedback/noteStates.js.map +1 -0
  139. package/dist/cjs/Provider/NotesContext.d.ts +23 -0
  140. package/dist/cjs/Provider/NotesContext.d.ts.map +1 -0
  141. package/dist/cjs/Provider/NotesContext.js +51 -0
  142. package/dist/cjs/Provider/NotesContext.js.map +1 -0
  143. package/dist/cjs/Provider/NotesProvider.d.ts +11 -0
  144. package/dist/cjs/Provider/NotesProvider.d.ts.map +1 -0
  145. package/dist/cjs/Provider/NotesProvider.js +133 -0
  146. package/dist/cjs/Provider/NotesProvider.js.map +1 -0
  147. package/dist/cjs/Provider/index.d.ts +4 -0
  148. package/dist/cjs/Provider/index.d.ts.map +1 -0
  149. package/dist/cjs/Provider/notesVisibility.d.ts +2 -0
  150. package/dist/cjs/Provider/notesVisibility.d.ts.map +1 -0
  151. package/dist/cjs/Provider/notesVisibility.js +16 -0
  152. package/dist/cjs/Provider/notesVisibility.js.map +1 -0
  153. package/dist/cjs/index.d.ts +8 -0
  154. package/dist/cjs/index.d.ts.map +1 -0
  155. package/dist/cjs/index.js +85 -0
  156. package/dist/cjs/index.js.map +1 -0
  157. package/dist/cjs/package.json +3 -0
  158. package/dist/esm/Buttons/NotesButton.d.ts +8 -0
  159. package/dist/esm/Buttons/NotesButton.d.ts.map +1 -0
  160. package/dist/esm/Buttons/NotesButton.js +124 -0
  161. package/dist/esm/Buttons/NotesButton.js.map +1 -0
  162. package/dist/esm/Buttons/index.d.ts +4 -0
  163. package/dist/esm/Buttons/index.d.ts.map +1 -0
  164. package/dist/esm/Buttons/index.js +4 -0
  165. package/dist/esm/Buttons/index.js.map +1 -0
  166. package/dist/esm/Buttons/menuItems.d.ts +10 -0
  167. package/dist/esm/Buttons/menuItems.d.ts.map +1 -0
  168. package/dist/esm/Buttons/menuItems.js +54 -0
  169. package/dist/esm/Buttons/menuItems.js.map +1 -0
  170. package/dist/esm/Buttons/notesDialogHeaderActions.d.ts +4 -0
  171. package/dist/esm/Buttons/notesDialogHeaderActions.d.ts.map +1 -0
  172. package/dist/esm/Buttons/notesDialogHeaderActions.js +34 -0
  173. package/dist/esm/Buttons/notesDialogHeaderActions.js.map +1 -0
  174. package/dist/esm/Context/componentContext.d.ts +8 -0
  175. package/dist/esm/Context/componentContext.d.ts.map +1 -0
  176. package/dist/esm/Context/componentContext.js +51 -0
  177. package/dist/esm/Context/componentContext.js.map +1 -0
  178. package/dist/esm/Context/formatLocation.d.ts +7 -0
  179. package/dist/esm/Context/formatLocation.d.ts.map +1 -0
  180. package/dist/esm/Context/formatLocation.js +21 -0
  181. package/dist/esm/Context/formatLocation.js.map +1 -0
  182. package/dist/esm/Context/index.d.ts +4 -0
  183. package/dist/esm/Context/index.d.ts.map +1 -0
  184. package/dist/esm/Context/index.js +4 -0
  185. package/dist/esm/Context/index.js.map +1 -0
  186. package/dist/esm/Context/noteContext.d.ts +22 -0
  187. package/dist/esm/Context/noteContext.d.ts.map +1 -0
  188. package/dist/esm/Context/noteContext.js +110 -0
  189. package/dist/esm/Context/noteContext.js.map +1 -0
  190. package/dist/esm/Feedback/ComponentFeedbackDialog.d.ts +10 -0
  191. package/dist/esm/Feedback/ComponentFeedbackDialog.d.ts.map +1 -0
  192. package/dist/esm/Feedback/ComponentFeedbackDialog.js +181 -0
  193. package/dist/esm/Feedback/ComponentFeedbackDialog.js.map +1 -0
  194. package/dist/esm/Feedback/ComponentModeSwitch.d.ts +7 -0
  195. package/dist/esm/Feedback/ComponentModeSwitch.d.ts.map +1 -0
  196. package/dist/esm/Feedback/ComponentModeSwitch.js +27 -0
  197. package/dist/esm/Feedback/ComponentModeSwitch.js.map +1 -0
  198. package/dist/esm/Feedback/ContextSummary.d.ts +7 -0
  199. package/dist/esm/Feedback/ContextSummary.d.ts.map +1 -0
  200. package/dist/esm/Feedback/ContextSummary.js +29 -0
  201. package/dist/esm/Feedback/ContextSummary.js.map +1 -0
  202. package/dist/esm/Feedback/FeedbackDialog.d.ts +11 -0
  203. package/dist/esm/Feedback/FeedbackDialog.d.ts.map +1 -0
  204. package/dist/esm/Feedback/FeedbackDialog.js +53 -0
  205. package/dist/esm/Feedback/FeedbackDialog.js.map +1 -0
  206. package/dist/esm/Feedback/KindAndText.d.ts +7 -0
  207. package/dist/esm/Feedback/KindAndText.d.ts.map +1 -0
  208. package/dist/esm/Feedback/KindAndText.js +31 -0
  209. package/dist/esm/Feedback/KindAndText.js.map +1 -0
  210. package/dist/esm/Feedback/SliceChooser.d.ts +9 -0
  211. package/dist/esm/Feedback/SliceChooser.d.ts.map +1 -0
  212. package/dist/esm/Feedback/SliceChooser.js +111 -0
  213. package/dist/esm/Feedback/SliceChooser.js.map +1 -0
  214. package/dist/esm/Feedback/SlicesFeedbackDialog.d.ts +8 -0
  215. package/dist/esm/Feedback/SlicesFeedbackDialog.d.ts.map +1 -0
  216. package/dist/esm/Feedback/SlicesFeedbackDialog.js +72 -0
  217. package/dist/esm/Feedback/SlicesFeedbackDialog.js.map +1 -0
  218. package/dist/esm/Feedback/index.d.ts +11 -0
  219. package/dist/esm/Feedback/index.d.ts.map +1 -0
  220. package/dist/esm/Feedback/index.js +11 -0
  221. package/dist/esm/Feedback/index.js.map +1 -0
  222. package/dist/esm/Feedback/kindOptions.d.ts +9 -0
  223. package/dist/esm/Feedback/kindOptions.d.ts.map +1 -0
  224. package/dist/esm/Feedback/kindOptions.js +34 -0
  225. package/dist/esm/Feedback/kindOptions.js.map +1 -0
  226. package/dist/esm/Feedback/propertySuggestions.d.ts +6 -0
  227. package/dist/esm/Feedback/propertySuggestions.d.ts.map +1 -0
  228. package/dist/esm/Feedback/propertySuggestions.js +29 -0
  229. package/dist/esm/Feedback/propertySuggestions.js.map +1 -0
  230. package/dist/esm/Feedback/sliceChoice.d.ts +7 -0
  231. package/dist/esm/Feedback/sliceChoice.d.ts.map +1 -0
  232. package/dist/esm/Feedback/sliceChoice.js +65 -0
  233. package/dist/esm/Feedback/sliceChoice.js.map +1 -0
  234. package/dist/esm/Icons.d.ts +4 -0
  235. package/dist/esm/Icons.d.ts.map +1 -0
  236. package/dist/esm/Icons.js +49 -0
  237. package/dist/esm/Icons.js.map +1 -0
  238. package/dist/esm/Labels/NotesLabels.d.ts +90 -0
  239. package/dist/esm/Labels/NotesLabels.d.ts.map +1 -0
  240. package/dist/esm/Labels/NotesLabels.js +2 -0
  241. package/dist/esm/Labels/NotesLabels.js.map +1 -0
  242. package/dist/esm/Labels/defaultNotesLabels.d.ts +3 -0
  243. package/dist/esm/Labels/defaultNotesLabels.d.ts.map +1 -0
  244. package/dist/esm/Labels/defaultNotesLabels.js +92 -0
  245. package/dist/esm/Labels/defaultNotesLabels.js.map +1 -0
  246. package/dist/esm/Labels/format.d.ts +2 -0
  247. package/dist/esm/Labels/format.d.ts.map +1 -0
  248. package/dist/esm/Labels/format.js +13 -0
  249. package/dist/esm/Labels/format.js.map +1 -0
  250. package/dist/esm/Labels/index.d.ts +5 -0
  251. package/dist/esm/Labels/index.d.ts.map +1 -0
  252. package/dist/esm/Labels/index.js +5 -0
  253. package/dist/esm/Labels/index.js.map +1 -0
  254. package/dist/esm/Labels/resolveLabels.d.ts +3 -0
  255. package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
  256. package/dist/esm/Labels/resolveLabels.js +33 -0
  257. package/dist/esm/Labels/resolveLabels.js.map +1 -0
  258. package/dist/esm/MyFeedback/MyFeedbackDialog.d.ts +2 -0
  259. package/dist/esm/MyFeedback/MyFeedbackDialog.d.ts.map +1 -0
  260. package/dist/esm/MyFeedback/MyFeedbackDialog.js +53 -0
  261. package/dist/esm/MyFeedback/MyFeedbackDialog.js.map +1 -0
  262. package/dist/esm/MyFeedback/MyFeedbackList.d.ts +10 -0
  263. package/dist/esm/MyFeedback/MyFeedbackList.d.ts.map +1 -0
  264. package/dist/esm/MyFeedback/MyFeedbackList.js +60 -0
  265. package/dist/esm/MyFeedback/MyFeedbackList.js.map +1 -0
  266. package/dist/esm/MyFeedback/index.d.ts +4 -0
  267. package/dist/esm/MyFeedback/index.d.ts.map +1 -0
  268. package/dist/esm/MyFeedback/index.js +4 -0
  269. package/dist/esm/MyFeedback/index.js.map +1 -0
  270. package/dist/esm/MyFeedback/noteStates.d.ts +8 -0
  271. package/dist/esm/MyFeedback/noteStates.d.ts.map +1 -0
  272. package/dist/esm/MyFeedback/noteStates.js +84 -0
  273. package/dist/esm/MyFeedback/noteStates.js.map +1 -0
  274. package/dist/esm/Provider/NotesContext.d.ts +23 -0
  275. package/dist/esm/Provider/NotesContext.d.ts.map +1 -0
  276. package/dist/esm/Provider/NotesContext.js +44 -0
  277. package/dist/esm/Provider/NotesContext.js.map +1 -0
  278. package/dist/esm/Provider/NotesProvider.d.ts +11 -0
  279. package/dist/esm/Provider/NotesProvider.d.ts.map +1 -0
  280. package/dist/esm/Provider/NotesProvider.js +131 -0
  281. package/dist/esm/Provider/NotesProvider.js.map +1 -0
  282. package/dist/esm/Provider/index.d.ts +4 -0
  283. package/dist/esm/Provider/index.d.ts.map +1 -0
  284. package/dist/esm/Provider/index.js +4 -0
  285. package/dist/esm/Provider/index.js.map +1 -0
  286. package/dist/esm/Provider/notesVisibility.d.ts +2 -0
  287. package/dist/esm/Provider/notesVisibility.d.ts.map +1 -0
  288. package/dist/esm/Provider/notesVisibility.js +14 -0
  289. package/dist/esm/Provider/notesVisibility.js.map +1 -0
  290. package/dist/esm/index.d.ts +8 -0
  291. package/dist/esm/index.d.ts.map +1 -0
  292. package/dist/esm/index.js +27 -0
  293. package/dist/esm/index.js.map +1 -0
  294. package/dist/esm/package.json +3 -0
  295. package/index.ts +10 -0
  296. package/package.json +84 -5
  297. package/styles.css +192 -0
@@ -0,0 +1,64 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { DialogResult, useDialogContext } from '@cratis/arc.react/dialogs';
5
+ import { CommandDialog } from '@cratis/components/CommandDialog';
6
+ import { DialogInitialFocus } from '@cratis/components/Dialogs';
7
+ import { Guid } from '@cratis/fundamentals';
8
+ import { GiveNoteOnContext, GiveNoteOnScreen, NoteContext } from '@cratis/showrunner.notes';
9
+ import { useState } from 'react';
10
+ import { describeContext, describeScreen } from '../Context/index.js';
11
+ import { useNotesContext } from '../Provider/NotesContext.js';
12
+ import { ContextSummary } from './ContextSummary.js';
13
+ import { defaultKind } from './kindOptions.js';
14
+ import { KindAndText } from './KindAndText.js';
15
+
16
+ /**
17
+ * What the feedback dialogs close with.
18
+ */
19
+ export interface FeedbackGiven {
20
+ /** The id of the note. */
21
+ readonly noteId: Guid;
22
+ }
23
+
24
+ /**
25
+ * Props for {@link FeedbackDialog}.
26
+ */
27
+ export interface FeedbackDialogProps {
28
+ /** What the user was looking at when they chose to give feedback. */
29
+ context: NoteContext;
30
+
31
+ /** Whether the feedback is about what was on screen, or about the screen. Defaults to what was on screen. */
32
+ about?: 'context' | 'screen';
33
+ }
34
+
35
+ /**
36
+ * The give feedback dialog: shows in plain language what was captured, and takes the kind and the text. It sends
37
+ * `GiveNoteOnContext`, or `GiveNoteOnScreen` for a screen, and closes with {@link FeedbackGiven}. Open it with
38
+ * `useDialog`.
39
+ */
40
+ export const FeedbackDialog = ({ context, about = 'context' }: FeedbackDialogProps) => {
41
+ const { labels } = useNotesContext();
42
+ const { closeDialog } = useDialogContext<FeedbackDialogProps, FeedbackGiven>();
43
+ const [noteId] = useState(() => Guid.create());
44
+ const isScreen = about === 'screen';
45
+ const command = isScreen ? GiveNoteOnScreen : GiveNoteOnContext;
46
+
47
+ return (
48
+ <CommandDialog<GiveNoteOnContext | GiveNoteOnScreen>
49
+ command={command as typeof GiveNoteOnContext}
50
+ title={isScreen ? labels.feedback.screenTitle : labels.feedback.contextTitle}
51
+ okLabel={labels.feedback.send}
52
+ cancelLabel={labels.common.cancel}
53
+ closeAriaLabel={labels.common.close}
54
+ width='560px'
55
+ initialFocus={DialogInitialFocus.Content}
56
+ initialValues={{ context, noteId, kind: defaultKind }}
57
+ onSuccess={() => closeDialog(DialogResult.Ok, { noteId })}>
58
+ <div className='notes-feedback-form'>
59
+ <ContextSummary text={isScreen ? describeScreen(context, labels) : describeContext(context, labels)} />
60
+ <KindAndText<GiveNoteOnContext> />
61
+ </div>
62
+ </CommandDialog>
63
+ );
64
+ };
@@ -0,0 +1,38 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { RadioGroupField, TextAreaField } from '@cratis/components/CommandForm';
5
+ import { NoteKind } from '@cratis/showrunner.notes';
6
+ import { useNotesLabels } from '../Provider/NotesContext.js';
7
+ import { kindOptions } from './kindOptions.js';
8
+
9
+ /**
10
+ * The command values {@link KindAndText} binds to.
11
+ */
12
+ export interface KindAndTextValues {
13
+ /** What kind of feedback it is. */
14
+ kind: NoteKind;
15
+
16
+ /** What the user writes. */
17
+ text: string;
18
+ }
19
+
20
+ /**
21
+ * The kind selector and the text field every feedback dialog has.
22
+ */
23
+ export const KindAndText = <TCommand extends KindAndTextValues>() => {
24
+ const labels = useNotesLabels();
25
+
26
+ return (
27
+ <div className='notes-kind-and-text'>
28
+ <RadioGroupField<TCommand>
29
+ value={command => command.kind}
30
+ title={labels.kinds.title}
31
+ options={kindOptions(labels)}
32
+ optionValue='value'
33
+ optionLabel='label'
34
+ layout='horizontal' />
35
+ <TextAreaField<TCommand> value={command => command.text} title={labels.feedback.text} rows={5} />
36
+ </div>
37
+ );
38
+ };
@@ -0,0 +1,90 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { Checkbox, IconButton, TextInput } from '@cratis/components/Common';
5
+ import { useId, useState } from 'react';
6
+ import { formatLocation, LocationParts } from '../Context/formatLocation.js';
7
+ import { CloseIcon } from '../Icons.js';
8
+ import { format } from '../Labels/index.js';
9
+ import { useNotesLabels } from '../Provider/NotesContext.js';
10
+ import { distinctSlices, isChosen, searchSlices, sliceKey, toggleSlice } from './sliceChoice.js';
11
+
12
+ /**
13
+ * Props for {@link SliceChooser}.
14
+ */
15
+ export interface SliceChooserProps {
16
+ /** The slices active on the screen. */
17
+ active: readonly LocationParts[];
18
+
19
+ /** Every slice the host knows about, to search over. */
20
+ known: readonly LocationParts[];
21
+
22
+ /** The chosen slices. */
23
+ chosen: readonly LocationParts[];
24
+
25
+ /** Called with the chosen slices after a change. */
26
+ onChange: (chosen: LocationParts[]) => void;
27
+ }
28
+
29
+ /**
30
+ * Chooses the slices a note is about: the ones active on the screen, and a search over all the slices the host knows.
31
+ */
32
+ export const SliceChooser = ({ active, known, chosen, onChange }: SliceChooserProps) => {
33
+ const labels = useNotesLabels();
34
+ const [query, setQuery] = useState('');
35
+ const activeId = useId();
36
+ const resultsId = useId();
37
+ const activeSlices = distinctSlices(active);
38
+ const results = searchSlices(known, query);
39
+ const name = (location: LocationParts) => formatLocation(location, labels.common.locationSeparator, labels.common.unknownLocation);
40
+
41
+ const option = (location: LocationParts) => (
42
+ <li key={sliceKey(location)}>
43
+ <Checkbox label={name(location)} checked={isChosen(chosen, location)} onChange={() => onChange(toggleSlice(chosen, location))} />
44
+ </li>
45
+ );
46
+
47
+ return (
48
+ <div className='notes-slice-chooser'>
49
+ <section aria-labelledby={activeId}>
50
+ <h3 id={activeId} className='notes-slice-chooser__heading'>{labels.slices.active}</h3>
51
+ {activeSlices.length === 0
52
+ ? <p className='notes-slice-chooser__empty'>{labels.slices.noneActive}</p>
53
+ : <ul className='notes-slice-chooser__list'>{activeSlices.map(option)}</ul>}
54
+ </section>
55
+ <section>
56
+ <label className='notes-slice-chooser__heading' htmlFor={`${resultsId}-search`}>{labels.slices.search}</label>
57
+ <TextInput
58
+ id={`${resultsId}-search`}
59
+ type='search'
60
+ value={query}
61
+ placeholder={labels.slices.searchPlaceholder}
62
+ aria-controls={resultsId}
63
+ onChange={value => setQuery(value)} />
64
+ <div id={resultsId} aria-live='polite'>
65
+ {query.trim().length > 0 && (results.length === 0
66
+ ? <p className='notes-slice-chooser__empty'>{labels.slices.noMatches}</p>
67
+ : <ul className='notes-slice-chooser__list' aria-label={labels.slices.results}>{results.map(option)}</ul>)}
68
+ </div>
69
+ </section>
70
+ {chosen.length > 0 && (
71
+ <section>
72
+ <p className='notes-slice-chooser__heading'>{format(labels.slices.chosen, { count: chosen.length })}</p>
73
+ <ul className='notes-slice-chooser__chosen'>
74
+ {chosen.map(location => (
75
+ <li key={sliceKey(location)} className='notes-slice-chooser__chip'>
76
+ <span>{name(location)}</span>
77
+ <IconButton
78
+ variant='ghost'
79
+ size='small'
80
+ icon={<CloseIcon />}
81
+ aria-label={format(labels.slices.remove, { slice: name(location) })}
82
+ onClick={() => onChange(toggleSlice(chosen, location))} />
83
+ </li>
84
+ ))}
85
+ </ul>
86
+ </section>
87
+ )}
88
+ </div>
89
+ );
90
+ };
@@ -0,0 +1,63 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { DialogResult, useDialogContext } from '@cratis/arc.react/dialogs';
5
+ import { CommandDialog } from '@cratis/components/CommandDialog';
6
+ import { DialogInitialFocus } from '@cratis/components/Dialogs';
7
+ import { Guid } from '@cratis/fundamentals';
8
+ import { GiveNoteOnSlices, NoteContext } from '@cratis/showrunner.notes';
9
+ import { useMemo, useState } from 'react';
10
+ import { describeContext, toSliceLocation } from '../Context/index.js';
11
+ import { LocationParts } from '../Context/formatLocation.js';
12
+ import { useNotesContext } from '../Provider/NotesContext.js';
13
+ import { ContextSummary } from './ContextSummary.js';
14
+ import { FeedbackGiven } from './FeedbackDialog.js';
15
+ import { defaultKind } from './kindOptions.js';
16
+ import { KindAndText } from './KindAndText.js';
17
+ import { SliceChooser } from './SliceChooser.js';
18
+ import { distinctSlices } from './sliceChoice.js';
19
+
20
+ /**
21
+ * Props for {@link SlicesFeedbackDialog}.
22
+ */
23
+ export interface SlicesFeedbackDialogProps {
24
+ /** What the user was looking at when they chose to give feedback. */
25
+ context: NoteContext;
26
+
27
+ /** Every slice the host knows about, to search over. */
28
+ knownSlices?: readonly LocationParts[];
29
+ }
30
+
31
+ /**
32
+ * The give feedback on specific slices dialog: the user chooses among the slices active on the screen and searches
33
+ * all the slices the host knows. It sends `GiveNoteOnSlices` and closes with {@link FeedbackGiven}. Open it with
34
+ * `useDialog`.
35
+ */
36
+ export const SlicesFeedbackDialog = ({ context, knownSlices = [] }: SlicesFeedbackDialogProps) => {
37
+ const { labels } = useNotesContext();
38
+ const { closeDialog } = useDialogContext<SlicesFeedbackDialogProps, FeedbackGiven>();
39
+ const [noteId] = useState(() => Guid.create());
40
+ const active = useMemo(() => distinctSlices([context.location, ...context.activeSlices]), [context]);
41
+ const [chosen, setChosen] = useState<LocationParts[]>([]);
42
+ const currentValues = useMemo(() => ({ slices: chosen.map(toSliceLocation) }), [chosen]);
43
+
44
+ return (
45
+ <CommandDialog<GiveNoteOnSlices>
46
+ command={GiveNoteOnSlices}
47
+ title={labels.slices.title}
48
+ okLabel={labels.feedback.send}
49
+ cancelLabel={labels.common.cancel}
50
+ closeAriaLabel={labels.common.close}
51
+ width='640px'
52
+ initialFocus={DialogInitialFocus.Content}
53
+ initialValues={{ context, noteId, kind: defaultKind }}
54
+ currentValues={currentValues}
55
+ onSuccess={() => closeDialog(DialogResult.Ok, { noteId })}>
56
+ <div className='notes-feedback-form'>
57
+ <ContextSummary text={describeContext(context, labels)} />
58
+ <SliceChooser active={active} known={knownSlices} chosen={chosen} onChange={setChosen} />
59
+ <KindAndText<GiveNoteOnSlices> />
60
+ </div>
61
+ </CommandDialog>
62
+ );
63
+ };
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './ComponentFeedbackDialog.js';
5
+ export * from './ComponentModeSwitch.js';
6
+ export * from './ContextSummary.js';
7
+ export * from './FeedbackDialog.js';
8
+ export * from './kindOptions.js';
9
+ export * from './KindAndText.js';
10
+ export * from './propertySuggestions.js';
11
+ export * from './SliceChooser.js';
12
+ export * from './SlicesFeedbackDialog.js';
13
+ export * from './sliceChoice.js';
@@ -0,0 +1,35 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { NoteKind } from '@cratis/showrunner.notes';
5
+ import { NotesLabels } from '../Labels/index.js';
6
+
7
+ /**
8
+ * One choice of the kind field.
9
+ */
10
+ export type KindOption = {
11
+ /** The kind. */
12
+ readonly value: NoteKind;
13
+
14
+ /** The label. */
15
+ readonly label: string;
16
+ };
17
+
18
+ /**
19
+ * Gets the kinds of feedback a user can choose from.
20
+ * @param labels The labels to show.
21
+ * @returns The {@link KindOption}s, in the order they are offered.
22
+ */
23
+ export function kindOptions(labels: NotesLabels): KindOption[] {
24
+ return [
25
+ { value: NoteKind.problem, label: labels.kinds.problem },
26
+ { value: NoteKind.suggestion, label: labels.kinds.suggestion },
27
+ { value: NoteKind.question, label: labels.kinds.question },
28
+ { value: NoteKind.praise, label: labels.kinds.praise }
29
+ ];
30
+ }
31
+
32
+ /**
33
+ * The kind a note starts as.
34
+ */
35
+ export const defaultKind: NoteKind = NoteKind.suggestion;
@@ -0,0 +1,38 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { PresentationChange } from '@cratis/components/ComponentPicker';
5
+ import { Guid } from '@cratis/fundamentals';
6
+ import { ISuggestComponentPropertyChange, NoteContext, PickedComponent } from '@cratis/showrunner.notes';
7
+
8
+ /**
9
+ * Turns the value of a presentation property into the text a suggestion carries.
10
+ * @param value The value; undefined when the property was not set.
11
+ * @returns The text; empty when the property was not set.
12
+ */
13
+ export function propertyValueText(value: unknown): string {
14
+ return value === undefined || value === null ? '' : String(value);
15
+ }
16
+
17
+ /**
18
+ * Makes the values of one `SuggestComponentPropertyChange` per changed property.
19
+ * @param changes What the user changed in the property editor.
20
+ * @param context What the user was looking at.
21
+ * @param component The picked component.
22
+ * @param noteId The id the whole picking session shares.
23
+ * @returns The command values, in the order of the changes.
24
+ */
25
+ export function propertySuggestions(
26
+ changes: readonly PresentationChange[],
27
+ context: NoteContext,
28
+ component: PickedComponent,
29
+ noteId: Guid): ISuggestComponentPropertyChange[] {
30
+ return changes.map(change => ({
31
+ noteId,
32
+ context,
33
+ component,
34
+ property: change.property,
35
+ currentValue: propertyValueText(change.from),
36
+ suggestedValue: propertyValueText(change.to)
37
+ }));
38
+ }
@@ -0,0 +1,73 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { formatLocation, LocationParts } from '../Context/formatLocation.js';
5
+
6
+ /**
7
+ * Gets what identifies a slice location.
8
+ * @param location The location.
9
+ * @returns A key that is the same for the same location.
10
+ */
11
+ export function sliceKey(location: LocationParts): string {
12
+ return `${location.module}/${location.feature}/${location.slice}`;
13
+ }
14
+
15
+ /**
16
+ * Removes the slices that repeat an earlier one, and the ones that are empty.
17
+ * @param locations The locations.
18
+ * @returns The distinct, non-empty locations in their order.
19
+ */
20
+ export function distinctSlices<TLocation extends LocationParts>(locations: readonly TLocation[]): TLocation[] {
21
+ const seen = new Set<string>();
22
+ return locations.filter(location => {
23
+ const key = sliceKey(location);
24
+ if (key === '//' || seen.has(key)) {
25
+ return false;
26
+ }
27
+
28
+ seen.add(key);
29
+ return true;
30
+ });
31
+ }
32
+
33
+ /**
34
+ * Adds a slice to the chosen ones, or removes it when it is chosen already.
35
+ * @param chosen The chosen slices.
36
+ * @param location The slice to toggle.
37
+ * @returns The chosen slices after the toggle.
38
+ */
39
+ export function toggleSlice<TLocation extends LocationParts>(chosen: readonly TLocation[], location: TLocation): TLocation[] {
40
+ const key = sliceKey(location);
41
+ return chosen.some(slice => sliceKey(slice) === key)
42
+ ? chosen.filter(slice => sliceKey(slice) !== key)
43
+ : [...chosen, location];
44
+ }
45
+
46
+ /**
47
+ * Whether a slice is among the chosen ones.
48
+ * @param chosen The chosen slices.
49
+ * @param location The slice.
50
+ * @returns True when it is chosen.
51
+ */
52
+ export function isChosen(chosen: readonly LocationParts[], location: LocationParts): boolean {
53
+ const key = sliceKey(location);
54
+ return chosen.some(slice => sliceKey(slice) === key);
55
+ }
56
+
57
+ /**
58
+ * Searches the slices the host knows about.
59
+ * @param known Every slice the host knows about.
60
+ * @param query What the user typed; every word has to be part of the module, feature or slice.
61
+ * @returns The distinct slices that match; none for an empty query.
62
+ */
63
+ export function searchSlices<TLocation extends LocationParts>(known: readonly TLocation[], query: string): TLocation[] {
64
+ const words = query.toLowerCase().split(/\s+/).filter(word => word.length > 0);
65
+ if (words.length === 0) {
66
+ return [];
67
+ }
68
+
69
+ return distinctSlices(known).filter(location => {
70
+ const text = formatLocation(location, ' ', '').toLowerCase();
71
+ return words.every(word => text.includes(word));
72
+ });
73
+ }
package/Icons.tsx ADDED
@@ -0,0 +1,29 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ /**
5
+ * The speech bubble icon of the feedback button. Decorative: the button carries the accessible name.
6
+ */
7
+ export const FeedbackIcon = () => (
8
+ <svg className='notes-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>
9
+ <path fill='currentColor' d='M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 14H5.17L4 17.17V4h16v12z' />
10
+ </svg>
11
+ );
12
+
13
+ /**
14
+ * The chevron of the drop-down toggle. Decorative: the toggle carries the accessible name.
15
+ */
16
+ export const ChevronIcon = () => (
17
+ <svg className='notes-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>
18
+ <path fill='currentColor' d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z' />
19
+ </svg>
20
+ );
21
+
22
+ /**
23
+ * The close icon of a chosen slice's remove button. Decorative: the button carries the accessible name.
24
+ */
25
+ export const CloseIcon = () => (
26
+ <svg className='notes-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>
27
+ <path fill='currentColor' d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z' />
28
+ </svg>
29
+ );
@@ -0,0 +1,185 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ /**
5
+ * Every text the Notes components show or announce. Placeholders in braces, such as `{count}`, are filled in by the
6
+ * components.
7
+ */
8
+ export interface NotesLabels {
9
+ /** Texts shared by several components. */
10
+ common: {
11
+ /** The cancel button. */
12
+ cancel: string;
13
+ /** The accessible name of a dialog's close button. */
14
+ close: string;
15
+ /** Separates the module, feature and slice of a location. */
16
+ locationSeparator: string;
17
+ /** Shown when nothing is known about where the user is. */
18
+ unknownLocation: string;
19
+ /** Introduces what the note is about. */
20
+ aboutHeading: string;
21
+ };
22
+
23
+ /** The feedback button and its drop-down. */
24
+ button: {
25
+ /** The text, tooltip and accessible name of the main action. */
26
+ giveFeedback: string;
27
+ /** The accessible name of the drop-down toggle. */
28
+ moreOptions: string;
29
+ /** The drop-down item that gives feedback on specific slices. */
30
+ aboutSlices: string;
31
+ /** The drop-down item that gives feedback on the screen. */
32
+ aboutScreen: string;
33
+ /** The drop-down item that points at a component. */
34
+ pointAtSomething: string;
35
+ /** The drop-down item that opens the user's own feedback. */
36
+ myFeedback: string;
37
+ };
38
+
39
+ /** What the feedback dialogs say about where the user is. */
40
+ context: {
41
+ /** The sentence for a location, a screen and no dialog. `{location}` and `{screen}` are filled in. */
42
+ onScreen: string;
43
+ /** The sentence for a location with no screen. `{location}` is filled in. */
44
+ atLocation: string;
45
+ /** The sentence for a dialog. `{location}`, `{dialog}` and `{screen}` are filled in. */
46
+ inDialog: string;
47
+ /** The sentence for a screen only. `{screen}` is filled in. */
48
+ screenOnly: string;
49
+ };
50
+
51
+ /** The kinds of feedback. */
52
+ kinds: {
53
+ /** The label of the kind field. */
54
+ title: string;
55
+ /** A problem. */
56
+ problem: string;
57
+ /** A suggestion. */
58
+ suggestion: string;
59
+ /** A question. */
60
+ question: string;
61
+ /** Praise. */
62
+ praise: string;
63
+ };
64
+
65
+ /** The dialog that gives feedback on what is on screen, or on the screen. */
66
+ feedback: {
67
+ /** The title when giving feedback on what is on screen. */
68
+ contextTitle: string;
69
+ /** The title when giving feedback on the screen. */
70
+ screenTitle: string;
71
+ /** The send button. */
72
+ send: string;
73
+ /** The label of the text field. */
74
+ text: string;
75
+ /** Confirms that the feedback was sent. */
76
+ sent: string;
77
+ };
78
+
79
+ /** The dialog that gives feedback on specific slices. */
80
+ slices: {
81
+ /** The title. */
82
+ title: string;
83
+ /** The label of the list of slices active on the screen. */
84
+ active: string;
85
+ /** The label of the search over all the slices. */
86
+ search: string;
87
+ /** The placeholder of the search. */
88
+ searchPlaceholder: string;
89
+ /** The heading of the search results. */
90
+ results: string;
91
+ /** Shown when nothing matches the search. */
92
+ noMatches: string;
93
+ /** Shown when no slice is active on the screen. */
94
+ noneActive: string;
95
+ /** How many slices are chosen. `{count}` is the number. */
96
+ chosen: string;
97
+ /** The accessible name of a chosen slice's remove button. `{slice}` is the slice. */
98
+ remove: string;
99
+ };
100
+
101
+ /** The dialog that gives feedback on a picked component. */
102
+ component: {
103
+ /** The title. */
104
+ title: string;
105
+ /** What the dialog is about. `{component}` is the component. */
106
+ about: string;
107
+ /** The mode that describes the component with text. */
108
+ describe: string;
109
+ /** The mode that changes the component's properties. */
110
+ change: string;
111
+ /** The accessible name of the mode switch. */
112
+ mode: string;
113
+ /** Shown when the component has no properties to change. */
114
+ nothingToChange: string;
115
+ /** Tells that the changes are only a preview until closed. */
116
+ previewNotice: string;
117
+ /** The send button of the change mode. */
118
+ sendChanges: string;
119
+ /** Shown when no property differs. */
120
+ noChanges: string;
121
+ /** Shown when some changes could not be sent. `{count}` is the number. */
122
+ failed: string;
123
+ };
124
+
125
+ /** The pointing at a component. */
126
+ picker: {
127
+ /** Announced when pointing starts. */
128
+ started: string;
129
+ };
130
+
131
+ /** The user's own feedback. */
132
+ myFeedback: {
133
+ /** The title. */
134
+ title: string;
135
+ /** The description under the title. */
136
+ description: string;
137
+ /** Shown when the user gave no feedback. */
138
+ empty: string;
139
+ /** The withdraw button. */
140
+ withdraw: string;
141
+ /** The accessible name of the withdraw button. `{text}` is the start of the note. */
142
+ withdrawNote: string;
143
+ /** The text of a note that only suggests property changes. */
144
+ suggestionsOnly: string;
145
+ /** What a note is about, by target. */
146
+ targets: {
147
+ /** Feedback on what was on screen. */
148
+ context: string;
149
+ /** Feedback on slices. */
150
+ slices: string;
151
+ /** Feedback on a screen. */
152
+ screen: string;
153
+ /** Feedback on a component. `{component}` is the component. */
154
+ component: string;
155
+ };
156
+ /** The status of a note. */
157
+ statuses: {
158
+ /** Given. */
159
+ given: string;
160
+ /** Acknowledged. */
161
+ acknowledged: string;
162
+ /** Addressed, with the version. `{version}` is the version. */
163
+ addressed: string;
164
+ /** Declined, with the reason. `{reason}` is the reason. */
165
+ declined: string;
166
+ /** Withdrawn. */
167
+ withdrawn: string;
168
+ };
169
+ /** The suggested property changes. `{count}` is the number. */
170
+ propertyChanges: string;
171
+ };
172
+ }
173
+
174
+ /**
175
+ * Makes every property of a type optional, all the way down.
176
+ */
177
+ export type DeepPartial<T> = {
178
+ [TKey in keyof T]?: T[TKey] extends object ? DeepPartial<T[TKey]> : T[TKey];
179
+ };
180
+
181
+ /**
182
+ * The labels of the Notes components that a solution replaces, for instance to localize them. Labels left out keep
183
+ * their English defaults.
184
+ */
185
+ export type NotesLabelOverrides = DeepPartial<NotesLabels>;