@genesislcap/foundation-workspace 14.406.0-workspaces.7
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/api-extractor.json +5 -0
- package/dist/dts/index.d.ts +4 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/workspace/filter-registry.d.ts +34 -0
- package/dist/dts/workspace/filter-registry.d.ts.map +1 -0
- package/dist/dts/workspace/grid-register/grid-register.d.ts +23 -0
- package/dist/dts/workspace/grid-register/grid-register.d.ts.map +1 -0
- package/dist/dts/workspace/grid-register/grid-register.template.d.ts +4 -0
- package/dist/dts/workspace/grid-register/grid-register.template.d.ts.map +1 -0
- package/dist/dts/workspace/grid-register/index.d.ts +2 -0
- package/dist/dts/workspace/grid-register/index.d.ts.map +1 -0
- package/dist/dts/workspace/grid-registry.d.ts +47 -0
- package/dist/dts/workspace/grid-registry.d.ts.map +1 -0
- package/dist/dts/workspace/index.d.ts +9 -0
- package/dist/dts/workspace/index.d.ts.map +1 -0
- package/dist/dts/workspace/layout-registry.d.ts +27 -0
- package/dist/dts/workspace/layout-registry.d.ts.map +1 -0
- package/dist/dts/workspace/layout-wrapper/index.d.ts +2 -0
- package/dist/dts/workspace/layout-wrapper/index.d.ts.map +1 -0
- package/dist/dts/workspace/layout-wrapper/layout-wrapper.d.ts +14 -0
- package/dist/dts/workspace/layout-wrapper/layout-wrapper.d.ts.map +1 -0
- package/dist/dts/workspace/layout-wrapper/layout-wrapper.template.d.ts +4 -0
- package/dist/dts/workspace/layout-wrapper/layout-wrapper.template.d.ts.map +1 -0
- package/dist/dts/workspace/workspace-state.d.ts +45 -0
- package/dist/dts/workspace/workspace-state.d.ts.map +1 -0
- package/dist/dts/workspace/workspace-state.types.d.ts +26 -0
- package/dist/dts/workspace/workspace-state.types.d.ts.map +1 -0
- package/dist/dts/workspace/workspace.types.d.ts +25 -0
- package/dist/dts/workspace/workspace.types.d.ts.map +1 -0
- package/dist/dts/workspace-components.d.ts +22 -0
- package/dist/dts/workspace-components.d.ts.map +1 -0
- package/dist/dts/workspace-manager/index.d.ts +2 -0
- package/dist/dts/workspace-manager/index.d.ts.map +1 -0
- package/dist/dts/workspace-manager/workspace-manager.d.ts +70 -0
- package/dist/dts/workspace-manager/workspace-manager.d.ts.map +1 -0
- package/dist/dts/workspace-manager/workspace-manager.styles.d.ts +2 -0
- package/dist/dts/workspace-manager/workspace-manager.styles.d.ts.map +1 -0
- package/dist/dts/workspace-manager/workspace-manager.template.d.ts +4 -0
- package/dist/dts/workspace-manager/workspace-manager.template.d.ts.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/workspace/filter-registry.js +47 -0
- package/dist/esm/workspace/grid-register/grid-register.js +136 -0
- package/dist/esm/workspace/grid-register/grid-register.template.js +4 -0
- package/dist/esm/workspace/grid-register/index.js +1 -0
- package/dist/esm/workspace/grid-registry.js +109 -0
- package/dist/esm/workspace/index.js +8 -0
- package/dist/esm/workspace/layout-registry.js +45 -0
- package/dist/esm/workspace/layout-wrapper/index.js +1 -0
- package/dist/esm/workspace/layout-wrapper/layout-wrapper.js +64 -0
- package/dist/esm/workspace/layout-wrapper/layout-wrapper.template.js +4 -0
- package/dist/esm/workspace/workspace-state.js +193 -0
- package/dist/esm/workspace/workspace-state.types.js +1 -0
- package/dist/esm/workspace/workspace.types.js +1 -0
- package/dist/esm/workspace-components.js +43 -0
- package/dist/esm/workspace-manager/index.js +1 -0
- package/dist/esm/workspace-manager/workspace-manager.js +436 -0
- package/dist/esm/workspace-manager/workspace-manager.styles.js +138 -0
- package/dist/esm/workspace-manager/workspace-manager.template.js +259 -0
- package/dist/foundation-workspace.api.json +3614 -0
- package/dist/foundation-workspace.d.ts +343 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docs/.gitkeep +1 -0
- package/docs/api/foundation-workspace.defaultfilterregistry.md +17 -0
- package/docs/api/foundation-workspace.defaultgridregistry.md +17 -0
- package/docs/api/foundation-workspace.defaultlayoutregistry.md +18 -0
- package/docs/api/foundation-workspace.defaultworkspacestate._constructor_.md +65 -0
- package/docs/api/foundation-workspace.defaultworkspacestate.auth.md +14 -0
- package/docs/api/foundation-workspace.defaultworkspacestate.kvstorage.md +14 -0
- package/docs/api/foundation-workspace.defaultworkspacestate.md +115 -0
- package/docs/api/foundation-workspace.filterregistration.filterkey.md +14 -0
- package/docs/api/foundation-workspace.filterregistration.getfiltervalue.md +14 -0
- package/docs/api/foundation-workspace.filterregistration.md +98 -0
- package/docs/api/foundation-workspace.filterregistration.setfiltervalue.md +14 -0
- package/docs/api/foundation-workspace.filterregistry.applyfiltersvalues.md +53 -0
- package/docs/api/foundation-workspace.filterregistry.getallfiltersvalues.md +18 -0
- package/docs/api/foundation-workspace.filterregistry.md +16 -0
- package/docs/api/foundation-workspace.filterregistry.registerfilter.md +81 -0
- package/docs/api/foundation-workspace.filterregistry.unregisterfilter.md +53 -0
- package/docs/api/foundation-workspace.gridregister.gridkey.md +14 -0
- package/docs/api/foundation-workspace.gridregister.gridregistry.md +14 -0
- package/docs/api/foundation-workspace.gridregister.md +100 -0
- package/docs/api/foundation-workspace.gridregister.workspacestate.md +14 -0
- package/docs/api/foundation-workspace.gridregistration.columnapi.md +14 -0
- package/docs/api/foundation-workspace.gridregistration.gridapi.md +14 -0
- package/docs/api/foundation-workspace.gridregistration.gridkey.md +14 -0
- package/docs/api/foundation-workspace.gridregistration.md +98 -0
- package/docs/api/foundation-workspace.gridregistry.applyallgridssettings.md +53 -0
- package/docs/api/foundation-workspace.gridregistry.applygridsettings.md +72 -0
- package/docs/api/foundation-workspace.gridregistry.getallgridssettings.md +18 -0
- package/docs/api/foundation-workspace.gridregistry.getgrid.md +53 -0
- package/docs/api/foundation-workspace.gridregistry.md +16 -0
- package/docs/api/foundation-workspace.gridregistry.registergrid.md +81 -0
- package/docs/api/foundation-workspace.gridregistry.unregistergrid.md +53 -0
- package/docs/api/foundation-workspace.layoutregistry.applysavedlayouts.md +53 -0
- package/docs/api/foundation-workspace.layoutregistry.getlayoutsconfigs.md +18 -0
- package/docs/api/foundation-workspace.layoutregistry.md +16 -0
- package/docs/api/foundation-workspace.layoutregistry.registerlayout.md +67 -0
- package/docs/api/foundation-workspace.layoutregistry.unregisterlayout.md +53 -0
- package/docs/api/foundation-workspace.layoutwrapper.layoutkey.md +14 -0
- package/docs/api/foundation-workspace.layoutwrapper.layoutregistry.md +14 -0
- package/docs/api/foundation-workspace.layoutwrapper.md +81 -0
- package/docs/api/foundation-workspace.loadmode.md +16 -0
- package/docs/api/foundation-workspace.md +332 -0
- package/docs/api/foundation-workspace.savedfiltervalue.filterkey.md +14 -0
- package/docs/api/foundation-workspace.savedfiltervalue.md +79 -0
- package/docs/api/foundation-workspace.savedfiltervalue.value.md +14 -0
- package/docs/api/foundation-workspace.savedgridsettings.columnstate.md +14 -0
- package/docs/api/foundation-workspace.savedgridsettings.gridkey.md +14 -0
- package/docs/api/foundation-workspace.savedgridsettings.md +99 -0
- package/docs/api/foundation-workspace.savedgridsettings.savedat.md +14 -0
- package/docs/api/foundation-workspace.savedlayout.layout.md +14 -0
- package/docs/api/foundation-workspace.savedlayout.layoutkey.md +14 -0
- package/docs/api/foundation-workspace.savedlayout.md +79 -0
- package/docs/api/foundation-workspace.savedworkspace.description.md +14 -0
- package/docs/api/foundation-workspace.savedworkspace.filters.md +14 -0
- package/docs/api/foundation-workspace.savedworkspace.grids.md +14 -0
- package/docs/api/foundation-workspace.savedworkspace.layouts.md +14 -0
- package/docs/api/foundation-workspace.savedworkspace.md +174 -0
- package/docs/api/foundation-workspace.savedworkspace.name.md +14 -0
- package/docs/api/foundation-workspace.savedworkspace.savedat.md +14 -0
- package/docs/api/foundation-workspace.savedworkspace.username.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.createdon.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.data.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.description.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.id.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.md +174 -0
- package/docs/api/foundation-workspace.sharedworkspace.modifiedon.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.name.md +14 -0
- package/docs/api/foundation-workspace.sharedworkspace.username.md +14 -0
- package/docs/api/foundation-workspace.workspacecomponents.md +29 -0
- package/docs/api/foundation-workspace.workspacemanager.applyingworkspace.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.auth.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.canshareworkspace.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.connect.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.dialogboundary.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.filterregistry.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.gridregistry.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.isloading.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.layoutregistry.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.loadmodal.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.loadmode.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.md +442 -0
- package/docs/api/foundation-workspace.workspacemanager.savedworkspaces.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.savemodal.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.savemode.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.selectedworkspacetooverwrite.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.sharedworkspacedialogboundary.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.sharedworkspaces.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.workspacedescription.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.workspacename.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.workspacestate.md +14 -0
- package/docs/api/foundation-workspace.workspacemanager.workspacetoshare.md +14 -0
- package/docs/api/foundation-workspace.workspacestate.deleteworkspace.md +53 -0
- package/docs/api/foundation-workspace.workspacestate.getcurrentworkspace.md +18 -0
- package/docs/api/foundation-workspace.workspacestate.getsavedworkspaces.md +18 -0
- package/docs/api/foundation-workspace.workspacestate.loadworkspace.md +53 -0
- package/docs/api/foundation-workspace.workspacestate.md +16 -0
- package/docs/api/foundation-workspace.workspacestate.saveworkspace.md +111 -0
- package/docs/api/foundation-workspace.workspacestate.setcurrentworkspace.md +53 -0
- package/docs/api/index.md +30 -0
- package/docs/api-report.md.api.md +372 -0
- package/license.txt +46 -0
- package/package.json +69 -0
- package/src/index.ts +3 -0
- package/src/workspace/filter-registry.ts +80 -0
- package/src/workspace/grid-register/grid-register.template.ts +7 -0
- package/src/workspace/grid-register/grid-register.ts +142 -0
- package/src/workspace/grid-register/index.ts +1 -0
- package/src/workspace/grid-registry.ts +157 -0
- package/src/workspace/index.ts +8 -0
- package/src/workspace/layout-registry.ts +58 -0
- package/src/workspace/layout-wrapper/index.ts +1 -0
- package/src/workspace/layout-wrapper/layout-wrapper.template.ts +7 -0
- package/src/workspace/layout-wrapper/layout-wrapper.ts +66 -0
- package/src/workspace/workspace-state.ts +234 -0
- package/src/workspace/workspace-state.types.ts +27 -0
- package/src/workspace/workspace.types.ts +26 -0
- package/src/workspace-components.ts +51 -0
- package/src/workspace-manager/index.ts +1 -0
- package/src/workspace-manager/workspace-manager.styles.ts +139 -0
- package/src/workspace-manager/workspace-manager.template.ts +352 -0
- package/src/workspace-manager/workspace-manager.ts +420 -0
- package/temp/api-report.md.api.md +372 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace persistence types.
|
|
3
|
+
* Layout and column state use generic shapes so consumers can use foundation-layout and ag-grid types.
|
|
4
|
+
* @alpha
|
|
5
|
+
*/
|
|
6
|
+
export interface SavedGridSettings {
|
|
7
|
+
gridKey: string;
|
|
8
|
+
columnState: any[];
|
|
9
|
+
savedAt: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
export interface SavedFilterValue {
|
|
16
|
+
filterKey: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @alpha
|
|
22
|
+
*/
|
|
23
|
+
export interface SavedLayout {
|
|
24
|
+
layoutKey: string;
|
|
25
|
+
layout: unknown;
|
|
26
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Container } from '@microsoft/fast-foundation';
|
|
2
|
+
|
|
3
|
+
// Import the custom elements so their `@customElement` decorators run and define tags.
|
|
4
|
+
import { LayoutWrapper, GridRegister } from './workspace';
|
|
5
|
+
import { WorkspaceManager } from './workspace-manager';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Registration object for workspace-related components.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors the shape of `rapidGridComponents` so it can be passed into
|
|
11
|
+
* `provideDesignSystem().register(...)` without additional glue code.
|
|
12
|
+
*
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
export const workspaceComponents = {
|
|
16
|
+
workspaceManager: () => ({
|
|
17
|
+
register(_container?: Container, ..._rest: any[]) {
|
|
18
|
+
// Custom elements are defined by decorators at module import time.
|
|
19
|
+
void WorkspaceManager;
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
layoutWrapper: () => ({
|
|
24
|
+
register(_container?: Container, ..._rest: any[]) {
|
|
25
|
+
void LayoutWrapper;
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
|
|
29
|
+
gridRegister: () => ({
|
|
30
|
+
register(_container?: Container, ..._rest: any[]) {
|
|
31
|
+
void GridRegister;
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
|
|
35
|
+
register(container?: Container, ...rest: any[]) {
|
|
36
|
+
if (!container) {
|
|
37
|
+
// Preserve backward compatibility with callers that iterate keys.
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
for (const key in this) {
|
|
42
|
+
if (key === 'register') {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// The values of this object are functions that return a component
|
|
47
|
+
// registration object with a `.register(...)` method.
|
|
48
|
+
(this as any)[key]().register(container, ...rest);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './workspace-manager';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
|
|
3
|
+
export const WorkspaceManagerStyles = css`
|
|
4
|
+
.workspace-manager {
|
|
5
|
+
display: flex;
|
|
6
|
+
gap: 10px;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dialog-content {
|
|
11
|
+
padding: 16px;
|
|
12
|
+
min-width: 400px;
|
|
13
|
+
max-width: 400px;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
max-height: 90vh;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.button-group {
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
justify-content: flex-end;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.workspace-list {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 12px;
|
|
30
|
+
max-height: 400px;
|
|
31
|
+
overflow-y: auto;
|
|
32
|
+
margin: 10px 0;
|
|
33
|
+
align-items: unset;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
rapid-label {
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.empty-state {
|
|
42
|
+
padding: 24px;
|
|
43
|
+
text-align: center;
|
|
44
|
+
color: var(--neutral-foreground-hint);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.save-mode-selector {
|
|
48
|
+
margin-bottom: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.warning-message {
|
|
52
|
+
margin: 12px 0;
|
|
53
|
+
padding: 12px;
|
|
54
|
+
border: 1px solid var(--warning-color);
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.workspace-item {
|
|
60
|
+
padding: 12px;
|
|
61
|
+
border: 1px solid var(--neutral-stroke-rest);
|
|
62
|
+
border-radius: 4px;
|
|
63
|
+
background: var(--neutral-fill-rest);
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.workspace-item:hover {
|
|
70
|
+
background: var(--neutral-fill-hover);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.workspace-item::part(control) {
|
|
74
|
+
margin-top: 2px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.workspace-info {
|
|
78
|
+
flex: 1;
|
|
79
|
+
margin-left: 8px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.workspace-name {
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
margin-bottom: 4px;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.workspace-date {
|
|
91
|
+
font-size: 12px;
|
|
92
|
+
color: var(--neutral-foreground-hint);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.workspace-description {
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
color: var(--neutral-foreground-hint);
|
|
98
|
+
margin-top: 4px;
|
|
99
|
+
white-space: pre-wrap;
|
|
100
|
+
word-break: break-word;
|
|
101
|
+
line-height: 1.4;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.workspace-description-input {
|
|
105
|
+
width: 100%;
|
|
106
|
+
min-height: 60px;
|
|
107
|
+
padding: 8px 12px;
|
|
108
|
+
margin-bottom: 16px;
|
|
109
|
+
font-family: inherit;
|
|
110
|
+
font-size: 14px;
|
|
111
|
+
border: 1px solid var(--neutral-stroke-rest);
|
|
112
|
+
border-radius: 4px;
|
|
113
|
+
background: var(--neutral-fill-rest);
|
|
114
|
+
color: var(--neutral-foreground-rest);
|
|
115
|
+
resize: vertical;
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.workspace-description-input::placeholder {
|
|
120
|
+
color: var(--neutral-foreground-hint);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.workspace-description-input:focus {
|
|
124
|
+
outline: none;
|
|
125
|
+
border-color: var(--accent-fill-rest);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.loading-container {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
padding: 24px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.save-field {
|
|
137
|
+
margin-bottom: 20px;
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { sync, whenElse } from '@genesislcap/foundation-utils';
|
|
2
|
+
import { ExecutionContext, html, ref, repeat, when } from '@microsoft/fast-element';
|
|
3
|
+
import { SavedWorkspace, SharedWorkspace } from '../workspace/workspace-state.types';
|
|
4
|
+
import type { WorkspaceManager } from './workspace-manager';
|
|
5
|
+
|
|
6
|
+
export const WORKSPACE_DESCRIPTION_MAX = 200;
|
|
7
|
+
|
|
8
|
+
export const WorkspaceManagerTemplate = html<WorkspaceManager>`
|
|
9
|
+
<div class="workspace-manager">
|
|
10
|
+
<rapid-button @click=${(x) => x.openSaveDialog()}>
|
|
11
|
+
<rapid-icon name="download"></rapid-icon>
|
|
12
|
+
Save Workspace
|
|
13
|
+
</rapid-button>
|
|
14
|
+
<rapid-button @click=${(x) => x.openLoadDialog()}>
|
|
15
|
+
<rapid-icon name="upload"></rapid-icon>
|
|
16
|
+
Load Workspace
|
|
17
|
+
</rapid-button>
|
|
18
|
+
</div>
|
|
19
|
+
<rapid-modal ${ref('saveModal')}>
|
|
20
|
+
<h2 slot="top">Save Workspace</h2>
|
|
21
|
+
<div class="dialog-content">
|
|
22
|
+
<div class="save-mode-selector">
|
|
23
|
+
<rapid-segmented-control value="${sync((x) => x.saveMode)}">
|
|
24
|
+
<rapid-segmented-item value="create">Create</rapid-segmented-item>
|
|
25
|
+
<rapid-segmented-item value="overwrite">Overwrite</rapid-segmented-item>
|
|
26
|
+
${when(
|
|
27
|
+
(x) => x.canShareWorkspace,
|
|
28
|
+
html<WorkspaceManager>`
|
|
29
|
+
<rapid-segmented-item value="shared">Share</rapid-segmented-item>
|
|
30
|
+
`,
|
|
31
|
+
)}
|
|
32
|
+
</rapid-segmented-control>
|
|
33
|
+
</div>
|
|
34
|
+
${when(
|
|
35
|
+
(x) => x.saveMode === 'create',
|
|
36
|
+
html<WorkspaceManager>`
|
|
37
|
+
<rapid-label>Workspace Name:</rapid-label>
|
|
38
|
+
<rapid-text-field
|
|
39
|
+
class="save-field"
|
|
40
|
+
:value=${(x) => x.workspaceName}
|
|
41
|
+
@input=${(x, c) => (x.workspaceName = (c.event.target as HTMLInputElement).value)}
|
|
42
|
+
placeholder="Enter workspace name"
|
|
43
|
+
></rapid-text-field>
|
|
44
|
+
<rapid-label>
|
|
45
|
+
Description (optional, max ${WORKSPACE_DESCRIPTION_MAX} characters):
|
|
46
|
+
</rapid-label>
|
|
47
|
+
<textarea
|
|
48
|
+
class="save-field workspace-description-input"
|
|
49
|
+
:value=${(x) => x.workspaceDescription}
|
|
50
|
+
@input=${(x, c) =>
|
|
51
|
+
x.updateWorkspaceDescription((c.event.target as HTMLTextAreaElement).value)}
|
|
52
|
+
placeholder="Add a description for this workspace"
|
|
53
|
+
rows="3"
|
|
54
|
+
></textarea>
|
|
55
|
+
${when(
|
|
56
|
+
(x) => x.workspaceName && x.isWorkspaceExisting(x.workspaceName),
|
|
57
|
+
html`
|
|
58
|
+
<div class="warning-message">
|
|
59
|
+
<rapid-icon name="triangle-exclamation"></rapid-icon>
|
|
60
|
+
A workspace with this name already exists. Use "Overwrite Existing Workspace" to
|
|
61
|
+
replace it.
|
|
62
|
+
</div>
|
|
63
|
+
`,
|
|
64
|
+
)}
|
|
65
|
+
`,
|
|
66
|
+
)}
|
|
67
|
+
${when(
|
|
68
|
+
(x) => x.saveMode === 'overwrite',
|
|
69
|
+
html<WorkspaceManager>`
|
|
70
|
+
${when(
|
|
71
|
+
(x) => x.savedWorkspaces.length === 0,
|
|
72
|
+
html`
|
|
73
|
+
<div class="empty-state">No saved workspaces to overwrite</div>
|
|
74
|
+
`,
|
|
75
|
+
)}
|
|
76
|
+
<rapid-label>Select Workspace to Overwrite:</rapid-label>
|
|
77
|
+
<rapid-radio-group
|
|
78
|
+
class="workspace-list"
|
|
79
|
+
value=${sync((x) => x.selectedWorkspaceToOverwrite)}
|
|
80
|
+
orientation="vertical"
|
|
81
|
+
>
|
|
82
|
+
${repeat(
|
|
83
|
+
(x) => x.savedWorkspaces,
|
|
84
|
+
html<SavedWorkspace>`
|
|
85
|
+
<rapid-radio value=${(x) => x.name} class="workspace-item">
|
|
86
|
+
<div class="workspace-info">
|
|
87
|
+
<div class="workspace-name">${(x) => x.name}</div>
|
|
88
|
+
<div class="workspace-date">
|
|
89
|
+
Saved: ${(x) => new Date(x.savedAt).toLocaleString()}
|
|
90
|
+
</div>
|
|
91
|
+
${when(
|
|
92
|
+
(w) => w.description,
|
|
93
|
+
html<SavedWorkspace>`
|
|
94
|
+
<div class="workspace-description">${(w) => w.description}</div>
|
|
95
|
+
`,
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
</rapid-radio>
|
|
99
|
+
`,
|
|
100
|
+
)}
|
|
101
|
+
</rapid-radio-group>
|
|
102
|
+
<rapid-label>Description (optional):</rapid-label>
|
|
103
|
+
<textarea
|
|
104
|
+
class="save-field workspace-description-input"
|
|
105
|
+
:value=${(x) => x.workspaceDescription}
|
|
106
|
+
@input=${(x, c) =>
|
|
107
|
+
x.updateWorkspaceDescription((c.event.target as HTMLTextAreaElement).value)}
|
|
108
|
+
placeholder="Add a description for this workspace"
|
|
109
|
+
rows="3"
|
|
110
|
+
></textarea>
|
|
111
|
+
<div class="warning-message">
|
|
112
|
+
<rapid-icon name="triangle-exclamation"></rapid-icon>
|
|
113
|
+
This will permanently replace the selected workspace. This action cannot be undone.
|
|
114
|
+
</div>
|
|
115
|
+
`,
|
|
116
|
+
)}
|
|
117
|
+
${when(
|
|
118
|
+
(x) => x.saveMode === 'shared',
|
|
119
|
+
html<WorkspaceManager>`
|
|
120
|
+
<h3>Share existing workspace:</h3>
|
|
121
|
+
${whenElse(
|
|
122
|
+
(x) => x.savedWorkspaces.length === 0,
|
|
123
|
+
html`
|
|
124
|
+
<div class="empty-state">No saved workspaces to share</div>
|
|
125
|
+
`,
|
|
126
|
+
html<WorkspaceManager>`
|
|
127
|
+
<div class="workspace-list">
|
|
128
|
+
${repeat(
|
|
129
|
+
(x) => x.savedWorkspaces,
|
|
130
|
+
html<SavedWorkspace>`
|
|
131
|
+
<div class="workspace-item">
|
|
132
|
+
<div class="workspace-info">
|
|
133
|
+
<div class="workspace-name">${(w) => w.name}</div>
|
|
134
|
+
<div class="workspace-date">
|
|
135
|
+
Saved: ${(w) => new Date(w.savedAt).toLocaleString()}
|
|
136
|
+
</div>
|
|
137
|
+
${when(
|
|
138
|
+
(w) => w.description,
|
|
139
|
+
html<SavedWorkspace>`
|
|
140
|
+
<div class="workspace-description">${(w) => w.description}</div>
|
|
141
|
+
`,
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
144
|
+
<div class="button-group">
|
|
145
|
+
<rapid-button
|
|
146
|
+
appearance="primary"
|
|
147
|
+
@click=${(w, c: ExecutionContext<WorkspaceManager>) =>
|
|
148
|
+
c.parent.shareExistingWorkspace(w.name)}
|
|
149
|
+
>
|
|
150
|
+
Share
|
|
151
|
+
</rapid-button>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
`,
|
|
155
|
+
)}
|
|
156
|
+
</div>
|
|
157
|
+
`,
|
|
158
|
+
)}
|
|
159
|
+
<h3>My Shared Workspaces</h3>
|
|
160
|
+
${whenElse(
|
|
161
|
+
(x) =>
|
|
162
|
+
x.sharedWorkspaces.filter((w) => w.userName === x.auth?.loggedUserResult?.username)
|
|
163
|
+
.length === 0,
|
|
164
|
+
html`
|
|
165
|
+
<div class="empty-state">You have not shared any workspaces</div>
|
|
166
|
+
`,
|
|
167
|
+
html<WorkspaceManager>`
|
|
168
|
+
<div class="workspace-list">
|
|
169
|
+
${repeat(
|
|
170
|
+
(x) =>
|
|
171
|
+
x.sharedWorkspaces.filter(
|
|
172
|
+
(w) => w.userName === x.auth?.loggedUserResult?.username,
|
|
173
|
+
),
|
|
174
|
+
html<SharedWorkspace>`
|
|
175
|
+
<div class="workspace-item">
|
|
176
|
+
<div class="workspace-info">
|
|
177
|
+
<div class="workspace-name">${(w) => w.name}</div>
|
|
178
|
+
<div class="workspace-date">
|
|
179
|
+
Shared on
|
|
180
|
+
${(w) => new Date((w.modifiedOn || w.createdOn) as any).toLocaleString()}
|
|
181
|
+
</div>
|
|
182
|
+
${when(
|
|
183
|
+
(w) => w.description,
|
|
184
|
+
html<SharedWorkspace>`
|
|
185
|
+
<div class="workspace-description">${(w) => w.description}</div>
|
|
186
|
+
`,
|
|
187
|
+
)}
|
|
188
|
+
</div>
|
|
189
|
+
<div class="button-group">
|
|
190
|
+
<rapid-button
|
|
191
|
+
appearance="primary"
|
|
192
|
+
@click=${(w, c: ExecutionContext<WorkspaceManager>) =>
|
|
193
|
+
c.parent.modifySharedWorkspace(w)}
|
|
194
|
+
>
|
|
195
|
+
Save
|
|
196
|
+
</rapid-button>
|
|
197
|
+
<rapid-button
|
|
198
|
+
appearance="danger"
|
|
199
|
+
@click=${(w, c: ExecutionContext<WorkspaceManager>) =>
|
|
200
|
+
c.parent.confirmDeleteSharedWorkspace(w)}
|
|
201
|
+
>
|
|
202
|
+
Delete
|
|
203
|
+
</rapid-button>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
`,
|
|
207
|
+
)}
|
|
208
|
+
</div>
|
|
209
|
+
`,
|
|
210
|
+
)}
|
|
211
|
+
`,
|
|
212
|
+
)}
|
|
213
|
+
<div class="button-group">
|
|
214
|
+
<rapid-button
|
|
215
|
+
@click=${(x) => x.saveWorkspace()}
|
|
216
|
+
appearance="primary"
|
|
217
|
+
?disabled=${(x) =>
|
|
218
|
+
(x.saveMode === 'create' && !x.workspaceName.trim()) ||
|
|
219
|
+
(x.saveMode === 'overwrite' && !x.selectedWorkspaceToOverwrite) ||
|
|
220
|
+
x.saveMode === 'shared' ||
|
|
221
|
+
(x.workspaceName && x.isWorkspaceExisting(x.workspaceName))}
|
|
222
|
+
>
|
|
223
|
+
${(x) =>
|
|
224
|
+
x.saveMode === 'create' ? 'Create' : x.saveMode === 'overwrite' ? 'Overwrite' : 'Save'}
|
|
225
|
+
</rapid-button>
|
|
226
|
+
<rapid-button appearance="outline" @click=${(x) => x.closeSaveDialog()}>
|
|
227
|
+
Cancel
|
|
228
|
+
</rapid-button>
|
|
229
|
+
</div>
|
|
230
|
+
<div class="workspace-dialog-boundary" ${ref('sharedWorkspaceDialogBoundary')}></div>
|
|
231
|
+
</div>
|
|
232
|
+
</rapid-modal>
|
|
233
|
+
<rapid-modal ${ref('loadModal')}>
|
|
234
|
+
<h2 slot="top">Load Workspace</h2>
|
|
235
|
+
<div class="dialog-content">
|
|
236
|
+
${when(
|
|
237
|
+
(x) => x.applyingWorkspace || x.isLoading,
|
|
238
|
+
html`
|
|
239
|
+
<div class="loading-container">
|
|
240
|
+
<div>Loading...</div>
|
|
241
|
+
</div>
|
|
242
|
+
`,
|
|
243
|
+
)}
|
|
244
|
+
${when(
|
|
245
|
+
(x) => !x.applyingWorkspace,
|
|
246
|
+
html<WorkspaceManager>`
|
|
247
|
+
<rapid-segmented-control value="${sync((x) => x.loadMode)}">
|
|
248
|
+
<rapid-segmented-item value="MY">My Workspaces</rapid-segmented-item>
|
|
249
|
+
<rapid-segmented-item value="SHARED">Shared Workspaces</rapid-segmented-item>
|
|
250
|
+
</rapid-segmented-control>
|
|
251
|
+
${when(
|
|
252
|
+
(x) => x.loadMode === 'MY',
|
|
253
|
+
html`
|
|
254
|
+
<div class="workspace-list">
|
|
255
|
+
${repeat(
|
|
256
|
+
(x) => x.savedWorkspaces,
|
|
257
|
+
html<SavedWorkspace>`
|
|
258
|
+
<div class="workspace-item">
|
|
259
|
+
<div class="workspace-info">
|
|
260
|
+
<div class="workspace-name">${(w) => w.name}</div>
|
|
261
|
+
<div class="workspace-date">
|
|
262
|
+
Saved: ${(w) => new Date(w.savedAt).toLocaleString()}
|
|
263
|
+
</div>
|
|
264
|
+
${when(
|
|
265
|
+
(w) => w.description,
|
|
266
|
+
html<SavedWorkspace>`
|
|
267
|
+
<div class="workspace-description">${(w) => w.description}</div>
|
|
268
|
+
`,
|
|
269
|
+
)}
|
|
270
|
+
</div>
|
|
271
|
+
<div class="button-group">
|
|
272
|
+
<rapid-button
|
|
273
|
+
appearance="primary"
|
|
274
|
+
@click=${(w, c: ExecutionContext<WorkspaceManager>) =>
|
|
275
|
+
c.parent.loadWorkspace(w.name)}
|
|
276
|
+
>
|
|
277
|
+
Load
|
|
278
|
+
</rapid-button>
|
|
279
|
+
<rapid-button
|
|
280
|
+
appearance="danger"
|
|
281
|
+
@click=${(w, c: ExecutionContext<WorkspaceManager>) =>
|
|
282
|
+
c.parent.confirmDeleteWorkspace(w.name)}
|
|
283
|
+
>
|
|
284
|
+
Delete
|
|
285
|
+
</rapid-button>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
`,
|
|
289
|
+
)}
|
|
290
|
+
${when(
|
|
291
|
+
(x) => x.savedWorkspaces.length === 0,
|
|
292
|
+
html`
|
|
293
|
+
<div class="empty-state">No saved workspaces found</div>
|
|
294
|
+
`,
|
|
295
|
+
)}
|
|
296
|
+
</div>
|
|
297
|
+
`,
|
|
298
|
+
)}
|
|
299
|
+
${when(
|
|
300
|
+
(x) => x.loadMode === 'SHARED',
|
|
301
|
+
html`
|
|
302
|
+
<div class="workspace-section">
|
|
303
|
+
<div class="workspace-list">
|
|
304
|
+
${repeat(
|
|
305
|
+
(x) => x.sharedWorkspaces,
|
|
306
|
+
html<SharedWorkspace>`
|
|
307
|
+
<div class="workspace-item">
|
|
308
|
+
<div class="workspace-info">
|
|
309
|
+
<div class="workspace-name">${(w) => w.name}</div>
|
|
310
|
+
<div class="workspace-date">
|
|
311
|
+
Shared by ${(w) => w.userName} ·
|
|
312
|
+
${(w) =>
|
|
313
|
+
new Date((w.modifiedOn || w.createdOn) as any).toLocaleString()}
|
|
314
|
+
</div>
|
|
315
|
+
${when(
|
|
316
|
+
(w) => w.description,
|
|
317
|
+
html<SharedWorkspace>`
|
|
318
|
+
<div class="workspace-description">${(w) => w.description}</div>
|
|
319
|
+
`,
|
|
320
|
+
)}
|
|
321
|
+
</div>
|
|
322
|
+
<div class="button-group">
|
|
323
|
+
<rapid-button
|
|
324
|
+
appearance="primary"
|
|
325
|
+
@click=${(w, c: ExecutionContext<WorkspaceManager>) =>
|
|
326
|
+
c.parent.loadSharedWorkspace(w)}
|
|
327
|
+
>
|
|
328
|
+
Load
|
|
329
|
+
</rapid-button>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
`,
|
|
333
|
+
)}
|
|
334
|
+
</div>
|
|
335
|
+
${when(
|
|
336
|
+
(x) => x.sharedWorkspaces.length === 0,
|
|
337
|
+
html`
|
|
338
|
+
<div class="empty-state">No shared workspaces available</div>
|
|
339
|
+
`,
|
|
340
|
+
)}
|
|
341
|
+
</div>
|
|
342
|
+
`,
|
|
343
|
+
)}
|
|
344
|
+
`,
|
|
345
|
+
)}
|
|
346
|
+
<div class="button-group">
|
|
347
|
+
<rapid-button appearance="outline" @click=${(x) => x.closeLoadDialog()}>Close</rapid-button>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
<div class="workspace-dialog-boundary" ${ref('dialogBoundary')}></div>
|
|
351
|
+
</rapid-modal>
|
|
352
|
+
`;
|