@k2b/ui 0.18.0 → 0.20.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 (204) hide show
  1. package/README.md +3 -2
  2. package/dist/browser/actions/ContextMenu.js +3 -1
  3. package/dist/browser/actions/ContextMenu.js.map +1 -1
  4. package/dist/browser/actions/Dropdown.js +91 -46
  5. package/dist/browser/actions/Dropdown.js.map +1 -1
  6. package/dist/browser/actions/FilterChip.js +4 -1
  7. package/dist/browser/actions/FilterChip.js.map +1 -1
  8. package/dist/browser/actions/GestureMenu.js +467 -0
  9. package/dist/browser/actions/GestureMenu.js.map +1 -0
  10. package/dist/browser/actions/index.js +1 -0
  11. package/dist/browser/actions/index.js.map +1 -1
  12. package/dist/browser/chat/ChatComposer.js +1255 -534
  13. package/dist/browser/chat/ChatComposer.js.map +1 -1
  14. package/dist/browser/chat/ChatPrimitives.js +9 -3
  15. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  16. package/dist/browser/chat/ChatTimeline.js +19 -1
  17. package/dist/browser/chat/ChatTimeline.js.map +1 -1
  18. package/dist/browser/chat/chat-behavior.js +9 -0
  19. package/dist/browser/chat/chat-behavior.js.map +1 -1
  20. package/dist/browser/chat/index.js.map +1 -1
  21. package/dist/browser/chat/types.js.map +1 -1
  22. package/dist/browser/content/Calendar.js +579 -533
  23. package/dist/browser/content/Calendar.js.map +1 -1
  24. package/dist/browser/content/Lightbox.js +76 -40
  25. package/dist/browser/content/Lightbox.js.map +1 -1
  26. package/dist/browser/content/MessageRow.js +2 -2
  27. package/dist/browser/content/MessageRow.js.map +1 -1
  28. package/dist/browser/content/PdfPreview.js +146 -79
  29. package/dist/browser/content/PdfPreview.js.map +1 -1
  30. package/dist/browser/content/Timeline.js +1038 -0
  31. package/dist/browser/content/Timeline.js.map +1 -0
  32. package/dist/browser/content/VideoPlayer.js +29 -9
  33. package/dist/browser/content/VideoPlayer.js.map +1 -1
  34. package/dist/browser/content/chart-inspection.js +7 -2
  35. package/dist/browser/content/chart-inspection.js.map +1 -1
  36. package/dist/browser/content/index.js +1 -0
  37. package/dist/browser/content/index.js.map +1 -1
  38. package/dist/browser/content/timeline-model.js +579 -0
  39. package/dist/browser/content/timeline-model.js.map +1 -0
  40. package/dist/browser/feedback/dialog-core.js +26 -14
  41. package/dist/browser/feedback/dialog-core.js.map +1 -1
  42. package/dist/browser/inputs/ChoiceChips.js +66 -0
  43. package/dist/browser/inputs/ChoiceChips.js.map +1 -0
  44. package/dist/browser/inputs/ChoiceGroups.js +53 -12
  45. package/dist/browser/inputs/ChoiceGroups.js.map +1 -1
  46. package/dist/browser/inputs/FileInputs.js +48 -33
  47. package/dist/browser/inputs/FileInputs.js.map +1 -1
  48. package/dist/browser/inputs/SignatureInput.js +558 -0
  49. package/dist/browser/inputs/SignatureInput.js.map +1 -0
  50. package/dist/browser/inputs/TextInput.js +13 -1
  51. package/dist/browser/inputs/TextInput.js.map +1 -1
  52. package/dist/browser/inputs/emoji/EmojiPicker.js +841 -0
  53. package/dist/browser/inputs/emoji/EmojiPicker.js.map +1 -0
  54. package/dist/browser/inputs/emoji/emoji-data.js +1903 -0
  55. package/dist/browser/inputs/emoji/emoji-data.js.map +1 -0
  56. package/dist/browser/inputs/emoji/emoji-index.js +209 -0
  57. package/dist/browser/inputs/emoji/emoji-index.js.map +1 -0
  58. package/dist/browser/inputs/emoji/emoji-messages.js +64 -0
  59. package/dist/browser/inputs/emoji/emoji-messages.js.map +1 -0
  60. package/dist/browser/inputs/index.js +5 -0
  61. package/dist/browser/inputs/index.js.map +1 -1
  62. package/dist/browser/inputs/markdown/actions.js +6 -2
  63. package/dist/browser/inputs/markdown/actions.js.map +1 -1
  64. package/dist/browser/inputs/markdown/code-zone.js +38 -2
  65. package/dist/browser/inputs/markdown/code-zone.js.map +1 -1
  66. package/dist/browser/inputs/signature-messages.js +39 -0
  67. package/dist/browser/inputs/signature-messages.js.map +1 -0
  68. package/dist/browser/inputs/signature.js +208 -0
  69. package/dist/browser/inputs/signature.js.map +1 -0
  70. package/dist/browser/internal/render-error.js +49 -0
  71. package/dist/browser/internal/render-error.js.map +1 -0
  72. package/dist/browser/intl/messages.js +102 -0
  73. package/dist/browser/intl/messages.js.map +1 -1
  74. package/dist/browser/layout/AppWorkspace.js +321 -222
  75. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  76. package/dist/browser/layout/FloatingWindow.js +4 -1
  77. package/dist/browser/layout/FloatingWindow.js.map +1 -1
  78. package/dist/browser/layout/SidebarItemPreview.js +5 -1
  79. package/dist/browser/layout/SidebarItemPreview.js.map +1 -1
  80. package/dist/browser/layout/index.js.map +1 -1
  81. package/dist/browser/surfaces/ResourceCard.js +212 -0
  82. package/dist/browser/surfaces/ResourceCard.js.map +1 -0
  83. package/dist/browser/surfaces/index.js +1 -0
  84. package/dist/browser/surfaces/index.js.map +1 -1
  85. package/dist/licenses/emojibase-data.txt +21 -0
  86. package/dist/ssr/actions/ContextMenu.js +3 -1
  87. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  88. package/dist/ssr/actions/Dropdown.js +49 -12
  89. package/dist/ssr/actions/Dropdown.js.map +1 -1
  90. package/dist/ssr/actions/FilterChip.js +4 -1
  91. package/dist/ssr/actions/FilterChip.js.map +1 -1
  92. package/dist/ssr/actions/GestureMenu.js +411 -0
  93. package/dist/ssr/actions/GestureMenu.js.map +1 -0
  94. package/dist/ssr/actions/index.js +1 -0
  95. package/dist/ssr/actions/index.js.map +1 -1
  96. package/dist/ssr/chat/ChatComposer.js +767 -214
  97. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  98. package/dist/ssr/chat/ChatPrimitives.js +9 -3
  99. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  100. package/dist/ssr/chat/ChatTimeline.js +19 -1
  101. package/dist/ssr/chat/ChatTimeline.js.map +1 -1
  102. package/dist/ssr/chat/chat-behavior.js +9 -0
  103. package/dist/ssr/chat/chat-behavior.js.map +1 -1
  104. package/dist/ssr/chat/index.js.map +1 -1
  105. package/dist/ssr/chat/types.js.map +1 -1
  106. package/dist/ssr/content/Calendar.js +183 -142
  107. package/dist/ssr/content/Calendar.js.map +1 -1
  108. package/dist/ssr/content/Lightbox.js +19 -5
  109. package/dist/ssr/content/Lightbox.js.map +1 -1
  110. package/dist/ssr/content/MessageRow.js +2 -2
  111. package/dist/ssr/content/MessageRow.js.map +1 -1
  112. package/dist/ssr/content/PdfPreview.js +77 -36
  113. package/dist/ssr/content/PdfPreview.js.map +1 -1
  114. package/dist/ssr/content/Timeline.js +804 -0
  115. package/dist/ssr/content/Timeline.js.map +1 -0
  116. package/dist/ssr/content/VideoPlayer.js +29 -9
  117. package/dist/ssr/content/VideoPlayer.js.map +1 -1
  118. package/dist/ssr/content/chart-inspection.js +7 -2
  119. package/dist/ssr/content/chart-inspection.js.map +1 -1
  120. package/dist/ssr/content/index.js +1 -0
  121. package/dist/ssr/content/index.js.map +1 -1
  122. package/dist/ssr/content/timeline-model.js +579 -0
  123. package/dist/ssr/content/timeline-model.js.map +1 -0
  124. package/dist/ssr/feedback/dialog-core.js +26 -14
  125. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  126. package/dist/ssr/inputs/ChoiceChips.js +66 -0
  127. package/dist/ssr/inputs/ChoiceChips.js.map +1 -0
  128. package/dist/ssr/inputs/ChoiceGroups.js +12 -4
  129. package/dist/ssr/inputs/ChoiceGroups.js.map +1 -1
  130. package/dist/ssr/inputs/FileInputs.js +19 -4
  131. package/dist/ssr/inputs/FileInputs.js.map +1 -1
  132. package/dist/ssr/inputs/SignatureInput.js +404 -0
  133. package/dist/ssr/inputs/SignatureInput.js.map +1 -0
  134. package/dist/ssr/inputs/TextInput.js +13 -1
  135. package/dist/ssr/inputs/TextInput.js.map +1 -1
  136. package/dist/ssr/inputs/emoji/EmojiPicker.js +551 -0
  137. package/dist/ssr/inputs/emoji/EmojiPicker.js.map +1 -0
  138. package/dist/ssr/inputs/emoji/emoji-data.js +1903 -0
  139. package/dist/ssr/inputs/emoji/emoji-data.js.map +1 -0
  140. package/dist/ssr/inputs/emoji/emoji-index.js +209 -0
  141. package/dist/ssr/inputs/emoji/emoji-index.js.map +1 -0
  142. package/dist/ssr/inputs/emoji/emoji-messages.js +64 -0
  143. package/dist/ssr/inputs/emoji/emoji-messages.js.map +1 -0
  144. package/dist/ssr/inputs/index.js +5 -0
  145. package/dist/ssr/inputs/index.js.map +1 -1
  146. package/dist/ssr/inputs/markdown/actions.js +6 -2
  147. package/dist/ssr/inputs/markdown/actions.js.map +1 -1
  148. package/dist/ssr/inputs/markdown/code-zone.js +38 -2
  149. package/dist/ssr/inputs/markdown/code-zone.js.map +1 -1
  150. package/dist/ssr/inputs/signature-messages.js +39 -0
  151. package/dist/ssr/inputs/signature-messages.js.map +1 -0
  152. package/dist/ssr/inputs/signature.js +208 -0
  153. package/dist/ssr/inputs/signature.js.map +1 -0
  154. package/dist/ssr/internal/render-error.js +49 -0
  155. package/dist/ssr/internal/render-error.js.map +1 -0
  156. package/dist/ssr/intl/messages.js +102 -0
  157. package/dist/ssr/intl/messages.js.map +1 -1
  158. package/dist/ssr/layout/AppWorkspace.js +112 -41
  159. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  160. package/dist/ssr/layout/FloatingWindow.js +4 -1
  161. package/dist/ssr/layout/FloatingWindow.js.map +1 -1
  162. package/dist/ssr/layout/SidebarItemPreview.js +5 -1
  163. package/dist/ssr/layout/SidebarItemPreview.js.map +1 -1
  164. package/dist/ssr/layout/index.js.map +1 -1
  165. package/dist/ssr/surfaces/ResourceCard.js +115 -0
  166. package/dist/ssr/surfaces/ResourceCard.js.map +1 -0
  167. package/dist/ssr/surfaces/index.js +1 -0
  168. package/dist/ssr/surfaces/index.js.map +1 -1
  169. package/dist/styles.css +1 -1
  170. package/dist/types/actions/Dropdown.d.ts +13 -1
  171. package/dist/types/actions/FilterChip.d.ts +5 -0
  172. package/dist/types/actions/GestureMenu.d.ts +35 -0
  173. package/dist/types/actions/index.d.ts +2 -0
  174. package/dist/types/chat/ChatComposer.d.ts +27 -1
  175. package/dist/types/chat/chat-behavior.d.ts +15 -0
  176. package/dist/types/chat/index.d.ts +1 -1
  177. package/dist/types/chat/types.d.ts +34 -0
  178. package/dist/types/content/Calendar.d.ts +28 -8
  179. package/dist/types/content/Lightbox.d.ts +8 -0
  180. package/dist/types/content/Timeline.d.ts +49 -0
  181. package/dist/types/content/index.d.ts +4 -2
  182. package/dist/types/content/timeline-model.d.ts +148 -0
  183. package/dist/types/feedback/dialog-core.d.ts +1 -1
  184. package/dist/types/inputs/ChoiceChips.d.ts +20 -0
  185. package/dist/types/inputs/ChoiceGroups.d.ts +11 -2
  186. package/dist/types/inputs/FileInputs.d.ts +6 -0
  187. package/dist/types/inputs/SignatureInput.d.ts +22 -0
  188. package/dist/types/inputs/emoji/EmojiPicker.d.ts +42 -0
  189. package/dist/types/inputs/emoji/emoji-data.d.ts +2 -0
  190. package/dist/types/inputs/emoji/emoji-index.d.ts +109 -0
  191. package/dist/types/inputs/emoji/emoji-messages.d.ts +30 -0
  192. package/dist/types/inputs/index.d.ts +10 -0
  193. package/dist/types/inputs/markdown/actions.d.ts +2 -0
  194. package/dist/types/inputs/markdown/code-zone.d.ts +7 -0
  195. package/dist/types/inputs/signature-messages.d.ts +11 -0
  196. package/dist/types/inputs/signature.d.ts +72 -0
  197. package/dist/types/internal/render-error.d.ts +13 -0
  198. package/dist/types/intl/messages.d.ts +51 -0
  199. package/dist/types/layout/AppWorkspace.d.ts +17 -0
  200. package/dist/types/layout/SidebarItemPreview.d.ts +2 -0
  201. package/dist/types/layout/index.d.ts +1 -1
  202. package/dist/types/surfaces/ResourceCard.d.ts +31 -0
  203. package/dist/types/surfaces/index.d.ts +2 -0
  204. package/package.json +6 -5
