@k2b/ui 0.55.0 → 0.57.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/SplitButton.js +5 -7
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +16 -7
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +6 -5
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +28 -27
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/content/Lightbox.js +917 -283
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/PdfPages.js +8 -3
- package/dist/browser/content/PdfPages.js.map +1 -1
- package/dist/browser/content/PdfThumbnails.js +271 -0
- package/dist/browser/content/PdfThumbnails.js.map +1 -0
- package/dist/browser/content/PdfViewer.js +11 -3
- package/dist/browser/content/PdfViewer.js.map +1 -1
- package/dist/browser/content/Timeline.js +116 -117
- package/dist/browser/content/Timeline.js.map +1 -1
- package/dist/browser/content/code-highlight.js +24 -11
- package/dist/browser/content/code-highlight.js.map +1 -1
- package/dist/browser/content/index.js +5 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/lightbox-messages.js +64 -18
- package/dist/browser/content/lightbox-messages.js.map +1 -1
- package/dist/browser/content/lightbox-renderers.js +6 -0
- package/dist/browser/content/lightbox-renderers.js.map +1 -0
- package/dist/browser/content/map-view-worker.js +3 -3
- package/dist/browser/content/pdf-messages.js +16 -2
- package/dist/browser/content/pdf-messages.js.map +1 -1
- package/dist/browser/content/pdf-viewer-engine.js +15 -15
- package/dist/browser/content/pdf-viewer-worker.js +4 -5
- package/dist/browser/feedback/prompt-confirm.js +2 -0
- package/dist/browser/feedback/prompt-confirm.js.map +1 -1
- package/dist/browser/internal/truncated-title.js +9 -0
- package/dist/browser/internal/truncated-title.js.map +1 -0
- package/dist/browser/intl/messages.js +1 -1
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +3 -5
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/FloatingWindow.js +416 -122
- package/dist/browser/layout/FloatingWindow.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +3 -1
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/PersonPopover.js +406 -0
- package/dist/browser/layout/PersonPopover.js.map +1 -0
- package/dist/browser/layout/floating-window-geometry.js +58 -2
- package/dist/browser/layout/floating-window-geometry.js.map +1 -1
- package/dist/browser/layout/floating-window-messages.js +12 -0
- package/dist/browser/layout/floating-window-messages.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/ssr/actions/CommandMenu.js +2 -2
- package/dist/ssr/actions/CommandMenu.js.map +1 -1
- package/dist/ssr/actions/SplitButton.js +5 -7
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +16 -7
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +6 -5
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +31 -30
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +659 -150
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/PdfPages.js +8 -3
- package/dist/ssr/content/PdfPages.js.map +1 -1
- package/dist/ssr/content/PdfThumbnails.js +189 -0
- package/dist/ssr/content/PdfThumbnails.js.map +1 -0
- package/dist/ssr/content/PdfViewer.js +11 -3
- package/dist/ssr/content/PdfViewer.js.map +1 -1
- package/dist/ssr/content/Timeline.js +2 -5
- package/dist/ssr/content/Timeline.js.map +1 -1
- package/dist/ssr/content/code-highlight.js +24 -11
- package/dist/ssr/content/code-highlight.js.map +1 -1
- package/dist/ssr/content/index.js +5 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/lightbox-messages.js +64 -18
- package/dist/ssr/content/lightbox-messages.js.map +1 -1
- package/dist/ssr/content/lightbox-renderers.js +6 -0
- package/dist/ssr/content/lightbox-renderers.js.map +1 -0
- package/dist/ssr/content/pdf-messages.js +16 -2
- package/dist/ssr/content/pdf-messages.js.map +1 -1
- package/dist/ssr/feedback/prompt-confirm.js +1 -0
- package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
- package/dist/ssr/inputs/ChoiceInputs.js +2 -2
- package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
- package/dist/ssr/inputs/SignatureInput.js +2 -2
- package/dist/ssr/inputs/SignatureInput.js.map +1 -1
- package/dist/ssr/inputs/markdown/SlashCommands.js +2 -2
- package/dist/ssr/inputs/markdown/SlashCommands.js.map +1 -1
- package/dist/ssr/internal/truncated-title.js +9 -0
- package/dist/ssr/internal/truncated-title.js.map +1 -0
- package/dist/ssr/intl/messages.js +1 -1
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +1 -4
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/FloatingWindow.js +286 -73
- package/dist/ssr/layout/FloatingWindow.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +1 -0
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/PersonPopover.js +248 -0
- package/dist/ssr/layout/PersonPopover.js.map +1 -0
- package/dist/ssr/layout/floating-window-geometry.js +58 -2
- package/dist/ssr/layout/floating-window-geometry.js.map +1 -1
- package/dist/ssr/layout/floating-window-messages.js +12 -0
- package/dist/ssr/layout/floating-window-messages.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/SplitButton.d.ts +2 -0
- package/dist/types/actions/Toolbar.d.ts +6 -0
- package/dist/types/chat/ChatComposer.d.ts +1 -0
- package/dist/types/content/Lightbox.d.ts +54 -14
- package/dist/types/content/PdfPages.d.ts +7 -1
- package/dist/types/content/PdfThumbnails.d.ts +26 -0
- package/dist/types/content/PdfViewer.d.ts +12 -3
- package/dist/types/content/index.d.ts +4 -2
- package/dist/types/content/lightbox-messages.d.ts +31 -8
- package/dist/types/content/lightbox-renderers.d.ts +3 -0
- package/dist/types/content/pdf-messages.d.ts +7 -0
- package/dist/types/internal/truncated-title.d.ts +7 -0
- package/dist/types/layout/FloatingWindow.d.ts +29 -1
- package/dist/types/layout/PersonPopover.d.ts +70 -0
- package/dist/types/layout/floating-window-geometry.d.ts +20 -3
- package/dist/types/layout/floating-window-messages.d.ts +6 -0
- package/dist/types/layout/index.d.ts +3 -2
- package/package.json +20 -20
|
@@ -2,6 +2,8 @@ import { type JSX } from "solid-js";
|
|
|
2
2
|
import { type ButtonProps } from "./Button";
|
|
3
3
|
import { type DropdownItem, type DropdownPosition, type DropdownProps } from "./Dropdown";
|
|
4
4
|
export type SplitButtonProps = Omit<ButtonProps, "align"> & {
|
|
5
|
+
/** Classes for the whole control, so host tone tokens such as `--k2b-action-solid` reach both segments. */
|
|
6
|
+
class?: string;
|
|
5
7
|
/** Actions shown from the secondary menu trigger. */
|
|
6
8
|
items: readonly DropdownItem[];
|
|
7
9
|
/** Optional selection menu in place of the primary immediate action. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
|
+
import { type DropdownItem } from "./Dropdown";
|
|
2
3
|
export type ToolbarProps = {
|
|
3
4
|
children: JSX.Element;
|
|
4
5
|
label: string;
|
|
@@ -14,6 +15,11 @@ export type ToolbarProps = {
|
|
|
14
15
|
* ignore it.
|
|
15
16
|
*/
|
|
16
17
|
tone?: "danger";
|
|
18
|
+
/**
|
|
19
|
+
* Rarer commands of a floating toolbar that always live in More, such as Copy to or Move to trash for a selection.
|
|
20
|
+
* More then always shows; actions that move there on a narrow row come first, these follow in their own group.
|
|
21
|
+
*/
|
|
22
|
+
moreItems?: readonly DropdownItem[];
|
|
17
23
|
class?: string;
|
|
18
24
|
};
|
|
19
25
|
export type ToolbarActionProps = {
|
|
@@ -218,6 +218,7 @@ export type ChatComposerProps = {
|
|
|
218
218
|
submitDisabled?: boolean;
|
|
219
219
|
error?: string;
|
|
220
220
|
focusToken?: unknown;
|
|
221
|
+
/** Names the draft. A new value starts another draft and closes the open lists; the same value keeps them. */
|
|
221
222
|
draftKey?: unknown;
|
|
222
223
|
class?: string;
|
|
223
224
|
/**
|
|
@@ -1,26 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { FileViewContent } from "./FileView";
|
|
3
|
+
import { type FileViewFile } from "./file-view-preview";
|
|
4
|
+
/** One more command for the shown file, in the action pill before Download: a short label, its icon, and what it does. */
|
|
2
5
|
export type LightboxAction = {
|
|
3
6
|
label: string;
|
|
4
7
|
icon: string;
|
|
5
8
|
onClick: () => void;
|
|
6
9
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* One file the Lightbox can show. Give what the file has: `src` for an image, video, audio file or PDF the browser
|
|
12
|
+
* reads from an address; `load` for text, Markdown, code or PDF bytes; `preview` for a document that only exists as
|
|
13
|
+
* a preview PDF, such as an Office file. `file` names the type when the name alone does not.
|
|
14
|
+
*/
|
|
15
|
+
export type LightboxItem = {
|
|
16
|
+
/** The name in the pill at the top and in the dialog's accessible name. It never wraps. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Quiet facts after the name, such as "PDF · 5.1 MB". */
|
|
19
|
+
meta?: string;
|
|
20
|
+
/** Path, media type and size; they choose the renderer as in `FileView`. Defaults to the name. */
|
|
21
|
+
file?: FileViewFile;
|
|
22
|
+
/**
|
|
23
|
+
* An address on this site the browser reads directly: an image, video, audio file, or PDF. A function resolves it
|
|
24
|
+
* when the file is shown, such as a short-lived signed address; "Try again" and a video that runs past its address
|
|
25
|
+
* ask it for a fresh one. Every loader receives a signal that aborts when the person moves on or closes.
|
|
26
|
+
*/
|
|
27
|
+
src?: string | ((signal: AbortSignal) => Promise<string>);
|
|
28
|
+
/** Loads text, Markdown, code, or a PDF's bytes. */
|
|
29
|
+
load?: (signal: AbortSignal) => Promise<FileViewContent>;
|
|
30
|
+
/** Loads a preview PDF, such as one converted from an Office file. A rejection shows "Preview not possible". */
|
|
31
|
+
preview?: (signal: AbortSignal) => Promise<Blob>;
|
|
32
|
+
/** A small image for the film strip; without it the strip shows the file's type icon. */
|
|
33
|
+
thumbnail?: string;
|
|
34
|
+
/** Adds Download to the action pill. */
|
|
10
35
|
downloadUrl?: string;
|
|
11
|
-
/**
|
|
36
|
+
/** Adds Download for a file the app hands out itself, such as through a short-lived lease. */
|
|
37
|
+
onDownload?: () => void;
|
|
38
|
+
/** Adds the blue Open pill at the front, for an app that can open the file. The caller chooses where it leads. */
|
|
39
|
+
open?: {
|
|
40
|
+
label?: string;
|
|
41
|
+
onOpen: () => void;
|
|
42
|
+
};
|
|
43
|
+
/** More commands for this file, before Download. */
|
|
12
44
|
actions?: readonly LightboxAction[];
|
|
13
|
-
/** A small version for the thumbnail strip, shown from four images on; without it the strip loads `src`. */
|
|
14
|
-
thumbnail?: string;
|
|
15
45
|
};
|
|
16
|
-
type LightboxProps = {
|
|
17
|
-
|
|
18
|
-
|
|
46
|
+
export type LightboxProps = {
|
|
47
|
+
items: readonly LightboxItem[];
|
|
48
|
+
/** The shown item; the caller owns it, so it can follow a selection behind the Lightbox. */
|
|
49
|
+
index: number;
|
|
50
|
+
onIndexChange: (index: number) => void;
|
|
19
51
|
onClose: () => void;
|
|
52
|
+
/** The caller's own control in the action pill after Open, such as "Select" in a file chooser. */
|
|
53
|
+
actions?: (item: LightboxItem) => JSX.Element;
|
|
20
54
|
};
|
|
21
55
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
56
|
+
* The one large view of a file anywhere in Cloud: an image, PDF, video, audio file, text, Markdown, code, or a document
|
|
57
|
+
* shown through its preview PDF, and for anything else its icon, facts and Download. It loads the file itself and
|
|
58
|
+
* shows every state: a placeholder after a short wait, a failure with "Try again", and "Preview not possible".
|
|
59
|
+
*
|
|
60
|
+
* The name sits in a pill at the top left; Open (when the caller gives a target), the caller's commands, Download
|
|
61
|
+
* and Close in a pill at the top right. Large round buttons at the screen edges step between files, as do ← and →
|
|
62
|
+
* and the film strip from two files on; there is no "2 / 8" counter. The only pill at the bottom holds zoom and the
|
|
63
|
+
* page. Escape, Close, a press beside the file or a swipe down close it, and focus returns to the opener. On a phone
|
|
64
|
+
* it fills the screen and a swipe steps between files.
|
|
24
65
|
*/
|
|
25
|
-
export default function Lightbox(props: LightboxProps):
|
|
26
|
-
export {};
|
|
66
|
+
export default function Lightbox(props: LightboxProps): JSX.Element;
|
|
@@ -14,6 +14,8 @@ export type PdfPagesProps = {
|
|
|
14
14
|
title: string;
|
|
15
15
|
/** Without the zoom bar, always fitted. Defaults to `true`. */
|
|
16
16
|
zoom?: boolean;
|
|
17
|
+
/** With `zoom` false, a factor of the fitted width, for a host that zooms with its own controls. Defaults to 1. */
|
|
18
|
+
scale?: number;
|
|
17
19
|
/**
|
|
18
20
|
* How a fitted document fills the area: `"width"` (the default) fits each page to the area's width, for reading;
|
|
19
21
|
* `"page"` shows the whole first page in the area's height, narrower, for a preview beside other content.
|
|
@@ -23,9 +25,13 @@ export type PdfPagesProps = {
|
|
|
23
25
|
/** Shows only this page (zero-based) instead of all pages one below the other. */
|
|
24
26
|
page?: number;
|
|
25
27
|
/** The first visible page is drawn; a host can drop its loading state. */
|
|
26
|
-
onReady?: (
|
|
28
|
+
onReady?: (document: {
|
|
29
|
+
pages: number;
|
|
30
|
+
}) => void;
|
|
27
31
|
/** The document could not be opened, or a page could not be drawn and has no image yet. */
|
|
28
32
|
onError?: (error: unknown) => void;
|
|
33
|
+
/** The page in the middle of the view changed (zero-based), for a host that shows "Page 2 / 4" itself. */
|
|
34
|
+
onPage?: (index: number) => void;
|
|
29
35
|
/** Icons after the fit, in this order. */
|
|
30
36
|
actions?: readonly PdfPagesAction[];
|
|
31
37
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export type PdfThumbnailsProps = {
|
|
3
|
+
/** The PDF's bytes; `null` while the host still loads them, which shows placeholders in place. */
|
|
4
|
+
data: Blob | ArrayBuffer | null;
|
|
5
|
+
/** The document's name, for the list's accessible name. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Shows at most this many pages; a quiet "+n" tile says how many follow. */
|
|
8
|
+
limit?: number;
|
|
9
|
+
/** `sm` is a strip of small tiles beside a name; `md` is a grid of pages to choose from. Defaults to `sm`. */
|
|
10
|
+
size?: "sm" | "md";
|
|
11
|
+
/** Zero-based pages that are chosen. With `onToggle`, every page is a toggle button. */
|
|
12
|
+
selected?: ReadonlySet<number>;
|
|
13
|
+
onToggle?: (index: number) => void;
|
|
14
|
+
/** The document's page count, once it opened. */
|
|
15
|
+
onPages?: (count: number) => void;
|
|
16
|
+
/** The document could not be opened; the tiles say so in place. */
|
|
17
|
+
onError?: (error: unknown) => void;
|
|
18
|
+
class?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Small pictures of a PDF's pages, drawn by pdf.js in the browser: a strip beside a file in a list, or a grid of pages
|
|
22
|
+
* to pick. Every tile keeps the page's proportions from the moment the document opens, so nothing moves while pages
|
|
23
|
+
* are drawn one after another; a tile far below the view waits until it scrolls near.
|
|
24
|
+
*/
|
|
25
|
+
export declare function PdfThumbnails(props: PdfThumbnailsProps): JSX.Element;
|
|
26
|
+
export default PdfThumbnails;
|
|
@@ -26,6 +26,11 @@ export type PdfViewerProps = {
|
|
|
26
26
|
open?: boolean | string;
|
|
27
27
|
/** Without the zoom controls, always fitted. Defaults to `true`. */
|
|
28
28
|
zoom?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* With `zoom` false, a factor of the fitted width, such as 1.5, for a host that zooms with its own controls, like
|
|
31
|
+
* `Lightbox`. Defaults to 1.
|
|
32
|
+
*/
|
|
33
|
+
scale?: number;
|
|
29
34
|
/**
|
|
30
35
|
* How a fitted document fills the area: `"width"` (the default) fits each page to the area's width, for reading;
|
|
31
36
|
* `"page"` shows the whole first page in the area's height, narrower, for a preview beside other content.
|
|
@@ -34,10 +39,14 @@ export type PdfViewerProps = {
|
|
|
34
39
|
fit?: "width" | "page";
|
|
35
40
|
/** Shows only this page (zero-based) instead of all pages one below the other. */
|
|
36
41
|
page?: number;
|
|
37
|
-
/** The first visible page is drawn. */
|
|
38
|
-
onReady?: (
|
|
39
|
-
|
|
42
|
+
/** The first visible page is drawn; `pages` counts the document's pages, such as for a host's "4 pages". */
|
|
43
|
+
onReady?: (document: {
|
|
44
|
+
pages: number;
|
|
45
|
+
}) => void;
|
|
46
|
+
/** The request failed, or pdf.js could not open or draw the document; the viewer shows its error state. */
|
|
40
47
|
onError?: (error: unknown) => void;
|
|
48
|
+
/** The page in the middle of the view changed (zero-based), for a host that shows "Page 2 / 4" itself. */
|
|
49
|
+
onPage?: (index: number) => void;
|
|
41
50
|
class?: string;
|
|
42
51
|
};
|
|
43
52
|
/**
|
|
@@ -34,13 +34,14 @@ export { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFile
|
|
|
34
34
|
export { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from "./FileGrid";
|
|
35
35
|
export { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from "./FileTree";
|
|
36
36
|
export { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from "./FileTypeIcon";
|
|
37
|
-
export {
|
|
37
|
+
export { default as FileView, type FileViewContent, type FileViewProps, type FileViewRenderer, type FileViewRendererProps, formatFileViewSize, } from "./FileView";
|
|
38
38
|
export { FlowAmount, type FlowAmountDirection, type FlowAmountProps, flowDirection } from "./FlowAmount";
|
|
39
|
+
export { canPreviewFile, type FileViewFile, type FileViewPreviewKind, getFileViewPreviewKind } from "./file-view-preview";
|
|
39
40
|
export type { KbdProps } from "./Kbd";
|
|
40
41
|
export { Kbd } from "./Kbd";
|
|
41
42
|
export type { LabelChipProps } from "./LabelChip";
|
|
42
43
|
export { LabelChip } from "./LabelChip";
|
|
43
|
-
export type { LightboxAction,
|
|
44
|
+
export type { LightboxAction, LightboxItem, LightboxProps } from "./Lightbox";
|
|
44
45
|
export { default as Lightbox } from "./Lightbox";
|
|
45
46
|
export type { LoadMoreProps } from "./LoadMore";
|
|
46
47
|
export { LoadMore } from "./LoadMore";
|
|
@@ -63,6 +64,7 @@ export type { MapViewArea, MapViewFit, MapViewFrameProps, MapViewHandle, MapView
|
|
|
63
64
|
export { MARKDOWN_CALLOUT_CLASSES, MARKDOWN_CALLOUT_ICON_ATTRIBUTES, type MarkdownInfoBlock, type MarkdownInfoBlockRenderInput, type MarkdownInfoBlockType, markdownInfoBlocks, renderMarkdownInfoBlock, scanMarkdownInfoBlock, } from "./markdown-info-blocks";
|
|
64
65
|
export { type MarkdownLinkInput, type MarkdownReference, type MarkdownReferenceKind, type MarkdownReferenceType, markdownLinkReference, markdownReferenceIcon, markdownReferenceType, markdownReferenceTypeLabel, markStandaloneLinks, renderMarkdownLink, } from "./markdown-links";
|
|
65
66
|
export { Pagination, type PaginationProps } from "./Pagination";
|
|
67
|
+
export { PdfThumbnails, type PdfThumbnailsProps } from "./PdfThumbnails";
|
|
66
68
|
export type { PdfViewerProps, PdfViewerRequest } from "./PdfViewer";
|
|
67
69
|
export { default as PdfViewer } from "./PdfViewer";
|
|
68
70
|
export type { RangeOption, RangePickerProps } from "./RangePicker";
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
declare const lightboxMessages: import("@k2b/stdlib").Catalog<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
actions: string;
|
|
3
|
+
close: string;
|
|
4
|
+
closeHint: string;
|
|
5
|
+
download: string;
|
|
6
|
+
open: string;
|
|
7
|
+
previous: string;
|
|
8
|
+
next: string;
|
|
9
|
+
files: string;
|
|
10
|
+
view: string;
|
|
11
|
+
zoomIn: string;
|
|
12
|
+
zoomOut: string;
|
|
13
|
+
percent: ({ value }: {
|
|
14
|
+
value: number;
|
|
10
15
|
}) => string;
|
|
16
|
+
page: ({ number, total }: {
|
|
17
|
+
number: number;
|
|
18
|
+
total: number;
|
|
19
|
+
}) => string;
|
|
20
|
+
sheet: ({ number, total }: {
|
|
21
|
+
number: number;
|
|
22
|
+
total: number;
|
|
23
|
+
}) => string;
|
|
24
|
+
loading: string;
|
|
25
|
+
converting: string;
|
|
26
|
+
failed: string;
|
|
27
|
+
failedHint: string;
|
|
28
|
+
retry: string;
|
|
29
|
+
notPossible: string;
|
|
30
|
+
notPossibleHint: string;
|
|
31
|
+
noPreview: string;
|
|
32
|
+
noPreviewHint: string;
|
|
33
|
+
viewOnly: string;
|
|
11
34
|
}>;
|
|
12
35
|
export type LightboxMessages = ReturnType<(typeof lightboxMessages)["resolve"]>["t"];
|
|
13
36
|
/** Resolved from the inherited render locale. */
|
|
@@ -26,6 +26,13 @@ declare const pdfMessages: import("@k2b/stdlib").Catalog<{
|
|
|
26
26
|
}) => string;
|
|
27
27
|
pdfFitWidthLabel: string;
|
|
28
28
|
pdfFitPageLabel: string;
|
|
29
|
+
pdfThumbnailPage: ({ number }: {
|
|
30
|
+
number: number;
|
|
31
|
+
}) => string;
|
|
32
|
+
pdfThumbnailMore: ({ count }: {
|
|
33
|
+
count: number;
|
|
34
|
+
}) => string;
|
|
35
|
+
pdfThumbnailsFailed: string;
|
|
29
36
|
}>;
|
|
30
37
|
export type PdfMessages = ReturnType<(typeof pdfMessages)["resolve"]>["t"];
|
|
31
38
|
/** Resolved from the inherited render locale. */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Titles in headers stay on one line and end with an ellipsis, so a long name never moves what follows. Pointing at a
|
|
3
|
+
* cut title shows all of it as the native hint; assistive technology reads the full text content either way.
|
|
4
|
+
*/
|
|
5
|
+
export declare const showTruncatedTitle: (event: PointerEvent & {
|
|
6
|
+
currentTarget: HTMLElement;
|
|
7
|
+
}) => void;
|
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
|
-
|
|
2
|
+
import { type FloatingWindowRect } from "./floating-window-geometry";
|
|
3
|
+
export { type FloatingWindowBounds, type FloatingWindowRect, fitFloatingWindowRect } from "./floating-window-geometry";
|
|
4
|
+
/** `minimized` is a bar at the bottom edge with the content kept alive; `maximized` covers the area above a scrim. */
|
|
5
|
+
export type FloatingWindowState = "normal" | "minimized" | "maximized";
|
|
3
6
|
export type FloatingWindowProps = {
|
|
7
|
+
/** One line in the header; a long title ends with an ellipsis and shows in full on hover. */
|
|
4
8
|
title: string;
|
|
5
9
|
icon?: string;
|
|
10
|
+
/** A short status right after the title, such as "Saved". On a phone it sits below the title. */
|
|
11
|
+
status?: JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Actions of the content in the header, such as Send, after the title and before the window controls. A minimized bar
|
|
14
|
+
* hides them. On a phone sheet they stand at the end of the header, within reach above the keyboard.
|
|
15
|
+
*/
|
|
16
|
+
actions?: JSX.Element;
|
|
6
17
|
children: JSX.Element;
|
|
7
18
|
onClose: () => void;
|
|
19
|
+
/** The current state when the application owns it; pair it with `onStateChange`. */
|
|
20
|
+
state?: FloatingWindowState;
|
|
21
|
+
/** The state the window opens in when the application does not own it. Defaults to `normal`. */
|
|
22
|
+
defaultState?: FloatingWindowState;
|
|
23
|
+
/** Called when the person minimizes, maximizes, or restores the window. */
|
|
24
|
+
onStateChange?: (state: FloatingWindowState) => void;
|
|
25
|
+
/** Where the window stands, in viewport pixels, such as a remembered place. Without it the window places itself. */
|
|
26
|
+
rect?: FloatingWindowRect;
|
|
27
|
+
/** Called when the person moved or resized the window, with its new place. */
|
|
28
|
+
onRectChange?: (rect: FloatingWindowRect) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Where a window without `rect` opens: `center` (default) in the middle of the area, or `dock` at the bottom end, in
|
|
31
|
+
* one row with minimized windows, until the person moves it.
|
|
32
|
+
*/
|
|
33
|
+
placement?: "center" | "dock";
|
|
34
|
+
/** The element whose box the window lives in: it stays inside it, docks at its bottom, and maximizes over it. Defaults to the viewport. */
|
|
35
|
+
area?: () => HTMLElement | null | undefined;
|
|
8
36
|
initialWidth?: number;
|
|
9
37
|
initialHeight?: number;
|
|
10
38
|
minWidth?: number;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export type PersonPopoverPhone = {
|
|
3
|
+
number: string /** Such as "Office" or "Mobile". */;
|
|
4
|
+
label?: string;
|
|
5
|
+
};
|
|
6
|
+
/** A row of the list section, such as an earlier conversation: a link or a button. */
|
|
7
|
+
export type PersonPopoverLink = {
|
|
8
|
+
label: string /** A quiet second line, such as a date and a count. */;
|
|
9
|
+
meta?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
onSelect?: () => void;
|
|
12
|
+
};
|
|
13
|
+
/** A menu-like row at the end of the card. Choosing it closes the card. */
|
|
14
|
+
export type PersonPopoverAction = {
|
|
15
|
+
label: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
onSelect?: () => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** A quiet line in place of what could not load, with a retry. */
|
|
22
|
+
export type PersonPopoverError = {
|
|
23
|
+
message: string;
|
|
24
|
+
onRetry: () => void /** Defaults to the shared "Retry". */;
|
|
25
|
+
retryLabel?: string;
|
|
26
|
+
};
|
|
27
|
+
export type PersonPopoverList = {
|
|
28
|
+
title: string;
|
|
29
|
+
items?: readonly PersonPopoverLink[];
|
|
30
|
+
/** Two placeholder rows in the size of real rows while the list loads. */
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
error?: PersonPopoverError;
|
|
33
|
+
/** A quiet line when the list is empty; without it an empty list hides the section. */
|
|
34
|
+
empty?: string;
|
|
35
|
+
};
|
|
36
|
+
export type PersonPopoverProps = {
|
|
37
|
+
/** The control the card belongs to, such as a sender name. The card is open while this is set. */
|
|
38
|
+
anchor: HTMLElement | null | undefined;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
/** The card's accessible name; defaults to the name or the address. */
|
|
41
|
+
label?: string;
|
|
42
|
+
/** The person's name. Without it the address heads the card. */
|
|
43
|
+
name?: string;
|
|
44
|
+
/** An image URL for the avatar; without it the avatar shows initials. */
|
|
45
|
+
avatar?: string | null;
|
|
46
|
+
/** One secondary line, such as company and role. */
|
|
47
|
+
detail?: string;
|
|
48
|
+
/** Shown with a copy button. */
|
|
49
|
+
email?: string;
|
|
50
|
+
/** Each number is a `tel:` link with an optional label. */
|
|
51
|
+
phones?: readonly PersonPopoverPhone[];
|
|
52
|
+
/** While the person's details load, placeholders stand where the detail line and the contact rows will be. */
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
/** The details could not load: a quiet line with a retry stands in their place. */
|
|
55
|
+
error?: PersonPopoverError;
|
|
56
|
+
/** An optional section with a heading and link rows, such as earlier conversations. */
|
|
57
|
+
list?: PersonPopoverList;
|
|
58
|
+
actions?: readonly PersonPopoverAction[];
|
|
59
|
+
align?: "start" | "end";
|
|
60
|
+
side?: "below" | "above";
|
|
61
|
+
/** Desktop width, such as `22rem`. On a phone the card is a bottom sheet. */
|
|
62
|
+
width?: string;
|
|
63
|
+
class?: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A card about one person, anchored to the control that names them: avatar, name, one secondary line, contact rows,
|
|
67
|
+
* an optional list such as earlier conversations, and actions. The application supplies every text and decides what
|
|
68
|
+
* the actions do; the card owns layout, loading, partial and error states, and keyboard behaviour.
|
|
69
|
+
*/
|
|
70
|
+
export declare function PersonPopover(props: PersonPopoverProps): JSX.Element;
|
|
@@ -4,8 +4,25 @@ export type FloatingWindowRect = {
|
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
/** The area a window lives in, in viewport pixels. Without `x` and `y` it starts at the top left corner. */
|
|
8
|
+
export type FloatingWindowBounds = {
|
|
9
|
+
x?: number;
|
|
10
|
+
y?: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
export type FloatingWindowSize = {
|
|
9
15
|
width: number;
|
|
10
16
|
height: number;
|
|
11
|
-
}
|
|
17
|
+
};
|
|
18
|
+
export declare const FLOATING_WINDOW_VIEWPORT_GAP = 16;
|
|
19
|
+
/** A minimized window is a bar as tall as the window header. */
|
|
20
|
+
export declare const FLOATING_WINDOW_BAR: FloatingWindowSize;
|
|
21
|
+
export declare const fitFloatingWindowRect: (rect: FloatingWindowRect, minWidth: number, minHeight: number, viewport: FloatingWindowBounds) => FloatingWindowRect;
|
|
22
|
+
/** A maximized window covers almost the whole area. */
|
|
23
|
+
export declare const maximizedFloatingWindowRect: (bounds: FloatingWindowBounds) => FloatingWindowRect;
|
|
24
|
+
/**
|
|
25
|
+
* Lines docked windows up along the bottom edge of the area, the first at the end. A row that is full continues
|
|
26
|
+
* above the previous one, so no two docked windows overlap. A window wider than the area shrinks to fit it.
|
|
27
|
+
*/
|
|
28
|
+
export declare const layoutFloatingWindowDock: (sizes: readonly FloatingWindowSize[], bounds: FloatingWindowBounds) => FloatingWindowRect[];
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
declare const floatingWindowMessages: import("@k2b/stdlib").Catalog<{
|
|
2
2
|
closeWindow: string;
|
|
3
|
+
minimizeWindow: string;
|
|
4
|
+
maximizeWindow: string;
|
|
5
|
+
restoreSize: string;
|
|
6
|
+
restoreWindow: ({ title }: {
|
|
7
|
+
title: string;
|
|
8
|
+
}) => string;
|
|
3
9
|
moveWindow: ({ title }: {
|
|
4
10
|
title: string;
|
|
5
11
|
}) => string;
|
|
@@ -20,8 +20,8 @@ export { DetailAccess, DetailLinks, DetailPresence, DetailPresenceSlot, DetailPr
|
|
|
20
20
|
export { DETAILS_ICON, DetailsToggle, type DetailsToggleProps } from "./DetailsToggle";
|
|
21
21
|
export type { DiscussionComposerProps, DiscussionItemProps, DiscussionListProps, DiscussionProps } from "./Discussion";
|
|
22
22
|
export { default as Discussion } from "./Discussion";
|
|
23
|
-
export type { FloatingWindowClose, FloatingWindowProps, OpenFloatingWindowOptions, } from "./FloatingWindow";
|
|
24
|
-
export { default as FloatingWindow, type FloatingWindowRect, fitFloatingWindowRect, openFloatingWindow, } from "./FloatingWindow";
|
|
23
|
+
export type { FloatingWindowClose, FloatingWindowProps, FloatingWindowState, OpenFloatingWindowOptions, } from "./FloatingWindow";
|
|
24
|
+
export { default as FloatingWindow, type FloatingWindowBounds, type FloatingWindowRect, fitFloatingWindowRect, openFloatingWindow, } from "./FloatingWindow";
|
|
25
25
|
export type { MobileShellHeaderProps, MobileShellProps, MobileShellSidebarItem, MobileShellSidebarProps } from "./MobileShell";
|
|
26
26
|
export { default as MobileShell, observeMobileShell } from "./MobileShell";
|
|
27
27
|
export { default as Navigation, type NavigationProps } from "./Navigation";
|
|
@@ -34,6 +34,7 @@ export type { PanelHeaderProps } from "./PanelHeader";
|
|
|
34
34
|
export { PanelHeader } from "./PanelHeader";
|
|
35
35
|
export type { PanesItem, PanesProps } from "./Panes";
|
|
36
36
|
export { default as Panes } from "./Panes";
|
|
37
|
+
export { PersonPopover, type PersonPopoverAction, type PersonPopoverError, type PersonPopoverLink, type PersonPopoverList, type PersonPopoverPhone, type PersonPopoverProps, } from "./PersonPopover";
|
|
37
38
|
export type { PullToRefreshProps, PullToRefreshState } from "./PullToRefresh";
|
|
38
39
|
export { default as PullToRefresh } from "./PullToRefresh";
|
|
39
40
|
export { installPageTitleController } from "./page-title-controller";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Production-ready components for SolidJS applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -80,21 +80,21 @@
|
|
|
80
80
|
"prepack": "bun run build"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@codemirror/commands": "6.
|
|
84
|
-
"@codemirror/language": "6.
|
|
85
|
-
"@codemirror/state": "6.7.
|
|
86
|
-
"@codemirror/view": "6.43.
|
|
83
|
+
"@codemirror/commands": "6.11.1",
|
|
84
|
+
"@codemirror/language": "6.13.1",
|
|
85
|
+
"@codemirror/state": "6.7.6",
|
|
86
|
+
"@codemirror/view": "6.43.15",
|
|
87
87
|
"@fontsource/ibm-plex-mono": "5.3.0",
|
|
88
88
|
"@fontsource/ibm-plex-sans": "5.3.0",
|
|
89
89
|
"@k2b/stdlib": "0.32.0",
|
|
90
|
-
"@lezer/highlight": "1.2.
|
|
91
|
-
"@lezer/markdown": "1.
|
|
90
|
+
"@lezer/highlight": "1.2.5",
|
|
91
|
+
"@lezer/markdown": "1.8.1",
|
|
92
92
|
"@tabler/icons-webfont": "3.48.0",
|
|
93
93
|
"dompurify": "3.4.17",
|
|
94
|
-
"maplibre-gl": "6.
|
|
95
|
-
"marked": "18.
|
|
94
|
+
"maplibre-gl": "6.17.0",
|
|
95
|
+
"marked": "18.1.3",
|
|
96
96
|
"pbf": "5.1.2",
|
|
97
|
-
"pdfjs-dist": "6.
|
|
97
|
+
"pdfjs-dist": "6.5.438",
|
|
98
98
|
"qr-scanner": "1.4.2"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
@@ -102,24 +102,24 @@
|
|
|
102
102
|
"solid-js": "^1.9.10"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@babel/core": "8.0
|
|
106
|
-
"@babel/preset-typescript": "8.0.
|
|
107
|
-
"@k2b/ssr": "0.21.
|
|
105
|
+
"@babel/core": "8.1.0",
|
|
106
|
+
"@babel/preset-typescript": "8.0.7",
|
|
107
|
+
"@k2b/ssr": "0.21.2",
|
|
108
108
|
"@types/babel__core": "7.20.5",
|
|
109
109
|
"@types/bun": "1.4.2",
|
|
110
|
-
"axe-core": "4.
|
|
111
|
-
"babel-preset-solid": "1.9.
|
|
110
|
+
"axe-core": "4.14.0",
|
|
111
|
+
"babel-preset-solid": "1.9.16",
|
|
112
112
|
"bun-plugin-tailwind": "0.1.2",
|
|
113
113
|
"emojibase-data": "17.0.0",
|
|
114
114
|
"happy-dom": "20.14.5",
|
|
115
|
-
"hono": "4.13.
|
|
116
|
-
"playwright": "1.
|
|
115
|
+
"hono": "4.13.17",
|
|
116
|
+
"playwright": "1.65.0",
|
|
117
117
|
"seroval": "1.6.7",
|
|
118
|
-
"solid-js": "1.9.
|
|
119
|
-
"tailwindcss": "4.3.
|
|
118
|
+
"solid-js": "1.9.18",
|
|
119
|
+
"tailwindcss": "4.3.5",
|
|
120
120
|
"typescript": "7.0.2",
|
|
121
121
|
"@typescript/typescript6": "6.0.2",
|
|
122
|
-
"@maplibre/maplibre-gl-style-spec": "26.
|
|
122
|
+
"@maplibre/maplibre-gl-style-spec": "26.5.1",
|
|
123
123
|
"fontnik": "0.7.7",
|
|
124
124
|
"yjs": "13.6.33",
|
|
125
125
|
"y-codemirror.next": "0.3.6",
|