studiocms 0.1.0-beta.25 → 0.1.0-beta.26
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/CHANGELOG.md +91 -0
- package/dist/cli/users/steps/libsqlCreateUsers.js +1 -3
- package/dist/cli/users/steps/libsqlModifyUsers.js +1 -3
- package/dist/components/auth/OAuthButton.astro +1 -1
- package/dist/components/auth/OAuthButtonStack.astro +1 -1
- package/dist/components/auth/component-scripts/formListener.js +1 -1
- package/dist/components/dashboard/BaseHead.astro +6 -17
- package/dist/components/dashboard/DashboardGrid.astro +2 -2
- package/dist/components/dashboard/DashboardGridItem.astro +2 -1
- package/dist/components/dashboard/DashboardPageHeader.astro +8 -4
- package/dist/components/dashboard/DoubleSidebar.astro +2 -2
- package/dist/components/dashboard/LoginChecker.astro +3 -2
- package/dist/components/dashboard/MainSidebarContent.astro +16 -12
- package/dist/components/dashboard/PageHeader.astro +3 -2
- package/dist/components/dashboard/SidebarLink.astro +5 -5
- package/dist/components/dashboard/SidebarPluginLink.astro +3 -3
- package/dist/components/dashboard/SingleSidebar.astro +2 -2
- package/dist/components/dashboard/configuration/ConfigForm.astro +49 -47
- package/dist/components/dashboard/configuration/LoginPreview.astro +6 -4
- package/dist/components/dashboard/content-mgmt/CreateFolder.astro +3 -2
- package/dist/components/dashboard/content-mgmt/CreatePage.astro +8 -5
- package/dist/components/dashboard/content-mgmt/EditFolder.astro +3 -2
- package/dist/components/dashboard/content-mgmt/EditPage.astro +25 -13
- package/dist/components/dashboard/content-mgmt/InnerSidebarElement.astro +23 -15
- package/dist/components/dashboard/content-mgmt/PageHeader.astro +23 -14
- package/dist/components/dashboard/content-mgmt/PluginFields.astro +6 -1
- package/dist/components/dashboard/content-mgmt/TreeRenderer.astro +6 -6
- package/dist/components/dashboard/content-mgmt/TreeSidebarFolder.astro +4 -4
- package/dist/components/dashboard/content-mgmt/TreeSidebarLink.astro +4 -4
- package/dist/components/dashboard/plugins/SettingsRenderer.astro +6 -1
- package/dist/components/dashboard/profile/APITokens.astro +14 -8
- package/dist/components/dashboard/profile/BasicInfo.astro +8 -4
- package/dist/components/dashboard/profile/Notifications.astro +7 -4
- package/dist/components/dashboard/profile/SocialSignin.astro +8 -5
- package/dist/components/dashboard/profile/UpdatePassword.astro +6 -3
- package/dist/components/dashboard/sidebar/UserAccount.astro +1 -2
- package/dist/components/dashboard/sidebar/VersionCheck.astro +7 -7
- package/dist/components/dashboard/sidebar/VersionCheckChangelog.astro +28 -6
- package/dist/components/dashboard/sidebar-modals/UserManagementModals.astro +8 -3
- package/dist/components/dashboard/sidebar-modals/VersionModal.astro +16 -15
- package/dist/components/dashboard/sidebarConfig.d.ts +2 -2
- package/dist/components/dashboard/sidebarConfig.js +6 -6
- package/dist/components/dashboard/user-mgmt/InnerSidebarElement.astro +16 -9
- package/dist/components/dashboard/user-mgmt/RankCheck.astro +6 -8
- package/dist/components/dashboard/user-mgmt/SocialSignin.astro +9 -10
- package/dist/components/dashboard/user-mgmt/UserListItem.astro +8 -6
- package/dist/components/default-grid-items/Recently-created-pages.astro +11 -9
- package/dist/components/default-grid-items/Recently-signed-up.astro +8 -8
- package/dist/components/default-grid-items/Recently-updated-pages.astro +11 -9
- package/dist/components/default-grid-items/Totals.astro +7 -6
- package/dist/components/first-time-setup/PageHeader.astro +4 -3
- package/dist/components/shared/SSRUser.astro +200 -0
- package/dist/components/shared/head/Favicons.astro +6 -0
- package/dist/components/shared/head/Global.astro +4 -0
- package/dist/components/shared/head/TitleTags.astro +14 -0
- package/dist/config.d.ts +1 -4
- package/dist/consts.d.ts +34 -1
- package/dist/consts.js +42 -1
- package/dist/db/config.d.ts +22 -37
- package/dist/db/config.js +14 -2
- package/dist/handlers/astroConfigCheck.js +1 -1
- package/dist/handlers/changelog.d.ts +1 -0
- package/dist/handlers/changelog.js +54 -0
- package/dist/handlers/index.d.ts +1 -2
- package/dist/handlers/index.js +2 -4
- package/dist/handlers/pluginHandler.d.ts +2 -1
- package/dist/handlers/pluginHandler.js +14 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +115 -107
- package/dist/integrations/dynamic-sitemap/index.js +1 -1
- package/dist/integrations/webVitals/checkForWebVitalsPlugin.js +3 -3
- package/dist/integrations/webVitals/dashboard-grid-items/CoreVitals.astro +1 -1
- package/dist/integrations/webVitals/dashboard-grid-items/MetricCard.astro +3 -2
- package/dist/integrations/webVitals/dashboard-grid-items/SummaryCard.astro +2 -2
- package/dist/integrations/webVitals/dashboard-grid-items/metric.css +17 -17
- package/dist/integrations/webVitals/dashboard-grid-items/shared.d.ts +4 -4
- package/dist/integrations/webVitals/dashboard-grid-items/shared.js +3 -3
- package/dist/integrations/webVitals/pages/analytics/body.astro +10 -9
- package/dist/integrations/webVitals/utils/webVitalsUtils.d.ts +9 -9
- package/dist/layouts/AuthLayout.astro +7 -18
- package/dist/layouts/DashboardLayout.astro +3 -2
- package/dist/layouts/FirstTimeSetupLayout.astro +7 -18
- package/dist/middleware/index.js +3 -13
- package/dist/middleware/utils.d.ts +1 -1
- package/dist/middleware/utils.js +8 -5
- package/dist/routes/api/auth/login.js +1 -6
- package/dist/routes/api/auth/logout.js +3 -2
- package/dist/routes/api/auth/register.js +1 -7
- package/dist/routes/api/dashboard/content/page.js +5 -5
- package/dist/routes/api/dashboard/create-user-invite.js +1 -1
- package/dist/routes/api/dashboard/create-user.d.ts +0 -7
- package/dist/routes/api/dashboard/create-user.js +18 -23
- package/dist/routes/api/dashboard/email-notification-settings-site.js +10 -0
- package/dist/routes/api/dashboard/profile.js +1 -1
- package/dist/routes/api/dashboard/reset-password.js +1 -1
- package/dist/routes/api/dashboard/users.js +27 -10
- package/dist/routes/api/dashboard/verify-email.js +5 -2
- package/dist/routes/api/dashboard/verify-session.js +3 -2
- package/dist/routes/api/rest/utils/auth-token.d.ts +1 -1
- package/dist/routes/api/rest/v1/pages/[id]/index.js +3 -10
- package/dist/routes/api/rest/v1/users/[id].js +24 -23
- package/dist/routes/api/rest/v1/users/index.js +1 -1
- package/dist/routes/api/sdk/utils/changelog.d.ts +0 -15
- package/dist/routes/api/sdk/utils/changelog.js +9 -112
- package/dist/routes/auth/login.astro +16 -9
- package/dist/routes/auth/signup.astro +2 -1
- package/dist/routes/dashboard/configuration.astro +3 -2
- package/dist/routes/dashboard/content-management/createfolder.astro +1 -1
- package/dist/routes/dashboard/content-management/createpage.astro +1 -1
- package/dist/routes/dashboard/content-management/diff.astro +8 -5
- package/dist/routes/dashboard/content-management/index.astro +1 -1
- package/dist/routes/dashboard/password-reset.astro +8 -5
- package/dist/routes/dashboard/plugins/[plugin].astro +4 -3
- package/dist/routes/dashboard/smtp-configuration.astro +21 -10
- package/dist/routes/dashboard/unverified-email.astro +2 -4
- package/dist/routes/dashboard/user-management/edit.astro +30 -22
- package/dist/routes/dashboard/user-management/index.astro +2 -2
- package/dist/routes/error-pages/404.astro +1 -1
- package/dist/routes/firstTimeSetupRoutes/1-start.astro +15 -14
- package/dist/routes/firstTimeSetupRoutes/2-next.astro +14 -11
- package/dist/routes/firstTimeSetupRoutes/3-done.astro +3 -2
- package/dist/routes/firstTimeSetupRoutes/api/step-2.js +1 -1
- package/dist/schemas/plugins/index.d.ts +64 -64
- package/dist/schemas/plugins/shared.d.ts +84 -84
- package/dist/schemas/plugins/shared.js +10 -16
- package/dist/styles/404.css +1 -1
- package/dist/styles/code-component.css +8 -8
- package/dist/styles/dashboard-base.css +29 -29
- package/dist/styles/dashboard-diff.css +31 -31
- package/dist/types.d.ts +2 -22
- package/dist/utils/effects/smtp.d.ts +2 -3
- package/dist/utils/effects/smtp.js +5 -1
- package/dist/utils/safeString.d.ts +1 -1
- package/dist/utils/safeString.js +1 -3
- package/dist/utils/stripIconify.d.ts +13 -0
- package/dist/utils/stripIconify.js +11 -0
- package/dist/utils/tinyMDParser.js +5 -5
- package/dist/virtual.d.ts +17 -60
- package/dist/virtuals/auth/core.d.ts +91 -0
- package/dist/virtuals/auth/core.js +45 -0
- package/dist/virtuals/auth/index.d.ts +1 -4
- package/dist/virtuals/auth/index.js +1 -4
- package/dist/virtuals/auth/verify-email.d.ts +3 -3
- package/dist/virtuals/i18n/LanguageSelector.astro +1 -1
- package/dist/virtuals/i18n/client.d.ts +100 -4
- package/dist/virtuals/i18n/client.js +11 -10
- package/dist/virtuals/i18n/config.d.ts +417 -3
- package/dist/virtuals/i18n/config.js +22 -1
- package/dist/virtuals/i18n/server.d.ts +116 -0
- package/dist/virtuals/i18n/{index.js → server.js} +6 -19
- package/dist/virtuals/i18n/v-files.d.ts +30 -0
- package/dist/virtuals/i18n/v-files.js +46 -0
- package/dist/virtuals/lib/head.d.ts +1 -25
- package/dist/virtuals/lib/head.js +1 -73
- package/dist/virtuals/lib/headDefaults.d.ts +2 -2
- package/dist/virtuals/lib/pathGenerators.d.ts +1 -20
- package/dist/virtuals/lib/pathGenerators.js +1 -66
- package/dist/virtuals/lib/urlGen.d.ts +2 -1
- package/dist/virtuals/lib/urlGen.js +4 -24
- package/dist/virtuals/mailer/index.d.ts +4 -34
- package/dist/virtuals/mailer/index.js +3 -16
- package/dist/virtuals/plugins/dashboard-pages.d.ts +8 -8
- package/dist/virtuals/scripts/user-quick-tools.d.ts +3 -2
- package/dist/virtuals/scripts/user-quick-tools.js +135 -53
- package/dist/virtuals/sdk/effect/collectors.d.ts +1 -1
- package/dist/virtuals/sdk/effect/foldertree.d.ts +1 -1
- package/dist/virtuals/sdk/effect/parsers.js +1 -1
- package/dist/virtuals/sdk/index.d.ts +2 -1
- package/dist/virtuals/sdk/modules/auth.d.ts +6 -5
- package/dist/virtuals/sdk/modules/config.d.ts +272 -0
- package/dist/virtuals/sdk/modules/config.js +205 -0
- package/dist/virtuals/sdk/modules/get.d.ts +10 -23
- package/dist/virtuals/sdk/modules/get.js +27 -40
- package/dist/virtuals/sdk/modules/init.d.ts +4 -18
- package/dist/virtuals/sdk/modules/init.js +7 -8
- package/dist/virtuals/sdk/modules/notificationSettings.d.ts +5 -22
- package/dist/virtuals/sdk/modules/notificationSettings.js +7 -29
- package/dist/virtuals/sdk/modules/post.d.ts +5 -5
- package/dist/virtuals/sdk/modules/post.js +14 -9
- package/dist/virtuals/sdk/modules/rest_api.d.ts +3 -3
- package/dist/virtuals/sdk/modules/update.d.ts +19 -19
- package/dist/virtuals/sdk/modules/update.js +28 -25
- package/dist/virtuals/sdk/sdkCore.d.ts +5 -3
- package/dist/virtuals/sdk/sdkCore.js +9 -4
- package/dist/virtuals/sdk/types/index.d.ts +4 -3
- package/dist/virtuals/sdk/types/tableDefs.d.ts +5 -4
- package/dist/virtuals/sdk/types/tsAlias.d.ts +4 -0
- package/dist/virtuals/sdk/utils.d.ts +3 -2
- package/dist/virtuals/utils.d.ts +21 -17
- package/dist/virtuals/utils.js +10 -6
- package/package.json +15 -20
- package/src/cli/users/steps/libsqlCreateUsers.ts +2 -4
- package/src/cli/users/steps/libsqlModifyUsers.ts +2 -4
- package/src/components/auth/OAuthButton.astro +1 -1
- package/src/components/auth/OAuthButtonStack.astro +1 -1
- package/src/components/auth/component-scripts/formListener.ts +1 -1
- package/src/components/dashboard/BaseHead.astro +6 -17
- package/src/components/dashboard/DashboardGrid.astro +2 -2
- package/src/components/dashboard/DashboardGridItem.astro +2 -1
- package/src/components/dashboard/DashboardPageHeader.astro +8 -4
- package/src/components/dashboard/DoubleSidebar.astro +2 -2
- package/src/components/dashboard/LoginChecker.astro +3 -2
- package/src/components/dashboard/MainSidebarContent.astro +16 -12
- package/src/components/dashboard/PageHeader.astro +3 -2
- package/src/components/dashboard/SidebarLink.astro +5 -5
- package/src/components/dashboard/SidebarPluginLink.astro +3 -3
- package/src/components/dashboard/SingleSidebar.astro +2 -2
- package/src/components/dashboard/configuration/ConfigForm.astro +49 -47
- package/src/components/dashboard/configuration/LoginPreview.astro +6 -4
- package/src/components/dashboard/content-mgmt/CreateFolder.astro +3 -2
- package/src/components/dashboard/content-mgmt/CreatePage.astro +8 -5
- package/src/components/dashboard/content-mgmt/EditFolder.astro +3 -2
- package/src/components/dashboard/content-mgmt/EditPage.astro +25 -13
- package/src/components/dashboard/content-mgmt/InnerSidebarElement.astro +23 -15
- package/src/components/dashboard/content-mgmt/PageHeader.astro +23 -14
- package/src/components/dashboard/content-mgmt/PluginFields.astro +6 -1
- package/src/components/dashboard/content-mgmt/TreeRenderer.astro +6 -6
- package/src/components/dashboard/content-mgmt/TreeSidebarFolder.astro +4 -4
- package/src/components/dashboard/content-mgmt/TreeSidebarLink.astro +4 -4
- package/src/components/dashboard/plugins/SettingsRenderer.astro +6 -1
- package/src/components/dashboard/profile/APITokens.astro +14 -8
- package/src/components/dashboard/profile/BasicInfo.astro +8 -4
- package/src/components/dashboard/profile/Notifications.astro +7 -4
- package/src/components/dashboard/profile/SocialSignin.astro +8 -5
- package/src/components/dashboard/profile/UpdatePassword.astro +6 -3
- package/src/components/dashboard/sidebar/UserAccount.astro +1 -2
- package/src/components/dashboard/sidebar/VersionCheck.astro +7 -7
- package/src/components/dashboard/sidebar/VersionCheckChangelog.astro +28 -6
- package/src/components/dashboard/sidebar-modals/UserManagementModals.astro +8 -3
- package/src/components/dashboard/sidebar-modals/VersionModal.astro +16 -15
- package/src/components/dashboard/sidebarConfig.ts +8 -8
- package/src/components/dashboard/user-mgmt/InnerSidebarElement.astro +16 -9
- package/src/components/dashboard/user-mgmt/RankCheck.astro +6 -8
- package/src/components/dashboard/user-mgmt/SocialSignin.astro +9 -10
- package/src/components/dashboard/user-mgmt/UserListItem.astro +8 -6
- package/src/components/default-grid-items/Recently-created-pages.astro +11 -9
- package/src/components/default-grid-items/Recently-signed-up.astro +8 -8
- package/src/components/default-grid-items/Recently-updated-pages.astro +11 -9
- package/src/components/default-grid-items/Totals.astro +7 -6
- package/src/components/first-time-setup/PageHeader.astro +4 -3
- package/src/components/shared/SSRUser.astro +200 -0
- package/src/components/shared/head/Favicons.astro +6 -0
- package/src/components/shared/head/Global.astro +4 -0
- package/src/components/shared/head/TitleTags.astro +14 -0
- package/src/config.ts +1 -4
- package/src/consts.ts +67 -1
- package/src/db/config.ts +43 -2
- package/src/handlers/astroConfigCheck.ts +1 -1
- package/src/handlers/changelog.ts +67 -0
- package/src/handlers/index.ts +1 -2
- package/src/handlers/pluginHandler.ts +16 -9
- package/src/index.ts +142 -121
- package/src/integrations/dynamic-sitemap/index.ts +1 -1
- package/src/integrations/webVitals/checkForWebVitalsPlugin.ts +3 -3
- package/src/integrations/webVitals/dashboard-grid-items/CoreVitals.astro +1 -1
- package/src/integrations/webVitals/dashboard-grid-items/MetricCard.astro +3 -2
- package/src/integrations/webVitals/dashboard-grid-items/SummaryCard.astro +2 -2
- package/src/integrations/webVitals/dashboard-grid-items/metric.css +17 -17
- package/src/integrations/webVitals/dashboard-grid-items/shared.ts +7 -7
- package/src/integrations/webVitals/pages/analytics/body.astro +10 -9
- package/src/layouts/AuthLayout.astro +7 -18
- package/src/layouts/DashboardLayout.astro +3 -2
- package/src/layouts/FirstTimeSetupLayout.astro +7 -18
- package/src/middleware/index.ts +3 -19
- package/src/middleware/utils.ts +7 -4
- package/src/routes/api/auth/login.ts +1 -6
- package/src/routes/api/auth/logout.ts +3 -2
- package/src/routes/api/auth/register.ts +1 -7
- package/src/routes/api/dashboard/config.ts +3 -2
- package/src/routes/api/dashboard/content/page.ts +6 -6
- package/src/routes/api/dashboard/create-user-invite.ts +3 -2
- package/src/routes/api/dashboard/create-user.ts +21 -23
- package/src/routes/api/dashboard/email-notification-settings-site.ts +27 -2
- package/src/routes/api/dashboard/profile.ts +1 -1
- package/src/routes/api/dashboard/reset-password.ts +1 -1
- package/src/routes/api/dashboard/users.ts +33 -15
- package/src/routes/api/dashboard/verify-email.ts +5 -2
- package/src/routes/api/dashboard/verify-session.ts +3 -2
- package/src/routes/api/rest/v1/pages/[id]/index.ts +3 -13
- package/src/routes/api/rest/v1/users/[id].ts +24 -23
- package/src/routes/api/rest/v1/users/index.ts +1 -1
- package/src/routes/api/sdk/utils/changelog.ts +2 -143
- package/src/routes/auth/login.astro +16 -9
- package/src/routes/auth/signup.astro +2 -1
- package/src/routes/dashboard/configuration.astro +3 -2
- package/src/routes/dashboard/content-management/createfolder.astro +1 -1
- package/src/routes/dashboard/content-management/createpage.astro +1 -1
- package/src/routes/dashboard/content-management/diff.astro +8 -5
- package/src/routes/dashboard/content-management/index.astro +1 -1
- package/src/routes/dashboard/password-reset.astro +8 -5
- package/src/routes/dashboard/plugins/[plugin].astro +4 -3
- package/src/routes/dashboard/smtp-configuration.astro +21 -10
- package/src/routes/dashboard/unverified-email.astro +2 -4
- package/src/routes/dashboard/user-management/edit.astro +30 -22
- package/src/routes/dashboard/user-management/index.astro +2 -2
- package/src/routes/error-pages/404.astro +1 -1
- package/src/routes/firstTimeSetupRoutes/1-start.astro +15 -14
- package/src/routes/firstTimeSetupRoutes/2-next.astro +14 -11
- package/src/routes/firstTimeSetupRoutes/3-done.astro +3 -2
- package/src/routes/firstTimeSetupRoutes/api/step-2.ts +1 -1
- package/src/schemas/plugins/shared.ts +13 -25
- package/src/styles/404.css +1 -1
- package/src/styles/code-component.css +8 -8
- package/src/styles/dashboard-base.css +29 -29
- package/src/styles/dashboard-diff.css +31 -31
- package/src/types.ts +3 -20
- package/src/utils/effects/smtp.ts +8 -4
- package/src/utils/safeString.ts +1 -6
- package/src/utils/stripIconify.ts +20 -0
- package/src/utils/tinyMDParser.ts +7 -7
- package/src/virtual.d.ts +17 -60
- package/src/virtuals/auth/core.ts +82 -0
- package/src/virtuals/auth/index.ts +1 -4
- package/src/virtuals/i18n/LanguageSelector.astro +1 -1
- package/src/virtuals/i18n/client.ts +115 -11
- package/src/virtuals/i18n/config.ts +154 -3
- package/src/virtuals/i18n/{index.ts → server.ts} +42 -46
- package/src/virtuals/i18n/v-files.ts +122 -0
- package/src/virtuals/lib/head.ts +1 -114
- package/src/virtuals/lib/pathGenerators.ts +1 -72
- package/src/virtuals/lib/urlGen.ts +4 -29
- package/src/virtuals/mailer/index.ts +7 -34
- package/src/virtuals/scripts/user-quick-tools.ts +151 -59
- package/src/virtuals/sdk/effect/parsers.ts +1 -1
- package/src/virtuals/sdk/modules/auth.ts +2 -1
- package/src/virtuals/sdk/modules/config.ts +602 -0
- package/src/virtuals/sdk/modules/get.ts +32 -48
- package/src/virtuals/sdk/modules/init.ts +18 -26
- package/src/virtuals/sdk/modules/notificationSettings.ts +8 -44
- package/src/virtuals/sdk/modules/post.ts +17 -18
- package/src/virtuals/sdk/modules/update.ts +31 -29
- package/src/virtuals/sdk/sdkCore.ts +5 -0
- package/src/virtuals/sdk/types/index.ts +4 -8
- package/src/virtuals/sdk/types/tableDefs.ts +4 -4
- package/src/virtuals/sdk/types/tsAlias.ts +4 -0
- package/src/virtuals/sdk/utils.ts +2 -2
- package/src/virtuals/utils.ts +29 -25
- package/ui.d.ts +1301 -274
- package/dist/components/first-time-setup/TabItem.astro +0 -44
- package/dist/components/first-time-setup/Tabs.astro +0 -170
- package/dist/handlers/changelog/changelogLoader.d.ts +0 -15
- package/dist/handlers/changelog/changelogLoader.js +0 -104
- package/dist/handlers/changelog/index.d.ts +0 -1
- package/dist/handlers/changelog/index.js +0 -53
- package/dist/handlers/scriptHandler.d.ts +0 -30
- package/dist/handlers/scriptHandler.js +0 -25
- package/dist/utils/addIntegrationArray.d.ts +0 -24
- package/dist/utils/addIntegrationArray.js +0 -11
- package/dist/utils/getLatestVersion.d.ts +0 -12
- package/dist/utils/getLatestVersion.js +0 -36
- package/dist/utils/integrationLogger.d.ts +0 -8
- package/dist/utils/integrationLogger.js +0 -23
- package/dist/utils/jsonUtils.d.ts +0 -13
- package/dist/utils/jsonUtils.js +0 -11
- package/dist/utils/pageTypeFilter.d.ts +0 -2
- package/dist/utils/pageTypeFilter.js +0 -16
- package/dist/virtuals/auth/encryption.d.ts +0 -46
- package/dist/virtuals/auth/encryption.js +0 -82
- package/dist/virtuals/auth/password.d.ts +0 -47
- package/dist/virtuals/auth/password.js +0 -147
- package/dist/virtuals/auth/session.d.ts +0 -77
- package/dist/virtuals/auth/session.js +0 -146
- package/dist/virtuals/auth/user.d.ts +0 -155
- package/dist/virtuals/auth/user.js +0 -251
- package/dist/virtuals/auth/utils/lists/passwords.d.ts +0 -2
- package/dist/virtuals/auth/utils/lists/passwords.js +0 -10006
- package/dist/virtuals/auth/utils/lists/usernames.d.ts +0 -2
- package/dist/virtuals/auth/utils/lists/usernames.js +0 -547
- package/dist/virtuals/auth/utils/scrypt.d.ts +0 -17
- package/dist/virtuals/auth/utils/scrypt.js +0 -30
- package/dist/virtuals/auth/utils/unsafeCheck.d.ts +0 -34
- package/dist/virtuals/auth/utils/unsafeCheck.js +0 -39
- package/dist/virtuals/i18n/index.d.ts +0 -2471
- package/dist/virtuals/lib/jsonUtils.d.ts +0 -2
- package/dist/virtuals/lib/jsonUtils.js +0 -14
- package/dist/virtuals/lib/removeLeadingTrailingSlashes.d.ts +0 -10
- package/dist/virtuals/lib/removeLeadingTrailingSlashes.js +0 -5
- package/src/components/first-time-setup/TabItem.astro +0 -44
- package/src/components/first-time-setup/Tabs.astro +0 -170
- package/src/handlers/changelog/changelogLoader.ts +0 -138
- package/src/handlers/changelog/index.ts +0 -67
- package/src/handlers/scriptHandler.ts +0 -86
- package/src/utils/addIntegrationArray.ts +0 -35
- package/src/utils/getLatestVersion.ts +0 -67
- package/src/utils/integrationLogger.ts +0 -29
- package/src/utils/jsonUtils.ts +0 -20
- package/src/utils/pageTypeFilter.ts +0 -13
- package/src/virtuals/auth/encryption.ts +0 -148
- package/src/virtuals/auth/password.ts +0 -279
- package/src/virtuals/auth/session.ts +0 -290
- package/src/virtuals/auth/user.ts +0 -501
- package/src/virtuals/auth/utils/lists/passwords.ts +0 -10004
- package/src/virtuals/auth/utils/lists/usernames.ts +0 -546
- package/src/virtuals/auth/utils/scrypt.ts +0 -42
- package/src/virtuals/auth/utils/unsafeCheck.ts +0 -72
- package/src/virtuals/lib/jsonUtils.ts +0 -11
- package/src/virtuals/lib/removeLeadingTrailingSlashes.ts +0 -11
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { type UiLanguageKeys, useTranslations } from 'studiocms:i18n';
|
|
3
|
-
import { Button
|
|
3
|
+
import { Button } from 'studiocms:ui/components/button';
|
|
4
|
+
import { Card } from 'studiocms:ui/components/card';
|
|
5
|
+
import { Center } from 'studiocms:ui/components/center';
|
|
6
|
+
import type { OAuthData } from '@withstudiocms/auth-kit/types';
|
|
4
7
|
import { providerData } from '../profile/oAuthButtonProviders.js';
|
|
5
8
|
|
|
6
9
|
interface Props {
|
|
7
10
|
lang: UiLanguageKeys;
|
|
8
|
-
oAuthData?:
|
|
9
|
-
provider: string;
|
|
10
|
-
providerUserId: string;
|
|
11
|
-
userId: string;
|
|
12
|
-
}[];
|
|
11
|
+
oAuthData?: OAuthData[];
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
const { oAuthData, lang } = Astro.props;
|
|
@@ -19,8 +18,8 @@ const hasOAuthData = oAuthData && oAuthData.length > 0;
|
|
|
19
18
|
const connectedAccounts: { provider: string }[] = [];
|
|
20
19
|
|
|
21
20
|
if (hasOAuthData) {
|
|
22
|
-
for (const provider
|
|
23
|
-
connectedAccounts.push({ provider });
|
|
21
|
+
for (const { provider } of oAuthData ?? []) {
|
|
22
|
+
connectedAccounts.push({ provider: provider.toLowerCase() });
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -81,7 +80,7 @@ const t = useTranslations(lang, '@studiocms/dashboard:user-mngmt-edit');
|
|
|
81
80
|
|
|
82
81
|
<style>
|
|
83
82
|
.social-signin-bg {
|
|
84
|
-
background-color:
|
|
83
|
+
background-color: var(--background-step-1);
|
|
85
84
|
height: auto;
|
|
86
85
|
width: auto;
|
|
87
86
|
|
|
@@ -96,7 +95,7 @@ const t = useTranslations(lang, '@studiocms/dashboard:user-mngmt-edit');
|
|
|
96
95
|
align-items: stretch;
|
|
97
96
|
justify-content: space-between !important;
|
|
98
97
|
width: 100%;
|
|
99
|
-
margin-
|
|
98
|
+
margin-bottom: 1rem;
|
|
100
99
|
cursor: default;
|
|
101
100
|
|
|
102
101
|
& .icon-and-label {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { getLabelForPermissionLevel } from 'studiocms:auth/utils/getLabelForPermissionLevel';
|
|
3
|
-
import { Divider
|
|
3
|
+
import { Divider } from 'studiocms:ui/components/divider';
|
|
4
|
+
import { Icon } from 'studiocms:ui/components/icon';
|
|
5
|
+
import type { AvailablePermissionRanks } from '@withstudiocms/auth-kit/types';
|
|
6
|
+
import User from '../../shared/SSRUser.astro';
|
|
4
7
|
|
|
5
8
|
interface Props {
|
|
6
9
|
user: {
|
|
@@ -12,7 +15,7 @@ interface Props {
|
|
|
12
15
|
permissionsData:
|
|
13
16
|
| {
|
|
14
17
|
user: string;
|
|
15
|
-
rank:
|
|
18
|
+
rank: AvailablePermissionRanks;
|
|
16
19
|
}
|
|
17
20
|
| undefined;
|
|
18
21
|
};
|
|
@@ -36,10 +39,9 @@ const userListItemHrefString = userListItemHref.toString();
|
|
|
36
39
|
<User
|
|
37
40
|
name={user.name}
|
|
38
41
|
avatar={user.avatar ?? undefined}
|
|
39
|
-
description={getLabelForPermissionLevel(user.permissionsData?.rank
|
|
40
|
-
loading="eager"
|
|
42
|
+
description={getLabelForPermissionLevel(user.permissionsData?.rank ?? 'unknown')}
|
|
41
43
|
/>
|
|
42
|
-
<Icon name="chevron-right" width={24} height={24} />
|
|
44
|
+
<Icon name="heroicons:chevron-right" width={24} height={24} />
|
|
43
45
|
</user-list-item>
|
|
44
46
|
<Divider background={"background-step-1"} />
|
|
45
47
|
|
|
@@ -94,7 +96,7 @@ const userListItemHrefString = userListItemHref.toString();
|
|
|
94
96
|
if (openInNewTab) {
|
|
95
97
|
// Preserve default middle-click behavior if this were a native link
|
|
96
98
|
e.preventDefault();
|
|
97
|
-
window.open(url.href, '_blank');
|
|
99
|
+
window.open(url.href, '_blank', 'noopener,noreferrer');
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { FormattedDate } from 'studiocms:components';
|
|
3
3
|
import { runSDK, SDKCoreJs } from 'studiocms:sdk';
|
|
4
|
-
import { Badge
|
|
4
|
+
import { Badge } from 'studiocms:ui/components/badge';
|
|
5
|
+
import { Card } from 'studiocms:ui/components/card';
|
|
6
|
+
import { Center } from 'studiocms:ui/components/center';
|
|
5
7
|
import { allowedIdentifiers, sortByDate, withinLast30Days } from './utils.js';
|
|
6
8
|
|
|
7
9
|
// Get all pages and users from the database
|
|
@@ -33,8 +35,8 @@ const recentlyUpdatedPages = totalPages
|
|
|
33
35
|
</Card>
|
|
34
36
|
))
|
|
35
37
|
) : (
|
|
36
|
-
<Card fullWidth style="background-color:
|
|
37
|
-
<Center><span style="color:
|
|
38
|
+
<Card fullWidth style="background-color: var(--background-step-2);">
|
|
39
|
+
<Center><span style="color: var(--text-muted);">No recently created pages found.</span></Center>
|
|
38
40
|
</Card>
|
|
39
41
|
)
|
|
40
42
|
}
|
|
@@ -51,7 +53,7 @@ const recentlyUpdatedPages = totalPages
|
|
|
51
53
|
.recently-created-page-card {
|
|
52
54
|
display: flex;
|
|
53
55
|
flex-direction: column;
|
|
54
|
-
background-color:
|
|
56
|
+
background-color: var(--background-step-2);
|
|
55
57
|
text-decoration: none;
|
|
56
58
|
color: initial;
|
|
57
59
|
transition: all .15s ease;
|
|
@@ -70,27 +72,27 @@ const recentlyUpdatedPages = totalPages
|
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
& .card-date {
|
|
73
|
-
color:
|
|
75
|
+
color: var(--text-muted);
|
|
74
76
|
font-size: .8rem;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
& .card-description {
|
|
78
80
|
font-size: 1rem;
|
|
79
|
-
color:
|
|
81
|
+
color: var(--text-muted);
|
|
80
82
|
line-clamp: 1;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
& .card-icon {
|
|
84
|
-
color:
|
|
86
|
+
color: var(--text-muted);
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
.recently-created-page-card .card-title {
|
|
90
|
-
color:
|
|
92
|
+
color: var(--text-normal);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
.recently-created-page-card:hover {
|
|
94
|
-
background-color:
|
|
96
|
+
background-color: var(--background-step-3) !important;
|
|
95
97
|
}
|
|
96
98
|
</style>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
import config from 'studiocms:config';
|
|
3
3
|
import { runSDK, SDKCoreJs } from 'studiocms:sdk';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { Card } from 'studiocms:ui/components/card';
|
|
5
|
+
import { Icon } from 'studiocms:ui/components/icon';
|
|
6
|
+
import User from '../shared/SSRUser.astro';
|
|
6
7
|
import { sortByDate } from './utils.js';
|
|
7
8
|
|
|
8
9
|
const totalUsers = await runSDK(SDKCoreJs.GET.users.all());
|
|
@@ -21,9 +22,8 @@ const recentlyCreatedUsers = totalUsers
|
|
|
21
22
|
name={user.name}
|
|
22
23
|
avatar={user.avatar ?? undefined}
|
|
23
24
|
description={`Created at ${new Date(user.createdAt!).toLocaleDateString(config.locale.dateLocale, config.locale.dateTimeFormat)}`}
|
|
24
|
-
loading='eager',
|
|
25
25
|
/>
|
|
26
|
-
<Icon name="eye" width={24} height={24} />
|
|
26
|
+
<Icon name="heroicons:eye" width={24} height={24} />
|
|
27
27
|
</div>
|
|
28
28
|
</Card>
|
|
29
29
|
</a>
|
|
@@ -43,18 +43,18 @@ const recentlyCreatedUsers = totalUsers
|
|
|
43
43
|
|
|
44
44
|
.recently-signed-up-user {
|
|
45
45
|
text-decoration: none;
|
|
46
|
-
color:
|
|
46
|
+
color: var(--text-normal);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.user-card {
|
|
50
|
-
background-color:
|
|
50
|
+
background-color: var(--background-step-2);
|
|
51
51
|
width: 100%;
|
|
52
52
|
height: 100%;
|
|
53
53
|
transition: all .15s ease;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.user-card:hover {
|
|
57
|
-
background-color:
|
|
57
|
+
background-color: var(--background-step-3);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.user-flex {
|
|
@@ -64,7 +64,7 @@ const recentlyCreatedUsers = totalUsers
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.user-card:hover {
|
|
67
|
-
background-color:
|
|
67
|
+
background-color: var(--background-step-3);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
</style>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { FormattedDate } from 'studiocms:components';
|
|
3
3
|
import { runSDK, SDKCoreJs } from 'studiocms:sdk';
|
|
4
|
-
import { Badge
|
|
4
|
+
import { Badge } from 'studiocms:ui/components/badge';
|
|
5
|
+
import { Card } from 'studiocms:ui/components/card';
|
|
6
|
+
import { Center } from 'studiocms:ui/components/center';
|
|
5
7
|
import { allowedIdentifiers, sortByDate, withinLast30Days } from './utils.js';
|
|
6
8
|
|
|
7
9
|
// Get all pages and users from the database
|
|
@@ -33,8 +35,8 @@ const recentlyUpdatedPages = totalPages
|
|
|
33
35
|
</Card>
|
|
34
36
|
))
|
|
35
37
|
) : (
|
|
36
|
-
<Card fullWidth style="background-color:
|
|
37
|
-
<Center><span style="color:
|
|
38
|
+
<Card fullWidth style="background-color: var(--background-step-2);">
|
|
39
|
+
<Center><span style="color: var(--text-muted);">No recently updated pages found.</span></Center>
|
|
38
40
|
</Card>
|
|
39
41
|
)
|
|
40
42
|
}
|
|
@@ -51,7 +53,7 @@ const recentlyUpdatedPages = totalPages
|
|
|
51
53
|
.recently-updated-page-card {
|
|
52
54
|
display: flex;
|
|
53
55
|
flex-direction: column;
|
|
54
|
-
background-color:
|
|
56
|
+
background-color: var(--background-step-2);
|
|
55
57
|
text-decoration: none;
|
|
56
58
|
color: initial;
|
|
57
59
|
transition: all .15s ease;
|
|
@@ -74,27 +76,27 @@ const recentlyUpdatedPages = totalPages
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
& .card-date {
|
|
77
|
-
color:
|
|
79
|
+
color: var(--text-muted);
|
|
78
80
|
font-size: .8rem;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
& .card-description {
|
|
82
84
|
font-size: 1rem;
|
|
83
|
-
color:
|
|
85
|
+
color: var(--text-muted);
|
|
84
86
|
line-clamp: 1;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
& .card-icon {
|
|
88
|
-
color:
|
|
90
|
+
color: var(--text-muted);
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
.recently-updated-page-card .card-title {
|
|
94
|
-
color:
|
|
96
|
+
color: var(--text-normal);
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
.recently-updated-page-card:hover {
|
|
98
|
-
background-color:
|
|
100
|
+
background-color: var(--background-step-3) !important;
|
|
99
101
|
}
|
|
100
102
|
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { runSDK, SDKCoreJs } from 'studiocms:sdk';
|
|
3
|
-
import { Card
|
|
3
|
+
import { Card } from 'studiocms:ui/components/card';
|
|
4
|
+
import { Icon } from 'studiocms:ui/components/icon';
|
|
4
5
|
import { Effect } from '../../effect.js';
|
|
5
6
|
import { allowedIdentifiers } from './utils.js';
|
|
6
7
|
|
|
@@ -20,7 +21,7 @@ const totalDraftPages = totalPages.filter(({ data: page }) => page.draft === tru
|
|
|
20
21
|
<a href={Astro.locals.StudioCMS.routeMap.mainLinks.contentManagement}>
|
|
21
22
|
<Card class="totals-grid-item-card">
|
|
22
23
|
<div class="totals-grid-item-content">
|
|
23
|
-
<Icon name="document-text" height={24} width={24} />
|
|
24
|
+
<Icon name="heroicons:document-text" height={24} width={24} />
|
|
24
25
|
<div class="totals-grid-item-text">
|
|
25
26
|
<span class="totals-grid-item-label">Total Pages</span>
|
|
26
27
|
<span>{totalPages.length}</span>
|
|
@@ -33,7 +34,7 @@ const totalDraftPages = totalPages.filter(({ data: page }) => page.draft === tru
|
|
|
33
34
|
<a href={Astro.locals.StudioCMS.routeMap.mainLinks.contentManagement}>
|
|
34
35
|
<Card class="totals-grid-item-card">
|
|
35
36
|
<div class="totals-grid-item-content">
|
|
36
|
-
<Icon name="document" height={24} width={24} />
|
|
37
|
+
<Icon name="heroicons:document" height={24} width={24} />
|
|
37
38
|
<div class="totals-grid-item-text">
|
|
38
39
|
<span class="totals-grid-item-label">Draft Pages</span>
|
|
39
40
|
<span>{totalDraftPages.length}</span>
|
|
@@ -46,7 +47,7 @@ const totalDraftPages = totalPages.filter(({ data: page }) => page.draft === tru
|
|
|
46
47
|
<a href={Astro.locals.StudioCMS.routeMap.mainLinks.userManagement}>
|
|
47
48
|
<Card class="totals-grid-item-card">
|
|
48
49
|
<div class="totals-grid-item-content">
|
|
49
|
-
<Icon name="user-group" height={24} width={24} />
|
|
50
|
+
<Icon name="heroicons:user-group" height={24} width={24} />
|
|
50
51
|
<div class="totals-grid-item-text">
|
|
51
52
|
<span class="totals-grid-item-label">Total Users</span>
|
|
52
53
|
<span>{totalUsers.length}</span>
|
|
@@ -64,14 +65,14 @@ const totalDraftPages = totalPages.filter(({ data: page }) => page.draft === tru
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
.totals-grid-item-card {
|
|
67
|
-
background-color:
|
|
68
|
+
background-color: var(--background-step-2);
|
|
68
69
|
width: 100%;
|
|
69
70
|
height: 100%;
|
|
70
71
|
transition: all 0.15s ease;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
.totals-grid-item-card:hover {
|
|
74
|
-
background-color:
|
|
75
|
+
background-color: var(--background-step-3);
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
.totals-grid-item-container {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { Badge
|
|
2
|
+
import { Badge } from 'studiocms:ui/components/badge';
|
|
3
|
+
import type { AvailableIcons } from 'studiocms:ui/icons';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
title: string;
|
|
6
7
|
badge?: {
|
|
7
8
|
label: string;
|
|
8
|
-
icon?:
|
|
9
|
+
icon?: AvailableIcons;
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -14,7 +15,7 @@ const { title, badge } = Astro.props;
|
|
|
14
15
|
<header class="page-header">
|
|
15
16
|
<div class="page-title-container">
|
|
16
17
|
<h1 class="page-title">{title}</h1>
|
|
17
|
-
{ badge && <Badge label={badge.label} size="lg" /> }
|
|
18
|
+
{ badge && <Badge label={badge.label} size="lg" icon={badge.icon} /> }
|
|
18
19
|
</div>
|
|
19
20
|
<div class="page-actions-container">
|
|
20
21
|
<slot />
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { extname } from 'node:path';
|
|
3
|
+
import { Icon } from 'studiocms:ui/components/icon';
|
|
4
|
+
import { lookup } from 'mrmime';
|
|
5
|
+
|
|
6
|
+
const heroIconsUserDataUri =
|
|
7
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADSklEQVR4AdSWS2xMYRTHjQXRRupRKVWrJhrxSCRigTQpYUHq0VYsarwi8RgJ0rCwFJEQEQ1psZFQXWgGRZB6NdFalkSFFRutV1UJNhLj9+dcOubeud8dC2lzfvd/7vedc77TO999DB/2n/+GZgOpVCoOSegx5K/N5WJGugIsNhHusNBZqIJiQ/455tqgiDFni9QAVZthIVyBBTAWJsBKeAOL4Tw4m3MD/GebqVoBV2Ox2ArohAHog1bGZ0MfLCJ2A+pkzg1QrRpkB3X4G5p4xdhOkOknkYYSpYE5Vu2pqZ/ctUFdDXOzS5QGvlkplxyXmJ/lnAOJfgSyMh0C0AbVVJcOLkRp4JQV3GeaJmy8SQzUg6xRBxecG2CTaaffpGgli12DeVAAhaDb8CFzhXCZ2Ouokzk3YNU2ordhGXTCALyDS6AH0C10CzhbpAb4z16DHjZxVtCivWgPJCHO3BJ4i+9skRrwqrJIE1TBZCiBGmjy5qNoTg1EWSAsNlIDbLZi2AEt0A2fDPkX8BOguyFs3d/zTg1QNB+OkPUcjkMNTIfRhvzV+CfgBbGHYBR+qIU2QCG97dqpVAcjoRuOgpqYggr5GnvCuWL2ou3kjkOzWtYGKFBAdgfoPfAR1S02iw1XB0l4achXgzOJ2QaKnYt2WA1cfwtsgETNtZA2FXR/l7LYaUhx7muag5NMloI+XKahzdSKob6mRXwnGEyA7nm949dQ+D3nTmax2hN6SC0lSVcOyTTfBuhYl36/hddS8IP5zmI56y3hADW1Ye30j/g2wLQ21Ri0i0JtaE5G7g0SH8N40PsCSbegBiot7J7pv4hXw6uZViuogRkWpdvP3JzFq6E7JKNIUAP63FbwJn67KsjTSRSUA/o2XGd5Xk07/SVBDei7/zshq0Bvun6KtcIeqIUKKAM9IfNQ+RrTnGL07dBvufrtVesM5xnm2wCbZyuRer9vR+/DCFgOh0FvPX18PsP/DF9AvsY0pxjFKke5up2LqLmLuAzzbUBRJOh7vxEt57wEVKABvQgPQO+Fr6iQrzHNKWY343pNl5PfAHqWMJRpgQ0MDqVAL9RDAqphPujJmI8K+RrTnGKOMa6PlcFlfH2nBnwzHQfDwn4AAAD//6qWhy8AAAAGSURBVAMAJXQ0UKI3Vu0AAAAASUVORK5CYII=';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
/**
|
|
11
|
+
* The name of the user.
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* The description of the user. Could be a role, a handle, etc.
|
|
16
|
+
*/
|
|
17
|
+
description: string;
|
|
18
|
+
/**
|
|
19
|
+
* The avatar of the user. Either a URL to an image or an imported image.
|
|
20
|
+
*/
|
|
21
|
+
avatar?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Additional classes to apply to the user container.
|
|
24
|
+
*/
|
|
25
|
+
class?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The loading strategy for the image. Defaults to `lazy`.
|
|
28
|
+
*/
|
|
29
|
+
loading?: 'eager' | 'lazy';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The timeout delay for loading the avatar image. Defaults to 5000ms.
|
|
33
|
+
*/
|
|
34
|
+
timeoutDelay?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
name,
|
|
39
|
+
description,
|
|
40
|
+
avatar,
|
|
41
|
+
class: className,
|
|
42
|
+
loading = 'lazy',
|
|
43
|
+
timeoutDelay = 3000,
|
|
44
|
+
} = Astro.props;
|
|
45
|
+
|
|
46
|
+
async function getObjectData(src: string): Promise<{ data: string; type: string } | undefined> {
|
|
47
|
+
try {
|
|
48
|
+
const data = src;
|
|
49
|
+
const extension = extname(src).toLowerCase();
|
|
50
|
+
|
|
51
|
+
if (extension) {
|
|
52
|
+
const type = lookup(extension);
|
|
53
|
+
|
|
54
|
+
if (!type) {
|
|
55
|
+
console.error(`Could not determine MIME type for extension: ${extension}`);
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!/^image\/.*$/.test(type)) {
|
|
60
|
+
console.error(`Unsupported image type: ${type}`);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (type === 'image/svg+xml' || type.startsWith('image/svg')) {
|
|
65
|
+
console.error('SVG avatars are disallowed for security.');
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return { data, type };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Create URL object to validate format
|
|
73
|
+
const urlObj = new URL(src);
|
|
74
|
+
|
|
75
|
+
// Only allow HTTPS (avoid mixed content + downgrade attacks)
|
|
76
|
+
if (urlObj.protocol !== 'https:') {
|
|
77
|
+
console.error(`Insecure avatar URL protocol: ${urlObj.protocol}`);
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const controller = new AbortController();
|
|
82
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutDelay);
|
|
83
|
+
let response: Response;
|
|
84
|
+
try {
|
|
85
|
+
// Fetch the URL with timeout
|
|
86
|
+
response = await fetch(src, {
|
|
87
|
+
method: 'HEAD', // Use HEAD to avoid downloading the entire image
|
|
88
|
+
signal: controller.signal,
|
|
89
|
+
cache: 'no-cache',
|
|
90
|
+
});
|
|
91
|
+
} finally {
|
|
92
|
+
clearTimeout(timeoutId);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!response || !response.ok) {
|
|
96
|
+
console.error(`Failed to fetch image: ${response.statusText}`);
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
const contentType = response.headers.get('content-type');
|
|
100
|
+
if (!contentType || !contentType.startsWith('image/')) {
|
|
101
|
+
console.error(`Invalid image type: ${contentType}`);
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (contentType === 'image/svg+xml') {
|
|
106
|
+
console.error('Remote SVG avatars are disallowed for security.');
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return { data, type: contentType };
|
|
111
|
+
} catch (error) {
|
|
112
|
+
// Handle various error types
|
|
113
|
+
if (error instanceof Error) {
|
|
114
|
+
if (error.name === 'AbortError') {
|
|
115
|
+
console.log(`Avatar URL test timed out after ${timeoutDelay / 1000} seconds`);
|
|
116
|
+
} else if (error.name === 'TypeError') {
|
|
117
|
+
console.log('Invalid URL or network error:', error.message);
|
|
118
|
+
} else {
|
|
119
|
+
console.log('Error testing avatar URL:', error.message);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const validAvatar = avatar ? await getObjectData(avatar) : undefined;
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
<div class="sui-user-container" class:list={[className]}>
|
|
130
|
+
<div class="sui-avatar-container">
|
|
131
|
+
{
|
|
132
|
+
validAvatar ? (
|
|
133
|
+
<img
|
|
134
|
+
src={validAvatar.data}
|
|
135
|
+
width={64}
|
|
136
|
+
height={64}
|
|
137
|
+
class="sui-avatar-img"
|
|
138
|
+
alt={name}
|
|
139
|
+
loading={loading}
|
|
140
|
+
decoding="async"
|
|
141
|
+
referrerpolicy="no-referrer"
|
|
142
|
+
onerror={`this.src='${heroIconsUserDataUri}'`}
|
|
143
|
+
/>
|
|
144
|
+
) : (
|
|
145
|
+
<Icon
|
|
146
|
+
name="heroicons:user"
|
|
147
|
+
width={24}
|
|
148
|
+
height={24}
|
|
149
|
+
role="img"
|
|
150
|
+
aria-label={`Placeholder avatar for ${name}`}
|
|
151
|
+
/>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
</div>
|
|
155
|
+
<div class="sui-text-content">
|
|
156
|
+
<span class="sui-name">{name}</span>
|
|
157
|
+
<span class="sui-description">{description}</span>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<style>
|
|
162
|
+
.sui-user-container {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: row;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 1rem;
|
|
167
|
+
}
|
|
168
|
+
.sui-avatar-container {
|
|
169
|
+
width: 2.5rem;
|
|
170
|
+
height: 2.5rem;
|
|
171
|
+
background-color: var(--default-base);
|
|
172
|
+
border-radius: var(--radius-full);
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
border: 1px solid var(--border);
|
|
178
|
+
}
|
|
179
|
+
.sui-avatar-img {
|
|
180
|
+
width: 100%;
|
|
181
|
+
height: auto;
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: center;
|
|
185
|
+
}
|
|
186
|
+
.sui-text-content {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
gap: 0.125rem;
|
|
190
|
+
}
|
|
191
|
+
.sui-name {
|
|
192
|
+
font-size: 1em;
|
|
193
|
+
font-weight: 600;
|
|
194
|
+
}
|
|
195
|
+
.sui-description {
|
|
196
|
+
font-size: 0.875em;
|
|
197
|
+
font-weight: 400;
|
|
198
|
+
color: var(--text-muted);
|
|
199
|
+
}
|
|
200
|
+
</style>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { FAVICON_ASSETS } from '../../../consts.js';
|
|
3
|
+
---
|
|
4
|
+
<link rel="icon" href={FAVICON_ASSETS.svg} type="image/svg+xml" />
|
|
5
|
+
<link rel="icon" href={FAVICON_ASSETS.png.light} type="image/png" media="(prefers-color-scheme: dark)" />
|
|
6
|
+
<link rel="icon" href={FAVICON_ASSETS.png.dark} type="image/png" media="(prefers-color-scheme: light)" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { STUDIOCMS_THEME_COLOR } from '../../../consts.js';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { title, description } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
<title>{title}</title>
|
|
12
|
+
<meta name="title" content={title} />
|
|
13
|
+
<meta name="description" content={description} />
|
|
14
|
+
<meta name="theme-color" content={STUDIOCMS_THEME_COLOR} />
|
package/dist/config.d.ts
CHANGED
|
@@ -16,13 +16,10 @@ export type { StudioCMSOptions } from './schemas/index.js';
|
|
|
16
16
|
* @example
|
|
17
17
|
* ```js
|
|
18
18
|
* // studiocms.config.mjs
|
|
19
|
-
* import { defineStudioCMSConfig } from 'studiocms';
|
|
19
|
+
* import { defineStudioCMSConfig } from 'studiocms/config';
|
|
20
20
|
*
|
|
21
21
|
* export default defineStudioCMSConfig({
|
|
22
22
|
* dbStartPage: true,
|
|
23
|
-
* contentRenderer: 'marked',
|
|
24
|
-
* verbose: true,
|
|
25
|
-
* dateLocale: 'en-us',
|
|
26
23
|
* // ...Other Options
|
|
27
24
|
* })
|
|
28
25
|
* ```
|
package/dist/consts.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type uiIntegration from '@studiocms/ui';
|
|
2
|
+
import { type AvailablePermissionRanks } from '@withstudiocms/auth-kit/types';
|
|
1
3
|
import type { AstroConfig } from 'astro';
|
|
2
4
|
import type { RobotsConfig } from './integrations/robots/schema.js';
|
|
3
5
|
import type { TimeString } from './schemas/config/sdk.js';
|
|
@@ -5,14 +7,17 @@ import type { TimeString } from './schemas/config/sdk.js';
|
|
|
5
7
|
* StudioCMS Site Config Table Entry ID
|
|
6
8
|
*/
|
|
7
9
|
export declare const CMSSiteConfigId: number;
|
|
10
|
+
export declare const Next_SiteConfigId: string;
|
|
8
11
|
/**
|
|
9
12
|
* StudioCMS Mailer Config Table Entry ID
|
|
10
13
|
*/
|
|
11
14
|
export declare const CMSMailerConfigId: string;
|
|
15
|
+
export declare const Next_MailerConfigId: string;
|
|
12
16
|
/**
|
|
13
17
|
* StudioCMS Notification Settings Table Entry ID
|
|
14
18
|
*/
|
|
15
19
|
export declare const CMSNotificationSettingsId: string;
|
|
20
|
+
export declare const Next_NotificationSettingsId: string;
|
|
16
21
|
/**
|
|
17
22
|
* The default lifetime for cached items.
|
|
18
23
|
* This value is used to determine how long an item should remain in the cache before it is considered expired.
|
|
@@ -78,7 +83,6 @@ export declare const GhostUserDefaults: {
|
|
|
78
83
|
* Default values for the site Notifications configuration.
|
|
79
84
|
*/
|
|
80
85
|
export declare const NotificationSettingsDefaults: {
|
|
81
|
-
id: string;
|
|
82
86
|
emailVerification: boolean;
|
|
83
87
|
oAuthBypassVerification: boolean;
|
|
84
88
|
requireEditorVerification: boolean;
|
|
@@ -170,3 +174,32 @@ export declare const FAVICON_ASSETS: {
|
|
|
170
174
|
readonly dark: "https://cdn.studiocms.dev/favicon-dark.png";
|
|
171
175
|
};
|
|
172
176
|
};
|
|
177
|
+
type UiOptions = Parameters<typeof uiIntegration>[0];
|
|
178
|
+
/**
|
|
179
|
+
* UI options configuration for StudioCMS.
|
|
180
|
+
*
|
|
181
|
+
* @remarks
|
|
182
|
+
* This constant defines the default UI options used throughout StudioCMS.
|
|
183
|
+
* It includes settings for CSS injection and icon sets.
|
|
184
|
+
*
|
|
185
|
+
* @property noInjectCSS - If true, StudioCMS UI will not inject its default CSS into all routes.
|
|
186
|
+
* @property icons - An object containing icon sets used in the UI.
|
|
187
|
+
* - `flatcoloricons`: Contains selected icons from the Flat Color Icons set (e.g., 'google').
|
|
188
|
+
* - `simpleicons`: Contains selected icons from the Simple Icons set (e.g., 'github', 'discord', 'auth0').
|
|
189
|
+
*/
|
|
190
|
+
export declare const STUDIOCMS_UI_OPTS: UiOptions;
|
|
191
|
+
/**
|
|
192
|
+
* Merges user-provided UI options with default StudioCMS UI options.
|
|
193
|
+
*
|
|
194
|
+
* @param userOpts - An optional partial object containing user-specified UI options.
|
|
195
|
+
* @returns The merged UI options object.
|
|
196
|
+
*
|
|
197
|
+
* @remarks
|
|
198
|
+
* - If a user option is provided, it takes precedence over the default.
|
|
199
|
+
* - The `icons` property is deeply merged, combining default and user-provided icons.
|
|
200
|
+
*/
|
|
201
|
+
export declare function getUiOpts(userOpts?: Partial<UiOptions>): UiOptions;
|
|
202
|
+
export declare const LinkNewOAuthCookieName = "link-new-o-auth";
|
|
203
|
+
export declare const AuthSessionCookieName = "auth_session";
|
|
204
|
+
export declare const ValidRanks: ReadonlySet<AvailablePermissionRanks>;
|
|
205
|
+
export {};
|