@genesislcap/foundation-ui 14.406.0-workspaces.1 → 14.406.0-workspaces.2

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.
@@ -54461,13 +54461,29 @@
54461
54461
  "kind": "javascript-module",
54462
54462
  "path": "src/workspace-manager/workspace-manager.template.ts",
54463
54463
  "declarations": [
54464
+ {
54465
+ "kind": "variable",
54466
+ "name": "WORKSPACE_DESCRIPTION_MAX",
54467
+ "type": {
54468
+ "text": "number"
54469
+ },
54470
+ "default": "200"
54471
+ },
54464
54472
  {
54465
54473
  "kind": "variable",
54466
54474
  "name": "WorkspaceManagerTemplate",
54467
- "default": "html<WorkspaceManager>`\n <div class=\"workspace-manager\">\n <rapid-button @click=${(x) => x.openSaveDialog()}>\n <rapid-icon name=\"download\"></rapid-icon>\n Save Workspace\n </rapid-button>\n <rapid-button @click=${(x) => x.openLoadDialog()}>\n <rapid-icon name=\"upload\"></rapid-icon>\n Load Workspace\n </rapid-button>\n </div>\n <rapid-modal ${ref('saveModal')}>\n <h2 slot=\"top\">Save Workspace</h2>\n <div class=\"dialog-content\">\n <div class=\"save-mode-selector\">\n <rapid-segmented-control value=\"${sync((x) => x.saveMode)}\">\n <rapid-segmented-item value=\"create\">Create</rapid-segmented-item>\n <rapid-segmented-item value=\"overwrite\">Overwrite</rapid-segmented-item>\n ${when(\n (x) => x.canShareWorkspace,\n html<WorkspaceManager>`\n <rapid-segmented-item value=\"shared\">Share</rapid-segmented-item>\n `,\n )}\n </rapid-segmented-control>\n </div>\n ${when(\n (x) => x.saveMode === 'create',\n html<WorkspaceManager>`\n <rapid-label>Workspace Name:</rapid-label>\n <rapid-text-field\n class=\"save-field\"\n :value=${(x) => x.workspaceName}\n @input=${(x, c) => (x.workspaceName = (c.event.target as HTMLInputElement).value)}\n placeholder=\"Enter workspace name\"\n ></rapid-text-field>\n <rapid-label>Description (optional):</rapid-label>\n <textarea\n class=\"save-field workspace-description-input\"\n :value=${(x) => x.workspaceDescription}\n @input=${(x, c) =>\n (x.workspaceDescription = (c.event.target as HTMLTextAreaElement).value)}\n placeholder=\"Add a description for this workspace\"\n rows=\"3\"\n ></textarea>\n ${when(\n (x) => x.workspaceName && x.isWorkspaceExisting(x.workspaceName),\n html`\n <div class=\"warning-message\">\n <rapid-icon name=\"triangle-exclamation\"></rapid-icon>\n A workspace with this name already exists. Use \"Overwrite Existing Workspace\" to\n replace it.\n </div>\n `,\n )}\n `,\n )}\n ${when(\n (x) => x.saveMode === 'overwrite',\n html<WorkspaceManager>`\n ${when(\n (x) => x.savedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No saved workspaces to overwrite</div>\n `,\n )}\n <rapid-label>Select Workspace to Overwrite:</rapid-label>\n <rapid-radio-group\n class=\"workspace-list\"\n value=${sync((x) => x.selectedWorkspaceToOverwrite)}\n orientation=\"vertical\"\n >\n ${repeat(\n (x) => x.savedWorkspaces,\n html<SavedWorkspace>`\n <rapid-radio value=${(x) => x.name} class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(x) => x.name}</div>\n <div class=\"workspace-date\">\n Saved: ${(x) => new Date(x.savedAt).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SavedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n </rapid-radio>\n `,\n )}\n </rapid-radio-group>\n <div class=\"warning-message\">\n <rapid-icon name=\"triangle-exclamation\"></rapid-icon>\n This will permanently replace the selected workspace. This action cannot be undone.\n </div>\n `,\n )}\n ${when(\n (x) => x.saveMode === 'shared',\n html<WorkspaceManager>`\n <h3>Share existing workspace:</h3>\n ${whenElse(\n (x) => x.savedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No saved workspaces to share</div>\n `,\n html<WorkspaceManager>`\n <div class=\"workspace-list\">\n ${repeat(\n (x) => x.savedWorkspaces,\n html<SavedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Saved: ${(w) => new Date(w.savedAt).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SavedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.shareExistingWorkspace(w.name)}\n >\n Share\n </rapid-button>\n </div>\n </div>\n `,\n )}\n </div>\n `,\n )}\n <h3>My Shared Workspaces</h3>\n ${whenElse(\n (x) =>\n x.sharedWorkspaces.filter((w) => w.userName === x.auth?.loggedUserResult?.username)\n .length === 0,\n html`\n <div class=\"empty-state\">You have not shared any workspaces</div>\n `,\n html<WorkspaceManager>`\n <div class=\"workspace-list\">\n ${repeat(\n (x) =>\n x.sharedWorkspaces.filter(\n (w) => w.userName === x.auth?.loggedUserResult?.username,\n ),\n html<SharedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Shared on\n ${(w) => new Date((w.modifiedOn || w.createdOn) as any).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SharedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.modifySharedWorkspace(w)}\n >\n Save\n </rapid-button>\n <rapid-button\n appearance=\"danger\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.confirmDeleteSharedWorkspace(w)}\n >\n Delete\n </rapid-button>\n </div>\n </div>\n `,\n )}\n </div>\n `,\n )}\n `,\n )}\n <div class=\"button-group\">\n <rapid-button\n @click=${(x) => x.saveWorkspace()}\n appearance=\"primary\"\n ?disabled=${(x) =>\n (x.saveMode === 'create' && !x.workspaceName.trim()) ||\n (x.saveMode === 'overwrite' && !x.selectedWorkspaceToOverwrite) ||\n x.saveMode === 'shared' ||\n (x.workspaceName && x.isWorkspaceExisting(x.workspaceName))}\n >\n ${(x) =>\n x.saveMode === 'create' ? 'Create' : x.saveMode === 'overwrite' ? 'Overwrite' : 'Save'}\n </rapid-button>\n <rapid-button appearance=\"outline\" @click=${(x) => x.closeSaveDialog()}>\n Cancel\n </rapid-button>\n </div>\n <div class=\"workspace-dialog-boundary\" ${ref('sharedWorkspaceDialogBoundary')}></div>\n </div>\n </rapid-modal>\n <rapid-modal ${ref('loadModal')}>\n <h2 slot=\"top\">Load Workspace</h2>\n <div class=\"dialog-content\">\n ${when(\n (x) => x.applyingWorkspace || x.isLoading,\n html`\n <div class=\"loading-container\">\n <div>Loading...</div>\n </div>\n `,\n )}\n ${when(\n (x) => !x.applyingWorkspace,\n html<WorkspaceManager>`\n <rapid-segmented-control value=\"${sync((x) => x.loadMode)}\">\n <rapid-segmented-item value=\"MY\">My Workspaces</rapid-segmented-item>\n <rapid-segmented-item value=\"SHARED\">Shared Workspaces</rapid-segmented-item>\n </rapid-segmented-control>\n ${when(\n (x) => x.loadMode === 'MY',\n html`\n <div class=\"workspace-list\">\n ${repeat(\n (x) => x.savedWorkspaces,\n html<SavedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Saved: ${(w) => new Date(w.savedAt).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SavedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.loadWorkspace(w.name)}\n >\n Load\n </rapid-button>\n <rapid-button\n appearance=\"danger\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.confirmDeleteWorkspace(w.name)}\n >\n Delete\n </rapid-button>\n </div>\n </div>\n `,\n )}\n ${when(\n (x) => x.savedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No saved workspaces found</div>\n `,\n )}\n </div>\n `,\n )}\n ${when(\n (x) => x.loadMode === 'SHARED',\n html`\n <div class=\"workspace-section\">\n <div class=\"workspace-list\">\n ${repeat(\n (x) => x.sharedWorkspaces,\n html<SharedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Shared by ${(w) => w.userName} ·\n ${(w) =>\n new Date((w.modifiedOn || w.createdOn) as any).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SharedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.loadSharedWorkspace(w)}\n >\n Load\n </rapid-button>\n </div>\n </div>\n `,\n )}\n </div>\n ${when(\n (x) => x.sharedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No shared workspaces available</div>\n `,\n )}\n </div>\n `,\n )}\n `,\n )}\n <div class=\"button-group\">\n <rapid-button appearance=\"outline\" @click=${(x) => x.closeLoadDialog()}>Close</rapid-button>\n </div>\n </div>\n <div class=\"workspace-dialog-boundary\" ${ref('dialogBoundary')}></div>\n </rapid-modal>\n`"
54475
+ "default": "html<WorkspaceManager>`\n <div class=\"workspace-manager\">\n <rapid-button @click=${(x) => x.openSaveDialog()}>\n <rapid-icon name=\"download\"></rapid-icon>\n Save Workspace\n </rapid-button>\n <rapid-button @click=${(x) => x.openLoadDialog()}>\n <rapid-icon name=\"upload\"></rapid-icon>\n Load Workspace\n </rapid-button>\n </div>\n <rapid-modal ${ref('saveModal')}>\n <h2 slot=\"top\">Save Workspace</h2>\n <div class=\"dialog-content\">\n <div class=\"save-mode-selector\">\n <rapid-segmented-control value=\"${sync((x) => x.saveMode)}\">\n <rapid-segmented-item value=\"create\">Create</rapid-segmented-item>\n <rapid-segmented-item value=\"overwrite\">Overwrite</rapid-segmented-item>\n ${when(\n (x) => x.canShareWorkspace,\n html<WorkspaceManager>`\n <rapid-segmented-item value=\"shared\">Share</rapid-segmented-item>\n `,\n )}\n </rapid-segmented-control>\n </div>\n ${when(\n (x) => x.saveMode === 'create',\n html<WorkspaceManager>`\n <rapid-label>Workspace Name:</rapid-label>\n <rapid-text-field\n class=\"save-field\"\n :value=${(x) => x.workspaceName}\n @input=${(x, c) => (x.workspaceName = (c.event.target as HTMLInputElement).value)}\n placeholder=\"Enter workspace name\"\n ></rapid-text-field>\n <rapid-label>\n Description (optional, max ${WORKSPACE_DESCRIPTION_MAX} characters):\n </rapid-label>\n <textarea\n class=\"save-field workspace-description-input\"\n :value=${(x) => x.workspaceDescription}\n @input=${(x, c) =>\n x.updateWorkspaceDescription((c.event.target as HTMLTextAreaElement).value)}\n placeholder=\"Add a description for this workspace\"\n rows=\"3\"\n ></textarea>\n ${when(\n (x) => x.workspaceName && x.isWorkspaceExisting(x.workspaceName),\n html`\n <div class=\"warning-message\">\n <rapid-icon name=\"triangle-exclamation\"></rapid-icon>\n A workspace with this name already exists. Use \"Overwrite Existing Workspace\" to\n replace it.\n </div>\n `,\n )}\n `,\n )}\n ${when(\n (x) => x.saveMode === 'overwrite',\n html<WorkspaceManager>`\n ${when(\n (x) => x.savedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No saved workspaces to overwrite</div>\n `,\n )}\n <rapid-label>Select Workspace to Overwrite:</rapid-label>\n <rapid-radio-group\n class=\"workspace-list\"\n value=${sync((x) => x.selectedWorkspaceToOverwrite)}\n orientation=\"vertical\"\n >\n ${repeat(\n (x) => x.savedWorkspaces,\n html<SavedWorkspace>`\n <rapid-radio value=${(x) => x.name} class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(x) => x.name}</div>\n <div class=\"workspace-date\">\n Saved: ${(x) => new Date(x.savedAt).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SavedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n </rapid-radio>\n `,\n )}\n </rapid-radio-group>\n <rapid-label>Description (optional):</rapid-label>\n <textarea\n class=\"save-field workspace-description-input\"\n :value=${(x) => x.workspaceDescription}\n @input=${(x, c) =>\n x.updateWorkspaceDescription((c.event.target as HTMLTextAreaElement).value)}\n placeholder=\"Add a description for this workspace\"\n rows=\"3\"\n ></textarea>\n <div class=\"warning-message\">\n <rapid-icon name=\"triangle-exclamation\"></rapid-icon>\n This will permanently replace the selected workspace. This action cannot be undone.\n </div>\n `,\n )}\n ${when(\n (x) => x.saveMode === 'shared',\n html<WorkspaceManager>`\n <h3>Share existing workspace:</h3>\n ${whenElse(\n (x) => x.savedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No saved workspaces to share</div>\n `,\n html<WorkspaceManager>`\n <div class=\"workspace-list\">\n ${repeat(\n (x) => x.savedWorkspaces,\n html<SavedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Saved: ${(w) => new Date(w.savedAt).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SavedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.shareExistingWorkspace(w.name)}\n >\n Share\n </rapid-button>\n </div>\n </div>\n `,\n )}\n </div>\n `,\n )}\n <h3>My Shared Workspaces</h3>\n ${whenElse(\n (x) =>\n x.sharedWorkspaces.filter((w) => w.userName === x.auth?.loggedUserResult?.username)\n .length === 0,\n html`\n <div class=\"empty-state\">You have not shared any workspaces</div>\n `,\n html<WorkspaceManager>`\n <div class=\"workspace-list\">\n ${repeat(\n (x) =>\n x.sharedWorkspaces.filter(\n (w) => w.userName === x.auth?.loggedUserResult?.username,\n ),\n html<SharedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Shared on\n ${(w) => new Date((w.modifiedOn || w.createdOn) as any).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SharedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.modifySharedWorkspace(w)}\n >\n Save\n </rapid-button>\n <rapid-button\n appearance=\"danger\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.confirmDeleteSharedWorkspace(w)}\n >\n Delete\n </rapid-button>\n </div>\n </div>\n `,\n )}\n </div>\n `,\n )}\n `,\n )}\n <div class=\"button-group\">\n <rapid-button\n @click=${(x) => x.saveWorkspace()}\n appearance=\"primary\"\n ?disabled=${(x) =>\n (x.saveMode === 'create' && !x.workspaceName.trim()) ||\n (x.saveMode === 'overwrite' && !x.selectedWorkspaceToOverwrite) ||\n x.saveMode === 'shared' ||\n (x.workspaceName && x.isWorkspaceExisting(x.workspaceName))}\n >\n ${(x) =>\n x.saveMode === 'create' ? 'Create' : x.saveMode === 'overwrite' ? 'Overwrite' : 'Save'}\n </rapid-button>\n <rapid-button appearance=\"outline\" @click=${(x) => x.closeSaveDialog()}>\n Cancel\n </rapid-button>\n </div>\n <div class=\"workspace-dialog-boundary\" ${ref('sharedWorkspaceDialogBoundary')}></div>\n </div>\n </rapid-modal>\n <rapid-modal ${ref('loadModal')}>\n <h2 slot=\"top\">Load Workspace</h2>\n <div class=\"dialog-content\">\n ${when(\n (x) => x.applyingWorkspace || x.isLoading,\n html`\n <div class=\"loading-container\">\n <div>Loading...</div>\n </div>\n `,\n )}\n ${when(\n (x) => !x.applyingWorkspace,\n html<WorkspaceManager>`\n <rapid-segmented-control value=\"${sync((x) => x.loadMode)}\">\n <rapid-segmented-item value=\"MY\">My Workspaces</rapid-segmented-item>\n <rapid-segmented-item value=\"SHARED\">Shared Workspaces</rapid-segmented-item>\n </rapid-segmented-control>\n ${when(\n (x) => x.loadMode === 'MY',\n html`\n <div class=\"workspace-list\">\n ${repeat(\n (x) => x.savedWorkspaces,\n html<SavedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Saved: ${(w) => new Date(w.savedAt).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SavedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.loadWorkspace(w.name)}\n >\n Load\n </rapid-button>\n <rapid-button\n appearance=\"danger\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.confirmDeleteWorkspace(w.name)}\n >\n Delete\n </rapid-button>\n </div>\n </div>\n `,\n )}\n ${when(\n (x) => x.savedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No saved workspaces found</div>\n `,\n )}\n </div>\n `,\n )}\n ${when(\n (x) => x.loadMode === 'SHARED',\n html`\n <div class=\"workspace-section\">\n <div class=\"workspace-list\">\n ${repeat(\n (x) => x.sharedWorkspaces,\n html<SharedWorkspace>`\n <div class=\"workspace-item\">\n <div class=\"workspace-info\">\n <div class=\"workspace-name\">${(w) => w.name}</div>\n <div class=\"workspace-date\">\n Shared by ${(w) => w.userName} ·\n ${(w) =>\n new Date((w.modifiedOn || w.createdOn) as any).toLocaleString()}\n </div>\n ${when(\n (w) => w.description,\n html<SharedWorkspace>`\n <div class=\"workspace-description\">${(w) => w.description}</div>\n `,\n )}\n </div>\n <div class=\"button-group\">\n <rapid-button\n appearance=\"primary\"\n @click=${(w, c: ExecutionContext<WorkspaceManager>) =>\n c.parent.loadSharedWorkspace(w)}\n >\n Load\n </rapid-button>\n </div>\n </div>\n `,\n )}\n </div>\n ${when(\n (x) => x.sharedWorkspaces.length === 0,\n html`\n <div class=\"empty-state\">No shared workspaces available</div>\n `,\n )}\n </div>\n `,\n )}\n `,\n )}\n <div class=\"button-group\">\n <rapid-button appearance=\"outline\" @click=${(x) => x.closeLoadDialog()}>Close</rapid-button>\n </div>\n </div>\n <div class=\"workspace-dialog-boundary\" ${ref('dialogBoundary')}></div>\n </rapid-modal>\n`"
54468
54476
  }
54469
54477
  ],
