@k2b/ui 0.38.1 → 0.40.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 +42 -6
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/SelectionToolbar.js +11 -6
- package/dist/browser/actions/SelectionToolbar.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +5 -1
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +11 -2
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +31 -17
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +49 -5
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/text-editor/TextEditor.js +331 -214
- package/dist/browser/text-editor/TextEditor.js.map +1 -1
- package/dist/browser/text-editor/table.js +43 -6
- package/dist/browser/text-editor/table.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +38 -6
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/SelectionToolbar.js +11 -6
- package/dist/ssr/actions/SelectionToolbar.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +5 -1
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +10 -2
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +31 -17
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +49 -5
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/text-editor/TextEditor.js +225 -96
- package/dist/ssr/text-editor/TextEditor.js.map +1 -1
- package/dist/ssr/text-editor/table.js +43 -6
- package/dist/ssr/text-editor/table.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +15 -1
- package/dist/types/actions/Toolbar.d.ts +6 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/layout/AppWorkspace.d.ts +14 -0
- package/dist/types/layout/app-workspace-controller.d.ts +2 -0
- package/package.json +1 -1
|
@@ -2,6 +2,12 @@ import { type JSX } from "solid-js";
|
|
|
2
2
|
import { type TooltipPlacement } from "../feedback/Tooltip";
|
|
3
3
|
import { type ButtonProps, type ButtonSize, type ButtonVariant } from "./Button";
|
|
4
4
|
export type DropdownPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left" | "right-start";
|
|
5
|
+
/** Where a menu opened without its trigger appears: an element, or any box such as a point inside one. */
|
|
6
|
+
export type DropdownAnchor = {
|
|
7
|
+
getBoundingClientRect(): Pick<DOMRect, "left" | "top" | "right" | "bottom">;
|
|
8
|
+
};
|
|
9
|
+
/** Where focus returns as a menu opened by `openAt` closes, read at that moment when it is a function. */
|
|
10
|
+
export type DropdownReturnFocus = HTMLElement | (() => HTMLElement | undefined);
|
|
5
11
|
export type DropdownActionBase = {
|
|
6
12
|
class?: string;
|
|
7
13
|
disabled?: boolean;
|
|
@@ -109,6 +115,14 @@ export type DropdownProps = {
|
|
|
109
115
|
* then carries each row's trigger, not each row's entries. Fixed for the menu's lifetime.
|
|
110
116
|
*/
|
|
111
117
|
lazy?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Receives `open`, which shows the menu without its trigger beside `anchor`, as for a context menu, a key or a
|
|
120
|
+
* grip. Focus returns to `returnFocus` when the menu or sheet closes; pass a function when an entry can move the
|
|
121
|
+
* place focus belongs to. Phones get the sheet as from the trigger.
|
|
122
|
+
*/
|
|
123
|
+
openAt?: (open: (anchor: DropdownAnchor, returnFocus?: DropdownReturnFocus) => void) => void;
|
|
124
|
+
/** Receives `close`, which closes the menu or sheet and returns focus. */
|
|
125
|
+
closeWith?: (close: () => void) => void;
|
|
112
126
|
};
|
|
113
127
|
export type DropdownTriggerProps = Omit<ButtonProps, "aria-controls" | "aria-expanded" | "aria-haspopup" | "children" | "disabled" | "onClick" | "onKeyDown"> & {
|
|
114
128
|
children: JSX.Element;
|
|
@@ -141,7 +155,7 @@ export type DropdownItemProps = {
|
|
|
141
155
|
onSelect?: () => void;
|
|
142
156
|
class?: string;
|
|
143
157
|
};
|
|
144
|
-
export declare const dropdownPosition: (trigger: DOMRect, menu: Pick<DOMRect, "width" | "height">, position: DropdownPosition, viewport: {
|
|
158
|
+
export declare const dropdownPosition: (trigger: Pick<DOMRect, "left" | "top" | "right" | "bottom">, menu: Pick<DOMRect, "width" | "height">, position: DropdownPosition, viewport: {
|
|
145
159
|
width: number;
|
|
146
160
|
height: number;
|
|
147
161
|
}, gap?: number) => {
|
|
@@ -13,7 +13,10 @@ export type ToolbarActionProps = {
|
|
|
13
13
|
label: string;
|
|
14
14
|
/** Icon class, such as "ti ti-archive". */
|
|
15
15
|
icon: string;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Shortcut hint below the icon, tooltip suffix, and aria-keyshortcuts; does not register a shortcut handler.
|
|
18
|
+
* SelectionToolbar's compact actions keep only the tooltip suffix and aria-keyshortcuts.
|
|
19
|
+
*/
|
|
17
20
|
keys?: string;
|
|
18
21
|
/** 1 is most important. Larger numbers move first; ties move later DOM actions first. Omit to keep fixed. */
|
|
19
22
|
priority?: number;
|
|
@@ -39,5 +42,7 @@ type ToolbarComponent = ((props: ToolbarProps) => JSX.Element) & {
|
|
|
39
42
|
Separator: (props: ToolbarSeparatorProps) => JSX.Element;
|
|
40
43
|
Spacer: () => JSX.Element;
|
|
41
44
|
};
|
|
45
|
+
/** False where actions are icon-sized, such as SelectionToolbar: no room below the icon for a hint. Package-internal. */
|
|
46
|
+
export declare const ToolbarHintsContext: import("solid-js").Context<boolean>;
|
|
42
47
|
export declare const Toolbar: ToolbarComponent;
|
|
43
48
|
export default Toolbar;
|
|
@@ -8,7 +8,7 @@ export type { DisclosureProps } from "./Disclosure";
|
|
|
8
8
|
export { Disclosure } from "./Disclosure";
|
|
9
9
|
export type { DragPayload, DragSourceProps, DropTargetProps } from "./DragAndDrop";
|
|
10
10
|
export { activeDrag, DragSource, DropTarget, useKeyboardDrag } from "./DragAndDrop";
|
|
11
|
-
export type { DropdownAction, DropdownActionBase, DropdownChoice, DropdownItemProps, DropdownPosition, DropdownProps, DropdownSection, DropdownTriggerProps, } from "./Dropdown";
|
|
11
|
+
export type { DropdownAction, DropdownActionBase, DropdownAnchor, DropdownChoice, DropdownItemProps, DropdownPosition, DropdownProps, DropdownReturnFocus, DropdownSection, DropdownTriggerProps, } from "./Dropdown";
|
|
12
12
|
export { Dropdown, DropdownItem, dropdownPosition } from "./Dropdown";
|
|
13
13
|
export type { FilterChipOption, FilterChipProps, FilterChipSection, FilterToggleProps } from "./FilterChip";
|
|
14
14
|
export { FilterChip, FilterToggle } from "./FilterChip";
|
|
@@ -46,6 +46,14 @@ export type AppWorkspaceProps = {
|
|
|
46
46
|
layoutState?: () => AppWorkspaceLayoutState | null | undefined;
|
|
47
47
|
/** Called with the full layout whenever a resize settles. Persist it here. */
|
|
48
48
|
onLayoutChange?: (state: AppWorkspaceLayoutState) => void;
|
|
49
|
+
/**
|
|
50
|
+
* `false` draws no head row. The application then shows the page's title itself and gives people the sidebar and
|
|
51
|
+
* Detail buttons the head would hold: a control with `data-app-workspace-sidebar-toggle` (it opens the overlay
|
|
52
|
+
* sidebar, and shows or hides a sidebar with `onHiddenChange` where it is a column) and, for each Detail with
|
|
53
|
+
* `toggle={false}`, a control with `data-app-workspace-detail-toggle` and `aria-controls` set to
|
|
54
|
+
* `appWorkspaceDetailElementId(id)`. The controller runs both and keeps their `aria-expanded` current.
|
|
55
|
+
*/
|
|
56
|
+
head?: false;
|
|
49
57
|
/**
|
|
50
58
|
* Opt out of the built-in controller. Only needed when the application calls
|
|
51
59
|
* `installAppWorkspaceController` itself — installing twice would double up
|
|
@@ -118,6 +126,12 @@ export type AppWorkspaceDetailProps = {
|
|
|
118
126
|
open: boolean;
|
|
119
127
|
/** Keeps the shared head control reachable while closed; set the app's existing open state synchronously. */
|
|
120
128
|
onOpen?: () => void;
|
|
129
|
+
/**
|
|
130
|
+
* `false` draws no Details button of the workspace's own: the application gives one with
|
|
131
|
+
* `data-app-workspace-detail-toggle` and `aria-controls` set to `appWorkspaceDetailElementId(id)`, as with
|
|
132
|
+
* `AppWorkspace head={false}`.
|
|
133
|
+
*/
|
|
134
|
+
toggle?: false;
|
|
121
135
|
/** Whether the current object may show details. False disables reopening and hides the panel. */
|
|
122
136
|
available?: boolean;
|
|
123
137
|
/**
|
|
@@ -11,6 +11,8 @@ export declare const parkWorkspaceDetailDrawers: (root?: ParentNode) => void;
|
|
|
11
11
|
* stays application state, so the controller only requests the change.
|
|
12
12
|
*/
|
|
13
13
|
export declare const APP_WORKSPACE_SIDEBAR_HIDE_EVENT = "k2b-app-workspace-sidebar-hide";
|
|
14
|
+
/** Asks the owning `AppWorkspace.Sidebar` to show again; its `onHiddenChange` decides. */
|
|
15
|
+
export declare const APP_WORKSPACE_SIDEBAR_SHOW_EVENT = "k2b-app-workspace-sidebar-show";
|
|
14
16
|
/** Asks the owning Detail to reopen its current available object. */
|
|
15
17
|
export declare const APP_WORKSPACE_DETAIL_OPEN_EVENT = "k2b-app-workspace-detail-open";
|
|
16
18
|
/** Asks the owning `AppWorkspace.Detail` to close; its `onClose` decides. */
|