@k2b/ui 0.29.0 → 0.31.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 (243) hide show
  1. package/README.md +2 -2
  2. package/dist/base.css +2 -2
  3. package/dist/browser/actions/Dropdown.js +6 -3
  4. package/dist/browser/actions/Dropdown.js.map +1 -1
  5. package/dist/browser/actions/FilterChip.js +137 -7
  6. package/dist/browser/actions/FilterChip.js.map +1 -1
  7. package/dist/browser/actions/SegmentedControl.js +5 -9
  8. package/dist/browser/actions/SegmentedControl.js.map +1 -1
  9. package/dist/browser/actions/SpotlightSearch.js +6 -3
  10. package/dist/browser/actions/SpotlightSearch.js.map +1 -1
  11. package/dist/browser/actions/Tabs.js +5 -2
  12. package/dist/browser/actions/Tabs.js.map +1 -1
  13. package/dist/browser/actions/Toolbar.js +2 -0
  14. package/dist/browser/actions/Toolbar.js.map +1 -1
  15. package/dist/browser/actions/ViewTabs.js +294 -0
  16. package/dist/browser/actions/ViewTabs.js.map +1 -0
  17. package/dist/browser/actions/filter-messages.js +6 -2
  18. package/dist/browser/actions/filter-messages.js.map +1 -1
  19. package/dist/browser/actions/index.js +2 -1
  20. package/dist/browser/actions/index.js.map +1 -1
  21. package/dist/browser/chat/ChatComposer.js +1108 -604
  22. package/dist/browser/chat/ChatComposer.js.map +1 -1
  23. package/dist/browser/chat/ChatDecision.js +146 -84
  24. package/dist/browser/chat/ChatDecision.js.map +1 -1
  25. package/dist/browser/chat/ChatPrimitives.js +292 -159
  26. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  27. package/dist/browser/chat/chat-messages.js +8 -0
  28. package/dist/browser/chat/chat-messages.js.map +1 -1
  29. package/dist/browser/chat/command-search.js +26 -15
  30. package/dist/browser/chat/command-search.js.map +1 -1
  31. package/dist/browser/chat/index.js +4 -2
  32. package/dist/browser/chat/index.js.map +1 -1
  33. package/dist/browser/content/Calendar.js +143 -116
  34. package/dist/browser/content/Calendar.js.map +1 -1
  35. package/dist/browser/content/CalendarWeekView.js +291 -266
  36. package/dist/browser/content/CalendarWeekView.js.map +1 -1
  37. package/dist/browser/content/DataTable.js +224 -155
  38. package/dist/browser/content/DataTable.js.map +1 -1
  39. package/dist/browser/content/MapAttribution.js +27 -0
  40. package/dist/browser/content/MapAttribution.js.map +1 -0
  41. package/dist/browser/content/MapView.js +553 -0
  42. package/dist/browser/content/MapView.js.map +1 -0
  43. package/dist/browser/content/MapViewFrame.js +395 -0
  44. package/dist/browser/content/MapViewFrame.js.map +1 -0
  45. package/dist/browser/content/data-table-messages.js +4 -2
  46. package/dist/browser/content/data-table-messages.js.map +1 -1
  47. package/dist/browser/content/index.js +5 -0
  48. package/dist/browser/content/index.js.map +1 -1
  49. package/dist/browser/content/map-palette.js +39 -0
  50. package/dist/browser/content/map-palette.js.map +1 -0
  51. package/dist/browser/content/map-style.js +276 -0
  52. package/dist/browser/content/map-style.js.map +1 -0
  53. package/dist/browser/content/map-view-geometry.js +269 -0
  54. package/dist/browser/content/map-view-geometry.js.map +1 -0
  55. package/dist/browser/content/map-view-live.js +28 -0
  56. package/dist/browser/content/map-view-live.js.map +1 -0
  57. package/dist/browser/content/map-view-messages.js +53 -0
  58. package/dist/browser/content/map-view-messages.js.map +1 -0
  59. package/dist/browser/content/map-view-types.js +2 -0
  60. package/dist/browser/content/map-view-types.js.map +1 -0
  61. package/dist/browser/content/map-view-worker.js +10 -0
  62. package/dist/browser/feedback/MovedHint.js +197 -0
  63. package/dist/browser/feedback/MovedHint.js.map +1 -0
  64. package/dist/browser/feedback/dialog-core.js +85 -9
  65. package/dist/browser/feedback/dialog-core.js.map +1 -1
  66. package/dist/browser/feedback/index.js +1 -0
  67. package/dist/browser/feedback/index.js.map +1 -1
  68. package/dist/browser/feedback/prompts.js +6 -1
  69. package/dist/browser/feedback/prompts.js.map +1 -1
  70. package/dist/browser/inputs/DatePicker.js +337 -212
  71. package/dist/browser/inputs/DatePicker.js.map +1 -1
  72. package/dist/browser/inputs/date-picker.js +59 -5
  73. package/dist/browser/inputs/date-picker.js.map +1 -1
  74. package/dist/browser/intl/messages.js +12 -0
  75. package/dist/browser/intl/messages.js.map +1 -1
  76. package/dist/browser/intl/weekend.js +39 -0
  77. package/dist/browser/intl/weekend.js.map +1 -0
  78. package/dist/browser/layout/AppOverview.js +0 -1
  79. package/dist/browser/layout/AppOverview.js.map +1 -1
  80. package/dist/browser/layout/AppWorkspace.js +701 -476
  81. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  82. package/dist/browser/layout/PageTitle.js +3 -2
  83. package/dist/browser/layout/PageTitle.js.map +1 -1
  84. package/dist/browser/layout/SettingsModal.js +2 -2
  85. package/dist/browser/layout/SettingsModal.js.map +1 -1
  86. package/dist/browser/layout/SidebarSwitcher.js +13 -12
  87. package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
  88. package/dist/browser/layout/TabBar.js +1 -1
  89. package/dist/browser/layout/TabBar.js.map +1 -1
  90. package/dist/browser/layout/app-host-width.js +44 -0
  91. package/dist/browser/layout/app-host-width.js.map +1 -0
  92. package/dist/browser/layout/app-workspace-controller.js +331 -45
  93. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  94. package/dist/browser/layout/app-workspace-width.js +26 -0
  95. package/dist/browser/layout/app-workspace-width.js.map +1 -0
  96. package/dist/browser/layout/index.js +2 -1
  97. package/dist/browser/layout/index.js.map +1 -1
  98. package/dist/browser/surfaces/Placeholder.js +36 -13
  99. package/dist/browser/surfaces/Placeholder.js.map +1 -1
  100. package/dist/licenses/maplibre-gl.txt +116 -0
  101. package/dist/ssr/actions/Dropdown.js +5 -2
  102. package/dist/ssr/actions/Dropdown.js.map +1 -1
  103. package/dist/ssr/actions/FilterChip.js +59 -7
  104. package/dist/ssr/actions/FilterChip.js.map +1 -1
  105. package/dist/ssr/actions/SegmentedControl.js +1 -2
  106. package/dist/ssr/actions/SegmentedControl.js.map +1 -1
  107. package/dist/ssr/actions/SpotlightSearch.js +2 -2
  108. package/dist/ssr/actions/SpotlightSearch.js.map +1 -1
  109. package/dist/ssr/actions/Tabs.js +2 -2
  110. package/dist/ssr/actions/Tabs.js.map +1 -1
  111. package/dist/ssr/actions/Toolbar.js +2 -0
  112. package/dist/ssr/actions/Toolbar.js.map +1 -1
  113. package/dist/ssr/actions/ViewTabs.js +211 -0
  114. package/dist/ssr/actions/ViewTabs.js.map +1 -0
  115. package/dist/ssr/actions/filter-messages.js +6 -2
  116. package/dist/ssr/actions/filter-messages.js.map +1 -1
  117. package/dist/ssr/actions/index.js +2 -1
  118. package/dist/ssr/actions/index.js.map +1 -1
  119. package/dist/ssr/chat/ChatComposer.js +546 -131
  120. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  121. package/dist/ssr/chat/ChatDecision.js +44 -19
  122. package/dist/ssr/chat/ChatDecision.js.map +1 -1
  123. package/dist/ssr/chat/ChatPrimitives.js +95 -24
  124. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  125. package/dist/ssr/chat/chat-messages.js +8 -0
  126. package/dist/ssr/chat/chat-messages.js.map +1 -1
  127. package/dist/ssr/chat/command-search.js +26 -15
  128. package/dist/ssr/chat/command-search.js.map +1 -1
  129. package/dist/ssr/chat/index.js +4 -2
  130. package/dist/ssr/chat/index.js.map +1 -1
  131. package/dist/ssr/content/Calendar.js +109 -100
  132. package/dist/ssr/content/Calendar.js.map +1 -1
  133. package/dist/ssr/content/CalendarWeekView.js +42 -28
  134. package/dist/ssr/content/CalendarWeekView.js.map +1 -1
  135. package/dist/ssr/content/DataTable.js +78 -31
  136. package/dist/ssr/content/DataTable.js.map +1 -1
  137. package/dist/ssr/content/MapAttribution.js +19 -0
  138. package/dist/ssr/content/MapAttribution.js.map +1 -0
  139. package/dist/ssr/content/MapView.js +474 -0
  140. package/dist/ssr/content/MapView.js.map +1 -0
  141. package/dist/ssr/content/MapViewFrame.js +193 -0
  142. package/dist/ssr/content/MapViewFrame.js.map +1 -0
  143. package/dist/ssr/content/data-table-messages.js +4 -2
  144. package/dist/ssr/content/data-table-messages.js.map +1 -1
  145. package/dist/ssr/content/index.js +5 -0
  146. package/dist/ssr/content/index.js.map +1 -1
  147. package/dist/ssr/content/map-palette.js +39 -0
  148. package/dist/ssr/content/map-palette.js.map +1 -0
  149. package/dist/ssr/content/map-style.js +276 -0
  150. package/dist/ssr/content/map-style.js.map +1 -0
  151. package/dist/ssr/content/map-view-geometry.js +269 -0
  152. package/dist/ssr/content/map-view-geometry.js.map +1 -0
  153. package/dist/ssr/content/map-view-live.js +1 -0
  154. package/dist/ssr/content/map-view-messages.js +53 -0
  155. package/dist/ssr/content/map-view-messages.js.map +1 -0
  156. package/dist/ssr/content/map-view-types.js +2 -0
  157. package/dist/ssr/content/map-view-types.js.map +1 -0
  158. package/dist/ssr/feedback/MovedHint.js +166 -0
  159. package/dist/ssr/feedback/MovedHint.js.map +1 -0
  160. package/dist/ssr/feedback/dialog-core.js +85 -9
  161. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  162. package/dist/ssr/feedback/index.js +1 -0
  163. package/dist/ssr/feedback/index.js.map +1 -1
  164. package/dist/ssr/feedback/prompts.js +6 -1
  165. package/dist/ssr/feedback/prompts.js.map +1 -1
  166. package/dist/ssr/inputs/DatePicker.js +138 -69
  167. package/dist/ssr/inputs/DatePicker.js.map +1 -1
  168. package/dist/ssr/inputs/date-picker.js +59 -5
  169. package/dist/ssr/inputs/date-picker.js.map +1 -1
  170. package/dist/ssr/intl/messages.js +12 -0
  171. package/dist/ssr/intl/messages.js.map +1 -1
  172. package/dist/ssr/intl/weekend.js +39 -0
  173. package/dist/ssr/intl/weekend.js.map +1 -0
  174. package/dist/ssr/layout/AppOverview.js +0 -1
  175. package/dist/ssr/layout/AppOverview.js.map +1 -1
  176. package/dist/ssr/layout/AppWorkspace.js +216 -44
  177. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  178. package/dist/ssr/layout/PageTitle.js +3 -2
  179. package/dist/ssr/layout/PageTitle.js.map +1 -1
  180. package/dist/ssr/layout/SettingsModal.js +2 -2
  181. package/dist/ssr/layout/SettingsModal.js.map +1 -1
  182. package/dist/ssr/layout/SidebarSwitcher.js +13 -12
  183. package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
  184. package/dist/ssr/layout/TabBar.js +1 -1
  185. package/dist/ssr/layout/TabBar.js.map +1 -1
  186. package/dist/ssr/layout/app-host-width.js +44 -0
  187. package/dist/ssr/layout/app-host-width.js.map +1 -0
  188. package/dist/ssr/layout/app-workspace-controller.js +331 -45
  189. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  190. package/dist/ssr/layout/app-workspace-width.js +26 -0
  191. package/dist/ssr/layout/app-workspace-width.js.map +1 -0
  192. package/dist/ssr/layout/index.js +2 -1
  193. package/dist/ssr/layout/index.js.map +1 -1
  194. package/dist/ssr/surfaces/Placeholder.js +24 -7
  195. package/dist/ssr/surfaces/Placeholder.js.map +1 -1
  196. package/dist/styles.css +1 -1
  197. package/dist/types/actions/Dropdown.d.ts +4 -0
  198. package/dist/types/actions/FilterChip.d.ts +22 -0
  199. package/dist/types/actions/ViewTabs.d.ts +30 -0
  200. package/dist/types/actions/filter-messages.d.ts +2 -0
  201. package/dist/types/actions/index.d.ts +4 -2
  202. package/dist/types/chat/ChatComposer.d.ts +52 -0
  203. package/dist/types/chat/ChatDecision.d.ts +18 -2
  204. package/dist/types/chat/ChatPrimitives.d.ts +10 -0
  205. package/dist/types/chat/chat-messages.d.ts +4 -0
  206. package/dist/types/chat/command-search.d.ts +2 -0
  207. package/dist/types/chat/index.d.ts +9 -8
  208. package/dist/types/content/DataTable.d.ts +3 -0
  209. package/dist/types/content/MapAttribution.d.ts +6 -0
  210. package/dist/types/content/MapView.d.ts +5 -0
  211. package/dist/types/content/MapViewFrame.d.ts +31 -0
  212. package/dist/types/content/data-table-messages.d.ts +1 -0
  213. package/dist/types/content/index.d.ts +6 -0
  214. package/dist/types/content/map-palette.d.ts +58 -0
  215. package/dist/types/content/map-style.d.ts +29 -0
  216. package/dist/types/content/map-view-geometry.d.ts +55 -0
  217. package/dist/types/content/map-view-live.d.ts +2 -0
  218. package/dist/types/content/map-view-messages.d.ts +21 -0
  219. package/dist/types/content/map-view-types.d.ts +61 -0
  220. package/dist/types/feedback/MovedHint.d.ts +25 -0
  221. package/dist/types/feedback/dialog-core.d.ts +6 -2
  222. package/dist/types/feedback/index.d.ts +2 -0
  223. package/dist/types/feedback/prompts.d.ts +2 -0
  224. package/dist/types/inputs/DatePicker.d.ts +7 -0
  225. package/dist/types/inputs/date-picker.d.ts +25 -1
  226. package/dist/types/intl/messages.d.ts +6 -0
  227. package/dist/types/intl/weekend.d.ts +12 -0
  228. package/dist/types/layout/AppWorkspace.d.ts +48 -8
  229. package/dist/types/layout/app-host-width.d.ts +6 -0
  230. package/dist/types/layout/app-workspace-width.d.ts +13 -0
  231. package/dist/types/layout/index.d.ts +3 -2
  232. package/dist/types/surfaces/Placeholder.d.ts +2 -1
  233. package/map-glyphs/IBM Plex Sans Medium/0-255.pbf +0 -0
  234. package/map-glyphs/IBM Plex Sans Medium/1024-1279.pbf +0 -0
  235. package/map-glyphs/IBM Plex Sans Medium/256-511.pbf +0 -0
  236. package/map-glyphs/IBM Plex Sans Medium/512-767.pbf +0 -0
  237. package/map-glyphs/IBM Plex Sans Medium/768-1023.pbf +0 -0
  238. package/map-glyphs/IBM Plex Sans Medium/7680-7935.pbf +0 -0
  239. package/map-glyphs/IBM Plex Sans Medium/8192-8447.pbf +0 -0
  240. package/map-glyphs/IBM Plex Sans Medium/8448-8703.pbf +0 -0
  241. package/map-glyphs/IBM Plex Sans Medium/8704-8959.pbf +0 -0
  242. package/map-glyphs/OFL.txt +93 -0
  243. package/package.json +11 -6
