vue-dockable-desktop 1.0.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/CHANGELOG.md +60 -0
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/components/VddConfirm.vue.d.ts +19 -0
- package/dist/components/VddContextMenu.vue.d.ts +35 -0
- package/dist/components/VddDesktop.vue.d.ts +28 -0
- package/dist/components/VddDragGhost.vue.d.ts +3 -0
- package/dist/components/VddDropZones.vue.d.ts +6 -0
- package/dist/components/VddEdgeZones.vue.d.ts +3 -0
- package/dist/components/VddFloatingWidget.vue.d.ts +51 -0
- package/dist/components/VddFloatingWindow.vue.d.ts +12 -0
- package/dist/components/VddLeafGroup.vue.d.ts +7 -0
- package/dist/components/VddModalHost.vue.d.ts +9 -0
- package/dist/components/VddModals.vue.d.ts +3 -0
- package/dist/components/VddOverlayFrame.vue.d.ts +28 -0
- package/dist/components/VddPanelMount.vue.d.ts +8 -0
- package/dist/components/VddPanelOverlay.vue.d.ts +13 -0
- package/dist/components/VddPanelSlot.vue.d.ts +9 -0
- package/dist/components/VddPanelToolbar.vue.d.ts +26 -0
- package/dist/components/VddSecondarySidebar.vue.d.ts +16 -0
- package/dist/components/VddSidePanelHost.vue.d.ts +10 -0
- package/dist/components/VddSidePanels.vue.d.ts +12 -0
- package/dist/components/VddSidebar.vue.d.ts +54 -0
- package/dist/components/VddSidebarDrawer.vue.d.ts +51 -0
- package/dist/components/VddSidebarRail.vue.d.ts +22 -0
- package/dist/components/VddSidebarTabScope.vue.d.ts +22 -0
- package/dist/components/VddTaskbar.vue.d.ts +17 -0
- package/dist/components/VddTaskbarPreview.vue.d.ts +24 -0
- package/dist/components/VddToastIcon.vue.d.ts +8 -0
- package/dist/components/VddToastItem.vue.d.ts +18 -0
- package/dist/components/VddToasts.vue.d.ts +36 -0
- package/dist/components/VddToolbar.vue.d.ts +20 -0
- package/dist/components/VddToolbarButton.vue.d.ts +25 -0
- package/dist/components/VddToolbarCenter.vue.d.ts +13 -0
- package/dist/components/VddToolbarGroupButton.vue.d.ts +8 -0
- package/dist/components/VddToolbarItem.vue.d.ts +13 -0
- package/dist/components/VddToolbarSearch.vue.d.ts +27 -0
- package/dist/components/VddToolbarSeparator.vue.d.ts +3 -0
- package/dist/components/VddToolbarSpacer.vue.d.ts +3 -0
- package/dist/components/VddToolbarToggle.vue.d.ts +32 -0
- package/dist/components/VddWorkspaceGrid.vue.d.ts +8 -0
- package/dist/composables/useColorScheme.d.ts +19 -0
- package/dist/composables/useContextMenu.d.ts +29 -0
- package/dist/composables/useContributions.d.ts +48 -0
- package/dist/composables/useDragDock.d.ts +59 -0
- package/dist/composables/useOverlayHost.d.ts +30 -0
- package/dist/composables/useOverlays.d.ts +51 -0
- package/dist/composables/usePanel.d.ts +82 -0
- package/dist/composables/usePanelDom.d.ts +7 -0
- package/dist/composables/usePanelOverlay.d.ts +35 -0
- package/dist/composables/useSidebar.d.ts +15 -0
- package/dist/composables/useToolbar.d.ts +9 -0
- package/dist/composables/useWorkspace.d.ts +18 -0
- package/dist/core/anchorGeometry.d.ts +39 -0
- package/dist/core/contextMenu.d.ts +74 -0
- package/dist/core/contributions.d.ts +56 -0
- package/dist/core/dragResize.d.ts +67 -0
- package/dist/core/eventBus.d.ts +73 -0
- package/dist/core/layoutTree.d.ts +96 -0
- package/dist/core/messages.d.ts +117 -0
- package/dist/core/overlayState.d.ts +64 -0
- package/dist/core/overlays.d.ts +114 -0
- package/dist/core/panelDom.d.ts +79 -0
- package/dist/core/panelMenu.d.ts +45 -0
- package/dist/core/panelOverlay.d.ts +121 -0
- package/dist/core/registry.d.ts +61 -0
- package/dist/core/serializable.d.ts +26 -0
- package/dist/core/serialize.d.ts +32 -0
- package/dist/core/sidebarTypes.d.ts +102 -0
- package/dist/core/stretch.d.ts +47 -0
- package/dist/core/toast.d.ts +474 -0
- package/dist/core/toolbarState.d.ts +13 -0
- package/dist/core/toolbarTypes.d.ts +99 -0
- package/dist/core/workspace.d.ts +222 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +4851 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +3944 -0
- package/dist/types.d.ts +145 -0
- package/package.json +102 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The drawer: one pane per mounted tab, only the open one displayed.
|
|
3
|
+
*
|
|
4
|
+
* Panes are hidden with `display: none` rather than unmounted, which is what makes
|
|
5
|
+
* `preserveState` mean anything — and why a tab that asked for neither `eagerMount` nor
|
|
6
|
+
* `preserveState` is dropped from the mounted set when the drawer closes.
|
|
7
|
+
*/
|
|
8
|
+
import type { SidebarTab } from '../core/sidebarTypes';
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
tabs: SidebarTab[];
|
|
11
|
+
activeTabId: string | null;
|
|
12
|
+
position: 'left' | 'right';
|
|
13
|
+
open: boolean;
|
|
14
|
+
width: number;
|
|
15
|
+
minWidth: number;
|
|
16
|
+
maxWidth: number;
|
|
17
|
+
/** Suppress the library's own header for every tab. */
|
|
18
|
+
headerOverridden: boolean;
|
|
19
|
+
showCloseButton: boolean;
|
|
20
|
+
/** No transition while a resize drag is in flight, or the drawer lags the pointer. */
|
|
21
|
+
resizing: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare var __VLS_1: {
|
|
24
|
+
tab: SidebarTab;
|
|
25
|
+
close: () => void;
|
|
26
|
+
open: () => void;
|
|
27
|
+
}, __VLS_13: `tab-${string}`, __VLS_14: {
|
|
28
|
+
tab: SidebarTab;
|
|
29
|
+
close: () => void;
|
|
30
|
+
open: () => void;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Slots = {} & {
|
|
33
|
+
[K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any;
|
|
34
|
+
} & {
|
|
35
|
+
header?: (props: typeof __VLS_1) => any;
|
|
36
|
+
};
|
|
37
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
|
+
close: () => any;
|
|
39
|
+
open: (id: string) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
41
|
+
onClose?: (() => any) | undefined;
|
|
42
|
+
onOpen?: ((id: string) => any) | undefined;
|
|
43
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
export default _default;
|
|
47
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
48
|
+
new (): {
|
|
49
|
+
$slots: S;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The activity strip: header entries, the tab buttons, footer entries.
|
|
3
|
+
*
|
|
4
|
+
* Its own component so the left and right arrangements share one implementation. Writing it
|
|
5
|
+
* twice inside the parent is how the two sides drift apart.
|
|
6
|
+
*/
|
|
7
|
+
import type { SidebarRailEntry, SidebarTab } from '../core/sidebarTypes';
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
tabs: SidebarTab[];
|
|
10
|
+
header: SidebarRailEntry[];
|
|
11
|
+
footer: SidebarRailEntry[];
|
|
12
|
+
activeTabId: string | null;
|
|
13
|
+
position: 'left' | 'right';
|
|
14
|
+
visible: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
select: (id: string) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onSelect?: ((id: string) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
tabId: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
close: () => any;
|
|
10
|
+
open: (id: string) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onClose?: (() => any) | undefined;
|
|
13
|
+
onOpen?: ((id: string) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PanelDomCache } from '../core/panelDom';
|
|
2
|
+
export type TaskbarVisibility = 'always' | 'compact' | 'autohide';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
visibility?: TaskbarVisibility;
|
|
5
|
+
cache: PanelDomCache;
|
|
6
|
+
/** Fallback icon for panels that register none. */
|
|
7
|
+
defaultIcon?: unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
contextMenu: (panelId: string, event: MouseEvent | PointerEvent) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onContextMenu?: ((panelId: string, event: MouseEvent | PointerEvent) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
visibility: TaskbarVisibility;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PanelDomCache } from '../core/panelDom';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
panelId: string;
|
|
4
|
+
/** The icon's on-screen rect, so the preview can sit above it. */
|
|
5
|
+
anchor: {
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
width: number;
|
|
9
|
+
};
|
|
10
|
+
cache: PanelDomCache;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
close: () => any;
|
|
14
|
+
restore: () => any;
|
|
15
|
+
dismiss: () => any;
|
|
16
|
+
keep: () => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onClose?: (() => any) | undefined;
|
|
19
|
+
onRestore?: (() => any) | undefined;
|
|
20
|
+
onDismiss?: (() => any) | undefined;
|
|
21
|
+
onKeep?: (() => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The built-in per-type icons. Replaced per toast by `toast(msg, { icon })`. */
|
|
2
|
+
import type { ToastType } from '../core/toast';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
type: ToastType;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ToastRecord } from '../core/toast';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
toast: ToastRecord;
|
|
4
|
+
/** A left-hand container slides in from the other side. */
|
|
5
|
+
isLeft: boolean;
|
|
6
|
+
showProgress: boolean;
|
|
7
|
+
pauseOnHover: boolean;
|
|
8
|
+
animation: 'slide' | 'fade' | 'none';
|
|
9
|
+
defaultDuration: number;
|
|
10
|
+
defaultClosable: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
exited: (id: string) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onExited?: ((id: string) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ToastAdapter, ToastPosition } from '../core/toast';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** @default 'top-right' */
|
|
4
|
+
position?: ToastPosition;
|
|
5
|
+
/** How many show at once. The rest wait. @default 3 */
|
|
6
|
+
maxVisible?: number;
|
|
7
|
+
/** Auto-dismiss delay in ms; `0` makes every toast sticky. @default 5000 */
|
|
8
|
+
defaultDuration?: number;
|
|
9
|
+
/** @default true */
|
|
10
|
+
defaultClosable?: boolean;
|
|
11
|
+
/** Hold the timer while the pointer is over a toast. @default true */
|
|
12
|
+
pauseOnHover?: boolean;
|
|
13
|
+
/** @default 'slide' */
|
|
14
|
+
animation?: 'slide' | 'fade' | 'none';
|
|
15
|
+
/** Put the newest toast at the top of the stack. @default false */
|
|
16
|
+
newestOnTop?: boolean;
|
|
17
|
+
/** A countdown bar along the bottom of each toast. @default false */
|
|
18
|
+
progressBar?: boolean;
|
|
19
|
+
/** Card width in pixels. @default 320 */
|
|
20
|
+
width?: number;
|
|
21
|
+
/** Hand every `toast.*` call to another library instead. */
|
|
22
|
+
adapter?: ToastAdapter;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
width: number;
|
|
26
|
+
position: ToastPosition;
|
|
27
|
+
animation: "slide" | "fade" | "none";
|
|
28
|
+
pauseOnHover: boolean;
|
|
29
|
+
defaultDuration: number;
|
|
30
|
+
defaultClosable: boolean;
|
|
31
|
+
maxVisible: number;
|
|
32
|
+
newestOnTop: boolean;
|
|
33
|
+
progressBar: boolean;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ToolbarItem } from '../core/toolbarTypes';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Which edge to attach to; also decides the strip's orientation. @default 'left' */
|
|
4
|
+
position?: 'left' | 'right' | 'top' | 'bottom';
|
|
5
|
+
items: ToolbarItem[];
|
|
6
|
+
};
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
/** Collapse the strip to nothing. State is kept — items are not unmounted. */
|
|
9
|
+
'visible'?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:visible": (value: boolean) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
position: "left" | "right" | "top" | "bottom";
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** An icon button for a `<VddPanelToolbar>`. The icon is a slot, so anything renders. */
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Tooltip and accessible name. */
|
|
4
|
+
title?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Overrides the toolbar's own `buttonVariant`. */
|
|
7
|
+
variant?: 'ghost' | 'soft' | 'outlined' | 'filled';
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_1: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
click: () => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onClick?: (() => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolbarGroupItem } from '../core/toolbarTypes';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
item: ToolbarGroupItem;
|
|
4
|
+
position: 'left' | 'right' | 'top' | 'bottom';
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/** One row in the dropdown. */
|
|
3
|
+
export interface SearchResult {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Secondary text, below the label. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Groups results under a heading. */
|
|
9
|
+
group?: string;
|
|
10
|
+
icon?: Component;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
/** Called on each change, debounced. Return results, or a promise of them. */
|
|
15
|
+
search: (query: string, signal: AbortSignal) => SearchResult[] | Promise<SearchResult[]>;
|
|
16
|
+
/** Debounce in ms. @default 300 */
|
|
17
|
+
debounce?: number;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
select: (result: SearchResult) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onSelect?: ((result: SearchResult) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
debounce: number;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A two-state icon button for a `<VddPanelToolbar>`.
|
|
3
|
+
*
|
|
4
|
+
* rdd took `active` plus `onToggle` and left flipping it to the caller. `v-model:active` is
|
|
5
|
+
* the same thing without the boilerplate, and still controllable: bind it and you own it.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
title?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
variant?: 'ghost' | 'soft' | 'outlined' | 'filled';
|
|
11
|
+
};
|
|
12
|
+
type __VLS_ModelProps = {
|
|
13
|
+
'active'?: boolean;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare var __VLS_1: {};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
default?: (props: typeof __VLS_1) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:active": (value: boolean) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:active"?: ((value: boolean) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LayoutNode } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: LayoutNode;
|
|
4
|
+
path: number[];
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
/** What the workspace is currently rendering as. */
|
|
3
|
+
export type ColorScheme = 'dark' | 'light';
|
|
4
|
+
/**
|
|
5
|
+
* The workspace's current colour scheme, as a ref that follows it.
|
|
6
|
+
*
|
|
7
|
+
* `<VddDesktop>` mirrors the scheme onto `document.documentElement` as
|
|
8
|
+
* `data-color-scheme`; this watches that attribute. For panel content that has to match —
|
|
9
|
+
* a map's tile layer, an embedded editor's theme, a chart's palette.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* const scheme = useColorScheme()
|
|
13
|
+
* watch(scheme, s => map.setStyle(s === 'dark' ? darkStyle : lightStyle))
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Anything other than `'light'` reads as `'dark'`, including a missing attribute, so there is
|
|
17
|
+
* no third state to handle.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useColorScheme(): ComputedRef<ColorScheme>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ContextMenuItem, ShowContextMenuOptions } from '../core/contextMenu';
|
|
2
|
+
/**
|
|
3
|
+
* Open a context menu from anywhere.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* const showMenu = useContextMenu()
|
|
7
|
+
* showMenu({ event, items: [{ label: 'Rename', action: rename }] })
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Works wherever `useWorkspace()` works, including outside the component tree — the menu
|
|
11
|
+
* request is state, and `<VddContextMenu>` renders what is pending.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useContextMenu(): (options: ShowContextMenuOptions) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Contribute items to *this panel's* own context menu, from inside the panel.
|
|
16
|
+
*
|
|
17
|
+
* Pass a getter: it is read each time the menu opens, so items that enable, disable, check
|
|
18
|
+
* or disappear with the panel's state need no extra wiring.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* usePanelContextMenu(() => [
|
|
22
|
+
* { label: 'Save', action: save },
|
|
23
|
+
* { label: 'Revert', action: revert, disabled: !dirty.value },
|
|
24
|
+
* ])
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Registered in `setup` and disposed with the component — nothing to unsubscribe.
|
|
28
|
+
*/
|
|
29
|
+
export declare function usePanelContextMenu(items: () => ContextMenuItem[]): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Component, ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { PanelContribution } from '../core/contributions';
|
|
3
|
+
import type { SidebarTab } from '../core/sidebarTypes';
|
|
4
|
+
import type { ToolbarItem } from '../core/toolbarTypes';
|
|
5
|
+
/**
|
|
6
|
+
* Publish this panel's toolbar items and sidebar sections, for the shell to surface while
|
|
7
|
+
* this panel is the active one.
|
|
8
|
+
*
|
|
9
|
+
* Pass a getter or a ref, not a plain object: the contribution is re-published whenever it
|
|
10
|
+
* changes, so items that enable, check or disappear with the panel's own state need no extra
|
|
11
|
+
* wiring.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const tool = ref<'pan' | 'draw'>('pan')
|
|
15
|
+
* usePanelContribution(() => ({
|
|
16
|
+
* toolbarItems: [
|
|
17
|
+
* { type: 'toggle', id: 'draw', label: 'Draw', icon: Pencil,
|
|
18
|
+
* active: tool.value === 'draw', onToggle: v => (tool.value = v ? 'draw' : 'pan') },
|
|
19
|
+
* ],
|
|
20
|
+
* sidebarSections: [{ id: 'layers', label: 'Layers', component: LayerList }],
|
|
21
|
+
* }))
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* rdd asked callers to memoise the object themselves, and to call the hook on every render,
|
|
25
|
+
* because a new object literal each render meant republishing each render. A getter makes
|
|
26
|
+
* that the framework's problem instead of the caller's.
|
|
27
|
+
*
|
|
28
|
+
* Registered in `setup` and withdrawn with the component — nothing to unsubscribe.
|
|
29
|
+
*/
|
|
30
|
+
export declare function usePanelContribution(contribution: MaybeRefOrGetter<PanelContribution>): void;
|
|
31
|
+
/**
|
|
32
|
+
* What the active panel has published, or `null`.
|
|
33
|
+
*
|
|
34
|
+
* For the app shell to merge into its own `<VddToolbar :items>` and `<VddSidebar :tabs>`.
|
|
35
|
+
* Nothing is merged automatically: the library does not know what a contributed item means
|
|
36
|
+
* for your domain, or where in your toolbar it belongs.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useActiveContribution(): ComputedRef<PanelContribution | null>;
|
|
39
|
+
/**
|
|
40
|
+
* A static toolbar list with the active panel's contributed items appended behind a
|
|
41
|
+
* separator, as a `computed`.
|
|
42
|
+
*
|
|
43
|
+
* `mergeToolbarItems` is the plain function underneath, for when the merge position or the
|
|
44
|
+
* separator needs to be different.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useMergedToolbarItems(staticItems: MaybeRefOrGetter<ToolbarItem[]>): ComputedRef<ToolbarItem[]>;
|
|
47
|
+
/** A static tab list with the active panel's contributed sections appended, as a `computed`. */
|
|
48
|
+
export declare function useMergedSidebarTabs(staticTabs: MaybeRefOrGetter<SidebarTab[]>, fallbackIcon?: Component): ComputedRef<SidebarTab[]>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { DropPosition, FloatAnchor, SplitDirection } from '../types';
|
|
3
|
+
import type { Workspace } from '../core/workspace';
|
|
4
|
+
/** How long a touch must rest before it becomes a drag. */
|
|
5
|
+
export declare const LONG_PRESS_MS = 300;
|
|
6
|
+
/** How far a touch may wander before the long press is abandoned. */
|
|
7
|
+
export declare const CANCEL_MOVE_PX = 8;
|
|
8
|
+
/** Which tab a dragged panel would be inserted next to. */
|
|
9
|
+
export interface TabTarget {
|
|
10
|
+
leafId: string;
|
|
11
|
+
panelId: string;
|
|
12
|
+
index: number;
|
|
13
|
+
side: 'left' | 'right';
|
|
14
|
+
}
|
|
15
|
+
export interface DragDock {
|
|
16
|
+
/** The panel being dragged, or `null`. */
|
|
17
|
+
draggedId: Ref<string | null>;
|
|
18
|
+
/** Pointer position, for the ghost. */
|
|
19
|
+
pointer: Ref<{
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}>;
|
|
23
|
+
/** The armed leaf cross target. */
|
|
24
|
+
zone: Ref<{
|
|
25
|
+
leafId: string;
|
|
26
|
+
position: DropPosition;
|
|
27
|
+
} | null>;
|
|
28
|
+
/** The armed workspace edge. */
|
|
29
|
+
edge: Ref<SplitDirection | null>;
|
|
30
|
+
/** The armed corner anchor. */
|
|
31
|
+
corner: Ref<FloatAnchor | null>;
|
|
32
|
+
/** The armed tab insertion point. */
|
|
33
|
+
tab: Ref<TabTarget | null>;
|
|
34
|
+
/** True while a gesture is in progress. */
|
|
35
|
+
dragging: ComputedRef<boolean>;
|
|
36
|
+
startTabDrag: (panelId: string, event: PointerEvent, onLongPressWithoutDrag?: (e: PointerEvent) => void) => void;
|
|
37
|
+
/** Begin a gesture that another component drives (a floating window's title bar). */
|
|
38
|
+
beginDrag: (panelId: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Update the pointer and re-resolve the armed target by hit-testing.
|
|
41
|
+
*
|
|
42
|
+
* Needed whenever the gesture holds pointer capture — a captured pointer routes every
|
|
43
|
+
* event to the capturing element, so the drop zones never receive `pointerenter`. The
|
|
44
|
+
* dragged window sets `pointer-events: none` on itself, so the zones beneath it are what
|
|
45
|
+
* the hit test finds.
|
|
46
|
+
*/
|
|
47
|
+
trackPointer: (x: number, y: number) => void;
|
|
48
|
+
hoverZone: (leafId: string, position: DropPosition | null) => void;
|
|
49
|
+
hoverEdge: (edge: SplitDirection | null) => void;
|
|
50
|
+
hoverCorner: (corner: FloatAnchor | null) => void;
|
|
51
|
+
hoverTab: (target: TabTarget | null) => void;
|
|
52
|
+
/** Finish a gesture started elsewhere (a floating window's title bar). */
|
|
53
|
+
finishDrag: (panelId: string, event: PointerEvent) => void;
|
|
54
|
+
cancel: () => void;
|
|
55
|
+
}
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare function provideDragDock(ws: Workspace<never>): DragDock;
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare function useDragDock(): DragDock | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComputedRef, Component, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { OverlayInstance } from '../core/overlays';
|
|
3
|
+
/**
|
|
4
|
+
* Everything a rendered side panel or modal needs, in one place.
|
|
5
|
+
*
|
|
6
|
+
* rdd's `SidePanelRenderer` and `ModalStackRenderer` each carried their own copy of this —
|
|
7
|
+
* the close sequence, the dirty-confirmation modal, the title asterisk, the `setDirty` and
|
|
8
|
+
* `setTitle` plumbing, the Escape handler. Thirty-five of those lines were character-for-
|
|
9
|
+
* character identical, which is how two containers come to disagree about what closing a
|
|
10
|
+
* dirty panel does. Here the two components differ only in their chrome.
|
|
11
|
+
*
|
|
12
|
+
* **Escape routing** lives here too, and is the reason it can be stated once: Escape belongs
|
|
13
|
+
* to the topmost modal, and reaches a drawer only when no modal is open. rdd expressed the
|
|
14
|
+
* same rule twice, in two different shapes (`modals.length === 0` in one,
|
|
15
|
+
* `isTopmost` in the other).
|
|
16
|
+
*/
|
|
17
|
+
export declare function useOverlayHost(instance: MaybeRefOrGetter<OverlayInstance>): {
|
|
18
|
+
/** The instance's title, resolved through the formatter, with a trailing `*` when dirty. */
|
|
19
|
+
displayTitle: ComputedRef<string>;
|
|
20
|
+
/** Whether Escape and a backdrop click should close this instance. */
|
|
21
|
+
dismissible: ComputedRef<boolean>;
|
|
22
|
+
/** The icon to show in the header: the live one set from inside, else the open-time one. */
|
|
23
|
+
icon: ComputedRef<Component | null>;
|
|
24
|
+
/** Close, honouring the close guard and dirty state. */
|
|
25
|
+
close: (options?: {
|
|
26
|
+
force?: boolean;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
/** `padding` for the body, or `undefined` to leave it to the stylesheet. */
|
|
29
|
+
bodyPadding: ComputedRef<string | undefined>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Component, ComputedRef } from 'vue';
|
|
2
|
+
import type { ModalOptions, OverlayInstance, SidePanelOptions } from '../core/overlays';
|
|
3
|
+
/**
|
|
4
|
+
* The modal stack.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const { open, close, closeAll, stack } = useModals()
|
|
8
|
+
* const id = open(EditFeature, { featureId }, { size: 'medium', title: 'Edit' })
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* `open` returns the instance id, which is what `close(id)` takes. Modals stack, so opening
|
|
12
|
+
* one never closes another.
|
|
13
|
+
*
|
|
14
|
+
* Every one of these is also reachable as `workspace.overlays.*` without a component, which
|
|
15
|
+
* is the usual case for a confirmation raised by a service.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useModals(): {
|
|
18
|
+
/** Bottom to top — the last entry is the topmost. */
|
|
19
|
+
stack: ComputedRef<OverlayInstance[]>;
|
|
20
|
+
/** The topmost modal, or `null`. */
|
|
21
|
+
topmost: ComputedRef<OverlayInstance | null>;
|
|
22
|
+
open: (component: Component, props?: Record<string, unknown>, options?: ModalOptions) => string;
|
|
23
|
+
/** Close, honouring the modal's close guard and dirty state. */
|
|
24
|
+
close: (id: string, options?: {
|
|
25
|
+
force?: boolean;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
closeAll: () => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The two side drawers.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* const { openLeft, openRight, close, left, right } = useSidePanels()
|
|
34
|
+
* await openLeft(LayerList, { layers }, { title: 'Layers', width: 320 })
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Each side holds one panel, so opening is also closing whatever was there — which is why
|
|
38
|
+
* `openLeft`/`openRight` are async and resolve to `null` when the occupant's close guard
|
|
39
|
+
* refuses. A synchronous return would have to either ignore the guard or lie about the id.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useSidePanels(): {
|
|
42
|
+
left: ComputedRef<OverlayInstance | null>;
|
|
43
|
+
right: ComputedRef<OverlayInstance | null>;
|
|
44
|
+
openLeft: (component: Component, props?: Record<string, unknown>, options?: SidePanelOptions) => Promise<string | null>;
|
|
45
|
+
openRight: (component: Component, props?: Record<string, unknown>, options?: SidePanelOptions) => Promise<string | null>;
|
|
46
|
+
close: (id: string, options?: {
|
|
47
|
+
force?: boolean;
|
|
48
|
+
}) => Promise<void>;
|
|
49
|
+
/** Close both drawers, leaving the modal stack alone. */
|
|
50
|
+
closeAll: () => void;
|
|
51
|
+
};
|