@@ -0,0 +1,109 @@
1
+ /**
2
+ * The emoji dataset behind `EmojiPicker` and the composer's `:shortcode` completion. The data (about 80 kB compressed)
3
+ * loads on first use, so a page that never opens either does not download it.
4
+ */
5
+ /** `0` is the default yellow; `1` (light) to `5` (dark) are the Fitzpatrick modifiers. */
6
+ export type EmojiSkinTone = 0 | 1 | 2 | 3 | 4 | 5;
7
+ export declare const EMOJI_SKIN_TONES: readonly EmojiSkinTone[];
8
+ /** The groups in their order. Emojibase numbers them 0 to 9; 2 holds skin-tone parts and never appears. */
9
+ export declare const EMOJI_GROUPS: readonly [{
10
+ readonly id: 0;
11
+ readonly key: "smileys";
12
+ readonly icon: "ti ti-mood-smile";
13
+ }, {
14
+ readonly id: 1;
15
+ readonly key: "people";
16
+ readonly icon: "ti ti-hand-stop";
17
+ }, {
18
+ readonly id: 3;
19
+ readonly key: "animals";
20
+ readonly icon: "ti ti-paw";
21
+ }, {
22
+ readonly id: 4;
23
+ readonly key: "food";
24
+ readonly icon: "ti ti-tools-kitchen-2";
25
+ }, {
26
+ readonly id: 5;
27
+ readonly key: "travel";
28
+ readonly icon: "ti ti-plane";
29
+ }, {
30
+ readonly id: 6;
31
+ readonly key: "activities";
32
+ readonly icon: "ti ti-ball-football";
33
+ }, {
34
+ readonly id: 7;
35
+ readonly key: "objects";
36
+ readonly icon: "ti ti-bulb";
37
+ }, {
38
+ readonly id: 8;
39
+ readonly key: "symbols";
40
+ readonly icon: "ti ti-heart";
41
+ }, {
42
+ readonly id: 9;
43
+ readonly key: "flags";
44
+ readonly icon: "ti ti-flag";
45
+ }];
46
+ export type EmojiGroupKey = (typeof EMOJI_GROUPS)[number]["key"];
47
+ export type EmojiEntry = {
48
+ emoji: string;
49
+ group: number;
50
+ /** The light variant; the other tones swap its modifier. Absent for emoji without skin tones. */
51
+ light?: string;
52
+ name: {
53
+ en: string;
54
+ de: string;
55
+ };
56
+ shortcodes: readonly string[];
57
+ /** Normalized names, keywords and shortcodes for search. */
58
+ search: {
59
+ names: readonly string[];
60
+ keywords: readonly string[];
61
+ shortcodes: readonly string[];
62
+ words: readonly string[];
63
+ };
64
+ };
65
+ export type EmojiIndex = {
66
+ entries: readonly EmojiEntry[];
67
+ /** Every emoji and skin-tone variant, without presentation selectors, to its entry. Look up with `findEmoji`. */
68
+ byEmoji: ReadonlyMap<string, EmojiEntry>;
69
+ byShortcode: ReadonlyMap<string, EmojiEntry>;
70
+ };
71
+ /** Lower case without accents, so "lacheln", "laecheln" and "Lächeln" meet; `_` and `-` separate words. */
72
+ export declare const normalizeEmojiQuery: (value: string) => string;
73
+ export declare const parseEmojiData: (data: string) => EmojiIndex;
74
+ /** Loads and indexes the dataset once. A failed load is retried on the next call. */
75
+ export declare const loadEmojiIndex: () => Promise<EmojiIndex>;
76
+ /** The entry of an emoji in any skin tone, with or without presentation selectors. */
77
+ export declare const findEmoji: (index: EmojiIndex, emoji: string) => EmojiEntry | undefined;
78
+ /** The emoji in `tone`; emoji without skin tones stay as they are. */
79
+ export declare const emojiInTone: (entry: EmojiEntry, tone: EmojiSkinTone) => string;
80
+ /** The name in the render language: German for `de` locales, English otherwise. */
81
+ export declare const emojiName: (entry: EmojiEntry, locale: string) => string;
82
+ /** Matches in English and German names, keywords and shortcodes, best first and otherwise in Unicode order. */
83
+ export declare const searchEmoji: (index: EmojiIndex, query: string, limit?: number) => EmojiEntry[];
84
+ /**
85
+ * The suggestions for a `:shortcode` being typed. Only the start of a shortcode, name, word or keyword counts, and a
86
+ * leading sign must start a shortcode, as in `:+1` and `:-1`: emoticons such as `:DD`, `:-D` or `:-P` find nothing,
87
+ * so Enter still sends them.
88
+ */
89
+ export declare const suggestEmoji: (index: EmojiIndex, query: string, limit: number) => EmojiEntry[];
90
+ /** As many recent emoji as the picker shows: three rows. */
91
+ export declare const RECENT_EMOJI_LIMIT = 24;
92
+ /** The recent list after `emoji` was used: it moves to the front, once, and the oldest drop off. */
93
+ export declare const rememberEmoji: (recent: readonly string[], emoji: string) => string[];
94
+ export type EmojiShortcodeQuery = {
95
+ start: number;
96
+ end: number;
97
+ query: string;
98
+ };
99
+ /**
100
+ * The `:shortcode` being typed at the caret: a colon at the start or after a space or "(", then at least two letters,
101
+ * digits, "_", "+" or "-". Code, URLs ("https://") and times ("10:30") are no queries.
102
+ */
103
+ export declare const emojiShortcodeQuery: (text: string, caret: number, selectionEnd?: number) => EmojiShortcodeQuery | null;
104
+ /** A complete `:shortcode:` just typed at the caret, such as `:thumbsup:`, with its range. */
105
+ export declare const completedEmojiShortcode: (text: string, caret: number) => {
106
+ start: number;
107
+ end: number;
108
+ shortcode: string;
109
+ } | null;
@@ -0,0 +1,30 @@
1
+ /** The picker's own strings. They live with the picker, so pages without it do not carry them. */
2
+ declare const emojiMessages: import("@k2b/stdlib").Catalog<{
3
+ emojiPicker: string;
4
+ emojiSearch: string;
5
+ emojiGroups: string;
6
+ emojiRecent: string;
7
+ emojiSmileys: string;
8
+ emojiPeople: string;
9
+ emojiAnimals: string;
10
+ emojiFood: string;
11
+ emojiTravel: string;
12
+ emojiActivities: string;
13
+ emojiObjects: string;
14
+ emojiSymbols: string;
15
+ emojiFlags: string;
16
+ emojiSkinTone: string;
17
+ emojiToneDefault: string;
18
+ emojiToneLight: string;
19
+ emojiToneMediumLight: string;
20
+ emojiToneMedium: string;
21
+ emojiToneMediumDark: string;
22
+ emojiToneDark: string;
23
+ emojiNoResults: string;
24
+ emojiLoadFailed: string;
25
+ }>;
26
+ export type EmojiMessages = ReturnType<(typeof emojiMessages)["resolve"]>["t"];
27
+ /** Resolved from the inherited render locale, like the rest of @k2b/ui. */
28
+ export declare const useEmojiMessages: () => (() => EmojiMessages);
29
+ export declare const checkEmojiMessages: () => import("@k2b/stdlib").CatalogIssue[];
30
+ export {};
@@ -6,6 +6,8 @@ export type { CheckboxProps } from "./Checkbox";
6
6
  export { Checkbox } from "./Checkbox";