@@ -14,6 +14,8 @@ export type DropdownActionBase = {
14
14
  */
15
15
  ariaLabel?: string;
16
16
  description?: string;
17
+ /** Quiet trailing information, such as a count. */
18
+ trailing?: JSX.Element;
17
19
  variant?: "danger";
18
20
  };
19
21
  export type DropdownAction = (DropdownActionBase & {
@@ -107,6 +109,8 @@ export type DropdownItemProps = {
107
109
  icon?: string;
108
110
  image?: string;
109
111
  description?: string;
112
+ /** Quiet trailing information, such as a count. */
113
+ trailing?: JSX.Element;
110
114
  disabled?: boolean;
111
115
  danger?: boolean;
112
116
  variant?: "danger";
@@ -28,9 +28,31 @@ export type FilterChipProps = {
28
28
  iconOnly?: boolean;
29
29
  /** Use a standard button appearance instead of the default filter field. */
30
30
  variant?: ButtonVariant;
31
+ /**
32
+ * An active chip names its first value instead of a count: "Tags: Customer", "Tags: Customer +2". Use it for the
33
+ * chips of `AppWorkspace.Head`; pass only the filter's name as `label`. The chip then grows with its value.
34
+ */
35
+ showValue?: boolean;
31
36
  disabled?: boolean;
32
37
  class?: string;
33
38
  };
34
39
  /** Section-aware controlled filter with immediate single- and multi-select commits. */
35
40
  export declare function FilterChip(props: FilterChipProps): JSX.Element;
36
41
  export default FilterChip;
42
+ export type FilterToggleProps = {
43
+ label: JSX.Element;
44
+ icon: string;
45
+ /** Whether the filter is on. An active toggle carries the same tint as an active `FilterChip`. */
46
+ active: boolean;
47
+ /** Link to the URL with the filter switched. The link keeps working without JavaScript. */
48
+ href?: string;
49
+ onClick?: (event: MouseEvent) => void;
50
+ title?: string;
51
+ disabled?: boolean;
52
+ class?: string;
53
+ };
54
+ /**
55
+ * One on/off filter in the chip look: a link marked `aria-current="true"` while active, or a button with
56
+ * `aria-pressed`. Selection changes only colour and background, so neighbouring chips never move.
57
+ */
58
+ export declare function FilterToggle(props: FilterToggleProps): JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { type JSX } from "solid-js";
2
+ export type ViewTab = {
3
+ id: string;
4
+ label: string;
5
+ href: string;
6
+ icon?: string;
7
+ count?: number | string;
8
+ };
9
+ export type ViewTabsProps = {
10
+ /** Accessible name of the navigation landmark, e.g. "Views". */
11
+ label: string;
12
+ items: readonly ViewTab[];
13
+ /** Id of the open view; the server reads it from `?view=`. Unknown ids select nothing. */
14
+ current: string | undefined;
15
+ /** Tabs shown before More (default 5). */
16
+ max?: number;
17
+ class?: string;
18
+ };
19
+ /** Two deterministic strip levels; only opening the menu reads CSS visibility. */
20
+ export declare function viewTabsLayout(items: readonly ViewTab[], current: string | undefined, max?: number): {
21
+ wide: number[];
22
+ compact: number[];
23
+ wideHidden: number;
24
+ compactHidden: number;
25
+ };
26
+ /**
27
+ * URL-backed object views. Every view is an ordinary document link, in the strip and under More, so reload, back,
28
+ * and forward keep the view the URL names.
29
+ */
30
+ export declare function ViewTabs(props: ViewTabsProps): JSX.Element;
@@ -1,5 +1,7 @@
1
1
  declare const filterMessages: import("@k2b/stdlib").Catalog<{
2
2
  filterActions: string;
3
+ filters: string;
4
+ reset: string;
3
5
  }>;
4
6
  export type FilterMessages = ReturnType<(typeof filterMessages)["resolve"]>["t"];
5
7
  /** Resolved from the inherited render locale. */
@@ -10,8 +10,8 @@ export type { DragPayload, DragSourceProps, DropTargetProps } from "./DragAndDro
10
10
  export { activeDrag, DragSource, DropTarget, useKeyboardDrag } from "./DragAndDrop";
11
11
  export type { DropdownAction, DropdownActionBase, DropdownChoice, DropdownItemProps, DropdownPosition, DropdownProps, DropdownSection, DropdownTriggerProps, } from "./Dropdown";
12
12
  export { Dropdown, DropdownItem, dropdownPosition } from "./Dropdown";
13
- export type { FilterChipOption, FilterChipProps, FilterChipSection } from "./FilterChip";
14
- export { FilterChip } from "./FilterChip";
13
+ export type { FilterChipOption, FilterChipProps, FilterChipSection, FilterToggleProps } from "./FilterChip";
14
+ export { FilterChip, FilterToggle } from "./FilterChip";
15
15
  export type { GestureKind, GestureMenuAction, GestureMenuItem, GestureMenuProps, GestureMenuSection } from "./GestureMenu";
16
16
  export { GestureMenu } from "./GestureMenu";
17
17
  export type { RemoveButtonProps } from "./RemoveButton";
@@ -26,3 +26,5 @@ export type { TabOption, TabsItemProps, TabsProps } from "./Tabs";
26
26
  export { Tabs } from "./Tabs";
27
27
  export type { ToolbarActionProps, ToolbarGroupProps, ToolbarLabelProps, ToolbarProps, ToolbarSeparatorProps } from "./Toolbar";
28
28
  export { Toolbar } from "./Toolbar";
29
+ export type { ViewTab, ViewTabsProps } from "./ViewTabs";
30
+ export { ViewTabs } from "./ViewTabs";
@@ -15,6 +15,18 @@ export type ChatCommandResult = void | "cancelled" | {
15
15
  } | {
16
16
  mention: ChatAttachment;
17
17
  };
18
+ /** The draft as a successful `open` leaves it: without the `/…` token, with its references moved along. Save this one. */
19
+ export type ChatCommandDraft = {
20
+ value: string;
21
+ mentions: readonly ChatMention[];
22
+ };
23
+ /**
24
+ * How an `open` row ends: on success (`void`) the token leaves as for an action; `"cancelled"` changes nothing; `failed`
25
+ * keeps the list open and the draft unchanged, and its text replaces the row's description until the row runs again.
26
+ */
27
+ export type ChatCommandOpenResult = void | "cancelled" | {
28
+ failed: string;
29
+ };
18
30
  /** A fixed place in the slash list. Sections keep the given order, also while searching. */
19
31
  export type ChatCommandSection = {
20
32
  id: string;
@@ -23,6 +35,20 @@ export type ChatCommandSection = {
23
35
  searched?: boolean;
24
36
  /** Only while searching or narrowed: absent from the overview (empty query), including its loading placeholder. */
25
37
  searchOnly?: boolean;
38
+ /** Only in the overview (empty query, no scope): absent while searching or narrowed, such as recently used rows. */
39
+ overviewOnly?: boolean;
40
+ /**
41
+ * Its local rows are fixed when the list opens: a row that arrives while the list is open waits for the next opening,
42
+ * so a section above others whose rows load in the background never pushes a visible row down. Rows that go away
43
+ * still leave at once.
44
+ */
45
+ fixedWhileOpen?: boolean;
46
+ /**
47
+ * Local rows still on their way, such as Commands from a catalog: the section ends with placeholder rows, three in
48
+ * the overview and one while searching, and its heading shows a spinner. Make it the last section, so rows that
49
+ * arrive only fill the end of the list and no visible row moves.
50
+ */
51
+ pending?: boolean;
26
52
  };
27
53
  /** First-word narrowing; Tab writes `words[0]` followed by a space. */
28
54
  export type ChatCommandScope = {
@@ -47,8 +73,15 @@ export type ChatCommand = {
47
73
  selected?: boolean;
48
74
  /** Retry discovery in a new opening, retaining the token and currently displayed rows. */
49
75
  searchAgain?: boolean;
76
+ /** Stays in every search of its section, after the matches, such as a row that retries loading the section. */
77
+ persistent?: boolean;
50
78
  /** Application name, searchable but not displayed. */
51
79
  app?: string;
80
+ /**
81
+ * Used recently by this person. While searching, a matching row moves one step up the ranking ladder of its section
82
+ * and comes before rows of equal rank. The overview keeps consumer order.
83
+ */
84
+ recent?: boolean;
52
85
  /** Stable row key for option ids, marking and de-duplication. Defaults to `name`. */
53
86
  id?: string;
54
87
  name: string;
@@ -62,6 +95,16 @@ export type ChatCommand = {
62
95
  busyLabel?: string;
63
96
  /** Failures restore an unchanged draft and appear once in the status line, without calling `onError`. */
64
97
  action?: (context: ChatCommandContext) => ChatCommandResult | Promise<ChatCommandResult>;
98
+ /**
99
+ * Leaves the composer, such as opening another app. Runs with the token and the list in place: the row shows
100
+ * `busyLabel` (default "Opening …") with a spinner instead of its description, and editing waits. A rejection ends like
101
+ * an action's: the token stays, the list closes and the status line names the reason. Closing the list, such as with
102
+ * Escape, cancels: `signal` aborts and the row ends at once. `signal` also aborts when the opening ends any other way
103
+ * than by success, so the opener can save the draft with its token again. A new `draftKey` cancels too, unless the
104
+ * opener calls `follow()` right before changing it itself: that next change keeps the opening, moves its busy line
105
+ * to the status line, and Escape still cancels. See `ChatCommandOpenResult`.
106
+ */
107
+ open?: (draft: ChatCommandDraft, signal: AbortSignal, follow: () => void) => Promise<ChatCommandOpenResult>;
65
108
  /** Selecting a reference inserts its display name and retains its opaque payload. */
66
109
  mention?: ChatAttachment;
67
110
  /**
@@ -104,7 +147,16 @@ export type ChatComposerProps = {
104
147
  fileSelection?: ChatFileSelection;
105
148
  /** Handle non-file clipboard content. Pasted files already use `fileSelection`. */
106
149
  onPaste?: ChatPasteHandler;
150
+ /** The add menu's entries after "Attach files". Not shown with `addOpensCommands`. */
107
151
  menuActions?: readonly ChatAction[];
152
+ /**
153
+ * "+" opens the slash list with a search field on top instead of the add menu, for keyboards where "/" is hard to
154
+ * reach, such as a phone's. The search field filters, narrows and chooses as typing after "/" does, and a reference
155
+ * lands where the field's caret was when "+" was pressed. Escape, "+" again, Back on a phone or a press outside
156
+ * closes the list without acting on what lies below, and the field gets its focus and selection back. `menuActions`
157
+ * do not show then: offer them as `commands`, and file selection as a row with `attachFiles`.
158
+ */
159
+ addOpensCommands?: boolean;
108
160
  models?: readonly ChatModelOption[];
109
161
  selectedModelId?: string | null;
110
162
  onModelChange?: (modelId: string) => void;
@@ -72,10 +72,25 @@ declare function ChatPreviewTitle(props: ChatPreviewTitleProps): JSX.Element;
72
72
  declare function ChatPreviewSentence(props: {
73
73
  children: JSX.Element;
74
74
  }): JSX.Element;
75
+ export type ChatPreviewExcerptProps = {
76
+ children: JSX.Element;
77
+ /** Shows the whole text in place instead of the first lines, such as after `Chat.Preview.ShowAll`. */
78
+ expanded?: boolean;
79
+ id?: string;
80
+ };
75
81
  /** The first lines of a longer text. It keeps its line breaks, shows about three lines, and fades out. */
76
- declare function ChatPreviewExcerpt(props: {
82
+ declare function ChatPreviewExcerpt(props: ChatPreviewExcerptProps): JSX.Element;
83
+ export type ChatPreviewShowAllProps = {
84
+ /** The id of the `Chat.Preview.Excerpt` this button opens. */
85
+ controls: string;
86
+ onShow: () => void;
77
87
  children: JSX.Element;
78
- }): JSX.Element;
88
+ };
89
+ /**
90
+ * Shows the rest of an excerpt in place, for a text with no page of its own to open. It looks like `ReadMore`; the
91
+ * caller removes it once the text is shown, and the focus moves to the text, so reading goes on where it was.
92
+ */
93
+ declare function ChatPreviewShowAll(props: ChatPreviewShowAllProps): JSX.Element;
79
94
  export type ChatPreviewReadMoreProps = {
80
95
  href: string;
81
96
  children: JSX.Element;
@@ -120,6 +135,7 @@ export declare const ChatPreview: typeof ChatPreviewRoot & {
120
135
  Sentence: typeof ChatPreviewSentence;
121
136
  Excerpt: typeof ChatPreviewExcerpt;
122
137
  ReadMore: typeof ChatPreviewReadMore;
138
+ ShowAll: typeof ChatPreviewShowAll;
123
139
  Lines: typeof ChatPreviewLines;
124
140
  Line: typeof ChatPreviewLine;
125
141
  People: typeof ChatPreviewPeople;
@@ -53,5 +53,15 @@ export type ChatContextUsageProps = ChatContextUsageData & {
53
53
  };
54
54
  export declare const formatChatTokens: (tokens: number) => string;
55
55
  export declare function ChatMessage(props: ChatMessageProps): JSX.Element;
56
+ export type ChatActivityToggleProps = {
57
+ /** The words that open the body, usually the count, such as "3 of 4 tasks". */
58
+ children: JSX.Element;
59
+ };
60
+ /**
61
+ * The words of an activity label that open its body, with the chevron right after them. With a toggle in its label,
62
+ * only these words are the disclosure, and the rest of the row, chips with links included, stays ordinary content.
63
+ * Outside an activity with a body it renders its words as plain text.
64
+ */
65
+ export declare function ChatActivityToggle(props: ChatActivityToggleProps): JSX.Element;
56
66
  export declare function ChatActivity(props: ChatActivityProps): JSX.Element;
57
67
  export declare function ChatContextUsage(props: ChatContextUsageProps): JSX.Element;
@@ -3,10 +3,14 @@ export declare const chatMessages: import("@k2b/stdlib").Catalog<{
3
3
  commandDraftChanged: string;
4
4
  markAdded: string;
5
5
  markRemoved: string;
6
+ commandOpening: string;
6
7
  commandSelected: string;
7
8
  attachments: string;
8
9
  assistant: string;
9
10
  addToChat: string;
11
+ addMenu: string;
12
+ commandSearch: string;
13
+ commandSearchLabel: string;
10
14
  attachFiles: string;
11
15
  addGuidance: string;
12
16
  chat: string;
@@ -20,6 +20,8 @@ type Group = {
20
20
  rows: ChatCommandRow[];
21
21
  loading: boolean;
22
22
  placeholder: boolean;
23
+ /** Placeholder rows of a `pending` section, after its rows: three in the overview, one while searching. */
24
+ pendingRows: number;
23
25
  };
24
26
  export declare function chatCommandListModel(input: {
25
27
  query: string;
@@ -4,12 +4,12 @@ import { ChatTasks } from "./ChatTasks";
4
4
  export type { ChatTask, ChatTasksProps } from "./ChatTasks";
5
5
  import { ChatComposer } from "./ChatComposer";
6
6
  import { ChatDecision, ChatMark, ChatOutcome } from "./ChatDecision";
7
- import { ChatActivity, ChatContextUsage, ChatMessage } from "./ChatPrimitives";
7
+ import { ChatActivity, ChatActivityToggle, ChatContextUsage, ChatMessage } from "./ChatPrimitives";
8
8
  import { ChatRoot } from "./ChatRoot";
9
9
  import { ChatTimeline } from "./ChatTimeline";
10
- export type { ChatCommand, ChatCommandContext, ChatCommandResult, ChatCommandScope, ChatCommandSearch, ChatCommandSection, ChatComposerProps, ChatFileSelection, ChatPasteHandler, } from "./ChatComposer";
11
- export type { ChatDecisionProps, ChatMarkProps, ChatOutcomeProps, ChatPreviewHeaderProps, ChatPreviewLineProps, ChatPreviewPeopleProps, ChatPreviewProps, ChatPreviewReadMoreProps, ChatPreviewTitleProps, } from "./ChatDecision";
12
- export type { ChatActivityProps, ChatContextUsageProps, ChatMessageProps } from "./ChatPrimitives";
10
+ export type { ChatCommand, ChatCommandContext, ChatCommandDraft, ChatCommandOpenResult, ChatCommandResult, ChatCommandScope, ChatCommandSearch, ChatCommandSection, ChatComposerProps, ChatFileSelection, ChatPasteHandler, } from "./ChatComposer";
11
+ export type { ChatDecisionProps, ChatMarkProps, ChatOutcomeProps, ChatPreviewExcerptProps, ChatPreviewHeaderProps, ChatPreviewLineProps, ChatPreviewPeopleProps, ChatPreviewProps, ChatPreviewReadMoreProps, ChatPreviewShowAllProps, ChatPreviewTitleProps, } from "./ChatDecision";
12
+ export type { ChatActivityProps, ChatActivityToggleProps, ChatContextUsageProps, ChatMessageProps } from "./ChatPrimitives";
13
13
  export { formatChatTokens } from "./ChatPrimitives";
14
14
  export type { ChatRootProps } from "./ChatRoot";
15
15
  export type { ChatActivityItem, ChatMessageItem, ChatTimelineItem, ChatTimelineProps } from "./ChatTimeline";
@@ -22,7 +22,9 @@ export declare const Chat: typeof ChatRoot & {
22
22
  Tasks: typeof ChatTasks;
23
23
  Timeline: typeof ChatTimeline;
24
24
  Message: typeof ChatMessage;
25
- Activity: typeof ChatActivity;
25
+ Activity: typeof ChatActivity & {
26
+ Toggle: typeof ChatActivityToggle;
27
+ };
26
28
  Composer: typeof ChatComposer;
27
29
  ContextUsage: typeof ChatContextUsage;
28
30
  ContextPopup: typeof ChatContextPopup;
@@ -35,10 +37,9 @@ export declare const Chat: typeof ChatRoot & {
35
37
  Sentence: (props: {
36
38
  children: import("solid-js").JSX.Element;
37
39
  }) => import("solid-js").JSX.Element;
38
- Excerpt: (props: {
39
- children: import("solid-js").JSX.Element;
40
- }) => import("solid-js").JSX.Element;
40
+ Excerpt: (props: import("./ChatDecision").ChatPreviewExcerptProps) => import("solid-js").JSX.Element;
41
41
  ReadMore: (props: import("./ChatDecision").ChatPreviewReadMoreProps) => import("solid-js").JSX.Element;
42
+ ShowAll: (props: import("./ChatDecision").ChatPreviewShowAllProps) => import("solid-js").JSX.Element;
42
43
  Lines: (props: {
43
44
  label?: string;
44
45
  children: import("solid-js").JSX.Element;
@@ -85,6 +85,9 @@ export type DataTableProps<T> = {
85
85
  footer?: DataTableFooter<T>;
86
86
  hasMore?: boolean;
87
87
  loadingMore?: boolean;
88
+ loading?: boolean;
89
+ /** Initial placeholder count, clamped to an integer from 1 to 50. Defaults to 5. */
90
+ loadingRows?: number;
88
91
  onLoadMore?: () => void;
89
92
  empty?: JSX.Element;
90
93
  density?: "compact" | "normal";
@@ -0,0 +1,6 @@
1
+ import { type JSX } from "solid-js";
2
+ /**
3
+ * The required credits for maps built with `mapStyle()`, each one a link, for MapView's `attribution` slot.
4
+ * @example <MapView style={style} attribution={<MapAttribution />} height={320} />
5
+ */
6
+ export declare function MapAttribution(): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { MapViewProps } from "./map-view-types";
3
+ export type { MapViewProps } from "./map-view-types";
4
+ /** A static server frame enhanced with a same-origin MapLibre worker only after it enters the viewport. */
5
+ export declare function MapView(props: MapViewProps): JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type MapFrame } from "./map-view-geometry";
3
+ import type { MapViewFrameProps, MapViewMarker } from "./map-view-types";
4
+ export type { MapViewFrameProps } from "./map-view-types";
5
+ export declare const mapNumber: (value: number) => string;
6
+ export declare const selectedMarker: (markers: MapViewMarker[], selectedId?: string) => MapViewMarker | undefined;
7
+ export declare function frameStyle(frame: MapFrame, padding: number): JSX.CSSProperties;
8
+ export declare function MapGeometry(props: MapViewFrameProps & {
9
+ frame: MapFrame;
10
+ boxStyle?: JSX.CSSProperties;
11
+ onSelect?: (id: string) => void;
12
+ /** Pins are buttons in MapView; the standalone frame draws them as labelled images, never focusable. */
13
+ interactive?: boolean;
14
+ /** 2^(live zoom - fitted zoom), so pin separation follows the person's zoom; 1 until then. */
15
+ zoomFactor?: number;
16
+ }): JSX.Element;
17
+ export type MapScale = {
18
+ label: string;
19
+ width: string;
20
+ };
21
+ export declare function referenceScale(frame: MapFrame, padding: number): MapScale;
22
+ export declare function MapScaleBar(props: {
23
+ scale: MapScale;
24
+ }): JSX.Element;
25
+ /** The scale bar and the attribution share the bottom row, so a long attribution wraps before it covers the scale. */
26
+ export declare function MapFootRow(props: {
27
+ scale?: MapScale;
28
+ children?: JSX.Element;
29
+ }): JSX.Element;
30
+ /** Geometry without a browser, a canvas, or a network dependency; suitable for server rendering and PDF output. */
31
+ export declare function MapViewFrame(props: MapViewFrameProps): JSX.Element;
@@ -2,6 +2,7 @@ declare const dataTableMessages: import("@k2b/stdlib").Catalog<{
2
2
  dataTable: string;
3
3
  noColumns: string;
4
4
  noRecords: string;
5
+ loadingRows: string;
5
6
  }>;
6
7
  export type DataTableMessages = ReturnType<(typeof dataTableMessages)["resolve"]>["t"];
7
8
  /** Resolved from the inherited render locale. */
@@ -35,9 +35,15 @@ export type { LightboxAction, LightboxImage } from "./Lightbox";
35
35
  export { default as Lightbox } from "./Lightbox";
36
36
  export type { LogTableEntry } from "./LogEntriesTable";
37
37
  export { default as LogEntriesTable } from "./LogEntriesTable";
38
+ export { MapAttribution } from "./MapAttribution";
39
+ export { MapView } from "./MapView";
40
+ export { MapViewFrame } from "./MapViewFrame";
38
41
  export { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from "./MarkdownView";
39
42
  export type { MessageGroupEntry, MessageRowAction, MessageRowAttachment, MessageRowAuthor, MessageRowFile, MessageRowMedia, MessageRowProgress, MessageRowProps, MessageRowQuote, MessageRowReaction, MessageRowStatus, MessageRowThread, MessageSystemRowProps, } from "./MessageRow";
40
43
  export { MessageRow, MessageSystemRow, startsMessageGroup } from "./MessageRow";
44
+ export { type MapPaletteColors, type MapTheme, mapPalette } from "./map-palette";
45
+ export { type MapStyleOptions, mapAttribution, mapStyle } from "./map-style";
46
+ export type { MapViewArea, MapViewFit, MapViewFrameProps, MapViewLine, MapViewLineTone, MapViewMarker, MapViewOwnLocation, MapViewPoint, MapViewProps, MapViewStyle, MapViewStyleSource, MapViewTone, } from "./map-view-types";
41
47
  export { MARKDOWN_CALLOUT_CLASSES, MARKDOWN_CALLOUT_ICON_ATTRIBUTES, type MarkdownInfoBlock, type MarkdownInfoBlockRenderInput, type MarkdownInfoBlockType, markdownInfoBlocks, renderMarkdownInfoBlock, scanMarkdownInfoBlock, } from "./markdown-info-blocks";
42
48
  export { type MarkdownLinkInput, type MarkdownReference, type MarkdownReferenceKind, type MarkdownReferenceType, markdownLinkReference, markdownReferenceIcon, markdownReferenceType, markdownReferenceTypeLabel, markStandaloneLinks, renderMarkdownLink, } from "./markdown-links";
43
49
  export { Pagination, type PaginationProps } from "./Pagination";
@@ -0,0 +1,58 @@
1
+ /** The map image colours. Each key is also the CSS token `--k2b-map-<kebab-key>` on `.k2b-map-view`. */
2
+ export type MapPaletteColors = {
3
+ /** Background land, also behind the server frame before the map image arrives. */
4
+ land: string;
5
+ /** Woods, grass, and city green; large protected areas stay plain land. */
6
+ green: string;
7
+ water: string;
8
+ building: string;
9
+ road: string;
10
+ roadCasing: string;
11
+ motorway: string;
12
+ motorwayCasing: string;
13
+ /** Rail lines and footpaths. */
14
+ rail: string;
15
+ boundary: string;
16
+ /** Streets, suburbs, villages, and states. */
17
+ label: string;
18
+ /** Cities, towns, and countries. */
19
+ labelStrong: string;
20
+ waterLabel: string;
21
+ };
22
+ export type MapTheme = "light" | "dark";
23
+ /**
24
+ * Plain data so a server can build the style JSON without CSS. The accent stays with the host's
25
+ * pins and lines; the map image only uses calm land, water, green, and road tones.
26
+ */
27
+ export declare const mapPalette: {
28
+ readonly light: {
29
+ readonly land: "#f1efe9";
30
+ readonly green: "#e3ecd9";
31
+ readonly water: "#cfe3f3";
32
+ readonly building: "#e8e5dd";
33
+ readonly road: "#ffffff";
34
+ readonly roadCasing: "#dcd8ce";
35
+ readonly motorway: "#f6c76b";
36
+ readonly motorwayCasing: "#d9a443";
37
+ readonly rail: "#c4bfb4";
38
+ readonly boundary: "#aea89c";
39
+ readonly label: "#52525b";
40
+ readonly labelStrong: "#27272a";
41
+ readonly waterLabel: "#3a6383";
42
+ };
43
+ readonly dark: {
44
+ readonly land: "#1a1f26";
45
+ readonly green: "#1c2a22";
46
+ readonly water: "#14283a";
47
+ readonly building: "#20262e";
48
+ readonly road: "#2c333d";
49
+ readonly roadCasing: "#222830";
50
+ readonly motorway: "#5d6470";
51
+ readonly motorwayCasing: "#444a54";
52
+ readonly rail: "#39404a";
53
+ readonly boundary: "#4f5763";
54
+ readonly label: "#a1a1aa";
55
+ readonly labelStrong: "#e4e4e7";
56
+ readonly waterLabel: "#8fb5d3";
57
+ };
58
+ };
@@ -0,0 +1,29 @@
1
+ import type { StyleSpecification } from "maplibre-gl";
2
+ import { type MapTheme } from "./map-palette";
3
+ export type MapStyleOptions = {
4
+ theme: MapTheme;
5
+ /** Request locale such as `de` or `de-DE`; labels prefer `name:<language>`. */
6
+ locale: string;
7
+ /** Vector tile template with `{z}`, `{x}`, and `{y}`, for example `/_geo/tiles/{z}/{x}/{y}.pbf`. */
8
+ tiles: string;
9
+ /** Glyph template with `{fontstack}` and `{range}`, served from `@k2b/ui/map-glyphs/*`. */
10
+ glyphs: string;
11
+ /** Highest zoom the tiles carry; the map scales the last level up beyond it. Defaults to 14. */
12
+ maxzoom?: number;
13
+ };
14
+ /** Attribution for OpenMapTiles-schema maps with OpenStreetMap data from Geoapify, in display order. */
15
+ export declare const mapAttribution: readonly [{
16
+ readonly label: "© OpenStreetMap";
17
+ readonly href: "https://www.openstreetmap.org/copyright";
18
+ }, {
19
+ readonly label: "© OpenMapTiles";
20
+ readonly href: "https://openmaptiles.org/";
21
+ }, {
22
+ readonly label: "Geoapify";
23
+ readonly href: "https://www.geoapify.com/";
24
+ }];
25
+ /**
26
+ * A flat Cloud map style for OpenMapTiles-schema vector tiles. The host passes the tile and glyph
27
+ * templates; there are no network defaults, sprites, extrusions, or relief.
28
+ */
29
+ export declare function mapStyle(options: MapStyleOptions): StyleSpecification;
@@ -0,0 +1,55 @@
1
+ import type { MapViewFrameProps, MapViewLine, MapViewMarker, MapViewPoint } from "./map-view-types";
2
+ export declare const MIN_SPAN: number;
3
+ export declare const EARTH_CIRCUMFERENCE = 40075016.686;
4
+ /** Room around the fitted geometry: clears the floating controls, the notice, the scale bar and the attribution. */
5
+ export declare const DEFAULT_PADDING = 64;
6
+ /**
7
+ * `referenceWidth` is the fitted width when the container is wide enough; `minWidth` keeps the whole world at least as
8
+ * tall as the map, the smallest zoom MapLibre allows, so a world-scale fit lands where MapLibre puts it.
9
+ */
10
+ export type MapFrame = {
11
+ minX: number;
12
+ minY: number;
13
+ spanX: number;
14
+ spanY: number;
15
+ aspect: number;
16
+ referenceWidth: number;
17
+ minWidth: number;
18
+ /** The fitted width on a 320 px phone: pins are kept apart from this scale up, so they never cover each other there. */
19
+ overlapWidth: number;
20
+ };
21
+ export declare function decodePolyline6(encoded: string): MapViewPoint[];
22
+ export declare const linePoints: (line: MapViewLine) => MapViewPoint[];
23
+ export declare function projectPoint(point: MapViewPoint): {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ export declare function unprojectPoint(x: number, y: number): MapViewPoint;
28
+ export declare function mapFrame(geometry: Pick<MapViewFrameProps, "markers" | "lines" | "areas" | "ownLocation" | "fit">, height: number, padding?: number): MapFrame | null;
29
+ export declare function fitCamera(frame: MapFrame, width: number, padding?: number): {
30
+ center: [number, number];
31
+ zoom: number;
32
+ };
33
+ export declare const isStop: (marker: MapViewMarker) => boolean;
34
+ export declare function sortMarkers(markers: MapViewMarker[]): MapViewMarker[];
35
+ type PinOffset = {
36
+ dx: number;
37
+ dy: number;
38
+ };
39
+ /**
40
+ * Pin offsets in px, decided from the data alone: at the phone fit and checked for every wider fit up to the widest
41
+ * one, so they hold at any width. `zoomFactor` is 2^(live zoom - fitted zoom): 1 for the server frame, the first client
42
+ * frame and the untouched live map, so all three agree; when the person zooms, separation is decided for the new scale.
43
+ */
44
+ export declare function pinOffsets(sortedMarkers: MapViewMarker[], frame: MapFrame, zoomFactor?: number, ownLocation?: MapViewPoint): Map<string, PinOffset>;
45
+ /**
46
+ * The touch hit radius of each pin in px: up to 22 px (a 44 px target), but never into a neighbour's visible mark
47
+ * (radius up to 14 px) at any width, so a tap on a visible pin always reaches it.
48
+ */
49
+ export declare function pinHitRadii(sortedMarkers: MapViewMarker[], frame: MapFrame, offsets: Map<string, PinOffset>, zoomFactor?: number): Map<string, number>;
50
+ export declare const metersPerPixel: (lat: number, zoom: number) => number;
51
+ export declare function scaleBar(mpp: number, maxPx?: number): {
52
+ meters: number;
53
+ label: string;
54
+ };
55
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Map, type MapOptions } from "maplibre-gl";
2
+ export declare function createMap(options: MapOptions): Map;
@@ -0,0 +1,21 @@
1
+ export declare const useMapViewMessages: () => () => {
2
+ mapLabel: string;
3
+ summary: ({ count }: {
4
+ count: number;
5
+ }) => string;
6
+ pins: string;
7
+ zoomIn: string;
8
+ zoomOut: string;
9
+ locate: string;
10
+ loading: string;
11
+ error: string;
12
+ retry: string;
13
+ reload: string;
14
+ noWebgl: string;
15
+ ownLocation: string;
16
+ canvasTitle: string;
17
+ gestureWindows: string;
18
+ gestureMac: string;
19
+ gestureMobile: string;
20
+ };
21
+ export declare const checkMapViewMessages: () => import("@k2b/stdlib").CatalogIssue[];
@@ -0,0 +1,61 @@
1
+ import type { StyleSpecification } from "maplibre-gl";
2
+ import type { JSX } from "solid-js";
3
+ export type MapViewPoint = {
4
+ lat: number;
5
+ lon: number;
6
+ };
7
+ export type MapViewTone = "accent" | "second" | "neutral" | "warning";
8
+ export type MapViewMarker = {
9
+ id: string;
10
+ point: MapViewPoint;
11
+ /** A number, a single letter, or "+". Omit for a drop pin. */
12
+ mark?: number | string;
13
+ label: string;
14
+ tone?: MapViewTone;
15
+ selected?: boolean;
16
+ };
17
+ export type MapViewLineTone = "accent" | "muted" | "preview" | "previous";
18
+ export type MapViewLine = {
19
+ id: string;
20
+ tone?: MapViewLineTone;
21
+ } & ({
22
+ polyline6: string;
23
+ } | {
24
+ points: MapViewPoint[];
25
+ });
26
+ export type MapViewArea = {
27
+ id: string;
28
+ polygon: MapViewPoint[];
29
+ tone?: MapViewTone;
30
+ };
31
+ export type MapViewOwnLocation = {
32
+ point: MapViewPoint;
33
+ accuracyMeters?: number;
34
+ };
35
+ export type MapViewStyle = string | StyleSpecification;
36
+ export type MapViewStyleSource = MapViewStyle | {
37
+ light: MapViewStyle;
38
+ dark: MapViewStyle;
39
+ };
40
+ export type MapViewFit = "all" | "markers";
41
+ export type MapViewFrameProps = {
42
+ markers?: MapViewMarker[];
43
+ lines?: MapViewLine[];
44
+ areas?: MapViewArea[];
45
+ ownLocation?: MapViewOwnLocation;
46
+ height: number;
47
+ padding?: number;
48
+ fit?: MapViewFit;
49
+ selectedId?: string;
50
+ attribution?: JSX.Element;
51
+ class?: string;
52
+ };
53
+ export type MapViewProps = Omit<MapViewFrameProps, "attribution"> & {
54
+ style: MapViewStyleSource;
55
+ attribution: JSX.Element;
56
+ onSelect?: (id: string) => void;
57
+ infoTile?: (marker: MapViewMarker) => JSX.Element;
58
+ notice?: JSX.Element;
59
+ empty?: JSX.Element;
60
+ onLocate?: () => void;
61
+ };