@k2b/ui 0.35.0 → 0.36.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 (51) hide show
  1. package/dist/browser/content/MapView.js +128 -13
  2. package/dist/browser/content/MapView.js.map +1 -1
  3. package/dist/browser/content/MapViewFrame.js +1 -1
  4. package/dist/browser/content/MapViewFrame.js.map +1 -1
  5. package/dist/browser/content/index.js +1 -0
  6. package/dist/browser/content/index.js.map +1 -1
  7. package/dist/browser/content/map-view-glyphs.js +23 -0
  8. package/dist/browser/content/map-view-glyphs.js.map +1 -0
  9. package/dist/browser/content/map-view-live.js +45 -22
  10. package/dist/browser/content/map-view-live.js.map +1 -1
  11. package/dist/browser/content/map-view-snapshot.js +191 -0
  12. package/dist/browser/content/map-view-snapshot.js.map +1 -0
  13. package/dist/browser/content/map-view-types.js.map +1 -1
  14. package/dist/browser/inputs/Combobox.js +139 -62
  15. package/dist/browser/inputs/Combobox.js.map +1 -1
  16. package/dist/browser/inputs/TextInput.js +1 -1
  17. package/dist/browser/inputs/TextInput.js.map +1 -1
  18. package/dist/browser/layout/AppWorkspace.js +73 -70
  19. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  20. package/dist/browser/layout/ScrollArea.js +4 -1
  21. package/dist/browser/layout/ScrollArea.js.map +1 -1
  22. package/dist/ssr/content/MapView.js +128 -13
  23. package/dist/ssr/content/MapView.js.map +1 -1
  24. package/dist/ssr/content/MapViewFrame.js +1 -1
  25. package/dist/ssr/content/MapViewFrame.js.map +1 -1
  26. package/dist/ssr/content/index.js +1 -0
  27. package/dist/ssr/content/index.js.map +1 -1
  28. package/dist/ssr/content/map-view-glyphs.js +23 -0
  29. package/dist/ssr/content/map-view-glyphs.js.map +1 -0
  30. package/dist/ssr/content/map-view-snapshot.js +191 -0
  31. package/dist/ssr/content/map-view-snapshot.js.map +1 -0
  32. package/dist/ssr/content/map-view-types.js.map +1 -1
  33. package/dist/ssr/inputs/Combobox.js +66 -20
  34. package/dist/ssr/inputs/Combobox.js.map +1 -1
  35. package/dist/ssr/inputs/TextInput.js.map +1 -1
  36. package/dist/ssr/layout/AppWorkspace.js +1 -1
  37. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  38. package/dist/ssr/layout/ScrollArea.js +4 -1
  39. package/dist/ssr/layout/ScrollArea.js.map +1 -1
  40. package/dist/styles.css +1 -1
  41. package/dist/types/content/MapViewFrame.d.ts +1 -1
  42. package/dist/types/content/index.d.ts +2 -1
  43. package/dist/types/content/map-view-glyphs.d.ts +5 -0
  44. package/dist/types/content/map-view-live.d.ts +1 -1
  45. package/dist/types/content/map-view-snapshot.d.ts +13 -0
  46. package/dist/types/content/map-view-types.d.ts +15 -0
  47. package/dist/types/inputs/Combobox.d.ts +12 -0
  48. package/dist/types/inputs/TextInput.d.ts +2 -1
  49. package/dist/types/layout/AppWorkspace.d.ts +4 -1
  50. package/dist/types/layout/ScrollArea.d.ts +2 -0
  51. package/package.json +2 -1
@@ -27,5 +27,5 @@ export declare function MapFootRow(props: {
27
27
  scale?: MapScale;
28
28
  children?: JSX.Element;
29
29
  }): JSX.Element;
30
- /** Geometry without a browser, a canvas, or a network dependency; suitable for server rendering and PDF output. */
30
+ /** Geometry fallback without a browser, canvas, or network. Does not contain a geographic basemap image. */
31
31
  export declare function MapViewFrame(props: MapViewFrameProps): JSX.Element;