7
7
  export type { CheckboxCardProps } from "./CheckboxCard";
8
8
  export { CheckboxCard } from "./CheckboxCard";
9
+ export type { ChoiceChipOption, ChoiceChipsProps } from "./ChoiceChips";
10
+ export { ChoiceChips } from "./ChoiceChips";
9
11
  export type { ColorInputProps, PinInputProps, SliderProps, } from "./ChoiceInputs";
10
12
  export { ColorInput, PinInput, Slider } from "./ChoiceInputs";
11
13
  export type { ComboboxOption, ComboboxProps } from "./Combobox";
@@ -15,6 +17,10 @@ export type { Completion, QueryContext, SuggestContext, Suggestion, } from "./co
15
17
  export { abbreviations } from "./completion";
16
18
  export type { DatePickerBaseProps, DatePickerProps, DatePreset, DateRangePickerProps, DateRangeValue, DateTimePickerProps, DurationPreset, } from "./DatePicker";
17
19
  export { DatePicker, DateRangePicker, DateTimePicker } from "./DatePicker";
20
+ export type { EmojiPickerPopoverProps, EmojiPickerProps } from "./emoji/EmojiPicker";
21
+ export { EmojiPicker } from "./emoji/EmojiPicker";
22
+ export type { EmojiSkinTone } from "./emoji/emoji-index";
23
+ export { rememberEmoji } from "./emoji/emoji-index";
18
24
  export type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTargetProps } from "./FileDropTarget";
