studiocms 0.1.0-beta.7 → 0.1.0-beta.8
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 +473 -0
- package/LICENSE +1 -1
- package/README.md +17 -10
- package/auth.d.ts +405 -0
- package/core.d.ts +225 -0
- package/custom-renderers/index.ts +4 -0
- package/custom-renderers/markdocRenderers/markdocReact-components/MarkDocReactRenderer.tsx +8 -0
- package/custom-renderers/markdocRenderers/markdocReact-components/MarkDocReactWrapper.astro +13 -0
- package/custom-renderers/markdocRenderers/markdocReact.ts +56 -0
- package/dist/cli/cmds/get-turso.d.ts +1 -0
- package/dist/cli/cmds/get-turso.js +10 -0
- package/dist/cli/cmds/init/index.d.ts +4 -0
- package/dist/cli/cmds/init/index.js +52 -0
- package/dist/cli/cmds/init/steps/data/studiocmsEnv.d.ts +3 -0
- package/dist/cli/cmds/init/steps/data/studiocmsEnv.js +71 -0
- package/dist/cli/cmds/init/steps/envBuilder.d.ts +21 -0
- package/dist/cli/cmds/init/steps/envBuilder.js +368 -0
- package/dist/cli/cmds/init/steps/nextSteps.d.ts +2 -0
- package/dist/cli/cmds/init/steps/nextSteps.js +38 -0
- package/dist/cli/cmds/init.d.ts +1 -0
- package/dist/cli/cmds/init.js +4 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +9 -0
- package/dist/cli/lib/commander.d.ts +39 -0
- package/dist/cli/lib/commander.js +87 -0
- package/dist/cli/lib/context.d.ts +28 -0
- package/dist/cli/lib/context.js +55 -0
- package/dist/cli/lib/pathUtil.d.ts +5 -0
- package/dist/cli/lib/pathUtil.js +14 -0
- package/dist/cli/lib/runExternal.d.ts +20 -0
- package/dist/cli/lib/runExternal.js +40 -0
- package/dist/cli/lib/seasonal.d.ts +5 -0
- package/dist/cli/lib/seasonal.js +88 -0
- package/dist/cli/lib/utils.d.ts +55 -0
- package/dist/cli/lib/utils.js +310 -0
- package/dist/cli/shared/intro.d.ts +2 -0
- package/dist/cli/shared/intro.js +24 -0
- package/dist/components/DefaultEditor.astro +138 -0
- package/dist/components/FormattedDate.astro +12 -0
- package/dist/components/Generator.astro +7 -0
- package/dist/components/Renderer.astro +13 -0
- package/dist/components/auth/OAuthButton.astro +21 -0
- package/dist/components/auth/OAuthButtonStack.astro +19 -0
- package/dist/components/auth/StaticAuthCheck.astro +20 -0
- package/dist/components/auth/StudioCMSLogoSVG.astro +13 -0
- package/dist/components/auth/oAuthButtonProviders.d.ts +8 -0
- package/dist/components/auth/oAuthButtonProviders.js +35 -0
- package/dist/components/dashboard/AstroCodeDiffsScript.astro +25 -0
- package/dist/components/dashboard/BaseHead.astro +41 -0
- package/dist/components/dashboard/Code.astro +23 -0
- package/dist/components/dashboard/DashboardPageHeader.astro +60 -0
- package/dist/components/dashboard/DoubleSidebar.astro +26 -0
- package/dist/components/dashboard/Footer.astro +16 -0
- package/dist/components/dashboard/MainSidebarContent.astro +124 -0
- package/dist/components/dashboard/PageHeader.astro +52 -0
- package/dist/components/dashboard/SidebarLink.astro +61 -0
- package/dist/components/dashboard/SidebarModals.astro +6 -0
- package/dist/components/dashboard/SidebarPluginLink.astro +45 -0
- package/dist/components/dashboard/SingleSidebar.astro +23 -0
- package/dist/components/dashboard/StudioCMSLogo.astro +12 -0
- package/dist/components/dashboard/ThemeManager.astro +53 -0
- package/dist/components/dashboard/component-scripts/TinyMDE.astro +6 -0
- package/dist/components/dashboard/component-scripts/dateTimeListener.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/dateTimeListener.js +14 -0
- package/dist/components/dashboard/component-scripts/dateWithTimeAndZone.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/dateWithTimeAndZone.js +12 -0
- package/dist/components/dashboard/component-scripts/makeClientRoutable.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/makeClientRoutable.js +9 -0
- package/dist/components/dashboard/component-scripts/timeAgo.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/timeAgo.js +21 -0
- package/dist/components/dashboard/islands/LoginChecker.astro +52 -0
- package/dist/components/dashboard/islands/configuration/ConfigForm.astro +272 -0
- package/dist/components/dashboard/islands/configuration/LightVsDark.astro +67 -0
- package/dist/components/dashboard/islands/content-mgmt/CreateFolder.astro +91 -0
- package/dist/components/dashboard/islands/content-mgmt/CreatePage.astro +332 -0
- package/dist/components/dashboard/islands/content-mgmt/EditFolder.astro +112 -0
- package/dist/components/dashboard/islands/content-mgmt/EditPage.astro +388 -0
- package/dist/components/dashboard/islands/content-mgmt/InnerSidebarElement.astro +230 -0
- package/dist/components/dashboard/islands/content-mgmt/PageHeader.astro +387 -0
- package/dist/components/dashboard/islands/content-mgmt/PageList.astro +49 -0
- package/dist/components/dashboard/islands/content-mgmt/PluginFields.astro +29 -0
- package/dist/components/dashboard/islands/content-mgmt/TreeRenderer.astro +75 -0
- package/dist/components/dashboard/islands/content-mgmt/TreeSidebarFolder.astro +53 -0
- package/dist/components/dashboard/islands/content-mgmt/TreeSidebarLink.astro +51 -0
- package/dist/components/dashboard/islands/content-mgmt/runtime.d.ts +10 -0
- package/dist/components/dashboard/islands/content-mgmt/runtime.js +33 -0
- package/dist/components/dashboard/islands/content-mgmt/shared.d.ts +27 -0
- package/dist/components/dashboard/islands/content-mgmt/shared.js +31 -0
- package/dist/components/dashboard/islands/dashboard/DashboardGrid.astro +39 -0
- package/dist/components/dashboard/islands/dashboard/DashboardGridItem.astro +34 -0
- package/dist/components/dashboard/islands/dashboard/Test.astro +5 -0
- package/dist/components/dashboard/islands/dashboard/UserName.astro +6 -0
- package/dist/components/dashboard/islands/dashboard/shared.d.ts +2 -0
- package/dist/components/dashboard/islands/dashboard/shared.js +0 -0
- package/dist/components/dashboard/islands/plugins/SettingsRenderer.astro +29 -0
- package/dist/components/dashboard/islands/profile/APITokens.astro +267 -0
- package/dist/components/dashboard/islands/profile/BasicInfo.astro +107 -0
- package/dist/components/dashboard/islands/profile/BasicInfoFallback.astro +43 -0
- package/dist/components/dashboard/islands/profile/SocialSignin.astro +151 -0
- package/dist/components/dashboard/islands/profile/SocialSigninFallback.astro +83 -0
- package/dist/components/dashboard/islands/profile/UpdatePassword.astro +137 -0
- package/dist/components/dashboard/islands/profile/UpdatePasswordFallback.astro +47 -0
- package/dist/components/dashboard/islands/profile/oAuthButtonProviders.d.ts +8 -0
- package/dist/components/dashboard/islands/profile/oAuthButtonProviders.js +35 -0
- package/dist/components/dashboard/islands/sidebar/Admin.astro +103 -0
- package/dist/components/dashboard/islands/sidebar/Editor.astro +18 -0
- package/dist/components/dashboard/islands/sidebar/UserAccount.astro +23 -0
- package/dist/components/dashboard/islands/sidebar/VersionCheck.astro +127 -0
- package/dist/components/dashboard/islands/sidebar/VersionCheckChangelog.astro +107 -0
- package/dist/components/dashboard/islands/user-mgmt/InnerSidebarElement.astro +298 -0
- package/dist/components/dashboard/islands/user-mgmt/RankCheck.astro +49 -0
- package/dist/components/dashboard/islands/user-mgmt/SocialSignin.astro +88 -0
- package/dist/components/dashboard/islands/user-mgmt/UserListItem.astro +60 -0
- package/dist/components/dashboard/sidebar-modals/UserManagementModals.astro +103 -0
- package/dist/components/dashboard/sidebar-modals/VersionModal.astro +267 -0
- package/dist/components/dashboard/sidebarConfig.d.ts +31 -0
- package/dist/components/dashboard/sidebarConfig.js +90 -0
- package/dist/components/default-grid-items/Recently-created-pages.astro +91 -0
- package/dist/components/default-grid-items/Recently-signed-up.astro +71 -0
- package/dist/components/default-grid-items/Recently-updated-pages.astro +96 -0
- package/dist/components/default-grid-items/Totals.astro +107 -0
- package/dist/components/default-grid-items/utils.d.ts +17 -0
- package/dist/components/default-grid-items/utils.js +26 -0
- package/dist/components/image/CustomImage.astro +90 -0
- package/dist/components/user-quick-tools.d.ts +42 -0
- package/dist/components/user-quick-tools.js +312 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +4 -0
- package/dist/consts.d.ts +61 -0
- package/dist/consts.js +39 -0
- package/dist/db/config.d.ts +4 -0
- package/dist/db/config.js +6 -0
- package/dist/db/tables.js +168 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.js +11 -0
- package/dist/index.d.ts +152 -0
- package/dist/index.js +1177 -0
- package/dist/layouts/auth/AuthLayout.astro +74 -0
- package/dist/layouts/auth/FallbackCanvas.astro +123 -0
- package/dist/layouts/auth/ThemeManager.astro +53 -0
- package/dist/layouts/auth/ThreeCanvasLoader.astro +18 -0
- package/dist/layouts/dashboard/Layout.astro +64 -0
- package/dist/lib/auth/encryption.d.ts +30 -0
- package/dist/lib/auth/encryption.js +39 -0
- package/dist/lib/auth/password.d.ts +27 -0
- package/dist/lib/auth/password.js +42 -0
- package/dist/lib/auth/rate-limit.d.ts +136 -0
- package/dist/lib/auth/rate-limit.js +214 -0
- package/dist/lib/auth/session.d.ts +85 -0
- package/dist/lib/auth/session.js +93 -0
- package/dist/lib/auth/types.d.ts +83 -0
- package/dist/lib/auth/types.js +0 -0
- package/dist/lib/auth/user.d.ts +148 -0
- package/dist/lib/auth/user.js +133 -0
- package/dist/lib/dashboardGrid.d.ts +119 -0
- package/dist/lib/dashboardGrid.js +0 -0
- package/dist/lib/dynamic-sitemap/index.d.ts +42 -0
- package/dist/lib/dynamic-sitemap/index.js +45 -0
- package/dist/lib/dynamic-sitemap/sitemap-index.xml.d.ts +8 -0
- package/dist/lib/dynamic-sitemap/sitemap-index.xml.js +20 -0
- package/dist/lib/dynamic-sitemap/sitemap-index.xml.ts +45 -0
- package/dist/lib/head.d.ts +9 -0
- package/dist/lib/head.js +65 -0
- package/dist/lib/headDefaults.d.ts +18 -0
- package/dist/lib/headDefaults.js +75 -0
- package/dist/lib/i18n/LanguageSelector.astro +103 -0
- package/dist/lib/i18n/config.d.ts +16 -0
- package/dist/lib/i18n/config.js +8 -0
- package/dist/lib/i18n/index.d.ts +228 -0
- package/dist/lib/i18n/index.js +63 -0
- package/dist/lib/i18n/translations/de.json +43 -0
- package/dist/lib/i18n/translations/en-us.json +63 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/jsonUtils.d.ts +2 -0
- package/dist/lib/jsonUtils.js +11 -0
- package/dist/lib/makeAPIRoute.d.ts +45 -0
- package/dist/lib/makeAPIRoute.js +16 -0
- package/dist/lib/makePublicRoute.d.ts +7 -0
- package/dist/lib/makePublicRoute.js +6 -0
- package/dist/lib/pathGenerators.d.ts +20 -0
- package/dist/lib/pathGenerators.js +66 -0
- package/dist/lib/plugins/dashboard-pages.d.ts +71 -0
- package/dist/lib/plugins/dashboard-pages.js +11 -0
- package/dist/lib/plugins/frontend-navigation.d.ts +18 -0
- package/dist/lib/plugins/frontend-navigation.js +39 -0
- package/dist/lib/plugins/index.d.ts +2 -0
- package/dist/lib/plugins/index.js +2 -0
- package/dist/lib/removeLeadingTrailingSlashes.d.ts +7 -0
- package/dist/lib/removeLeadingTrailingSlashes.js +13 -0
- package/dist/lib/renderer/astro-remark.d.ts +13 -0
- package/dist/lib/renderer/astro-remark.js +11 -0
- package/dist/lib/renderer/contentRenderer.d.ts +13 -0
- package/dist/lib/renderer/contentRenderer.js +31 -0
- package/dist/lib/renderer/errors.d.ts +5 -0
- package/dist/lib/renderer/errors.js +25 -0
- package/dist/lib/renderer/markdoc-renderers/markdocHTML.d.ts +3 -0
- package/dist/lib/renderer/markdoc-renderers/markdocHTML.js +14 -0
- package/dist/lib/renderer/markdoc-renderers/markdocReactStatic.d.ts +3 -0
- package/dist/lib/renderer/markdoc-renderers/markdocReactStatic.js +14 -0
- package/dist/lib/renderer/markdoc.d.ts +11 -0
- package/dist/lib/renderer/markdoc.js +28 -0
- package/dist/lib/renderer/mdx.d.ts +10 -0
- package/dist/lib/renderer/mdx.js +37 -0
- package/dist/lib/renderer/runtime.d.ts +8 -0
- package/dist/lib/renderer/runtime.js +30 -0
- package/dist/lib/renderer/shared.d.ts +15 -0
- package/dist/lib/renderer/shared.js +13 -0
- package/dist/lib/renderer/studiocms.d.ts +11 -0
- package/dist/lib/renderer/studiocms.js +22 -0
- package/dist/lib/renderer/types.d.ts +12 -0
- package/dist/lib/renderer/types.js +0 -0
- package/dist/lib/robots/core.d.ts +24 -0
- package/dist/lib/robots/core.js +187 -0
- package/dist/lib/robots/index.d.ts +11 -0
- package/dist/lib/robots/index.js +47 -0
- package/dist/lib/robots/types.d.ts +185 -0
- package/dist/lib/robots/types.js +0 -0
- package/dist/lib/robots/utils.d.ts +22 -0
- package/dist/lib/robots/utils.js +22 -0
- package/dist/lib/routeMap.d.ts +257 -0
- package/dist/lib/routeMap.js +249 -0
- package/dist/lib/urlGen.d.ts +11 -0
- package/dist/lib/urlGen.js +26 -0
- package/dist/lib/webVitals/checkForWebVitalsPlugin.d.ts +18 -0
- package/dist/lib/webVitals/checkForWebVitalsPlugin.js +82 -0
- package/dist/lib/webVitals/consts.d.ts +240 -0
- package/dist/lib/webVitals/consts.js +40 -0
- package/dist/lib/webVitals/dashboard-grid-items/CoreVitals.astro +66 -0
- package/dist/lib/webVitals/dashboard-grid-items/MetricCard.astro +24 -0
- package/dist/lib/webVitals/dashboard-grid-items/SummaryCard.astro +56 -0
- package/dist/lib/webVitals/dashboard-grid-items/metric.css +103 -0
- package/dist/lib/webVitals/dashboard-grid-items/shared.d.ts +29 -0
- package/dist/lib/webVitals/dashboard-grid-items/shared.js +35 -0
- package/dist/lib/webVitals/pages/analytics/body.astro +186 -0
- package/dist/lib/webVitals/pages/analytics/header.astro +42 -0
- package/dist/lib/webVitals/schemas.d.ts +78 -0
- package/dist/lib/webVitals/schemas.js +37 -0
- package/dist/lib/webVitals/types.d.ts +156 -0
- package/dist/lib/webVitals/types.js +0 -0
- package/dist/lib/webVitals/utils/buildDataObject.d.ts +8 -0
- package/dist/lib/webVitals/utils/buildDataObject.js +28 -0
- package/dist/lib/webVitals/utils/buildPageRouteDataObject.d.ts +15 -0
- package/dist/lib/webVitals/utils/buildPageRouteDataObject.js +70 -0
- package/dist/lib/webVitals/utils/buildPerPageDataObject.d.ts +23 -0
- package/dist/lib/webVitals/utils/buildPerPageDataObject.js +209 -0
- package/dist/lib/webVitals/utils/checkDate.d.ts +5 -0
- package/dist/lib/webVitals/utils/checkDate.js +19 -0
- package/dist/lib/webVitals/utils/webVitalsUtils.d.ts +24 -0
- package/dist/lib/webVitals/utils/webVitalsUtils.js +234 -0
- package/dist/lib/webVitals/webVital.d.ts +20 -0
- package/dist/lib/webVitals/webVital.js +40 -0
- package/dist/lib/webVitals/webVitalsRouteSummary.d.ts +19 -0
- package/dist/lib/webVitals/webVitalsRouteSummary.js +59 -0
- package/dist/lib/webVitals/webVitalsSummary.d.ts +19 -0
- package/dist/lib/webVitals/webVitalsSummary.js +49 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.js +6 -0
- package/dist/routes/api/render.astro +25 -0
- package/dist/routes/auth/api/auth0/callback.d.ts +4 -0
- package/dist/routes/auth/api/auth0/callback.js +117 -0
- package/dist/routes/auth/api/auth0/index.d.ts +4 -0
- package/dist/routes/auth/api/auth0/index.js +36 -0
- package/dist/routes/auth/api/auth0/shared.d.ts +13 -0
- package/dist/routes/auth/api/auth0/shared.js +24 -0
- package/dist/routes/auth/api/discord/callback.d.ts +4 -0
- package/dist/routes/auth/api/discord/callback.js +112 -0
- package/dist/routes/auth/api/discord/index.d.ts +4 -0
- package/dist/routes/auth/api/discord/index.js +36 -0
- package/dist/routes/auth/api/discord/shared.d.ts +12 -0
- package/dist/routes/auth/api/discord/shared.js +17 -0
- package/dist/routes/auth/api/github/callback.d.ts +4 -0
- package/dist/routes/auth/api/github/callback.js +112 -0
- package/dist/routes/auth/api/github/index.d.ts +4 -0
- package/dist/routes/auth/api/github/index.js +36 -0
- package/dist/routes/auth/api/github/shared.d.ts +13 -0
- package/dist/routes/auth/api/github/shared.js +14 -0
- package/dist/routes/auth/api/google/callback.d.ts +4 -0
- package/dist/routes/auth/api/google/callback.js +115 -0
- package/dist/routes/auth/api/google/index.d.ts +4 -0
- package/dist/routes/auth/api/google/index.js +38 -0
- package/dist/routes/auth/api/google/shared.d.ts +12 -0
- package/dist/routes/auth/api/google/shared.js +19 -0
- package/dist/routes/auth/api/login.d.ts +4 -0
- package/dist/routes/auth/api/login.js +46 -0
- package/dist/routes/auth/api/logout.d.ts +5 -0
- package/dist/routes/auth/api/logout.js +55 -0
- package/dist/routes/auth/api/register.d.ts +4 -0
- package/dist/routes/auth/api/register.js +64 -0
- package/dist/routes/auth/api/shared.d.ts +2 -0
- package/dist/routes/auth/api/shared.js +21 -0
- package/dist/routes/auth/login.astro +67 -0
- package/dist/routes/auth/logout.astro +28 -0
- package/dist/routes/auth/signup.astro +70 -0
- package/dist/routes/dashboard/[...pluginPage].astro +88 -0
- package/dist/routes/dashboard/configuration.astro +27 -0
- package/dist/routes/dashboard/content-management/createfolder.astro +56 -0
- package/dist/routes/dashboard/content-management/createpage.astro +59 -0
- package/dist/routes/dashboard/content-management/diff.astro +100 -0
- package/dist/routes/dashboard/content-management/editfolder.astro +40 -0
- package/dist/routes/dashboard/content-management/editpage.astro +44 -0
- package/dist/routes/dashboard/content-management/index.astro +57 -0
- package/dist/routes/dashboard/index.astro +24 -0
- package/dist/routes/dashboard/password-reset.astro +169 -0
- package/dist/routes/dashboard/plugins/[plugin].astro +60 -0
- package/dist/routes/dashboard/profile.astro +57 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/api-tokens.d.ts +5 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/api-tokens.js +90 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/config.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/config.js +63 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/folder.d.ts +6 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/folder.js +121 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/page.d.ts +6 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/page.js +257 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-reset-link.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-reset-link.js +59 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user-invite.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user-invite.js +105 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user.js +100 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/partials/Editor.astro +61 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/partials/LiveRender.astro +30 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/partials/UserListItems.astro +39 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/plugins/[plugin].d.ts +2 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/plugins/[plugin].js +32 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/profile.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/profile.js +130 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/reset-password.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/reset-password.js +105 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/search-list.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/search-list.js +55 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/users.d.ts +5 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/users.js +92 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/verify-session.d.ts +2 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/verify-session.js +72 -0
- package/dist/routes/dashboard/user-management/edit.astro +593 -0
- package/dist/routes/dashboard/user-management/index.astro +67 -0
- package/dist/routes/error-pages/404.astro +35 -0
- package/dist/routes/firstTimeSetupRoutes/1-start.astro +253 -0
- package/dist/routes/firstTimeSetupRoutes/2-next.astro +208 -0
- package/dist/routes/firstTimeSetupRoutes/3-done.astro +95 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-1.d.ts +2 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-1.js +126 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-2.d.ts +2 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-2.js +110 -0
- package/dist/routes/firstTimeSetupRoutes/components/Layout.astro +41 -0
- package/dist/routes/firstTimeSetupRoutes/components/PageHeader.astro +60 -0
- package/dist/routes/firstTimeSetupRoutes/components/TabItem.astro +44 -0
- package/dist/routes/firstTimeSetupRoutes/components/Tabs.astro +170 -0
- package/dist/routes/firstTimeSetupRoutes/snippets/opt1-astro.config.diff +14 -0
- package/dist/routes/firstTimeSetupRoutes/snippets/opt2-astro.config.diff +9 -0
- package/dist/routes/firstTimeSetupRoutes/snippets/opt2-studiocms.config.diff +5 -0
- package/dist/routes/rest/utils/auth-token.d.ts +17 -0
- package/dist/routes/rest/utils/auth-token.js +31 -0
- package/dist/routes/rest/v1/folders/[id].d.ts +6 -0
- package/dist/routes/rest/v1/folders/[id].js +106 -0
- package/dist/routes/rest/v1/folders/index.d.ts +5 -0
- package/dist/routes/rest/v1/folders/index.js +88 -0
- package/dist/routes/rest/v1/pages/[id]/history/[diffid].d.ts +4 -0
- package/dist/routes/rest/v1/pages/[id]/history/[diffid].js +55 -0
- package/dist/routes/rest/v1/pages/[id]/history/index.d.ts +4 -0
- package/dist/routes/rest/v1/pages/[id]/history/index.js +61 -0
- package/dist/routes/rest/v1/pages/[id]/index.d.ts +6 -0
- package/dist/routes/rest/v1/pages/[id]/index.js +165 -0
- package/dist/routes/rest/v1/pages/index.d.ts +5 -0
- package/dist/routes/rest/v1/pages/index.js +113 -0
- package/dist/routes/rest/v1/public/folders/[id].d.ts +4 -0
- package/dist/routes/rest/v1/public/folders/[id].js +43 -0
- package/dist/routes/rest/v1/public/folders/index.d.ts +4 -0
- package/dist/routes/rest/v1/public/folders/index.js +49 -0
- package/dist/routes/rest/v1/public/pages/[id].d.ts +4 -0
- package/dist/routes/rest/v1/public/pages/[id].js +46 -0
- package/dist/routes/rest/v1/public/pages/index.d.ts +4 -0
- package/dist/routes/rest/v1/public/pages/index.js +61 -0
- package/dist/routes/rest/v1/settings/index.d.ts +5 -0
- package/dist/routes/rest/v1/settings/index.js +75 -0
- package/dist/routes/rest/v1/users/[id].d.ts +6 -0
- package/dist/routes/rest/v1/users/[id].js +212 -0
- package/dist/routes/rest/v1/users/index.d.ts +5 -0
- package/dist/routes/rest/v1/users/index.js +138 -0
- package/dist/routes/sdk/fallback-list-pages.json.d.ts +2 -0
- package/dist/routes/sdk/fallback-list-pages.json.js +19 -0
- package/dist/routes/sdk/fallback-list-pages.json.ts +22 -0
- package/dist/routes/sdk/full-changelog.json.d.ts +16 -0
- package/dist/routes/sdk/full-changelog.json.js +170 -0
- package/dist/routes/sdk/full-changelog.json.ts +224 -0
- package/dist/routes/sdk/list-pages.d.ts +4 -0
- package/dist/routes/sdk/list-pages.js +34 -0
- package/dist/routes/sdk/update-latest-version-cache.d.ts +4 -0
- package/dist/routes/sdk/update-latest-version-cache.js +41 -0
- package/dist/runtime/AstroComponentProxy.d.ts +29 -0
- package/dist/runtime/AstroComponentProxy.js +47 -0
- package/dist/runtime/decoder/decode-codepoint.d.ts +18 -0
- package/dist/runtime/decoder/decode-codepoint.js +58 -0
- package/dist/runtime/decoder/decode-data-html.d.ts +1 -0
- package/dist/runtime/decoder/decode-data-html.js +7 -0
- package/dist/runtime/decoder/decode-data-xml.d.ts +1 -0
- package/dist/runtime/decoder/decode-data-xml.js +7 -0
- package/dist/runtime/decoder/index.d.ts +34 -0
- package/dist/runtime/decoder/index.js +18 -0
- package/dist/runtime/decoder/util.d.ts +208 -0
- package/dist/runtime/decoder/util.js +415 -0
- package/dist/schemas/config/auth.d.ts +175 -0
- package/dist/schemas/config/auth.js +65 -0
- package/dist/schemas/config/componentoverrides.d.ts +17 -0
- package/dist/schemas/config/componentoverrides.js +14 -0
- package/dist/schemas/config/dashboard.d.ts +154 -0
- package/dist/schemas/config/dashboard.js +59 -0
- package/dist/schemas/config/defaultFrontend.d.ts +125 -0
- package/dist/schemas/config/defaultFrontend.js +57 -0
- package/dist/schemas/config/developer.d.ts +15 -0
- package/dist/schemas/config/developer.js +14 -0
- package/dist/schemas/config/imageService.d.ts +13 -0
- package/dist/schemas/config/imageService.js +12 -0
- package/dist/schemas/config/index.d.ts +1153 -0
- package/dist/schemas/config/index.js +95 -0
- package/dist/schemas/config/integrations.d.ts +14 -0
- package/dist/schemas/config/integrations.js +12 -0
- package/dist/schemas/config/markdoc.d.ts +172 -0
- package/dist/schemas/config/markdoc.js +68 -0
- package/dist/schemas/config/mdx.d.ts +455 -0
- package/dist/schemas/config/mdx.js +71 -0
- package/dist/schemas/config/rendererConfig.d.ts +659 -0
- package/dist/schemas/config/rendererConfig.js +51 -0
- package/dist/schemas/config/sdk.d.ts +167 -0
- package/dist/schemas/config/sdk.js +85 -0
- package/dist/schemas/config/studiocms-markdown-remark.d.ts +292 -0
- package/dist/schemas/config/studiocms-markdown-remark.js +63 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/plugins/index.d.ts +7373 -0
- package/dist/schemas/plugins/index.js +192 -0
- package/dist/schemas/plugins/shared.d.ts +1752 -0
- package/dist/schemas/plugins/shared.js +221 -0
- package/dist/scripts/formListener.d.ts +16 -0
- package/dist/scripts/formListener.js +46 -0
- package/dist/scripts/three.d.ts +1 -0
- package/dist/scripts/three.js +277 -0
- package/dist/scripts/utils/fitModelToViewport.d.ts +8 -0
- package/dist/scripts/utils/fitModelToViewport.js +19 -0
- package/dist/sdk/StudioCMSVirtualCache.d.ts +283 -0
- package/dist/sdk/StudioCMSVirtualCache.js +685 -0
- package/dist/sdk/cache.d.ts +11 -0
- package/dist/sdk/cache.js +12 -0
- package/dist/sdk/core.d.ts +865 -0
- package/dist/sdk/core.js +1966 -0
- package/dist/sdk/errors.d.ts +21 -0
- package/dist/sdk/errors.js +11 -0
- package/dist/sdk/index.d.ts +371 -0
- package/dist/sdk/index.js +8 -0
- package/dist/sdk/lib/foldertree.d.ts +50 -0
- package/dist/sdk/lib/foldertree.js +123 -0
- package/dist/sdk/lib/generators.d.ts +30 -0
- package/dist/sdk/lib/generators.js +25 -0
- package/dist/sdk/lib/packages.d.ts +8 -0
- package/dist/sdk/lib/packages.js +14 -0
- package/dist/sdk/lib/parsers.d.ts +14 -0
- package/dist/sdk/lib/parsers.js +10 -0
- package/dist/sdk/lib/users.d.ts +19 -0
- package/dist/sdk/lib/users.js +26 -0
- package/dist/sdk/tables.d.ts +1198 -0
- package/dist/sdk/tables.js +55 -0
- package/dist/sdk/types/index.d.ts +175 -0
- package/dist/sdk/types/index.js +0 -0
- package/dist/sdk/types/tableDefs.d.ts +75 -0
- package/dist/sdk/types/tableDefs.js +0 -0
- package/dist/sdk/types/tsAlias.d.ts +155 -0
- package/dist/sdk/types/tsAlias.js +0 -0
- package/dist/sdk/utils/db.d.ts +5 -0
- package/dist/sdk/utils/db.js +15 -0
- package/dist/stubs/auth-lib.d.ts +2 -0
- package/dist/stubs/auth-lib.js +519 -0
- package/dist/stubs/auth-scripts.d.ts +2 -0
- package/dist/stubs/auth-scripts.js +29 -0
- package/dist/stubs/auth-utils.d.ts +2 -0
- package/dist/stubs/auth-utils.js +36 -0
- package/dist/stubs/changelog.d.ts +2 -0
- package/dist/stubs/changelog.js +16 -0
- package/dist/stubs/components.d.ts +2 -0
- package/dist/stubs/components.js +67 -0
- package/dist/stubs/core.d.ts +2 -0
- package/dist/stubs/core.js +49 -0
- package/dist/stubs/i18n-dts.d.ts +2 -0
- package/dist/stubs/i18n-dts.js +117 -0
- package/dist/stubs/images.d.ts +1 -0
- package/dist/stubs/images.js +30 -0
- package/dist/stubs/index.d.ts +1 -0
- package/dist/stubs/index.js +40 -0
- package/dist/stubs/lib.d.ts +2 -0
- package/dist/stubs/lib.js +123 -0
- package/dist/stubs/plugins.d.ts +2 -0
- package/dist/stubs/plugins.js +60 -0
- package/dist/stubs/proxy.d.ts +2 -0
- package/dist/stubs/proxy.js +40 -0
- package/dist/stubs/renderer-config.d.ts +2 -0
- package/dist/stubs/renderer-config.js +18 -0
- package/dist/stubs/renderer-markdownConfig.d.ts +2 -0
- package/dist/stubs/renderer-markdownConfig.js +17 -0
- package/dist/stubs/renderer.d.ts +2 -0
- package/dist/stubs/renderer.js +44 -0
- package/dist/stubs/sdk.d.ts +2 -0
- package/dist/stubs/sdk.js +202 -0
- package/dist/stubs/webVitals.d.ts +2 -0
- package/dist/stubs/webVitals.js +40 -0
- package/dist/styles/404.css +47 -0
- package/dist/styles/SyntaxFont.woff2 +0 -0
- package/dist/styles/authlayout.css +138 -0
- package/dist/styles/dashboard-base.css +493 -0
- package/dist/styles/dashboard-code.css +33 -0
- package/dist/styles/dashboard-diff.css +389 -0
- package/dist/styles/dashboard-tiny-mde.css +224 -0
- package/dist/styles/md-remark-callouts/github.css +56 -0
- package/dist/styles/md-remark-callouts/obsidian.css +66 -0
- package/dist/styles/md-remark-callouts/vitepress.css +58 -0
- package/dist/styles/md-remark-headings.css +48 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.js +0 -0
- package/dist/utils/addAPIRoutes.d.ts +9 -0
- package/dist/utils/addAPIRoutes.js +33 -0
- package/dist/utils/addIntegrationArray.d.ts +24 -0
- package/dist/utils/addIntegrationArray.js +11 -0
- package/dist/utils/addIntegrationArrayWithCheck.d.ts +11 -0
- package/dist/utils/addIntegrationArrayWithCheck.js +24 -0
- package/dist/utils/astroConfigCheck.d.ts +8 -0
- package/dist/utils/astroConfigCheck.js +31 -0
- package/dist/utils/astroEnvConfig.d.ts +45 -0
- package/dist/utils/astroEnvConfig.js +9 -0
- package/dist/utils/authEnvCheck.d.ts +38 -0
- package/dist/utils/authEnvCheck.js +82 -0
- package/dist/utils/changelog.d.ts +1 -0
- package/dist/utils/changelog.js +53 -0
- package/dist/utils/changelogLoader.d.ts +15 -0
- package/dist/utils/changelogLoader.js +104 -0
- package/dist/utils/checkENV.d.ts +27 -0
- package/dist/utils/checkENV.js +115 -0
- package/dist/utils/configManager.d.ts +22 -0
- package/dist/utils/configManager.js +98 -0
- package/dist/utils/configResolver.d.ts +283 -0
- package/dist/utils/configResolver.js +105 -0
- package/dist/utils/defineStudioCMSConfig.d.ts +165 -0
- package/dist/utils/defineStudioCMSConfig.js +6 -0
- package/dist/utils/getLabelForPermissionLevel.d.ts +2 -0
- package/dist/utils/getLabelForPermissionLevel.js +17 -0
- package/dist/utils/injectRouteArray.d.ts +19 -0
- package/dist/utils/injectRouteArray.js +75 -0
- package/dist/utils/integrationLogger.d.ts +7 -0
- package/dist/utils/integrationLogger.js +18 -0
- package/dist/utils/integrations.d.ts +4 -0
- package/dist/utils/integrations.js +32 -0
- package/dist/utils/isDashboardRoute.d.ts +7 -0
- package/dist/utils/isDashboardRoute.js +10 -0
- package/dist/utils/loginBackgrounds/studiocms-blobs-dark.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-blobs-light.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-blocks-dark.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-blocks-light.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-curves-dark.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-curves-light.png +0 -0
- package/dist/utils/makePageTitle.d.ts +3 -0
- package/dist/utils/makePageTitle.js +7 -0
- package/dist/utils/pageListPackageLabel.d.ts +4 -0
- package/dist/utils/pageListPackageLabel.js +12 -0
- package/dist/utils/readJson.d.ts +1 -0
- package/dist/utils/readJson.js +7 -0
- package/dist/utils/routeBuilder.d.ts +18 -0
- package/dist/utils/routeBuilder.js +96 -0
- package/dist/utils/safeString.d.ts +1 -0
- package/dist/utils/safeString.js +6 -0
- package/dist/utils/simpleResponse.d.ts +1 -0
- package/dist/utils/simpleResponse.js +29 -0
- package/dist/utils/validImages.d.ts +13 -0
- package/dist/utils/validImages.js +39 -0
- package/dist/virtual.d.js +0 -0
- package/dist/virtual.d.ts +5 -0
- package/package.json +180 -59
- package/renderer.d.ts +25 -0
- package/static/studiocms-resources/auth/studiocms-logo.glb +0 -0
- package/static/studiocms-resources/core/favicon-dark.png +0 -0
- package/static/studiocms-resources/core/favicon-light.png +0 -0
- package/static/studiocms-resources/core/favicon.svg +15 -0
- package/studiocms-cli.mjs +13 -0
- package/ui.d.ts +291 -0
- package/src/blog/index.ts +0 -35
- package/src/index.ts +0 -25
- package/src/integration.ts +0 -130
- package/src/updateCheck.ts +0 -51
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '../../../../styles/dashboard-tiny-mde.css';
|
|
3
|
+
import { FormattedDate } from 'studiocms:components';
|
|
4
|
+
import { StudioCMSRoutes } from 'studiocms:lib';
|
|
5
|
+
import type { SettingsField } from 'studiocms:plugin-helpers';
|
|
6
|
+
import pluginList from 'studiocms:plugins';
|
|
7
|
+
import studioCMS_SDK from 'studiocms:sdk';
|
|
8
|
+
import studioCMS_SDK_Cache from 'studiocms:sdk/cache';
|
|
9
|
+
import { Button, Card, Center, Icon, Input, Select, TabItem, Tabs } from 'studiocms:ui/components';
|
|
10
|
+
import { editorKeys } from 'virtual:studiocms/components/Editors';
|
|
11
|
+
import PluginFields from './PluginFields.astro';
|
|
12
|
+
import { convertToSafeString, importEditorKeys } from './runtime.js';
|
|
13
|
+
import {
|
|
14
|
+
categoriesOptions,
|
|
15
|
+
pageTypeOptions,
|
|
16
|
+
parentFolderOptions,
|
|
17
|
+
tagsOptions,
|
|
18
|
+
trueFalse,
|
|
19
|
+
} from './shared.js';
|
|
20
|
+
|
|
21
|
+
const urlParams = Astro.url.searchParams;
|
|
22
|
+
const editId = urlParams.get('edit') || '';
|
|
23
|
+
|
|
24
|
+
const { data: pageData } = await studioCMS_SDK_Cache.GET.page.byId(editId);
|
|
25
|
+
|
|
26
|
+
function getParentFolderValue(value: string | null): string | undefined {
|
|
27
|
+
const options = parentFolderOptions;
|
|
28
|
+
if (value === null) return 'null';
|
|
29
|
+
return options.find((option: { value: FormDataEntryValue }) => option.value === value)?.value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
data: { enableDiffs },
|
|
34
|
+
} = await studioCMS_SDK_Cache.GET.siteConfig();
|
|
35
|
+
|
|
36
|
+
const diffs = await studioCMS_SDK.diffTracking.get.byPageId.latest(pageData.id, 10);
|
|
37
|
+
|
|
38
|
+
const users = await studioCMS_SDK.GET.database.users();
|
|
39
|
+
|
|
40
|
+
const user = (id: string) => users.find((u) => u.id === id)?.name;
|
|
41
|
+
|
|
42
|
+
const editors = await importEditorKeys(editorKeys);
|
|
43
|
+
|
|
44
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
45
|
+
let editor: any = editors[convertToSafeString(pageData.package)];
|
|
46
|
+
|
|
47
|
+
const CurrentEditorComponent = editor;
|
|
48
|
+
|
|
49
|
+
const pluginFields = pluginList
|
|
50
|
+
.flatMap(({ pageTypes }) => {
|
|
51
|
+
const pageTypeOutput: {
|
|
52
|
+
identifier: string;
|
|
53
|
+
fields?: SettingsField[];
|
|
54
|
+
}[] = [];
|
|
55
|
+
|
|
56
|
+
if (!pageTypes) {
|
|
57
|
+
return pageTypeOutput;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
for (const pageType of pageTypes) {
|
|
61
|
+
pageTypeOutput.push(pageType);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return pageTypeOutput;
|
|
65
|
+
})
|
|
66
|
+
.find((pageType) => pageType.identifier === pageData.package);
|
|
67
|
+
---
|
|
68
|
+
<div id="edit-page-container">
|
|
69
|
+
<form id="edit-page-form" action={StudioCMSRoutes.endpointLinks.content.page}>
|
|
70
|
+
|
|
71
|
+
<Tabs variant={'starlight'}>
|
|
72
|
+
<TabItem label='Basic Information' icon={'information-circle-20-solid'} color={'primary'}>
|
|
73
|
+
<div class="tab-section">
|
|
74
|
+
<div class="form-row">
|
|
75
|
+
<Input label='Page Title' name='page-title' isRequired defaultValue={pageData.title} />
|
|
76
|
+
<Input label='Slug' name='page-slug' disabled isRequired defaultValue={pageData.slug} />
|
|
77
|
+
|
|
78
|
+
<input type="hidden" name="page-slug" value={pageData.slug} />
|
|
79
|
+
<input type="hidden" name="page-id" value={pageData.id} />
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="form-row">
|
|
83
|
+
<Input label='Description' name='page-description' isRequired defaultValue={pageData.description}/>
|
|
84
|
+
<Input label='OpenGraph/Hero Image' name='page-hero-image' placeholder='https://...' defaultValue={pageData.heroImage} />
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="form-row">
|
|
88
|
+
<Select
|
|
89
|
+
label="Page type"
|
|
90
|
+
name="page-type"
|
|
91
|
+
isRequired
|
|
92
|
+
fullWidth
|
|
93
|
+
defaultValue={pageData.package}
|
|
94
|
+
options={pageTypeOptions}
|
|
95
|
+
/>
|
|
96
|
+
<Select
|
|
97
|
+
label="Show in Navigation"
|
|
98
|
+
name="show-in-nav"
|
|
99
|
+
isRequired
|
|
100
|
+
defaultValue={`${pageData.showOnNav}`}
|
|
101
|
+
fullWidth
|
|
102
|
+
options={trueFalse}
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="form-row">
|
|
107
|
+
<Select label="Parent Folder" name="parent-folder" fullWidth options={parentFolderOptions} defaultValue={getParentFolderValue(pageData.parentFolder)} />
|
|
108
|
+
<Select label="Draft" name="draft" fullWidth options={trueFalse} defaultValue={`${pageData.draft ?? false}`} disabled={pageData.slug === 'index'} />
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div class="form-row">
|
|
112
|
+
<Select label="Categories" name="categories" placeholder="Work in Progress" fullWidth options={categoriesOptions} disabled />
|
|
113
|
+
<Select label="Tags" name="tags" placeholder="Work in Progress" fullWidth options={tagsOptions} disabled />
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div class="form-row">
|
|
117
|
+
<Select label="Show Author" name="show-author" defaultValue={`${pageData.showAuthor}`} fullWidth options={trueFalse} />
|
|
118
|
+
<Select label="Show Contributors" name="show-contributors" defaultValue={`${pageData.showContributors}`} fullWidth options={trueFalse} />
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div id="custom-page-type-fields" class:list={[pluginFields?.fields ? '' : 'page-types-hidden']}>
|
|
122
|
+
<Card fullWidth>
|
|
123
|
+
<div slot="header">
|
|
124
|
+
<span>Plugin Page Type Fields</span>
|
|
125
|
+
</div>
|
|
126
|
+
{pluginFields?.fields && (<PluginFields fields={pluginFields.fields} /> )}
|
|
127
|
+
<div>You have changed your pageType. Please save your changes and refresh the page to see the new fields.</div>
|
|
128
|
+
</Card>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</TabItem>
|
|
132
|
+
<TabItem label='Page Content' icon={'document-text-20-solid'} color={'success'}>
|
|
133
|
+
|
|
134
|
+
<input type="hidden" name="page-content-id" value={pageData.defaultContent?.id} />
|
|
135
|
+
|
|
136
|
+
<div class="tab-section">
|
|
137
|
+
<div class="page-content-editor">
|
|
138
|
+
<CurrentEditorComponent content={pageData.defaultContent?.content} />
|
|
139
|
+
<div id="page-content-editor-placeholder" style="display: none;"></div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</TabItem>
|
|
143
|
+
|
|
144
|
+
{
|
|
145
|
+
enableDiffs && (
|
|
146
|
+
<TabItem label='Edit History' icon={'archive-box-20-solid'} color={'warning'}>
|
|
147
|
+
<div class="tab-section">
|
|
148
|
+
<div class="edit-card-list">
|
|
149
|
+
|
|
150
|
+
{
|
|
151
|
+
diffs.length > 0 ? (
|
|
152
|
+
diffs.map((diff) => (
|
|
153
|
+
<Card fullWidth class={'edit-card'}>
|
|
154
|
+
<div class="card-row">
|
|
155
|
+
<span class="card-title">{pageData.title}</span>
|
|
156
|
+
<span class="card-date">Edited: <FormattedDate date={diff.timestamp!} /> by {user(diff.userId)}</span>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<div class="card-row">
|
|
160
|
+
<span class="card-description">{pageData.description}</span>
|
|
161
|
+
<Button size='sm' as='a' href={StudioCMSRoutes.mainLinks.contentManagementDiff + `?diff=${diff.id}`}>
|
|
162
|
+
<Icon name="eye" width={24} height={24} class="card-icon" />
|
|
163
|
+
</Button>
|
|
164
|
+
</div>
|
|
165
|
+
</Card>
|
|
166
|
+
))
|
|
167
|
+
) : (
|
|
168
|
+
<Card fullWidth style="background-color: hsl(var(--background-step-1));">
|
|
169
|
+
<Center>No history found.</Center>
|
|
170
|
+
</Card>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</TabItem>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
</Tabs>
|
|
181
|
+
|
|
182
|
+
</form>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<script is:inline define:vars={{ editors: editorKeys }}>
|
|
186
|
+
|
|
187
|
+
// TODO: Make this work to be able to swap in new editors instead... This almost works but does not load scripts once the partial is loaded.
|
|
188
|
+
|
|
189
|
+
async function setupPluginFields() {
|
|
190
|
+
const pageTypeDropdown = document.querySelector('#page-type-dropdown');
|
|
191
|
+
const pageTypeOptions = pageTypeDropdown.querySelectorAll('.sui-select-option');
|
|
192
|
+
|
|
193
|
+
pageTypeOptions.forEach((option) => {
|
|
194
|
+
option.addEventListener('click', async () => {
|
|
195
|
+
const selectedValue = option.getAttribute('value');
|
|
196
|
+
|
|
197
|
+
const pluginFields = pluginFields.find((pluginField) => pluginField.identifier === selectedValue);
|
|
198
|
+
|
|
199
|
+
if (!pluginFields) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const customPageTypeFields = document.getElementById('custom-page-type-fields');
|
|
204
|
+
|
|
205
|
+
if (pluginFields.fields > 0) {
|
|
206
|
+
customPageTypeFields.classList.remove('page-types-hidden');
|
|
207
|
+
customPageTypeFields.style.display = 'block';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (pluginFields.fields === 0) {
|
|
211
|
+
customPageTypeFields.classList.add('page-types-hidden');
|
|
212
|
+
customPageTypeFields.style.display = 'none';
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
async function setupPageEditorSwapper() {
|
|
220
|
+
const currentPageTypeOptions = document.querySelector('#page-type-dropdown').querySelectorAll('.sui-select-option');
|
|
221
|
+
|
|
222
|
+
currentPageTypeOptions.forEach((option) => {
|
|
223
|
+
option.addEventListener('click', async () => {
|
|
224
|
+
|
|
225
|
+
const selectedValue = option.getAttribute('value');
|
|
226
|
+
|
|
227
|
+
if (selectedValue !== 'studiocms/markdown') {
|
|
228
|
+
const editorContainer = document.querySelector('.page-content-editor');
|
|
229
|
+
const editorPlaceholder = document.getElementById('page-content-editor-placeholder');
|
|
230
|
+
|
|
231
|
+
if (editors.find((editor) => editor !== selectedValue)) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
editorContainer.style.display = 'none';
|
|
236
|
+
editorPlaceholder.style.display = 'block';
|
|
237
|
+
editorPlaceholder.innerText = 'You have changed your pageType. Please save your changes and refresh the page to see the new editor.';
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (selectedValue === 'studiocms/markdown') {
|
|
241
|
+
const editorContainer = document.querySelector('.page-content-editor');
|
|
242
|
+
const editorPlaceholder = document.getElementById('page-content-editor-placeholder');
|
|
243
|
+
|
|
244
|
+
editorContainer.style.display = 'block';
|
|
245
|
+
editorPlaceholder.style.display = 'none';
|
|
246
|
+
}
|
|
247
|
+
})
|
|
248
|
+
})
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
setupPluginFields();
|
|
252
|
+
setupPageEditorSwapper();
|
|
253
|
+
</script>
|
|
254
|
+
<script>
|
|
255
|
+
import { toast } from "studiocms:ui/components";
|
|
256
|
+
|
|
257
|
+
// get the elements
|
|
258
|
+
const editPageForm = document.getElementById('edit-page-form') as HTMLFormElement;
|
|
259
|
+
|
|
260
|
+
editPageForm.addEventListener('submit', async (e) => {
|
|
261
|
+
e.preventDefault();
|
|
262
|
+
const formData = new FormData(editPageForm);
|
|
263
|
+
|
|
264
|
+
const response = await fetch(editPageForm.action, {
|
|
265
|
+
method: 'PATCH',
|
|
266
|
+
body: formData,
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const res = await response.json();
|
|
270
|
+
|
|
271
|
+
if (response.status !== 200) {
|
|
272
|
+
toast({
|
|
273
|
+
title: 'Error',
|
|
274
|
+
description: res.error,
|
|
275
|
+
type: 'danger'
|
|
276
|
+
})
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (response.status === 200) {
|
|
281
|
+
toast({
|
|
282
|
+
title: 'Success',
|
|
283
|
+
description: res.message,
|
|
284
|
+
type: 'success'
|
|
285
|
+
})
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
</script>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
<style>
|
|
294
|
+
.page-types-hidden {
|
|
295
|
+
display: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
#edit-page-container {
|
|
299
|
+
height: 100%;
|
|
300
|
+
width: 100%;
|
|
301
|
+
min-width: 100%;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
#edit-page-form {
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-direction: column;
|
|
307
|
+
gap: .75rem;
|
|
308
|
+
padding-top: .5rem;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.tab-section {
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
gap: 1rem;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.form-row {
|
|
318
|
+
display: grid;
|
|
319
|
+
grid-template-columns: 1fr 1fr;
|
|
320
|
+
gap: .75rem;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
@media screen and (max-width: 768px) {
|
|
324
|
+
.form-row {
|
|
325
|
+
grid-template-columns: 1fr;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.page-content-editor {
|
|
330
|
+
height: 250px;
|
|
331
|
+
margin-bottom: 2rem;
|
|
332
|
+
|
|
333
|
+
.editor-container {
|
|
334
|
+
height: 100%;
|
|
335
|
+
overflow: hidden;
|
|
336
|
+
margin-bottom: 1rem;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
#page-content {
|
|
340
|
+
height: 100%;
|
|
341
|
+
width: 100%;
|
|
342
|
+
border: 1px solid hsl(var(--border));
|
|
343
|
+
border-radius: 4px;
|
|
344
|
+
padding: 1rem;
|
|
345
|
+
font-size: 1rem;
|
|
346
|
+
overflow-y: auto;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.edit-card-list {
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
gap: 0.875rem;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.edit-card {
|
|
357
|
+
display: flex;
|
|
358
|
+
flex-direction: column;
|
|
359
|
+
background-color: hsl(var(--background-step-2));
|
|
360
|
+
|
|
361
|
+
& .card-row {
|
|
362
|
+
display: flex;
|
|
363
|
+
justify-content: space-between;
|
|
364
|
+
align-items: center;
|
|
365
|
+
|
|
366
|
+
& .card-title {
|
|
367
|
+
font-weight: 600;
|
|
368
|
+
font-size: 1.25rem;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
& .card-date {
|
|
372
|
+
color: hsl(var(--text-muted));
|
|
373
|
+
font-size: .8rem;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
& .card-description {
|
|
377
|
+
font-size: 1rem;
|
|
378
|
+
color: hsl(var(--text-muted));
|
|
379
|
+
line-clamp: 1;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
& .card-icon {
|
|
383
|
+
color: hsl(var(--text-muted));
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
</style>
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { StudioCMSRoutes } from 'studiocms:lib';
|
|
3
|
+
import { Button, Divider, Dropdown, Icon, Input } from 'studiocms:ui/components';
|
|
4
|
+
import PageList from './PageList.astro';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
isNewFolder?: boolean;
|
|
8
|
+
isNewPage?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { isNewFolder, isNewPage } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class="inner-sidebar-header">
|
|
15
|
+
<Button variant="solid" color="primary" size='md' id="back-to-outer" class="mobile-btn mid-size-btn">
|
|
16
|
+
<Icon name="arrow-left" width={24} height={24} slot="start-content" />
|
|
17
|
+
</Button>
|
|
18
|
+
<form id="search-form">
|
|
19
|
+
<Input name='search' placeholder='Search...' type='search' required />
|
|
20
|
+
</form>
|
|
21
|
+
<Dropdown
|
|
22
|
+
transition:persist
|
|
23
|
+
transition:persist-props
|
|
24
|
+
id='create-new-dropdown'
|
|
25
|
+
options={[
|
|
26
|
+
{
|
|
27
|
+
label: 'Create Page',
|
|
28
|
+
icon: 'document',
|
|
29
|
+
value: StudioCMSRoutes.mainLinks.contentManagementCreate
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Create Folder',
|
|
33
|
+
icon: 'folder',
|
|
34
|
+
value: StudioCMSRoutes.mainLinks.contentManagementFolderCreate
|
|
35
|
+
},
|
|
36
|
+
]}
|
|
37
|
+
align={'end'}
|
|
38
|
+
offset={8}
|
|
39
|
+
>
|
|
40
|
+
<Button variant="solid" color="primary" size='md' class="add-button">
|
|
41
|
+
<Icon name="plus" width={24} height={24} slot="start-content" />
|
|
42
|
+
</Button>
|
|
43
|
+
</Dropdown>
|
|
44
|
+
<Button variant="solid" color="primary" size='md' class="mobile-btn" id="show-page">
|
|
45
|
+
<Icon name="x-mark" width={24} height={24} slot="start-content" />
|
|
46
|
+
</Button>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<Divider background={'background-step-2'}><span id="sidebar-divider-title">Items</span></Divider>
|
|
50
|
+
|
|
51
|
+
<div
|
|
52
|
+
class="inner-sidebar-items scrollbar"
|
|
53
|
+
id="inner-sidebar-items"
|
|
54
|
+
>
|
|
55
|
+
<PageList {isNewFolder} {isNewPage} />
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
class="inner-sidebar-items scrollbar"
|
|
60
|
+
id="inner-sidebar-items-search"
|
|
61
|
+
style="display: none;"
|
|
62
|
+
data-searchlist={StudioCMSRoutes.endpointLinks.searchList}
|
|
63
|
+
data-editpage={StudioCMSRoutes.mainLinks.contentManagementEdit}
|
|
64
|
+
data-editfolder={StudioCMSRoutes.mainLinks.contentManagementFolderEdit}
|
|
65
|
+
></div>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
import { DropdownHelper } from 'studiocms:ui/components';
|
|
69
|
+
|
|
70
|
+
const createNewDropdown = new DropdownHelper('create-new-dropdown');
|
|
71
|
+
|
|
72
|
+
createNewDropdown.registerClickCallback((value) => {
|
|
73
|
+
window.location.assign(value);
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<script>
|
|
78
|
+
import DOMPurify from 'dompurify';
|
|
79
|
+
import Fuse from 'fuse.js';
|
|
80
|
+
|
|
81
|
+
type SearchItem = {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
slug?: string;
|
|
85
|
+
type: 'folder' | 'page';
|
|
86
|
+
isDraft?: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type SearchList = SearchItem[];
|
|
90
|
+
|
|
91
|
+
function getIcon(item: SearchItem) {
|
|
92
|
+
if (item.type === 'folder') {
|
|
93
|
+
// heroicons:folder
|
|
94
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z" /> </svg> `;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (item.slug === 'index') {
|
|
98
|
+
// heroicons:home-modern
|
|
99
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 21v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21m0 0h4.5V3.545M12.75 21h7.5V10.75M2.25 21h1.5m18 0h-18M2.25 9l4.5-1.636M18.75 3l-1.5.545m0 6.205 3 1m1.5.5-1.5-.5M6.75 7.364V3h-3v18m3-13.636 10.5-3.819" /> </svg> `;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (item.isDraft) {
|
|
103
|
+
// heroicons:pencil-square
|
|
104
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"> <path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /> </svg> `;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// heroicons:document-text
|
|
108
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" /> </svg>`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const itemTemplate = (item: SearchItem, searchTerm: string) => {
|
|
112
|
+
const url = item.type === 'folder'
|
|
113
|
+
? `${document.getElementById('inner-sidebar-items-search')?.dataset.editfolder}?folder=${item.id}&search=${searchTerm}`
|
|
114
|
+
: `${document.getElementById('inner-sidebar-items-search')?.dataset.editpage}/?edit=${item.id}&search=${searchTerm}`;
|
|
115
|
+
return `
|
|
116
|
+
<div id="search-selector" data-href=${url} class="inner-sidebar-link">
|
|
117
|
+
${ getIcon(item) }
|
|
118
|
+
<span class="sidebar-link-text">
|
|
119
|
+
${item.name}
|
|
120
|
+
</span>
|
|
121
|
+
</div>
|
|
122
|
+
`;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
async function getSearchList(searchItems: HTMLDivElement) {
|
|
126
|
+
|
|
127
|
+
console.log(`Fetching search list from ${searchItems.dataset.searchlist}`);
|
|
128
|
+
|
|
129
|
+
const response = await fetch(searchItems.dataset.searchlist as string);
|
|
130
|
+
|
|
131
|
+
if (!response.ok) {
|
|
132
|
+
console.error('Failed to fetch search list');
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const data: SearchList = await response.json();
|
|
137
|
+
|
|
138
|
+
return data;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function clearSearchParams(dividerTitle: HTMLSpanElement, innerSidebarItemsSearch: HTMLDivElement) {
|
|
142
|
+
const url = new URL(window.location.href);
|
|
143
|
+
url.searchParams.delete('search');
|
|
144
|
+
window.history.pushState({}, '', url);
|
|
145
|
+
innerSidebarItemsSearch.innerHTML = '';
|
|
146
|
+
document.getElementById('inner-sidebar-items')!.style.display = 'block';
|
|
147
|
+
innerSidebarItemsSearch.style.display = 'none';
|
|
148
|
+
dividerTitle.innerText = 'Items';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function runSearch(form: HTMLFormElement, divider: HTMLSpanElement, searchItems: HTMLDivElement) {
|
|
152
|
+
const formData = new FormData(form);
|
|
153
|
+
|
|
154
|
+
const searchTerm = DOMPurify.sanitize(formData.get('search')?.toString() || '');
|
|
155
|
+
|
|
156
|
+
if (!searchTerm || searchTerm.length === 0) return;
|
|
157
|
+
|
|
158
|
+
const url = new URL(window.location.href);
|
|
159
|
+
url.searchParams.set('search', searchTerm);
|
|
160
|
+
window.history.pushState({}, '', url);
|
|
161
|
+
|
|
162
|
+
const searchList = await getSearchList(searchItems);
|
|
163
|
+
|
|
164
|
+
const fuse = new Fuse(searchList, {
|
|
165
|
+
keys: ['name', 'slug'],
|
|
166
|
+
isCaseSensitive: false,
|
|
167
|
+
threshold: 0.5,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const results = fuse.search(searchTerm);
|
|
171
|
+
|
|
172
|
+
console.log(`Search Results (${results.length}) `, results);
|
|
173
|
+
|
|
174
|
+
searchItems.innerHTML = results.map(({ item }) => {
|
|
175
|
+
return itemTemplate(item, searchTerm);
|
|
176
|
+
}).join('');
|
|
177
|
+
|
|
178
|
+
document.getElementById('inner-sidebar-items')!.style.display = 'none';
|
|
179
|
+
searchItems.style.display = 'block';
|
|
180
|
+
divider.innerText = `Search Results (${results.length})`;
|
|
181
|
+
|
|
182
|
+
const searchResultSelectors = document.querySelectorAll('#search-selector') as NodeListOf<HTMLDivElement>;
|
|
183
|
+
|
|
184
|
+
for (const selector of searchResultSelectors) {
|
|
185
|
+
selector.addEventListener('click', (e) => {
|
|
186
|
+
const url = selector.dataset.href;
|
|
187
|
+
window.location.assign(url!);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Main Functions
|
|
193
|
+
|
|
194
|
+
// Event Listeners
|
|
195
|
+
async function searchSetup() {
|
|
196
|
+
const form = document.getElementById('search-form') as HTMLFormElement;
|
|
197
|
+
const searchInput = form.querySelector('input[name=search]') as HTMLInputElement;
|
|
198
|
+
|
|
199
|
+
const innerSidebarItemsSearch = document.getElementById('inner-sidebar-items-search') as HTMLDivElement;
|
|
200
|
+
const dividerTitle = document.getElementById('sidebar-divider-title') as HTMLSpanElement;
|
|
201
|
+
|
|
202
|
+
const url = new URL(window.location.href);
|
|
203
|
+
const searchTerm = url.searchParams.get('search');
|
|
204
|
+
if (searchTerm) {
|
|
205
|
+
const input = searchInput;
|
|
206
|
+
input.value = searchTerm;
|
|
207
|
+
await runSearch(form, dividerTitle, innerSidebarItemsSearch);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// if the user submits the form, run the search
|
|
211
|
+
form.addEventListener('submit', async (e) => {
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
await runSearch(form, dividerTitle, innerSidebarItemsSearch);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// if the user stops typing for 500ms, run the search
|
|
217
|
+
let timeout: NodeJS.Timeout;
|
|
218
|
+
form.addEventListener('input', () => {
|
|
219
|
+
if (searchInput.value.length === 0) clearSearchParams(dividerTitle, innerSidebarItemsSearch);
|
|
220
|
+
|
|
221
|
+
clearTimeout(timeout);
|
|
222
|
+
timeout = setTimeout(async () => await runSearch(form, dividerTitle, innerSidebarItemsSearch), 500);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// if the user clears the search, clear the query params
|
|
226
|
+
searchInput.addEventListener('search', () => clearSearchParams(dividerTitle, innerSidebarItemsSearch));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
searchSetup();
|
|
230
|
+
</script>
|