54470
54478
  "exports": [
54479
+ {
54480
+ "kind": "js",
54481
+ "name": "WORKSPACE_DESCRIPTION_MAX",
54482
+ "declaration": {
54483
+ "name": "WORKSPACE_DESCRIPTION_MAX",
54484
+ "module": "src/workspace-manager/workspace-manager.template.ts"
54485
+ }
54486
+ },
54471
54487
  {
54472
54488
  "kind": "js",
54473
54489
  "name": "WorkspaceManagerTemplate",
@@ -54644,6 +54660,51 @@
54644
54660
  "text": "boolean"
54645
54661
  }
54646
54662
  },
54663
+ {
54664
+ "kind": "method",
54665
+ "name": "sanitizeDescription",
54666
+ "privacy": "private",
54667
+ "return": {
54668
+ "type": {
54669
+ "text": "string"
54670
+ }
54671
+ },
54672
+ "parameters": [
54673
+ {
54674
+ "name": "input",
54675
+ "type": {
54676
+ "text": "string"
54677
+ }
54678
+ }
54679
+ ]
54680
+ },
54681
+ {
54682
+ "kind": "method",
54683
+ "name": "updateWorkspaceDescription",
54684
+ "return": {
54685
+ "type": {
54686
+ "text": "void"
54687
+ }
54688
+ },
54689
+ "parameters": [
54690
+ {
54691
+ "name": "raw",
54692
+ "type": {
54693
+ "text": "string"
54694
+ }
54695
+ }
54696
+ ]
54697
+ },
54698
+ {
54699
+ "kind": "method",
54700
+ "name": "setDescriptionFromSelectedWorkspace",
54701
+ "privacy": "private",
54702
+ "return": {
54703
+ "type": {
54704
+ "text": "void"
54705
+ }
54706
+ }
54707
+ },
54647
54708
  {
54648
54709
  "kind": "method",
54649
54710
  "name": "refreshSavedWorkspaces",
@@ -54944,6 +55005,29 @@
54944
55005
  }
