@stonecrop/desktop 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +394 -0
- package/dist/desktop.js +933 -833
- package/dist/desktop.js.map +1 -1
- package/dist/src/components/ActionSet.vue.d.ts +12 -0
- package/dist/src/components/ActionSet.vue.d.ts.map +1 -0
- package/dist/src/components/CommandPalette.vue.d.ts +35 -0
- package/dist/src/components/CommandPalette.vue.d.ts.map +1 -0
- package/dist/src/components/Desktop.vue.d.ts +26 -0
- package/dist/src/components/Desktop.vue.d.ts.map +1 -0
- package/dist/src/components/SheetNav.vue.d.ts +10 -0
- package/dist/src/components/SheetNav.vue.d.ts.map +1 -0
- package/dist/{tsdoc-metadata.json → src/tsdoc-metadata.json} +1 -1
- package/package.json +37 -31
- package/dist/desktop.css +0 -1
- package/dist/desktop.d.ts +0 -119
- package/dist/desktop.tsbuildinfo +0 -1
- package/dist/src/index.js +0 -6
- package/dist/src/plugins/index.js +0 -17
- package/dist/src/types/index.js +0 -0
- package/src/components/ActionSet.vue +0 -211
- package/src/components/CommandPalette.vue +0 -235
- package/src/components/Desktop.vue +0 -982
- package/src/components/SheetNav.vue +0 -297
- package/src/index.ts +0 -9
- package/src/plugins/index.ts +0 -21
- package/src/shims-vue.d.ts +0 -5
- package/src/types/index.ts +0 -107
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RouteAdapter, NavigationTarget, ActionEventPayload, RecordOpenEventPayload, LoadRecordsEventPayload, LoadRecordEventPayload } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
availableDoctypes?: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Pluggable router adapter. When provided, Desktop uses these functions for all
|
|
6
|
+
* routing instead of reaching into the registry's internal Vue Router instance.
|
|
7
|
+
* Nuxt hosts (or any host with custom route conventions) should supply this.
|
|
8
|
+
*/
|
|
9
|
+
routeAdapter?: RouteAdapter;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
action: (payload: ActionEventPayload) => any;
|
|
13
|
+
navigate: (target: NavigationTarget) => any;
|
|
14
|
+
"record:open": (payload: RecordOpenEventPayload) => any;
|
|
15
|
+
"load-records": (payload: LoadRecordsEventPayload) => any;
|
|
16
|
+
"load-record": (payload: LoadRecordEventPayload) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onAction?: ((payload: ActionEventPayload) => any) | undefined;
|
|
19
|
+
onNavigate?: ((target: NavigationTarget) => any) | undefined;
|
|
20
|
+
"onRecord:open"?: ((payload: RecordOpenEventPayload) => any) | undefined;
|
|
21
|
+
"onLoad-records"?: ((payload: LoadRecordsEventPayload) => any) | undefined;
|
|
22
|
+
"onLoad-record"?: ((payload: LoadRecordEventPayload) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=Desktop.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Desktop.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Desktop.vue"],"names":[],"mappings":"AA0+BA,OAAO,KAAK,EAEX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,UAAU,CAAA;AAEjB,KAAK,WAAW,GAAG;IAClB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAA;CAC3B,CAAC;AAqiCF,QAAA,MAAM,YAAY;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
breadcrumbs?: {
|
|
3
|
+
title: string;
|
|
4
|
+
to: string;
|
|
5
|
+
}[];
|
|
6
|
+
};
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=SheetNav.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SheetNav.vue"],"names":[],"mappings":"AA8SA,KAAK,WAAW,GAAG;IAAE,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC;AAqOrE,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/package.json
CHANGED
|
@@ -1,47 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/desktop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Desktop-specific components for Stonecrop UI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"components",
|
|
7
|
+
"desktop",
|
|
8
|
+
"shell",
|
|
9
|
+
"stonecrop",
|
|
10
|
+
"vue"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/agritheory/stonecrop#readme",
|
|
5
13
|
"bugs": {
|
|
6
14
|
"url": "https://github.com/agritheory/stonecrop/issues"
|
|
7
15
|
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/agritheory/stonecrop",
|
|
11
|
-
"directory": "desktop"
|
|
12
|
-
},
|
|
13
16
|
"license": "MIT",
|
|
14
17
|
"author": {
|
|
15
18
|
"name": "Tyler Matteson",
|
|
16
19
|
"email": "tyler@agritheory.com"
|
|
17
20
|
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/agritheory/stonecrop",
|
|
24
|
+
"directory": "desktop"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
18
30
|
"sideEffects": [
|
|
19
31
|
"**/*.css"
|
|
20
32
|
],
|
|
21
|
-
"
|
|
33
|
+
"types": "./dist/src/index.d.ts",
|
|
22
34
|
"exports": {
|
|
23
35
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
36
|
+
"types": "./dist/src/index.d.ts",
|
|
25
37
|
"import": "./dist/desktop.js"
|
|
26
38
|
},
|
|
27
|
-
"./styles": "./dist/
|
|
28
|
-
"./types": "./dist/src/types/index.d.ts"
|
|
39
|
+
"./styles": "./dist/assets/index.css",
|
|
40
|
+
"./types": "./dist/src/types/index.d.ts",
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
29
45
|
},
|
|
30
|
-
"types": "./dist/desktop.d.ts",
|
|
31
|
-
"files": [
|
|
32
|
-
"dist/*",
|
|
33
|
-
"src/*"
|
|
34
|
-
],
|
|
35
46
|
"dependencies": {
|
|
36
|
-
"@stonecrop/
|
|
37
|
-
"@stonecrop/
|
|
38
|
-
"@stonecrop/
|
|
39
|
-
"@stonecrop/stonecrop": "0.
|
|
40
|
-
"@stonecrop/themes": "0.31.0"
|
|
47
|
+
"@stonecrop/schema": "0.32.0",
|
|
48
|
+
"@stonecrop/aform": "0.32.0",
|
|
49
|
+
"@stonecrop/themes": "0.32.0",
|
|
50
|
+
"@stonecrop/stonecrop": "0.32.0"
|
|
41
51
|
},
|
|
42
52
|
"devDependencies": {
|
|
43
|
-
"@microsoft/api-
|
|
44
|
-
"@rushstack/heft": "^1.2.17",
|
|
53
|
+
"@microsoft/api-extractor": "^7.58.7",
|
|
45
54
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
46
55
|
"@vitest/coverage-istanbul": "^4.1.5",
|
|
47
56
|
"@vue/test-utils": "^2.4.10",
|
|
@@ -51,12 +60,13 @@
|
|
|
51
60
|
"oxlint-tsgolint": "0.23.0",
|
|
52
61
|
"pinia": "^3.0.4",
|
|
53
62
|
"typescript": "^6.0.3",
|
|
54
|
-
"vite": "^
|
|
63
|
+
"vite": "^8.2.2",
|
|
64
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
55
65
|
"vitest": "^4.1.5",
|
|
56
66
|
"vue": "^3.5.33",
|
|
67
|
+
"vue-component-meta": "^3.3.11",
|
|
57
68
|
"vue-router": "^5.0.6",
|
|
58
|
-
"vue-tsc": "^3.3.6"
|
|
59
|
-
"stonecrop-rig": "0.7.0"
|
|
69
|
+
"vue-tsc": "^3.3.6"
|
|
60
70
|
},
|
|
61
71
|
"peerDependencies": {
|
|
62
72
|
"pinia": "^3.0.4",
|
|
@@ -65,13 +75,9 @@
|
|
|
65
75
|
"engines": {
|
|
66
76
|
"node": ">=24.0.0"
|
|
67
77
|
},
|
|
68
|
-
"publishConfig": {
|
|
69
|
-
"access": "public"
|
|
70
|
-
},
|
|
71
78
|
"scripts": {
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"docs": "bash ../common/scripts/run-docs.sh desktop",
|
|
79
|
+
"dev": "vite build --watch",
|
|
80
|
+
"docs": "bash ../tools/scripts/run-docs.sh desktop",
|
|
75
81
|
"lint": "oxlint",
|
|
76
82
|
"lint:fix": "oxlint --fix",
|
|
77
83
|
"test": "vitest run --coverage.enabled false",
|
package/dist/desktop.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#cross[data-v-8e18f635]{position:relative;transform:rotate(45deg);cursor:pointer;transition:all .2s ease-in-out;-webkit-user-select:none;user-select:none;line-height:1rem}#cross.rotated[data-v-8e18f635],.cross.rotated[data-v-8e18f635]{transform:rotate(0)}#cross svg[data-v-8e18f635]{width:1.5em;height:1.5em}.action-set[data-v-8e18f635]{position:fixed;top:300px;right:10px;padding:10px;display:flex;flex-direction:column;align-items:flex-end;background:var(--sc-form-background);border:1px solid var(--sc-gray-20);border-left:4px solid var(--sc-gray-20);border-radius:0;overflow:hidden;z-index:1001;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.action-menu-icon[data-v-8e18f635]{position:relative;font-size:2rem;display:inline-block;color:var(--sc-gray-60);transition:all .2s ease-in-out}.action-set.collapsed[data-v-8e18f635]{max-width:46px;max-height:40px;overflow:hidden}.action-set.collapsed .action-element[data-v-8e18f635]{opacity:0;-webkit-transition:opacity .25s ease-in-out;-moz-transition:opacity .25s ease-in-out;-o-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out}.action-element[data-v-8e18f635]{width:100%;text-align:right;border:1px solid var(--sc-gray-20);background:none;font-size:1.5rem;font-family:var(--sc-font-family);font-weight:600;margin-top:10px;position:relative}.action-element-header[data-v-8e18f635]{display:flex;justify-content:end}button.button-default[data-v-8e18f635]{background-color:transparent;border-radius:0;box-shadow:none;border:none;cursor:pointer;white-space:nowrap;font-weight:700;font-size:1rem;text-align:right;color:var(--sc-gray-80);padding:5px 12px 5px 50px;font-family:var(--sc-font-family)}.dropdown-header:hover button.button-default[data-v-8e18f635],.dropdown-header[data-v-8e18f635]:hover,.action-element-header[data-v-8e18f635]:hover{background-color:#f2f2f2}.dropdown-title[data-v-8e18f635]{position:relative}.dropdown-header[data-v-8e18f635]{display:flex;align-items:center}.cross[data-v-8e18f635]{pointer-events:all;margin-left:5px;font-family:var(--sc-font-family);color:var(--sc-gray-60);cursor:pointer;transform:rotate(45deg);-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out;line-height:1rem}button.dropdown-item[data-v-8e18f635]{width:100%;padding:5px 12px;text-align:right;border:none;background-color:#fff;cursor:pointer;border-radius:5px;font-size:1rem}button.dropdown-item[data-v-8e18f635]:hover{background-color:#f2f2f2}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease}.fade-enter-from,.fade-leave-to{opacity:0}.command-palette-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;align-items:flex-start;justify-content:center;z-index:300;padding-top:100px}.command-palette{width:600px;max-width:90%;background-color:#fff;border-radius:8px;box-shadow:0 4px 20px #00000026;overflow:hidden;max-height:80vh;display:flex;flex-direction:column}.command-palette-header{display:flex;border-bottom:1px solid #eaeaea;padding:12px}.command-palette-input{flex:1;border:none;outline:none;font-size:16px;padding:8px 12px;background-color:transparent}.command-palette-close{background:transparent;border:none;font-size:24px;cursor:pointer;color:#666;padding:0 8px}.command-palette-close:hover{color:#333}.command-palette-results{overflow-y:auto;max-height:60vh}.command-palette-result{padding:12px 16px;cursor:pointer;border-bottom:1px solid #f0f0f0}.command-palette-result:hover,.command-palette-result.selected{background-color:#f5f5f5}.command-palette-result.selected{background-color:#843c031a}.result-title{font-weight:500;margin-bottom:4px;color:#333}.result-content{font-size:14px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.command-palette-no-results{padding:20px 16px;text-align:center;color:#666}footer[data-v-cd118b06]{position:fixed;bottom:0;width:100%;background-color:transparent;height:auto;min-height:2.4rem;z-index:100;text-align:left;font-size:100%;display:flex;justify-content:right;padding:0 .75rem 0 0;box-sizing:border-box}ul[data-v-cd118b06]{display:flex;flex-direction:row-reverse;margin:0;padding:0;list-style:none}.tabs li[data-v-cd118b06]{float:left;list-style-type:none;position:relative;margin-left:-1px}.tabs a[data-v-cd118b06]{float:left;padding:.5rem 1rem;height:2.4rem;box-sizing:border-box;display:flex;align-items:center;justify-content:center;text-decoration:none;color:var(--sc-gray-60);background:var(--sc-btn-color);border:1px solid var(--sc-btn-border);font-size:.85rem;font-family:var(--sc-font-family);transition:all .15s ease;border-top-left-radius:2px;border-top-right-radius:2px}.tabs a[data-v-cd118b06]:hover{background:var(--sc-btn-hover)}.tabs .router-link-active[data-v-cd118b06]{z-index:3;background:var(--sc-primary-color)!important;border-color:var(--sc-primary-color)!important;color:var(--sc-primary-text-color)!important}.hidebreadcrumbs a[data-v-cd118b06]{min-width:2.4rem;width:2.4rem;height:2.4rem;padding:.5rem;background:var(--sc-btn-color);border:1px solid var(--sc-btn-border);color:var(--sc-gray-60)}.hidebreadcrumbs a div[data-v-cd118b06]{font-size:1.2rem}.rotated[data-v-cd118b06]{transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transition:transform .25s ease}.unrotated[data-v-cd118b06]{transform:rotate(0);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform .25s ease}li[data-v-cd118b06]:active,li[data-v-cd118b06]:hover,li[data-v-cd118b06]:focus,li>a[data-v-cd118b06]:active,li>a[data-v-cd118b06]:hover,li>a[data-v-cd118b06]:focus{z-index:3}a[data-v-cd118b06]:active,a[data-v-cd118b06]:hover,a[data-v-cd118b06]:focus{outline:2px solid var(--sc-input-active-border-color);z-index:3}.hometab a[data-v-cd118b06]{min-width:2.4rem;width:2.4rem;height:2.4rem;padding:.5rem;background:var(--sc-btn-color);border:1px solid var(--sc-btn-border);color:var(--sc-gray-60)}.icon[data-v-cd118b06]{width:1rem;height:1rem;stroke:currentColor;flex-shrink:0}.searchtab[data-v-cd118b06]{overflow:hidden}.searchtab a[data-v-cd118b06]{min-width:2.4rem;height:2.4rem;padding:.5rem;background:var(--sc-btn-color);border:1px solid var(--sc-btn-border);color:var(--sc-gray-60);overflow:hidden;max-width:2.4rem;transition:max-width .35s ease-in-out,padding .35s ease-in-out,background .2s ease}.searchtab .search-icon[data-v-cd118b06]{cursor:pointer}.searchtab input[data-v-cd118b06]{outline:none;border:1px solid var(--sc-input-border-color);border-radius:.25rem;background-color:var(--sc-form-background);color:var(--sc-gray-80);text-align:left;font-size:.875rem;padding:.25rem .5rem;width:180px;height:1.5rem;flex-shrink:0;opacity:0;transition:opacity .2s ease-in-out;transition-delay:0s}.searchtab input[data-v-cd118b06]:focus{border-color:var(--sc-input-active-border-color);outline:none}.searchtab input[data-v-cd118b06]::placeholder{color:var(--sc-input-label-color)}.searchtab.search-active a[data-v-cd118b06]{max-width:200px;min-width:auto;width:auto;padding:.5rem .75rem}.searchtab.search-active input[data-v-cd118b06]{opacity:1;transition-delay:.15s}
|
package/dist/desktop.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { ActionEventPayload } from '@stonecrop/stonecrop';
|
|
2
|
-
import ActionSet from './components/ActionSet.vue';
|
|
3
|
-
import CommandPalette from './components/CommandPalette.vue';
|
|
4
|
-
import Desktop from './components/Desktop.vue';
|
|
5
|
-
import { Plugin as Plugin_2 } from 'vue';
|
|
6
|
-
import SheetNav from './components/SheetNav.vue';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Superset of all element types in the Action Set
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare type ActionElements = ButtonElement | DropdownElement;
|
|
13
|
-
|
|
14
|
-
export { ActionEventPayload }
|
|
15
|
-
|
|
16
|
-
export { ActionSet }
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Base type for elements in the Action Set
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export declare type BaseElement = {
|
|
23
|
-
label: string;
|
|
24
|
-
show?: boolean;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Button elements
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
export declare type ButtonElement = BaseElement & ElementAction & {
|
|
32
|
-
type: 'button';
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export { CommandPalette }
|
|
37
|
-
|
|
38
|
-
export { Desktop }
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Dropdown elements
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export declare type DropdownElement = BaseElement & {
|
|
45
|
-
type: 'dropdown';
|
|
46
|
-
actions: ElementAction[];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Element actions
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export declare type ElementAction = BaseElement & {
|
|
54
|
-
link?: string;
|
|
55
|
-
action?: () => void;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Payload emitted with the 'load-record' event when Desktop needs a single record
|
|
60
|
-
* @public
|
|
61
|
-
*/
|
|
62
|
-
export declare type LoadRecordEventPayload = {
|
|
63
|
-
doctype: string;
|
|
64
|
-
recordId: string;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Payload emitted with the 'load-records' event when Desktop needs records for a list view
|
|
69
|
-
* @public
|
|
70
|
-
*/
|
|
71
|
-
export declare type LoadRecordsEventPayload = {
|
|
72
|
-
doctype: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Navigation target passed to RouteAdapter.navigate and emitted with the 'navigate' event
|
|
77
|
-
* @public
|
|
78
|
-
*/
|
|
79
|
-
export declare type NavigationTarget = {
|
|
80
|
-
view: 'doctypes' | 'records' | 'record';
|
|
81
|
-
doctype?: string;
|
|
82
|
-
recordId?: string;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Payload emitted with the 'record:open' event
|
|
87
|
-
* @public
|
|
88
|
-
*/
|
|
89
|
-
export declare type RecordOpenEventPayload = {
|
|
90
|
-
doctype: string;
|
|
91
|
-
recordId: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Adapter that lets host applications (Nuxt, etc.) supply their own routing layer.
|
|
96
|
-
* When provided as a prop, Desktop uses these functions instead of reaching into
|
|
97
|
-
* the Vue Router instance baked into the Stonecrop registry.
|
|
98
|
-
* @public
|
|
99
|
-
*/
|
|
100
|
-
export declare type RouteAdapter = {
|
|
101
|
-
/** Returns the active doctype key (e.g. 'plan', 'recipe'). Called inside computed — should read reactive state. */
|
|
102
|
-
getCurrentDoctype: () => string;
|
|
103
|
-
/** Returns the active record ID, or '' when viewing a list. Called inside computed. */
|
|
104
|
-
getCurrentRecordId: () => string;
|
|
105
|
-
/** Returns which of the three views is currently active. Called inside computed. */
|
|
106
|
-
getCurrentView: () => 'doctypes' | 'records' | 'record';
|
|
107
|
-
/** Perform the navigation. Called after the host app has handled any side effects. */
|
|
108
|
-
navigate: (target: NavigationTarget) => void | Promise<void>;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export { SheetNav }
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* This is the main plugin that will be used to register all the desktop components.
|
|
115
|
-
* @public
|
|
116
|
-
*/
|
|
117
|
-
export declare const StonecropDesktop: Plugin_2;
|
|
118
|
-
|
|
119
|
-
export { }
|
package/dist/desktop.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"6.0.3"}
|
package/dist/src/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import ActionSet from './components/ActionSet.vue';
|
|
2
|
-
import CommandPalette from './components/CommandPalette.vue';
|
|
3
|
-
import Desktop from './components/Desktop.vue';
|
|
4
|
-
import SheetNav from './components/SheetNav.vue';
|
|
5
|
-
import StonecropDesktop from './plugins';
|
|
6
|
-
export { ActionSet, CommandPalette, Desktop, SheetNav, StonecropDesktop };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import ActionSet from '../components/ActionSet.vue';
|
|
2
|
-
import CommandPalette from '../components/CommandPalette.vue';
|
|
3
|
-
import Desktop from '../components/Desktop.vue';
|
|
4
|
-
import SheetNav from '../components/SheetNav.vue';
|
|
5
|
-
/**
|
|
6
|
-
* This is the main plugin that will be used to register all the desktop components.
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
const plugin = {
|
|
10
|
-
install: (app) => {
|
|
11
|
-
app.component('ActionSet', ActionSet);
|
|
12
|
-
app.component('CommandPalette', CommandPalette);
|
|
13
|
-
app.component('Desktop', Desktop);
|
|
14
|
-
app.component('SheetNav', SheetNav);
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export default plugin;
|
package/dist/src/types/index.js
DELETED
|
File without changes
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="{ collapsed: !isOpen }" class="action-set">
|
|
3
|
-
<div class="action-menu-icon">
|
|
4
|
-
<div id="cross" :class="{ rotated: isOpen }" @click="onClick">×</div>
|
|
5
|
-
</div>
|
|
6
|
-
<div style="margin-right: 30px"></div>
|
|
7
|
-
<div v-for="(el, index) in elements" :key="el.label" class="action-element">
|
|
8
|
-
<div class="action-element-header">
|
|
9
|
-
<button
|
|
10
|
-
v-if="el.type == 'button'"
|
|
11
|
-
:disabled="el.disabled"
|
|
12
|
-
class="button-default"
|
|
13
|
-
@click="handleClick(el.action, el.label)">
|
|
14
|
-
{{ el.label }}
|
|
15
|
-
</button>
|
|
16
|
-
</div>
|
|
17
|
-
<div v-if="el.type == 'dropdown'">
|
|
18
|
-
<div class="dropdown-header">
|
|
19
|
-
<div class="cross" :class="{ rotated: dropdownOpen[index] }" @click="toggleDropdown(index)">×</div>
|
|
20
|
-
<button class="button-default dropdown-title" @click="toggleDropdown(index)">
|
|
21
|
-
{{ el.label }}
|
|
22
|
-
</button>
|
|
23
|
-
</div>
|
|
24
|
-
<div v-show="dropdownStates[index]" class="dropdown-container">
|
|
25
|
-
<div class="dropdown">
|
|
26
|
-
<div v-for="item in el.actions" :key="item.label">
|
|
27
|
-
<button v-if="item.action != null" class="dropdown-item" @click="handleClick(item.action, item.label)">
|
|
28
|
-
{{ item.label }}
|
|
29
|
-
</button>
|
|
30
|
-
<a v-else-if="item.link != null" :href="item.link"
|
|
31
|
-
><button class="dropdown-item">{{ item.label }}</button></a
|
|
32
|
-
>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<script setup lang="ts">
|
|
42
|
-
import { onMounted, ref } from 'vue'
|
|
43
|
-
|
|
44
|
-
import type { ActionElements } from '../types'
|
|
45
|
-
|
|
46
|
-
const { elements = [] } = defineProps<{ elements?: ActionElements[] }>()
|
|
47
|
-
const emit = defineEmits<{
|
|
48
|
-
actionClick: [label: string, action: (() => void | Promise<void>) | undefined]
|
|
49
|
-
}>()
|
|
50
|
-
|
|
51
|
-
// Track dropdown open state separately (index -> boolean)
|
|
52
|
-
const dropdownStates = ref<Record<number, boolean>>({})
|
|
53
|
-
|
|
54
|
-
const isOpen = ref(true)
|
|
55
|
-
const dropdownOpen = ref<boolean[]>([])
|
|
56
|
-
|
|
57
|
-
onMounted(() => {
|
|
58
|
-
closeDropdowns()
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
const closeDropdowns = () => {
|
|
62
|
-
dropdownStates.value = {}
|
|
63
|
-
dropdownOpen.value = []
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const onClick = () => {
|
|
67
|
-
isOpen.value = !isOpen.value
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const toggleDropdown = (index: number) => {
|
|
71
|
-
const showDropdown = !dropdownStates.value[index]
|
|
72
|
-
closeDropdowns()
|
|
73
|
-
if (showDropdown) {
|
|
74
|
-
dropdownStates.value[index] = true
|
|
75
|
-
dropdownOpen.value[index] = true
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {
|
|
80
|
-
// Emit event to parent - parent will handle execution
|
|
81
|
-
emit('actionClick', label, action)
|
|
82
|
-
}
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style scoped>
|
|
86
|
-
#cross {
|
|
87
|
-
position: relative;
|
|
88
|
-
transform: rotate(45deg);
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
transition: all 0.2s ease-in-out;
|
|
91
|
-
user-select: none;
|
|
92
|
-
line-height: 1rem;
|
|
93
|
-
}
|
|
94
|
-
#cross.rotated,
|
|
95
|
-
.cross.rotated {
|
|
96
|
-
transform: rotate(0deg);
|
|
97
|
-
}
|
|
98
|
-
#cross svg {
|
|
99
|
-
width: 1.5em;
|
|
100
|
-
height: 1.5em;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.action-set {
|
|
104
|
-
position: fixed;
|
|
105
|
-
top: 300px;
|
|
106
|
-
right: 10px;
|
|
107
|
-
padding: 10px;
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
align-items: flex-end;
|
|
111
|
-
background: var(--sc-form-background);
|
|
112
|
-
border: 1px solid var(--sc-gray-20);
|
|
113
|
-
border-left: 4px solid var(--sc-gray-20);
|
|
114
|
-
border-radius: 0;
|
|
115
|
-
overflow: hidden;
|
|
116
|
-
z-index: 1001; /* Above SheetNav (100) and operation log button (999) */
|
|
117
|
-
-webkit-transition: all 0.5s ease-in-out;
|
|
118
|
-
-moz-transition: all 0.5s ease-in-out;
|
|
119
|
-
-o-transition: all 0.5s ease-in-out;
|
|
120
|
-
transition: all 0.5s ease-in-out;
|
|
121
|
-
}
|
|
122
|
-
.action-menu-icon {
|
|
123
|
-
position: relative;
|
|
124
|
-
font-size: 2rem;
|
|
125
|
-
display: inline-block;
|
|
126
|
-
color: var(--sc-gray-60);
|
|
127
|
-
transition: all 0.2s ease-in-out;
|
|
128
|
-
}
|
|
129
|
-
.action-set.collapsed {
|
|
130
|
-
max-width: 46px;
|
|
131
|
-
max-height: 40px;
|
|
132
|
-
overflow: hidden;
|
|
133
|
-
}
|
|
134
|
-
.action-set.collapsed .action-element {
|
|
135
|
-
opacity: 0;
|
|
136
|
-
-webkit-transition: opacity 0.25s ease-in-out;
|
|
137
|
-
-moz-transition: opacity 0.25s ease-in-out;
|
|
138
|
-
-o-transition: opacity 0.25s ease-in-out;
|
|
139
|
-
transition: opacity 0.25s ease-in-out;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.action-element {
|
|
143
|
-
width: 100%;
|
|
144
|
-
text-align: right;
|
|
145
|
-
border: 1px solid var(--sc-gray-20);
|
|
146
|
-
background: none;
|
|
147
|
-
font-size: 1.5rem;
|
|
148
|
-
font-family: var(--sc-font-family);
|
|
149
|
-
font-weight: 600;
|
|
150
|
-
margin-top: 10px;
|
|
151
|
-
position: relative; /* Make this the positioning context for absolute children */
|
|
152
|
-
}
|
|
153
|
-
.action-element-header {
|
|
154
|
-
display: flex;
|
|
155
|
-
justify-content: end;
|
|
156
|
-
}
|
|
157
|
-
button.button-default {
|
|
158
|
-
background-color: transparent;
|
|
159
|
-
padding: 5px 12px;
|
|
160
|
-
border-radius: 0px;
|
|
161
|
-
box-shadow: none;
|
|
162
|
-
border: none;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
white-space: nowrap;
|
|
165
|
-
font-weight: bold;
|
|
166
|
-
font-size: 1rem;
|
|
167
|
-
text-align: right;
|
|
168
|
-
color: var(--sc-gray-80);
|
|
169
|
-
padding-left: 50px;
|
|
170
|
-
font-family: var(--sc-font-family);
|
|
171
|
-
}
|
|
172
|
-
.dropdown-header:hover button.button-default,
|
|
173
|
-
.dropdown-header:hover,
|
|
174
|
-
.action-element-header:hover {
|
|
175
|
-
background-color: #f2f2f2;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.dropdown-title {
|
|
179
|
-
position: relative;
|
|
180
|
-
}
|
|
181
|
-
.dropdown-header {
|
|
182
|
-
display: flex;
|
|
183
|
-
align-items: center;
|
|
184
|
-
}
|
|
185
|
-
.cross {
|
|
186
|
-
pointer-events: all;
|
|
187
|
-
margin-left: 5px;
|
|
188
|
-
font-family: var(--sc-font-family);
|
|
189
|
-
color: var(--sc-gray-60);
|
|
190
|
-
cursor: pointer;
|
|
191
|
-
transform: rotate(45deg);
|
|
192
|
-
user-select: none;
|
|
193
|
-
transition: all 0.2s ease-in-out;
|
|
194
|
-
line-height: 1rem;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
button.dropdown-item {
|
|
198
|
-
width: 100%;
|
|
199
|
-
padding: 5px 12px;
|
|
200
|
-
text-align: right;
|
|
201
|
-
border: none;
|
|
202
|
-
background-color: #ffffff;
|
|
203
|
-
cursor: pointer;
|
|
204
|
-
border-radius: 5px;
|
|
205
|
-
font-size: 1rem;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
button.dropdown-item:hover {
|
|
209
|
-
background-color: #f2f2f2;
|
|
210
|
-
}
|
|
211
|
-
</style>
|