@k2b/ui 0.16.0 → 0.18.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/chat/ChatComposer.js +261 -274
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatPrimitives.js +9 -6
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/content/FileView.js +62 -36
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/MarkdownView.js +9 -3
- package/dist/browser/content/MarkdownView.js.map +1 -1
- package/dist/browser/content/VideoPlayer.js +279 -0
- package/dist/browser/content/VideoPlayer.js.map +1 -0
- package/dist/browser/content/file-view-preview.js +2 -2
- package/dist/browser/content/file-view-preview.js.map +1 -1
- package/dist/browser/content/index.js +2 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/markdown-links.js +178 -0
- package/dist/browser/content/markdown-links.js.map +1 -0
- package/dist/browser/inputs/FileDropTarget.js +129 -0
- package/dist/browser/inputs/FileDropTarget.js.map +1 -0
- package/dist/browser/inputs/FileInputs.js +37 -11
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/file-drop.js +338 -0
- package/dist/browser/inputs/file-drop.js.map +1 -0
- package/dist/browser/inputs/index.js +1 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/markdown/MarkdownEditor.js +72 -78
- package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/browser/intl/messages.js +97 -4
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +210 -44
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Navigation.js +278 -170
- package/dist/browser/layout/Navigation.js.map +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/navigation-model.js +3 -1
- package/dist/browser/layout/navigation-model.js.map +1 -1
- package/dist/browser/surfaces/NoticeCard.js +47 -44
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +59 -48
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +9 -6
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/content/FileView.js +30 -6
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/MarkdownView.js +9 -3
- package/dist/ssr/content/MarkdownView.js.map +1 -1
- package/dist/ssr/content/VideoPlayer.js +208 -0
- package/dist/ssr/content/VideoPlayer.js.map +1 -0
- package/dist/ssr/content/file-view-preview.js +2 -2
- package/dist/ssr/content/file-view-preview.js.map +1 -1
- package/dist/ssr/content/index.js +2 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/markdown-links.js +178 -0
- package/dist/ssr/content/markdown-links.js.map +1 -0
- package/dist/ssr/inputs/FileDropTarget.js +103 -0
- package/dist/ssr/inputs/FileDropTarget.js.map +1 -0
- package/dist/ssr/inputs/FileInputs.js +32 -10
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/file-drop.js +338 -0
- package/dist/ssr/inputs/file-drop.js.map +1 -0
- package/dist/ssr/inputs/index.js +1 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/markdown/MarkdownEditor.js +14 -2
- package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/ssr/intl/messages.js +97 -4
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +173 -27
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +175 -102
- package/dist/ssr/layout/Navigation.js.map +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/navigation-model.js +3 -1
- package/dist/ssr/layout/navigation-model.js.map +1 -1
- package/dist/ssr/surfaces/NoticeCard.js +17 -12
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/chat/ChatPrimitives.d.ts +1 -1
- package/dist/types/content/VideoPlayer.d.ts +41 -0
- package/dist/types/content/index.d.ts +2 -0
- package/dist/types/content/markdown-links.d.ts +66 -0
- package/dist/types/inputs/FileDropTarget.d.ts +23 -0
- package/dist/types/inputs/FileInputs.d.ts +2 -0
- package/dist/types/inputs/file-drop.d.ts +80 -0
- package/dist/types/inputs/index.d.ts +2 -0
- package/dist/types/intl/messages.d.ts +47 -0
- package/dist/types/layout/AppWorkspace.d.ts +21 -0
- package/dist/types/layout/index.d.ts +2 -2
- package/dist/types/layout/navigation-model.d.ts +29 -0
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ export type ChatActivityProps = {
|
|
|
44
44
|
export type ChatContextUsageProps = ChatContextUsageData & {
|
|
45
45
|
action?: ChatAction;
|
|
46
46
|
onActionError?: (error: unknown) => void;
|
|
47
|
-
/** Host-owned number formatting. The default
|
|
47
|
+
/** Host-owned number formatting. The default groups whole numbers in the inherited render locale. */
|
|
48
48
|
formatNumber?: (value: number) => string;
|
|
49
49
|
class?: string;
|
|
50
50
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VideoPlayer — one video with the browser's own controls inside a frame whose
|
|
3
|
+
* size never depends on the video. The frame fills the height its host gives
|
|
4
|
+
* it, or keeps a ratio where the host leaves the height open. The picture fits
|
|
5
|
+
* inside uncropped, so a portrait reel and a wide recording both show whole and
|
|
6
|
+
* nothing moves while the video loads.
|
|
7
|
+
*/
|
|
8
|
+
import { type JSX } from "solid-js";
|
|
9
|
+
export type VideoPlayerProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Inline address of the video. Seeking needs a server that answers `Range` requests; Safari plays nothing without.
|
|
12
|
+
* Null while the host still fetches it, for example a signed URL: the frame already shows at its final size.
|
|
13
|
+
*/
|
|
14
|
+
src: string | null;
|
|
15
|
+
/** Names the video for assistive technology, for example its file name. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Picture shown before playback starts. Without one, the player shows the first frame. */
|
|
18
|
+
poster?: string;
|
|
19
|
+
/** Width divided by height of the frame where the host leaves its height open. Defaults to 16 / 9. */
|
|
20
|
+
ratio?: number;
|
|
21
|
+
/** CORS mode for a video on another origin. Omit to keep the browser default. */
|
|
22
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
23
|
+
/**
|
|
24
|
+
* Resolves a fresh address of the same video, for example a renewed signed URL. When playback fails, the player asks
|
|
25
|
+
* for one and continues at the same time, playing if it was. A renewed address that fails before it shows that point,
|
|
26
|
+
* or within ten seconds after, shows the fallback, so a renewed address must stay valid for longer.
|
|
27
|
+
*/
|
|
28
|
+
renew?: () => Promise<string>;
|
|
29
|
+
/** Offered with the fallback when the browser cannot play the video, typically a download. */
|
|
30
|
+
fallbackAction?: JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Shown in the frame instead of the video while set, for example the host's own error with a retry when it could not
|
|
33
|
+
* fetch the address. The frame keeps its size.
|
|
34
|
+
*/
|
|
35
|
+
error?: JSX.Element;
|
|
36
|
+
/** Called when the player gives up on the video and shows its fallback. */
|
|
37
|
+
onFallback?: () => void;
|
|
38
|
+
class?: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function VideoPlayer(props: VideoPlayerProps): JSX.Element;
|
|
41
|
+
export default VideoPlayer;
|
|
@@ -34,6 +34,7 @@ export { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewP
|
|
|
34
34
|
export type { MessageGroupEntry, MessageRowAction, MessageRowAttachment, MessageRowAuthor, MessageRowFile, MessageRowMedia, MessageRowProgress, MessageRowProps, MessageRowQuote, MessageRowReaction, MessageRowStatus, MessageRowThread, MessageSystemRowProps, } from "./MessageRow";
|
|
35
35
|
export { MessageRow, MessageSystemRow, startsMessageGroup } from "./MessageRow";
|
|
36
36
|
export { type MarkdownInfoBlock, type MarkdownInfoBlockRenderInput, type MarkdownInfoBlockType, markdownInfoBlocks, renderMarkdownInfoBlock, scanMarkdownInfoBlock, } from "./markdown-info-blocks";
|
|
37
|
+
export { type MarkdownLinkInput, type MarkdownReference, type MarkdownReferenceKind, type MarkdownReferenceType, markdownLinkReference, markdownReferenceIcon, markdownReferenceType, markdownReferenceTypeLabel, markStandaloneLinks, renderMarkdownLink, } from "./markdown-links";
|
|
37
38
|
export { Pagination, type PaginationProps } from "./Pagination";
|
|
38
39
|
export type { PdfPreviewProps, PdfPreviewRequest } from "./PdfPreview";
|
|
39
40
|
export { default as PdfPreview } from "./PdfPreview";
|
|
@@ -41,6 +42,7 @@ export type { RangeOption, RangePickerProps } from "./RangePicker";
|
|
|
41
42
|
export { default as RangePicker } from "./RangePicker";
|
|
42
43
|
export type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from "./StructuredDataPreview";
|
|
43
44
|
export { default as StructuredDataPreview, isStructuredDataValue } from "./StructuredDataPreview";
|
|
45
|
+
export { VideoPlayer, type VideoPlayerProps } from "./VideoPlayer";
|
|
44
46
|
export type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from "./VirtualFeed";
|
|
45
47
|
export { VirtualFeed } from "./VirtualFeed";
|
|
46
48
|
export type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from "./ZoomPanViewport";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Token, Tokens } from "marked";
|
|
2
|
+
/** What a reference points to inside the host application. */
|
|
3
|
+
export type MarkdownReferenceKind = "file" | "note" | "heading" | "task" | "page";
|
|
4
|
+
/** The type a reference shows: a file's type from its extension, or the kind of the referenced content. */
|
|
5
|
+
export type MarkdownReferenceType = "pdf" | "image" | "design" | "file" | "note" | "heading" | "task" | "page";
|
|
6
|
+
/**
|
|
7
|
+
* A link to content inside the host application, as opposed to a web or mail link.
|
|
8
|
+
* References render as a calm pill whose icon names the type.
|
|
9
|
+
*/
|
|
10
|
+
export type MarkdownReference = {
|
|
11
|
+
kind: MarkdownReferenceKind;
|
|
12
|
+
/** The file's name, which decides its type and icon. Defaults to the link text. */
|
|
13
|
+
fileName?: string;
|
|
14
|
+
/** The file's formatted size. It shows only when the link stands alone on its line. */
|
|
15
|
+
size?: string;
|
|
16
|
+
/** Plain-text title of the document that holds a heading, for a heading in another document. */
|
|
17
|
+
document?: string;
|
|
18
|
+
};
|
|
19
|
+
export type MarkdownLinkInput = {
|
|
20
|
+
/** The final, already validated link destination. */
|
|
21
|
+
href: string;
|
|
22
|
+
/** The rendered link text. It crosses a trust boundary: the caller sanitizes it. */
|
|
23
|
+
html: string;
|
|
24
|
+
/** The link text as plain text, for the accessible name. Defaults to the text of `html`. */
|
|
25
|
+
text?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
target?: "_blank";
|
|
28
|
+
/** Link relations without a new tab, such as `noreferrer`. `target: "_blank"` always sets `noopener noreferrer`. */
|
|
29
|
+
rel?: string;
|
|
30
|
+
/** A reference inside the host. Without one, the link is a web link, or a mail link for `mailto:` and `tel:`. */
|
|
31
|
+
reference?: MarkdownReference | null;
|
|
32
|
+
/** The link is the only content of its line. Only then does a file show its size. */
|
|
33
|
+
standalone?: boolean;
|
|
34
|
+
/** Locale of the type name in the accessible name. Defaults to English on the server and the page language in the browser. */
|
|
35
|
+
locale?: string;
|
|
36
|
+
};
|
|
37
|
+
/** The type of a file reference, from the extension of its name. */
|
|
38
|
+
export declare const markdownFileType: (fileName: string) => "pdf" | "image" | "design" | "file";
|
|
39
|
+
/**
|
|
40
|
+
* The reference a link destination names on its own: `#anchor` is a heading in the same document, and any other
|
|
41
|
+
* relative URL is a page of the host, or a file when its last path segment has a file extension. Absolute URLs,
|
|
42
|
+
* every scheme, and relative URLs that a browser resolves to another host, such as `//host` or `/\host`, are web
|
|
43
|
+
* or mail links; the result is then `null`.
|
|
44
|
+
*/
|
|
45
|
+
export declare const markdownLinkReference: (href: string) => MarkdownReference | null;
|
|
46
|
+
/** The type a reference shows. */
|
|
47
|
+
export declare const markdownReferenceType: (reference: MarkdownReference, text: string) => MarkdownReferenceType;
|
|
48
|
+
/** The Tabler glyph of a reference type; any other file keeps the glyph of its file family. */
|
|
49
|
+
export declare const markdownReferenceIcon: (type: MarkdownReferenceType, fileName?: string) => string;
|
|
50
|
+
/** The localized name of a reference type, such as "PDF" or "Überschrift". */
|
|
51
|
+
export declare const markdownReferenceTypeLabel: (type: MarkdownReferenceType, locale?: string) => string;
|
|
52
|
+
/**
|
|
53
|
+
* One link of rendered Markdown. A reference to content of the host renders as a calm pill: a neutral fill, the
|
|
54
|
+
* text in the prose colour, and an icon whose colour names the type. Its accessible name starts with the type, as
|
|
55
|
+
* in "PDF: Brand-2026.pdf". A heading in another document shows that document first ("Notes › Heading"). A web
|
|
56
|
+
* link stays prose text with a thin underline in the link accent and a small ↗; a mail link has no arrow. A link
|
|
57
|
+
* around an image is the image: a plain anchor that the image's own text names.
|
|
58
|
+
*/
|
|
59
|
+
export declare const renderMarkdownLink: (input: MarkdownLinkInput) => string;
|
|
60
|
+
/**
|
|
61
|
+
* The links among `tokens` that stand alone on their line: the only content of a paragraph or list item line,
|
|
62
|
+
* between line breaks. Pass the result's check as `standalone` to `renderMarkdownLink`, so a file shows its size
|
|
63
|
+
* in a list of files but not inside a sentence. Call it from `walkTokens` of a renderer with GFM line breaks
|
|
64
|
+
* (`breaks: true`), where every source line is a visual line.
|
|
65
|
+
*/
|
|
66
|
+
export declare const markStandaloneLinks: (token: Token, standalone: WeakSet<Tokens.Link>) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type FileDropOptions } from "./file-drop";
|
|
3
|
+
export type { FileDropDetails, FileDropOptions, FileDropRejection } from "./file-drop";
|
|
4
|
+
export type FileDropTargetProps = FileDropOptions & {
|
|
5
|
+
/**
|
|
6
|
+
* The area that takes the files. Defaults to the nearest dialog, `AppWorkspace.Detail`, or `AppWorkspace.Main`
|
|
7
|
+
* around the component, and to the whole window outside of them.
|
|
8
|
+
*/
|
|
9
|
+
for?: Element;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Turns an area into a drop target while files from outside the page are dragged over the window. A calm overlay
|
|
13
|
+
* covers the area without moving anything and says what dropping does; a more specific target inside it, such as a
|
|
14
|
+
* folder row or a `FileDropzone`, takes the drop and its sentence while the pointer is over it. Text, links, and
|
|
15
|
+
* elements dragged within the page never show it. Keep a visible upload button for keyboard and touch users.
|
|
16
|
+
*/
|
|
17
|
+
export declare function FileDropTarget(props: FileDropTargetProps): JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Makes one element a specific drop target, such as a folder row inside a `FileDropTarget` area: pass the result as
|
|
20
|
+
* the element's `ref`. It wins over the area around it while the pointer is over it, and the area's overlay shows its
|
|
21
|
+
* sentence. Calling the ref again with new options replaces them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fileDropTarget(options: FileDropOptions): (element: Element) => void;
|
|
@@ -10,6 +10,8 @@ export type FileDropzoneProps = FieldProps & {
|
|
|
10
10
|
title?: JSX.Element;
|
|
11
11
|
subtitle?: JSX.Element;
|
|
12
12
|
hint?: JSX.Element;
|
|
13
|
+
/** One sentence that says what dropping does, shown while files are over the zone. Defaults to "Drop to upload". */
|
|
14
|
+
dropLabel?: string;
|
|
13
15
|
onDrop: (files: File[]) => void | Promise<void>;
|
|
14
16
|
};
|
|
15
17
|
export declare function FileDropzone(props: FileDropzoneProps): JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
import type { UiMessages } from "../intl/messages";
|
|
3
|
+
export type FileDropRejection = {
|
|
4
|
+
file: File;
|
|
5
|
+
/** `type` misses `accept`, `size` exceeds `maxSize`, `count` is past `maxFiles` or the single file of `multiple={false}`. */
|
|
6
|
+
reason: "type" | "size" | "count";
|
|
7
|
+
};
|
|
8
|
+
export type FileDropDetails = {
|
|
9
|
+
/** The drop's data, readable only while `onDrop` runs synchronously; read folder entries before the first `await`. */
|
|
10
|
+
dataTransfer: DataTransfer;
|
|
11
|
+
/** Files left out by `accept`, `maxSize`, or the file count; the user has already been told. */
|
|
12
|
+
rejected: readonly FileDropRejection[];
|
|
13
|
+
};
|
|
14
|
+
export type FileDropOptions = {
|
|
15
|
+
/** One sentence that says what dropping does here, such as "Drop to attach to the message". */
|
|
16
|
+
label: string;
|
|
17
|
+
/** `<input accept>` syntax, such as `"image/*,.pdf"`. */
|
|
18
|
+
accept?: string;
|
|
19
|
+
/** Defaults to `true`; `false` takes the first fitting file. */
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
/** The most files one drop hands over. */
|
|
22
|
+
maxFiles?: number;
|
|
23
|
+
/** The largest file in bytes. */
|
|
24
|
+
maxSize?: number;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Called synchronously in the drop with the files that fit. `files` is empty only when the drop carried no file
|
|
28
|
+
* objects at all, as some engines hand over dropped folders; `details.dataTransfer.items` still has their entries.
|
|
29
|
+
*/
|
|
30
|
+
onDrop: (files: File[], details: FileDropDetails) => void | Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
export type FileDropTargetEntry = {
|
|
33
|
+
options: FileDropOptions;
|
|
34
|
+
messages: () => UiMessages;
|
|
35
|
+
locale: () => string;
|
|
36
|
+
/** Set for regions: the area the overlay covers. Specific targets are keyed by their element. */
|
|
37
|
+
region?: () => Element | undefined;
|
|
38
|
+
/** Set for regions: where the target itself is rendered; a region whose host is hidden takes no drops. */
|
|
39
|
+
host?: () => Element | undefined;
|
|
40
|
+
};
|
|
41
|
+
export type FileDropHover = {
|
|
42
|
+
entry: FileDropTargetEntry;
|
|
43
|
+
element: Element;
|
|
44
|
+
invalid: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type FileDropSession = {
|
|
47
|
+
/** Regions that show their overlay during this drag: eligible, visible, and not inside another shown region. */
|
|
48
|
+
shown: readonly FileDropTargetEntry[];
|
|
49
|
+
hover: FileDropHover | null;
|
|
50
|
+
};
|
|
51
|
+
export type FileDropEngine = {
|
|
52
|
+
session: Accessor<FileDropSession | null>;
|
|
53
|
+
/** Changes on every drag movement, so overlays can follow a region that moved or resized. */
|
|
54
|
+
frame: Accessor<number>;
|
|
55
|
+
addRegion: (entry: FileDropTargetEntry) => () => void;
|
|
56
|
+
setTarget: (element: Element, entry: FileDropTargetEntry) => void;
|
|
57
|
+
};
|
|
58
|
+
/** The marker a hovered specific target carries for its ring; regions show their own overlay instead. */
|
|
59
|
+
export declare const FILE_DROP_ATTRIBUTE = "data-file-drop";
|
|
60
|
+
/** Where a region without `for` looks for its area: the nearest dialog, workspace detail, or workspace main area. */
|
|
61
|
+
export declare const FILE_DROP_DEFAULT_REGION = "dialog, .k2b-app-workspace__detail, .k2b-app-workspace__main";
|
|
62
|
+
/** Sorts dropped files into the ones a target takes and the ones it leaves out, in drop order. */
|
|
63
|
+
export declare const partitionDroppedFiles: (files: readonly File[], options: Pick<FileDropOptions, "accept" | "multiple" | "maxFiles" | "maxSize">) => {
|
|
64
|
+
accepted: File[];
|
|
65
|
+
rejected: FileDropRejection[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* During a drag only the types are readable, and only in some engines. A drag is refused when none of them can fit.
|
|
69
|
+
* An extension in `accept` matches by file name, and systems report differing types for one extension (a `.csv` may be
|
|
70
|
+
* `application/vnd.ms-excel`), so with one the drop decides.
|
|
71
|
+
*/
|
|
72
|
+
export declare const refusesDraggedTypes: (types: readonly string[], accept: string | undefined) => boolean;
|
|
73
|
+
export declare const fileDropRejectionMessage: (rejected: readonly FileDropRejection[], options: Pick<FileDropOptions, "multiple" | "maxFiles" | "maxSize">, messages: UiMessages, locale: string) => string;
|
|
74
|
+
/**
|
|
75
|
+
* The document an element lives in. A freshly rendered element still belongs to the inert document of the template it
|
|
76
|
+
* was cloned from; until it is inserted, that is the page's document.
|
|
77
|
+
*/
|
|
78
|
+
export declare const liveDocument: (element: Element) => Document;
|
|
79
|
+
/** The one drag tracker of a document, shared by every drop target in it. */
|
|
80
|
+
export declare const fileDropEngine: (doc: Document) => FileDropEngine;
|
|
@@ -15,6 +15,8 @@ export type { Completion, QueryContext, SuggestContext, Suggestion, } from "./co
|
|
|
15
15
|
export { abbreviations } from "./completion";
|
|
16
16
|
export type { DatePickerBaseProps, DatePickerProps, DatePreset, DateRangePickerProps, DateRangeValue, DateTimePickerProps, DurationPreset, } from "./DatePicker";
|
|
17
17
|
export { DatePicker, DateRangePicker, DateTimePicker } from "./DatePicker";
|
|
18
|
+
export type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTargetProps } from "./FileDropTarget";
|
|
19
|
+
export { FileDropTarget, fileDropTarget } from "./FileDropTarget";
|
|
18
20
|
export type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from "./FileInputs";
|
|
19
21
|
export { FileDropzone, ImageCropper, ImageInput } from "./FileInputs";
|
|
20
22
|
export type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from "./field-contract";
|
|
@@ -38,6 +38,14 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
|
|
|
38
38
|
infoBlockSuccess: string;
|
|
39
39
|
infoBlockWarning: string;
|
|
40
40
|
infoBlockDanger: string;
|
|
41
|
+
referencePdf: string;
|
|
42
|
+
referenceImage: string;
|
|
43
|
+
referenceDesign: string;
|
|
44
|
+
referenceFile: string;
|
|
45
|
+
referenceNote: string;
|
|
46
|
+
referenceHeading: string;
|
|
47
|
+
referenceTask: string;
|
|
48
|
+
referencePage: string;
|
|
41
49
|
copy: string;
|
|
42
50
|
closeLightbox: string;
|
|
43
51
|
couldNotLoadData: string;
|
|
@@ -54,6 +62,26 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
|
|
|
54
62
|
durationPresets: string;
|
|
55
63
|
filterOptions: string;
|
|
56
64
|
fileTypeNotAccepted: string;
|
|
65
|
+
fileDropDropped: ({ count }: {
|
|
66
|
+
count: number;
|
|
67
|
+
}) => string;
|
|
68
|
+
fileDropDroppedOne: ({ name }: {
|
|
69
|
+
name: string;
|
|
70
|
+
}) => string;
|
|
71
|
+
fileDropMore: ({ count }: {
|
|
72
|
+
count: number;
|
|
73
|
+
}) => string;
|
|
74
|
+
fileDropRejectedType: ({ names }: {
|
|
75
|
+
names: string;
|
|
76
|
+
}) => string;
|
|
77
|
+
fileDropRejectedSize: ({ names, limit }: {
|
|
78
|
+
names: string;
|
|
79
|
+
limit: string;
|
|
80
|
+
}) => string;
|
|
81
|
+
fileDropRejectedCount: ({ names, max }: {
|
|
82
|
+
names: string;
|
|
83
|
+
max: number;
|
|
84
|
+
}) => string;
|
|
57
85
|
imageLightbox: string;
|
|
58
86
|
imageNavigation: string;
|
|
59
87
|
increaseValue: string;
|
|
@@ -322,6 +350,7 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
|
|
|
322
350
|
templatePreview: string;
|
|
323
351
|
lastRequestContext: string;
|
|
324
352
|
contextWindowUsed: string;
|
|
353
|
+
contextWindow: string;
|
|
325
354
|
contextUsageUnavailable: string;
|
|
326
355
|
contextUsageUnavailableWithWindow: ({ window }: {
|
|
327
356
|
window: string;
|
|
@@ -413,6 +442,10 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
|
|
|
413
442
|
}) => string;
|
|
414
443
|
range: string;
|
|
415
444
|
resizePanes: string;
|
|
445
|
+
resizeNavigation: string;
|
|
446
|
+
resizeWorkspacePane: string;
|
|
447
|
+
resizeDetailPanel: string;
|
|
448
|
+
resizeBottomDrawer: string;
|
|
416
449
|
resetMapView: string;
|
|
417
450
|
resetTimelineView: string;
|
|
418
451
|
retryOlderMessages: string;
|
|
@@ -448,6 +481,18 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
|
|
|
448
481
|
italicShortcut: string;
|
|
449
482
|
linkShortcut: string;
|
|
450
483
|
markdownFormatting: string;
|
|
484
|
+
editorLines: ({ count, value }: {
|
|
485
|
+
count: number;
|
|
486
|
+
value: string;
|
|
487
|
+
}) => string;
|
|
488
|
+
editorWords: ({ count, value }: {
|
|
489
|
+
count: number;
|
|
490
|
+
value: string;
|
|
491
|
+
}) => string;
|
|
492
|
+
editorCharacters: ({ count, value }: {
|
|
493
|
+
count: number;
|
|
494
|
+
value: string;
|
|
495
|
+
}) => string;
|
|
451
496
|
numberedListShortcut: string;
|
|
452
497
|
quote: string;
|
|
453
498
|
csvSettings: string;
|
|
@@ -469,6 +514,8 @@ declare const uiMessages: import("@k2b/stdlib").Catalog<{
|
|
|
469
514
|
textEditor: string;
|
|
470
515
|
audioUnsupported: string;
|
|
471
516
|
videoUnsupported: string;
|
|
517
|
+
videoCannotPlay: string;
|
|
518
|
+
videoCannotPlayDescription: string;
|
|
472
519
|
yes: string;
|
|
473
520
|
installApp: string;
|
|
474
521
|
installNative: ({ appName }: {
|
|
@@ -237,8 +237,25 @@ export type AppWorkspaceNavTreeProps = {
|
|
|
237
237
|
onSelectedIdChange?: (id: string) => void;
|
|
238
238
|
onExpandedIdsChange?: (ids: readonly string[]) => void;
|
|
239
239
|
indented?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Lets people reorder `movable` items among their siblings: by dragging on
|
|
242
|
+
* fine pointers and with Alt+ArrowUp/ArrowDown on a focused item. The tree
|
|
243
|
+
* only reports the requested place; the application saves it and renders
|
|
244
|
+
* the new order, and the tree then keeps focus on the moved item.
|
|
245
|
+
*/
|
|
246
|
+
onMove?: (move: AppWorkspaceNavTreeMove) => void;
|
|
240
247
|
class?: string;
|
|
241
248
|
};
|
|
249
|
+
/** One requested place for an item among its unchanged siblings. */
|
|
250
|
+
export type AppWorkspaceNavTreeMove = {
|
|
251
|
+
id: string;
|
|
252
|
+
/** The parent item, unchanged by the move; `null` on the top level. */
|
|
253
|
+
parentId: string | null;
|
|
254
|
+
/** The sibling the item now precedes; `null` when it becomes the last. */
|
|
255
|
+
beforeId: string | null;
|
|
256
|
+
/** The sibling the item now follows; `null` when it becomes the first. */
|
|
257
|
+
afterId: string | null;
|
|
258
|
+
};
|
|
242
259
|
export type AppWorkspaceNavTreeItemProps = {
|
|
243
260
|
id: string;
|
|
244
261
|
label: JSX.Element;
|
|
@@ -252,6 +269,8 @@ export type AppWorkspaceNavTreeItemProps = {
|
|
|
252
269
|
onSelect?: (event: MouseEvent) => void;
|
|
253
270
|
disabled?: boolean;
|
|
254
271
|
icon?: string;
|
|
272
|
+
/** Names a meaningful icon for screen readers, such as "Homepage"; without it the icon is decorative. */
|
|
273
|
+
iconLabel?: string;
|
|
255
274
|
/** Replaces `icon` while this branch is expanded and makes the icon the disclosure target. */
|
|
256
275
|
expandedIcon?: string;
|
|
257
276
|
meta?: JSX.Element;
|
|
@@ -261,6 +280,8 @@ export type AppWorkspaceNavTreeItemProps = {
|
|
|
261
280
|
title?: string;
|
|
262
281
|
viewTransitionName?: string;
|
|
263
282
|
class?: string;
|
|
283
|
+
/** With the tree's `onMove`, the item can change its place among its siblings. Other items keep theirs, and no item moves past them. */
|
|
284
|
+
movable?: boolean;
|
|
264
285
|
onDragEnter?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;
|
|
265
286
|
onDragOver?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;
|
|
266
287
|
onDragLeave?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { AppOverviewCardsProps, AppOverviewEmptyStateProps, AppOverviewPanelProps, AppOverviewProps, } from "./AppOverview";
|
|
2
2
|
export { default as AppOverview } from "./AppOverview";
|
|
3
|
-
export type { AppWorkspaceBottomDrawerHeight, AppWorkspaceBottomDrawerProps, AppWorkspaceContentProps, AppWorkspaceDetailProps, AppWorkspaceDetailWidth, AppWorkspaceMainPaneProps, AppWorkspaceMainProps, AppWorkspaceNavTreeItemProps, AppWorkspaceNavTreeProps, AppWorkspaceProps, AppWorkspaceSidebarAccessoryVisibility, AppWorkspaceSidebarBodyProps, AppWorkspaceSidebarIconActionProps, AppWorkspaceSidebarIconActionTone, AppWorkspaceSidebarIconGridProps, AppWorkspaceSidebarItemActionProps, AppWorkspaceSidebarItemActionsProps, AppWorkspaceSidebarItemIconProps, AppWorkspaceSidebarItemLabelProps, AppWorkspaceSidebarItemMetaProps, AppWorkspaceSidebarItemProps, AppWorkspaceSidebarItemTone, AppWorkspaceSidebarProps, AppWorkspaceSidebarSectionProps, AppWorkspaceSidebarVisibility, } from "./AppWorkspace";
|
|
3
|
+
export type { AppWorkspaceBottomDrawerHeight, AppWorkspaceBottomDrawerProps, AppWorkspaceContentProps, AppWorkspaceDetailProps, AppWorkspaceDetailWidth, AppWorkspaceMainPaneProps, AppWorkspaceMainProps, AppWorkspaceNavTreeItemProps, AppWorkspaceNavTreeMove, AppWorkspaceNavTreeProps, AppWorkspaceProps, AppWorkspaceSidebarAccessoryVisibility, AppWorkspaceSidebarBodyProps, AppWorkspaceSidebarIconActionProps, AppWorkspaceSidebarIconActionTone, AppWorkspaceSidebarIconGridProps, AppWorkspaceSidebarItemActionProps, AppWorkspaceSidebarItemActionsProps, AppWorkspaceSidebarItemIconProps, AppWorkspaceSidebarItemLabelProps, AppWorkspaceSidebarItemMetaProps, AppWorkspaceSidebarItemProps, AppWorkspaceSidebarItemTone, AppWorkspaceSidebarProps, AppWorkspaceSidebarSectionProps, AppWorkspaceSidebarVisibility, } from "./AppWorkspace";
|
|
4
4
|
export { default as AppWorkspace } from "./AppWorkspace";
|
|
5
5
|
export type { AppWorkspaceControllerOptions } from "./app-workspace-controller";
|
|
6
6
|
export { installAppWorkspaceController } from "./app-workspace-controller";
|
|
@@ -18,7 +18,7 @@ export { default as FloatingWindow, type FloatingWindowRect, fitFloatingWindowRe
|
|
|
18
18
|
export type { MobileShellHeaderProps, MobileShellProps } from "./MobileShell";
|
|
19
19
|
export { default as MobileShell, observeMobileShell } from "./MobileShell";
|
|
20
20
|
export { default as Navigation, type NavigationProps } from "./Navigation";
|
|
21
|
-
export { createNavigation, findNavigationItem, type NavigationController, type NavigationItem, type NavigationOptions, } from "./navigation-model";
|
|
21
|
+
export { createNavigation, findNavigationItem, type NavigationController, type NavigationItem, type NavigationOptions, type NavigationStatus, } from "./navigation-model";
|
|
22
22
|
export type { PanelDialogBodyProps, PanelDialogFooterProps, PanelDialogHeaderProps, PanelDialogProps, PanelDialogSectionProps, PanelDialogSurface, PanelDialogTabOption, PanelDialogTabsProps, } from "./PanelDialog";
|
|
23
23
|
export { confirmDiscardIfDirty, default as PanelDialog, panelDialogFixedOptions, panelDialogFixedPanelClass, panelDialogOptions, panelDialogPanelClass, panelDialogWideOptions, panelDialogWidePanelClass, panelDialogWorkspaceOptions, panelDialogWorkspacePanelClass, } from "./PanelDialog";
|
|
24
24
|
export type { PanelHeaderProps } from "./PanelHeader";
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import type { LinkNavigateEvent, NavigationScrollMode } from "@k2b/ssr/nav";
|
|
2
2
|
import type { Accessor } from "solid-js";
|
|
3
|
+
import type { IntentTone } from "../semantics";
|
|
4
|
+
/** A status icon at a row's end, such as "running". `label` names it for screen readers and as its tooltip. */
|
|
5
|
+
export type NavigationStatus = {
|
|
6
|
+
icon: string;
|
|
7
|
+
label: string;
|
|
8
|
+
tone?: IntentTone;
|
|
9
|
+
};
|
|
3
10
|
type NavigationEntry = {
|
|
4
11
|
id: string;
|
|
5
12
|
label: string;
|
|
6
13
|
icon?: string;
|
|
14
|
+
/** Names a meaningful icon for screen readers, such as "Homepage"; without it the icon is decorative. */
|
|
15
|
+
iconLabel?: string;
|
|
7
16
|
badge?: string | number;
|
|
8
17
|
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Status icon in a fixed-size slot at the row's end. Set `null` on a row whose status comes and goes: the empty slot
|
|
20
|
+
* keeps its place, so a status change never rewraps the label or moves the rows below.
|
|
21
|
+
*/
|
|
22
|
+
status?: NavigationStatus | null;
|
|
9
23
|
active?: boolean;
|
|
10
24
|
disabled?: boolean;
|
|
11
25
|
color?: string;
|
|
@@ -15,6 +29,17 @@ type NavigationEntry = {
|
|
|
15
29
|
/** Owner-held disclosure state. The renderer shows it and reports toggles through `onExpandedChange`. */
|
|
16
30
|
expanded?: boolean;
|
|
17
31
|
actions?: readonly NavigationItem[];
|
|
32
|
+
/**
|
|
33
|
+
* Square icon buttons in the row, before the `actions` menu. They run an `action`; a destination belongs in a row,
|
|
34
|
+
* where its link keeps modified clicks and new tabs.
|
|
35
|
+
*/
|
|
36
|
+
inlineActions?: readonly {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
icon: string;
|
|
40
|
+
action: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
}[];
|
|
18
43
|
};
|
|
19
44
|
/** Serializable presentation. Functions stay with the controller's owning island. */
|
|
20
45
|
export type NavigationItem = NavigationEntry & ({
|
|
@@ -22,17 +47,21 @@ export type NavigationItem = NavigationEntry & ({
|
|
|
22
47
|
action?: string;
|
|
23
48
|
navigation?: "document" | "enhanced";
|
|
24
49
|
scroll?: NavigationScrollMode;
|
|
50
|
+
section?: never;
|
|
25
51
|
} | {
|
|
26
52
|
action: string;
|
|
27
53
|
href?: never;
|
|
28
54
|
navigation?: never;
|
|
29
55
|
scroll?: never;
|
|
56
|
+
section?: never;
|
|
30
57
|
} | {
|
|
31
58
|
href?: never;
|
|
32
59
|
action?: never;
|
|
33
60
|
navigation?: never;
|
|
34
61
|
scroll?: never;
|
|
35
62
|
children: readonly NavigationItem[];
|
|
63
|
+
/** Shows the group as a plain heading over its rows, always open and not indented, instead of a disclosure. */
|
|
64
|
+
section?: boolean;
|
|
36
65
|
});
|
|
37
66
|
export type NavigationOptions = {
|
|
38
67
|
items: Accessor<readonly NavigationItem[]>;
|