19
25
  export { FileDropTarget, fileDropTarget } from "./FileDropTarget";
20
26
  export type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from "./FileInputs";
@@ -35,10 +41,14 @@ export type { ChoiceAppearance, SelectGridSize, SelectGroup, SelectOption, Selec
35
41
  export { Select } from "./Select";
36
42
  export type { SelectChipOption, SelectChipProps } from "./SelectChip";
37
43
  export { SelectChip } from "./SelectChip";
44
+ export type { SignatureInputProps } from "./SignatureInput";
45
+ export { SignatureInput } from "./SignatureInput";
38
46
  export type { IconInputProps, IconOption } from "./SpecialInputs";
39
47
  export { IconInput } from "./SpecialInputs";
40
48
  export type { SwitchProps } from "./Switch";
41
49
  export { Switch } from "./Switch";
50
+ export type { SignaturePngOptions, SignatureValue } from "./signature";
51
+ export { parseSignature, signatureToPng } from "./signature";
42
52
  export type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from "./TagEditor";
43
53
  export { TagEditor } from "./TagEditor";
44
54
  export type { TagsInputProps } from "./TagsInput";
@@ -1,6 +1,8 @@
1
1
  export declare const toggleBold: (textarea: HTMLTextAreaElement) => void;
2
2
  export declare const toggleItalic: (textarea: HTMLTextAreaElement) => void;
3
3
  export declare const toggleCode: (textarea: HTMLTextAreaElement) => void;
4
+ /** Wraps the selection in `marker`, or unwraps it; without a selection the caret lands between two markers. */
5
+ export declare const toggleInlineMarker: (textarea: HTMLTextAreaElement, marker: string) => void;
4
6
  export declare const insertLink: (textarea: HTMLTextAreaElement, url?: string) => void;
5
7
  export declare const toggleHeading: (textarea: HTMLTextAreaElement, level: 1 | 2 | 3) => void;
6
8
  export declare const toggleBulletList: (textarea: HTMLTextAreaElement) => void;
@@ -1 +1,8 @@
1
+ /** Whether `line` closes a block that `marker` opened: the same character, at least as many, nothing after it. */
2
+ export declare const closesCodeFence: (line: string, marker: string) => boolean;
3
+ /** The fenced code block that is still open at `position`, judged by the text before it: its opening line's start and marker. */
4
+ export declare const openCodeFence: (text: string, position: number) => {
5
+ start: number;
6
+ marker: string;
7
+ } | null;
1
8
  export declare const isInCodeZone: (text: string, position: number) => boolean;
@@ -0,0 +1,11 @@
1
+ export declare const useSignatureMessages: () => () => {
2
+ method: string;
3
+ draw: string;
4
+ type: string;
5
+ signHere: string;
6
+ drawArea: string;
7
+ drawn: string;
8
+ typeName: string;
9
+ undo: string;
10
+ };
11
+ export declare const checkSignatureMessages: () => import("@k2b/stdlib").CatalogIssue[];
@@ -0,0 +1,72 @@
1
+ /**
2
+ * A signature as the field reports it. `kind` records how it was given, so the
3
+ * application can keep that fact next to the image. `svg` is a standalone SVG
4
+ * document whose ink uses `currentColor`, so it renders black as an image. A
5
+ * value that arrives from a browser is untrusted input: read it with
6
+ * `parseSignature` before storing or embedding it.
7
+ */
8
+ export type SignatureValue = {
9
+ kind: "drawn";
10
+ svg: string;
11
+ } | {
12
+ kind: "typed";
13
+ name: string;
14
+ svg: string;
15
+ };
16
+ /** One sampled pointer position in drawing units, with a pressure from 0 to 1. */
17
+ export type SignaturePoint = {
18
+ x: number;
19
+ y: number;
20
+ pressure: number;
21
+ };
22
+ /** The drawing space as an SVG viewBox and one closed outline path per stroke. */
23
+ export type SignatureDrawing = {
24
+ x: number;
25
+ y: number;
26
+ width: number;
27
+ height: number;
28
+ strokes: readonly string[];
29
+ };
30
+ /** Escapes text for XML content or attributes and drops characters XML cannot hold, so the document stays well-formed. */
31
+ export declare const escapeXml: (text: string) => string;
32
+ /** The name as a typed signature stores it: without characters an SVG cannot hold and without surrounding space. */
33
+ export declare const signatureName: (name: string) => string;
34
+ /** Stroke width in drawing units at a pressure: light pressure still leaves a readable line. */
35
+ export declare const strokeWidth: (size: number, pressure: number) => number;
36
+ /**
37
+ * Turns sampled points into one filled outline: both edges follow the points at
38
+ * half the local stroke width and are smoothed through their midpoints, and
39
+ * round caps close the ends. A filled outline, unlike a stroked path, can change
40
+ * width along the line, so pen pressure and drawing speed show in the ink.
41
+ */
42
+ export declare const strokeOutline: (points: readonly SignaturePoint[], size: number) => string;
43
+ /** Serializes a drawing as a standalone SVG document; an empty drawing has no value. */
44
+ export declare const drawingToSvg: (drawing: SignatureDrawing) => string | null;
45
+ /** Reads the drawing space and strokes back from an SVG drawingToSvg wrote, so a stored signature can be extended or undone. */
46
+ export declare const svgToDrawing: (svg: string) => SignatureDrawing | null;
47
+ /**
48
+ * Lays out a typed name as an SVG document in the given font family. `measure`
49
+ * returns the text width at `TYPED_FONT_SIZE`; without one, the width is estimated.
50
+ */
51
+ export declare const typedToSvg: (name: string, fontFamily: string, measure?: (text: string, font: string) => number | undefined) => string;
52
+ /**
53
+ * Reads a submitted signature on the server: the JSON string of the field's
54
+ * hidden input, or a value the browser sent as JSON. It accepts only markup
55
+ * the field writes and returns it rebuilt, so the result is safe to store and
56
+ * to embed. An empty or invalid value returns `null`.
57
+ */
58
+ export declare const parseSignature: (input: unknown) => SignatureValue | null;
59
+ export type SignaturePngOptions = {
60
+ /** Device pixels per SVG unit. Defaults to `2`. */
61
+ scale?: number;
62
+ /** Ink colour. Defaults to `"#000000"`. */
63
+ color?: string;
64
+ /** Background fill. Defaults to transparent. */
65
+ background?: string;
66
+ };
67
+ /**
68
+ * Rasterizes a signature into a PNG data URL in the browser, for a document or
69
+ * service that needs a bitmap. A typed signature renders with the fonts
70
+ * installed on this device: an SVG image cannot use the page's web fonts.
71
+ */
72
+ export declare const signatureToPng: (value: SignatureValue, options?: SignaturePngOptions) => Promise<string>;
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "solid-js";
2
+ /**
3
+ * Guards a Solid root that @k2b/ui creates itself, such as a dialog or a floating window. These roots are mostly
4
+ * opened from a click handler, outside any owner and any island boundary. Without a boundary of their own, content
5
+ * that throws on an update throws into the code that wrote the signal and leaves other parts of the page stale.
6
+ * The content is created untracked, as `render()` and components create it, so a signal it reads directly does not
7
+ * rebuild it. `onClose` adds a Close button for a root whose content draws its own close control.
8
+ */
9
+ export declare function RenderErrorBoundary(props: {
10
+ content: () => JSX.Element;
11
+ onClose?: () => void;
12
+ onError?: () => void;
13
+ }): JSX.Element;
@@ -49,6 +49,7 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
49
49
  copy: string;
50
50
  closeLightbox: string;
51
51
  couldNotLoadData: string;
52
+ couldNotDisplayContent: string;
52
53
  datePicker: string;
53
54
  dataTable: string;
54
55
  datePresets: string;
@@ -195,6 +196,28 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
195
196
  start: string;
196
197
  end: string;
197
198
  }) => string;
