@panomc/theme-core 1.0.0-dev.60 → 1.0.0-dev.62
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/assets/css/pano-fallback-legacy.css +12381 -0
- package/assets/css/pano-fallback.css +3222 -0
- package/bin/__tests__/check/fixtures/plugin-contracts/market/controllers.json +4 -0
- package/bin/__tests__/check/fixtures/plugin-contracts/market/views.json +67 -0
- package/bin/__tests__/check/fixtures/routes.json +5 -0
- package/bin/__tests__/check/helpers.js +55 -0
- package/bin/__tests__/check/overrides.test.js +287 -0
- package/bin/__tests__/check/theme.test.js +332 -0
- package/bin/__tests__/cli/accept-and-list.test.js +159 -0
- package/bin/__tests__/cli/config-edit.test.js +213 -0
- package/bin/__tests__/cli/contracts-pull.test.js +187 -0
- package/bin/__tests__/cli/core-meta.test.js +305 -0
- package/bin/__tests__/cli/eject-view.test.js +356 -0
- package/bin/__tests__/cli/helpers.js +258 -0
- package/bin/__tests__/scaffold/scaffold.test.js +84 -0
- package/bin/bundle-internal-libs.js +14 -2
- package/bin/check.js +1150 -213
- package/bin/contracts.js +1643 -0
- package/bin/generate-contract.js +378 -0
- package/bin/generate-licenses.js +14 -2
- package/bin/generate-runtime-shims.js +27 -9
- package/bin/new.js +101 -2
- package/bin/package-zip.js +16 -2
- package/bin/sync.js +360 -7
- package/bin/theme-core.js +65 -107
- package/lang/en-US.json +1 -0
- package/lang/ru.json +1 -0
- package/lang/tr.json +1 -0
- package/package.json +8 -9
- package/skin-contract.json +864 -19
- package/src/kit/__tests__/hooks-server-fetch.test.js +56 -0
- package/src/kit/__tests__/route-map.test.js +154 -0
- package/src/kit/__tests__/theme-meta.test.js +249 -0
- package/src/kit/hooks-client.js +3 -0
- package/src/kit/hooks-server.js +79 -21
- package/src/kit/route-map.js +300 -0
- package/src/kit/specifiers.js +3 -62
- package/src/kit/svelte-config.js +3 -0
- package/src/kit/theme-meta.js +405 -0
- package/src/kit/vite-config.js +156 -12
- package/src/lib/NotificationManager.js +18 -0
- package/src/lib/PluginAPI.js +313 -9
- package/src/lib/Store.js +18 -5
- package/src/lib/__tests__/avatarVersion.test.js +25 -0
- package/src/lib/__tests__/check.test.js +201 -0
- package/src/lib/__tests__/controllerHost.test.js +363 -0
- package/src/lib/__tests__/cx03.test.js +245 -0
- package/src/lib/__tests__/engineBoot.test.js +151 -0
- package/src/lib/__tests__/engineParts.helper.js +284 -0
- package/src/lib/__tests__/engineParts.test.js +179 -0
- package/src/lib/__tests__/engineSidebars.helper.js +353 -0
- package/src/lib/__tests__/engineSidebars.test.js +273 -0
- package/src/lib/__tests__/engineStyles.test.js +227 -0
- package/src/lib/__tests__/engineWiring.test.js +1000 -0
- package/src/lib/__tests__/fallbackStyles.test.js +1254 -0
- package/src/lib/__tests__/fixtures/Probe.svelte +5 -0
- package/src/lib/__tests__/fixtures/engine-parts.ssr.json +29 -0
- package/src/lib/__tests__/fixtures/engine-sidebars.ssr.json +16 -0
- package/src/lib/__tests__/home.test.js +563 -0
- package/src/lib/__tests__/injectedScope.test.js +490 -0
- package/src/lib/__tests__/languageConcurrency.test.js +55 -0
- package/src/lib/__tests__/languageLayers.test.js +286 -0
- package/src/lib/__tests__/pageHead.test.js +167 -0
- package/src/lib/__tests__/pageMeta.util.test.js +216 -0
- package/src/lib/__tests__/pageTitle.util.test.js +96 -0
- package/src/lib/__tests__/pluginApiViews.test.js +529 -0
- package/src/lib/__tests__/plugins.test.js +53 -0
- package/src/lib/__tests__/profileNav.util.test.js +145 -0
- package/src/lib/__tests__/registryReady.test.js +26 -0
- package/src/lib/__tests__/returnTo.util.test.js +294 -0
- package/src/lib/__tests__/routeConfig.test.js +361 -0
- package/src/lib/__tests__/sidebarSpec.util.test.js +152 -0
- package/src/lib/__tests__/skinContract.test.js +558 -0
- package/src/lib/__tests__/svelteSsr.helper.js +68 -0
- package/src/lib/__tests__/tc03.test.js +427 -0
- package/src/lib/__tests__/tc11.test.js +184 -0
- package/src/lib/__tests__/translationLayers.test.js +161 -0
- package/src/lib/avatarVersion.js +39 -0
- package/src/lib/components/Breadcrumb.svelte +9 -40
- package/src/lib/components/Date.svelte +1 -1
- package/src/lib/components/DefaultToast.svelte +13 -3
- package/src/lib/components/FallbackLinks.svelte +28 -0
- package/src/lib/components/FallbackScope.svelte +24 -0
- package/src/lib/components/Footer.svelte +8 -8
- package/src/lib/components/Header.svelte +3 -3
- package/src/lib/components/Hook.svelte +12 -1
- package/src/lib/components/LoginFormBody.svelte +5 -5
- package/src/lib/components/Main.svelte +22 -47
- package/src/lib/components/Navbar.svelte +30 -29
- package/src/lib/components/NoContent.svelte +2 -2
- package/src/lib/components/NotificationContainer.svelte +31 -82
- package/src/lib/components/OnlineAdmins.svelte +3 -2
- package/src/lib/components/PageActions.svelte +1 -1
- package/src/lib/components/PageHead.svelte +50 -0
- package/src/lib/components/PageTitle.svelte +2 -2
- package/src/lib/components/Pagination.svelte +6 -6
- package/src/lib/components/PlayerHead.svelte +4 -4
- package/src/lib/components/PluginBlock.svelte +132 -0
- package/src/lib/components/PluginSlot.svelte +40 -0
- package/src/lib/components/Post.svelte +13 -230
- package/src/lib/components/Posts.svelte +7 -14
- package/src/lib/components/RegisterForm.svelte +12 -11
- package/src/lib/components/Sidebar.svelte +9 -7
- package/src/lib/components/TicketRow.svelte +8 -48
- package/src/lib/components/TicketStatus.svelte +10 -16
- package/src/lib/components/Tickets.svelte +8 -30
- package/src/lib/components/Toast.svelte +16 -14
- package/src/lib/components/ToastContainer.svelte +16 -9
- package/src/lib/components/ViewComponent.svelte +13 -1
- package/src/lib/components/modals/CloseTicketConfirmModal.svelte +15 -46
- package/src/lib/components/modals/ConfirmRemoveAllNotificationsModal.svelte +17 -39
- package/src/lib/components/modals/LogoutSessionConfirmModal.svelte +12 -30
- package/src/lib/components/sidebars/HomeSidebar.svelte +33 -284
- package/src/lib/components/sidebars/PlayerDetailSidebar.svelte +14 -63
- package/src/lib/components/sidebars/PluginSidebar.svelte +21 -0
- package/src/lib/components/sidebars/ProfileNavCard.svelte +24 -0
- package/src/lib/components/sidebars/ProfileSidebar.svelte +44 -84
- package/src/lib/components/sidebars/SupportSidebar.svelte +19 -22
- package/src/lib/components/sidebars/TicketCreateAndDetailSidebar.svelte +23 -35
- package/src/lib/components/sidebars/profileNav.util.js +105 -0
- package/src/lib/components/sidebars/sidebarSpec.util.js +92 -0
- package/src/lib/controllerHost.js +261 -0
- package/src/lib/fallbackStyles.js +317 -0
- package/src/lib/home.js +202 -0
- package/src/lib/language.util.js +70 -37
- package/src/lib/layouts/AppLayout.svelte +16 -8
- package/src/lib/layouts/AuthLayout.svelte +6 -4
- package/src/lib/layouts/MainLayout.svelte +17 -12
- package/src/lib/layouts/ProfileLayout.svelte +6 -4
- package/src/lib/layouts/ThemeSettingsLayout.svelte +6 -4
- package/src/lib/layouts/TicketsLayout.svelte +6 -5
- package/src/lib/pageMeta.util.js +212 -0
- package/src/lib/pageShape.js +33 -0
- package/src/lib/pageTitle.util.js +32 -0
- package/src/lib/pages/ActivateEmailPage.svelte +2 -7
- package/src/lib/pages/ConfirmNewEmailPage.svelte +2 -7
- package/src/lib/pages/ErrorPage.svelte +5 -2
- package/src/lib/pages/HomePage.svelte +31 -8
- package/src/lib/pages/LoginPage.svelte +38 -41
- package/src/lib/pages/NotificationsPage.svelte +2 -7
- package/src/lib/pages/PlayerDetailPage.svelte +2 -7
- package/src/lib/pages/PostDetailPage.svelte +2 -7
- package/src/lib/pages/PreviewPostPage.svelte +2 -7
- package/src/lib/pages/RegisterPage.svelte +10 -13
- package/src/lib/pages/RenewPasswordPage.svelte +2 -7
- package/src/lib/pages/ResetPasswordPage.svelte +2 -7
- package/src/lib/pages/RulesPage.svelte +3 -8
- package/src/lib/pages/SupportPage.svelte +2 -7
- package/src/lib/pages/ThemeSettingsPage.svelte +2 -7
- package/src/lib/pages/profile/ProfilePage.svelte +2 -7
- package/src/lib/pages/profile/SettingsPage.svelte +2 -7
- package/src/lib/pages/profile/TicketsPage.svelte +2 -7
- package/src/lib/pages/ticket/CreateTicketPage.svelte +2 -7
- package/src/lib/pages/ticket/TicketDetailPage.svelte +2 -7
- package/src/lib/plugins.js +61 -0
- package/src/lib/returnTo.util.js +116 -0
- package/src/lib/services/auth.js +11 -11
- package/src/lib/services/posts.js +21 -10
- package/src/lib/services/profile.js +5 -5
- package/src/lib/services/theme-setting.js +1 -1
- package/src/lib/services/tickets.js +36 -15
- package/src/lib/siteRealtime.js +55 -8
- package/src/lib/themePageLoad.js +38 -0
- package/src/lib/translationLayers.js +144 -0
- package/src/lib/ui-logics/layout-logics/AppLayoutLogics.js +160 -6
- package/src/lib/ui-logics/layout-logics/AuthLayoutLogics.js +3 -2
- package/src/lib/ui-logics/layout-logics/ProfileLayoutLogics.js +3 -2
- package/src/lib/ui-logics/layout-logics/TicketsLayoutLogics.js +3 -2
- package/src/lib/ui-logics/page-logics/ActiveEmailPageLogics.js +4 -4
- package/src/lib/ui-logics/page-logics/ConfirmNewEmailPageLogics.js +4 -4
- package/src/lib/ui-logics/page-logics/CreateTicketPageLogics.js +5 -5
- package/src/lib/ui-logics/page-logics/HomePageLogics.js +5 -3
- package/src/lib/ui-logics/page-logics/NotificationsPageLogics.js +40 -16
- package/src/lib/ui-logics/page-logics/PlayerDetailPageLogics.js +3 -3
- package/src/lib/ui-logics/page-logics/PostDetailPageLogics.js +3 -3
- package/src/lib/ui-logics/page-logics/PreviewPostPageLogics.js +1 -1
- package/src/lib/ui-logics/page-logics/RenewPasswordPageLogics.js +4 -4
- package/src/lib/ui-logics/page-logics/ResetPasswordPageLogics.js +6 -6
- package/src/lib/ui-logics/page-logics/SettingsPageLogics.js +8 -8
- package/src/lib/ui-logics/page-logics/TicketDetailPageLogics.js +3 -3
- package/src/lib/ui-logics/page-logics/TicketsPageLogics.js +5 -3
- package/src/lib/views/ActivateEmailView.samples.js +22 -0
- package/src/lib/views/ActivateEmailView.svelte +4 -4
- package/src/lib/views/AppLayoutView.samples.js +17 -0
- package/src/lib/views/AppLayoutView.svelte +1 -1
- package/src/lib/views/AuthLayoutView.samples.js +4 -0
- package/src/lib/views/AuthLayoutView.svelte +1 -1
- package/src/lib/views/Breadcrumb.samples.js +15 -0
- package/src/lib/views/CloseTicketConfirmModal.samples.js +12 -0
- package/src/lib/views/ConfirmNewEmailView.samples.js +22 -0
- package/src/lib/views/ConfirmNewEmailView.svelte +4 -4
- package/src/lib/views/ConfirmRemoveAllNotificationsModal.samples.js +9 -0
- package/src/lib/views/CreateTicketView.samples.js +21 -0
- package/src/lib/views/CreateTicketView.svelte +5 -5
- package/src/lib/views/Date.samples.js +9 -0
- package/src/lib/views/DefaultToast.samples.js +7 -0
- package/src/lib/views/ErrorView.samples.js +8 -0
- package/src/lib/views/ErrorView.svelte +4 -2
- package/src/lib/views/Footer.samples.js +8 -0
- package/src/lib/views/Header.samples.js +8 -0
- package/src/lib/views/HomeSidebar.samples.js +59 -0
- package/src/lib/views/HomeView.samples.js +34 -0
- package/src/lib/views/HomeView.svelte +14 -6
- package/src/lib/views/LoginFormBody.samples.js +8 -0
- package/src/lib/views/LoginView.samples.js +50 -0
- package/src/lib/views/LoginView.svelte +24 -22
- package/src/lib/views/LogoutSessionConfirmModal.samples.js +8 -0
- package/src/lib/views/Main.samples.js +23 -0
- package/src/lib/views/MainLayoutView.svelte +3 -4
- package/src/lib/views/Navbar.samples.js +8 -0
- package/src/lib/views/NoContent.samples.js +7 -0
- package/src/lib/views/NotificationContainer.samples.js +25 -0
- package/src/lib/views/NotificationsView.samples.js +36 -0
- package/src/lib/views/NotificationsView.svelte +21 -12
- package/src/lib/views/PageActions.samples.js +7 -0
- package/src/lib/views/PageTitle.samples.js +8 -0
- package/src/lib/views/Pagination.samples.js +7 -0
- package/src/lib/views/PlayerDetailSidebar.samples.js +35 -0
- package/src/lib/views/PlayerDetailView.samples.js +8 -0
- package/src/lib/views/PlayerDetailView.svelte +3 -3
- package/src/lib/views/PlayerHead.samples.js +8 -0
- package/src/lib/views/Post.samples.js +10 -0
- package/src/lib/views/PostDetailView.samples.js +28 -0
- package/src/lib/views/PostDetailView.svelte +24 -16
- package/src/lib/views/Posts.samples.js +9 -0
- package/src/lib/views/PreviewPostView.samples.js +20 -0
- package/src/lib/views/PreviewPostView.svelte +10 -10
- package/src/lib/views/ProfileLayoutView.samples.js +4 -0
- package/src/lib/views/ProfileSidebar.samples.js +33 -0
- package/src/lib/views/ProfileView.samples.js +29 -0
- package/src/lib/views/ProfileView.svelte +2 -2
- package/src/lib/views/RegisterForm.samples.js +7 -0
- package/src/lib/views/RegisterView.samples.js +28 -0
- package/src/lib/views/RegisterView.svelte +5 -3
- package/src/lib/views/RenewPasswordView.samples.js +24 -0
- package/src/lib/views/RenewPasswordView.svelte +6 -6
- package/src/lib/views/ResetPasswordView.samples.js +24 -0
- package/src/lib/views/ResetPasswordView.svelte +3 -3
- package/src/lib/views/RulesView.samples.js +14 -0
- package/src/lib/views/RulesView.svelte +3 -3
- package/src/lib/views/SettingsView.svelte +48 -17
- package/src/lib/views/Sidebar.samples.js +7 -0
- package/src/lib/views/SupportSidebar.samples.js +24 -0
- package/src/lib/views/SupportView.samples.js +16 -0
- package/src/lib/views/SupportView.svelte +8 -6
- package/src/lib/views/ThemeSettingsLayoutView.samples.js +9 -0
- package/src/lib/views/ThemeSettingsLayoutView.svelte +1 -1
- package/src/lib/views/ThemeSettingsView.svelte +89 -89
- package/src/lib/views/TicketCreateAndDetailSidebar.samples.js +33 -0
- package/src/lib/views/TicketDetailView.samples.js +34 -0
- package/src/lib/views/TicketDetailView.svelte +17 -15
- package/src/lib/views/TicketRow.samples.js +10 -0
- package/src/lib/views/TicketStatus.samples.js +8 -0
- package/src/lib/views/Tickets.samples.js +9 -0
- package/src/lib/views/TicketsLayoutView.samples.js +4 -0
- package/src/lib/views/TicketsView.samples.js +23 -0
- package/src/lib/views/TicketsView.svelte +11 -9
- package/src/lib/views/Toast.samples.js +9 -0
- package/src/lib/views/ToastContainer.samples.js +8 -0
- package/src/lib/views/parts/Breadcrumb.svelte +53 -0
- package/src/lib/views/parts/CloseTicketConfirmModal.svelte +63 -0
- package/src/lib/views/parts/ConfirmRemoveAllNotificationsModal.svelte +55 -0
- package/src/lib/views/parts/DefaultToast.svelte +22 -0
- package/src/lib/views/parts/HomeSidebar.svelte +334 -0
- package/src/lib/views/parts/LogoutSessionConfirmModal.svelte +46 -0
- package/src/lib/views/parts/Main.svelte +71 -0
- package/src/lib/views/parts/NotificationContainer.svelte +109 -0
- package/src/lib/views/parts/PlayerDetailSidebar.svelte +81 -0
- package/src/lib/views/parts/Post.svelte +255 -0
- package/src/lib/views/parts/Posts.svelte +25 -0
- package/src/lib/views/parts/ProfileSidebar.svelte +115 -0
- package/src/lib/views/parts/Sidebar.svelte +19 -0
- package/src/lib/views/parts/SupportSidebar.svelte +34 -0
- package/src/lib/views/parts/TicketCreateAndDetailSidebar.svelte +51 -0
- package/src/lib/views/parts/TicketRow.svelte +63 -0
- package/src/lib/views/parts/TicketStatus.svelte +24 -0
- package/src/lib/views/parts/Tickets.svelte +45 -0
- package/src/lib/views/parts/Toast.svelte +27 -0
- package/src/lib/views/parts/ToastContainer.svelte +17 -0
- package/src/lib/views/parts/engine-views.generated.js +63 -0
- package/src/lib/views/parts/publicHref.js +18 -0
- package/src/lib/views/parts/ticketStatuses.js +7 -0
- package/src/plugin-engine/__tests__/engine.test.js +161 -0
- package/src/plugin-engine/engine.js +80 -12
- package/src/registry/__tests__/registry.test.js +510 -0
- package/src/registry/__tests__/view.test.js +52 -0
- package/src/registry/index.js +700 -51
- package/src/registry/routes.js +62 -0
- package/src/registry/view.js +69 -0
- package/src/routes/RootLayout.svelte +24 -1
- package/src/routes/catalogue/List.svelte +163 -0
- package/src/routes/catalogue/Stage.svelte +355 -0
- package/src/routes/catalogue/__tests__/browserSafe.test.js +13 -0
- package/src/routes/catalogue/__tests__/catalogue.test.js +539 -0
- package/src/routes/catalogue/catalogue.js +129 -0
- package/src/routes/catalogue/deps.js +147 -0
- package/src/routes/catalogue/engineSamples.js +63 -0
- package/src/routes/catalogue/fixtures.js +77 -0
- package/src/routes/catalogue/list.js +37 -0
- package/src/routes/catalogue/model.js +286 -0
- package/src/routes/catalogue/stage.js +69 -0
- package/src/routes/catalogue/views-json.js +24 -0
- package/src/routes/plugin-ui/Layout.svelte +29 -4
- package/src/routes/plugin-ui/Page.svelte +86 -31
- package/src/routes/plugin-ui/load.js +173 -0
- package/src/routes/plugins-client-file.js +8 -3
- package/src/routes/plugins-ui-file.js +60 -0
- package/src/routes/root-layout-load.js +59 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Generated by bin/generate-contract.js from skin-contract.json - do not edit.
|
|
2
|
+
// The engine's own views for registerEngineViews() (doc 01 section 4): the default of a view
|
|
3
|
+
// is its markup file (a part when the view was split into controller + part).
|
|
4
|
+
|
|
5
|
+
export const engineViews = {
|
|
6
|
+
"HomeView": { contract: 1, component: () => import("../HomeView.svelte"), uses: ["Pagination","Posts"], hooks: ["page:home:top"] },
|
|
7
|
+
"LoginView": { contract: 1, component: () => import("../LoginView.svelte"), uses: ["PageTitle","RegisterForm"] },
|
|
8
|
+
"RegisterView": { contract: 1, component: () => import("../RegisterView.svelte"), uses: ["RegisterForm"] },
|
|
9
|
+
"NotificationsView": { contract: 1, component: () => import("../NotificationsView.svelte"), uses: ["ConfirmRemoveAllNotificationsModal","NoContent"] },
|
|
10
|
+
"PlayerDetailView": { contract: 1, component: () => import("../PlayerDetailView.svelte"), uses: ["Date"] },
|
|
11
|
+
"PostDetailView": { contract: 1, component: () => import("../PostDetailView.svelte"), uses: ["Date"], hooks: ["theme:post-detail:bottom"] },
|
|
12
|
+
"PreviewPostView": { contract: 1, component: () => import("../PreviewPostView.svelte"), uses: ["Date"] },
|
|
13
|
+
"SupportView": { contract: 1, component: () => import("../SupportView.svelte"), hooks: ["theme:support:content"] },
|
|
14
|
+
"ActivateEmailView": { contract: 1, component: () => import("../ActivateEmailView.svelte") },
|
|
15
|
+
"ConfirmNewEmailView": { contract: 1, component: () => import("../ConfirmNewEmailView.svelte") },
|
|
16
|
+
"RenewPasswordView": { contract: 1, component: () => import("../RenewPasswordView.svelte") },
|
|
17
|
+
"ResetPasswordView": { contract: 1, component: () => import("../ResetPasswordView.svelte") },
|
|
18
|
+
"ErrorView": { contract: 1, component: () => import("../ErrorView.svelte"), uses: ["PageTitle"] },
|
|
19
|
+
"ThemeSettingsView": { contract: 1, component: () => import("../ThemeSettingsView.svelte") },
|
|
20
|
+
"ProfileView": { contract: 1, component: () => import("../ProfileView.svelte"), uses: ["Date"] },
|
|
21
|
+
"SettingsView": { contract: 1, component: () => import("../SettingsView.svelte"), uses: ["Date","LogoutSessionConfirmModal","NoContent"] },
|
|
22
|
+
"TicketsView": { contract: 1, component: () => import("../TicketsView.svelte"), uses: ["Pagination","Tickets"] },
|
|
23
|
+
"TicketDetailView": { contract: 1, component: () => import("../TicketDetailView.svelte"), uses: ["Date","PageTitle","TicketStatus"] },
|
|
24
|
+
"CreateTicketView": { contract: 1, component: () => import("../CreateTicketView.svelte") },
|
|
25
|
+
"AppLayoutView": { contract: 1, component: () => import("../AppLayoutView.svelte"), uses: ["ToastContainer"] },
|
|
26
|
+
"MainLayoutView": { contract: 1, component: () => import("../MainLayoutView.svelte"), uses: ["Breadcrumb","Main","NotificationContainer"], hooks: ["theme:top","page:top"] },
|
|
27
|
+
"AuthLayoutView": { contract: 1, component: () => import("../AuthLayoutView.svelte") },
|
|
28
|
+
"ProfileLayoutView": { contract: 1, component: () => import("../ProfileLayoutView.svelte") },
|
|
29
|
+
"ThemeSettingsLayoutView": { contract: 1, component: () => import("../ThemeSettingsLayoutView.svelte") },
|
|
30
|
+
"TicketsLayoutView": { contract: 1, component: () => import("../TicketsLayoutView.svelte"), uses: ["CloseTicketConfirmModal"] },
|
|
31
|
+
"RulesView": { contract: 1, component: () => import("../RulesView.svelte") },
|
|
32
|
+
"Main": { contract: 1, component: () => import("./Main.svelte"), uses: ["PageTitle"] },
|
|
33
|
+
"Sidebar": { contract: 1, component: () => import("./Sidebar.svelte") },
|
|
34
|
+
"Breadcrumb": { contract: 1, component: () => import("./Breadcrumb.svelte") },
|
|
35
|
+
"Post": { contract: 1, component: () => import("./Post.svelte"), uses: ["Date"] },
|
|
36
|
+
"Posts": { contract: 1, component: () => import("./Posts.svelte"), uses: ["NoContent","Post"] },
|
|
37
|
+
"Tickets": { contract: 1, component: () => import("./Tickets.svelte"), uses: ["NoContent","TicketRow"] },
|
|
38
|
+
"TicketRow": { contract: 1, component: () => import("./TicketRow.svelte"), uses: ["Date","TicketStatus"] },
|
|
39
|
+
"TicketStatus": { contract: 1, component: () => import("./TicketStatus.svelte") },
|
|
40
|
+
"Toast": { contract: 1, component: () => import("./Toast.svelte") },
|
|
41
|
+
"DefaultToast": { contract: 1, component: () => import("./DefaultToast.svelte"), uses: ["Toast"] },
|
|
42
|
+
"ToastContainer": { contract: 1, component: () => import("./ToastContainer.svelte"), uses: ["DefaultToast"] },
|
|
43
|
+
"NotificationContainer": { contract: 1, component: () => import("./NotificationContainer.svelte") },
|
|
44
|
+
"CloseTicketConfirmModal": { contract: 1, component: () => import("./CloseTicketConfirmModal.svelte") },
|
|
45
|
+
"ConfirmRemoveAllNotificationsModal": { contract: 1, component: () => import("./ConfirmRemoveAllNotificationsModal.svelte") },
|
|
46
|
+
"LogoutSessionConfirmModal": { contract: 1, component: () => import("./LogoutSessionConfirmModal.svelte") },
|
|
47
|
+
"LoginFormBody": { contract: 1, component: () => import("../../components/LoginFormBody.svelte") },
|
|
48
|
+
"RegisterForm": { contract: 1, component: () => import("../../components/RegisterForm.svelte") },
|
|
49
|
+
"Date": { contract: 1, component: () => import("../../components/Date.svelte") },
|
|
50
|
+
"Pagination": { contract: 2, component: () => import("../../components/Pagination.svelte") },
|
|
51
|
+
"NoContent": { contract: 1, component: () => import("../../components/NoContent.svelte") },
|
|
52
|
+
"PageActions": { contract: 1, component: () => import("../../components/PageActions.svelte") },
|
|
53
|
+
"PageTitle": { contract: 1, component: () => import("../../components/PageTitle.svelte") },
|
|
54
|
+
"PlayerHead": { contract: 1, component: () => import("../../components/PlayerHead.svelte") },
|
|
55
|
+
"Navbar": { contract: 1, component: () => import("../../components/Navbar.svelte") },
|
|
56
|
+
"Header": { contract: 1, component: () => import("../../components/Header.svelte") },
|
|
57
|
+
"Footer": { contract: 1, component: () => import("../../components/Footer.svelte") },
|
|
58
|
+
"HomeSidebar": { contract: 1, component: () => import("./HomeSidebar.svelte"), uses: ["Sidebar"] },
|
|
59
|
+
"ProfileSidebar": { contract: 1, component: () => import("./ProfileSidebar.svelte"), uses: ["PageTitle","PlayerHead","Sidebar"] },
|
|
60
|
+
"SupportSidebar": { contract: 1, component: () => import("./SupportSidebar.svelte"), uses: ["Sidebar"] },
|
|
61
|
+
"PlayerDetailSidebar": { contract: 1, component: () => import("./PlayerDetailSidebar.svelte"), uses: ["PageTitle","PlayerHead","Sidebar"] },
|
|
62
|
+
"TicketCreateAndDetailSidebar": { contract: 1, component: () => import("./TicketCreateAndDetailSidebar.svelte"), uses: ["Sidebar"] },
|
|
63
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The public form of a site link (doc 01 section 9): a canonical path such as "/store/vip" becomes the path
|
|
2
|
+
// the theme publishes ("/shop/vip" when it renames "/store"). The query string and the hash are kept as they
|
|
3
|
+
// are; an absolute URL, a protocol-relative one or anything that is not a site path passes unchanged.
|
|
4
|
+
import { route } from "../../../registry/routes.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {unknown} href
|
|
8
|
+
* @returns {unknown}
|
|
9
|
+
*/
|
|
10
|
+
export function publicHref(href) {
|
|
11
|
+
if (typeof href !== "string" || !href.startsWith("/") || href.startsWith("//")) {
|
|
12
|
+
return href;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const cut = href.search(/[?#]/);
|
|
16
|
+
|
|
17
|
+
return cut === -1 ? route(href) : route(href.slice(0, cut)) + href.slice(cut);
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// The ticket status names. Kept in a plain module so the TicketStatus controller can re-export
|
|
2
|
+
// them and the TicketRow / TicketStatus parts can read them without importing each other.
|
|
3
|
+
export const TicketStatuses = Object.freeze({
|
|
4
|
+
NEW: "NEW",
|
|
5
|
+
REPLIED: "REPLIED",
|
|
6
|
+
CLOSED: "CLOSED",
|
|
7
|
+
});
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { get } from "svelte/store";
|
|
3
|
+
|
|
4
|
+
import { createHookEngine, createSlotRegistry } from "../engine.js";
|
|
5
|
+
|
|
6
|
+
const module = (label, load) => ({ default: function Component() {}, label, ...(load ? { load } : {}) });
|
|
7
|
+
const thunk = (m) => async () => m;
|
|
8
|
+
const slotsOf = (policy = {}) =>
|
|
9
|
+
createSlotRegistry({ getPlugins: () => ({}), browser: true, executeLifecycle: async () => {}, ...policy });
|
|
10
|
+
|
|
11
|
+
describe("hook engine: isSuppressed keeps positions aligned", () => {
|
|
12
|
+
test("getHook and executeHookLoad list the same entries in the same order", async () => {
|
|
13
|
+
const calls = [];
|
|
14
|
+
const engine = createHookEngine({ isSuppressed: (entry) => entry.view === "market:NavCart" });
|
|
15
|
+
|
|
16
|
+
for (const [id, view] of [
|
|
17
|
+
["a", "market:A"],
|
|
18
|
+
["claimed", "market:NavCart"],
|
|
19
|
+
["c", "market:C"],
|
|
20
|
+
]) {
|
|
21
|
+
engine.register({
|
|
22
|
+
name: "theme:top",
|
|
23
|
+
id,
|
|
24
|
+
view,
|
|
25
|
+
component: thunk(module(id, async () => (calls.push(id), { from: id }))),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const list = get(engine.get("theme:top"));
|
|
30
|
+
const props = await engine.executeHookLoad("theme:top", {});
|
|
31
|
+
|
|
32
|
+
expect(list.map((entry) => entry.id)).toEqual(["a", "c"]);
|
|
33
|
+
expect(props.map((p) => p.from)).toEqual(["a", "c"]);
|
|
34
|
+
// no wasted load for the claimed entry
|
|
35
|
+
expect(calls.sort()).toEqual(["a", "c"]);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("an entry without `view` is never suppressed", () => {
|
|
39
|
+
const engine = createHookEngine({ isSuppressed: (entry) => entry.view === "x:Y" });
|
|
40
|
+
engine.register({ name: "h", id: "one", component: thunk(module("one")) });
|
|
41
|
+
|
|
42
|
+
expect(get(engine.get("h")).length).toBe(1);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("no policy = today's behaviour", async () => {
|
|
46
|
+
const engine = createHookEngine();
|
|
47
|
+
engine.register({ name: "h", component: thunk(module("a", async () => ({ x: 1 }))) });
|
|
48
|
+
|
|
49
|
+
expect(get(engine.get("h")).length).toBe(1);
|
|
50
|
+
expect(await engine.executeHookLoad("h", {})).toEqual([{ x: 1 }]);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("normalizeItem can drop a hook entry", () => {
|
|
54
|
+
const engine = createHookEngine({ normalizeItem: (item) => (item.id === "bad" ? null : item) });
|
|
55
|
+
engine.register({ name: "h", id: "bad", component: thunk(module("bad")) });
|
|
56
|
+
engine.register({ name: "h", id: "ok", component: thunk(module("ok")) });
|
|
57
|
+
|
|
58
|
+
expect(get(engine.get("h")).map((entry) => entry.id)).toEqual(["ok"]);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("the plugin's registration object is not mutated by normalizeItem", () => {
|
|
62
|
+
const engine = createHookEngine({
|
|
63
|
+
normalizeItem: (item) => {
|
|
64
|
+
item.component = thunk(module("n"));
|
|
65
|
+
return item;
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
const options = { name: "h", id: "x", view: "a:B" };
|
|
69
|
+
engine.register(options);
|
|
70
|
+
|
|
71
|
+
expect(options.component).toBeUndefined();
|
|
72
|
+
expect(typeof get(engine.get("h"))[0].component).toBe("function");
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe("slot registry: isSuppressed", () => {
|
|
77
|
+
test("a claimed item is not read, not loaded and stays in the store", async () => {
|
|
78
|
+
const loads = [];
|
|
79
|
+
const registry = slotsOf({ isSuppressed: (item) => item.view === "market:NavCart" });
|
|
80
|
+
|
|
81
|
+
registry.register({
|
|
82
|
+
viewId: "navbar-right",
|
|
83
|
+
id: "cart",
|
|
84
|
+
view: "market:NavCart",
|
|
85
|
+
component: thunk(module("cart", async () => (loads.push("cart"), { n: 1 }))),
|
|
86
|
+
});
|
|
87
|
+
registry.register({
|
|
88
|
+
viewId: "navbar-right",
|
|
89
|
+
id: "other",
|
|
90
|
+
view: "market:Other",
|
|
91
|
+
component: thunk(module("other", async () => (loads.push("other"), { n: 2 }))),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
expect(get(registry.get("navbar-right")).map((item) => item.id)).toEqual(["other"]);
|
|
95
|
+
|
|
96
|
+
const resolved = await registry.executeViewLoad("navbar-right", {});
|
|
97
|
+
|
|
98
|
+
expect(resolved.map((item) => item.id)).toEqual(["other"]);
|
|
99
|
+
expect(resolved[0].props.data).toEqual({ n: 2 });
|
|
100
|
+
expect(loads).toEqual(["other"]);
|
|
101
|
+
// the claimed item was not thrown away
|
|
102
|
+
expect(get(registry.uiItems)["navbar-right"].map((item) => item.id).sort()).toEqual(["cart", "other"]);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test("register keeps `view`, `props` and `pluginId` on the item", () => {
|
|
106
|
+
const registry = slotsOf();
|
|
107
|
+
registry.register({
|
|
108
|
+
viewId: "s",
|
|
109
|
+
id: "a",
|
|
110
|
+
view: "x:Y",
|
|
111
|
+
pluginId: "pano-plugin-x",
|
|
112
|
+
props: { sidebarId: "s" },
|
|
113
|
+
component: thunk(module("a")),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const [item] = get(registry.get("s"));
|
|
117
|
+
expect(item).toMatchObject({ id: "a", view: "x:Y", pluginId: "pano-plugin-x", props: { sidebarId: "s" } });
|
|
118
|
+
expect(item.viewId).toBeUndefined();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test("re-registering an id replaces the component and keeps the order key", () => {
|
|
122
|
+
const registry = slotsOf();
|
|
123
|
+
registry.register({ viewId: "s", id: "a", component: thunk(module("one")) });
|
|
124
|
+
const seq = get(registry.uiItems).s[0]._seq;
|
|
125
|
+
const second = thunk(module("two"));
|
|
126
|
+
registry.register({ viewId: "s", id: "a", component: second, priority: 3 });
|
|
127
|
+
|
|
128
|
+
const [item] = get(registry.uiItems).s;
|
|
129
|
+
expect(item.component).toBe(second);
|
|
130
|
+
expect(item.priority).toBe(3);
|
|
131
|
+
expect(item._seq).toBe(seq);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test("normalizeItem runs after edit and drops what it returns null for, in place", () => {
|
|
135
|
+
const registry = slotsOf({ normalizeItem: (item) => (item.drop ? null : item) });
|
|
136
|
+
let given;
|
|
137
|
+
registry.edit("s", (items) => {
|
|
138
|
+
given = items;
|
|
139
|
+
items.push({ id: "keep", priority: 1 }, { id: "gone", drop: true });
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
expect(given.map((item) => item.id)).toEqual(["keep"]);
|
|
143
|
+
expect(get(registry.get("s")).map((item) => item.id)).toEqual(["keep"]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test("normalizeItem runs on upsert", () => {
|
|
147
|
+
const registry = slotsOf({ normalizeItem: (item) => (item.drop ? null : item) });
|
|
148
|
+
registry.upsert("s", { id: "a", drop: true });
|
|
149
|
+
registry.upsert("s", { id: "b" });
|
|
150
|
+
|
|
151
|
+
expect(get(registry.uiItems).s.map((item) => item.id)).toEqual(["b"]);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test("without a policy nothing changes for edit / register / load", async () => {
|
|
155
|
+
const registry = slotsOf();
|
|
156
|
+
registry.edit("s", (items) => items.push({ id: "a", component: thunk(module("a", async () => ({ z: 1 }))) }));
|
|
157
|
+
|
|
158
|
+
const resolved = await registry.executeViewLoad("s", {});
|
|
159
|
+
expect(resolved[0].props.data).toEqual({ z: 1 });
|
|
160
|
+
});
|
|
161
|
+
});
|
|
@@ -91,6 +91,35 @@ export function createSeq() {
|
|
|
91
91
|
return () => n++;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Profile-supplied item policy shared by the hook engine and the slot registry (doc 01 section 3 and 5).
|
|
96
|
+
*
|
|
97
|
+
* @typedef {Object} ItemPolicy
|
|
98
|
+
* @property {(item: any) => any} [normalizeItem] run on every registered / edited / upserted item; returns
|
|
99
|
+
* the item to keep (it may be the same object, mutated) or a falsy value to drop it. Must be idempotent.
|
|
100
|
+
* @property {(item: any) => boolean} [isSuppressed] true = the theme places this item itself, so the
|
|
101
|
+
* automatic copy is left out of reads, loads and hook positions (`getClaims().has(item.view)`).
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
/** @param {ItemPolicy} [policy] */
|
|
105
|
+
function policyOf(policy) {
|
|
106
|
+
const normalizeItem = typeof policy?.normalizeItem === "function" ? policy.normalizeItem : null;
|
|
107
|
+
const isSuppressed = typeof policy?.isSuppressed === "function" ? policy.isSuppressed : null;
|
|
108
|
+
return {
|
|
109
|
+
/** keep = item, drop = null */
|
|
110
|
+
keep: (item) => (normalizeItem ? (normalizeItem(item) ?? null) : item),
|
|
111
|
+
suppressed: (item) => {
|
|
112
|
+
if (!isSuppressed || !item || typeof item !== "object") return false;
|
|
113
|
+
try {
|
|
114
|
+
return Boolean(isSuppressed(item));
|
|
115
|
+
} catch (e) {
|
|
116
|
+
console.error("[pano] isSuppressed failed; showing the item", e);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
94
123
|
// ---------------------------------------------------------------------------
|
|
95
124
|
// Lifecycle registry
|
|
96
125
|
// ---------------------------------------------------------------------------
|
|
@@ -140,17 +169,29 @@ export function createLifecycleRegistry() {
|
|
|
140
169
|
* server/client prop synchronization; without it SSR and CSR insertion order drift and hydrate
|
|
141
170
|
* out of sync.
|
|
142
171
|
*/
|
|
143
|
-
export function createHookEngine() {
|
|
172
|
+
export function createHookEngine(policy) {
|
|
173
|
+
const { keep, suppressed } = policyOf(policy);
|
|
144
174
|
const hooks = writable({});
|
|
145
175
|
const nextSeq = createSeq();
|
|
146
176
|
|
|
147
177
|
const hookExecutionCache = new WeakMap();
|
|
148
178
|
const componentLoadCache = new WeakMap();
|
|
149
179
|
|
|
180
|
+
/**
|
|
181
|
+
* The hooks of one name in render order, theme-claimed entries left out. `getHook` and
|
|
182
|
+
* `executeHookLoad` both read this, so `hookProps[i]` always belongs to `hooks[i]`.
|
|
183
|
+
*/
|
|
184
|
+
function visibleList(all, name) {
|
|
185
|
+
return sortHooks(all[name] || []).filter((entry) => !suppressed(entry));
|
|
186
|
+
}
|
|
187
|
+
|
|
150
188
|
function register(options) {
|
|
151
189
|
const { name } = options;
|
|
190
|
+
// A copy: normalizeItem fills in the component of a `view` entry and must not touch the plugin's object.
|
|
191
|
+
const normalized = keep({ ...options });
|
|
192
|
+
if (!normalized) return;
|
|
152
193
|
// Stamp a stable registration index so server and client sort hooks identically.
|
|
153
|
-
const entry =
|
|
194
|
+
const entry = normalized._seq === undefined ? { ...normalized, _seq: nextSeq() } : normalized;
|
|
154
195
|
hooks.update((h) => {
|
|
155
196
|
if (!h[name]) h[name] = [];
|
|
156
197
|
h[name].push(entry);
|
|
@@ -162,7 +203,7 @@ export function createHookEngine() {
|
|
|
162
203
|
return derived(hooks, ($h) => {
|
|
163
204
|
// Sort by stable registration order. Deterministic order is crucial for server-client
|
|
164
205
|
// prop synchronization (see sortHooks).
|
|
165
|
-
return
|
|
206
|
+
return visibleList($h, name);
|
|
166
207
|
});
|
|
167
208
|
}
|
|
168
209
|
|
|
@@ -197,7 +238,7 @@ export function createHookEngine() {
|
|
|
197
238
|
|
|
198
239
|
const $h = get(hooks);
|
|
199
240
|
// MUST match the sort order used in the 'get' accessor (see sortHooks).
|
|
200
|
-
|
|
241
|
+
const list = visibleList($h, name);
|
|
201
242
|
|
|
202
243
|
// Resolve all modules and execute load functions in parallel
|
|
203
244
|
const results = await Promise.all(
|
|
@@ -301,8 +342,18 @@ export function createHookEngine() {
|
|
|
301
342
|
* @param {(name: string, data: any, event: any) => Promise<void>} [deps.executeLifecycle]
|
|
302
343
|
* the lifecycle registry's executor, used by executeViewLoad/executeSidebarLoad.
|
|
303
344
|
* @param {string} [deps.lifecyclePrefix] lifecycle-event namespace (default "theme").
|
|
345
|
+
* @param {ItemPolicy["normalizeItem"]} [deps.normalizeItem] see {@link ItemPolicy}
|
|
346
|
+
* @param {ItemPolicy["isSuppressed"]} [deps.isSuppressed] see {@link ItemPolicy}
|
|
304
347
|
*/
|
|
305
|
-
export function createSlotRegistry({
|
|
348
|
+
export function createSlotRegistry({
|
|
349
|
+
getPlugins,
|
|
350
|
+
browser,
|
|
351
|
+
executeLifecycle,
|
|
352
|
+
lifecyclePrefix = "theme",
|
|
353
|
+
normalizeItem,
|
|
354
|
+
isSuppressed,
|
|
355
|
+
}) {
|
|
356
|
+
const { keep, suppressed } = policyOf({ normalizeItem, isSuppressed });
|
|
306
357
|
const uiItems = writable({});
|
|
307
358
|
const nextSeq = createSeq();
|
|
308
359
|
|
|
@@ -330,12 +381,19 @@ export function createSlotRegistry({ getPlugins, browser, executeLifecycle, life
|
|
|
330
381
|
if (!items[slotId]) items[slotId] = [];
|
|
331
382
|
callback(items[slotId]);
|
|
332
383
|
deduplicateById(items[slotId]);
|
|
384
|
+
if (normalizeItem) {
|
|
385
|
+
// In place: callers hold the array they were given.
|
|
386
|
+
const kept = items[slotId].map((item) => keep(item)).filter(Boolean);
|
|
387
|
+
items[slotId].splice(0, items[slotId].length, ...kept);
|
|
388
|
+
}
|
|
333
389
|
return items;
|
|
334
390
|
});
|
|
335
391
|
}
|
|
336
392
|
|
|
337
393
|
/** Upsert a raw item by id (no dedup/priority/seq stamping) — used by alternativeMethods.add. */
|
|
338
|
-
function upsert(slotId,
|
|
394
|
+
function upsert(slotId, rawItem) {
|
|
395
|
+
const item = keep(rawItem);
|
|
396
|
+
if (!item) return;
|
|
339
397
|
uiItems.update((items) => {
|
|
340
398
|
if (!items[slotId]) items[slotId] = [];
|
|
341
399
|
const existing = items[slotId].findIndex((i) => i.id === item.id);
|
|
@@ -348,21 +406,26 @@ export function createSlotRegistry({ getPlugins, browser, executeLifecycle, life
|
|
|
348
406
|
});
|
|
349
407
|
}
|
|
350
408
|
|
|
351
|
-
function register(
|
|
352
|
-
|
|
409
|
+
function register(rawOptions) {
|
|
410
|
+
// A copy: normalizeItem fills in the component of a `view` item and must not touch the plugin's object.
|
|
411
|
+
const options = keep({ ...rawOptions });
|
|
412
|
+
if (!options) return;
|
|
413
|
+
const { viewId, id, component, priority = 10, ...extra } = options;
|
|
414
|
+
// `view`, `_view`, `props`, `pluginId` ... travel with the item; `viewId` is the container, not part of it.
|
|
353
415
|
uiItems.update((items) => {
|
|
354
416
|
if (!items[viewId]) items[viewId] = [];
|
|
355
417
|
const existingIdx = items[viewId].findIndex((i) => i.id === id);
|
|
356
418
|
if (existingIdx !== -1) {
|
|
357
419
|
items[viewId][existingIdx] = {
|
|
358
420
|
...items[viewId][existingIdx],
|
|
421
|
+
...extra,
|
|
359
422
|
component,
|
|
360
423
|
priority,
|
|
361
424
|
// Keep the original registration sequence on re-registration so order stays stable.
|
|
362
425
|
_seq: items[viewId][existingIdx]._seq ?? nextSeq(),
|
|
363
426
|
};
|
|
364
427
|
} else {
|
|
365
|
-
items[viewId].push({ id, component, priority, hidden: false, _seq: nextSeq() });
|
|
428
|
+
items[viewId].push({ ...extra, id, component, priority, hidden: false, _seq: nextSeq() });
|
|
366
429
|
}
|
|
367
430
|
return items;
|
|
368
431
|
});
|
|
@@ -397,7 +460,9 @@ export function createSlotRegistry({ getPlugins, browser, executeLifecycle, life
|
|
|
397
460
|
|
|
398
461
|
function getView(viewId) {
|
|
399
462
|
return derived(uiItems, ($items) => {
|
|
400
|
-
return ($items[viewId] || [])
|
|
463
|
+
return ($items[viewId] || [])
|
|
464
|
+
.filter((item) => !item.hidden && !suppressed(item))
|
|
465
|
+
.sort(compareViewItems);
|
|
401
466
|
});
|
|
402
467
|
}
|
|
403
468
|
|
|
@@ -406,7 +471,10 @@ export function createSlotRegistry({ getPlugins, browser, executeLifecycle, life
|
|
|
406
471
|
|
|
407
472
|
// Cache check removed because UI items are dynamic and rebuilt on navigation
|
|
408
473
|
|
|
409
|
-
const
|
|
474
|
+
const allItems = get(uiItems)[containerId] || [];
|
|
475
|
+
// Items the theme places itself are not loaded (no wasted `load`) and not shown; they stay in the store.
|
|
476
|
+
const items = allItems.filter((item) => !suppressed(item));
|
|
477
|
+
const claimed = allItems.filter((item) => suppressed(item));
|
|
410
478
|
|
|
411
479
|
const resolvedItems = await Promise.all(
|
|
412
480
|
items.map(async (item) => {
|
|
@@ -450,7 +518,7 @@ export function createSlotRegistry({ getPlugins, browser, executeLifecycle, life
|
|
|
450
518
|
}),
|
|
451
519
|
);
|
|
452
520
|
|
|
453
|
-
uiItems.update((current) => ({ ...current, [containerId]: resolvedItems }));
|
|
521
|
+
uiItems.update((current) => ({ ...current, [containerId]: [...resolvedItems, ...claimed] }));
|
|
454
522
|
uiLoadedCacheKeys.set(containerId, freshPluginCacheKey);
|
|
455
523
|
|
|
456
524
|
return resolvedItems;
|