@panomc/theme-core 1.0.0-dev.60 → 1.0.0-dev.61
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 +7 -3
- 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 -0
- 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,334 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Default markup of the engine's <HomeSidebar> (registry name "HomeSidebar", contract 1): the cards of the
|
|
3
|
+
home page sidebar. The controller (components/sidebars/HomeSidebar.svelte) owns the data, the item list
|
|
4
|
+
and the copy-to-clipboard state.
|
|
5
|
+
|
|
6
|
+
Props:
|
|
7
|
+
side "left" | "right" - which side of the content the column sits on
|
|
8
|
+
items store of { id, component, props } - the sidebar items, plugin items included;
|
|
9
|
+
unknown ids are rendered with <ViewComponent> (the place plugins inject)
|
|
10
|
+
data store of the home sidebar data: { mainServer, serverGameVersion, ipAddress, lastRegisteredUsers }
|
|
11
|
+
themeSettings object - the active theme's settings
|
|
12
|
+
avatarVersion store - cache buster of the avatar URLs
|
|
13
|
+
serverOnline boolean - the main server answers
|
|
14
|
+
isCommandTextCopied boolean - the address was copied a moment ago
|
|
15
|
+
onCopyCommandTextClick function() - copies the address
|
|
16
|
+
playCardIpText string - the address shown on the play card
|
|
17
|
+
playCardIpLength string - its length, for the no-JS size estimate
|
|
18
|
+
playCardBgImage string - background image URL of the play card ("" for none)
|
|
19
|
+
playCardOpacity number - opacity of that image
|
|
20
|
+
playCardBgStyle string - CSS of the overlay
|
|
21
|
+
playCardBorderColor string - Bootstrap border class of the play card
|
|
22
|
+
playCardHeaderClass string - Bootstrap background class of the style-1 header
|
|
23
|
+
playCardIpColor string - Bootstrap link class of the style-2 address
|
|
24
|
+
playCardBtnColor string - Bootstrap button colour of the style-1 address
|
|
25
|
+
showPlayCardStatusBadge boolean - show the online / offline badge
|
|
26
|
+
showPlayCardPlayerCount boolean - show the player count
|
|
27
|
+
showPlayCardVersionInfo boolean - show the game version
|
|
28
|
+
-->
|
|
29
|
+
<Sidebar side={side}>
|
|
30
|
+
<div class="vstack gap-3">
|
|
31
|
+
{#each $items as item (item.id)}
|
|
32
|
+
{#if item.id === "play-button"}
|
|
33
|
+
{#if (themeSettings.playCardStyle || "style-2") === "style-2"}
|
|
34
|
+
<!-- Style 2: Modern (Faded) -->
|
|
35
|
+
<div class="card position-relative overflow-hidden square-card-desktop">
|
|
36
|
+
<div
|
|
37
|
+
class="pano-home-sidebar__body card-body position-relative z-1 rounded overflow-hidden border border-2 {playCardBorderColor}">
|
|
38
|
+
<!-- Background Image -->
|
|
39
|
+
<div
|
|
40
|
+
class="position-absolute top-0 start-0 w-100 h-100"
|
|
41
|
+
style="background-image: url({playCardBgImage}); background-size: cover; background-position: {themeSettings.headerBgImagePosition ||
|
|
42
|
+
'center'}; opacity: {playCardOpacity}; z-index: -2;">
|
|
43
|
+
</div>
|
|
44
|
+
<!-- Overlay (Solid or Gradient) -->
|
|
45
|
+
<div
|
|
46
|
+
class="position-absolute top-0 start-0 w-100 h-100"
|
|
47
|
+
style="{playCardBgStyle} z-index: -1;">
|
|
48
|
+
</div>
|
|
49
|
+
<ul
|
|
50
|
+
class="pano-home-sidebar__list list-group list-group-flush text-center bg-transparent position-relative z-1">
|
|
51
|
+
<li class="pano-home-sidebar__item list-group-item border-0 py-2 bg-transparent">
|
|
52
|
+
<button
|
|
53
|
+
class="pano-home-sidebar__action btn btn-link {playCardIpColor} border-0 shadow-none text-decoration-none w-100 focus-ring play-card-ip"
|
|
54
|
+
style="--ip-len: {playCardIpLength}; --ip-max: 28px;"
|
|
55
|
+
type="button"
|
|
56
|
+
on:click={onCopyCommandTextClick}
|
|
57
|
+
use:tooltip={[
|
|
58
|
+
isCommandTextCopied
|
|
59
|
+
? $_("sidebars.home.copied")
|
|
60
|
+
: $_("sidebars.home.copy"),
|
|
61
|
+
{ placement: "top", hideOnClick: false },
|
|
62
|
+
]}>
|
|
63
|
+
<b class="d-block" bind:this={ipEl}>{playCardIpText}</b>
|
|
64
|
+
</button>
|
|
65
|
+
</li>
|
|
66
|
+
{#if showPlayCardStatusBadge}
|
|
67
|
+
<li class="pano-home-sidebar__online list-group-item border-0 py-2 bg-transparent">
|
|
68
|
+
{#if serverOnline}
|
|
69
|
+
<span class="pano-home-sidebar__badge badge text-bg-success"
|
|
70
|
+
>{$_("sidebars.home.online")}</span>
|
|
71
|
+
{:else}
|
|
72
|
+
<span class="pano-home-sidebar__offline badge text-bg-danger rounded-pill"
|
|
73
|
+
>{$_("sidebars.home.offline")}</span>
|
|
74
|
+
{/if}
|
|
75
|
+
</li>
|
|
76
|
+
{/if}
|
|
77
|
+
{#if showPlayCardPlayerCount}
|
|
78
|
+
<li class="pano-home-sidebar__playing list-group-item border-0 py-2 bg-transparent">
|
|
79
|
+
{$_("sidebars.home.playing", {
|
|
80
|
+
values: {
|
|
81
|
+
playerCount: $data.mainServer?.playerCount || 0,
|
|
82
|
+
maxPlayerCount: $data.mainServer?.maxPlayerCount || 0,
|
|
83
|
+
},
|
|
84
|
+
})}
|
|
85
|
+
</li>
|
|
86
|
+
{/if}
|
|
87
|
+
{#if showPlayCardVersionInfo}
|
|
88
|
+
<li class="pano-home-sidebar__item-2 list-group-item border-0 py-2 bg-transparent">
|
|
89
|
+
{$data.serverGameVersion}
|
|
90
|
+
</li>
|
|
91
|
+
{/if}
|
|
92
|
+
</ul>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
{:else}
|
|
96
|
+
<!-- Style 1: Default -->
|
|
97
|
+
<div class="card border-0 square-card-desktop">
|
|
98
|
+
<div
|
|
99
|
+
class="pano-home-sidebar__header card-header {playCardHeaderClass} p-0 rounded-top border-bottom border-5 {playCardBorderColor}">
|
|
100
|
+
<button
|
|
101
|
+
class="pano-home-sidebar__copied btn btn-{playCardBtnColor} border-0 shadow-none text-decoration-none w-100 focus-ring py-2 play-card-ip"
|
|
102
|
+
style="--ip-len: {playCardIpLength}; --ip-max: 24px;"
|
|
103
|
+
type="button"
|
|
104
|
+
on:click={onCopyCommandTextClick}
|
|
105
|
+
use:tooltip={[
|
|
106
|
+
isCommandTextCopied
|
|
107
|
+
? $_("sidebars.home.copied")
|
|
108
|
+
: $_("sidebars.home.copy"),
|
|
109
|
+
{ placement: "top", hideOnClick: false },
|
|
110
|
+
]}>
|
|
111
|
+
<b class="d-block" bind:this={ipEl}>{playCardIpText}</b>
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
114
|
+
<div
|
|
115
|
+
class="pano-home-sidebar__body-2 card-body position-relative z-1 overflow-hidden border border-2 {playCardBorderColor} border-top-0 rounded-bottom">
|
|
116
|
+
<!-- Background Image -->
|
|
117
|
+
<div
|
|
118
|
+
class="position-absolute top-0 start-0 w-100 h-100"
|
|
119
|
+
style="background-image: url({playCardBgImage}); background-size: cover; background-position: {themeSettings.headerBgImagePosition ||
|
|
120
|
+
'center'}; opacity: {playCardOpacity}; z-index: -2;">
|
|
121
|
+
</div>
|
|
122
|
+
<!-- Overlay (Solid or Gradient) -->
|
|
123
|
+
<div
|
|
124
|
+
class="position-absolute top-0 start-0 w-100 h-100"
|
|
125
|
+
style="{playCardBgStyle} z-index: -1;">
|
|
126
|
+
</div>
|
|
127
|
+
<ul
|
|
128
|
+
class="pano-home-sidebar__list-2 list-group list-group-flush text-center bg-transparent position-relative z-1">
|
|
129
|
+
{#if showPlayCardStatusBadge}
|
|
130
|
+
<li class="pano-home-sidebar__item-3 list-group-item border-0 py-2 bg-transparent">
|
|
131
|
+
{#if serverOnline}
|
|
132
|
+
<span class="pano-home-sidebar__badge-2 badge text-bg-success"
|
|
133
|
+
>{$_("sidebars.home.online")}</span>
|
|
134
|
+
{:else}
|
|
135
|
+
<span class="pano-home-sidebar__badge-3 badge text-bg-danger rounded-pill"
|
|
136
|
+
>{$_("sidebars.home.offline")}</span>
|
|
137
|
+
{/if}
|
|
138
|
+
</li>
|
|
139
|
+
{/if}
|
|
140
|
+
{#if showPlayCardPlayerCount}
|
|
141
|
+
<li class="pano-home-sidebar__item-4 list-group-item border-0 py-2 bg-transparent">
|
|
142
|
+
{$_("sidebars.home.playing", {
|
|
143
|
+
values: {
|
|
144
|
+
playerCount: $data.mainServer?.playerCount || 0,
|
|
145
|
+
maxPlayerCount: $data.mainServer?.maxPlayerCount || 0,
|
|
146
|
+
},
|
|
147
|
+
})}
|
|
148
|
+
</li>
|
|
149
|
+
{/if}
|
|
150
|
+
{#if showPlayCardVersionInfo}
|
|
151
|
+
<li class="pano-home-sidebar__item-5 list-group-item border-0 py-2 bg-transparent">
|
|
152
|
+
{$data.serverGameVersion}
|
|
153
|
+
</li>
|
|
154
|
+
{/if}
|
|
155
|
+
</ul>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
{/if}
|
|
159
|
+
{:else if item.id === "server-info"}
|
|
160
|
+
<!-- Merged into play-button -->
|
|
161
|
+
{:else if item.id === "last-registrants"}
|
|
162
|
+
<!-- Last Registrants Snippet -->
|
|
163
|
+
<div
|
|
164
|
+
class="card position-relative overflow-hidden mb-lg-0 mb-3 square-card-desktop"
|
|
165
|
+
hidden={typeof themeSettings.sidebarCarts?.lastRegistrants ===
|
|
166
|
+
"undefined"
|
|
167
|
+
? false
|
|
168
|
+
: !themeSettings.sidebarCarts.lastRegistrants}>
|
|
169
|
+
<CardHeader headerClasses="bg-transparent">
|
|
170
|
+
<div slot="left">
|
|
171
|
+
{$_("sidebars.home.last-registrants")}
|
|
172
|
+
</div>
|
|
173
|
+
</CardHeader>
|
|
174
|
+
<div class="pano-home-sidebar__body-3 card-body pt-3 d-flex flex-column justify-content-start">
|
|
175
|
+
<div class="row g-3 justify-content-evenly align-items-start align-content-start">
|
|
176
|
+
{#each $data.lastRegisteredUsers || [] as player, index (player)}
|
|
177
|
+
<div class="col-auto">
|
|
178
|
+
<a
|
|
179
|
+
href={route(`/player/${player.username}`)}
|
|
180
|
+
class="d-inline-block rounded focus-ring">
|
|
181
|
+
<img
|
|
182
|
+
alt={player.username}
|
|
183
|
+
class="pano-home-sidebar__image rounded"
|
|
184
|
+
class:border={player.lastActivityTime > Date.now() - 300000 || player.inGame}
|
|
185
|
+
class:border-2={player.lastActivityTime > Date.now() - 300000 || player.inGame}
|
|
186
|
+
class:border-success={player.lastActivityTime > Date.now() - 300000 || player.inGame}
|
|
187
|
+
src="/api/v1/profile/picture/{player.username}?{$avatarVersion}"
|
|
188
|
+
use:tooltip={[player.username, { placement: "bottom" }]}
|
|
189
|
+
width="48"
|
|
190
|
+
height="48" />
|
|
191
|
+
</a>
|
|
192
|
+
</div>
|
|
193
|
+
{/each}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
{:else}
|
|
198
|
+
<!-- External Component -->
|
|
199
|
+
<ViewComponent
|
|
200
|
+
component={item.component}
|
|
201
|
+
data={$data}
|
|
202
|
+
{...item.props} />
|
|
203
|
+
{/if}
|
|
204
|
+
{/each}
|
|
205
|
+
</div>
|
|
206
|
+
</Sidebar>
|
|
207
|
+
|
|
208
|
+
<script>
|
|
209
|
+
import { onMount } from "svelte";
|
|
210
|
+
import { _ } from "svelte-i18n";
|
|
211
|
+
import tooltip from "$pano/lib/tooltip.util";
|
|
212
|
+
import { route } from "$pano/registry/routes.js";
|
|
213
|
+
import Sidebar from "$pano/lib/components/Sidebar.svelte";
|
|
214
|
+
import CardHeader from "$pano/lib/components/CardHeader.svelte";
|
|
215
|
+
import ViewComponent from "$pano/lib/components/ViewComponent.svelte";
|
|
216
|
+
|
|
217
|
+
export let side;
|
|
218
|
+
export let items;
|
|
219
|
+
export let data;
|
|
220
|
+
export let themeSettings;
|
|
221
|
+
export let avatarVersion;
|
|
222
|
+
export let serverOnline;
|
|
223
|
+
export let isCommandTextCopied;
|
|
224
|
+
export let onCopyCommandTextClick;
|
|
225
|
+
export let playCardIpText;
|
|
226
|
+
export let playCardIpLength;
|
|
227
|
+
export let playCardBgImage;
|
|
228
|
+
export let playCardOpacity;
|
|
229
|
+
export let playCardBgStyle;
|
|
230
|
+
export let playCardBorderColor;
|
|
231
|
+
export let playCardHeaderClass;
|
|
232
|
+
export let playCardIpColor;
|
|
233
|
+
export let playCardBtnColor;
|
|
234
|
+
export let showPlayCardStatusBadge;
|
|
235
|
+
export let showPlayCardPlayerCount;
|
|
236
|
+
export let showPlayCardVersionInfo;
|
|
237
|
+
|
|
238
|
+
/* Address fit — see the stylesheet for why the CSS alone is not enough.
|
|
239
|
+
Measuring beats guessing at per-character width: reset to the maximum,
|
|
240
|
+
compare what the text wants against what the button gives it, and scale by
|
|
241
|
+
that ratio. Runs on mount, whenever the address changes, once webfonts have
|
|
242
|
+
settled (metrics shift under the fallback face), and on resize. */
|
|
243
|
+
const IP_MIN_PX = 13.6; // 0.85rem — matches the clamp floor
|
|
244
|
+
|
|
245
|
+
let ipEl;
|
|
246
|
+
|
|
247
|
+
function fitIpText() {
|
|
248
|
+
const el = ipEl;
|
|
249
|
+
if (!el) return;
|
|
250
|
+
|
|
251
|
+
const max = parseFloat(getComputedStyle(el).getPropertyValue("--ip-max")) || 28;
|
|
252
|
+
|
|
253
|
+
el.style.whiteSpace = "";
|
|
254
|
+
el.style.fontSize = `${max}px`;
|
|
255
|
+
|
|
256
|
+
const available = el.clientWidth;
|
|
257
|
+
if (!available) return;
|
|
258
|
+
|
|
259
|
+
// Two passes: scaling by the first ratio overshoots slightly because
|
|
260
|
+
// letter-spacing does not scale with the font, so re-measure and correct.
|
|
261
|
+
let size = max;
|
|
262
|
+
for (let pass = 0; pass < 2 && el.scrollWidth > available; pass++) {
|
|
263
|
+
size = Math.max(IP_MIN_PX, (size * available) / el.scrollWidth);
|
|
264
|
+
el.style.fontSize = `${size}px`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// An address long enough to hit the legibility floor wraps onto a second
|
|
268
|
+
// line — still the whole address, which cutting it off would not be.
|
|
269
|
+
el.style.whiteSpace = el.scrollWidth > available ? "normal" : "";
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Re-fit when the address changes; ipEl is undefined until mounted and on the
|
|
273
|
+
// server, so this is a no-op there.
|
|
274
|
+
$: playCardIpText, ipEl && fitIpText();
|
|
275
|
+
|
|
276
|
+
onMount(() => {
|
|
277
|
+
fitIpText();
|
|
278
|
+
|
|
279
|
+
const observer = new ResizeObserver(fitIpText);
|
|
280
|
+
if (ipEl?.parentElement) observer.observe(ipEl.parentElement);
|
|
281
|
+
|
|
282
|
+
document.fonts?.ready.then(fitIpText).catch(() => {});
|
|
283
|
+
|
|
284
|
+
return () => observer.disconnect();
|
|
285
|
+
});
|
|
286
|
+
</script>
|
|
287
|
+
|
|
288
|
+
<style>
|
|
289
|
+
/* The server address is site-supplied and routinely longer than a stock
|
|
290
|
+
"play.example.com", so the old fixed .fs-3 overflowed the card and got cut
|
|
291
|
+
off by .text-truncate — an ellipsised address is worse than useless, since
|
|
292
|
+
the whole point of the card is that you can read and copy it. It now
|
|
293
|
+
shrinks to fit instead.
|
|
294
|
+
|
|
295
|
+
This rule is the server-rendered / no-JS baseline: the button is a size
|
|
296
|
+
container, so 100cqi is exactly the width the address has to live in, and
|
|
297
|
+
0.72em is a deliberately pessimistic per-character advance — themes ship
|
|
298
|
+
very different faces (a wide serif costs far more per character than a
|
|
299
|
+
narrow sans), so this errs small rather than risk clipping. fitIpText()
|
|
300
|
+
then measures the real text on mount and hands back whatever headroom the
|
|
301
|
+
estimate gave away, which is why --ip-max is in px: it is read from here. */
|
|
302
|
+
.play-card-ip {
|
|
303
|
+
container-type: inline-size;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.play-card-ip b {
|
|
307
|
+
font-size: clamp(
|
|
308
|
+
0.85rem,
|
|
309
|
+
calc(100cqi / (var(--ip-len, 16) * 0.72)),
|
|
310
|
+
var(--ip-max, 28px)
|
|
311
|
+
);
|
|
312
|
+
line-height: 1.25;
|
|
313
|
+
white-space: nowrap;
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
/* inert while nowrap holds; it only matters once fitIpText() lets an
|
|
316
|
+
over-long address wrap, and an address has no spaces to break at. */
|
|
317
|
+
overflow-wrap: anywhere;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@media (min-width: 992px) {
|
|
321
|
+
.square-card-desktop {
|
|
322
|
+
aspect-ratio: 1 / 1;
|
|
323
|
+
display: flex;
|
|
324
|
+
flex-direction: column;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.square-card-desktop :global(.card-body) {
|
|
328
|
+
flex: 1;
|
|
329
|
+
display: flex;
|
|
330
|
+
flex-direction: column;
|
|
331
|
+
justify-content: center;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Default markup of the engine's <LogoutSessionConfirmModal> (registry name "LogoutSessionConfirmModal", contract 1).
|
|
3
|
+
A Bootstrap modal: show() finds it by id and opens it, so the root element must keep that id.
|
|
4
|
+
|
|
5
|
+
Props:
|
|
6
|
+
dialogID string - the id of the modal root element
|
|
7
|
+
hide function() - cancel: closes the modal
|
|
8
|
+
onYesClick function() - confirm: closes the modal and runs the callback (logs out)
|
|
9
|
+
-->
|
|
10
|
+
<div
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
class="pano-logout-session-confirm-modal modal fade"
|
|
13
|
+
id="{dialogID}"
|
|
14
|
+
role="dialog"
|
|
15
|
+
tabindex="-1">
|
|
16
|
+
<div class="modal-dialog modal-dialog-centered" role="dialog">
|
|
17
|
+
<div class="modal-content">
|
|
18
|
+
<div class="pano-logout-session-confirm-modal__body modal-body text-center">
|
|
19
|
+
<div class="pb-3">
|
|
20
|
+
<i class="fas fa-question-circle fa-3x d-block m-auto text-gray"></i>
|
|
21
|
+
</div>
|
|
22
|
+
{$_("components.modals.logout-session-confirm.title")}
|
|
23
|
+
</div>
|
|
24
|
+
<div class="pano-logout-session-confirm-modal__footer modal-footer flex-nowrap">
|
|
25
|
+
<button
|
|
26
|
+
class="pano-logout-session-confirm-modal__action btn btn-link col-6 m-0"
|
|
27
|
+
type="button"
|
|
28
|
+
onclick={hide}>
|
|
29
|
+
{$_("buttons.cancel")}
|
|
30
|
+
</button>
|
|
31
|
+
<button
|
|
32
|
+
class="pano-logout-session-confirm-modal__yes btn btn-danger col-6 m-0"
|
|
33
|
+
type="button"
|
|
34
|
+
onclick={onYesClick}>{$_("buttons.yes")}</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { _ } from "svelte-i18n";
|
|
42
|
+
|
|
43
|
+
export let dialogID;
|
|
44
|
+
export let hide;
|
|
45
|
+
export let onYesClick;
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Default markup of the engine's <Main> (registry name "Main", contract 1). The controller
|
|
3
|
+
(lib/components/Main.svelte) resolves the theme's override or this file and passes the props below.
|
|
4
|
+
|
|
5
|
+
Props:
|
|
6
|
+
dev boolean - SvelteKit dev flag
|
|
7
|
+
devUi boolean - true while the theme's UI dev server runs (it serves /style.css itself)
|
|
8
|
+
pageTitle store - the page's title value (string key or object)
|
|
9
|
+
resolvedTitle { title, subtitle, hidden } - the translated title
|
|
10
|
+
sidebar store - the sidebar component for this page (or null)
|
|
11
|
+
sidebarProps store - props of the sidebar component
|
|
12
|
+
sidebarEnabled boolean - the theme setting
|
|
13
|
+
sidebarPosition "LEFT" | "RIGHT"
|
|
14
|
+
Slot: the routed page content.
|
|
15
|
+
-->
|
|
16
|
+
<svelte:head>
|
|
17
|
+
{#if dev && !devUi}
|
|
18
|
+
<link rel="stylesheet" href={stylesheet} />
|
|
19
|
+
{/if}
|
|
20
|
+
</svelte:head>
|
|
21
|
+
|
|
22
|
+
<!-- Main Container -->
|
|
23
|
+
<main class="pano-main container">
|
|
24
|
+
|
|
25
|
+
{#if $pageTitle && !resolvedTitle.hidden}
|
|
26
|
+
{@const isString = typeof $pageTitle === "string"}
|
|
27
|
+
<div class="row">
|
|
28
|
+
<div class="col-12 mb-3">
|
|
29
|
+
<PageTitle
|
|
30
|
+
title={resolvedTitle.title}
|
|
31
|
+
subtitle={resolvedTitle.subtitle}
|
|
32
|
+
html={isString ? undefined : $pageTitle.html}
|
|
33
|
+
subtitleHtml={isString ? undefined : $pageTitle.subtitleHtml} />
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
37
|
+
|
|
38
|
+
<div class="row gx-3 align-items-start">
|
|
39
|
+
{#if sidebarEnabled}
|
|
40
|
+
<svelte:component
|
|
41
|
+
this={$sidebar}
|
|
42
|
+
{...{
|
|
43
|
+
...$sidebarProps,
|
|
44
|
+
side: sidebarPosition === "LEFT" ? "left" : "right",
|
|
45
|
+
}} />
|
|
46
|
+
{/if}
|
|
47
|
+
|
|
48
|
+
<!-- Content -->
|
|
49
|
+
<div class:col={!sidebarEnabled} class:col-lg-8={sidebarEnabled && $sidebar}>
|
|
50
|
+
<slot />
|
|
51
|
+
</div>
|
|
52
|
+
<!-- Content End -->
|
|
53
|
+
</div>
|
|
54
|
+
</main>
|
|
55
|
+
|
|
56
|
+
<!-- Main Container End -->
|
|
57
|
+
<script>
|
|
58
|
+
import PageTitle from "$pano/lib/components/PageTitle.svelte";
|
|
59
|
+
|
|
60
|
+
export let dev = false;
|
|
61
|
+
export let devUi = false;
|
|
62
|
+
export let pageTitle;
|
|
63
|
+
export let resolvedTitle;
|
|
64
|
+
export let sidebar;
|
|
65
|
+
export let sidebarProps;
|
|
66
|
+
export let sidebarEnabled = true;
|
|
67
|
+
export let sidebarPosition = "RIGHT";
|
|
68
|
+
|
|
69
|
+
// The theme's compiled stylesheet, served by the dev server only (a static asset, not a route).
|
|
70
|
+
const stylesheet = "/style.css";
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Default markup of the engine's <NotificationContainer> (registry name "NotificationContainer", contract 1):
|
|
3
|
+
the toast stack of new site notifications.
|
|
4
|
+
|
|
5
|
+
Props:
|
|
6
|
+
notifications store - the notifications on screen (objects of the notifications API)
|
|
7
|
+
checkTime number - tick counter, passed to getTime so the relative times refresh
|
|
8
|
+
currentLanguage store - active language object; .dateFnsCode selects the date-fns locale
|
|
9
|
+
locales object - the date-fns locale namespace
|
|
10
|
+
avatarVersion store - cache-busting version appended to profile picture URLs
|
|
11
|
+
getTime function(checkTime, time, locale) - relative "time ago" text
|
|
12
|
+
onNotificationClick function(notification, navigate) - runs the notification's listener, or navigates
|
|
13
|
+
navigate function(path) - goto(base + path)
|
|
14
|
+
notificationTextKey function(notification) - the translation key of the notification text
|
|
15
|
+
sanitizeObject function(details) - escapes detail values before {@html} interpolation
|
|
16
|
+
onClick function(notification) - the whole-card click: marks it read, follows it, hides it
|
|
17
|
+
-->
|
|
18
|
+
<div class="pano-notification-container toast-container position-fixed bottom-0 end-0 p-3 d-xl-block d-none">
|
|
19
|
+
{#each $notifications as notification, index (notification)}
|
|
20
|
+
<article
|
|
21
|
+
id="notificationToast{notification.id}"
|
|
22
|
+
class="toast position-relative"
|
|
23
|
+
aria-live="assertive"
|
|
24
|
+
aria-atomic="true">
|
|
25
|
+
|
|
26
|
+
<div class="toast-header text-bg-primary">
|
|
27
|
+
<strong class="me-auto">
|
|
28
|
+
{$_("components.notification-container.notification")}
|
|
29
|
+
</strong>
|
|
30
|
+
<small>
|
|
31
|
+
{getTime(
|
|
32
|
+
checkTime,
|
|
33
|
+
parseInt(notification.createdAt),
|
|
34
|
+
locales[$currentLanguage.dateFnsCode],
|
|
35
|
+
)}
|
|
36
|
+
</small>
|
|
37
|
+
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
class="btn-close btn-close-white position-relative z-3"
|
|
41
|
+
aria-label="{$_('buttons.close')}"
|
|
42
|
+
data-bs-dismiss="toast"
|
|
43
|
+
on:click|stopPropagation>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="toast-body">
|
|
48
|
+
<div
|
|
49
|
+
class="pano-notification-container__item fw-normal list-group-item list-group-item-action d-flex align-items-center gap-3 text-wrap">
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
title={$_("buttons.view")}
|
|
53
|
+
on:click={() => onNotificationClick(notification, navigate)}
|
|
54
|
+
class="text-start border-0 bg-transparent p-0 d-flex align-items-center gap-3">
|
|
55
|
+
|
|
56
|
+
<span class="d-flex align-items-center">
|
|
57
|
+
{#if notification.details.faIcon}
|
|
58
|
+
<i class="{notification.details.faIcon} fa-fw"></i>
|
|
59
|
+
{:else if notification.details.image || notification.details.username}
|
|
60
|
+
<img
|
|
61
|
+
src="{notification.details.image || `/api/v1/profile/picture/${notification.details.username}?${$avatarVersion}`}"
|
|
62
|
+
alt="{$_('buttons.view')}"
|
|
63
|
+
width="48"
|
|
64
|
+
height="48"
|
|
65
|
+
class="pano-notification-container__image rounded" />
|
|
66
|
+
{:else}
|
|
67
|
+
<i class="fa fa-fw fa-bolt"></i>
|
|
68
|
+
{/if}
|
|
69
|
+
</span>
|
|
70
|
+
|
|
71
|
+
<span class="text-start">
|
|
72
|
+
<span class="text-wrap markdown-renderer text-break">
|
|
73
|
+
{@html $_(notificationTextKey(notification), {
|
|
74
|
+
values: { ...sanitizeObject(notification.details || {}) },
|
|
75
|
+
default: $_('notifications.UNKNOWN')
|
|
76
|
+
})}
|
|
77
|
+
</span>
|
|
78
|
+
</span>
|
|
79
|
+
</button>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- Invisible button covering whole area without creating spacing -->
|
|
84
|
+
<button
|
|
85
|
+
type="button"
|
|
86
|
+
class="stretched-link p-0 border-0 bg-transparent position-absolute top-0 start-0 w-100 h-100"
|
|
87
|
+
aria-label={$_("buttons.view")}
|
|
88
|
+
on:click={() => onClick(notification)}>
|
|
89
|
+
</button>
|
|
90
|
+
</article>
|
|
91
|
+
|
|
92
|
+
{/each}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<script>
|
|
96
|
+
import { _ } from "svelte-i18n";
|
|
97
|
+
|
|
98
|
+
export let notifications;
|
|
99
|
+
export let checkTime;
|
|
100
|
+
export let currentLanguage;
|
|
101
|
+
export let locales;
|
|
102
|
+
export let avatarVersion;
|
|
103
|
+
export let getTime;
|
|
104
|
+
export let onNotificationClick;
|
|
105
|
+
export let navigate;
|
|
106
|
+
export let notificationTextKey;
|
|
107
|
+
export let sanitizeObject;
|
|
108
|
+
export let onClick;
|
|
109
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Default markup of the engine's <PlayerDetailSidebar> (registry name "PlayerDetailSidebar", contract 1):
|
|
3
|
+
the player card beside a player's page. The controller (components/sidebars/PlayerDetailSidebar.svelte)
|
|
4
|
+
owns the data, the item list and the clock.
|
|
5
|
+
|
|
6
|
+
Props:
|
|
7
|
+
side "left" | "right" - which side of the content the column sits on
|
|
8
|
+
items store of { id, component, props } - the sidebar items, plugin items included;
|
|
9
|
+
unknown ids are rendered with <ViewComponent> (the place plugins inject)
|
|
10
|
+
data store of { username, lastActivityTime, inGame, permissionGroupName, banned }
|
|
11
|
+
checkTime number - ticks every second, re-renders the "last seen" texts
|
|
12
|
+
-->
|
|
13
|
+
<Sidebar side={side}>
|
|
14
|
+
<div class="vstack gap-3">
|
|
15
|
+
{#each $items as item (item.id)}
|
|
16
|
+
{#if item.id === 'player-info'}
|
|
17
|
+
<!-- Player Info Snippet -->
|
|
18
|
+
<div class="card border-0 square-card-desktop">
|
|
19
|
+
<div class="pano-player-detail-sidebar__body card-body vstack gap-3">
|
|
20
|
+
<PlayerHead
|
|
21
|
+
username={$data.username}
|
|
22
|
+
inGame={$data.inGame}
|
|
23
|
+
banned={$data.banned}
|
|
24
|
+
lastActivityTime={$data.lastActivityTime}
|
|
25
|
+
checkTime={checkTime}
|
|
26
|
+
width="64"
|
|
27
|
+
height="64" />
|
|
28
|
+
|
|
29
|
+
<PageTitle title={$data.username} breadcrumb={false} />
|
|
30
|
+
|
|
31
|
+
<div class="text-center">
|
|
32
|
+
<PlayerStatusBadge
|
|
33
|
+
banned={$data.banned}
|
|
34
|
+
lastActivityTime={$data.lastActivityTime}
|
|
35
|
+
inGame={$data.inGame}
|
|
36
|
+
checkTime={checkTime} />
|
|
37
|
+
</div>
|
|
38
|
+
<div class="text-center">
|
|
39
|
+
<PlayerPermissionBadge
|
|
40
|
+
permissionGroupName={$data.permissionGroupName} />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
{:else}
|
|
45
|
+
<!-- External Component -->
|
|
46
|
+
<ViewComponent component={item.component} data={$data} checkTime={checkTime} {...item.props} />
|
|
47
|
+
{/if}
|
|
48
|
+
{/each}
|
|
49
|
+
</div>
|
|
50
|
+
</Sidebar>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import Sidebar from "$pano/lib/components/Sidebar.svelte";
|
|
54
|
+
import ViewComponent from "$pano/lib/components/ViewComponent.svelte";
|
|
55
|
+
import PlayerPermissionBadge from "$pano/lib/components/PlayerPermissionBadge.svelte";
|
|
56
|
+
import PlayerStatusBadge from "$pano/lib/components/PlayerStatusBadge.svelte";
|
|
57
|
+
import PlayerHead from "$pano/lib/components/PlayerHead.svelte";
|
|
58
|
+
import PageTitle from "$pano/lib/components/PageTitle.svelte";
|
|
59
|
+
|
|
60
|
+
export let side;
|
|
61
|
+
export let items;
|
|
62
|
+
export let data;
|
|
63
|
+
export let checkTime;
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
@media (min-width: 992px) {
|
|
68
|
+
.square-card-desktop {
|
|
69
|
+
aspect-ratio: 1 / 1;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.square-card-desktop :global(.card-body) {
|
|
75
|
+
flex: 1;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|