@jskit-ai/workspaces-web 0.1.29 → 0.1.31
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/package.descriptor.mjs +12 -6
- package/package.json +7 -7
- package/src/client/components/UsersWorkspaceToolsWidget.vue +4 -4
- package/src/shared/toolsOutletContracts.js +6 -6
- package/templates/src/pages/admin/workspace/settings/index.vue +2 -1
- package/test/settingsPlacementContract.test.js +15 -3
package/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/workspaces-web",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.31",
|
|
5
5
|
kind: "runtime",
|
|
6
6
|
description: "Workspace web module: workspace selector, tools widget, workspace surfaces, and members/settings UI.",
|
|
7
7
|
dependsOn: [
|
|
@@ -72,6 +72,12 @@ export default Object.freeze({
|
|
|
72
72
|
defaultLinkComponentToken: "local.main.ui.surface-aware-menu-link-item",
|
|
73
73
|
surfaces: ["admin"],
|
|
74
74
|
source: "templates/src/pages/admin/workspace/settings.vue"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
target: "admin-cog:primary-menu",
|
|
78
|
+
defaultLinkComponentToken: "local.main.ui.surface-aware-menu-link-item",
|
|
79
|
+
surfaces: ["admin"],
|
|
80
|
+
source: "src/client/components/UsersWorkspaceToolsWidget.vue"
|
|
75
81
|
}
|
|
76
82
|
],
|
|
77
83
|
contributions: [
|
|
@@ -139,7 +145,7 @@ export default Object.freeze({
|
|
|
139
145
|
},
|
|
140
146
|
{
|
|
141
147
|
id: "workspaces.workspace.menu.workspace-settings",
|
|
142
|
-
target: "
|
|
148
|
+
target: "admin-cog:primary-menu",
|
|
143
149
|
surfaces: ["admin"],
|
|
144
150
|
order: 100,
|
|
145
151
|
componentToken: "workspaces.web.workspace-settings.menu-item",
|
|
@@ -147,7 +153,7 @@ export default Object.freeze({
|
|
|
147
153
|
},
|
|
148
154
|
{
|
|
149
155
|
id: "workspaces.workspace.menu.members",
|
|
150
|
-
target: "
|
|
156
|
+
target: "admin-cog:primary-menu",
|
|
151
157
|
surfaces: ["admin"],
|
|
152
158
|
order: 200,
|
|
153
159
|
componentToken: "workspaces.web.workspace-members.menu-item",
|
|
@@ -160,8 +166,8 @@ export default Object.freeze({
|
|
|
160
166
|
mutations: {
|
|
161
167
|
dependencies: {
|
|
162
168
|
runtime: {
|
|
163
|
-
"@jskit-ai/workspaces-core": "0.1.
|
|
164
|
-
"@jskit-ai/users-web": "0.1.
|
|
169
|
+
"@jskit-ai/workspaces-core": "0.1.31",
|
|
170
|
+
"@jskit-ai/users-web": "0.1.70",
|
|
165
171
|
"vuetify": "^4.0.0"
|
|
166
172
|
},
|
|
167
173
|
dev: {}
|
|
@@ -318,7 +324,7 @@ export default Object.freeze({
|
|
|
318
324
|
file: "src/placement.js",
|
|
319
325
|
position: "bottom",
|
|
320
326
|
skipIfContains: "id: \"workspaces.workspace.selector\"",
|
|
321
|
-
value: "\naddPlacement({\n id: \"workspaces.workspace.menu.app\",\n target: \"shell-layout:primary-menu\",\n surfaces: [\"app\"],\n order: 50,\n componentToken: \"local.main.ui.surface-aware-menu-link-item\",\n props: {\n label: \"Home\",\n surface: \"app\",\n scopedSuffix: \"/\",\n unscopedSuffix: \"/\",\n exact: true\n },\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.workspace.menu.admin\",\n target: \"shell-layout:primary-menu\",\n surfaces: [\"admin\"],\n order: 60,\n componentToken: \"local.main.ui.surface-aware-menu-link-item\",\n props: {\n label: \"Home\",\n surface: \"admin\",\n scopedSuffix: \"/\",\n unscopedSuffix: \"/\",\n exact: true\n },\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.workspace.selector\",\n target: \"shell-layout:top-left\",\n surfaces: [\"*\"],\n order: 200,\n componentToken: \"workspaces.web.workspace.selector\",\n props: {\n allowOnNonWorkspaceSurface: true,\n targetSurfaceId: \"app\"\n },\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.account.invites.cue\",\n target: \"shell-layout:top-right\",\n surfaces: [\"*\"],\n order: 850,\n componentToken: \"local.main.account.pending-invites.cue\",\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.workspace.tools.widget\",\n target: \"shell-layout:top-right\",\n surfaces: [\"admin\"],\n order: 900,\n componentToken: \"workspaces.web.workspace.tools.widget\"\n});\n\naddPlacement({\n id: \"workspaces.workspace.menu.workspace-settings\",\n target: \"
|
|
327
|
+
value: "\naddPlacement({\n id: \"workspaces.workspace.menu.app\",\n target: \"shell-layout:primary-menu\",\n surfaces: [\"app\"],\n order: 50,\n componentToken: \"local.main.ui.surface-aware-menu-link-item\",\n props: {\n label: \"Home\",\n surface: \"app\",\n scopedSuffix: \"/\",\n unscopedSuffix: \"/\",\n exact: true\n },\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.workspace.menu.admin\",\n target: \"shell-layout:primary-menu\",\n surfaces: [\"admin\"],\n order: 60,\n componentToken: \"local.main.ui.surface-aware-menu-link-item\",\n props: {\n label: \"Home\",\n surface: \"admin\",\n scopedSuffix: \"/\",\n unscopedSuffix: \"/\",\n exact: true\n },\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.workspace.selector\",\n target: \"shell-layout:top-left\",\n surfaces: [\"*\"],\n order: 200,\n componentToken: \"workspaces.web.workspace.selector\",\n props: {\n allowOnNonWorkspaceSurface: true,\n targetSurfaceId: \"app\"\n },\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.account.invites.cue\",\n target: \"shell-layout:top-right\",\n surfaces: [\"*\"],\n order: 850,\n componentToken: \"local.main.account.pending-invites.cue\",\n when: ({ auth }) => auth?.authenticated === true\n});\n\naddPlacement({\n id: \"workspaces.workspace.tools.widget\",\n target: \"shell-layout:top-right\",\n surfaces: [\"admin\"],\n order: 900,\n componentToken: \"workspaces.web.workspace.tools.widget\"\n});\n\naddPlacement({\n id: \"workspaces.workspace.menu.workspace-settings\",\n target: \"admin-cog:primary-menu\",\n surfaces: [\"admin\"],\n order: 100,\n componentToken: \"workspaces.web.workspace-settings.menu-item\"\n});\n\naddPlacement({\n id: \"workspaces.workspace.menu.members\",\n target: \"admin-cog:primary-menu\",\n surfaces: [\"admin\"],\n order: 200,\n componentToken: \"workspaces.web.workspace-members.menu-item\"\n});\n",
|
|
322
328
|
reason: "Append workspace placement entries into app-owned placement registry.",
|
|
323
329
|
category: "workspaces-web",
|
|
324
330
|
id: "workspaces-web-placement-block",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/workspaces-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tanstack/vue-query": "5.92.12",
|
|
17
17
|
"@mdi/js": "^7.4.47",
|
|
18
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
19
|
-
"@jskit-ai/kernel": "0.1.
|
|
20
|
-
"@jskit-ai/shell-web": "0.1.
|
|
21
|
-
"@jskit-ai/users-core": "0.1.
|
|
22
|
-
"@jskit-ai/users-web": "0.1.
|
|
23
|
-
"@jskit-ai/workspaces-core": "0.1.
|
|
18
|
+
"@jskit-ai/http-runtime": "0.1.54",
|
|
19
|
+
"@jskit-ai/kernel": "0.1.55",
|
|
20
|
+
"@jskit-ai/shell-web": "0.1.54",
|
|
21
|
+
"@jskit-ai/users-core": "0.1.65",
|
|
22
|
+
"@jskit-ai/users-web": "0.1.70",
|
|
23
|
+
"@jskit-ai/workspaces-core": "0.1.31",
|
|
24
24
|
"vuetify": "^4.0.0"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ShellOutletMenuWidget from "@jskit-ai/shell-web/client/components/ShellOutletMenuWidget";
|
|
3
|
-
import {
|
|
3
|
+
import { ADMIN_COG_OUTLET } from "../../shared/toolsOutletContracts.js";
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
7
7
|
<ShellOutletMenuWidget
|
|
8
|
-
:target="
|
|
9
|
-
:default-link-component-token="
|
|
10
|
-
:aria-label="
|
|
8
|
+
:target="ADMIN_COG_OUTLET.target"
|
|
9
|
+
:default-link-component-token="ADMIN_COG_OUTLET.defaultLinkComponentToken"
|
|
10
|
+
:aria-label="ADMIN_COG_OUTLET.ariaLabel"
|
|
11
11
|
/>
|
|
12
12
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const DEFAULT_COG_LINK_COMPONENT_TOKEN = "local.main.ui.surface-aware-menu-link-item";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
target: "
|
|
5
|
-
defaultLinkComponentToken:
|
|
6
|
-
ariaLabel: "
|
|
3
|
+
const ADMIN_COG_OUTLET = Object.freeze({
|
|
4
|
+
target: "admin-cog:primary-menu",
|
|
5
|
+
defaultLinkComponentToken: DEFAULT_COG_LINK_COMPONENT_TOKEN,
|
|
6
|
+
ariaLabel: "Admin cog"
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { DEFAULT_COG_LINK_COMPONENT_TOKEN, ADMIN_COG_OUTLET };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
// To redirect this settings shell to a child page, uncomment and edit the example below.
|
|
3
|
+
// import { redirectToChild } from "@jskit-ai/kernel/client/pageRedirects";
|
|
3
4
|
// definePage({
|
|
4
|
-
// redirect: (
|
|
5
|
+
// redirect: redirectToChild("your_child_segment")
|
|
5
6
|
// });
|
|
6
7
|
</script>
|
|
7
8
|
|
|
@@ -8,10 +8,11 @@ import descriptor from "../package.descriptor.mjs";
|
|
|
8
8
|
const TEST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
const PACKAGE_DIR = path.resolve(TEST_DIRECTORY, "..");
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function readOutlets(target = "") {
|
|
12
12
|
const outlets = descriptor?.metadata?.ui?.placements?.outlets;
|
|
13
|
+
const normalizedTarget = String(target || "").trim();
|
|
13
14
|
return Array.isArray(outlets)
|
|
14
|
-
? outlets.filter((entry) => String(entry?.target || "").trim() ===
|
|
15
|
+
? outlets.filter((entry) => String(entry?.target || "").trim() === normalizedTarget)
|
|
15
16
|
: [];
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -78,7 +79,7 @@ test("workspaces-web admin settings index template is a simple developer-owned s
|
|
|
78
79
|
|
|
79
80
|
test("workspaces-web descriptor metadata advertises admin settings outlets", () => {
|
|
80
81
|
assert.deepEqual(
|
|
81
|
-
|
|
82
|
+
readOutlets("admin-settings:primary-menu"),
|
|
82
83
|
[
|
|
83
84
|
{
|
|
84
85
|
target: "admin-settings:primary-menu",
|
|
@@ -88,6 +89,17 @@ test("workspaces-web descriptor metadata advertises admin settings outlets", ()
|
|
|
88
89
|
}
|
|
89
90
|
]
|
|
90
91
|
);
|
|
92
|
+
assert.deepEqual(
|
|
93
|
+
readOutlets("admin-cog:primary-menu"),
|
|
94
|
+
[
|
|
95
|
+
{
|
|
96
|
+
target: "admin-cog:primary-menu",
|
|
97
|
+
defaultLinkComponentToken: "local.main.ui.surface-aware-menu-link-item",
|
|
98
|
+
surfaces: ["admin"],
|
|
99
|
+
source: "src/client/components/UsersWorkspaceToolsWidget.vue"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
);
|
|
91
103
|
assert.equal(findContribution("workspaces.workspace.settings.general"), null);
|
|
92
104
|
assert.deepEqual(findContribution("workspaces.workspace.menu.app"), {
|
|
93
105
|
id: "workspaces.workspace.menu.app",
|