54945
55006
  ]
54946
55007
  },
55008
+ {
55009
+ "kind": "method",
55010
+ "name": "selectedWorkspaceToOverwriteChanged",
55011
+ "return": {
55012
+ "type": {
55013
+ "text": "void"
55014
+ }
55015
+ },
55016
+ "parameters": [
55017
+ {
55018
+ "name": "oldValue",
55019
+ "type": {
55020
+ "text": "string"
55021
+ }
55022
+ },
55023
+ {
55024
+ "name": "newValue",
55025
+ "type": {
55026
+ "text": "string"
55027
+ }
55028
+ }
55029
+ ]
55030
+ },
54947
55031
  {
54948
55032
  "kind": "method",
54949
55033
  "name": "openLoadDialog",
@@ -25,6 +25,9 @@ export declare class WorkspaceManager extends FoundationElement {
25
25
  connect: Connect;
26
26
  auth: Auth;
27
27
  canShareWorkspace: boolean;
28
+ private sanitizeDescription;
29
+ updateWorkspaceDescription(raw: string): void;
30
+ private setDescriptionFromSelectedWorkspace;
28
31
  connectedCallback(): Promise<void>;
29
32
  refreshSavedWorkspaces(): Promise<void>;
30
33
  refreshSharedWorkspaces(): Promise<void>;
@@ -51,6 +54,7 @@ export declare class WorkspaceManager extends FoundationElement {
51
54
  openSaveDialog(): Promise<void>;
52
55
  isWorkspaceExisting(workspaceName: string): boolean;
53
56
  saveModeChanged(oldValue: string, newValue: string): void;
57
+ selectedWorkspaceToOverwriteChanged(oldValue: string, newValue: string): void;
54
58
  openLoadDialog(): void;
55
59
  closeSaveDialog(): void;
56
60
  closeLoadDialog(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-manager.d.ts","sourceRoot":"","sources":["../../../src/workspace-manager/workspace-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAM9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;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} from './workspace-manager';
2
+ export declare const WORKSPACE_DESCRIPTION_MAX = 200;
2
3
  export declare const WorkspaceManagerTemplate: import("@microsoft/fast-element").ViewTemplate<WorkspaceManager, any>;
3
4
  //# sourceMappingURL=workspace-manager.template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-manager.template.d.ts","sourceRoot":"","sources":["../../../src/workspace-manager/workspace-manager.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,wBAAwB,uEA6UpC,CAAC"}
1
+ {"version":3,"file":"workspace-manager.template.d.ts","sourceRoot":"","sources":["../../../src/workspace-manager/workspace-manager.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,eAAO,MAAM,wBAAwB,uEAwVpC,CAAC"}
@@ -5,7 +5,7 @@ import { customElement, observable } from '@microsoft/fast-element';
5
5
  import { FoundationElement } from '@microsoft/fast-foundation';
6
6
  import { LayoutRegistry, GridRegistry, FilterRegistry, WorkspaceState, } from '../workspace';
7
7
  import { WorkspaceManagerStyles as styles } from './workspace-manager.styles';
8
- import { WorkspaceManagerTemplate as template } from './workspace-manager.template';
8
+ import { WORKSPACE_DESCRIPTION_MAX, WorkspaceManagerTemplate as template, } from './workspace-manager.template';
9
9
  let WorkspaceManager = class WorkspaceManager extends FoundationElement {
10
10
  constructor() {
11
11
  super(...arguments);
@@ -20,6 +20,28 @@ let WorkspaceManager = class WorkspaceManager extends FoundationElement {
20
20
  this.selectedWorkspaceToOverwrite = '';
21
21
  this.workspaceToShare = '';
22
22
  }
23
+ sanitizeDescription(input) {
24
+ const cleaned = (input !== null && input !== void 0 ? input : '')
25
+ // allow only letters, numbers and whitespace
26
+ .replace(/[^a-zA-Z0-9\s]/g, '')
27
+ // normalise whitespace
28
+ .replace(/\s+/g, ' ')
29
+ .trim();
30
+ return cleaned.slice(0, WORKSPACE_DESCRIPTION_MAX);
31
+ }
32
+ updateWorkspaceDescription(raw) {
33
+ this.workspaceDescription = this.sanitizeDescription(raw);
34
+ }
35
+ setDescriptionFromSelectedWorkspace() {
36
+ var _a, _b;
37
+ const name = (_a = this.selectedWorkspaceToOverwrite) === null || _a === void 0 ? void 0 : _a.trim();
38
+ if (!name) {
39
+ this.workspaceDescription = '';
40
+ return;
41
+ }
42
+ const existing = this.savedWorkspaces.find((w) => w.name === name);
43
+ this.workspaceDescription = this.sanitizeDescription((_b = existing === null || existing === void 0 ? void 0 : existing.description) !== null && _b !== void 0 ? _b : '');
44
+ }
23
45
  connectedCallback() {
24
46
  const _super = Object.create(null, {
25
47
  connectedCallback: { get: () => super.connectedCallback }
@@ -202,10 +224,13 @@ let WorkspaceManager = class WorkspaceManager extends FoundationElement {
202
224
  const layouts = this.layoutRegistry.getLayoutsConfigs();
203
225
  const grids = this.gridRegistry.getAllGridsSettings();
204
226
  const filters = this.filterRegistry.getAllFiltersValues();
227
+ const baseWorkspace = yield this.workspaceState.loadWorkspace(sharedWorkspace.name);
228
+ const description = this.sanitizeDescription((_b = (_a = baseWorkspace === null || baseWorkspace === void 0 ? void 0 : baseWorkspace.description) !== null && _a !== void 0 ? _a : sharedWorkspace.description) !== null && _b !== void 0 ? _b : '') ||
229
+ undefined;
205
230
  const workspace = {
206
231
  name: sharedWorkspace.name,
207
232
  username: sharedWorkspace.userName,
208
- description: sharedWorkspace.description,
233
+ description,
209
234
  layouts,
210
235
  grids,
211
236
  filters,
@@ -216,7 +241,7 @@ let WorkspaceManager = class WorkspaceManager extends FoundationElement {
216
241
  DETAILS: {
217
242
  WORKSPACE_NAME: sharedWorkspace.name,
218
243
  WORKSPACE_DATA: JSON.stringify(workspace),
219
- WORKSPACE_DESCRIPTION: (_b = (_a = workspace.description) !== null && _a !== void 0 ? _a : sharedWorkspace.description) !== null && _b !== void 0 ? _b : null,
244
+ WORKSPACE_DESCRIPTION: description !== null && description !== void 0 ? description : null,
220
245
  },
221
246
  });
222
247
  if (response.MESSAGE_TYPE == 'EVENT_ACK') {
@@ -304,13 +329,21 @@ let WorkspaceManager = class WorkspaceManager extends FoundationElement {
304
329
  saveModeChanged(oldValue, newValue) {
305
330
  if (newValue === 'create') {
306
331
  this.selectedWorkspaceToOverwrite = '';
332
+ this.workspaceDescription = '';
307
333
  }
308
334
  else if (newValue === 'overwrite') {
309
335
  this.workspaceName = '';
336
+ this.setDescriptionFromSelectedWorkspace();
310
337
  }
311
338
  else if (newValue === 'shared') {
312
339
  this.workspaceName = '';
313
340
  this.selectedWorkspaceToOverwrite = '';
341
+ this.workspaceDescription = '';
342
+ }
343
+ }
344
+ selectedWorkspaceToOverwriteChanged(oldValue, newValue) {
345
+ if (this.saveMode === 'overwrite') {
346
+ this.setDescriptionFromSelectedWorkspace();
314
347
  }
315
348
  }
316
349
  openLoadDialog() {
@@ -1,5 +1,6 @@
1
1
  import { sync, whenElse } from '@genesislcap/foundation-utils';
2
2
  import { html, ref, repeat, when } from '@microsoft/fast-element';
3
+ export const WORKSPACE_DESCRIPTION_MAX = 200;
3
4
  export const WorkspaceManagerTemplate = html `
4
5
  <div class="workspace-manager">
5
6
  <rapid-button @click=${(x) => x.openSaveDialog()}>
@@ -31,11 +32,13 @@ export const WorkspaceManagerTemplate = html `
31
32
  @input=${(x, c) => (x.workspaceName = c.event.target.value)}
32
33
  placeholder="Enter workspace name"
33
34
  ></rapid-text-field>
34
- <rapid-label>Description (optional):</rapid-label>
35
+ <rapid-label>
36
+ Description (optional, max ${WORKSPACE_DESCRIPTION_MAX} characters):
37
+ </rapid-label>
35
38
  <textarea
36
39
  class="save-field workspace-description-input"
37
40
  :value=${(x) => x.workspaceDescription}
38
- @input=${(x, c) => (x.workspaceDescription = c.event.target.value)}
41
+ @input=${(x, c) => x.updateWorkspaceDescription(c.event.target.value)}
39
42
  placeholder="Add a description for this workspace"
40
43
  rows="3"
41
44
  ></textarea>
@@ -71,6 +74,14 @@ export const WorkspaceManagerTemplate = html `
71
74
  </rapid-radio>
72
75
  `)}
73
76
  </rapid-radio-group>
77
+ <rapid-label>Description (optional):</rapid-label>
78
+ <textarea
79
+ class="save-field workspace-description-input"
80
+ :value=${(x) => x.workspaceDescription}
81
+ @input=${(x, c) => x.updateWorkspaceDescription(c.event.target.value)}
82
+ placeholder="Add a description for this workspace"
83
+ rows="3"
84
+ ></textarea>
74
85
  <div class="warning-message">
75
86
  <rapid-icon name="triangle-exclamation"></rapid-icon>
76
87
  This will permanently replace the selected workspace. This action cannot be undone.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-ui",
3
3
  "description": "Genesis Foundation UI",
4
- "version": "14.406.0-workspaces.1",
4
+ "version": "14.406.0-workspaces.2",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -85,13 +85,13 @@
85
85
  }
86
86
  },
87
87
  "devDependencies": {
88
- "@genesislcap/foundation-testing": "14.406.0-workspaces.1",
89
- "@genesislcap/genx": "14.406.0-workspaces.1",
90
- "@genesislcap/rollup-builder": "14.406.0-workspaces.1",
91
- "@genesislcap/ts-builder": "14.406.0-workspaces.1",
92
- "@genesislcap/uvu-playwright-builder": "14.406.0-workspaces.1",
93
- "@genesislcap/vite-builder": "14.406.0-workspaces.1",
94
- "@genesislcap/webpack-builder": "14.406.0-workspaces.1",
88
+ "@genesislcap/foundation-testing": "14.406.0-workspaces.2",
89
+ "@genesislcap/genx": "14.406.0-workspaces.2",
90
+ "@genesislcap/rollup-builder": "14.406.0-workspaces.2",
91
+ "@genesislcap/ts-builder": "14.406.0-workspaces.2",
92
+ "@genesislcap/uvu-playwright-builder": "14.406.0-workspaces.2",
93
+ "@genesislcap/vite-builder": "14.406.0-workspaces.2",
94
+ "@genesislcap/webpack-builder": "14.406.0-workspaces.2",
95
95
  "copyfiles": "^2.4.1"
96
96
  },
97
97
  "dependencies": {
@@ -100,16 +100,16 @@
100
100
  "@fortawesome/free-regular-svg-icons": "^6.2.1",
101
101
  "@fortawesome/free-solid-svg-icons": "^6.2.1",
102
102
  "@genesiscommunitysuccess/analyzer-import-alias-plugin": "^5.0.3",
103
- "@genesislcap/expression-builder": "14.406.0-workspaces.1",
104
- "@genesislcap/foundation-ai": "14.406.0-workspaces.1",
105
- "@genesislcap/foundation-comms": "14.406.0-workspaces.1",
106
- "@genesislcap/foundation-criteria": "14.406.0-workspaces.1",
107
- "@genesislcap/foundation-errors": "14.406.0-workspaces.1",
108
- "@genesislcap/foundation-events": "14.406.0-workspaces.1",
109
- "@genesislcap/foundation-logger": "14.406.0-workspaces.1",
110
- "@genesislcap/foundation-notifications": "14.406.0-workspaces.1",
111
- "@genesislcap/foundation-user": "14.406.0-workspaces.1",
112
- "@genesislcap/foundation-utils": "14.406.0-workspaces.1",
103
+ "@genesislcap/expression-builder": "14.406.0-workspaces.2",
104
+ "@genesislcap/foundation-ai": "14.406.0-workspaces.2",
105
+ "@genesislcap/foundation-comms": "14.406.0-workspaces.2",
106
+ "@genesislcap/foundation-criteria": "14.406.0-workspaces.2",
107
+ "@genesislcap/foundation-errors": "14.406.0-workspaces.2",
108
+ "@genesislcap/foundation-events": "14.406.0-workspaces.2",
109
+ "@genesislcap/foundation-logger": "14.406.0-workspaces.2",
110
+ "@genesislcap/foundation-notifications": "14.406.0-workspaces.2",
111
+ "@genesislcap/foundation-user": "14.406.0-workspaces.2",
112
+ "@genesislcap/foundation-utils": "14.406.0-workspaces.2",
113
113
  "@microsoft/fast-colors": "5.3.1",
114
114
  "@microsoft/fast-components": "2.30.6",
115
115
  "@microsoft/fast-element": "1.14.0",
@@ -131,5 +131,5 @@
131
131
  "access": "public"
132
132
  },
133
133
  "customElements": "dist/custom-elements.json",
134
- "gitHead": "d85783a1758179d4516fef12808446f19b1719db"
134
+ "gitHead": "3391e5272de97281b8144b11f7acd24488c027ab"
135
135
  }