199
+ timeline: string;
200
+ timelineHint: string;
201
+ timelineTimeRange: ({ start, end }: {
202
+ start: string;
203
+ end: string;
204
+ }) => string;
205
+ timelineDone: string;
206
+ timelineOpen: string;
207
+ timelineNight: ({ start, end }: {
208
+ start: string;
209
+ end: string;
210
+ }) => string;
211
+ timelineNothingPlanned: string;
212
+ timelineFree: ({ duration }: {
213
+ duration: string;
214
+ }) => string;
215
+ timelineMore: ({ count }: {
216
+ count: number;
217
+ }) => string;
218
+ timelineNow: ({ time }: {
219
+ time: string;
220
+ }) => string;
198
221
  today: string;
199
222
  day: string;
200
223
  week: string;
@@ -258,6 +281,10 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
258
281
  time: string;
259
282
  }) => string;
260
283
  messageStop: string;
284
+ resourceUntitled: string;
285
+ resourceNoAccess: string;
286
+ resourceDeleted: string;
287
+ resourceUnavailable: string;
261
288
  conversationMessages: ({ label }: {
262
289
  label: string;
263
290
  }) => string;
@@ -371,6 +398,13 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
371
398
  label: string;
372
399
  }) => string;
373
400
  rowAction: string;
