@synopackageland/ui 0.20.3 → 0.20.4
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/CHANGELOG.md +22 -0
- package/LICENSES/ux-foundation.md +83 -0
- package/LICENSES/ux-grid-baserow.md +35 -0
- package/LICENSES/ux-grid-teable.md +48 -0
- package/README.md +3 -0
- package/dist/cli.js +0 -0
- package/dist/components/app/app-layout/AppLayout.vue.d.ts +31 -4
- package/dist/components/app/app-root/AppRoot.vue.d.ts +9 -0
- package/dist/components/app/aside-panel/AsidePanel.vue.d.ts +69 -0
- package/dist/components/app/aside-panel/asidePreference.d.ts +28 -0
- package/dist/components/composite/adaptive-panel/AdaptivePanel.vue.d.ts +61 -0
- package/dist/components/composite/connection-topology/ConnectionTopology.vue.d.ts +1 -1
- package/dist/components/composite/file-picker/FilePicker.vue.d.ts +1 -1
- package/dist/components/composite/mention-list/MentionList.vue.d.ts +2 -2
- package/dist/components/composite/overflow-toolbar/OverflowToolbar.vue.d.ts +2 -2
- package/dist/components/composite/record-panel/RecordPanel.vue.d.ts +77 -0
- package/dist/components/composite/record-panel/recordPanelWidth.d.ts +54 -0
- package/dist/components/composite/summary-card/SummaryCard.vue.d.ts +1 -1
- package/dist/components/composite/tag-editor/TagEditor.vue.d.ts +2 -2
- package/dist/components/composite/tree-view/TreeView.vue.d.ts +1 -1
- package/dist/components/composite/wizard/Wizard.vue.d.ts +2 -2
- package/dist/components/composite/wizard/WizardDialog.vue.d.ts +2 -2
- package/dist/components/containers/card/Card.vue.d.ts +1 -1
- package/dist/components/containers/card/CardField.vue.d.ts +26 -0
- package/dist/components/containers/card-grid/CardCover.vue.d.ts +16 -0
- package/dist/components/containers/card-grid/CardGrid.vue.d.ts +1 -1
- package/dist/components/containers/card-grid/VirtualCardGrid.vue.d.ts +71 -0
- package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +1 -1
- package/dist/components/containers/fieldset/Fieldset.vue.d.ts +1 -1
- package/dist/components/containers/list-detail/ListDetail.vue.d.ts +1 -1
- package/dist/components/containers/split-pane/SplitPane.vue.d.ts +1 -1
- package/dist/components/feedback/notification/Notification.vue.d.ts +1 -1
- package/dist/components/feedback/notification/NotificationProvider.vue.d.ts +1 -1
- package/dist/components/primitives/breadcrumb/Breadcrumb.vue.d.ts +2 -2
- package/dist/components/primitives/context-menu/ContextMenu.vue.d.ts +3 -0
- package/dist/components/primitives/context-menu/ContextMenuItems.vue.d.ts +4 -5
- package/dist/components/primitives/dialog/Dialog.vue.d.ts +2 -2
- package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +4 -0
- package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +6 -3
- package/dist/components/primitives/popover/Popover.vue.d.ts +10 -2
- package/dist/components/primitives/popover/floating.d.ts +27 -0
- package/dist/components/primitives/popover/overlay.d.ts +36 -0
- package/dist/components/primitives/segment-control/SegmentControl.vue.d.ts +4 -1
- package/dist/components/primitives/segment-control/context.d.ts +3 -0
- package/dist/components/primitives/select/Select.vue.d.ts +4 -0
- package/dist/components/primitives/select/internal/ComboboxField.vue.d.ts +1 -0
- package/dist/components/primitives/select/internal/types.d.ts +2 -0
- package/dist/components/primitives/skeleton/SectionSkeleton.vue.d.ts +25 -4
- package/dist/components/primitives/skeleton/Skeleton.vue.d.ts +3 -0
- package/dist/components/primitives/tag/Tag.vue.d.ts +2 -2
- package/dist/components/primitives/toast/ToastProvider.vue.d.ts +0 -2
- package/dist/components/primitives/toast/toast.d.ts +21 -1
- package/dist/components/primitives/tooltip/Tooltip.vue.d.ts +8 -3
- package/dist/components/primitives/tooltip/tooltipStyle.d.ts +11 -1
- package/dist/composables/backDismiss.d.ts +19 -0
- package/dist/composables/phone.d.ts +8 -0
- package/dist/composables/softKeyboard.d.ts +26 -4
- package/dist/composables/visualViewport.d.ts +31 -0
- package/dist/dnd/autoScroll.d.ts +57 -0
- package/dist/dnd/dragKit.d.ts +111 -0
- package/dist/dnd/index.d.ts +4 -0
- package/dist/dnd/layout.d.ts +57 -0
- package/dist/dnd/vue.d.ts +16 -0
- package/dist/feedback/StatusSlot.vue.d.ts +24 -0
- package/dist/feedback/showAfter.d.ts +15 -0
- package/dist/feedback/stackMotion.d.ts +13 -0
- package/dist/feedback/timing.d.ts +23 -0
- package/dist/grid/cells/draw.d.ts +57 -0
- package/dist/grid/cells/images.d.ts +5 -0
- package/dist/grid/cells/index.d.ts +7 -0
- package/dist/grid/cells/number.d.ts +5 -0
- package/dist/grid/cells/registry.d.ts +56 -0
- package/dist/grid/cells/renderers.d.ts +8 -0
- package/dist/grid/cells/status.d.ts +6 -0
- package/dist/grid/cells/types.d.ts +200 -0
- package/dist/grid/cells/use.d.ts +7 -0
- package/dist/grid/clipboard/copy.d.ts +17 -0
- package/dist/grid/clipboard/index.d.ts +4 -0
- package/dist/grid/clipboard/proposal.d.ts +35 -0
- package/dist/grid/clipboard/tsv.d.ts +14 -0
- package/dist/grid/clipboard/write.d.ts +21 -0
- package/dist/grid/contracts.d.ts +200 -0
- package/dist/grid/edit/cell-status.d.ts +33 -0
- package/dist/grid/edit/edit-session.d.ts +97 -0
- package/dist/grid/edit/use-grid-edit.d.ts +48 -0
- package/dist/grid/focus/editor-style.d.ts +67 -0
- package/dist/grid/host/GridHost.vue.d.ts +137 -0
- package/dist/grid/host/controller.d.ts +219 -0
- package/dist/grid/host/dom.d.ts +10 -0
- package/dist/grid/index.d.ts +8 -0
- package/dist/grid/range/block.d.ts +30 -0
- package/dist/grid/range/fill.d.ts +27 -0
- package/dist/grid/range/index.d.ts +2 -0
- package/dist/grid/theme.d.ts +61 -0
- package/dist/grid-core/auto-scroll.d.ts +67 -0
- package/dist/grid-core/column-resize.d.ts +43 -0
- package/dist/grid-core/config.d.ts +39 -0
- package/dist/grid-core/coordinate.d.ts +64 -0
- package/dist/grid-core/drag.d.ts +46 -0
- package/dist/grid-core/freeze.d.ts +11 -0
- package/dist/grid-core/index.d.ts +17 -0
- package/dist/grid-core/keyboard.d.ts +34 -0
- package/dist/grid-core/keys.d.ts +38 -0
- package/dist/grid-core/lru.d.ts +10 -0
- package/dist/grid-core/range.d.ts +28 -0
- package/dist/grid-core/region.d.ts +73 -0
- package/dist/grid-core/renderer/base.d.ts +92 -0
- package/dist/grid-core/renderer/layout.d.ts +129 -0
- package/dist/grid-core/selection-controller.d.ts +62 -0
- package/dist/grid-core/selection.d.ts +35 -0
- package/dist/grid-core/theme.d.ts +81 -0
- package/dist/grid-core/types.d.ts +178 -0
- package/dist/grid.js +6173 -0
- package/dist/i18n/text.d.ts +6 -0
- package/dist/index.d.ts +32 -2
- package/dist/index.js +17647 -13630
- package/dist/interaction/editSession.d.ts +49 -0
- package/dist/interaction/focus.d.ts +28 -0
- package/dist/interaction/gesture.d.ts +49 -0
- package/dist/interaction/ime.d.ts +55 -0
- package/dist/interaction/index.d.ts +6 -0
- package/dist/interaction/outside.d.ts +40 -0
- package/dist/interaction/vue.d.ts +21 -0
- package/dist/json-ai-prompt.md +1 -1
- package/dist/json-preview/preview.js +8523 -7814
- package/dist/json.js +10 -10
- package/dist/lib/adaptiveLayout.d.ts +32 -2
- package/dist/lib/deviceViewport.d.ts +2 -1
- package/dist/lib/motion.d.ts +12 -0
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/dist/virtual/cardHeight.d.ts +39 -0
- package/dist/virtual/galleryColumns.d.ts +11 -0
- package/dist/virtual/layoutMotion.d.ts +30 -0
- package/docs/adaptive-layout.md +137 -16
- package/docs/callout.md +22 -1
- package/docs/list-detail.md +54 -0
- package/docs/mobile-native.md +214 -0
- package/docs/release-checks.md +23 -0
- package/docs/theme-hooks.md +28 -7
- package/docs/ux-foundation.md +133 -0
- package/docs/ux-grid.md +217 -0
- package/package.json +94 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { OutsideResult } from './outside';
|
|
2
|
+
/**
|
|
3
|
+
* - `committed`: the draft was handed to `onCommit` and edit ended
|
|
4
|
+
* - `clean`: nothing changed; edit ended without a commit
|
|
5
|
+
* - `invalid`: `validate` rejected the draft; still editing (the veto)
|
|
6
|
+
* - `composing`: an IME owns the input; the commit runs when composition ends
|
|
7
|
+
* - `idle`: there was no edit
|
|
8
|
+
*/
|
|
9
|
+
export type EditCommitResult = 'committed' | 'clean' | 'invalid' | 'composing' | 'idle';
|
|
10
|
+
/** Plain state; `version` increases on every change so a host can bump one shallowRef. */
|
|
11
|
+
export interface EditSessionState<Cell, Value> {
|
|
12
|
+
readonly editing: boolean;
|
|
13
|
+
readonly cell: Cell | null;
|
|
14
|
+
readonly original: Value | undefined;
|
|
15
|
+
readonly draft: Value | undefined;
|
|
16
|
+
readonly composing: boolean;
|
|
17
|
+
readonly dirty: boolean;
|
|
18
|
+
/** Message from the last rejected commit; cleared by the next draft change. */
|
|
19
|
+
readonly error: string | null;
|
|
20
|
+
readonly version: number;
|
|
21
|
+
}
|
|
22
|
+
export interface EditSessionOptions<Cell, Value> {
|
|
23
|
+
equals?: (a: Value | undefined, b: Value | undefined) => boolean;
|
|
24
|
+
/** Return a message to veto the commit; the editor stays open. */
|
|
25
|
+
validate?: (draft: Value | undefined, cell: Cell) => string | null | undefined;
|
|
26
|
+
/** Apply the value locally, synchronously. Saving it is the caller's job. */
|
|
27
|
+
onCommit: (cell: Cell, draft: Value | undefined, original: Value | undefined) => void;
|
|
28
|
+
onCancel?: (cell: Cell, original: Value | undefined) => void;
|
|
29
|
+
onChange?: (state: EditSessionState<Cell, Value>) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface EditSession<Cell, Value> {
|
|
32
|
+
readonly state: EditSessionState<Cell, Value>;
|
|
33
|
+
/** Enter edit synchronously; `draft` defaults to the value (a first typed key passes ''). */
|
|
34
|
+
start(cell: Cell, value: Value | undefined, draft?: Value | undefined): void;
|
|
35
|
+
setDraft(draft: Value | undefined): void;
|
|
36
|
+
/** Feed composition start/end; ending a composition runs a commit that was waiting for it. */
|
|
37
|
+
setComposing(composing: boolean): void;
|
|
38
|
+
commit(): EditCommitResult;
|
|
39
|
+
/** Restore the original and leave edit. False while composing: Escape belongs to the IME. */
|
|
40
|
+
cancel(): boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare function createEditSession<Cell, Value>(options: EditSessionOptions<Cell, Value>): EditSession<Cell, Value>;
|
|
43
|
+
/**
|
|
44
|
+
* The §3.5 outside rules for a selectable, editable surface:
|
|
45
|
+
* - editing: commit (clean edits just close); an invalid draft vetoes the press;
|
|
46
|
+
* the selection stays
|
|
47
|
+
* - selected, not editing: clear the selection
|
|
48
|
+
*/
|
|
49
|
+
export declare function editSessionOutside<Cell, Value>(session: EditSession<Cell, Value>, clearSelection?: () => void): (event: PointerEvent) => OutsideResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Dialog containers whose focus and keys belong to whoever opened them. */
|
|
2
|
+
export declare const DIALOG_SELECTOR = "[role=\"dialog\"],[role=\"alertdialog\"],[aria-modal=\"true\"]";
|
|
3
|
+
/**
|
|
4
|
+
* True when `node` sits in a dialog that does not contain `owner`: a dialog
|
|
5
|
+
* opened over the surface owns focus and keys, so the surface must not take
|
|
6
|
+
* them back. A dialog that contains the owner is the owner's own context.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isInForeignDialog(node: Node | null | undefined, owner: Node): boolean;
|
|
9
|
+
/** Same test for an event path, which stays valid after its nodes are removed. */
|
|
10
|
+
export declare function pathInForeignDialog(path: readonly EventTarget[], owners: readonly Node[]): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Focuses `element` synchronously, without scrolling, unless a foreign dialog
|
|
13
|
+
* holds focus. Call it inside the pointerdown or key handler that changed the
|
|
14
|
+
* selection, so the next key and the first IME symbol land in this element
|
|
15
|
+
* rather than in whatever held focus a frame earlier.
|
|
16
|
+
*/
|
|
17
|
+
export declare function focusSync(element: HTMLElement | null | undefined, owner?: Node | null): boolean;
|
|
18
|
+
export interface FocusOwner {
|
|
19
|
+
/** Focus the owner element now; false when it is missing or a foreign dialog keeps focus. */
|
|
20
|
+
claim(): boolean;
|
|
21
|
+
/** True when the owner element has focus. */
|
|
22
|
+
owns(): boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A single focus owner for a surface (for a grid: the hidden input over the
|
|
26
|
+
* active cell). `element` is read on each call, so the host may swap nodes.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createFocusOwner(element: () => HTMLElement | null | undefined, surface?: () => Node | null | undefined): FocusOwner;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Distance a mouse press must travel before it becomes a drag. */
|
|
2
|
+
export declare const DRAG_THRESHOLD_PX = 5;
|
|
3
|
+
export type GestureAxis = 'x' | 'y' | 'both';
|
|
4
|
+
export type GestureCancelReason = 'pointercancel' | 'blur' | 'dispose';
|
|
5
|
+
/** Plain, mutable gesture state; never reactive, read it in the callbacks. */
|
|
6
|
+
export interface PointerGestureState {
|
|
7
|
+
readonly pointerId: number;
|
|
8
|
+
readonly pointerType: string;
|
|
9
|
+
readonly startX: number;
|
|
10
|
+
readonly startY: number;
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
dx: number;
|
|
14
|
+
dy: number;
|
|
15
|
+
/** True once the threshold was crossed. */
|
|
16
|
+
dragging: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface PointerGestureOptions {
|
|
19
|
+
threshold?: number;
|
|
20
|
+
/** Axis the threshold is measured on; `both` uses the larger of the two. */
|
|
21
|
+
axis?: GestureAxis;
|
|
22
|
+
/** Capture the pointer on the pressed element (default true). */
|
|
23
|
+
capture?: boolean;
|
|
24
|
+
/** Swallow the click that follows a finished drag (default true). */
|
|
25
|
+
suppressClick?: boolean;
|
|
26
|
+
onStart?: (state: PointerGestureState, event: PointerEvent) => void;
|
|
27
|
+
onMove?: (state: PointerGestureState, event: PointerEvent) => void;
|
|
28
|
+
/** Pointer released. `state.dragging` tells a drag from a press. */
|
|
29
|
+
onEnd?: (state: PointerGestureState, event: PointerEvent) => void;
|
|
30
|
+
onCancel?: (state: PointerGestureState, reason: GestureCancelReason) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface PointerGesture {
|
|
33
|
+
readonly state: PointerGestureState;
|
|
34
|
+
readonly active: boolean;
|
|
35
|
+
/** Stop tracking, release capture and listeners, and report `dispose` to `onCancel`. */
|
|
36
|
+
dispose(): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Tracks one pointer from its pointerdown. Moves are read from the event only
|
|
40
|
+
* (no layout reads). Listeners are on the window in capture, so tracking goes on
|
|
41
|
+
* outside the pressed element; pointercancel, window blur and `dispose()`
|
|
42
|
+
* release capture and every listener.
|
|
43
|
+
*/
|
|
44
|
+
export declare function trackPointerGesture(event: PointerEvent, options?: PointerGestureOptions): PointerGesture;
|
|
45
|
+
/**
|
|
46
|
+
* Drop index for reordering along one axis: the hovered item's index when the
|
|
47
|
+
* pointer is in its first half, otherwise the index after it.
|
|
48
|
+
*/
|
|
49
|
+
export declare function dropIndexAt(offset: number, index: number, itemStart: number, itemSize: number): number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* `isPrintableKey` is ported from Teable
|
|
4
|
+
* (packages/sdk/src/components/grid/utils/hotkey.ts at f8be01fad), with the
|
|
5
|
+
* ts-key-enum / ts-keycode-enum constants replaced by their numeric values.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2023-2025 Teable, Inc.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Window after `compositionend` in which a command key still belongs to the IME.
|
|
29
|
+
* Safari sends the Enter that picks a candidate as a plain keydown right after
|
|
30
|
+
* `compositionend`; a person cannot press another Enter this quickly.
|
|
31
|
+
*/
|
|
32
|
+
export declare const COMPOSITION_END_GRACE_MS = 50;
|
|
33
|
+
/** True while the IME owns the key: `isComposing`, or the legacy keyCode 229. */
|
|
34
|
+
export declare function isComposingKey(event: KeyboardEvent): boolean;
|
|
35
|
+
/** First-key test for starting an edit from a selected cell; keyCode 229 starts IME input. */
|
|
36
|
+
export declare function isPrintableKey(event: KeyboardEvent): boolean;
|
|
37
|
+
export interface CompositionGuard {
|
|
38
|
+
/** True between `compositionstart` and `compositionend`. */
|
|
39
|
+
readonly composing: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* True when Enter, Escape or Tab must be left to the IME: during composition,
|
|
42
|
+
* or the first command key within the grace window after `compositionend`.
|
|
43
|
+
*/
|
|
44
|
+
ownsKey(event: KeyboardEvent): boolean;
|
|
45
|
+
dispose(): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Tracks composition on `target` (an editor, a hidden focus input, or a window)
|
|
49
|
+
* so command keys are never treated as commit, cancel or move while an IME
|
|
50
|
+
* owns them. Listeners are capture-phase and removed by `dispose()`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createCompositionGuard(target: EventTarget, options?: {
|
|
53
|
+
onStart?: (event: CompositionEvent) => void;
|
|
54
|
+
onEnd?: (event: CompositionEvent) => void;
|
|
55
|
+
}): CompositionGuard;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { IGNORE_OUTSIDE_ATTR, IGNORE_OUTSIDE_SELECTOR, outsideLayerCount, registerOutsideLayer, swallowNextClick, type OutsideLayer, type OutsideLayerOptions, type OutsideResult, } from './outside';
|
|
2
|
+
export { COMPOSITION_END_GRACE_MS, createCompositionGuard, isComposingKey, isPrintableKey, type CompositionGuard, } from './ime';
|
|
3
|
+
export { DRAG_THRESHOLD_PX, dropIndexAt, trackPointerGesture, type GestureAxis, type GestureCancelReason, type PointerGesture, type PointerGestureOptions, type PointerGestureState, } from './gesture';
|
|
4
|
+
export { DIALOG_SELECTOR, createFocusOwner, focusSync, isInForeignDialog, pathInForeignDialog, type FocusOwner, } from './focus';
|
|
5
|
+
export { createEditSession, editSessionOutside, type EditCommitResult, type EditSession, type EditSessionOptions, type EditSessionState, } from './editSession';
|
|
6
|
+
export { useEditSession, useOutsideLayer, usePointerGesture } from './vue';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single ignore contract. Put it on every portal root that belongs to an
|
|
3
|
+
* interactive surface (popovers, menus, the grid editor): a press inside it is
|
|
4
|
+
* never an outside press for any layer, even if the node is removed while the
|
|
5
|
+
* press is handled.
|
|
6
|
+
*/
|
|
7
|
+
export declare const IGNORE_OUTSIDE_ATTR = "data-ui-ignore-outside";
|
|
8
|
+
export declare const IGNORE_OUTSIDE_SELECTOR = "[data-ui-ignore-outside]";
|
|
9
|
+
/** `'veto'` keeps the layer as it is and blocks the press from reaching its target. */
|
|
10
|
+
export type OutsideResult = void | 'veto';
|
|
11
|
+
export interface OutsideLayerOptions {
|
|
12
|
+
/** Nodes that belong to this layer: the surface and any portal it opened. Read on every press. */
|
|
13
|
+
elements: () => Iterable<Node | null | undefined>;
|
|
14
|
+
/** Runs in window capture, before any handler of the pressed target. */
|
|
15
|
+
onOutside?: (event: PointerEvent) => OutsideResult;
|
|
16
|
+
/** Escape for the topmost layer; return true when handled. Never called while an IME owns the key. */
|
|
17
|
+
onEscape?: (event: KeyboardEvent) => boolean | void;
|
|
18
|
+
}
|
|
19
|
+
export interface OutsideLayer {
|
|
20
|
+
readonly disposed: boolean;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Swallows the next `click` (in capture, before any handler) — used after a
|
|
25
|
+
* vetoed press or a finished drag so the release does not activate its target.
|
|
26
|
+
* Expires on the next press, the next key, or after `timeoutMs`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function swallowNextClick(view: Window, timeoutMs?: number): () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Registers an interactive surface (grid edit, popover, side panel) as the
|
|
31
|
+
* topmost layer of its window. One capture listener per window serves every
|
|
32
|
+
* layer and is removed with the last one.
|
|
33
|
+
*
|
|
34
|
+
* On pointerdown, layers are visited from the top: the first layer that
|
|
35
|
+
* contains the press stops the walk; every layer above it gets `onOutside`
|
|
36
|
+
* once, before the target's own handlers. Escape goes to the topmost layer only.
|
|
37
|
+
*/
|
|
38
|
+
export declare function registerOutsideLayer(view: Window, options: OutsideLayerOptions): OutsideLayer;
|
|
39
|
+
/** Number of live layers in `view`, for tests and diagnostics. */
|
|
40
|
+
export declare function outsideLayerCount(view: Window): number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { EditSession, EditSessionOptions } from './editSession';
|
|
3
|
+
import { PointerGesture, PointerGestureOptions } from './gesture';
|
|
4
|
+
import { OutsideLayerOptions } from './outside';
|
|
5
|
+
type Nodes = MaybeRefOrGetter<Node | null | undefined | readonly (Node | null | undefined)[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Registers `elements` as an outside layer while `active` is true, and
|
|
8
|
+
* disposes it when `active` turns false or the owning scope (component) ends.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useOutsideLayer(elements: Nodes, active: MaybeRefOrGetter<boolean>, handlers: Omit<OutsideLayerOptions, 'elements'>): import('vue').WatchHandle;
|
|
11
|
+
/** One pointer gesture at a time, disposed (capture and listeners released) with the scope. */
|
|
12
|
+
export declare function usePointerGesture(): {
|
|
13
|
+
start(event: PointerEvent, options?: PointerGestureOptions): PointerGesture;
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
};
|
|
16
|
+
/** `createEditSession` with one shallowRef bump per change for templates. */
|
|
17
|
+
export declare function useEditSession<Cell, Value>(options: EditSessionOptions<Cell, Value>): {
|
|
18
|
+
session: EditSession<Cell, Value>;
|
|
19
|
+
version: Readonly<Ref<number>>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
package/dist/json-ai-prompt.md
CHANGED
|
@@ -173,7 +173,7 @@ RULES:
|
|
|
173
173
|
21. Keep state in the spec and use $bindState/$bindItem for editable controls; do not invent JavaScript in props.
|
|
174
174
|
22. Use host-declared actions for side effects. Never encode fetch, timers, filesystem operations, or business logic as UI expressions.
|
|
175
175
|
23. If a domain view needs custom rendering or behavior (for example a treemap, terminal, rich download row, NAS path picker), use a host extension component instead of forcing it into generic components.
|
|
176
|
-
24. AppShell adapts to its actual
|
|
176
|
+
24. AppShell adapts to its actual container width: phone (<=640px), desktop window (641px and wider), and, only with wideLayout "web", the full-page web layout from 960px (its sidebar starts as a 48px rail below 1200px). Never assume browser viewport width.
|
|
177
177
|
25. For a phone-unfriendly custom view, use ResponsiveView slots: mobile alternative and default full view. Keep essential actions accessible on mobile.
|
|
178
178
|
26. Use low-level Stack/Text only when a semantic component does not already express the layout.
|
|
179
179
|
|