@kerfjs/ui 5.0.0-beta.57 → 5.0.0-beta.59
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/README.md +29 -6
- package/ai/component-catalog.json +51 -16
- package/ai/component-catalog.schema.json +16 -0
- package/ai/component-composition.json +16 -2
- package/ai/components/README.md +2 -2
- package/ai/components/popup-menu.md +96 -7
- package/ai/components/text.md +3 -3
- package/ai/components/token-search-field.md +6 -4
- package/ai/components/toolbar-control-group.md +2 -0
- package/ai/public-api-signatures-v1.md +67 -97
- package/ai/skill.md +6 -2
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/catalog-resources.d.ts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +5 -5
- package/dist/{chunk-G2RKFVRB.js → chunk-2CCMJTVY.js} +2 -2
- package/dist/chunk-2CCMJTVY.js.map +1 -0
- package/dist/{chunk-ZIYOJFZD.js → chunk-7JUBXOIV.js} +17 -4
- package/dist/chunk-7JUBXOIV.js.map +1 -0
- package/dist/chunk-F7F7KRO2.js +187 -0
- package/dist/chunk-F7F7KRO2.js.map +1 -0
- package/dist/{chunk-XCO6YCYM.js → chunk-QPUPLNNB.js} +16 -5
- package/dist/chunk-QPUPLNNB.js.map +1 -0
- package/dist/{chunk-63ZWBGE3.js → chunk-RRB26JRJ.js} +25 -3
- package/dist/chunk-RRB26JRJ.js.map +1 -0
- package/dist/{chunk-NBYTIVHS.js → chunk-UFYZHYWU.js} +118 -12
- package/dist/chunk-UFYZHYWU.js.map +1 -0
- package/dist/{chunk-WLG6SSNT.js → chunk-UWONG4QE.js} +41 -8
- package/dist/chunk-UWONG4QE.js.map +1 -0
- package/dist/{chunk-553ASUK6.js → chunk-UX2VVXZ3.js} +2 -2
- package/dist/{chunk-553ASUK6.js.map → chunk-UX2VVXZ3.js.map} +1 -1
- package/dist/{chunk-24PHKUR3.js → chunk-UXT7TE6B.js} +1 -1
- package/dist/chunk-UXT7TE6B.js.map +1 -0
- package/dist/{chunk-PWXNJS2B.js → chunk-W4XKTST6.js} +2 -2
- package/dist/{chunk-PWXNJS2B.js.map → chunk-W4XKTST6.js.map} +1 -1
- package/dist/collapsible-panel.d.ts +8 -8
- package/dist/collapsible-panel.js +2 -2
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -6
- package/dist/list-header.js +1 -1
- package/dist/nav-stack.js +1 -1
- package/dist/{panel-toolbar-BN4x0rth.d.ts → panel-toolbar-DqwtBxQL.d.ts} +10 -11
- package/dist/popup-menu.d.ts +31 -3
- package/dist/popup-menu.js +1 -1
- package/dist/split-view.js +1 -1
- package/dist/styles/popup-menu.css +33 -4
- package/dist/styles/text.css +8 -0
- package/dist/styles/token-search-field.css +29 -0
- package/dist/text.d.ts +1 -1
- package/dist/text.js +1 -1
- package/dist/token-search-field-CCke1yvQ.d.ts +126 -0
- package/dist/token-search-field.d.ts +3 -75
- package/dist/token-search-field.js +1 -1
- package/dist/token-search-model.d.ts +3 -0
- package/dist/token-search-model.js +3 -0
- package/dist/token-search-model.js.map +1 -0
- package/dist/toolbar-control-group.d.ts +3 -1
- package/dist/toolbar-control-group.js +1 -1
- package/dist/wire-token-search-fields.d.ts +5 -1
- package/dist/wire-token-search-fields.js +1 -1
- package/dist/workbench.d.ts +5 -5
- package/dist/workbench.js +1 -1
- package/docs/accessibility.md +14 -0
- package/docs/collapsible-panel.md +12 -7
- package/docs/component-contract.md +2 -1
- package/docs/component-integration.md +8 -1
- package/docs/component-selection.md +43 -2
- package/docs/layout.md +4 -1
- package/docs/workbench.md +12 -11
- package/llms.txt +6 -3
- package/package.json +5 -1
- package/dist/chunk-24PHKUR3.js.map +0 -1
- package/dist/chunk-63ZWBGE3.js.map +0 -1
- package/dist/chunk-G2RKFVRB.js.map +0 -1
- package/dist/chunk-NBYTIVHS.js.map +0 -1
- package/dist/chunk-WLG6SSNT.js.map +0 -1
- package/dist/chunk-XCO6YCYM.js.map +0 -1
- package/dist/chunk-ZIYOJFZD.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { wireResizableRegions } from './chunk-XQV2B4IL.js';
|
|
2
2
|
export { reorderTabs, wireTabBars } from './chunk-46263QLK.js';
|
|
3
|
-
export { wireTokenSearchFields } from './chunk-
|
|
4
|
-
export { TokenSearchField, placeTokenSearchCaret, readTokenSearchField } from './chunk-
|
|
3
|
+
export { wireTokenSearchFields } from './chunk-UFYZHYWU.js';
|
|
4
|
+
export { TokenSearchField, placeTokenSearchCaret, readTokenSearchField } from './chunk-RRB26JRJ.js';
|
|
5
|
+
export { createTokenSearchModel } from './chunk-F7F7KRO2.js';
|
|
5
6
|
export { ValueTable, ValueTableRow } from './chunk-6CINWX2E.js';
|
|
6
7
|
export { wireScrollDividers } from './chunk-JCV4GXWB.js';
|
|
7
8
|
|
|
@@ -17,7 +18,7 @@ export { EmptyState } from './chunk-E36EVCKG.js';
|
|
|
17
18
|
export { Grid } from './chunk-AGXQQFKZ.js';
|
|
18
19
|
export { ListActionRow } from './chunk-F4QMLOXJ.js';
|
|
19
20
|
export { AppTab } from './chunk-WOUF7YXM.js';
|
|
20
|
-
export { PopupMenu } from './chunk-
|
|
21
|
+
export { PopupMenu, closePopupMenu, openPopupMenuAt } from './chunk-UWONG4QE.js';
|
|
21
22
|
export { ResizableRegion, clampRegionSize, resizeRegionFromPointer } from './chunk-VHADGP3B.js';
|
|
22
23
|
export { Row } from './chunk-VZOFZPSO.js';
|
|
23
24
|
export { ListInsetText } from './chunk-DG6G5EPF.js';
|
|
@@ -28,12 +29,12 @@ export { ToolbarText } from './chunk-XDKAYSVD.js';
|
|
|
28
29
|
export { FloatingToolbar } from './chunk-M7QV3IHH.js';
|
|
29
30
|
|
|
30
31
|
export { LoadingSpinner } from './chunk-ZLWQZUGF.js';
|
|
31
|
-
export { ListHeader } from './chunk-
|
|
32
|
-
export { Text } from './chunk-
|
|
32
|
+
export { ListHeader } from './chunk-UX2VVXZ3.js';
|
|
33
|
+
export { Text } from './chunk-UXT7TE6B.js';
|
|
33
34
|
export { DisclosureArrow } from './chunk-KROD7KZK.js';
|
|
34
35
|
export { Skeleton } from './chunk-AHEG27M7.js';
|
|
35
36
|
export { Badge } from './chunk-MP2GDBQZ.js';
|
|
36
|
-
export { ToolbarActionLink, ToolbarControlGroup } from './chunk-
|
|
37
|
+
export { ToolbarActionLink, ToolbarControlGroup } from './chunk-7JUBXOIV.js';
|
|
37
38
|
export { Toolbar } from './chunk-6YFHCLHG.js';
|
|
38
39
|
export { Pane } from './chunk-EZVNC4J6.js';
|
|
39
40
|
export { LucideIcon } from './chunk-4R777DUZ.js';
|
package/dist/list-header.js
CHANGED
package/dist/nav-stack.js
CHANGED
|
@@ -33,17 +33,17 @@ interface PanelToggle {
|
|
|
33
33
|
* A collapsible panel's top toolbar, composed so its groups follow the
|
|
34
34
|
* panel's open state.
|
|
35
35
|
*
|
|
36
|
-
* - `title`
|
|
37
|
-
*
|
|
38
|
-
* - `
|
|
39
|
-
*
|
|
40
|
-
* collapsed.
|
|
36
|
+
* - `title` precedes the `leading` zone. Groups may appear in any of the
|
|
37
|
+
* `leading`, `center`, and `trailing` zones while the panel is open.
|
|
38
|
+
* - Groups marked `relocateOnCollapse` move to the work area's toolbar while
|
|
39
|
+
* the panel is collapsed, preserving their order across the three zones.
|
|
41
40
|
* - `toggle` is always the last group: in the panel's toolbar while it is
|
|
42
|
-
* open, and right after the
|
|
41
|
+
* open, and right after the relocated groups in the work area's toolbar
|
|
43
42
|
* while it is collapsed.
|
|
44
43
|
*
|
|
45
|
-
*
|
|
46
|
-
* panel's copy is inert), so give it no `id`s.
|
|
44
|
+
* Relocated content renders in both places while the panel is collapsed (the
|
|
45
|
+
* panel's copy is inert), so give it no `id`s. Pass groups directly or in
|
|
46
|
+
* arrays so their render-time annotation remains available to the panel.
|
|
47
47
|
*
|
|
48
48
|
* The toolbar's configuration (`dividerSides`, `centerAlign`, `responsive`,
|
|
49
49
|
* `responsiveAt`, `safeAreaEdges`) forwards to its `Toolbar`. It draws no
|
|
@@ -54,10 +54,9 @@ interface PanelToolbar extends ToolbarConfig {
|
|
|
54
54
|
/** Accessible name of the panel's toolbar. */
|
|
55
55
|
label: string;
|
|
56
56
|
title?: KerfUiContent;
|
|
57
|
-
|
|
58
|
-
/** Panel-only center content, available only while the panel is open. */
|
|
57
|
+
leading?: KerfUiContent;
|
|
59
58
|
center?: KerfUiContent;
|
|
60
|
-
|
|
59
|
+
trailing?: KerfUiContent;
|
|
61
60
|
toggle?: PanelToggle;
|
|
62
61
|
}
|
|
63
62
|
|
package/dist/popup-menu.d.ts
CHANGED
|
@@ -18,9 +18,19 @@ interface PopupMenuItem {
|
|
|
18
18
|
value?: string;
|
|
19
19
|
/** Leading icon, typically a `LucideIcon`; it is placed in the item's icon slot. */
|
|
20
20
|
icon?: SafeHtml;
|
|
21
|
+
/** A checked menu choice, including nested choices. */
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
/** Trailing safe content, such as a selected-choice tick. */
|
|
24
|
+
details?: SafeHtml;
|
|
25
|
+
/** Destructive command styling. */
|
|
26
|
+
tone?: 'default' | 'danger';
|
|
21
27
|
disabled?: boolean;
|
|
28
|
+
/** Native tooltip text for a disabled command. */
|
|
29
|
+
disabledReason?: string;
|
|
22
30
|
/** Application `data-*` metadata such as a record id. */
|
|
23
31
|
attributes?: PopupMenuDataAttributes;
|
|
32
|
+
/** Child commands opened by hover or keyboard navigation. */
|
|
33
|
+
submenu?: readonly PopupMenuItem[];
|
|
24
34
|
}
|
|
25
35
|
/** A labeled group heading; items that follow it belong to the group. */
|
|
26
36
|
interface PopupMenuHeading {
|
|
@@ -44,7 +54,17 @@ type PopupMenuTriggerName = {
|
|
|
44
54
|
*/
|
|
45
55
|
label: string;
|
|
46
56
|
};
|
|
47
|
-
type
|
|
57
|
+
type PopupMenuTrigger = (PopupMenuTriggerName & {
|
|
58
|
+
context?: false;
|
|
59
|
+
}) | {
|
|
60
|
+
context: true;
|
|
61
|
+
label: string;
|
|
62
|
+
text?: never;
|
|
63
|
+
icon?: never;
|
|
64
|
+
caret?: never;
|
|
65
|
+
disabled?: never;
|
|
66
|
+
};
|
|
67
|
+
type PopupMenuProps = PopupMenuTrigger & {
|
|
48
68
|
/** Trigger icon, typically a `LucideIcon`, before any visible text. */
|
|
49
69
|
icon?: KerfUiContent;
|
|
50
70
|
items: readonly PopupMenuEntry[];
|
|
@@ -58,6 +78,14 @@ type PopupMenuProps = PopupMenuTriggerName & {
|
|
|
58
78
|
/** Native named-slot assignment when composed inside a web component. */
|
|
59
79
|
slot?: string;
|
|
60
80
|
};
|
|
81
|
+
/** A rendered context PopupMenu with Web Awesome's controlled open state. */
|
|
82
|
+
type PopupMenuElement = HTMLElement & {
|
|
83
|
+
open: boolean;
|
|
84
|
+
};
|
|
85
|
+
/** Open a context PopupMenu at viewport pointer coordinates. */
|
|
86
|
+
declare function openPopupMenuAt(menu: PopupMenuElement, x: number, y: number): void;
|
|
87
|
+
/** Close a programmatically opened PopupMenu. */
|
|
88
|
+
declare function closePopupMenu(menu: PopupMenuElement): void;
|
|
61
89
|
/**
|
|
62
90
|
* An action menu: a trigger button that opens a list of commands. Renders the
|
|
63
91
|
* `wa-dropdown` root directly, so a `single` `ToolbarControlGroup` (with
|
|
@@ -66,6 +94,6 @@ type PopupMenuProps = PopupMenuTriggerName & {
|
|
|
66
94
|
* open-state reaction. Import `@kerfjs/ui/popup-menu/register` once to register
|
|
67
95
|
* the Web Awesome elements.
|
|
68
96
|
*/
|
|
69
|
-
declare function PopupMenu({ text, label, icon, items, placement, caret, disabled, rootAttributes, slot, }: PopupMenuProps): SafeHtml;
|
|
97
|
+
declare function PopupMenu({ text, label, icon, items, placement, caret, disabled, rootAttributes, slot, context, }: PopupMenuProps): SafeHtml;
|
|
70
98
|
|
|
71
|
-
export { PopupMenu, type PopupMenuDivider, type PopupMenuEntry, type PopupMenuHeading, type PopupMenuItem, type PopupMenuPlacement, type PopupMenuProps };
|
|
99
|
+
export { PopupMenu, type PopupMenuDivider, type PopupMenuElement, type PopupMenuEntry, type PopupMenuHeading, type PopupMenuItem, type PopupMenuPlacement, type PopupMenuProps, closePopupMenu, openPopupMenuAt };
|
package/dist/popup-menu.js
CHANGED
package/dist/split-view.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
scale: none !important;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.kui-popup-menu
|
|
36
|
+
.kui-popup-menu wa-dropdown-item {
|
|
37
37
|
/* Leading inset plus the Select's check column, so item icons and labels
|
|
38
38
|
start where a Select option's do. */
|
|
39
39
|
padding: var(--_kui-popup-row-padding-block)
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
var(--_kui-popup-row-check-width)
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
.kui-popup-menu
|
|
46
|
+
.kui-popup-menu wa-dropdown-item::part(label) {
|
|
47
47
|
padding-block: var(--_kui-popup-row-label-padding-block);
|
|
48
48
|
line-height: var(--_kui-popup-row-label-line-height);
|
|
49
49
|
}
|
|
50
50
|
/* A keyboard-focused item is the menu's current row: the Select's brand fill,
|
|
51
51
|
with no second focus ring inside the open popup. */
|
|
52
|
-
.kui-popup-menu
|
|
52
|
+
.kui-popup-menu wa-dropdown-item:focus-visible {
|
|
53
53
|
outline: none;
|
|
54
54
|
color: var(--_kui-popup-row-current-color);
|
|
55
55
|
background-color: var(--_kui-popup-row-current-background);
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/* Center the icon on the label's line, like the Select's start slot. */
|
|
62
|
-
.kui-popup-menu
|
|
62
|
+
.kui-popup-menu wa-dropdown-item::part(icon) {
|
|
63
63
|
display: flex;
|
|
64
64
|
align-self: center;
|
|
65
65
|
}
|
|
@@ -78,6 +78,35 @@
|
|
|
78
78
|
height: 100%;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
.kui-popup-menu__details {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.kui-popup-menu__details svg {
|
|
87
|
+
display: block;
|
|
88
|
+
width: var(--_kui-popup-row-icon-size);
|
|
89
|
+
height: var(--_kui-popup-row-icon-size);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.kui-popup-menu[data-trigger="context"] {
|
|
93
|
+
display: inline-block;
|
|
94
|
+
width: 0;
|
|
95
|
+
height: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.kui-popup-menu__context-anchor {
|
|
99
|
+
position: fixed;
|
|
100
|
+
top: var(--kui-popup-menu-context-y, 0px);
|
|
101
|
+
left: var(--kui-popup-menu-context-x, 0px);
|
|
102
|
+
width: 1px;
|
|
103
|
+
height: 1px;
|
|
104
|
+
padding: 0;
|
|
105
|
+
border: 0;
|
|
106
|
+
opacity: 0;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
81
110
|
/* A group title matches the Select's group title. It is a styled element
|
|
82
111
|
rather than a slotted heading, whose Web Awesome metrics are !important. */
|
|
83
112
|
.kui-popup-menu__heading {
|
package/dist/styles/text.css
CHANGED
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
font-size: var(--kui-font-xs);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
.kui-text[data-size="large"] {
|
|
21
|
+
font-size: var(--kui-font-l);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.kui-text[data-size="xlarge"] {
|
|
25
|
+
font-size: var(--kui-font-2xl);
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
.kui-text[data-font="monospace"] {
|
|
21
29
|
font-family: var(--kui-font-mono);
|
|
22
30
|
}
|
|
@@ -145,6 +145,35 @@
|
|
|
145
145
|
grid-column: 4;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
.kui-token-search__suggestions {
|
|
149
|
+
display: grid;
|
|
150
|
+
grid-column: 2 / -1;
|
|
151
|
+
min-width: 0;
|
|
152
|
+
padding: 0.25rem;
|
|
153
|
+
border: 1px solid var(--kui-token-search-border);
|
|
154
|
+
border-radius: var(--kui-radius-pill);
|
|
155
|
+
background: var(--kui-token-search-background);
|
|
156
|
+
gap: 0.125rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.kui-token-search__suggestion {
|
|
160
|
+
width: 100%;
|
|
161
|
+
padding: 0.375rem 0.5rem;
|
|
162
|
+
border: 0;
|
|
163
|
+
border-radius: var(--kui-radius-pill);
|
|
164
|
+
color: var(--kui-color-text);
|
|
165
|
+
background: transparent;
|
|
166
|
+
font: inherit;
|
|
167
|
+
text-align: start;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.kui-token-search__suggestion:hover,
|
|
172
|
+
.kui-token-search__suggestion:focus-visible {
|
|
173
|
+
background: var(--kui-color-surface-lowered);
|
|
174
|
+
outline: var(--kui-focus-ring);
|
|
175
|
+
}
|
|
176
|
+
|
|
148
177
|
.kui-token-search[data-has-trailing="false"] .kui-token-search__clear {
|
|
149
178
|
grid-column: 4;
|
|
150
179
|
}
|
package/dist/text.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
|
4
4
|
|
|
5
5
|
type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
6
6
|
type TextTone = 'default' | 'quiet' | 'danger';
|
|
7
|
-
type TextSize = 'default' | '
|
|
7
|
+
type TextSize = 'compact' | 'default' | 'large' | 'xlarge';
|
|
8
8
|
type TextFont = 'default' | 'monospace';
|
|
9
9
|
type TextBorder = 'transparent' | 'none';
|
|
10
10
|
type TextContent = KerfUiContent | string | number | readonly TextContent[];
|
package/dist/text.js
CHANGED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Signal, SafeHtml } from 'kerfjs';
|
|
2
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
3
|
+
|
|
4
|
+
interface TokenSearchRule {
|
|
5
|
+
/** The word before `:` (for example `tag` or `status`). */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Return a canonical value, or undefined to leave invalid input as text. */
|
|
8
|
+
parse?: (input: string) => string | undefined;
|
|
9
|
+
/** Label for a committed chip. Defaults to `name:input`. */
|
|
10
|
+
label?: (value: string, input: string) => string;
|
|
11
|
+
/** Suggestions for the unfinished value after `name:`. */
|
|
12
|
+
suggest?: (input: string) => readonly (string | {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
})[];
|
|
16
|
+
}
|
|
17
|
+
interface TokenSearchResolvedToken extends TokenSearchToken {
|
|
18
|
+
kind: string;
|
|
19
|
+
parsedValue: string;
|
|
20
|
+
}
|
|
21
|
+
interface TokenSearchState {
|
|
22
|
+
query: string;
|
|
23
|
+
tokens: TokenSearchResolvedToken[];
|
|
24
|
+
}
|
|
25
|
+
interface TokenSearchSuggestion {
|
|
26
|
+
value: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
interface TokenSearchModel<Result = unknown> {
|
|
30
|
+
state: Signal<TokenSearchState>;
|
|
31
|
+
/** Changes when a model action must replace DOM-owned editor text. */
|
|
32
|
+
editorRevision: Signal<number>;
|
|
33
|
+
suggestions: Signal<readonly TokenSearchSuggestion[]>;
|
|
34
|
+
result: Signal<Result | undefined>;
|
|
35
|
+
edit(value: TokenSearchFieldValue, commit?: boolean): void;
|
|
36
|
+
submit(value: TokenSearchFieldValue): void;
|
|
37
|
+
choose(value: string): void;
|
|
38
|
+
expandToken(value: string): void;
|
|
39
|
+
remove(value: string): void;
|
|
40
|
+
clear(): void;
|
|
41
|
+
dismiss(): void;
|
|
42
|
+
}
|
|
43
|
+
interface TokenSearchModelOptions<Result> {
|
|
44
|
+
rules?: readonly TokenSearchRule[];
|
|
45
|
+
initial?: TokenSearchFieldValue;
|
|
46
|
+
/** Runs after every state change, including initial state. */
|
|
47
|
+
evaluate?: (state: TokenSearchState) => Result;
|
|
48
|
+
onSubmit?: (state: TokenSearchState, result: Result | undefined) => void;
|
|
49
|
+
}
|
|
50
|
+
/** Opt-in state, token parsing, suggestions, and evaluation for TokenSearchField. */
|
|
51
|
+
declare function createTokenSearchModel<Result = unknown>({ rules, initial, evaluate, onSubmit, }?: TokenSearchModelOptions<Result>): TokenSearchModel<Result>;
|
|
52
|
+
|
|
53
|
+
interface TokenSearchToken {
|
|
54
|
+
value: string;
|
|
55
|
+
label: string;
|
|
56
|
+
offset?: number;
|
|
57
|
+
accessibleLabel?: string;
|
|
58
|
+
}
|
|
59
|
+
type TokenSearchEditorAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
60
|
+
'data-component'?: never;
|
|
61
|
+
'data-key'?: never;
|
|
62
|
+
'data-morph-skip'?: never;
|
|
63
|
+
'data-token-search-editor'?: never;
|
|
64
|
+
'data-token-count'?: never;
|
|
65
|
+
'data-placeholder'?: never;
|
|
66
|
+
}>;
|
|
67
|
+
interface TokenSearchFieldBaseProps {
|
|
68
|
+
id: string;
|
|
69
|
+
label: string;
|
|
70
|
+
query?: string;
|
|
71
|
+
tokens?: readonly TokenSearchToken[];
|
|
72
|
+
/** Opt-in grammar, suggestion, and evaluation state. Overrides `query` and `tokens`. */
|
|
73
|
+
model?: TokenSearchModel;
|
|
74
|
+
/**
|
|
75
|
+
* Editor identity for a programmatic text replacement. The editor's text is
|
|
76
|
+
* DOM-owned between token changes, so a new `query` with the same tokens
|
|
77
|
+
* does not re-render it (that would reset the caret on every keystroke).
|
|
78
|
+
* Change `revision` when the app replaces the text itself — reseeding a
|
|
79
|
+
* persistent dialog's field on reopen, applying a saved search — and the
|
|
80
|
+
* editor is rebuilt from `query` and `tokens`.
|
|
81
|
+
*/
|
|
82
|
+
revision?: string | number;
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
tokenPlaceholder?: string;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
autofocus?: boolean;
|
|
87
|
+
leading?: KerfUiContent;
|
|
88
|
+
trailing?: KerfUiContent;
|
|
89
|
+
/** Standalone field chrome or the inset visual layer of a configured toolbar group. */
|
|
90
|
+
presentation?: 'standalone' | 'toolbar-group';
|
|
91
|
+
editAction?: string;
|
|
92
|
+
removeAction?: string;
|
|
93
|
+
clearAction?: string;
|
|
94
|
+
clearLabel?: string;
|
|
95
|
+
/** Icon for the clear button. Default: the Lucide `x` glyph token chips also use. */
|
|
96
|
+
clearIcon?: SafeHtml;
|
|
97
|
+
className?: string;
|
|
98
|
+
editorAttributes?: TokenSearchEditorAttributes;
|
|
99
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
100
|
+
slot?: string;
|
|
101
|
+
}
|
|
102
|
+
type TokenSearchCollapsibleProps = {
|
|
103
|
+
/** Allow an empty field to render as one iconic action. */
|
|
104
|
+
collapsible: true;
|
|
105
|
+
/** Keep an empty collapsible field open while the application owns focus. */
|
|
106
|
+
expanded?: boolean;
|
|
107
|
+
expandAction?: string;
|
|
108
|
+
expandLabel?: string;
|
|
109
|
+
} | {
|
|
110
|
+
collapsible?: false;
|
|
111
|
+
expanded?: never;
|
|
112
|
+
expandAction?: never;
|
|
113
|
+
expandLabel?: never;
|
|
114
|
+
};
|
|
115
|
+
type TokenSearchFieldProps = TokenSearchFieldBaseProps & TokenSearchCollapsibleProps;
|
|
116
|
+
interface TokenSearchFieldValue {
|
|
117
|
+
query: string;
|
|
118
|
+
tokens: TokenSearchToken[];
|
|
119
|
+
}
|
|
120
|
+
declare function TokenSearchField({ id, label, query, tokens, model, revision, placeholder, tokenPlaceholder, disabled, autofocus, collapsible, expanded, expandAction, expandLabel, leading, trailing, presentation, editAction, removeAction, clearAction, clearLabel, clearIcon, className, editorAttributes, slot, }: TokenSearchFieldProps): SafeHtml;
|
|
121
|
+
/** Read editable text and ordered token offsets from a rendered TokenSearchField editor. */
|
|
122
|
+
declare function readTokenSearchField(editor: HTMLElement, knownTokens?: readonly TokenSearchToken[]): TokenSearchFieldValue;
|
|
123
|
+
/** Focus an editor and place its caret at a text offset, skipping atomic token chips. */
|
|
124
|
+
declare function placeTokenSearchCaret(editor: HTMLElement, offset?: number): void;
|
|
125
|
+
|
|
126
|
+
export { type TokenSearchEditorAttributes as T, TokenSearchField as a, type TokenSearchFieldProps as b, type TokenSearchFieldValue as c, type TokenSearchModel as d, type TokenSearchModelOptions as e, type TokenSearchResolvedToken as f, type TokenSearchRule as g, type TokenSearchState as h, type TokenSearchSuggestion as i, type TokenSearchToken as j, createTokenSearchModel as k, placeTokenSearchCaret as p, readTokenSearchField as r };
|
|
@@ -1,75 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
interface TokenSearchToken {
|
|
5
|
-
value: string;
|
|
6
|
-
label: string;
|
|
7
|
-
offset?: number;
|
|
8
|
-
accessibleLabel?: string;
|
|
9
|
-
}
|
|
10
|
-
type TokenSearchEditorAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
11
|
-
'data-component'?: never;
|
|
12
|
-
'data-key'?: never;
|
|
13
|
-
'data-morph-skip'?: never;
|
|
14
|
-
'data-token-search-editor'?: never;
|
|
15
|
-
'data-token-count'?: never;
|
|
16
|
-
'data-placeholder'?: never;
|
|
17
|
-
}>;
|
|
18
|
-
interface TokenSearchFieldBaseProps {
|
|
19
|
-
id: string;
|
|
20
|
-
label: string;
|
|
21
|
-
query?: string;
|
|
22
|
-
tokens?: readonly TokenSearchToken[];
|
|
23
|
-
/**
|
|
24
|
-
* Editor identity for a programmatic text replacement. The editor's text is
|
|
25
|
-
* DOM-owned between token changes, so a new `query` with the same tokens
|
|
26
|
-
* does not re-render it (that would reset the caret on every keystroke).
|
|
27
|
-
* Change `revision` when the app replaces the text itself — reseeding a
|
|
28
|
-
* persistent dialog's field on reopen, applying a saved search — and the
|
|
29
|
-
* editor is rebuilt from `query` and `tokens`.
|
|
30
|
-
*/
|
|
31
|
-
revision?: string | number;
|
|
32
|
-
placeholder?: string;
|
|
33
|
-
tokenPlaceholder?: string;
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
autofocus?: boolean;
|
|
36
|
-
leading?: KerfUiContent;
|
|
37
|
-
trailing?: KerfUiContent;
|
|
38
|
-
/** Standalone field chrome or the inset visual layer of a configured toolbar group. */
|
|
39
|
-
presentation?: 'standalone' | 'toolbar-group';
|
|
40
|
-
editAction?: string;
|
|
41
|
-
removeAction?: string;
|
|
42
|
-
clearAction?: string;
|
|
43
|
-
clearLabel?: string;
|
|
44
|
-
/** Icon for the clear button. Default: the Lucide `x` glyph token chips also use. */
|
|
45
|
-
clearIcon?: SafeHtml;
|
|
46
|
-
className?: string;
|
|
47
|
-
editorAttributes?: TokenSearchEditorAttributes;
|
|
48
|
-
/** Native named-slot assignment when composed inside a web component. */
|
|
49
|
-
slot?: string;
|
|
50
|
-
}
|
|
51
|
-
type TokenSearchCollapsibleProps = {
|
|
52
|
-
/** Allow an empty field to render as one iconic action. */
|
|
53
|
-
collapsible: true;
|
|
54
|
-
/** Keep an empty collapsible field open while the application owns focus. */
|
|
55
|
-
expanded?: boolean;
|
|
56
|
-
expandAction?: string;
|
|
57
|
-
expandLabel?: string;
|
|
58
|
-
} | {
|
|
59
|
-
collapsible?: false;
|
|
60
|
-
expanded?: never;
|
|
61
|
-
expandAction?: never;
|
|
62
|
-
expandLabel?: never;
|
|
63
|
-
};
|
|
64
|
-
type TokenSearchFieldProps = TokenSearchFieldBaseProps & TokenSearchCollapsibleProps;
|
|
65
|
-
interface TokenSearchFieldValue {
|
|
66
|
-
query: string;
|
|
67
|
-
tokens: TokenSearchToken[];
|
|
68
|
-
}
|
|
69
|
-
declare function TokenSearchField({ id, label, query, tokens, revision, placeholder, tokenPlaceholder, disabled, autofocus, collapsible, expanded, expandAction, expandLabel, leading, trailing, presentation, editAction, removeAction, clearAction, clearLabel, clearIcon, className, editorAttributes, slot, }: TokenSearchFieldProps): SafeHtml;
|
|
70
|
-
/** Read editable text and ordered token offsets from a rendered TokenSearchField editor. */
|
|
71
|
-
declare function readTokenSearchField(editor: HTMLElement, knownTokens?: readonly TokenSearchToken[]): TokenSearchFieldValue;
|
|
72
|
-
/** Focus an editor and place its caret at a text offset, skipping atomic token chips. */
|
|
73
|
-
declare function placeTokenSearchCaret(editor: HTMLElement, offset?: number): void;
|
|
74
|
-
|
|
75
|
-
export { type TokenSearchEditorAttributes, TokenSearchField, type TokenSearchFieldProps, type TokenSearchFieldValue, type TokenSearchToken, placeTokenSearchCaret, readTokenSearchField };
|
|
1
|
+
import 'kerfjs';
|
|
2
|
+
import './semantic-content-BbzjvSu9.js';
|
|
3
|
+
export { T as TokenSearchEditorAttributes, a as TokenSearchField, b as TokenSearchFieldProps, c as TokenSearchFieldValue, j as TokenSearchToken, p as placeTokenSearchCaret, r as readTokenSearchField } from './token-search-field-CCke1yvQ.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import 'kerfjs';
|
|
2
|
+
export { d as TokenSearchModel, e as TokenSearchModelOptions, f as TokenSearchResolvedToken, g as TokenSearchRule, h as TokenSearchState, i as TokenSearchSuggestion, k as createTokenSearchModel } from './token-search-field-CCke1yvQ.js';
|
|
3
|
+
import './semantic-content-BbzjvSu9.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"token-search-model.js"}
|
|
@@ -56,6 +56,8 @@ interface ToolbarControlGroupProps {
|
|
|
56
56
|
overflow?: ToolbarControlGroupOverflow;
|
|
57
57
|
/** Responsive visibility owned by the enclosing Toolbar container. */
|
|
58
58
|
visibility?: ToolbarControlGroupVisibility;
|
|
59
|
+
/** Move this group into the work-area toolbar when its panel collapses. */
|
|
60
|
+
relocateOnCollapse?: boolean;
|
|
59
61
|
/** Add contrast behind photo-backed avatar content. */
|
|
60
62
|
scrim?: boolean;
|
|
61
63
|
/**
|
|
@@ -66,6 +68,6 @@ interface ToolbarControlGroupProps {
|
|
|
66
68
|
/** Native named-slot assignment when composed inside a web component. */
|
|
67
69
|
slot?: string;
|
|
68
70
|
}
|
|
69
|
-
declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance, shape, size, density, content, focusRing, selectedChrome, selectedTone, nestedDropdown, menuInset, overflow, visibility, scrim, avatarImage, slot, }: ToolbarControlGroupProps): kerfjs.SafeHtml;
|
|
71
|
+
declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance, shape, size, density, content, focusRing, selectedChrome, selectedTone, nestedDropdown, menuInset, overflow, visibility, relocateOnCollapse, scrim, avatarImage, slot, }: ToolbarControlGroupProps): kerfjs.SafeHtml;
|
|
70
72
|
|
|
71
73
|
export { ToolbarActionLink, type ToolbarActionLinkProps, ToolbarControlGroup, type ToolbarControlGroupAppearance, type ToolbarControlGroupButtonAppearance, type ToolbarControlGroupContent, type ToolbarControlGroupDensity, type ToolbarControlGroupFocusRing, type ToolbarControlGroupMenuInset, type ToolbarControlGroupOverflow, type ToolbarControlGroupProps, type ToolbarControlGroupSelectedChrome, type ToolbarControlGroupSelectedTone, type ToolbarControlGroupShape, type ToolbarControlGroupSize, type ToolbarControlGroupTone, type ToolbarControlGroupVisibility };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Signal } from 'kerfjs';
|
|
2
|
+
import { d as TokenSearchModel } from './token-search-field-CCke1yvQ.js';
|
|
3
|
+
import './semantic-content-BbzjvSu9.js';
|
|
2
4
|
|
|
3
5
|
interface TokenSearchSubmit {
|
|
4
6
|
id: string;
|
|
@@ -76,6 +78,8 @@ interface TokenSearchCollapsibleOptions {
|
|
|
76
78
|
signals?: Readonly<Record<string, Signal<boolean>>>;
|
|
77
79
|
}
|
|
78
80
|
interface WireTokenSearchFieldsOptions {
|
|
81
|
+
/** Optional automatic grammar/suggestion models, keyed by TokenSearchField id. */
|
|
82
|
+
models?: Readonly<Record<string, TokenSearchModel>>;
|
|
79
83
|
onSubmit?: (submission: TokenSearchSubmit) => void;
|
|
80
84
|
/** Fired on every editor `input`, after the browser mutates it, so a caller can drop its own `input` listener. */
|
|
81
85
|
onEdit?: (edit: TokenSearchEdit) => void;
|
|
@@ -106,6 +110,6 @@ interface TokenSearchFieldsHandle {
|
|
|
106
110
|
* expand/collapse/focus. Returns a {@link TokenSearchFieldsHandle} — a disposer that also
|
|
107
111
|
* exposes the managed `expanded` state per field id.
|
|
108
112
|
*/
|
|
109
|
-
declare function wireTokenSearchFields(root: HTMLElement, { onSubmit, onEdit, collapsible, keyboard, }?: WireTokenSearchFieldsOptions): TokenSearchFieldsHandle;
|
|
113
|
+
declare function wireTokenSearchFields(root: HTMLElement, { models, onSubmit, onEdit, collapsible, keyboard, }?: WireTokenSearchFieldsOptions): TokenSearchFieldsHandle;
|
|
110
114
|
|
|
111
115
|
export { type TokenSearchCollapsibleOptions, type TokenSearchEdit, type TokenSearchFieldsHandle, type TokenSearchKeyboardOptions, type TokenSearchSubmit, type TokenSearchTokenRemoval, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
|
package/dist/workbench.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ListConfig } from './list.js';
|
|
|
3
3
|
import { PaneConfig } from './pane.js';
|
|
4
4
|
import { ResizableRegionSeparator, ResizableRegionCollapseMotion, ResizableRegionContentOverflow, ResizableRegionPresentation, ResizableRegionRestorePosition } from './resizable-region.js';
|
|
5
5
|
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
6
|
-
import { a as PanelToolbar, b as PanelToggle } from './panel-toolbar-
|
|
6
|
+
import { a as PanelToolbar, b as PanelToggle } from './panel-toolbar-DqwtBxQL.js';
|
|
7
7
|
import { ToolbarConfig } from './toolbar.js';
|
|
8
8
|
import './css-values.js';
|
|
9
9
|
import './flex-alignment-4ms8ZbV8.js';
|
|
@@ -16,7 +16,7 @@ type WorkbenchPanelToggle = PanelToggle;
|
|
|
16
16
|
/**
|
|
17
17
|
* A Workbench panel's top toolbar, composed by the Workbench so its groups can
|
|
18
18
|
* follow the panel's open state (see {@link PanelToolbar} for the roles).
|
|
19
|
-
* A collapsed rail's
|
|
19
|
+
* A collapsed rail's marked groups and toggle go to the leading edge of
|
|
20
20
|
* `mainToolbar` (left rail) or its trailing edge (right rail); a collapsed
|
|
21
21
|
* drawer's go to the trailing edge of `mainBottomToolbar`, else to a
|
|
22
22
|
* `FloatingToolbar` in the work area's bottom-end corner.
|
|
@@ -83,7 +83,7 @@ interface WorkbenchPanelResizable {
|
|
|
83
83
|
interface WorkbenchPanel {
|
|
84
84
|
content: KerfUiContent;
|
|
85
85
|
/**
|
|
86
|
-
* The panel's top toolbar, composed by the Workbench: its
|
|
86
|
+
* The panel's top toolbar, composed by the Workbench: its marked groups
|
|
87
87
|
* and standard `toggle` move to the work area's toolbar while the panel is
|
|
88
88
|
* collapsed. With it, `content` renders in a `Pane` below the toolbar.
|
|
89
89
|
*/
|
|
@@ -154,7 +154,7 @@ interface WorkbenchProps {
|
|
|
154
154
|
/** The central work area. */
|
|
155
155
|
main: KerfUiContent;
|
|
156
156
|
/**
|
|
157
|
-
* The work area's top toolbar. A collapsed left rail's
|
|
157
|
+
* The work area's top toolbar. A collapsed left rail's marked groups
|
|
158
158
|
* and toggle lead it; a collapsed right rail's trail it. With it, `main`
|
|
159
159
|
* renders in a `Pane` below the toolbar.
|
|
160
160
|
*/
|
|
@@ -170,7 +170,7 @@ interface WorkbenchProps {
|
|
|
170
170
|
*/
|
|
171
171
|
mainFooter?: KerfUiContent;
|
|
172
172
|
/**
|
|
173
|
-
* The work area's bottom toolbar. A collapsed drawer's
|
|
173
|
+
* The work area's bottom toolbar. A collapsed drawer's marked groups and
|
|
174
174
|
* toggle trail it; without it they float in the work area's corner.
|
|
175
175
|
*/
|
|
176
176
|
mainBottomToolbar?: WorkbenchMainBottomToolbar;
|
package/dist/workbench.js
CHANGED