@@ -45,7 +45,8 @@ export type { MessageEventGroupProps, MessageEventRowProps, MessageGroupEntry, M
45
45
  export { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from "./MessageRow";
46
46
  export { type MapPaletteColors, type MapTheme, mapPalette } from "./map-palette";
47
47
  export { type MapStyleOptions, mapAttribution, mapStyle } from "./map-style";
48
- export type { MapViewArea, MapViewFit, MapViewFrameProps, MapViewLine, MapViewLineTone, MapViewMarker, MapViewOwnLocation, MapViewPoint, MapViewProps, MapViewStyle, MapViewStyleSource, MapViewTone, } from "./map-view-types";
48
+ export { MAP_SNAPSHOT_MAX_PIXELS, MapSnapshotError, type MapSnapshotErrorCode } from "./map-view-snapshot";
49
+ export type { MapViewArea, MapViewFit, MapViewFrameProps, MapViewHandle, MapViewLine, MapViewLineTone, MapViewMarker, MapViewOwnLocation, MapViewPoint, MapViewProps, MapViewSnapshot, MapViewSnapshotOptions, MapViewStyle, MapViewStyleSource, MapViewTone, } from "./map-view-types";
49
50
  export { MARKDOWN_CALLOUT_CLASSES, MARKDOWN_CALLOUT_ICON_ATTRIBUTES, type MarkdownInfoBlock, type MarkdownInfoBlockRenderInput, type MarkdownInfoBlockType, markdownInfoBlocks, renderMarkdownInfoBlock, scanMarkdownInfoBlock, } from "./markdown-info-blocks";
50
51
  export { type MarkdownLinkInput, type MarkdownReference, type MarkdownReferenceKind, type MarkdownReferenceType, markdownLinkReference, markdownReferenceIcon, markdownReferenceType, markdownReferenceTypeLabel, markStandaloneLinks, renderMarkdownLink, } from "./markdown-links";
51
52
  export { Pagination, type PaginationProps } from "./Pagination";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Validate the glyphs MapLibre will decode before it can silently substitute local fonts.
3
+ * Uses the same PBF reader and 3px bitmap border as MapLibre 6, without allocating glyph images.
4
+ */
5
+ export declare function validateMapGlyphs(data: ArrayBuffer): void;
@@ -1,2 +1,2 @@
1
1
  import { Map, type MapOptions } from "maplibre-gl";
2
- export declare function createMap(options: MapOptions, onResourceError: () => void): Map;
2
+ export declare function createMap(options: MapOptions, resourceFailed: () => void): Map;
@@ -0,0 +1,13 @@
1
+ import type { MapViewSnapshot } from "./map-view-types";
2
+ /** Same decoded RGBA budget as Cloud's isolated print-image worker (64 MiB). */
3
+ export declare const MAP_SNAPSHOT_MAX_PIXELS: number;
4
+ export type MapSnapshotErrorCode = "not_ready" | "resource_failed" | "changed" | "disposed" | "busy" | "too_large" | "timed_out" | "aborted" | "capture_failed";
5
+ export declare class MapSnapshotError extends Error {
6
+ readonly code: MapSnapshotErrorCode;
7
+ constructor(code: MapSnapshotErrorCode);
8
+ }
9
+ export declare function snapshotAborted(signal: AbortSignal): MapSnapshotError;
10
+ /** Also observes late rejection; a cancelled image/font/encoding operation never becomes unhandled. */
11
+ export declare function snapshotWait<T>(promise: Promise<T>, signal: AbortSignal): Promise<T>;
12
+ /** Called synchronously in MapLibre's render event, before WebGL clears its drawing buffer. */
13
+ export declare function rasterizeMapView(root: HTMLElement, base: HTMLCanvasElement, signal: AbortSignal): Promise<MapViewSnapshot>;
@@ -50,8 +50,23 @@ export type MapViewFrameProps = {
50
50
  attribution?: JSX.Element;
51
51
  class?: string;
52
52
  };
53
+ export type MapViewSnapshot = {
54
+ data: Blob;
55
+ width: number;
56
+ height: number;
57
+ };
58
+ export type MapViewSnapshotOptions = {
59
+ signal?: AbortSignal;
60
+ timeoutMs?: number;
61
+ };
62
+ export type MapViewHandle = {
63
+ /** Capture the current complete view; never loads, pans, refits, or retries provider resources. */
64
+ snapshot: (options?: MapViewSnapshotOptions) => Promise<MapViewSnapshot>;
65
+ };
53
66
  export type MapViewProps = Omit<MapViewFrameProps, "attribution"> & {
54
67
  style: MapViewStyleSource;
68
+ /** Browser-only handle; remains safely callable after disposal (rejects disposed). */
69
+ ref?: (handle: MapViewHandle) => void;
55
70
  attribution: JSX.Element;
56
71
  onSelect?: (id: string) => void;
57
72
  infoTile?: (marker: MapViewMarker) => JSX.Element;
@@ -14,6 +14,18 @@ export type ComboboxProps = FieldProps & {
14
14
  fetchData: (query: string, signal: AbortSignal) => Promise<ComboboxOption[]>;
15
15
  onSelect: (option: ComboboxOption) => void;
16
16
  debounceMs?: number;
17
+ /** The query is the field's own value: picking or closing keeps the typed text, and Enter without an active option only closes the list. */
18
+ freeText?: boolean;
19
+ /** Below this many characters nothing loads and the list stays closed. */
20
+ minQueryLength?: number;
21
+ /** This result (by position) is active as soon as results arrive, so Enter takes it. */
22
+ autoHighlight?: number;
23
+ /** Replaces the results with a host-owned notice, such as an exhausted quota; nothing loads while it is set. */
24
+ status?: JSX.Element;
25
+ /** Shown instead of the default text when a search finds nothing. */
26
+ empty?: JSX.Element;
27
+ /** One line under the results, such as their source. */
28
+ footer?: JSX.Element;
17
29
  };
18
30
  export declare function Combobox(props: ComboboxProps): JSX.Element;
19
31
  export default Combobox;
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from "solid-js";
2
2
  import type { Completion } from "./completion";
3
3
  import type { ValueFieldProps } from "./field-contract";
4
- export type TextInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "onChange" | "onInput" | "prefix" | "suffix" | "type" | "value" | keyof ValueFieldProps<string>> & ValueFieldProps<string> & {
4
+ export type TextInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "onChange" | "onInput" | "onKeyDown" | "prefix" | "suffix" | "type" | "value" | keyof ValueFieldProps<string>> & ValueFieldProps<string> & {
5
5
  minLength?: number;
6
6
  maxLength?: number;
7
7
  type?: "text" | "search" | "email" | "url" | "tel";
@@ -21,6 +21,7 @@ export type TextInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "on
21
21
  password?: boolean;
22
22
  markdown?: boolean;
23
23
  onSubmit?: () => void;
24
+ onKeyDown?: JSX.EventHandlerUnion<HTMLInputElement | HTMLTextAreaElement, KeyboardEvent>;
24
25
  lines?: number;
25
26
  abbreviations?: Record<string, string>;
26
27
  completions?: readonly Completion[];
@@ -335,7 +335,10 @@ export type AppWorkspaceSidebarItemStatusProps = {
335
335
  unread?: number | boolean;
336
336
  /** Marks unread items that mention the person with "@". */
337
337
  mention?: boolean;
338
- /** Shows a muted bell. */
338
+ /**
339
+ * Shows a muted bell, and the item reads as set aside: its label in the muted ink without unread weight, and a
340
+ * mention count without its fill.
341
+ */
339
342
  muted?: boolean;
340
343
  /**
341
344
  * Items that wait for the person, such as requests to approve, in the unread slot instead of `unread`. `label` is
@@ -6,6 +6,8 @@ export type ScrollAreaProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children
6
6
  viewportSize?: "compact";
7
7
  orientation?: "vertical" | "horizontal";
8
8
  scrollPreserveKey?: string | false;
9
+ /** Keep 0.5 rem inside both side edges, like a workspace column; with a mouse the end one is a fixed scroll track. */
10
+ inset?: boolean;
9
11
  class?: string;
10
12
  };
11
13
  export declare function ScrollArea(props: ScrollAreaProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2b/ui",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Production-ready components for SolidJS applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -78,6 +78,7 @@
78
78
  "dompurify": "3.4.17",
79
79
  "maplibre-gl": "6.14.0",
80
80
  "marked": "18.0.14",
81
+ "pbf": "5.1.2",
81
82
  "qr-scanner": "1.4.2"
82
83
  },
83
84
  "peerDependencies": {