@k2b/ui 0.35.0 → 0.37.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.
- package/dist/browser/actions/Dropdown.js +132 -116
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/Tabs.js +18 -15
- package/dist/browser/actions/Tabs.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +58 -25
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/content/MapView.js +128 -13
- package/dist/browser/content/MapView.js.map +1 -1
- package/dist/browser/content/MapViewFrame.js +1 -1
- package/dist/browser/content/MapViewFrame.js.map +1 -1
- package/dist/browser/content/MessageRow.js +164 -152
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/map-view-glyphs.js +23 -0
- package/dist/browser/content/map-view-glyphs.js.map +1 -0
- package/dist/browser/content/map-view-live.js +45 -22
- package/dist/browser/content/map-view-live.js.map +1 -1
- package/dist/browser/content/map-view-snapshot.js +191 -0
- package/dist/browser/content/map-view-snapshot.js.map +1 -0
- package/dist/browser/content/map-view-types.js.map +1 -1
- package/dist/browser/feedback/prompts.js +23 -9
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +164 -82
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/RichSelect.js +86 -67
- package/dist/browser/inputs/RichSelect.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +1 -1
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/internal/keyed-for.js +47 -0
- package/dist/browser/internal/keyed-for.js.map +1 -0
- package/dist/browser/layout/AppWorkspace.js +73 -70
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/ScrollArea.js +4 -1
- package/dist/browser/layout/ScrollArea.js.map +1 -1
- package/dist/browser/text-editor/engine.js +13 -10
- package/dist/browser/text-editor/engine.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +101 -85
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/Tabs.js +12 -9
- package/dist/ssr/actions/Tabs.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +41 -15
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/content/MapView.js +128 -13
- package/dist/ssr/content/MapView.js.map +1 -1
- package/dist/ssr/content/MapViewFrame.js +1 -1
- package/dist/ssr/content/MapViewFrame.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +9 -2
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/map-view-glyphs.js +23 -0
- package/dist/ssr/content/map-view-glyphs.js.map +1 -0
- package/dist/ssr/content/map-view-snapshot.js +191 -0
- package/dist/ssr/content/map-view-snapshot.js.map +1 -0
- package/dist/ssr/content/map-view-types.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +22 -8
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js +79 -28
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/RichSelect.js +47 -28
- package/dist/ssr/inputs/RichSelect.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/internal/keyed-for.js +47 -0
- package/dist/ssr/internal/keyed-for.js.map +1 -0
- package/dist/ssr/layout/AppWorkspace.js +1 -1
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/ScrollArea.js +4 -1
- package/dist/ssr/layout/ScrollArea.js.map +1 -1
- package/dist/ssr/text-editor/engine.js +13 -10
- package/dist/ssr/text-editor/engine.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/content/MapViewFrame.d.ts +1 -1
- package/dist/types/content/MessageRow.d.ts +1 -1
- package/dist/types/content/index.d.ts +2 -1
- package/dist/types/content/map-view-glyphs.d.ts +5 -0
- package/dist/types/content/map-view-live.d.ts +1 -1
- package/dist/types/content/map-view-snapshot.d.ts +13 -0
- package/dist/types/content/map-view-types.d.ts +15 -0
- package/dist/types/feedback/prompts.d.ts +5 -0
- package/dist/types/inputs/Combobox.d.ts +12 -0
- package/dist/types/inputs/TextInput.d.ts +2 -1
- package/dist/types/internal/keyed-for.d.ts +13 -0
- package/dist/types/layout/AppWorkspace.d.ts +4 -1
- package/dist/types/layout/ScrollArea.d.ts +2 -0
- package/dist/types/text-editor/engine.d.ts +1 -1
- package/package.json +4 -2
|
@@ -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,
|
|
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;
|
|
@@ -113,7 +113,7 @@ export type MessageRowProps = {
|
|
|
113
113
|
* the author and time. Defaults to true; `startsMessageGroup` decides it from the previous message.
|
|
114
114
|
*/
|
|
115
115
|
groupStart?: boolean;
|
|
116
|
-
/** Shown next to the name at the start of a group, for example the kind of account. */
|
|
116
|
+
/** Shown next to the name (or own-message time) at the start of a group, for example the kind of account. */
|
|
117
117
|
badge?: JSX.Element;
|
|
118
118
|
/** Send state. Sets a line of fixed height below the message: a clock, a check, or "Not sent" with "Retry". */
|
|
119
119
|
status?: MessageRowStatus;
|
|
@@ -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
|
|
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";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Map, type MapOptions } from "maplibre-gl";
|
|
2
|
-
export declare function createMap(options: MapOptions,
|
|
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;
|
|
@@ -21,6 +21,11 @@ export interface ConfirmOptions extends DialogOptions {
|
|
|
21
21
|
}
|
|
22
22
|
type PromptContent = string | HTMLElement | JSX.Element;
|
|
23
23
|
export type PromptSearchItem<T = unknown> = {
|
|
24
|
+
/**
|
|
25
|
+
* Stable identity of the result, such as its record ID. With it, a newer answer that contains the same result keeps
|
|
26
|
+
* its row, so a click in progress still lands. Without it, each answer replaces the rows.
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
24
29
|
label: string;
|
|
25
30
|
desc?: string;
|
|
26
31
|
icon?: string;
|
|
@@ -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[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* `<For>` that keeps a row's element while its item stays the same: the same object, also when its getters change, or
|
|
4
|
+
* a new object with the same identity (`by`). Hosts rebuild equal items whenever their inputs change; `<For>` would
|
|
5
|
+
* then replace each row, and a row replaced between press and release swallows the click (#2140).
|
|
6
|
+
* Each row reads its current item.
|
|
7
|
+
*/
|
|
8
|
+
export declare function KeyedFor<T>(props: {
|
|
9
|
+
each: readonly T[];
|
|
10
|
+
by: (item: T) => string;
|
|
11
|
+
fallback?: JSX.Element;
|
|
12
|
+
children: (item: () => T, index: () => number) => JSX.Element;
|
|
13
|
+
}): JSX.Element;
|
|
@@ -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
|
-
/**
|
|
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;
|
|
@@ -27,7 +27,7 @@ export declare function createTextEditor(options: TextEditorOptions): {
|
|
|
27
27
|
view: EditorView;
|
|
28
28
|
/** Also re-reads `presentation`, so a host can refresh it, e.g. after a theme change. */
|
|
29
29
|
setMode: (mode: TextEditorMode) => void;
|
|
30
|
-
setLabel: (
|
|
30
|
+
setLabel: (next: string) => void;
|
|
31
31
|
setReadOnly: (readOnly: boolean) => void;
|
|
32
32
|
destroy: () => void;
|
|
33
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Production-ready components for SolidJS applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -73,11 +73,13 @@
|
|
|
73
73
|
"@fontsource/ibm-plex-mono": "5.3.0",
|
|
74
74
|
"@fontsource/ibm-plex-sans": "5.3.0",
|
|
75
75
|
"@k2b/stdlib": "0.30.0",
|
|
76
|
+
"@lezer/highlight": "1.2.4",
|
|
76
77
|
"@lezer/markdown": "1.7.2",
|
|
77
78
|
"@tabler/icons-webfont": "3.48.0",
|
|
78
79
|
"dompurify": "3.4.17",
|
|
79
80
|
"maplibre-gl": "6.14.0",
|
|
80
81
|
"marked": "18.0.14",
|
|
82
|
+
"pbf": "5.1.2",
|
|
81
83
|
"qr-scanner": "1.4.2"
|
|
82
84
|
},
|
|
83
85
|
"peerDependencies": {
|
|
@@ -87,7 +89,7 @@
|
|
|
87
89
|
"devDependencies": {
|
|
88
90
|
"@babel/core": "8.0.6",
|
|
89
91
|
"@babel/preset-typescript": "8.0.1",
|
|
90
|
-
"@k2b/ssr": "0.20.
|
|
92
|
+
"@k2b/ssr": "0.20.2",
|
|
91
93
|
"@types/babel__core": "7.20.5",
|
|
92
94
|
"@types/bun": "1.4.2",
|
|
93
95
|
"axe-core": "4.11.0",
|