401
+ sidebarUnread: ({ count }: {
402
+ count: number;
403
+ }) => string;
404
+ sidebarUnreadMany: string;
405
+ sidebarNewActivity: string;
406
+ sidebarMentioned: string;
407
+ sidebarMuted: string;
374
408
  addToNamed: ({ name }: {
375
409
  name: string;
376
410
  }) => string;
@@ -407,6 +441,8 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
407
441
  status: number;
408
442
  }) => string;
409
443
  pdfPreviewTabBlocked: string;
444
+ pdfPreviewNoViewer: string;
445
+ pdfPreviewNoViewerDescription: string;
410
446
  pdfPreviewRendering: string;
411
447
  pickIcon: string;
412
448
  postMessage: string;
@@ -418,6 +454,21 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
418
454
  sending: string;
419
455
  steering: string;
420
456
  writeMessage: string;
457
+ writeConversationMessage: string;
458
+ composerFormatting: string;
459
+ insertEmoji: string;
460
+ emojiSuggestions: string;
461
+ dictate: string;
462
+ dictateOrHold: string;
463
+ stopDictation: string;
464
+ microphoneOptions: string;
465
+ recordVoiceMessage: string;
466
+ dictationListening: string;
467
+ dictationRefining: string;
468
+ dictationRefined: string;
469
+ dictationUnrefined: string;
470
+ dictationInterrupted: string;
471
+ restoreOriginal: string;
421
472
  openInNewTab: ({ name }: {
422
473
  name: string;
423
474
  }) => string;
