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
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain types.
|
|
3
|
+
*
|
|
4
|
+
* Names and shapes are deliberately identical to react-dockable-desktop's. They are
|
|
5
|
+
* vocabulary, not React artefacts — and the serialisable subset is a compatibility
|
|
6
|
+
* contract: see docs/decisions/0009-layout-json-compatibility.md. Renaming a field here
|
|
7
|
+
* breaks a saved layout.
|
|
8
|
+
*/
|
|
9
|
+
/** A localisable message descriptor. The whole i18n integration surface is resolving one of these to a string. */
|
|
10
|
+
export interface MessageDescriptor {
|
|
11
|
+
/** Translation dictionary key. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Text used when no formatter is supplied. */
|
|
14
|
+
defaultMessage?: string;
|
|
15
|
+
/** Values interpolated into `{placeholders}` in the message. */
|
|
16
|
+
values?: Record<string, string | number>;
|
|
17
|
+
}
|
|
18
|
+
/** Resolves a {@link MessageDescriptor} to a flat string. */
|
|
19
|
+
export type MessageFormatter = (msg: MessageDescriptor) => string;
|
|
20
|
+
/** A label that may be plain text or localisable. */
|
|
21
|
+
export type Label = string | MessageDescriptor;
|
|
22
|
+
/** Orientation of a split. */
|
|
23
|
+
export type SplitOrientation = 'horizontal' | 'vertical';
|
|
24
|
+
/** The four sides a panel can be docked relative to another. */
|
|
25
|
+
export type SplitDirection = 'left' | 'right' | 'top' | 'bottom';
|
|
26
|
+
/** Where a dragged panel may be dropped on a leaf: a side, or its centre (same tab group). */
|
|
27
|
+
export type DropPosition = SplitDirection | 'center';
|
|
28
|
+
/** The resolved target of a drag-and-dock gesture. */
|
|
29
|
+
export interface DropTarget {
|
|
30
|
+
leafId: string;
|
|
31
|
+
position: DropPosition;
|
|
32
|
+
}
|
|
33
|
+
/** A split node: children laid out along one axis with relative sizes summing to 1. */
|
|
34
|
+
export interface LayoutGridNode {
|
|
35
|
+
type: 'branch';
|
|
36
|
+
orientation: SplitOrientation;
|
|
37
|
+
children: LayoutNode[];
|
|
38
|
+
/** Relative sizes, one per child, summing to 1. */
|
|
39
|
+
sizes: number[];
|
|
40
|
+
}
|
|
41
|
+
/** A tab group: an ordered list of panels with one selected. */
|
|
42
|
+
export interface LayoutLeafNode {
|
|
43
|
+
type: 'leaf';
|
|
44
|
+
id: string;
|
|
45
|
+
/** Panel ids, in tab order. */
|
|
46
|
+
panels: string[];
|
|
47
|
+
/** The selected tab, or `null` when the group is empty. */
|
|
48
|
+
activePanelId: string | null;
|
|
49
|
+
/** When `false`, this group's tabs cannot be closed. */
|
|
50
|
+
canClose?: boolean;
|
|
51
|
+
/** When `true`, the group survives in the layout after its last panel closes. */
|
|
52
|
+
keepOnEmpty?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** A node of the layout tree. */
|
|
55
|
+
export type LayoutNode = LayoutGridNode | LayoutLeafNode;
|
|
56
|
+
/**
|
|
57
|
+
* A corner of the workspace a floating window can be pinned to.
|
|
58
|
+
*
|
|
59
|
+
* Logical, not physical: `'top-left'` means the inline-start corner, so a layout saved in
|
|
60
|
+
* one reading direction restores correctly in the other.
|
|
61
|
+
*/
|
|
62
|
+
export type FloatAnchor = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
63
|
+
/** A floating window's geometry and stacking. Numbers are px; strings are any CSS length. */
|
|
64
|
+
export interface FloatingWindow {
|
|
65
|
+
id: string;
|
|
66
|
+
x: number | string;
|
|
67
|
+
y: number | string;
|
|
68
|
+
width: number | string;
|
|
69
|
+
height: number | string;
|
|
70
|
+
/** Stacking order; the highest is frontmost. */
|
|
71
|
+
z: number;
|
|
72
|
+
/** Whether the window currently fills the workspace. */
|
|
73
|
+
maximized?: boolean;
|
|
74
|
+
/** The corner it is pinned to, or `null`/absent when free-floating. */
|
|
75
|
+
anchor?: FloatAnchor | null;
|
|
76
|
+
}
|
|
77
|
+
/** Severity of the banner in the built-in unsaved-changes dialog. */
|
|
78
|
+
export type AlertType = 'info' | 'warning' | 'success' | 'danger';
|
|
79
|
+
/** Customises the built-in unsaved-changes dialog for one panel. */
|
|
80
|
+
export interface DirtyStateOptions {
|
|
81
|
+
title?: Label;
|
|
82
|
+
message?: Label;
|
|
83
|
+
/** Extra banner text, e.g. which fields are still invalid. */
|
|
84
|
+
alert?: string;
|
|
85
|
+
/** @default 'danger' when raised by a close, 'info' otherwise */
|
|
86
|
+
alertType?: AlertType;
|
|
87
|
+
}
|
|
88
|
+
/** Where a panel currently lives in the workspace. */
|
|
89
|
+
export type PanelState = 'docked' | 'floating' | 'minimized';
|
|
90
|
+
/**
|
|
91
|
+
* What kind of container a panel is being rendered inside.
|
|
92
|
+
*
|
|
93
|
+
* The same component can be opened as a docked panel *and* as a modal; this is how it
|
|
94
|
+
* adapts. `'standalone'` means no container at all — rendered on its own, in a test or a
|
|
95
|
+
* storybook.
|
|
96
|
+
*/
|
|
97
|
+
export type ContainerType = 'dockable-panel' | 'floating-window' | 'modal' | 'left-panel' | 'right-panel' | 'standalone';
|
|
98
|
+
/** Everything the workspace knows about one open panel. */
|
|
99
|
+
export interface PanelInfo {
|
|
100
|
+
id: string;
|
|
101
|
+
title: Label;
|
|
102
|
+
/** The registry key this panel was opened from. */
|
|
103
|
+
component: string;
|
|
104
|
+
state: PanelState;
|
|
105
|
+
/** What it was before being minimised, so restoring can put it back. */
|
|
106
|
+
previousState?: 'docked' | 'floating';
|
|
107
|
+
/** The floating rect to restore to. */
|
|
108
|
+
lastFloatingRect?: {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
anchor?: FloatAnchor | null;
|
|
114
|
+
};
|
|
115
|
+
/** The leaf to restore into. */
|
|
116
|
+
lastLeafId?: string;
|
|
117
|
+
/** Unsaved changes. */
|
|
118
|
+
dirty?: boolean;
|
|
119
|
+
dirtyOptions?: DirtyStateOptions;
|
|
120
|
+
/** Per-instance data passed to the panel component. Unconstrained by design; whether it
|
|
121
|
+
* survives `saveLayout()` is a runtime fact — see {@link PanelInfo.serializable}. */
|
|
122
|
+
props?: Record<string, unknown>;
|
|
123
|
+
/** Whether this panel's current `props` can round-trip through JSON. A panel with
|
|
124
|
+
* `false` still works normally; it is simply excluded from the next saved layout. */
|
|
125
|
+
serializable: boolean;
|
|
126
|
+
/** Dedup key: opening the same `component` with the same key focuses this panel instead
|
|
127
|
+
* of creating another. */
|
|
128
|
+
dedupeKey?: string;
|
|
129
|
+
}
|
|
130
|
+
/** The on-disk shape of a saved workspace. Compatible with react-dockable-desktop at `version: 2`. */
|
|
131
|
+
export interface SerializedLayout {
|
|
132
|
+
/** Schema version. Absent on layouts saved before it existed (treated as 0). */
|
|
133
|
+
version?: number;
|
|
134
|
+
/** The panel the user was looking at. Omitted when nothing was active, or when the
|
|
135
|
+
* active panel did not survive this snapshot's serialisability pruning. */
|
|
136
|
+
activePanelId?: string | null;
|
|
137
|
+
gridRoot: LayoutNode;
|
|
138
|
+
floating: FloatingWindow[];
|
|
139
|
+
minimized: {
|
|
140
|
+
id: string;
|
|
141
|
+
title: Label;
|
|
142
|
+
component: string;
|
|
143
|
+
}[];
|
|
144
|
+
panels: Record<string, PanelInfo>;
|
|
145
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-dockable-desktop",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Vue 3 port of react-dockable-desktop — a dockable layout engine with split docking, tabbed groups, floating windows and zero-unmount panel persistence.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/felipecarrillo100/vue-dockable-desktop.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/felipecarrillo100/vue-dockable-desktop#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/felipecarrillo100/vue-dockable-desktop/issues"
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./styles.css": "./dist/styles.css"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"CHANGELOG.md"
|
|
29
|
+
],
|
|
30
|
+
"sideEffects": [
|
|
31
|
+
"**/*.css"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"prepublishOnly": "npm run gate -- M14",
|
|
35
|
+
"dev": "vite",
|
|
36
|
+
"playground": "vite playground",
|
|
37
|
+
"build": "vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly && node scripts/copy-css.mjs",
|
|
38
|
+
"typecheck": "vue-tsc --noEmit",
|
|
39
|
+
"lint": "eslint .",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"test:watch": "vitest",
|
|
42
|
+
"gate": "node scripts/gate.mjs",
|
|
43
|
+
"gate:selftest": "node scripts/gates/selftest.mjs",
|
|
44
|
+
"gate:sweep": "vitest run --coverage --silent && node scripts/gates/non-vacuity.mjs",
|
|
45
|
+
"demo": "vite demo",
|
|
46
|
+
"demo:build": "vite build --config demo/vite.config.ts"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"vue": "^3.4.0"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=20"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"vue",
|
|
56
|
+
"vue3",
|
|
57
|
+
"react-dockable-desktop",
|
|
58
|
+
"dockable-desktop",
|
|
59
|
+
"dockable",
|
|
60
|
+
"layout",
|
|
61
|
+
"window-manager",
|
|
62
|
+
"docking",
|
|
63
|
+
"panels",
|
|
64
|
+
"workspace",
|
|
65
|
+
"ide"
|
|
66
|
+
],
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@eslint/js": "^10.0.1",
|
|
69
|
+
"@types/leaflet": "^1.9.22",
|
|
70
|
+
"@types/node": "^22.20.3",
|
|
71
|
+
"@vitejs/plugin-vue": "^6.0.9",
|
|
72
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
73
|
+
"@vue/eslint-config-typescript": "^14.9.0",
|
|
74
|
+
"@vue/test-utils": "^2.5.0",
|
|
75
|
+
"bootstrap": "^5.3.8",
|
|
76
|
+
"eslint": "^10.10.0",
|
|
77
|
+
"eslint-plugin-vue": "^10.11.0",
|
|
78
|
+
"globals": "^17.12.0",
|
|
79
|
+
"highlight.js": "^11.12.0",
|
|
80
|
+
"jsdom": "^30.0.1",
|
|
81
|
+
"katex": "^0.18.7",
|
|
82
|
+
"leaflet": "^1.9.4",
|
|
83
|
+
"monaco-editor": "^0.56.0",
|
|
84
|
+
"playwright-core": "^1.63.0",
|
|
85
|
+
"rehype-highlight": "^7.0.2",
|
|
86
|
+
"rehype-katex": "^7.0.1",
|
|
87
|
+
"rehype-raw": "^7.0.0",
|
|
88
|
+
"rehype-slug": "^6.0.0",
|
|
89
|
+
"rehype-stringify": "^10.0.1",
|
|
90
|
+
"remark-gfm": "^4.0.1",
|
|
91
|
+
"remark-math": "^6.0.0",
|
|
92
|
+
"remark-parse": "^11.0.0",
|
|
93
|
+
"remark-rehype": "^11.1.2",
|
|
94
|
+
"typescript": "~5.9",
|
|
95
|
+
"typescript-eslint": "^8.70.0",
|
|
96
|
+
"unified": "^11.0.5",
|
|
97
|
+
"vite": "^8.3.0",
|
|
98
|
+
"vitest": "^5.0.1",
|
|
99
|
+
"vue": "^3.5.42",
|
|
100
|
+
"vue-tsc": "^3.3.11"
|
|
101
|
+
}
|
|
102
|
+
}
|