@ynput/ayon-addon-dev 0.3.0 → 0.4.1
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/shell/index.js +31 -2
- package/package.json +3 -3
package/dist/shell/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useCallback, createContext, useContext, useState, useMemo, useEffect, u
|
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
import { provideHost, isKnownSlot, getRegistry, contributionTitle, getHost, registerManifest, setManifestsLoading } from "@ynput/ayon-addon/host";
|
|
5
5
|
import { useGetProjectFoldersQuery, useGetCurrentUserQuery, usersApi, useListProjectsQuery, useGetEntitiesDetailsPanelQuery, useGetUsersQuery, useGetProjectQuery, useGetUsersAssigneeQuery, createStandaloneStore } from "@ynput/ayon-frontend-shared/api";
|
|
6
|
-
import { AddonMoreMenu, AddonEntityPicker, SlicerHost, ProjectPageLayoutHost, JsonViewer, AddonButton, useUserDetailsSlotContext, useAddonUserMenuItems, AddonUserDetailsSections, useAddonCustomizeSections, useAddonTableShortcuts, shortcutEntities, SettingsPanel, AddonDialog, useStudioPageSlotContext, useProjectPageSlotContext, SplitterStyles, LoginPage, AddonServices } from "@ynput/ayon-frontend-shared/components";
|
|
6
|
+
import { AddonMoreMenu, AddonEntityPicker, SlicerHost, ProjectPageLayoutHost, useAddonContextMenu, JsonViewer, AddonButton, AddonProfileSections, useUserDetailsSlotContext, useAddonUserMenuItems, AddonUserDetailsSections, useAddonCustomizeSections, useAddonTableShortcuts, shortcutEntities, SettingsPanel, AddonDialog, useStudioPageSlotContext, useProjectPageSlotContext, SplitterStyles, LoginPage, AddonServices } from "@ynput/ayon-frontend-shared/components";
|
|
7
7
|
import { useGlobalContext, usePowerpack, useMenuContext, useSettingsPanel, useScopedDetailsPanel, EntityUpdatesProvider, GlobalProvider, PowerpackProvider, MenuProvider, URIProvider, DetailsPanelProvider, PiPProvider, DeleteEntitiesProvider, SettingsPanelProvider, ProjectContextProvider, ProjectFoldersContextProvider } from "@ynput/ayon-frontend-shared/context";
|
|
8
8
|
import { buildProjectsTableData, ProjectsTable, PROJECTS_LIST_MENU_ID, parseProjectFolderRowId } from "@ynput/ayon-frontend-shared/ProjectsTable";
|
|
9
9
|
import { getProjectDisplayName, clearAccessToken, storeAccessToken } from "@ynput/ayon-frontend-shared/util";
|
|
@@ -158,6 +158,7 @@ const ProjectList = ({ multiSelect = false }) => {
|
|
|
158
158
|
};
|
|
159
159
|
const provideShellHost = () => provideHost({
|
|
160
160
|
useUser,
|
|
161
|
+
useContextMenu: useAddonContextMenu,
|
|
161
162
|
components: {
|
|
162
163
|
ProjectPageLayout: ProjectPageLayoutHost,
|
|
163
164
|
Slicer: SlicerHost,
|
|
@@ -418,6 +419,11 @@ const SLOT_AREAS = [
|
|
|
418
419
|
]
|
|
419
420
|
}
|
|
420
421
|
]
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
label: "Account",
|
|
425
|
+
icon: "account_circle",
|
|
426
|
+
sections: [{ label: "Profile", slots: [{ slot: "profile.section", label: "Sections" }] }]
|
|
421
427
|
}
|
|
422
428
|
];
|
|
423
429
|
const slotPath = (slot) => {
|
|
@@ -436,7 +442,8 @@ const NO_PROJECT = [
|
|
|
436
442
|
"projectList.menuItem",
|
|
437
443
|
"app.service",
|
|
438
444
|
"userDetails.section",
|
|
439
|
-
"userDetails.menuItem"
|
|
445
|
+
"userDetails.menuItem",
|
|
446
|
+
"profile.section"
|
|
440
447
|
];
|
|
441
448
|
const PROJECTS = ["studio.page", "projectList.menuItem"];
|
|
442
449
|
const ENTITIES = [
|
|
@@ -1238,6 +1245,26 @@ const ServiceStage = ({ contribution, selection }) => {
|
|
|
1238
1245
|
useReport(contribution, context, true);
|
|
1239
1246
|
return /* @__PURE__ */ jsx(ServiceNote, {});
|
|
1240
1247
|
};
|
|
1248
|
+
const PROFILE_CONTEXT = {};
|
|
1249
|
+
const ProfileStage = ({ contribution }) => {
|
|
1250
|
+
const user2 = useUser$1();
|
|
1251
|
+
const { powerLicense, isLoading } = usePowerpack();
|
|
1252
|
+
const hidden = !!contribution.powerFeature && (isLoading || !powerLicense);
|
|
1253
|
+
useReport(contribution, PROFILE_CONTEXT, !!user2 && !hidden);
|
|
1254
|
+
if (!user2) return /* @__PURE__ */ jsx(Hint, { children: "Signing in…" });
|
|
1255
|
+
return /* @__PURE__ */ jsx("div", { className: "ayon-shell-body", style: { justifyContent: "center" }, children: /* @__PURE__ */ jsxs(
|
|
1256
|
+
"div",
|
|
1257
|
+
{
|
|
1258
|
+
style: { width: "min(600px, 100%)", display: "flex", flexDirection: "column", gap: 4 },
|
|
1259
|
+
"data-shell-surface": "profile",
|
|
1260
|
+
children: [
|
|
1261
|
+
/* @__PURE__ */ jsx("div", { className: "ayon-shell-bar", children: /* @__PURE__ */ jsx("strong", { children: user2.fullName || user2.name }) }),
|
|
1262
|
+
hidden && !isLoading && /* @__PURE__ */ jsx(Hint, { children: "A power feature: this section shows with a Power Pack licence only." }),
|
|
1263
|
+
/* @__PURE__ */ jsx(AddonProfileSections, {})
|
|
1264
|
+
]
|
|
1265
|
+
}
|
|
1266
|
+
) });
|
|
1267
|
+
};
|
|
1241
1268
|
const UserDetailsStage = ({ contribution }) => {
|
|
1242
1269
|
const signedIn = useUser$1();
|
|
1243
1270
|
const { data: users = [], isLoading } = useGetUsersQuery({ selfName: signedIn?.name });
|
|
@@ -1547,6 +1574,8 @@ const Stage = ({
|
|
|
1547
1574
|
case "userDetails.section":
|
|
1548
1575
|
case "userDetails.menuItem":
|
|
1549
1576
|
return /* @__PURE__ */ jsx(UserDetailsStage, { ...props });
|
|
1577
|
+
case "profile.section":
|
|
1578
|
+
return /* @__PURE__ */ jsx(ProfileStage, { ...props });
|
|
1550
1579
|
default:
|
|
1551
1580
|
return /* @__PURE__ */ jsxs(Hint, { children: [
|
|
1552
1581
|
"The shell has no stage for ",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ynput/ayon-addon-dev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Dev tooling for AYON addon frontends: Vite plugin, dev server, CLI, lint preset",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@module-federation/vite": ">=1.14",
|
|
44
|
-
"@ynput/ayon-addon": "0.
|
|
44
|
+
"@ynput/ayon-addon": "0.5.0",
|
|
45
45
|
"vite": ">=6",
|
|
46
|
-
"@ynput/ayon-frontend-shared": ">=0.
|
|
46
|
+
"@ynput/ayon-frontend-shared": ">=0.10.0",
|
|
47
47
|
"@ynput/ayon-react-components": "^1.25.1",
|
|
48
48
|
"primereact": ">=9",
|
|
49
49
|
"react": ">=18",
|