@@ -228,6 +228,22 @@ export type AppWorkspaceSidebarItemActionsProps = {
228
228
  children: JSX.Element;
229
229
  visibility?: AppWorkspaceSidebarAccessoryVisibility;
230
230
  };
231
+ /**
232
+ * Unread state for the trailing `meta` slot. Every mark keeps a fixed width,
233
+ * so the row keeps its height and the label its start in every state.
234
+ */
235
+ export type AppWorkspaceSidebarItemStatusProps = {
236
+ /**
237
+ * A positive number shows a count (above 99 as "99+") and sets the label in
238
+ * a stronger weight; `true` shows a quiet dot for new activity that should
239
+ * not draw attention, such as in a muted conversation.
240
+ */
241
+ unread?: number | boolean;
242
+ /** Marks unread items that mention the person with "@". */
243
+ mention?: boolean;
244
+ /** Shows a muted bell. */
245
+ muted?: boolean;
246
+ };
231
247
  export type AppWorkspaceNavTreeProps = {
232
248
  children: JSX.Element;
233
249
  ariaLabel: string;
@@ -310,6 +326,7 @@ type AppWorkspaceComponent = ((props: AppWorkspaceProps) => JSX.Element) & {
310
326
  SidebarItemMeta: (props: AppWorkspaceSidebarItemMetaProps) => JSX.Element;
311
327
  SidebarItemAction: (props: AppWorkspaceSidebarItemActionProps) => JSX.Element;
312
328
  SidebarItemActions: (props: AppWorkspaceSidebarItemActionsProps) => JSX.Element;
329
+ SidebarItemStatus: (props: AppWorkspaceSidebarItemStatusProps) => JSX.Element;
313
330
  NavTree: AppWorkspaceNavTreeComponent;
314
331
  SidebarIconGrid: (props: AppWorkspaceSidebarIconGridProps) => JSX.Element;
315
332
  SidebarIconAction: (props: AppWorkspaceSidebarIconActionProps) => JSX.Element;
@@ -7,5 +7,7 @@ export declare function SidebarItemPreview(props: {
7
7
  trigger?: "action" | "row";
8
8
  align?: "center" | "end";
9
9
  viewportSize?: ScrollAreaProps["viewportSize"];
10
+ /** The row's metadata; a row trigger, named by `label`, keeps it as its description. */
11
+ describedBy?: string;
10
12
  onOpenChange?: (open: boolean) => void;
11
13
  }): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  export type { AppOverviewCardsProps, AppOverviewEmptyStateProps, AppOverviewPanelProps, AppOverviewProps, } from "./AppOverview";
2
2
  export { default as AppOverview } from "./AppOverview";
3
- export type { AppWorkspaceBottomDrawerHeight, AppWorkspaceBottomDrawerProps, AppWorkspaceContentProps, AppWorkspaceDetailProps, AppWorkspaceDetailWidth, AppWorkspaceMainPaneProps, AppWorkspaceMainProps, AppWorkspaceNavTreeItemProps, AppWorkspaceNavTreeMove, AppWorkspaceNavTreeProps, AppWorkspaceProps, AppWorkspaceSidebarAccessoryVisibility, AppWorkspaceSidebarBodyProps, AppWorkspaceSidebarIconActionProps, AppWorkspaceSidebarIconActionTone, AppWorkspaceSidebarIconGridProps, AppWorkspaceSidebarItemActionProps, AppWorkspaceSidebarItemActionsProps, AppWorkspaceSidebarItemIconProps, AppWorkspaceSidebarItemLabelProps, AppWorkspaceSidebarItemMetaProps, AppWorkspaceSidebarItemProps, AppWorkspaceSidebarItemTone, AppWorkspaceSidebarProps, AppWorkspaceSidebarSectionProps, AppWorkspaceSidebarVisibility, } from "./AppWorkspace";
3
+ export type { AppWorkspaceBottomDrawerHeight, AppWorkspaceBottomDrawerProps, AppWorkspaceContentProps, AppWorkspaceDetailProps, AppWorkspaceDetailWidth, AppWorkspaceMainPaneProps, AppWorkspaceMainProps, AppWorkspaceNavTreeItemProps, AppWorkspaceNavTreeMove, AppWorkspaceNavTreeProps, AppWorkspaceProps, AppWorkspaceSidebarAccessoryVisibility, AppWorkspaceSidebarBodyProps, AppWorkspaceSidebarIconActionProps, AppWorkspaceSidebarIconActionTone, AppWorkspaceSidebarIconGridProps, AppWorkspaceSidebarItemActionProps, AppWorkspaceSidebarItemActionsProps, AppWorkspaceSidebarItemIconProps, AppWorkspaceSidebarItemLabelProps, AppWorkspaceSidebarItemMetaProps, AppWorkspaceSidebarItemProps, AppWorkspaceSidebarItemStatusProps, AppWorkspaceSidebarItemTone, AppWorkspaceSidebarProps, AppWorkspaceSidebarSectionProps, AppWorkspaceSidebarVisibility, } from "./AppWorkspace";
4
4
  export { default as AppWorkspace } from "./AppWorkspace";
5
5
  export type { AppWorkspaceControllerOptions } from "./app-workspace-controller";
6
6
  export { installAppWorkspaceController } from "./app-workspace-controller";
@@ -0,0 +1,31 @@
1
+ import { type JSX } from "solid-js";
2
+ /**
3
+ * What a card can show of the element it stands for: the element itself, a placeholder while it is being looked up, or
4
+ * why it cannot be shown.
5
+ */
6
+ export type ResourceCardState = "ok" | "loading" | "no_access" | "deleted" | "unavailable";
7
+ export type ResourceCardProps = {
8
+ /** Defaults to `"ok"`. Every state has the same size, so a card that changes state moves nothing around it. */
9
+ state?: ResourceCardState;
10
+ /** The element's name. Shown only in state `"ok"`, as "Untitled" when blank, so a card that opens always has a name. */
11
+ title?: string;
12
+ /** Icon class of the element's kind, for example `ti ti-notebook`. Shown only in state `"ok"`. */
13
+ icon?: string;
14
+ /** What the element belongs to, for example the application or service. Shown only in state `"ok"`. */
15
+ source?: string;
16
+ /** Where the element lives within its source, for example a folder or a project. Shown only in state `"ok"`. */
17
+ location?: string;
18
+ /** One line of plain text from the element. Shown only in state `"ok"`. */
19
+ preview?: string;
20
+ /** Opens the element, for example in a panel. Takes precedence over `href`. Only in state `"ok"`. */
21
+ onOpen?: () => void;
22
+ /** Opens the element. Absolute `https` or `http`, or relative. Only in state `"ok"`. */
23
+ href?: string;
24
+ class?: string;
25
+ };
26
+ /**
27
+ * A card for an element that something refers to, such as a task or a document, with the same size in every state.
28
+ * Outside state `"ok"`, it shows none of the element's fields and opens nothing, whatever the caller passes.
29
+ */
30
+ export declare function ResourceCard(props: ResourceCardProps): JSX.Element;
31
+ export default ResourceCard;
@@ -16,6 +16,8 @@ export type { ProgressBarProps, ProgressBarTone } from "./ProgressBar";
16
16
  export { ProgressBar } from "./ProgressBar";
17
17
  export type { ProgressRingProps, ProgressRingTone } from "./ProgressRing";
18
18
  export { ProgressRing } from "./ProgressRing";
19
+ export type { ResourceCardProps, ResourceCardState } from "./ResourceCard";
20
+ export { ResourceCard } from "./ResourceCard";
19
21
  export type { StatCellAccent, StatCellProps, StatCellTone } from "./StatCell";
20
22
  export { StatCell } from "./StatCell";
21
23
  export type { StatGridAction, StatGridColumns, StatGridProps, StatGridSize, StatGridSurface, } from "./StatGrid";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2b/ui",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Production-ready components for SolidJS applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,31 +38,32 @@
38
38
  "fixture:build": "bun run build && NODE_ENV=production bun run fixture/scripts/build.ts",
39
39
  "fixture:typecheck": "tsc -p fixture/tsconfig.json --noEmit --pretty false",
40
40
  "test": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' src scripts && bun run scripts/check-packed-consumer.ts",
41
- "typecheck": "tsc -p tsconfig.json --noEmit --pretty false && bun run check:declarations && bun run typecheck:dom",
41
+ "typecheck": "tsc --checkers 2 -p tsconfig.json --noEmit --pretty false && bun run check:declarations && bun run typecheck:dom",
42
42
  "typecheck:dom": "tsc -p test/tsconfig.json --noEmit --pretty false",
43
43
  "prepack": "bun run build"
44
44
  },
45
45
  "dependencies": {
46
46
  "@fontsource/ibm-plex-mono": "5.3.0",
47
47
  "@fontsource/ibm-plex-sans": "5.3.0",
48
- "@k2b/stdlib": "0.27.0",
48
+ "@k2b/stdlib": "0.28.0",
49
49
  "@tabler/icons-webfont": "3.48.0",
50
50
  "marked": "18.0.14",
51
51
  "qr-scanner": "1.4.2"
52
52
  },
53
53
  "peerDependencies": {
54
- "@k2b/ssr": "^0.12.0 || ^0.13.0 || ^0.14.0",
54
+ "@k2b/ssr": "^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0",
55
55
  "solid-js": "^1.9.10"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@babel/core": "8.0.6",
59
59
  "@babel/preset-typescript": "8.0.1",
60
- "@k2b/ssr": "0.14.0",
60
+ "@k2b/ssr": "0.15.0",
61
61
  "@types/babel__core": "7.20.5",
62
62
  "@types/bun": "1.4.2",
63
63
  "axe-core": "4.11.0",
64
64
  "babel-preset-solid": "1.9.15",
65
65
  "bun-plugin-tailwind": "0.1.2",
66
+ "emojibase-data": "17.0.0",
66
67
  "happy-dom": "20.14.5",
67
68
  "hono": "4.13.9",
68
69
  "playwright": "1.63.0",