domma-cms 1.60.0 → 1.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/CLAUDE.md +1 -1
  3. package/admin/index.html +7 -1
  4. package/admin/js/app.js +2 -2
  5. package/admin/js/lib/ai-assist.js +1 -1
  6. package/admin/js/templates/ai-assist-builders.html +29 -0
  7. package/admin/js/templates/docs/usage-chat.html +5 -2
  8. package/admin/js/views/ai-assist-builders.js +1 -0
  9. package/admin/js/views/ai-assist-settings.js +1 -1
  10. package/admin/js/views/index.js +1 -1
  11. package/admin/js/views/login.js +1 -1
  12. package/docs/DommaFeatures.md +4 -2
  13. package/docs/cache.md +24 -0
  14. package/docs/configuration.md +1 -1
  15. package/docs/plugin-development.md +26 -0
  16. package/package.json +1 -1
  17. package/public/js/effects.js +1 -1
  18. package/public/js/site.js +1 -1
  19. package/server/config.js +37 -0
  20. package/server/routes/api/admin-assistant.js +11 -3
  21. package/server/routes/api/auth.js +4 -1
  22. package/server/routes/api/chats.js +3 -1
  23. package/server/routes/api/components.js +2 -1
  24. package/server/routes/api/content-api.js +1 -1
  25. package/server/routes/api/content-public.js +2 -2
  26. package/server/routes/api/content-writes.js +1 -1
  27. package/server/routes/api/effects.js +4 -9
  28. package/server/routes/api/layouts.js +1 -1
  29. package/server/routes/api/pages.js +6 -5
  30. package/server/routes/api/search.js +3 -3
  31. package/server/routes/api/sidebar-counts.js +2 -0
  32. package/server/routes/api/theme.js +4 -7
  33. package/server/routes/api/views.js +2 -1
  34. package/server/routes/public.js +4 -4
  35. package/server/server.js +14 -7
  36. package/server/services/aiAssist.js +67 -0
  37. package/server/services/cache/adminChange.js +28 -0
  38. package/server/services/chat/ai.js +1 -1
  39. package/server/services/content.js +73 -10
  40. package/server/services/effectsSettings.js +25 -0
  41. package/server/services/health.js +2 -2
  42. package/server/services/hooks.js +1 -1
  43. package/server/services/htmlResponse.js +33 -4
  44. package/server/services/listTags.js +1 -1
  45. package/server/services/markdown.js +56 -22
  46. package/server/services/pluginGuides.js +2 -2
  47. package/server/services/plugins.js +34 -3
  48. package/server/services/projects.js +39 -4
  49. package/server/services/publicAssets.js +488 -0
  50. package/server/services/renderer.js +10 -8
  51. package/server/services/seo/index.js +3 -3
  52. package/server/services/sitemap.js +1 -1
  53. package/server/services/themeSettings.js +11 -0
  54. package/server/services/versions.js +2 -2
  55. package/server/services/wpImport/index.js +2 -2
  56. package/server/templates/page.html +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.61.1] - 2026-11-11
4
+
5
+ ### Changed
6
+
7
+ - **Faster pages for returning visitors.** A page's stylesheets and scripts are now cached by the browser for good and renamed automatically when they change, so going from one page to the next no longer asks the server about each of them again. On the Domma CMS site a repeat page view went from 58 requests to 10. Nothing to set up: a rendered page's local `.css` and `.js` links carry `_pv=<hash>`, and its modules are covered by an import map. See docs/cache.md, "Fingerprinted assets".
8
+ - **Custom CSS is a file, not part of every page.** Past 4 KB, `content/custom.css` is linked as `/content/custom.css` instead of being written into each page (previews keep it inline). On a site with a large stylesheet this took a page from 244 KB to 70 KB and cut the memory the page cache uses by about two thirds.
9
+ - **Lists, search and the sitemap no longer render every page.** The Pages list, its badge and tags, the Layouts, Search and Content API badges, the sitemap, the Content API's page list and search, and the public site search each parsed every page in full - about two seconds on a 237-page site, during which the site answered nothing else. They now read the front matter only (about 20 ms). Plugins: `listPages({render: false})` returns front matter, `urlPath`, `content` and `resolvedProject` without rendering.
10
+ - A page served from the cache costs about half the server time it did: it is no longer hashed, and `site.json` and the projects list are no longer read, on every request.
11
+ - Scroll-reveal settings are written into the page, so effects start without waiting on a request.
12
+
13
+ ### Fixed
14
+
15
+ - **The page cache survives an open admin.** The chat availability check-in (every 30 seconds), the side menu's badge refresh (every minute) and the editor's live previews (as you type) are POSTs, and each counted as a change that emptied the whole cache - so while anyone was signed in, almost no page was served from it. A route can now say it changes nothing a page shows (`config: {keepsCache: true}`, see docs/cache.md).
16
+ - Memory no longer grows with every editor preview and page save (the front matter parser kept every string it was given).
17
+ - `menu-float.js` was fetched and run twice on every page.
18
+
19
+ ## [1.61.0] - 2026-11-11
20
+
21
+ ### Changed
22
+
23
+
24
+ - **AI chat answers see up to 48,000 characters of Knowledge** (was 16,000), so a full Knowledge base of around 80 entries reaches AI Assist instead of only the most used third. Needs the matching Manager change; until then the Manager trims at 24,000.
25
+ - **AI Assist lives under Data.** Its side-menu entry now starts in the Data folder (it was Tools > Communication); a place an admin chose for it still wins.
26
+ - **Builders in AI Assist.** A new **Builders** tab lists the AI chats of the site's builders - the Site Builder's conversations and the Tool Builder's builds - with who started each and when; click one to carry on in its builder. Each person sees only the builders, and the chats, they could open in the builder itself. Builders opt in with plugin.json `admin.aiAssist` (see docs/plugin-development.md, "AI Assist: listing your AI chats"); only the plugin's own screen and API are accepted.
27
+ - The admin opens light while it loads, instead of dark until the site's admin theme is applied. Domma's own start-up theme (Charcoal Dark, or a theme remembered from the public site) no longer overrides it.
28
+ - Sign-in and password-reset screens honour the saved admin theme, including custom theme colours, fonts and matching logo variants, instead of forcing Charcoal Dark. Only the selected theme presentation is exposed before sign-in.
29
+ - When the saved theme cannot be read (an older site or a failed request), the sign-in screen falls back to Charcoal Light, matching the admin's light start while it loads.
30
+
3
31
  ## [1.60.0] - 2026-11-11
4
32
 
5
33
  - **AI Assist owns every chat.** On a site with AI Assist (Pro), chats are answered in its own screen, **AI Assist** (Tools > Communication), with **Chats**, **Knowledge** and **Settings** tabs; it takes the Chats entry's place in the side menu. **Settings** holds what AI answers know and the rules they keep (About the business, Rules) and the admin assistant, which move there from Site Settings. Launchers stay launchers. A site without AI Assist keeps Content > Chats exactly as before; links to either lead to whichever the site has, and chat notifications link there too.
package/CLAUDE.md CHANGED
@@ -560,7 +560,7 @@ standing trap as `buildThemeView()`. Every key in that object reaches the page s
560
560
  `normaliseSearchSettings()` whitelists rather than merges. `enabled: false` emits nothing at all.
561
561
 
562
562
  `window.DommaSiteSearch.open()` keeps its old name on purpose: context menus and site scripts already call it.
563
- There is no index - each query scans `listPages()` - and drafts and private pages never reach a result.
563
+ There is no index - each query scans `listPages({render: false})` (front matter and source, nothing rendered) - and drafts and private pages never reach a result.
564
564
 
565
565
  `server/services/search-migration.js` runs once at startup to lift an existing site off the old plugin: settings out
566
566
  of plugins.json, the plugins.json entry gone, and `plugins/site-search/` deleted (only if it is the bundled one -
package/admin/index.html CHANGED
@@ -31,7 +31,7 @@
31
31
  <link rel="stylesheet" href="/admin/css/calculator.css">
32
32
  <link rel="stylesheet" href="/admin/css/admin-assistant.css?v=20261110-admin-assistant">
33
33
  </head>
34
- <body class="dm-cloaked dm-theme-charcoal-dark dashboard-layout">
34
+ <body class="dm-cloaked dm-theme-charcoal-light dashboard-layout">
35
35
 
36
36
  <!-- Top Bar -->
37
37
  <header id="admin-topbar">
@@ -64,6 +64,12 @@
64
64
  </main>
65
65
  </div>
66
66
 
67
+ <!-- Domma (and the copy inside domma-tools) would otherwise apply its default
68
+ theme, Charcoal Dark, or a remembered public-site choice on DOMContentLoaded.
69
+ The body's own class (light) stays until the saved admin theme is applied
70
+ (lib/admin-theme.js, views/login.js). -->
71
+ <script>window.DommaOptions = Object.assign({}, window.DommaOptions, {theme: false});</script>
72
+
67
73
  <!-- DOMPurify - must load before DommaJS -->
68
74
  <script src="/public/js/vendor/dompurify/purify.min.js?v=3.4.17"></script>
69
75
 
package/admin/js/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import{wireNotificationMenu as ct}from"./lib/topbar-notifications.js";import{installSmoothCarets as pt}from"./lib/smooth-caret.js";import{viewLoaders as mt}from"./views/index.js";import{createLazyViews as dt}from"./lib/lazy-views.js";import{withPluginChrome as J}from"./lib/plugin-chrome.js";import{api as r,getUser as W,isAuthenticated as m,logout as ut,sendToLogin as ht}from"./api.js";import{claimDrafts as wt}from"./lib/draft-owner.js";import{isAuthScreen as P,loginHashFor as gt}from"./lib/login-arrange.js";import{installHttpInterceptor as ft}from"./http-interceptor.js";import{installResizableSlideovers as vt}from"./lib/slideover-resizable.js";import{installActivityThrobber as bt}from"./lib/activity-throbber.js";import{installUpdateNotice as Ct,renderCmsVersion as St}from"./lib/update-notice.js";import{renderFrameworkVersions as Y,wireAccountMenu as Mt}from"./lib/topbar-account.js";import{refreshTopbarProject as H}from"./lib/topbar-project.js";import{CONFINED_CLASS as yt,isConfined as Dt,isPathAllowed as N,redirectFor as At}from"./lib/admin-scope.js";import{deliverDesktop as Et,desktopActive as Q,notificationSettings as X}from"./lib/desktop-notify.js";import{chatToastsOpen as Pt,closeChatToasts as Nt,deliverChatToasts as kt,settleChatToasts as jt}from"./lib/chat-toast.js";import{aiAssistReroute as Rt,launcherChatsFor as It}from"./lib/ai-assist.js";import{onPresence as Tt,setAvailable as Z,startPresence as Lt,stopPresence as tt}from"./lib/chat-presence.js";import{avatarUrl as Ut,installAccountAvatar as $t}from"./lib/avatar.js";import{installCalculator as xt}from"./lib/calculator.js";import{installAdminAssistant as Bt}from"./lib/admin-assistant.js";import{installAdminLaunchers as Ft}from"./lib/admin-launchers.js";import{takeOverviewPass as Ot,withDashboardStrip as et}from"./lib/dashboards-strip.js";import{installHotkeys as Vt}from"./lib/hotkeys-ui.js";import{applyAdminBrand as at}from"./lib/admin-brand.js";import{installRouterCatchUp as _t}from"./lib/router-catch-up.js";import{installSidebarDrawer as Kt}from"./lib/sidebar-drawer.js";$(()=>{pt(document),ft(),xt(),Bt(),Ft(),Ct(),bt(),vt(),Kt(),(async()=>{const{applyAdminTheme:t,refreshAdminTheme:o}=await import("./lib/admin-theme.js");m()?await o(r,{init:!0}):t({dommaTheme:"charcoal-dark"},{init:!0})})();let l=null,f=null,p="/",v=!1,w=null,d=null,u=!0,b=!1,C=null;function k(t){if(T[t])return E.toast(`${T[t]} is switched off on this site.`,{type:"info"}),"/";const[o,e]=t.split("?"),a=new URLSearchParams(e||"").get("tab");if(o==="/settings"&&["favicon","pageNavigation","breadcrumbs","motion","search"].includes(a))return`/appearance?tab=${a}`;if(t.split("?")[0]==="/my-dashboard")return"/dashboards";const i=Rt(t,C);if(i&&N(l,i.split("?")[0]))return i;const s=It(t);if(s&&!N(l,o)&&N(l,s.split("?")[0]))return s;const n=I[t]||At(l,t);return n||(!u&&o==="/system/notifications"?l?.home||"/":(t.split("?")[0]||"/")==="/"&&p&&p!=="/"&&!Ot()?I[p]||p:null)}function j(){document.body.classList.toggle(yt,Dt(l))}const I={},T={};R.use(async(t,o,e)=>{if(P(t.path))return e();if(!m()){ht();return}const a=k(t.path);if(a){R.navigate(a);return}e()});async function y(){try{const t=await r.get("/auth/permissions");l=t.adminScope||null,j(),f=t.adminBrand||null,at(f),p=t.adminHome||"/",Y(t.versions||{});const o=t.permissions||[];return v=N(l,"/settings")&&o.some(e=>e==="settings"||e.startsWith("settings.")),w=o.some(e=>e==="notifications"||e.startsWith("notifications.")),d=t.adminPortal||null,u=t.notificationsScreen!==!1,b=o.includes("chats")||o.includes("chats.reply"),o}catch{return l=null,j(),p="/",f||at(null),v=!1,w=null,d=null,u=!0,b=!1,[]}}document.addEventListener("dm:admin-home-changed",()=>{y()});let L=null,U=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(H(r),L){U=!0;return}L=(async()=>{do{U=!1;try{await x(await y())}catch{}}while(U)})().finally(()=>{L=null})});async function x(t){const{applyAdminPortal:o}=await import("./lib/admin-portal.js");if(await o(d),d)return;const{renderAdminSidebar:e}=await import("./lib/sidebar-renderer.js");await e({mount:"#admin-sidebar",permissions:t,adminScope:l,brand:f,notificationsScreen:u})}M.subscribe("router:afterChange",({to:t})=>{P(t.path)&&(g&&(clearInterval(g),g=null),l=null,j(),p="/",v=!1,w=null,u=!0,b=!1,d&&(d=null,import("./lib/admin-portal.js").then(o=>o.applyAdminPortal(null))))});const it=[{path:"/",view:"dashboard",title:"Dashboard - Domma CMS"},{path:"/dashboards",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/my-dashboard",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/pages",view:"pages",title:"Pages - Domma CMS"},{path:"/pages/new",view:"pageEditor",title:"New Page - Domma CMS"},{path:"/pages/edit/*",view:"pageEditor",title:"Edit Page - Domma CMS"},{path:"/media",view:"media",title:"Media - Domma CMS"},{path:"/menus",view:"menus",title:"Menus - Domma CMS"},{path:"/context-menus",view:"contextMenus",title:"Context Menus - Domma CMS"},{path:"/context-menus/new",view:"contextMenuEditor",title:"New Context Menu - Domma CMS"},{path:"/context-menus/edit/:slug",view:"contextMenuEditor",title:"Edit Context Menu - Domma CMS"},{path:"/launchers",view:"launchers",title:"Launchers - Domma CMS"},{path:"/menus/new",view:"menuEditor",title:"New Menu - Domma CMS"},{path:"/menus/edit/:slug",view:"menuEditor",title:"Edit Menu - Domma CMS"},{path:"/menu-locations",view:"menuLocations",title:"Menu Locations - Domma CMS"},{path:"/navigation",view:"menusRedirect",title:"Menus - Domma CMS"},{path:"/layouts",view:"layouts",title:"Layouts - Domma CMS"},{path:"/appearance",view:"appearance",title:"Appearance - Domma CMS"},{path:"/footer",view:"footer",title:"Footer - Domma CMS"},{path:"/settings",view:"settings",title:"Settings - Domma CMS"},{path:"/theme",view:"theme",title:"Theme - Domma CMS"},{path:"/users",view:"users",title:"Users - Domma CMS"},{path:"/users/new",view:"userEditor",title:"New User - Domma CMS"},{path:"/users/edit/:id",view:"userEditor",title:"Edit User - Domma CMS"},{path:"/plugins",view:"plugins",title:"Plugins - Domma CMS"},{path:"/plugins/code/:name",view:"pluginCode",title:"Plugin Code - Domma CMS"},{path:"/documentation",view:"documentation",title:"Usage - Domma CMS"},{path:"/tutorials",view:"tutorials",title:"Tutorials - Domma CMS"},{path:"/tutorials/crud",view:"tutorialCrud",title:"Building a CRUD App - Domma CMS"},{path:"/tutorials/editor",view:"tutorialEditor",title:"The Editor - Domma CMS"},{path:"/tutorials/plugin",view:"tutorialPlugin",title:"Writing a Tool - Domma CMS"},{path:"/tutorials/forms",view:"tutorialForms",title:"Form Follow-Up - Domma CMS"},{path:"/docs/components",view:"componentsReference",title:"Components Reference - Domma CMS"},{path:"/docs/components-howto",view:"componentsHowto",title:"Components How-To - Domma CMS"},{path:"/docs/components-walkthrough",view:"componentsWalkthrough",title:"Components Walkthrough - Domma CMS"},{path:"/docs/components-rules",view:"componentsRules",title:"Components Rules - Domma CMS"},{path:"/docs/usage/pages",view:"usagePages",title:"Pages - Usage - Domma CMS"},{path:"/docs/usage/media",view:"usageMedia",title:"Media - Usage - Domma CMS"},{path:"/docs/usage/navigation",view:"usageNavigation",title:"Navigation - Usage - Domma CMS"},{path:"/docs/usage/dconfig",view:"usageDconfig",title:"DConfig - Usage - Domma CMS"},{path:"/docs/usage/shortcodes",view:"usageShortcodes",title:"Shortcodes - Usage - Domma CMS"},{path:"/docs/usage/site-settings",view:"usageSiteSettings",title:"Site Settings - Usage - Domma CMS"},{path:"/docs/usage/plugins",view:"usagePlugins",title:"Plugins - Usage - Domma CMS"},{path:"/docs/usage/users-roles",view:"usageUsersRoles",title:"Users & Roles - Usage - Domma CMS"},{path:"/docs/usage/views",view:"usageViews",title:"Views - Usage - Domma CMS"},{path:"/docs/usage/actions",view:"usageActions",title:"Actions - Usage - Domma CMS"},{path:"/docs/usage/cta-shortcode",view:"usageCtaShortcode",title:"CTA Shortcode - Usage - Domma CMS"},{path:"/docs/usage/editions",view:"usageEditions",title:"Editions & Licences - Usage - Domma CMS"},{path:"/docs/usage/collections",view:"usageCollections",title:"Collections & Forms - Usage - Domma CMS"},{path:"/docs/usage/blocks",view:"usageBlocks",title:"Blocks - Usage - Domma CMS"},{path:"/docs/usage/tools",view:"usageTools",title:"Built-in Tools - Usage - Domma CMS"},{path:"/docs/usage/dashboard",view:"usageDashboard",title:"Dashboard - Usage - Domma CMS"},{path:"/docs/usage/search-engines",view:"usageSearchEngines",title:"Search Engines & AI - Usage - Domma CMS"},{path:"/docs/usage/launchers",view:"usageLaunchers",title:"Launchers - Usage - Domma CMS"},{path:"/docs/usage/chat",view:"usageChat",title:"Chat & Knowledge - Usage - Domma CMS"},{path:"/docs/plugins",view:"pluginGuides",title:"Plugin Guides - Domma CMS"},{path:"/docs/plugins/*",view:"pluginGuide",title:"Plugin Guide - Domma CMS"},{path:"/docs/api/authentication",view:"apiRefAuthentication",title:"Authentication - API - Domma CMS"},{path:"/docs/api/pages",view:"apiRefPages",title:"Pages - API - Domma CMS"},{path:"/docs/api/settings",view:"apiRefSettings",title:"Settings - API - Domma CMS"},{path:"/docs/api/layouts",view:"apiRefLayouts",title:"Layouts - API - Domma CMS"},{path:"/docs/api/navigation",view:"apiRefNavigation",title:"Navigation - API - Domma CMS"},{path:"/docs/api/media",view:"apiRefMedia",title:"Media - API - Domma CMS"},{path:"/docs/api/users",view:"apiRefUsers",title:"Users - API - Domma CMS"},{path:"/docs/api/plugins",view:"apiRefPlugins",title:"Plugins - API - Domma CMS"},{path:"/docs/api/collections",view:"apiRefCollections",title:"Collections - API - Domma CMS"},{path:"/docs/api/views",view:"apiRefViews",title:"Views API - Domma CMS"},{path:"/docs/api/actions",view:"apiRefActions",title:"Actions API - Domma CMS"},{path:"/docs/api/forms",view:"apiRefForms",title:"Forms API - Domma CMS"},{path:"/docs/api/scaffold",view:"apiRefScaffold",title:"Scaffold API - Domma CMS"},{path:"/docs/api/external",view:"apiRefExternal",title:"External API & Tokens - Domma CMS"},{path:"/docs/api/content",view:"apiRefContent",title:"Content API - Domma CMS"},{path:"/docs/api/builder",view:"apiRefBuilder",title:"API Builder - Domma CMS"},{path:"/api-reference",view:"apiReference",title:"API Reference - Domma CMS"},{path:"/collections",view:"collections",title:"Collections - Domma CMS"},{path:"/collections/new",view:"collectionEditor",title:"New Collection - Domma CMS"},{path:"/collections/edit/:slug",view:"collectionEditor",title:"Edit Collection - Domma CMS"},{path:"/collections/:slug/entries",view:"collectionEntries",title:"Entries - Domma CMS"},{path:"/forms",view:"forms",title:"Forms - Domma CMS"},{path:"/forms/new",view:"formEditor",title:"New Form - Domma CMS"},{path:"/forms/edit/:slug",view:"formEditor",title:"Edit Form - Domma CMS"},{path:"/forms/:slug/submissions",view:"formSubmissions",title:"Submissions - Domma CMS"},{path:"/views",view:"viewsList",title:"Views - Domma CMS"},{path:"/views/new",view:"viewEditor",title:"New View - Domma CMS"},{path:"/views/edit/:slug",view:"viewEditor",title:"Edit View - Domma CMS"},{path:"/views/:slug/preview",view:"viewPreview",title:"View Preview - Domma CMS"},{path:"/actions",view:"actionsList",title:"Actions - Domma CMS"},{path:"/actions/new",view:"actionEditor",title:"New Action - Domma CMS"},{path:"/actions/edit/:slug",view:"actionEditor",title:"Edit Action - Domma CMS"},{path:"/pro/docs",view:"proDocs",title:"Pro Documentation - Domma CMS"},{path:"/blocks",view:"blocks",title:"Blocks - Domma CMS"},{path:"/blocks/new",view:"pageEditor",title:"New Block - Domma CMS"},{path:"/blocks/edit/:name",view:"pageEditor",title:"Edit Block - Domma CMS"},{path:"/components",view:"components",title:"Components - Domma CMS"},{path:"/components/new",view:"pageEditor",title:"New Component - Domma CMS"},{path:"/components/edit/:name",view:"pageEditor",title:"Edit Component - Domma CMS"},{path:"/my-profile",view:"myProfile",title:"My Profile - Domma CMS"},{path:"/roles",view:"roles",title:"Roles & Permissions - Domma CMS"},{path:"/roles/edit/:id",view:"roleEditor",title:"Edit Role - Domma CMS"},{path:"/effects",view:"effects",title:"Effects - Domma CMS"},{path:"/search",view:"search",title:"Search - Domma CMS"},{path:"/content-api",view:"contentApi",title:"Content API - Domma CMS"},{path:"/launchers/chats",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/chats/:id",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/knowledge",view:"chatKnowledge",title:"Chat Knowledge - Domma CMS"},{path:"/ai-assist",view:"aiAssistChats",title:"AI Assist - Domma CMS"},{path:"/ai-assist/chats",view:"aiAssistChats",title:"AI Assist - Domma CMS"},{path:"/ai-assist/chats/:id",view:"aiAssistChats",title:"AI Assist - Domma CMS"},{path:"/ai-assist/knowledge",view:"aiAssistKnowledge",title:"AI Assist Knowledge - Domma CMS"},{path:"/ai-assist/settings",view:"aiAssistSettings",title:"AI Assist Settings - Domma CMS"},{path:"/notes",view:"notes",title:"Notes - Domma CMS"},{path:"/todo",view:"todo",title:"Todo - Domma CMS"},{path:"/calculator",view:"calculator",title:"Calculator - Domma CMS"},{path:"/analytics",view:"analytics",title:"Analytics - Domma CMS"},{path:"/seo",view:"seo",title:"SEO - Domma CMS"},{path:"/seo/:tab",view:"seo",title:"SEO - Domma CMS"},{path:"/wordpress-import",view:"wordpressImport",title:"Import a site - Domma CMS"},{path:"/contacts",view:"contacts",title:"Contacts - Domma CMS"},{path:"/calls/new",view:"callNew",title:"Call now - Domma CMS"},{path:"/system/notifications",view:"notifications",title:"Notifications - Domma CMS"},{path:"/api-tokens",view:"apiTokens",title:"API Tokens - Domma CMS"},{path:"/api-endpoints",view:"apiEndpoints",title:"API Builder - Domma CMS"},{path:"/api-endpoints/new",view:"apiEndpointEditor",title:"New API Endpoint - Domma CMS"},{path:"/api-endpoints/edit/:id",view:"apiEndpointEditor",title:"Edit API Endpoint - Domma CMS"},{path:"/projects",view:"projects",title:"Projects - Domma CMS"},{path:"/projects/new",view:"projects",title:"New Project - Domma CMS"},{path:"/projects/edit/:slug",view:"projects",title:"Edit Project - Domma CMS"},{path:"/projects/:slug/settings",view:"projectSettings",title:"Project settings - Domma CMS"},{path:"/projects/:slug/pages",view:"pages",title:"Project pages - Domma CMS"},{path:"/projects/:slug/collections",view:"collections",title:"Project collections - Domma CMS"},{path:"/projects/:slug/forms",view:"forms",title:"Project forms - Domma CMS"},{path:"/projects/:slug/actions",view:"actionsList",title:"Project actions - Domma CMS"},{path:"/projects/:slug/menus",view:"menus",title:"Project menus - Domma CMS"},{path:"/projects/:slug/blocks",view:"blocks",title:"Project blocks - Domma CMS"},{path:"/projects/:slug/components",view:"components",title:"Project components - Domma CMS"},{path:"/projects/:slug/views",view:"viewsList",title:"Project views - Domma CMS"},{path:"/projects/:slug/roles",view:"roles",title:"Project roles - Domma CMS"},{path:"/projects/:slug/users",view:"users",title:"Project users - Domma CMS"},{path:"/projects/:slug/apis",view:"apiEndpoints",title:"Project APIs - Domma CMS"},{path:"/projects/:slug",view:"projectDetail",title:"Project - Domma CMS"},{path:"/login",view:"login",title:"Sign in - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide(),tt(),Nt()}},{path:"/reset-password",view:"login",title:"Reset Password - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}}];M.subscribe("router:afterChange",async({to:t,from:o})=>{if(!P(t.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),P(o?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(i=>i.refreshAdminTheme(r)),await O();const e=await y(),a=k(t.path);if(a&&R.navigate(a),x(e),X.read().signInToasts)try{const i=await r.system.notifications.list().catch(()=>[]),s=(Array.isArray(i)?i:[]).filter(n=>n.unread&&["warning","critical"].includes(n.data?.severity)).slice(0,3);for(const n of s){const c=h(n.data?.title||""),K=h((n.data?.body||"").slice(0,120));E.toast(`${c} - ${K}`,{type:n.data?.severity==="critical"?"error":"warning",duration:0})}}catch{}}G()}}),M.subscribe("router:afterChange",()=>{setTimeout(()=>{$(".btn-primary, .btn-danger").length&&Domma.effects.reveal(".btn-primary, .btn-danger",{animation:"fade",stagger:40,duration:300})},50)});const ot=["#field-project","#menu-project","#collection-project","#endpoint-project","#action-project","#view-project","#block-project","#component-project","#role-project",'[name="project"]','[name="ownedByProject"]'];function st(t){return/^\/(pages|menus|context-menus|collections|forms|actions|views|blocks|components|users|roles|api-endpoints)\/(new|edit\/)/.test(t)}M.subscribe("router:afterChange",({to:t})=>{const o=t?String(t.path).split("?")[0]:"";if(!t||!st(o))return;const a=new URLSearchParams(location.hash.split("?")[1]||"").get("project");if(!a||!/\/new$/.test(o))return;let i=0;const s=60,n=1500,c=()=>{i+=s;for(const K of ot){const A=document.querySelector(K);if(!A)continue;if(Array.from(A.options||[]).find(lt=>lt.value===a)){A.value=a,A.dispatchEvent(new Event("change",{bubbles:!0}));return}}i<n&&setTimeout(c,s)};setTimeout(c,s)});const q="cms_card_states",B=S.get(q)||{};M.subscribe("router:afterChange",()=>{setTimeout(()=>{$("#view-container .card-collapsible").each(function(){const t=$(this).find(".card-header h2, .card-header h3").first().text().trim();t&&B[t]==="collapsed"&&$(this).addClass("card-collapsed")})},200)}),$("#view-container").on("click",".card-collapsible .card-header",function(t){if($(t.target).closest("button, a").length)return;const o=$(this).closest(".card");o.toggleClass("card-collapsed");const e=$(this).find("h2, h3").first().text().trim();e&&(B[e]=o.hasClass("card-collapsed")?"collapsed":"open",S.set(q,B))}),Vt(),document.addEventListener("keydown",t=>{if(!(t.ctrlKey||t.metaKey)||t.key!=="s"||window.location.hash.startsWith("#/login")||window.location.hash.startsWith("#/reset-password"))return;const o=document.querySelector("#view-container .view-header button.btn-primary");o&&(t.preventDefault(),o.click())});const D=dt(),z=D.views,nt={notes:{displayName:"Notes",icon:"edit-3"},todo:{displayName:"Todo",icon:"check-square"},calculator:{displayName:"Calculator",icon:"calculator"},analytics:{displayName:"Analytics",icon:"chart-bar"},seo:{displayName:"SEO",icon:"search"},wordpressImport:{displayName:"Import a site",icon:"download"},contacts:{displayName:"Contacts",icon:"users"},projects:{displayName:"Projects",icon:"folder"},pages:{displayName:"Pages",icon:"file-text"},media:{displayName:"Media",icon:"image"},menus:{displayName:"Site menus",icon:"menu"},contextMenus:{displayName:"Context Menus",icon:"menu"},launchers:{displayName:"Launchers",icon:"rocket"},theme:{displayName:"Theme",icon:"droplet"},collections:{displayName:"Collections",icon:"database"},forms:{displayName:"Forms",icon:"layout"},viewsList:{displayName:"Views",icon:"eye"},actionsList:{displayName:"Actions",icon:"zap"},apiEndpoints:{displayName:"API Builder",icon:"code"},blocks:{displayName:"Blocks",icon:"box"},components:{displayName:"Components",icon:"component"},notifications:{displayName:"Notifications",icon:"bell"},roles:{displayName:"Roles",icon:"shield"},users:{displayName:"Users",icon:"users"},appearance:{displayName:"Appearance",icon:"layout"},footer:{displayName:"Footer",icon:"panel-bottom"},settings:{displayName:"Site Settings",icon:"settings"},effects:{displayName:"Effects",icon:"sparkles"},layouts:{displayName:"Layouts",icon:"layout"},plugins:{displayName:"Marketplace",icon:"store"},myProfile:{displayName:"My Profile",icon:"user"},apiTokens:{displayName:"API Tokens",icon:"key"},search:{displayName:"Search",icon:"search"},contentApi:{displayName:"Content API",icon:"file-text"},chats:{displayName:"Chats",icon:"message-circle"},dashboard:{displayName:"Dashboard",icon:"home"},dashboards:{displayName:"Dashboards",icon:"home"},pageEditor:{displayName:"Pages",section:"Edit",icon:"file-text"},menuEditor:{displayName:"Site menus",section:"Edit",icon:"menu"},menuLocations:{displayName:"Site menus",section:"Locations",icon:"map-pin"},contextMenuEditor:{displayName:"Context Menus",section:"Edit",icon:"menu"},collectionEditor:{displayName:"Collections",section:"Edit",icon:"database"},collectionEntries:{displayName:"Collections",section:"Entries",icon:"database"},formEditor:{displayName:"Forms",section:"Edit",icon:"layout"},formSubmissions:{displayName:"Forms",section:"Submissions",icon:"inbox"},viewEditor:{displayName:"Views",section:"Edit",icon:"eye"},viewPreview:{displayName:"Views",section:"Preview",icon:"eye"},actionEditor:{displayName:"Actions",section:"Edit",icon:"zap"},apiEndpointEditor:{displayName:"API Builder",section:"Edit",icon:"code"},roleEditor:{displayName:"Roles",section:"Edit",icon:"shield"},userEditor:{displayName:"Users",section:"Edit",icon:"users"},projectDetail:{displayName:"Projects",section:"Overview",icon:"folder"},projectSettings:{displayName:"Projects",section:"Settings",icon:"folder"},pluginCode:{displayName:"Marketplace",section:"Code",icon:"code"},chatKnowledge:{displayName:"Chats",section:"Knowledge",icon:"book-open"},aiAssistChats:{displayName:"AI Assist",section:"Chats",icon:"sparkles",licence:"Pro"},aiAssistKnowledge:{displayName:"AI Assist",section:"Knowledge",icon:"sparkles",licence:"Pro"},aiAssistSettings:{displayName:"AI Assist",section:"Settings",icon:"sparkles",licence:"Pro"}};for(const[t,o]of Object.entries(mt))D.register(t,async()=>{let e=await o();const a=nt[t];return a&&(e=J(e,{plugin:t,licence:"Built in",...a})),t==="dashboard"?et(e):e});R.use(async(t,o,e)=>{try{await D.load(t.view)}catch(a){console.error("[admin] Screen failed to load",a),z[t.view]={template:'<p role="alert">This screen could not load. Reload the page to try again.</p>'}}e()});const F=[...it];async function O(){if(m()){C=await r.get("/ai-assist").catch(()=>C);try{const t=await r.plugins.adminConfig(),o=new Set(F.map(e=>e.path));for(const e of t.routes||[])o.has(e.path)||F.push(e);for(const[e,a]of Object.entries(t.views||{})){const i=(t.meta||{})[e];D.register(e,async()=>{const n=(await import(`/plugins/${a.entry}`))[a.exportName];if(!n)throw new Error(`Missing plugin screen: ${e}`);const c=J(n,i);return e==="dashboard"?et(c):c},JSON.stringify([a,i]))}for(const[e,{route:a}]of Object.entries(t.takeovers||{}))a&&(I[`/${e}`]=a);t.mediaPicker&&(globalThis[Symbol.for("domma.media-picker")]=t.mediaPicker);for(const[e,{enabled:a,displayName:i}]of Object.entries(t.tools||{}))a===!1&&(T[`/${e}`]=i);for(const{id:e,href:a}of t.css||[])if(!document.getElementById(e)){const i=document.createElement("link");i.id=e,i.rel="stylesheet",i.href=a,document.head.appendChild(i)}}catch{}}}function G(){const t=W();if(!t)return;if($("#topbar-user-name").length){H(r);return}const e={"super-admin":"Super Admin",admin:"Admin",user:"User"}[t.role]||t.role,a=Ut(t);$("#topbar-user").get(0).innerHTML=`
1
+ import{wireNotificationMenu as ct}from"./lib/topbar-notifications.js";import{installSmoothCarets as pt}from"./lib/smooth-caret.js";import{viewLoaders as mt}from"./views/index.js";import{createLazyViews as dt}from"./lib/lazy-views.js";import{withPluginChrome as J}from"./lib/plugin-chrome.js";import{api as r,getUser as W,isAuthenticated as m,logout as ut,sendToLogin as ht}from"./api.js";import{claimDrafts as wt}from"./lib/draft-owner.js";import{isAuthScreen as P,loginHashFor as gt}from"./lib/login-arrange.js";import{installHttpInterceptor as ft}from"./http-interceptor.js";import{installResizableSlideovers as vt}from"./lib/slideover-resizable.js";import{installActivityThrobber as bt}from"./lib/activity-throbber.js";import{installUpdateNotice as Ct,renderCmsVersion as St}from"./lib/update-notice.js";import{renderFrameworkVersions as Y,wireAccountMenu as Mt}from"./lib/topbar-account.js";import{refreshTopbarProject as H}from"./lib/topbar-project.js";import{CONFINED_CLASS as yt,isConfined as Dt,isPathAllowed as N,redirectFor as At}from"./lib/admin-scope.js";import{deliverDesktop as Et,desktopActive as Q,notificationSettings as X}from"./lib/desktop-notify.js";import{chatToastsOpen as Pt,closeChatToasts as Nt,deliverChatToasts as kt,settleChatToasts as jt}from"./lib/chat-toast.js";import{aiAssistReroute as Rt,launcherChatsFor as It,rememberAiAssistState as Tt}from"./lib/ai-assist.js";import{onPresence as Lt,setAvailable as Z,startPresence as Ut,stopPresence as tt}from"./lib/chat-presence.js";import{avatarUrl as $t,installAccountAvatar as xt}from"./lib/avatar.js";import{installCalculator as Bt}from"./lib/calculator.js";import{installAdminAssistant as Ft}from"./lib/admin-assistant.js";import{installAdminLaunchers as Ot}from"./lib/admin-launchers.js";import{takeOverviewPass as Vt,withDashboardStrip as et}from"./lib/dashboards-strip.js";import{installHotkeys as _t}from"./lib/hotkeys-ui.js";import{applyAdminBrand as at}from"./lib/admin-brand.js";import{installRouterCatchUp as Kt}from"./lib/router-catch-up.js";import{installSidebarDrawer as Wt}from"./lib/sidebar-drawer.js";$(()=>{pt(document),ft(),Bt(),Ft(),Ot(),Ct(),bt(),vt(),Wt(),(async()=>{const{refreshAdminTheme:t}=await import("./lib/admin-theme.js");m()&&await t(r,{init:!0})})();let l=null,v=null,p="/",b=!1,w=null,d=null,u=!0,C=!1,g=null;function k(t){if(T[t])return E.toast(`${T[t]} is switched off on this site.`,{type:"info"}),"/";const[o,e]=t.split("?"),a=new URLSearchParams(e||"").get("tab");if(o==="/settings"&&["favicon","pageNavigation","breadcrumbs","motion","search"].includes(a))return`/appearance?tab=${a}`;if(t.split("?")[0]==="/my-dashboard")return"/dashboards";const i=Rt(t,g);if(i&&N(l,i.split("?")[0]))return i;const s=It(t);if(s&&!N(l,o)&&N(l,s.split("?")[0]))return s;const n=I[t]||At(l,t);return n||(!u&&o==="/system/notifications"?l?.home||"/":(t.split("?")[0]||"/")==="/"&&p&&p!=="/"&&!Vt()?I[p]||p:null)}function j(){document.body.classList.toggle(yt,Dt(l))}const I={},T={};R.use(async(t,o,e)=>{if(P(t.path))return e();if(!m()){ht();return}const a=k(t.path);if(a){R.navigate(a);return}e()});async function y(){try{const t=await r.get("/auth/permissions");l=t.adminScope||null,j(),v=t.adminBrand||null,at(v),p=t.adminHome||"/",Y(t.versions||{});const o=t.permissions||[];return b=N(l,"/settings")&&o.some(e=>e==="settings"||e.startsWith("settings.")),w=o.some(e=>e==="notifications"||e.startsWith("notifications.")),d=t.adminPortal||null,u=t.notificationsScreen!==!1,C=o.includes("chats")||o.includes("chats.reply"),o}catch{return l=null,j(),p="/",v||at(null),b=!1,w=null,d=null,u=!0,C=!1,[]}}document.addEventListener("dm:admin-home-changed",()=>{y()});let L=null,U=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(H(r),L){U=!0;return}L=(async()=>{do{U=!1;try{await x(await y())}catch{}}while(U)})().finally(()=>{L=null})});async function x(t){const{applyAdminPortal:o}=await import("./lib/admin-portal.js");if(await o(d),d)return;const{renderAdminSidebar:e}=await import("./lib/sidebar-renderer.js");await e({mount:"#admin-sidebar",permissions:t,adminScope:l,brand:v,notificationsScreen:u})}M.subscribe("router:afterChange",({to:t})=>{P(t.path)&&(f&&(clearInterval(f),f=null),l=null,j(),p="/",b=!1,w=null,u=!0,C=!1,d&&(d=null,import("./lib/admin-portal.js").then(o=>o.applyAdminPortal(null))))});const it=[{path:"/",view:"dashboard",title:"Dashboard - Domma CMS"},{path:"/dashboards",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/my-dashboard",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/pages",view:"pages",title:"Pages - Domma CMS"},{path:"/pages/new",view:"pageEditor",title:"New Page - Domma CMS"},{path:"/pages/edit/*",view:"pageEditor",title:"Edit Page - Domma CMS"},{path:"/media",view:"media",title:"Media - Domma CMS"},{path:"/menus",view:"menus",title:"Menus - Domma CMS"},{path:"/context-menus",view:"contextMenus",title:"Context Menus - Domma CMS"},{path:"/context-menus/new",view:"contextMenuEditor",title:"New Context Menu - Domma CMS"},{path:"/context-menus/edit/:slug",view:"contextMenuEditor",title:"Edit Context Menu - Domma CMS"},{path:"/launchers",view:"launchers",title:"Launchers - Domma CMS"},{path:"/menus/new",view:"menuEditor",title:"New Menu - Domma CMS"},{path:"/menus/edit/:slug",view:"menuEditor",title:"Edit Menu - Domma CMS"},{path:"/menu-locations",view:"menuLocations",title:"Menu Locations - Domma CMS"},{path:"/navigation",view:"menusRedirect",title:"Menus - Domma CMS"},{path:"/layouts",view:"layouts",title:"Layouts - Domma CMS"},{path:"/appearance",view:"appearance",title:"Appearance - Domma CMS"},{path:"/footer",view:"footer",title:"Footer - Domma CMS"},{path:"/settings",view:"settings",title:"Settings - Domma CMS"},{path:"/theme",view:"theme",title:"Theme - Domma CMS"},{path:"/users",view:"users",title:"Users - Domma CMS"},{path:"/users/new",view:"userEditor",title:"New User - Domma CMS"},{path:"/users/edit/:id",view:"userEditor",title:"Edit User - Domma CMS"},{path:"/plugins",view:"plugins",title:"Plugins - Domma CMS"},{path:"/plugins/code/:name",view:"pluginCode",title:"Plugin Code - Domma CMS"},{path:"/documentation",view:"documentation",title:"Usage - Domma CMS"},{path:"/tutorials",view:"tutorials",title:"Tutorials - Domma CMS"},{path:"/tutorials/crud",view:"tutorialCrud",title:"Building a CRUD App - Domma CMS"},{path:"/tutorials/editor",view:"tutorialEditor",title:"The Editor - Domma CMS"},{path:"/tutorials/plugin",view:"tutorialPlugin",title:"Writing a Tool - Domma CMS"},{path:"/tutorials/forms",view:"tutorialForms",title:"Form Follow-Up - Domma CMS"},{path:"/docs/components",view:"componentsReference",title:"Components Reference - Domma CMS"},{path:"/docs/components-howto",view:"componentsHowto",title:"Components How-To - Domma CMS"},{path:"/docs/components-walkthrough",view:"componentsWalkthrough",title:"Components Walkthrough - Domma CMS"},{path:"/docs/components-rules",view:"componentsRules",title:"Components Rules - Domma CMS"},{path:"/docs/usage/pages",view:"usagePages",title:"Pages - Usage - Domma CMS"},{path:"/docs/usage/media",view:"usageMedia",title:"Media - Usage - Domma CMS"},{path:"/docs/usage/navigation",view:"usageNavigation",title:"Navigation - Usage - Domma CMS"},{path:"/docs/usage/dconfig",view:"usageDconfig",title:"DConfig - Usage - Domma CMS"},{path:"/docs/usage/shortcodes",view:"usageShortcodes",title:"Shortcodes - Usage - Domma CMS"},{path:"/docs/usage/site-settings",view:"usageSiteSettings",title:"Site Settings - Usage - Domma CMS"},{path:"/docs/usage/plugins",view:"usagePlugins",title:"Plugins - Usage - Domma CMS"},{path:"/docs/usage/users-roles",view:"usageUsersRoles",title:"Users & Roles - Usage - Domma CMS"},{path:"/docs/usage/views",view:"usageViews",title:"Views - Usage - Domma CMS"},{path:"/docs/usage/actions",view:"usageActions",title:"Actions - Usage - Domma CMS"},{path:"/docs/usage/cta-shortcode",view:"usageCtaShortcode",title:"CTA Shortcode - Usage - Domma CMS"},{path:"/docs/usage/editions",view:"usageEditions",title:"Editions & Licences - Usage - Domma CMS"},{path:"/docs/usage/collections",view:"usageCollections",title:"Collections & Forms - Usage - Domma CMS"},{path:"/docs/usage/blocks",view:"usageBlocks",title:"Blocks - Usage - Domma CMS"},{path:"/docs/usage/tools",view:"usageTools",title:"Built-in Tools - Usage - Domma CMS"},{path:"/docs/usage/dashboard",view:"usageDashboard",title:"Dashboard - Usage - Domma CMS"},{path:"/docs/usage/search-engines",view:"usageSearchEngines",title:"Search Engines & AI - Usage - Domma CMS"},{path:"/docs/usage/launchers",view:"usageLaunchers",title:"Launchers - Usage - Domma CMS"},{path:"/docs/usage/chat",view:"usageChat",title:"Chat & Knowledge - Usage - Domma CMS"},{path:"/docs/plugins",view:"pluginGuides",title:"Plugin Guides - Domma CMS"},{path:"/docs/plugins/*",view:"pluginGuide",title:"Plugin Guide - Domma CMS"},{path:"/docs/api/authentication",view:"apiRefAuthentication",title:"Authentication - API - Domma CMS"},{path:"/docs/api/pages",view:"apiRefPages",title:"Pages - API - Domma CMS"},{path:"/docs/api/settings",view:"apiRefSettings",title:"Settings - API - Domma CMS"},{path:"/docs/api/layouts",view:"apiRefLayouts",title:"Layouts - API - Domma CMS"},{path:"/docs/api/navigation",view:"apiRefNavigation",title:"Navigation - API - Domma CMS"},{path:"/docs/api/media",view:"apiRefMedia",title:"Media - API - Domma CMS"},{path:"/docs/api/users",view:"apiRefUsers",title:"Users - API - Domma CMS"},{path:"/docs/api/plugins",view:"apiRefPlugins",title:"Plugins - API - Domma CMS"},{path:"/docs/api/collections",view:"apiRefCollections",title:"Collections - API - Domma CMS"},{path:"/docs/api/views",view:"apiRefViews",title:"Views API - Domma CMS"},{path:"/docs/api/actions",view:"apiRefActions",title:"Actions API - Domma CMS"},{path:"/docs/api/forms",view:"apiRefForms",title:"Forms API - Domma CMS"},{path:"/docs/api/scaffold",view:"apiRefScaffold",title:"Scaffold API - Domma CMS"},{path:"/docs/api/external",view:"apiRefExternal",title:"External API & Tokens - Domma CMS"},{path:"/docs/api/content",view:"apiRefContent",title:"Content API - Domma CMS"},{path:"/docs/api/builder",view:"apiRefBuilder",title:"API Builder - Domma CMS"},{path:"/api-reference",view:"apiReference",title:"API Reference - Domma CMS"},{path:"/collections",view:"collections",title:"Collections - Domma CMS"},{path:"/collections/new",view:"collectionEditor",title:"New Collection - Domma CMS"},{path:"/collections/edit/:slug",view:"collectionEditor",title:"Edit Collection - Domma CMS"},{path:"/collections/:slug/entries",view:"collectionEntries",title:"Entries - Domma CMS"},{path:"/forms",view:"forms",title:"Forms - Domma CMS"},{path:"/forms/new",view:"formEditor",title:"New Form - Domma CMS"},{path:"/forms/edit/:slug",view:"formEditor",title:"Edit Form - Domma CMS"},{path:"/forms/:slug/submissions",view:"formSubmissions",title:"Submissions - Domma CMS"},{path:"/views",view:"viewsList",title:"Views - Domma CMS"},{path:"/views/new",view:"viewEditor",title:"New View - Domma CMS"},{path:"/views/edit/:slug",view:"viewEditor",title:"Edit View - Domma CMS"},{path:"/views/:slug/preview",view:"viewPreview",title:"View Preview - Domma CMS"},{path:"/actions",view:"actionsList",title:"Actions - Domma CMS"},{path:"/actions/new",view:"actionEditor",title:"New Action - Domma CMS"},{path:"/actions/edit/:slug",view:"actionEditor",title:"Edit Action - Domma CMS"},{path:"/pro/docs",view:"proDocs",title:"Pro Documentation - Domma CMS"},{path:"/blocks",view:"blocks",title:"Blocks - Domma CMS"},{path:"/blocks/new",view:"pageEditor",title:"New Block - Domma CMS"},{path:"/blocks/edit/:name",view:"pageEditor",title:"Edit Block - Domma CMS"},{path:"/components",view:"components",title:"Components - Domma CMS"},{path:"/components/new",view:"pageEditor",title:"New Component - Domma CMS"},{path:"/components/edit/:name",view:"pageEditor",title:"Edit Component - Domma CMS"},{path:"/my-profile",view:"myProfile",title:"My Profile - Domma CMS"},{path:"/roles",view:"roles",title:"Roles & Permissions - Domma CMS"},{path:"/roles/edit/:id",view:"roleEditor",title:"Edit Role - Domma CMS"},{path:"/effects",view:"effects",title:"Effects - Domma CMS"},{path:"/search",view:"search",title:"Search - Domma CMS"},{path:"/content-api",view:"contentApi",title:"Content API - Domma CMS"},{path:"/launchers/chats",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/chats/:id",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/knowledge",view:"chatKnowledge",title:"Chat Knowledge - Domma CMS"},{path:"/ai-assist",view:"aiAssistChats",title:"AI Assist - Domma CMS"},{path:"/ai-assist/chats",view:"aiAssistChats",title:"AI Assist - Domma CMS"},{path:"/ai-assist/chats/:id",view:"aiAssistChats",title:"AI Assist - Domma CMS"},{path:"/ai-assist/knowledge",view:"aiAssistKnowledge",title:"AI Assist Knowledge - Domma CMS"},{path:"/ai-assist/settings",view:"aiAssistSettings",title:"AI Assist Settings - Domma CMS"},{path:"/ai-assist/builders",view:"aiAssistBuilders",title:"AI Assist Builders - Domma CMS"},{path:"/notes",view:"notes",title:"Notes - Domma CMS"},{path:"/todo",view:"todo",title:"Todo - Domma CMS"},{path:"/calculator",view:"calculator",title:"Calculator - Domma CMS"},{path:"/analytics",view:"analytics",title:"Analytics - Domma CMS"},{path:"/seo",view:"seo",title:"SEO - Domma CMS"},{path:"/seo/:tab",view:"seo",title:"SEO - Domma CMS"},{path:"/wordpress-import",view:"wordpressImport",title:"Import a site - Domma CMS"},{path:"/contacts",view:"contacts",title:"Contacts - Domma CMS"},{path:"/calls/new",view:"callNew",title:"Call now - Domma CMS"},{path:"/system/notifications",view:"notifications",title:"Notifications - Domma CMS"},{path:"/api-tokens",view:"apiTokens",title:"API Tokens - Domma CMS"},{path:"/api-endpoints",view:"apiEndpoints",title:"API Builder - Domma CMS"},{path:"/api-endpoints/new",view:"apiEndpointEditor",title:"New API Endpoint - Domma CMS"},{path:"/api-endpoints/edit/:id",view:"apiEndpointEditor",title:"Edit API Endpoint - Domma CMS"},{path:"/projects",view:"projects",title:"Projects - Domma CMS"},{path:"/projects/new",view:"projects",title:"New Project - Domma CMS"},{path:"/projects/edit/:slug",view:"projects",title:"Edit Project - Domma CMS"},{path:"/projects/:slug/settings",view:"projectSettings",title:"Project settings - Domma CMS"},{path:"/projects/:slug/pages",view:"pages",title:"Project pages - Domma CMS"},{path:"/projects/:slug/collections",view:"collections",title:"Project collections - Domma CMS"},{path:"/projects/:slug/forms",view:"forms",title:"Project forms - Domma CMS"},{path:"/projects/:slug/actions",view:"actionsList",title:"Project actions - Domma CMS"},{path:"/projects/:slug/menus",view:"menus",title:"Project menus - Domma CMS"},{path:"/projects/:slug/blocks",view:"blocks",title:"Project blocks - Domma CMS"},{path:"/projects/:slug/components",view:"components",title:"Project components - Domma CMS"},{path:"/projects/:slug/views",view:"viewsList",title:"Project views - Domma CMS"},{path:"/projects/:slug/roles",view:"roles",title:"Project roles - Domma CMS"},{path:"/projects/:slug/users",view:"users",title:"Project users - Domma CMS"},{path:"/projects/:slug/apis",view:"apiEndpoints",title:"Project APIs - Domma CMS"},{path:"/projects/:slug",view:"projectDetail",title:"Project - Domma CMS"},{path:"/login",view:"login",title:"Sign in - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide(),tt(),Nt()}},{path:"/reset-password",view:"login",title:"Reset Password - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}}];M.subscribe("router:afterChange",async({to:t,from:o})=>{if(!P(t.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),P(o?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(i=>i.refreshAdminTheme(r)),await O();const e=await y(),a=k(t.path);if(a&&R.navigate(a),x(e),X.read().signInToasts)try{const i=await r.system.notifications.list().catch(()=>[]),s=(Array.isArray(i)?i:[]).filter(n=>n.unread&&["warning","critical"].includes(n.data?.severity)).slice(0,3);for(const n of s){const c=h(n.data?.title||""),K=h((n.data?.body||"").slice(0,120));E.toast(`${c} - ${K}`,{type:n.data?.severity==="critical"?"error":"warning",duration:0})}}catch{}}G()}}),M.subscribe("router:afterChange",()=>{setTimeout(()=>{$(".btn-primary, .btn-danger").length&&Domma.effects.reveal(".btn-primary, .btn-danger",{animation:"fade",stagger:40,duration:300})},50)});const ot=["#field-project","#menu-project","#collection-project","#endpoint-project","#action-project","#view-project","#block-project","#component-project","#role-project",'[name="project"]','[name="ownedByProject"]'];function st(t){return/^\/(pages|menus|context-menus|collections|forms|actions|views|blocks|components|users|roles|api-endpoints)\/(new|edit\/)/.test(t)}M.subscribe("router:afterChange",({to:t})=>{const o=t?String(t.path).split("?")[0]:"";if(!t||!st(o))return;const a=new URLSearchParams(location.hash.split("?")[1]||"").get("project");if(!a||!/\/new$/.test(o))return;let i=0;const s=60,n=1500,c=()=>{i+=s;for(const K of ot){const A=document.querySelector(K);if(!A)continue;if(Array.from(A.options||[]).find(lt=>lt.value===a)){A.value=a,A.dispatchEvent(new Event("change",{bubbles:!0}));return}}i<n&&setTimeout(c,s)};setTimeout(c,s)});const q="cms_card_states",B=S.get(q)||{};M.subscribe("router:afterChange",()=>{setTimeout(()=>{$("#view-container .card-collapsible").each(function(){const t=$(this).find(".card-header h2, .card-header h3").first().text().trim();t&&B[t]==="collapsed"&&$(this).addClass("card-collapsed")})},200)}),$("#view-container").on("click",".card-collapsible .card-header",function(t){if($(t.target).closest("button, a").length)return;const o=$(this).closest(".card");o.toggleClass("card-collapsed");const e=$(this).find("h2, h3").first().text().trim();e&&(B[e]=o.hasClass("card-collapsed")?"collapsed":"open",S.set(q,B))}),_t(),document.addEventListener("keydown",t=>{if(!(t.ctrlKey||t.metaKey)||t.key!=="s"||window.location.hash.startsWith("#/login")||window.location.hash.startsWith("#/reset-password"))return;const o=document.querySelector("#view-container .view-header button.btn-primary");o&&(t.preventDefault(),o.click())});const D=dt(),z=D.views,nt={notes:{displayName:"Notes",icon:"edit-3"},todo:{displayName:"Todo",icon:"check-square"},calculator:{displayName:"Calculator",icon:"calculator"},analytics:{displayName:"Analytics",icon:"chart-bar"},seo:{displayName:"SEO",icon:"search"},wordpressImport:{displayName:"Import a site",icon:"download"},contacts:{displayName:"Contacts",icon:"users"},projects:{displayName:"Projects",icon:"folder"},pages:{displayName:"Pages",icon:"file-text"},media:{displayName:"Media",icon:"image"},menus:{displayName:"Site menus",icon:"menu"},contextMenus:{displayName:"Context Menus",icon:"menu"},launchers:{displayName:"Launchers",icon:"rocket"},theme:{displayName:"Theme",icon:"droplet"},collections:{displayName:"Collections",icon:"database"},forms:{displayName:"Forms",icon:"layout"},viewsList:{displayName:"Views",icon:"eye"},actionsList:{displayName:"Actions",icon:"zap"},apiEndpoints:{displayName:"API Builder",icon:"code"},blocks:{displayName:"Blocks",icon:"box"},components:{displayName:"Components",icon:"component"},notifications:{displayName:"Notifications",icon:"bell"},roles:{displayName:"Roles",icon:"shield"},users:{displayName:"Users",icon:"users"},appearance:{displayName:"Appearance",icon:"layout"},footer:{displayName:"Footer",icon:"panel-bottom"},settings:{displayName:"Site Settings",icon:"settings"},effects:{displayName:"Effects",icon:"sparkles"},layouts:{displayName:"Layouts",icon:"layout"},plugins:{displayName:"Marketplace",icon:"store"},myProfile:{displayName:"My Profile",icon:"user"},apiTokens:{displayName:"API Tokens",icon:"key"},search:{displayName:"Search",icon:"search"},contentApi:{displayName:"Content API",icon:"file-text"},chats:{displayName:"Chats",icon:"message-circle"},dashboard:{displayName:"Dashboard",icon:"home"},dashboards:{displayName:"Dashboards",icon:"home"},pageEditor:{displayName:"Pages",section:"Edit",icon:"file-text"},menuEditor:{displayName:"Site menus",section:"Edit",icon:"menu"},menuLocations:{displayName:"Site menus",section:"Locations",icon:"map-pin"},contextMenuEditor:{displayName:"Context Menus",section:"Edit",icon:"menu"},collectionEditor:{displayName:"Collections",section:"Edit",icon:"database"},collectionEntries:{displayName:"Collections",section:"Entries",icon:"database"},formEditor:{displayName:"Forms",section:"Edit",icon:"layout"},formSubmissions:{displayName:"Forms",section:"Submissions",icon:"inbox"},viewEditor:{displayName:"Views",section:"Edit",icon:"eye"},viewPreview:{displayName:"Views",section:"Preview",icon:"eye"},actionEditor:{displayName:"Actions",section:"Edit",icon:"zap"},apiEndpointEditor:{displayName:"API Builder",section:"Edit",icon:"code"},roleEditor:{displayName:"Roles",section:"Edit",icon:"shield"},userEditor:{displayName:"Users",section:"Edit",icon:"users"},projectDetail:{displayName:"Projects",section:"Overview",icon:"folder"},projectSettings:{displayName:"Projects",section:"Settings",icon:"folder"},pluginCode:{displayName:"Marketplace",section:"Code",icon:"code"},chatKnowledge:{displayName:"Chats",section:"Knowledge",icon:"book-open"},aiAssistChats:{displayName:"AI Assist",section:"Chats",icon:"sparkles",licence:"Pro"},aiAssistKnowledge:{displayName:"AI Assist",section:"Knowledge",icon:"sparkles",licence:"Pro"},aiAssistSettings:{displayName:"AI Assist",section:"Settings",icon:"sparkles",licence:"Pro"},aiAssistBuilders:{displayName:"AI Assist",section:"Builders",icon:"sparkles",licence:"Pro"}};for(const[t,o]of Object.entries(mt))D.register(t,async()=>{let e=await o();const a=nt[t];return a&&(e=J(e,{plugin:t,licence:"Built in",...a})),t==="dashboard"?et(e):e});R.use(async(t,o,e)=>{try{await D.load(t.view)}catch(a){console.error("[admin] Screen failed to load",a),z[t.view]={template:'<p role="alert">This screen could not load. Reload the page to try again.</p>'}}e()});const F=[...it];async function O(){if(m()){g=await r.get("/ai-assist").catch(()=>g),Tt(g);try{const t=await r.plugins.adminConfig(),o=new Set(F.map(e=>e.path));for(const e of t.routes||[])o.has(e.path)||F.push(e);for(const[e,a]of Object.entries(t.views||{})){const i=(t.meta||{})[e];D.register(e,async()=>{const n=(await import(`/plugins/${a.entry}`))[a.exportName];if(!n)throw new Error(`Missing plugin screen: ${e}`);const c=J(n,i);return e==="dashboard"?et(c):c},JSON.stringify([a,i]))}for(const[e,{route:a}]of Object.entries(t.takeovers||{}))a&&(I[`/${e}`]=a);t.mediaPicker&&(globalThis[Symbol.for("domma.media-picker")]=t.mediaPicker);for(const[e,{enabled:a,displayName:i}]of Object.entries(t.tools||{}))a===!1&&(T[`/${e}`]=i);for(const{id:e,href:a}of t.css||[])if(!document.getElementById(e)){const i=document.createElement("link");i.id=e,i.rel="stylesheet",i.href=a,document.head.appendChild(i)}}catch{}}}function G(){const t=W();if(!t)return;if($("#topbar-user-name").length){H(r);return}const e={"super-admin":"Super Admin",admin:"Admin",user:"User"}[t.role]||t.role,a=$t(t);$("#topbar-user").get(0).innerHTML=`
2
2
  <a id="topbar-project" class="topbar-action-link topbar-project" hidden>
3
3
  <span data-icon="folder"></span>
4
4
  <span id="topbar-project-name" class="topbar-project-name"></span>
@@ -56,4 +56,4 @@ import{wireNotificationMenu as ct}from"./lib/topbar-notifications.js";import{ins
56
56
  </a>
57
57
  </div>
58
58
  </div>
59
- `;const i=$("#topbar-settings").get(0);i&&(i.hidden=!v),$("#topbar-logout-btn").on("click",s=>{s.preventDefault(),tt({leaving:!0}),ut()}),Domma.icons.scan("#admin-topbar"),E.tooltip("#topbar-actions [data-tooltip]",{placement:"bottom"}),Mt(t),ct({refreshBadge:_,canRead:()=>w!==!1,own:()=>!u}),$t(t),rt(t),Y(),St(),H(r),_(),g||(g=setInterval(_,3e4))}function rt(t){const o=b&&C?.chats!==!1;Lt({userId:t.id,canReply:o,post:i=>r.post("/chats/presence",i)});const e=document.getElementById("topbar-presence"),a=document.getElementById("topbar-available");!e||!a||e.dataset.wired||(e.dataset.wired="1",e.addEventListener("click",()=>Z(e.getAttribute("aria-pressed")!=="true")),a.addEventListener("change",()=>Z(a.checked)),Tt(({available:i,canReply:s})=>{e.hidden=!s,a.closest("label").hidden=!s,e.setAttribute("aria-pressed",String(i)),e.classList.toggle("is-available",i),e.setAttribute("aria-label",i?"Available for chats - switch to away":"Away from chats - switch to available"),e.querySelector(".topbar-presence-label").textContent=i?"Available":"Away",a.checked=i}))}function h(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}let g=null,V=null;async function _(){if(!(!m()||w===!1))try{const{count:t}=await r.system.notifications.unreadCount(),o=$("#topbar-bell-badge");t>0?o.text(t>99?"99+":String(t)).removeAttr("hidden"):o.attr("hidden","").text("");const e=X.read().chatToasts&&t>0&&(V===null||t>V);V=t;const a=Pt();if(t>0&&(Q()||e)||a){const i=await r.system.notifications.list().catch(()=>null);if(!i)return;t>0&&Q()&&Et(i),e&&kt(i),a&&jt(i)}}catch{}}(async()=>{if(!m()&&!window.location.hash.startsWith("#/reset-password"))window.location.hash.startsWith("#/login")||(window.location.hash=gt(window.location.hash));else{wt(W()?.id);const a=W(),[i]=await Promise.all([a?y():Promise.resolve([]),O()]);if(a){const s=(window.location.hash||"#/").slice(1)||"/",n=k(s);n&&(window.location.hash=`#${n}`),x(i).catch(c=>console.error("[admin] Sidebar failed to load",c)),G()}}const t=R._extractParams.bind(R);R._extractParams=function(a,i){const s=i.indexOf("?");if(s!==-1&&(i=i.slice(0,s)),a.endsWith("/*")){const n=a.slice(0,-2);return i.startsWith(n+"/")?{}:null}return t(a,i)};const o=R._renderNotFound.bind(R);let e="";R._renderNotFound=async function(a){return m()&&e!==a&&(e=a,await O(),R._matchRoute(a).route)?(e="",R._handleRouteChange()):(e="",m()&&$("#admin-sidebar").get(0)?.style.display==="none"?(E.toast("That link goes nowhere - here is your home page.",{type:"warning"}),R.navigate("/")):o(a))},_t(R),R.init({container:"#view-container",routes:F,views:z,default:"/",transitions:{enter:"fadeIn",leave:"fadeOut",duration:150}})})()});
59
+ `;const i=$("#topbar-settings").get(0);i&&(i.hidden=!b),$("#topbar-logout-btn").on("click",s=>{s.preventDefault(),tt({leaving:!0}),ut()}),Domma.icons.scan("#admin-topbar"),E.tooltip("#topbar-actions [data-tooltip]",{placement:"bottom"}),Mt(t),ct({refreshBadge:_,canRead:()=>w!==!1,own:()=>!u}),xt(t),rt(t),Y(),St(),H(r),_(),f||(f=setInterval(_,3e4))}function rt(t){const o=C&&g?.chats!==!1;Ut({userId:t.id,canReply:o,post:i=>r.post("/chats/presence",i)});const e=document.getElementById("topbar-presence"),a=document.getElementById("topbar-available");!e||!a||e.dataset.wired||(e.dataset.wired="1",e.addEventListener("click",()=>Z(e.getAttribute("aria-pressed")!=="true")),a.addEventListener("change",()=>Z(a.checked)),Lt(({available:i,canReply:s})=>{e.hidden=!s,a.closest("label").hidden=!s,e.setAttribute("aria-pressed",String(i)),e.classList.toggle("is-available",i),e.setAttribute("aria-label",i?"Available for chats - switch to away":"Away from chats - switch to available"),e.querySelector(".topbar-presence-label").textContent=i?"Available":"Away",a.checked=i}))}function h(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}let f=null,V=null;async function _(){if(!(!m()||w===!1))try{const{count:t}=await r.system.notifications.unreadCount(),o=$("#topbar-bell-badge");t>0?o.text(t>99?"99+":String(t)).removeAttr("hidden"):o.attr("hidden","").text("");const e=X.read().chatToasts&&t>0&&(V===null||t>V);V=t;const a=Pt();if(t>0&&(Q()||e)||a){const i=await r.system.notifications.list().catch(()=>null);if(!i)return;t>0&&Q()&&Et(i),e&&kt(i),a&&jt(i)}}catch{}}(async()=>{if(!m()&&!window.location.hash.startsWith("#/reset-password"))window.location.hash.startsWith("#/login")||(window.location.hash=gt(window.location.hash));else{wt(W()?.id);const a=W(),[i]=await Promise.all([a?y():Promise.resolve([]),O()]);if(a){const s=(window.location.hash||"#/").slice(1)||"/",n=k(s);n&&(window.location.hash=`#${n}`),x(i).catch(c=>console.error("[admin] Sidebar failed to load",c)),G()}}const t=R._extractParams.bind(R);R._extractParams=function(a,i){const s=i.indexOf("?");if(s!==-1&&(i=i.slice(0,s)),a.endsWith("/*")){const n=a.slice(0,-2);return i.startsWith(n+"/")?{}:null}return t(a,i)};const o=R._renderNotFound.bind(R);let e="";R._renderNotFound=async function(a){return m()&&e!==a&&(e=a,await O(),R._matchRoute(a).route)?(e="",R._handleRouteChange()):(e="",m()&&$("#admin-sidebar").get(0)?.style.display==="none"?(E.toast("That link goes nowhere - here is your home page.",{type:"warning"}),R.navigate("/")):o(a))},Kt(R),R.init({container:"#view-container",routes:F,views:z,default:"/",transitions:{enter:"fadeIn",leave:"fadeOut",duration:150}})})()});
@@ -1 +1 @@
1
- export const AI_ASSIST_BASE="/ai-assist",LAUNCHER_BASE="/launchers",AI_ASSIST_TABS=Object.freeze([{key:"chats",label:"Chats",icon:"message-circle",chats:!0},{key:"knowledge",label:"Knowledge",icon:"book-open",chats:!0},{key:"settings",label:"Settings",icon:"settings",chats:!1}]);export function aiAssistReroute(e,t){if(!t||typeof e!="string")return null;const[n,o]=e.split("?"),a=o?`?${o}`:"",s=t.chats!==!1,r=n.match(/^\/(launchers|ai-assist)(?:\/(chats|knowledge|settings))?(\/[^/]+)?\/?$/);if(!r)return null;const[,c,i,l=""]=r;return c==="launchers"?!i||i==="settings"?null:t.on?`${AI_ASSIST_BASE}/${i}${l}${a}`:null:t.on?i?!s&&i!=="settings"?`${AI_ASSIST_BASE}/settings`:null:`${AI_ASSIST_BASE}/${s?"chats":"settings"}`:s&&(i==="chats"||i==="knowledge")?`${LAUNCHER_BASE}/${i}${l}${a}`:s?`${LAUNCHER_BASE}/chats`:"/"}export function launcherChatsFor(e){const t=String(e||"").match(/^\/ai-assist\/(chats|knowledge)(\/[^/?]+)?\/?(\?.*)?$/);return t?`${LAUNCHER_BASE}/${t[1]}${t[2]||""}${t[3]||""}`:null}export function chatsBaseFor(e){return/^#\/ai-assist\b/.test(String(e||""))?`#${AI_ASSIST_BASE}`:`#${LAUNCHER_BASE}`}export function aiAssistTabs(e,{chats:t=!0}={}){return AI_ASSIST_TABS.filter(n=>t||!n.chats).map(n=>({...n,href:`#${AI_ASSIST_BASE}/${n.key}`,active:n.key===e}))}export function mountAiAssistTabs(e,t,n={}){if(!e||chatsBaseFor(location.hash)!==`#${AI_ASSIST_BASE}`)return null;const o=e.querySelector(".dm-plugin-body")||e;o.querySelector(":scope > .ai-assist-tabs")?.remove();const a=document.createElement("nav");a.className="ai-assist-tabs",a.setAttribute("aria-label","AI Assist");for(const s of aiAssistTabs(t,n)){const r=document.createElement("a");r.className=`ai-assist-tab${s.active?" is-active":""}`,r.href=s.href,s.active&&r.setAttribute("aria-current","page");const c=document.createElement("span");c.dataset.icon=s.icon,c.dataset.iconSize="14",c.setAttribute("aria-hidden","true"),r.append(c,document.createTextNode(` ${s.label}`)),a.append(r)}return o.prepend(a),globalThis.I?.scan?.(a),a}
1
+ export const AI_ASSIST_BASE="/ai-assist",LAUNCHER_BASE="/launchers",AI_ASSIST_TABS=Object.freeze([{key:"chats",label:"Chats",icon:"message-circle",chats:!0},{key:"knowledge",label:"Knowledge",icon:"book-open",chats:!0},{key:"builders",label:"Builders",icon:"sparkles",builders:!0},{key:"settings",label:"Settings",icon:"settings",chats:!1}]);let u=null;export function rememberAiAssistState(s){u=s&&typeof s=="object"?s:null}export const aiAssistState=()=>u;export function aiAssistReroute(s,n){if(!n||typeof s!="string")return null;const[i,t]=s.split("?"),e=t?`?${t}`:"",r=n.chats!==!1,c=i.match(/^\/(launchers|ai-assist)(?:\/(chats|knowledge|settings|builders))?(\/[^/]+)?\/?$/);if(!c)return null;const[,l,a,o=""]=c;return l==="launchers"?!a||a==="settings"||a==="builders"?null:n.on?`${AI_ASSIST_BASE}/${a}${o}${e}`:null:n.on?a?a==="builders"?Array.isArray(n.builders)&&n.builders.length?null:`${AI_ASSIST_BASE}/${r?"chats":"settings"}`:!r&&a!=="settings"?`${AI_ASSIST_BASE}/settings`:null:`${AI_ASSIST_BASE}/${r?"chats":"settings"}`:r&&(a==="chats"||a==="knowledge")?`${LAUNCHER_BASE}/${a}${o}${e}`:r?`${LAUNCHER_BASE}/chats`:"/"}export function launcherChatsFor(s){const n=String(s||"").match(/^\/ai-assist\/(chats|knowledge)(\/[^/?]+)?\/?(\?.*)?$/);return n?`${LAUNCHER_BASE}/${n[1]}${n[2]||""}${n[3]||""}`:null}export function builderChatRows(s,n){const i=Array.isArray(s?.items)?s.items:Array.isArray(s?.conversations)?s.conversations:Array.isArray(s?.builds)?s.builds:[],t=(e,r=120)=>typeof e=="string"?e.trim().slice(0,r):"";return i.map(e=>{const r=t(e?.id,100)||t(e?.plugin,100);return r?{id:r,title:t(e.title)||t(e.displayName)||t(e.plugin)||"Untitled",when:t(e.updatedAt,40)||t(e.createdAt,40),who:t(e.startedBy,80)||t(e.by,80)||t(e.userName,80),status:t(e.status,40),href:`${n.url}?open=${encodeURIComponent(r)}`}:null}).filter(Boolean).sort((e,r)=>r.when.localeCompare(e.when))}export function chatsBaseFor(s){return/^#\/ai-assist\b/.test(String(s||""))?`#${AI_ASSIST_BASE}`:`#${LAUNCHER_BASE}`}export function aiAssistTabs(s,{chats:n=!0,builders:i=!1}={}){return AI_ASSIST_TABS.filter(t=>(n||!t.chats)&&(i||!t.builders)).map(t=>({...t,href:`#${AI_ASSIST_BASE}/${t.key}`,active:t.key===s}))}export function mountAiAssistTabs(s,n,i={}){if(!s||chatsBaseFor(location.hash)!==`#${AI_ASSIST_BASE}`)return null;const t=s.querySelector(".dm-plugin-body")||s;t.querySelector(":scope > .ai-assist-tabs")?.remove();const e=document.createElement("nav");e.className="ai-assist-tabs",e.setAttribute("aria-label","AI Assist");const r=aiAssistState(),c={chats:r?.chats!==!1,builders:!!r?.builders?.length,...i};for(const l of aiAssistTabs(n,c)){const a=document.createElement("a");a.className=`ai-assist-tab${l.active?" is-active":""}`,a.href=l.href,l.active&&a.setAttribute("aria-current","page");const o=document.createElement("span");o.dataset.icon=l.icon,o.dataset.iconSize="14",o.setAttribute("aria-hidden","true"),a.append(o,document.createTextNode(` ${l.label}`)),e.append(a)}return t.prepend(e),globalThis.I?.scan?.(e),e}
@@ -0,0 +1,29 @@
1
+ <!-- AI Assist › Builders. Bound with M.applyBindings - see admin/js/views/ai-assist-builders.js,
2
+ which also inserts the row template (the router renders a templateUrl through _.render, eating any {{…}}). -->
3
+ <div class="aib">
4
+ <div class="aib-note dm-loading-slot" data-bind-hidden="!loading.value">Loading…</div>
5
+ <p class="aib-intro" hidden data-bind-hidden="loading.value">
6
+ The AI chats in your builders. Click one to carry on with it in its builder.
7
+ <span data-help-title="Builders"
8
+ data-help="Each builder keeps its own chats - the Site Builder its conversations, the Tool Builder one chat per Tool. You see the ones you could open in that builder yourself. Right-click a chat (or its ⋮) to open it, or open the builder to start a new one."></span>
9
+ </p>
10
+ <p class="aib-note" hidden data-bind-hidden="loading.value || groups.value.length">No builders on this site.</p>
11
+ <div class="aib-groups" hidden data-bind-hidden="loading.value"></div>
12
+ </div>
13
+ <style>
14
+ .aib { display: grid; gap: 1rem; max-width: 1000px; }
15
+ .aib [hidden] { display: none !important; }
16
+ .aib-note, .aib-intro { margin: 0; color: var(--dm-text-muted); font-size: var(--dm-text-sm); }
17
+ .aib-groups { display: grid; gap: 1rem; }
18
+ .aib-group { padding: 1rem 1.25rem; display: grid; gap: .5rem; }
19
+ .aib-head { display: flex; align-items: center; gap: .5rem; }
20
+ .aib-head h3 { margin: 0; font-size: 1rem; flex: 1; }
21
+ .aib-list { display: grid; gap: .25rem; }
22
+ .aib-row { display: grid; grid-template-columns: 1fr auto auto; gap: .75rem; align-items: center; padding: .5rem .6rem;
23
+ border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); cursor: pointer; }
24
+ .aib-row:hover, .aib-row:focus-visible { border-color: var(--dm-primary); outline: none; }
25
+ .aib-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
26
+ .aib-meta { color: var(--dm-text-muted); font-size: var(--dm-text-sm); }
27
+ .aib-kebab { background: none; border: 0; color: var(--dm-text-muted); cursor: pointer; padding: 0 .25rem; }
28
+ .aib-chip { font-size: .75rem; padding: .05rem .5rem; border-radius: 9999px; border: 1px solid var(--dm-border); color: var(--dm-text-muted); }
29
+ </style>
@@ -69,10 +69,13 @@
69
69
  about something else, such as a help chat in the admin.</p>
70
70
 
71
71
  <h3>Answering visitors: Chats</h3>
72
- <p>On a site with <strong>AI Assist</strong> (Pro), every chat is answered in <strong>AI Assist</strong> (Tools &gt;
73
- Communication): its <strong>Chats</strong>, <strong>Knowledge</strong> and <strong>Settings</strong> tabs. Launchers stay
72
+ <p>On a site with <strong>AI Assist</strong> (Pro), every chat is answered in <strong>AI Assist</strong> (in Data): its <strong>Chats</strong>, <strong>Knowledge</strong>, <strong>Builders</strong> and
73
+ <strong>Settings</strong> tabs. Launchers stay
74
74
  launchers - a chat launcher only hands its chats over. Without AI Assist the same inbox is <strong>Content &gt;
75
75
  Chats</strong>, and old links to either lead to whichever the site has.</p>
76
+ <p>AI Assist's <strong>Builders</strong> tab lists the AI chats of the site's builders - the Site Builder's
77
+ conversations and the Tool Builder's builds - newest first, with who started each. Click one to carry on in its
78
+ builder. You see only the builders, and the chats, you could open in the builder yourself.</p>
76
79
  <p>The inbox Its sidebar badge counts the chats that need you: a visitor
77
80
  <strong>Waiting</strong> for a person (a live dot; red after five minutes), a <strong>Message left</strong> when
78
81
  nobody was available, and chats with new messages since your reply. Waiting chats are listed first, the longest
@@ -0,0 +1 @@
1
+ import{apiRequest as L}from"../api.js";import{helpPopovers as B}from"../lib/help-popover.js";import{SHAPES as j,whileLoading as D}from"../lib/loading.js";import{openMenuAt as $,viewLifetime as N}from"../lib/tool-kit.js";import{fmtDateTime as P}from"../lib/dates.js";import{builderChatRows as R,mountAiAssistTabs as T,rememberAiAssistState as K}from"../lib/ai-assist.js";const U=/^#\/ai-assist\/builders\b/,d=N(U);async function z(s){try{const n=await L(s.list.replace(/^\/api(?=\/)/,""));return{builder:s,rows:R(n,s),error:""}}catch(n){const i=String(n?.message||"");return{builder:s,rows:[],error:/403|permission|not allowed/i.test(i)?"Not available to you.":"Could not load its chats just now."}}}function o(s,n,i){const l=document.createElement(s);return n&&(l.className=n),i!==void 0&&(l.textContent=i),l}export const aiAssistBuildersView={templateUrl:"/admin/js/templates/ai-assist-builders.html",async onMount(s){d.reset();const n=s.get(0),i=n.querySelector(".aib")||n;let l=!1;d.add(()=>{l=!0});const x=()=>!l&&i.isConnected,w=M.observable(!0),y=M.observable([]),O=M.applyBindings({loading:w,groups:y},i);d.add(()=>O.dispose()),d.add(B(i,{position:"bottom"}));let u=[];try{u=await D(i.querySelector(".dm-loading-slot"),(async()=>{const e=await L("/ai-assist");return K(e),Promise.all((e?.builders||[]).map(z))})(),j.rows)}catch{u=[]}if(!x())return;T(n,"builders");const r=i.querySelector(".aib-groups");r.replaceChildren();const p=new Map;for(const e of u){const t=o("section","card aib-group"),c=o("div","aib-head"),f=o("span");f.dataset.icon="sparkles",f.dataset.iconSize="16";const v=o("a","btn btn-sm btn-outline",`Open ${e.builder.label}`);v.href=e.builder.url,c.append(f,o("h3","",e.builder.label),v),t.append(c),e.error?t.append(o("p","aib-note",e.error)):e.rows.length||t.append(o("p","aib-note","No chats yet. Open the builder to start one."));const A=o("div","aib-list");for(const a of e.rows){const S=`${e.builder.plugin}:${a.id}`;p.set(S,{row:a,builder:e.builder});const b=o("div","aib-row");b.tabIndex=0,b.dataset.key=S,b.setAttribute("role","link");const C=o("div");C.append(o("div","aib-title",a.title),o("div","aib-meta",[a.when?P(a.when):"",a.who].filter(Boolean).join(" \xB7 ")));const h=o("button","aib-kebab","\u22EE");h.type="button",h.setAttribute("aria-label",`Actions for ${a.title}`),b.append(C,a.status?o("span","aib-chip",a.status):o("span"),h),A.append(b)}t.append(A),r.append(t)}y.value=u,w.value=!1;const m=e=>{const t=p.get(e);t&&(location.hash=t.row.href)},g=e=>{const t=e.target.closest(".aib-kebab");if(t){$(t);return}const c=e.target.closest(".aib-row");c&&m(c.dataset.key)},k=e=>{const t=e.target.closest(".aib-row");t&&(e.key==="Enter"&&(e.preventDefault(),m(t.dataset.key)),e.key==="F10"&&e.shiftKey&&(e.preventDefault(),$(t)))};r.addEventListener("click",g),r.addEventListener("keydown",k),d.add(()=>{r.removeEventListener("click",g),r.removeEventListener("keydown",k)});const q=E.contextMenu?.(r,{cursor:"glyph",match:".aib-row",inherit:!1,density:"compact",items:e=>{const t=p.get(e?.dataset?.key);return t?[{header:t.row.title},{label:`Open in ${t.builder.label}`,icon:"external-link",action:()=>m(e.dataset.key)},{label:`Open ${t.builder.label}`,icon:"sparkles",action:()=>{location.hash=t.builder.url}}]:[]}});d.add(()=>q?.destroy?.()),I.scan(i)}};
@@ -1 +1 @@
1
- import{apiRequest as l}from"../api.js";import{addBannerAction as z}from"../lib/plugin-chrome.js";import{helpPopovers as G}from"../lib/help-popover.js";import{SHAPES as Q,whileLoading as X}from"../lib/loading.js";import{mountAiAssistTabs as x}from"../lib/ai-assist.js";import{characterOptions as Z,checkForm as P,formFromSettings as T,LIMITS as K,payloadFromForm as N,snapshot as k}from"../lib/ai-assist-settings-arrange.js";import{CHARACTERS as _}from"../../../public/js/characters.mjs";const C=/^\/ai-assist\/settings(\?.*)?$/;let n=null,U=!1;function ee(){U||!window.R?.use||(U=!0,R.use((r,i,o)=>!(C.test(i?.path||"")&&!C.test(r?.path||""))||!n?.dirty()?o():E.confirm("You have unsaved AI Assist settings. Leave anyway?").then(c=>{c?o():history.replaceState(null,"","#/ai-assist/settings")})),M.subscribe("router:afterChange",({to:r}={})=>{if(n&&!C.test(r?.path||"")){const i=n;n=null,i.dispose()}}))}export const aiAssistSettingsView={templateUrl:"/admin/js/templates/ai-assist-settings.html",async onMount(r){if(ee(),n){const e=n;n=null,e.dispose()}const i=[],o=e=>(i.push(e),e);let p=!1;const c=r.get(0),a=c.querySelector(".aia")||c,m=()=>!p&&a.isConnected;x(c,"settings",{chats:!0});const O=M.observable(!0);let u={},f=[],v={chats:!0};try{[u,f,v]=await X(a.querySelector(".dm-loading-slot"),Promise.all([l("/settings"),l("/auth/permissions").then(e=>e.permissions||[]).catch(()=>[]),l("/ai-assist").catch(()=>({chats:!0}))]),Q.rows)}catch(e){if(!m())return;a.querySelector(".dm-loading-slot").textContent=`Could not load the settings: ${e.message||e}`;return}if(!m())return;const h=f.includes("settings")||f.includes("settings.update");v?.chats===!1&&x(c,"settings",{chats:!1});const g=M.observable(T(u)),A=g.peek(),s=Object.fromEntries(Object.entries(A).map(([e,t])=>[e,M.observable(t)])),y=()=>Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.peek()])),j=()=>Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.value])),L=M.observable(k(A)),d=M.observable(!1),b=M.computed(()=>k(j())!==L.value),B=M.computed(()=>P(j())),D=M.computed(()=>`${s.aiContext.value.length} / ${K.context}`),H=M.computed(()=>`${s.aiRules.value.length} / ${K.rules}`),F=a.querySelector("#aia-admin-character");for(const e of Z(_))F.append(new Option(e.label,e.value));F.value=s.adminCharacter.peek();async function w(){if(d.peek()||!h)return;const e=P(y());if(e){E.toast(e,{type:"error"});return}d.value=!0;try{await l("/settings",{method:"PUT",body:JSON.stringify(N(y()))});const t=await l("/settings").catch(()=>({...u,...N(y())}));if(!m())return;u=t;const S=T(t);for(const[W,Y]of Object.entries(S))s[W].value=Y;g.value=S,L.value=k(S),window.dispatchEvent(new Event("admin-assistant:settings")),E.toast("AI Assist settings saved",{type:"success"})}catch(t){E.toast(`Not saved: ${t.message||t}`,{type:"error"})}finally{d.value=!1}}function V(){for(const[e,t]of Object.entries(g.peek()))s[e].value=t}O.value=!1;const J=M.applyBindings({...s,loading:O,dirty:b,saving:d,problem:B,contextCount:D,rulesCount:H,canEdit:h,chatsOn:v?.chats!==!1},a,{methods:{save:()=>w(),discard:()=>V()}});o(()=>J.dispose()),o(G(a,{position:"bottom"})),h&&z(r,{id:"ai-assist-save",icon:"save",title:"Save (Ctrl+S)",onClick:()=>w()});const $=e=>{!(e.ctrlKey||e.metaKey)||e.key!=="s"||(e.preventDefault(),e.stopImmediatePropagation(),w())};document.addEventListener("keydown",$,!0),o(()=>document.removeEventListener("keydown",$,!0));const q=e=>{b.peek()&&(e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",q),o(()=>window.removeEventListener("beforeunload",q)),n={dirty:()=>b.peek(),dispose(){p=!0,i.splice(0).reverse().forEach(e=>{try{e()}catch{}})}},I.scan(a)}};
1
+ import{apiRequest as l}from"../api.js";import{addBannerAction as z}from"../lib/plugin-chrome.js";import{helpPopovers as G}from"../lib/help-popover.js";import{SHAPES as Q,whileLoading as X}from"../lib/loading.js";import{mountAiAssistTabs as x}from"../lib/ai-assist.js";import{characterOptions as Z,checkForm as P,formFromSettings as T,LIMITS as K,payloadFromForm as N,snapshot as k}from"../lib/ai-assist-settings-arrange.js";import{CHARACTERS as _}from"../../../public/js/characters.mjs";const C=/^\/ai-assist\/settings(\?.*)?$/;let n=null,U=!1;function ee(){U||!window.R?.use||(U=!0,R.use((r,i,o)=>!(C.test(i?.path||"")&&!C.test(r?.path||""))||!n?.dirty()?o():E.confirm("You have unsaved AI Assist settings. Leave anyway?").then(c=>{c?o():history.replaceState(null,"","#/ai-assist/settings")})),M.subscribe("router:afterChange",({to:r}={})=>{if(n&&!C.test(r?.path||"")){const i=n;n=null,i.dispose()}}))}export const aiAssistSettingsView={templateUrl:"/admin/js/templates/ai-assist-settings.html",async onMount(r){if(ee(),n){const e=n;n=null,e.dispose()}const i=[],o=e=>(i.push(e),e);let p=!1;const c=r.get(0),a=c.querySelector(".aia")||c,m=()=>!p&&a.isConnected;x(c,"settings");const O=M.observable(!0);let u={},f=[],v={chats:!0};try{[u,f,v]=await X(a.querySelector(".dm-loading-slot"),Promise.all([l("/settings"),l("/auth/permissions").then(e=>e.permissions||[]).catch(()=>[]),l("/ai-assist").catch(()=>({chats:!0}))]),Q.rows)}catch(e){if(!m())return;a.querySelector(".dm-loading-slot").textContent=`Could not load the settings: ${e.message||e}`;return}if(!m())return;const h=f.includes("settings")||f.includes("settings.update");v?.chats===!1&&x(c,"settings",{chats:!1});const g=M.observable(T(u)),A=g.peek(),s=Object.fromEntries(Object.entries(A).map(([e,t])=>[e,M.observable(t)])),y=()=>Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.peek()])),j=()=>Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.value])),L=M.observable(k(A)),d=M.observable(!1),b=M.computed(()=>k(j())!==L.value),B=M.computed(()=>P(j())),D=M.computed(()=>`${s.aiContext.value.length} / ${K.context}`),H=M.computed(()=>`${s.aiRules.value.length} / ${K.rules}`),F=a.querySelector("#aia-admin-character");for(const e of Z(_))F.append(new Option(e.label,e.value));F.value=s.adminCharacter.peek();async function w(){if(d.peek()||!h)return;const e=P(y());if(e){E.toast(e,{type:"error"});return}d.value=!0;try{await l("/settings",{method:"PUT",body:JSON.stringify(N(y()))});const t=await l("/settings").catch(()=>({...u,...N(y())}));if(!m())return;u=t;const S=T(t);for(const[W,Y]of Object.entries(S))s[W].value=Y;g.value=S,L.value=k(S),window.dispatchEvent(new Event("admin-assistant:settings")),E.toast("AI Assist settings saved",{type:"success"})}catch(t){E.toast(`Not saved: ${t.message||t}`,{type:"error"})}finally{d.value=!1}}function V(){for(const[e,t]of Object.entries(g.peek()))s[e].value=t}O.value=!1;const J=M.applyBindings({...s,loading:O,dirty:b,saving:d,problem:B,contextCount:D,rulesCount:H,canEdit:h,chatsOn:v?.chats!==!1},a,{methods:{save:()=>w(),discard:()=>V()}});o(()=>J.dispose()),o(G(a,{position:"bottom"})),h&&z(r,{id:"ai-assist-save",icon:"save",title:"Save (Ctrl+S)",onClick:()=>w()});const $=e=>{!(e.ctrlKey||e.metaKey)||e.key!=="s"||(e.preventDefault(),e.stopImmediatePropagation(),w())};document.addEventListener("keydown",$,!0),o(()=>document.removeEventListener("keydown",$,!0));const q=e=>{b.peek()&&(e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",q),o(()=>window.removeEventListener("beforeunload",q)),n={dirty:()=>b.peek(),dispose(){p=!0,i.splice(0).reverse().forEach(e=>{try{e()}catch{}})}},I.scan(a)}};
@@ -1 +1 @@
1
- const i={templateUrl:"",async onMount(){location.hash="#/menus"}};export const viewLoaders={projects:()=>import("./projects.js").then(e=>e.projectsView),projectDetail:()=>import("./project-detail.js").then(e=>e.projectDetailView),projectSettings:()=>import("./project-settings.js").then(e=>e.projectSettingsView),apiTokens:()=>import("./api-tokens.js").then(e=>e.apiTokensView),apiEndpoints:()=>import("./api-endpoints.js").then(e=>e.apiEndpointsView),apiEndpointEditor:()=>import("./api-endpoint-editor.js").then(e=>e.apiEndpointEditorView),dashboard:()=>import("./dashboard.js").then(e=>e.dashboardView),dashboards:()=>import("./dashboards.js").then(e=>e.dashboardsView),pages:()=>import("./pages.js").then(e=>e.pagesView),pageEditor:()=>import("./page-editor.js").then(e=>e.pageEditorView),appearance:()=>import("./appearance.js").then(e=>e.appearanceView),footer:()=>import("./footer.js").then(e=>e.footerView),settings:()=>import("./settings.js").then(e=>e.settingsView),theme:()=>import("./theme.js").then(e=>e.themeView),layouts:()=>import("./layouts.js").then(e=>e.layoutsView),media:()=>import("./media.js").then(e=>e.mediaView),login:()=>import("./login.js").then(e=>e.loginView),users:()=>import("./users.js").then(e=>e.usersView),userEditor:()=>import("./user-editor.js").then(e=>e.userEditorView),plugins:()=>import("./plugins.js").then(e=>e.pluginsView),pluginCode:()=>import("./plugin-code.js").then(e=>e.pluginCodeView),documentation:()=>import("./documentation.js").then(e=>e.documentationView),tutorials:()=>import("./tutorials.js").then(e=>e.tutorialsView),apiReference:()=>import("./api-reference.js").then(e=>e.apiReferenceView),collections:()=>import("./collections.js").then(e=>e.collectionsView),collectionEditor:()=>import("./collection-editor.js").then(e=>e.collectionEditorView),collectionEntries:()=>import("./collection-entries.js").then(e=>e.collectionEntriesView),forms:()=>import("./forms.js").then(e=>e.formsView),formEditor:()=>import("./form-editor.js").then(e=>e.formEditorView),formSubmissions:()=>import("./form-submissions.js").then(e=>e.formSubmissionsView),viewsList:()=>import("./views-list.js").then(e=>e.viewsListView),viewEditor:()=>import("./view-editor.js").then(e=>e.viewEditorView),viewPreview:()=>import("./view-preview.js").then(e=>e.viewPreviewView),actionsList:()=>import("./actions-list.js").then(e=>e.actionsListView),actionEditor:()=>import("./action-editor.js").then(e=>e.actionEditorView),proDocs:()=>import("./pro-docs.js").then(e=>e.proDocsView),blocks:()=>import("./blocks.js").then(e=>e.blocksView),components:()=>import("./components.js").then(e=>e.componentsView),myProfile:()=>import("./my-profile.js").then(e=>e.myProfileView),roles:()=>import("./roles.js").then(e=>e.rolesView),roleEditor:()=>import("./role-editor.js").then(e=>e.roleEditorView),effects:()=>import("./effects.js").then(e=>e.effectsView),search:()=>import("./search.js").then(e=>e.searchView),contentApi:()=>import("./content-api.js").then(e=>e.contentApiView),notes:()=>import("./notes.js").then(e=>e.notesView),chats:()=>import("./chats.js").then(e=>e.chatsView),chatKnowledge:()=>import("./chat-knowledge.js").then(e=>e.chatKnowledgeView),aiAssistChats:()=>import("./chats.js").then(e=>e.chatsView),aiAssistKnowledge:()=>import("./chat-knowledge.js").then(e=>e.chatKnowledgeView),aiAssistSettings:()=>import("./ai-assist-settings.js").then(e=>e.aiAssistSettingsView),todo:()=>import("./todo.js").then(e=>e.todoView),calculator:()=>import("../lib/calculator.js").then(e=>e.calculatorView),analytics:()=>import("./analytics.js").then(e=>e.analyticsView),seo:()=>import("./seo.js").then(e=>e.seoView),wordpressImport:()=>import("./wordpress-import.js").then(e=>e.wordpressImportView),contacts:()=>import("./contacts.js").then(e=>e.contactsView),callNew:()=>import("./call-new.js").then(e=>e.callNewView),notifications:()=>import("./notifications.js").then(e=>e.notificationsView),menus:()=>import("./menus.js").then(e=>e.menusView),contextMenus:()=>import("./context-menus.js").then(e=>e.contextMenusView),launchers:()=>import("./launchers.js").then(e=>e.launchersView),contextMenuEditor:()=>import("./context-menu-editor.js").then(e=>e.contextMenuEditorView),menuEditor:()=>import("./menu-editor.js").then(e=>e.menuEditorView),menuLocations:()=>import("./menu-locations.js").then(e=>e.menuLocationsView),menusRedirect:async()=>i,pluginGuides:()=>import("./plugin-guides.js").then(e=>e.pluginGuidesView),pluginGuide:()=>import("./plugin-guides.js").then(e=>e.pluginGuideView)};for(const e of["tutorialCrud","tutorialPlugin","tutorialEditor","tutorialForms","componentsReference","componentsHowto","componentsWalkthrough","componentsRules","usagePages","usageMedia","usageNavigation","usageDconfig","usageShortcodes","usageSiteSettings","usagePlugins","usageUsersRoles","usageViews","usageActions","usageCtaShortcode","usageEditions","usageCollections","usageBlocks","usageTools","usageDashboard","usageSearchEngines","usageLaunchers","usageChat","apiRefAuthentication","apiRefPages","apiRefSettings","apiRefLayouts","apiRefNavigation","apiRefMedia","apiRefUsers","apiRefPlugins","apiRefCollections","apiRefViews","apiRefActions","apiRefForms","apiRefScaffold","apiRefExternal","apiRefContent","apiRefBuilder"])viewLoaders[e]=()=>import("./doc-pages.js").then(t=>t.docViews[e]);
1
+ const i={templateUrl:"",async onMount(){location.hash="#/menus"}};export const viewLoaders={projects:()=>import("./projects.js").then(e=>e.projectsView),projectDetail:()=>import("./project-detail.js").then(e=>e.projectDetailView),projectSettings:()=>import("./project-settings.js").then(e=>e.projectSettingsView),apiTokens:()=>import("./api-tokens.js").then(e=>e.apiTokensView),apiEndpoints:()=>import("./api-endpoints.js").then(e=>e.apiEndpointsView),apiEndpointEditor:()=>import("./api-endpoint-editor.js").then(e=>e.apiEndpointEditorView),dashboard:()=>import("./dashboard.js").then(e=>e.dashboardView),dashboards:()=>import("./dashboards.js").then(e=>e.dashboardsView),pages:()=>import("./pages.js").then(e=>e.pagesView),pageEditor:()=>import("./page-editor.js").then(e=>e.pageEditorView),appearance:()=>import("./appearance.js").then(e=>e.appearanceView),footer:()=>import("./footer.js").then(e=>e.footerView),settings:()=>import("./settings.js").then(e=>e.settingsView),theme:()=>import("./theme.js").then(e=>e.themeView),layouts:()=>import("./layouts.js").then(e=>e.layoutsView),media:()=>import("./media.js").then(e=>e.mediaView),login:()=>import("./login.js").then(e=>e.loginView),users:()=>import("./users.js").then(e=>e.usersView),userEditor:()=>import("./user-editor.js").then(e=>e.userEditorView),plugins:()=>import("./plugins.js").then(e=>e.pluginsView),pluginCode:()=>import("./plugin-code.js").then(e=>e.pluginCodeView),documentation:()=>import("./documentation.js").then(e=>e.documentationView),tutorials:()=>import("./tutorials.js").then(e=>e.tutorialsView),apiReference:()=>import("./api-reference.js").then(e=>e.apiReferenceView),collections:()=>import("./collections.js").then(e=>e.collectionsView),collectionEditor:()=>import("./collection-editor.js").then(e=>e.collectionEditorView),collectionEntries:()=>import("./collection-entries.js").then(e=>e.collectionEntriesView),forms:()=>import("./forms.js").then(e=>e.formsView),formEditor:()=>import("./form-editor.js").then(e=>e.formEditorView),formSubmissions:()=>import("./form-submissions.js").then(e=>e.formSubmissionsView),viewsList:()=>import("./views-list.js").then(e=>e.viewsListView),viewEditor:()=>import("./view-editor.js").then(e=>e.viewEditorView),viewPreview:()=>import("./view-preview.js").then(e=>e.viewPreviewView),actionsList:()=>import("./actions-list.js").then(e=>e.actionsListView),actionEditor:()=>import("./action-editor.js").then(e=>e.actionEditorView),proDocs:()=>import("./pro-docs.js").then(e=>e.proDocsView),blocks:()=>import("./blocks.js").then(e=>e.blocksView),components:()=>import("./components.js").then(e=>e.componentsView),myProfile:()=>import("./my-profile.js").then(e=>e.myProfileView),roles:()=>import("./roles.js").then(e=>e.rolesView),roleEditor:()=>import("./role-editor.js").then(e=>e.roleEditorView),effects:()=>import("./effects.js").then(e=>e.effectsView),search:()=>import("./search.js").then(e=>e.searchView),contentApi:()=>import("./content-api.js").then(e=>e.contentApiView),notes:()=>import("./notes.js").then(e=>e.notesView),chats:()=>import("./chats.js").then(e=>e.chatsView),chatKnowledge:()=>import("./chat-knowledge.js").then(e=>e.chatKnowledgeView),aiAssistChats:()=>import("./chats.js").then(e=>e.chatsView),aiAssistKnowledge:()=>import("./chat-knowledge.js").then(e=>e.chatKnowledgeView),aiAssistSettings:()=>import("./ai-assist-settings.js").then(e=>e.aiAssistSettingsView),aiAssistBuilders:()=>import("./ai-assist-builders.js").then(e=>e.aiAssistBuildersView),todo:()=>import("./todo.js").then(e=>e.todoView),calculator:()=>import("../lib/calculator.js").then(e=>e.calculatorView),analytics:()=>import("./analytics.js").then(e=>e.analyticsView),seo:()=>import("./seo.js").then(e=>e.seoView),wordpressImport:()=>import("./wordpress-import.js").then(e=>e.wordpressImportView),contacts:()=>import("./contacts.js").then(e=>e.contactsView),callNew:()=>import("./call-new.js").then(e=>e.callNewView),notifications:()=>import("./notifications.js").then(e=>e.notificationsView),menus:()=>import("./menus.js").then(e=>e.menusView),contextMenus:()=>import("./context-menus.js").then(e=>e.contextMenusView),launchers:()=>import("./launchers.js").then(e=>e.launchersView),contextMenuEditor:()=>import("./context-menu-editor.js").then(e=>e.contextMenuEditorView),menuEditor:()=>import("./menu-editor.js").then(e=>e.menuEditorView),menuLocations:()=>import("./menu-locations.js").then(e=>e.menuLocationsView),menusRedirect:async()=>i,pluginGuides:()=>import("./plugin-guides.js").then(e=>e.pluginGuidesView),pluginGuide:()=>import("./plugin-guides.js").then(e=>e.pluginGuideView)};for(const e of["tutorialCrud","tutorialPlugin","tutorialEditor","tutorialForms","componentsReference","componentsHowto","componentsWalkthrough","componentsRules","usagePages","usageMedia","usageNavigation","usageDconfig","usageShortcodes","usageSiteSettings","usagePlugins","usageUsersRoles","usageViews","usageActions","usageCtaShortcode","usageEditions","usageCollections","usageBlocks","usageTools","usageDashboard","usageSearchEngines","usageLaunchers","usageChat","apiRefAuthentication","apiRefPages","apiRefSettings","apiRefLayouts","apiRefNavigation","apiRefMedia","apiRefUsers","apiRefPlugins","apiRefCollections","apiRefViews","apiRefActions","apiRefForms","apiRefScaffold","apiRefExternal","apiRefContent","apiRefBuilder"])viewLoaders[e]=()=>import("./doc-pages.js").then(t=>t.docViews[e]);
@@ -1 +1 @@
1
- import{api as l,isAuthenticated as A,setAuthData as f,takePendingLogout as D}from"../api.js";import{themesInDisplayOrder as O}from"../lib/themes.js";import{enhancePasswordFields as b}from"../lib/password-field.js";import{challengeText as g,loginBrandFromStatus as S,minutesText as j,passwordVerdict as z,readLoginHash as H,resetTokenFrom as N}from"../lib/login-arrange.js";import{viewLifetime as V}from"../lib/tool-kit.js";import{applyAdminBrand as W}from"../lib/admin-brand.js";import{isDarkAdminTheme as Y}from"../lib/theme-aware-logo.js";const K={name:{type:"string",required:!0,minLength:2,label:"Full Name",formConfig:{placeholder:"Your name",autocomplete:"name"}},email:{type:"email",required:!0,label:"Email Address",formConfig:{placeholder:"admin@example.com",autocomplete:"email"}},password:{type:"password",required:!0,minLength:8,label:"Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"new-password",tooltip:"Minimum 8 characters"}}},U={email:{type:"email",required:!0,label:"Email Address",formConfig:{placeholder:"you@example.com",autocomplete:"email"}},password:{type:"password",required:!0,label:"Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"current-password"}}},G={email:{type:"email",required:!0,label:"Email Address",formConfig:{placeholder:"you@example.com",autocomplete:"email"}}},J={password:{type:"password",required:!0,minLength:8,label:"New Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"new-password"}},confirmPassword:{type:"password",required:!0,label:"Confirm Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"new-password"}}};let T=Promise.resolve();function Q(){let e;T=new Promise(o=>{e=o});const t=M.subscribe("router:afterChange",()=>{a(),e()}),a=()=>{typeof t=="function"&&t()};setTimeout(()=>{a(),e()},1500)}function y(e){T.then(()=>R.navigate(e))}const m=V(/^#\/(login|reset-password)(\?|$)/);function X(){const e=M.observable(null),t=M.observable("code"),a=M.observable(S()),o=M.observable("");return{step:M.observable(""),siteTitle:M.observable("Domma CMS"),brand:a,brandTheme:o,brandLogo:M.computed(()=>{o.value;const r=a.value;return Y()?r.logoDark||r.logo:r.logo||r.logoDark}),notice:M.observable(""),byEmail:M.observable(!0),expiresIn:M.observable(""),obTitle:M.observable(""),obTagline:M.observable(""),obSiteError:M.observable(""),obSiteSaving:M.observable(!1),themes:O(),theme:M.observable("charcoal-dark"),obThemeError:M.observable(""),obThemeSaving:M.observable(!1),chChallenge:e,chMode:t,chTitle:M.computed(()=>e.value?.title||"One more step"),chLabel:M.computed(()=>g(e.value,t.value).label),chHelp:M.computed(()=>g(e.value,t.value).help),chInputMode:M.computed(()=>g(e.value,t.value).inputMode),chImage:M.computed(()=>e.value?.image||""),chSecret:M.computed(()=>e.value?.secret||""),chCanTrust:M.computed(()=>e.value?.trust===!0),chCanRecover:M.computed(()=>e.value?.recovery===!0),chCode:M.observable(""),chTrust:M.observable(!1),chError:M.observable(""),chBusy:M.observable(!1),resetEmail:M.observable(""),resetExpiry:M.observable(""),resetLines:M.observable([])}}function w(e,t={}){e.byEmail.value=t.resetByEmail!==!1,e.expiresIn.value=t.resetExpiresIn||"";const a=S(t);e.brand.value=a,e.siteTitle.value=a.title,W(a)}export const loginView={templateUrl:"/admin/js/templates/login.html",async onMount(e){m.reset(),Q();const t=D(),a=window.location.hash,{next:o,expired:r}=H(a);if(A()){y(a.startsWith("#/reset-password")?"/":o);return}const n=e.get(0).querySelector(".login-wrap")||e.get(0),u=X(),c={state:u,root:n,next:o,token:"",email:"",pw:{problems:[],asked:0,timer:null}},p=M.applyBindings(u,n,{methods:Z(c)});if(m.add(()=>p.dispose()),m.add(()=>clearTimeout(c.pw.timer)),m.add(M.effect(()=>{u.step.value;const s=u.brand.value;requestAnimationFrame(()=>{if(!n.isConnected)return;const d=n.querySelector(".login-brand-icon"),i=I.render(s.icon,{size:32})||I.render("layout",{size:32});d&&i&&d.replaceChildren(i),I.scan(n)})})),m.add(Domma.theme.onChange(()=>{u.brandTheme.value=Domma.theme.get()})),a.startsWith("#/reset-password")){await ae(c,N(a));return}let h=!1;const v=E.loader(e.get(0),{type:"dots"});try{const s=await l.auth.setupStatus();h=s.needsSetup,w(u,s)}catch{E.toast("Could not reach the server.",{type:"error"})}finally{v.destroy()}h?(u.step.value="setup",_(c)):(u.step.value="login",k(c),r&&!t&&(u.notice.value="Your session ended - sign in again to carry on where you were."))}};function Z(e){const{state:t}=e,a=o=>r=>{r?.preventDefault?.(),o()};return{skipSite:a(()=>{t.step.value="onboarding-theme"}),saveSite:()=>$(t),pickTheme:o=>{t.theme.value=o},skipTheme:a(()=>{t.step.value="onboarding-done"}),saveTheme:()=>ee(t),backToLogin:a(()=>{t.step.value="login"}),forgot:a(()=>{const o=String(e.root.querySelector('#login-form-container input[type="email"]')?.value||"").trim();t.step.value="forgot",q(e,o)}),toggleRecovery:a(()=>C(t,t.chMode.value==="code"?"recovery":"code")),copySecret:async()=>{try{await navigator.clipboard.writeText(String(t.chSecret.value).replace(/\s+/g,"")),E.toast("Key copied.",{type:"success"})}catch{E.toast("Could not copy - select the key and copy it.",{type:"warning"})}},verify:o=>{o?.preventDefault?.(),te(e)},newLink:a(async()=>{try{w(t,await l.auth.setupStatus())}catch{}t.step.value="forgot",q(e)}),signInAfterReset:a(()=>{t.step.value="login",k(e,{email:e.email})})}}function _(e){F.render("#setup-form-container",K,{},{layout:"stacked",submitText:"Create admin account",onSubmit:async t=>{try{const a=await l.auth.setup(t);f(a),e.state.step.value="onboarding-site"}catch(a){return E.toast(a.message||"Setup failed. Please try again.",{type:"error"}),!1}}}),b(e.root.querySelector("#setup-form-container"))}async function $(e){e.obSiteError.value="";const t=e.obTitle.value.trim(),a=e.obTagline.value.trim();e.obSiteSaving.value=!0;try{const o=await l.settings.get();await l.settings.save({...o,title:t||o.title,tagline:a||o.tagline,brand:{...o.brand||{},text:t||o.brand?.text||o.title},seo:{...o.seo||{},defaultTitle:t||o.seo&&o.seo.defaultTitle}}),e.step.value="onboarding-theme"}catch(o){e.obSiteError.value=o.message||"Could not save site details."}finally{e.obSiteSaving.value=!1}}async function ee(e){e.obThemeError.value="",e.obThemeSaving.value=!0;try{await l.theme.save({theme:e.theme.value||"charcoal-dark"}),e.step.value="onboarding-done"}catch(t){e.obThemeError.value=t.message||"Could not save theme."}finally{e.obThemeSaving.value=!1}}function k(e,{email:t=""}={}){F.render("#login-form-container",U,t?{email:t}:{},{layout:"stacked",submitText:"Sign in",onSubmit:async a=>{try{const o=await l.auth.login(a);if(o?.challenge&&o.ticket)return x(e,o),!1;f(o),y(e.next)}catch(o){return E.toast(o.message||"Invalid credentials. Please try again.",{type:"error"}),!1}}}),b(e.root.querySelector("#login-form-container"))}function x(e,{challenge:t,ticket:a}){const{state:o}=e;e.ticket=a,o.chChallenge.value=t||{},o.chTrust.value=!1,C(o,"code"),o.step.value="challenge"}function C(e,t){e.chMode.value=t,e.chCode.value="",e.chError.value="",setTimeout(()=>document.getElementById("challenge-code")?.focus(),0)}async function te(e){const{state:t}=e;t.chBusy.value=!0;try{const a=await l.auth.verifyLogin({ticket:e.ticket,response:String(t.chCode.value||"").trim(),mode:t.chMode.value,trust:t.chTrust.value===!0});if(a?.challenge&&a.ticket){x(e,a);return}f(a),y(e.next)}catch(a){const o=a.message||"That did not match.";t.chError.value=o,/sign in again/i.test(o)&&setTimeout(()=>{t.step.value="login"},1800)}finally{t.chBusy.value=!1}}function q(e,t=""){const{state:a}=e;a.byEmail.value&&F.render("#forgot-form-container",G,t?{email:t}:{},{layout:"stacked",submitText:"Send reset link",onSubmit:async o=>{try{const r=await l.auth.forgotPassword(o.email);r?.expiresIn&&(a.expiresIn.value=r.expiresIn)}catch{}a.step.value="forgot-success"}})}async function ae(e,t){const{state:a}=e;if(!t){a.step.value="reset-invalid";return}const o=E.loader(e.root,{type:"dots"});let r;l.auth.setupStatus().then(n=>w(a,n)).catch(()=>{});try{r=await l.auth.checkReset(t)}catch{a.step.value="reset-invalid";return}finally{o.destroy()}e.token=t,e.email=r.email||"",a.resetEmail.value=e.email,a.resetExpiry.value=j(r.minutesLeft),a.step.value="reset",oe(e)}function oe(e){const{state:t,token:a,email:o,pw:r}=e,n=e.root.querySelector("#reset-form-container"),u=()=>({password:String(n.querySelector('input[name="password"]')?.value||""),confirm:String(n.querySelector('input[name="confirmPassword"]')?.value||"")}),c=()=>{const{password:s,confirm:d}=u(),i=z({password:s,confirm:d,problems:r.problems}),L=[...i.messages,...i.mismatch?["The two passwords do not match yet."]:[]];return t.resetLines.value=s?L.map((P,B)=>({id:B,text:P})):[],i},p=async()=>{const{password:s}=u(),d=++r.asked;if(s.length<8){r.problems=[],c();return}try{const i=await l.auth.checkReset(a,s);d===r.asked&&(r.problems=i.problems||[])}catch(i){if(i.body?.expired){t.step.value="reset-invalid";return}}d===r.asked&&c()};F.render("#reset-form-container",J,{},{layout:"stacked",submitText:"Set new password",onSubmit:async s=>{await p();const d=c();if(!d.ok)return E.toast(d.mismatch?"The passwords do not match.":"That password does not meet the rules below.",{type:"error"}),!1;try{await l.auth.resetPassword(a,s.password),history.replaceState(null,"","#/reset-password"),t.step.value="reset-done"}catch(i){return i.body?.expired?(t.step.value="reset-invalid",!1):(r.problems=i.body?.problems||[],c(),E.toast(i.message||"The password was not changed.",{type:"error"}),!1)}}});const h=n.querySelector("form")||n;if(o){const s=document.createElement("input");s.type="email",s.name="username",s.autocomplete="username",s.value=o,s.readOnly=!0,s.hidden=!0,h.prepend(s)}b(n);const v=s=>{s.target.matches?.('input[type="password"], input[name="password"], input[name="confirmPassword"]')&&(s.target.name==="password"&&(r.problems=[]),c(),clearTimeout(r.timer),s.target.name==="password"&&(r.timer=setTimeout(p,400)))};n.addEventListener("input",v),m.add(()=>n.removeEventListener("input",v))}
1
+ import{api as u,isAuthenticated as D,setAuthData as f,takePendingLogout as O}from"../api.js";import{themesInDisplayOrder as j}from"../lib/themes.js";import{enhancePasswordFields as b}from"../lib/password-field.js";import{challengeText as g,loginBrandFromStatus as S,minutesText as z,passwordVerdict as H,readLoginHash as N,resetTokenFrom as V}from"../lib/login-arrange.js";import{viewLifetime as W}from"../lib/tool-kit.js";import{applyAdminBrand as Y}from"../lib/admin-brand.js";import{isDarkAdminTheme as K}from"../lib/theme-aware-logo.js";import{applyAdminTheme as T}from"../lib/admin-theme.js";const U={name:{type:"string",required:!0,minLength:2,label:"Full Name",formConfig:{placeholder:"Your name",autocomplete:"name"}},email:{type:"email",required:!0,label:"Email Address",formConfig:{placeholder:"admin@example.com",autocomplete:"email"}},password:{type:"password",required:!0,minLength:8,label:"Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"new-password",tooltip:"Minimum 8 characters"}}},G={email:{type:"email",required:!0,label:"Email Address",formConfig:{placeholder:"you@example.com",autocomplete:"email"}},password:{type:"password",required:!0,label:"Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"current-password"}}},J={email:{type:"email",required:!0,label:"Email Address",formConfig:{placeholder:"you@example.com",autocomplete:"email"}}},Q={password:{type:"password",required:!0,minLength:8,label:"New Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"new-password"}},confirmPassword:{type:"password",required:!0,label:"Confirm Password",formConfig:{placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",autocomplete:"new-password"}}};let k=Promise.resolve();function X(){let e;k=new Promise(o=>{e=o});const t=M.subscribe("router:afterChange",()=>{a(),e()}),a=()=>{typeof t=="function"&&t()};setTimeout(()=>{a(),e()},1500)}function y(e){k.then(()=>R.navigate(e))}const d=W(/^#\/(login|reset-password)(\?|$)/);function Z(){const e=M.observable(null),t=M.observable("code"),a=M.observable(S()),o=M.observable("");return{step:M.observable(""),siteTitle:M.observable("Domma CMS"),brand:a,brandTheme:o,brandLogo:M.computed(()=>{o.value;const r=a.value;return K()?r.logoDark||r.logo:r.logo||r.logoDark}),notice:M.observable(""),byEmail:M.observable(!0),expiresIn:M.observable(""),obTitle:M.observable(""),obTagline:M.observable(""),obSiteError:M.observable(""),obSiteSaving:M.observable(!1),themes:j(),theme:M.observable("charcoal-dark"),obThemeError:M.observable(""),obThemeSaving:M.observable(!1),chChallenge:e,chMode:t,chTitle:M.computed(()=>e.value?.title||"One more step"),chLabel:M.computed(()=>g(e.value,t.value).label),chHelp:M.computed(()=>g(e.value,t.value).help),chInputMode:M.computed(()=>g(e.value,t.value).inputMode),chImage:M.computed(()=>e.value?.image||""),chSecret:M.computed(()=>e.value?.secret||""),chCanTrust:M.computed(()=>e.value?.trust===!0),chCanRecover:M.computed(()=>e.value?.recovery===!0),chCode:M.observable(""),chTrust:M.observable(!1),chError:M.observable(""),chBusy:M.observable(!1),resetEmail:M.observable(""),resetExpiry:M.observable(""),resetLines:M.observable([])}}function w(e,t={}){T(t.adminTheme||{dommaTheme:"charcoal-light"}),e.byEmail.value=t.resetByEmail!==!1,e.expiresIn.value=t.resetExpiresIn||"";const a=S(t);e.brand.value=a,e.siteTitle.value=a.title,Y(a)}export const loginView={templateUrl:"/admin/js/templates/login.html",async onMount(e){d.reset(),X();const t=O(),a=window.location.hash,{next:o,expired:r}=N(a);if(D()){y(a.startsWith("#/reset-password")?"/":o);return}const i=e.get(0).querySelector(".login-wrap")||e.get(0),l=Z(),c={state:l,root:i,next:o,token:"",email:"",pw:{problems:[],asked:0,timer:null}},p=M.applyBindings(l,i,{methods:_(c)});if(d.add(()=>p.dispose()),d.add(()=>clearTimeout(c.pw.timer)),d.add(M.effect(()=>{l.step.value;const s=l.brand.value;requestAnimationFrame(()=>{if(!i.isConnected)return;const m=i.querySelector(".login-brand-icon"),n=I.render(s.icon,{size:32})||I.render("layout",{size:32});m&&n&&m.replaceChildren(n),I.scan(i)})})),d.add(Domma.theme.onChange(()=>{l.brandTheme.value=Domma.theme.get()})),a.startsWith("#/reset-password")){try{w(l,await u.auth.setupStatus())}catch{T({dommaTheme:"charcoal-light"})}await oe(c,V(a));return}let h=!1;const v=E.loader(e.get(0),{type:"dots"});try{const s=await u.auth.setupStatus();h=s.needsSetup,w(l,s)}catch{E.toast("Could not reach the server.",{type:"error"})}finally{v.destroy()}h?(l.step.value="setup",$(c)):(l.step.value="login",x(c),r&&!t&&(l.notice.value="Your session ended - sign in again to carry on where you were."))}};function _(e){const{state:t}=e,a=o=>r=>{r?.preventDefault?.(),o()};return{skipSite:a(()=>{t.step.value="onboarding-theme"}),saveSite:()=>ee(t),pickTheme:o=>{t.theme.value=o},skipTheme:a(()=>{t.step.value="onboarding-done"}),saveTheme:()=>te(t),backToLogin:a(()=>{t.step.value="login"}),forgot:a(()=>{const o=String(e.root.querySelector('#login-form-container input[type="email"]')?.value||"").trim();t.step.value="forgot",L(e,o)}),toggleRecovery:a(()=>q(t,t.chMode.value==="code"?"recovery":"code")),copySecret:async()=>{try{await navigator.clipboard.writeText(String(t.chSecret.value).replace(/\s+/g,"")),E.toast("Key copied.",{type:"success"})}catch{E.toast("Could not copy - select the key and copy it.",{type:"warning"})}},verify:o=>{o?.preventDefault?.(),ae(e)},newLink:a(async()=>{try{w(t,await u.auth.setupStatus())}catch{}t.step.value="forgot",L(e)}),signInAfterReset:a(()=>{t.step.value="login",x(e,{email:e.email})})}}function $(e){F.render("#setup-form-container",U,{},{layout:"stacked",submitText:"Create admin account",onSubmit:async t=>{try{const a=await u.auth.setup(t);f(a),e.state.step.value="onboarding-site"}catch(a){return E.toast(a.message||"Setup failed. Please try again.",{type:"error"}),!1}}}),b(e.root.querySelector("#setup-form-container"))}async function ee(e){e.obSiteError.value="";const t=e.obTitle.value.trim(),a=e.obTagline.value.trim();e.obSiteSaving.value=!0;try{const o=await u.settings.get();await u.settings.save({...o,title:t||o.title,tagline:a||o.tagline,brand:{...o.brand||{},text:t||o.brand?.text||o.title},seo:{...o.seo||{},defaultTitle:t||o.seo&&o.seo.defaultTitle}}),e.step.value="onboarding-theme"}catch(o){e.obSiteError.value=o.message||"Could not save site details."}finally{e.obSiteSaving.value=!1}}async function te(e){e.obThemeError.value="",e.obThemeSaving.value=!0;try{await u.theme.save({theme:e.theme.value||"charcoal-dark"}),e.step.value="onboarding-done"}catch(t){e.obThemeError.value=t.message||"Could not save theme."}finally{e.obThemeSaving.value=!1}}function x(e,{email:t=""}={}){F.render("#login-form-container",G,t?{email:t}:{},{layout:"stacked",submitText:"Sign in",onSubmit:async a=>{try{const o=await u.auth.login(a);if(o?.challenge&&o.ticket)return C(e,o),!1;f(o),y(e.next)}catch(o){return E.toast(o.message||"Invalid credentials. Please try again.",{type:"error"}),!1}}}),b(e.root.querySelector("#login-form-container"))}function C(e,{challenge:t,ticket:a}){const{state:o}=e;e.ticket=a,o.chChallenge.value=t||{},o.chTrust.value=!1,q(o,"code"),o.step.value="challenge"}function q(e,t){e.chMode.value=t,e.chCode.value="",e.chError.value="",setTimeout(()=>document.getElementById("challenge-code")?.focus(),0)}async function ae(e){const{state:t}=e;t.chBusy.value=!0;try{const a=await u.auth.verifyLogin({ticket:e.ticket,response:String(t.chCode.value||"").trim(),mode:t.chMode.value,trust:t.chTrust.value===!0});if(a?.challenge&&a.ticket){C(e,a);return}f(a),y(e.next)}catch(a){const o=a.message||"That did not match.";t.chError.value=o,/sign in again/i.test(o)&&setTimeout(()=>{t.step.value="login"},1800)}finally{t.chBusy.value=!1}}function L(e,t=""){const{state:a}=e;a.byEmail.value&&F.render("#forgot-form-container",J,t?{email:t}:{},{layout:"stacked",submitText:"Send reset link",onSubmit:async o=>{try{const r=await u.auth.forgotPassword(o.email);r?.expiresIn&&(a.expiresIn.value=r.expiresIn)}catch{}a.step.value="forgot-success"}})}async function oe(e,t){const{state:a}=e;if(!t){a.step.value="reset-invalid";return}const o=E.loader(e.root,{type:"dots"});let r;try{r=await u.auth.checkReset(t)}catch{a.step.value="reset-invalid";return}finally{o.destroy()}e.token=t,e.email=r.email||"",a.resetEmail.value=e.email,a.resetExpiry.value=z(r.minutesLeft),a.step.value="reset",re(e)}function re(e){const{state:t,token:a,email:o,pw:r}=e,i=e.root.querySelector("#reset-form-container"),l=()=>({password:String(i.querySelector('input[name="password"]')?.value||""),confirm:String(i.querySelector('input[name="confirmPassword"]')?.value||"")}),c=()=>{const{password:s,confirm:m}=l(),n=H({password:s,confirm:m,problems:r.problems}),P=[...n.messages,...n.mismatch?["The two passwords do not match yet."]:[]];return t.resetLines.value=s?P.map((B,A)=>({id:A,text:B})):[],n},p=async()=>{const{password:s}=l(),m=++r.asked;if(s.length<8){r.problems=[],c();return}try{const n=await u.auth.checkReset(a,s);m===r.asked&&(r.problems=n.problems||[])}catch(n){if(n.body?.expired){t.step.value="reset-invalid";return}}m===r.asked&&c()};F.render("#reset-form-container",Q,{},{layout:"stacked",submitText:"Set new password",onSubmit:async s=>{await p();const m=c();if(!m.ok)return E.toast(m.mismatch?"The passwords do not match.":"That password does not meet the rules below.",{type:"error"}),!1;try{await u.auth.resetPassword(a,s.password),history.replaceState(null,"","#/reset-password"),t.step.value="reset-done"}catch(n){return n.body?.expired?(t.step.value="reset-invalid",!1):(r.problems=n.body?.problems||[],c(),E.toast(n.message||"The password was not changed.",{type:"error"}),!1)}}});const h=i.querySelector("form")||i;if(o){const s=document.createElement("input");s.type="email",s.name="username",s.autocomplete="username",s.value=o,s.readOnly=!0,s.hidden=!0,h.prepend(s)}b(i);const v=s=>{s.target.matches?.('input[type="password"], input[name="password"], input[name="confirmPassword"]')&&(s.target.name==="password"&&(r.problems=[]),c(),clearTimeout(r.timer),s.target.name==="password"&&(r.timer=setTimeout(p,400)))};i.addEventListener("input",v),d.add(()=>i.removeEventListener("input",v))}
@@ -360,7 +360,7 @@ Fast, file-based and friendly.
360
360
  - Since: built in 0.67.0 (was a plugin)
361
361
  - **Custom themes hook** - plugins (the Theme Roller) register themes via `hooks.registerThemes()`: a base theme plus changed tokens, usable everywhere a theme is chosen; the base is remembered so the site keeps working if the plugin goes away.
362
362
  - Since: 0.73.0
363
- - **Site custom CSS** - one stylesheet, `content/custom.css`, inlined last on every public page so it always wins.
363
+ - **Site custom CSS** - one stylesheet, `content/custom.css`, loaded last on every public page so it always wins: inline up to 4 KB, linked as `/content/custom.css` (fingerprinted, cached for good) beyond that; inline in previews.
364
364
  - Where: **System > Site Settings > Custom CSS**, or the page editor's CSS pane
365
365
 
366
366
  ### Site menus (authoring view)
@@ -453,6 +453,8 @@ headings (Layouts → Page contents settings, and `[contents]` per page).
453
453
  - Where: `server/services/renderer.js`, `server/templates/page.html`
454
454
  - **Response cache** - fully rendered pages are cached per URL, file modification time, set of viewer roles and origin, and invalidated by tags when pages, collections, forms, blocks, views, menus, context menus or settings change; concurrent cold requests render once. In-process memory driver, toggle and flush from the admin. Drafts and previews are never cached; responses are `private, no-cache` so shared proxies never mix roles.
455
455
  - Where: **System > Site Settings > Cache** (key viewer, on/off, clear); dashboard widget; `config/cache.json`; `/api/cache/*`; `docs/cache.md`
456
+ - **Fingerprinted assets** - a rendered page's local stylesheets and classic scripts carry `_pv=<hash of the file>` and are served `immutable` while the hash matches; modules are covered by an import map (their tags are not rewritten, so each stays one instance). A changed file gets a new URL on the next page drawn; an old fingerprint gets the current file with `max-age=0`. Images are left alone.
457
+ - Where: `server/services/publicAssets.js`; `docs/cache.md`
456
458
  - Since: file-change self-invalidation 0.36.12
457
459
 
458
460
  ---
@@ -1241,7 +1243,7 @@ The four Tools below were plugins until 0.67.0 and are now part of the CMS. They
1241
1243
  - Admin: **Content > Chats** (`#/launchers/chats`, `#/launchers/chats/:id`) - the inbox, waiting first, the live thread (3s poll), replies with per-chat drafts, end/delete/email in a context menu, Available switch, settings cog; sidebar badge `/api/chats/_count` (live while someone waits, red after 5 minutes). **Chats > Knowledge** (`#/launchers/knowledge`) - entries with an editor slideover (question, other ways of asking, keywords, Markdown answer, up to five buttons, on/off), Try the bot with scores, and the Unanswered list (Make an entry, add to the closest entry, dismiss). Visitor panel `public/js/launcher-chat.mjs` `mountChat(container, {launcherId, title, chat})` + `public/css/launcher-chat.css`, domma-reactive.
1242
1244
  - Permission `chats` (`read`, `reply`, `manage`) in the Tools group; Admin is granted it once. All of it is behind the Launchers switch.
1243
1245
  - AI Assist (unreleased): the paid `ai-assist` Tool (Pro plan) calls `hooks.enableAiAssist()` (`services/aiAssist.js`, paid + closedSource only, off when the Tool is disabled). Without it `aiAvailable()` is false (chat config says `ai: false`, nothing is asked) and the admin assistant is unavailable (`requestAdminAnswer` 403). `GET /api/launchers/items` says `aiAssist`, and the launcher editor notes under AI answers when it is off. The Manager checks the `ai-assist` licence (no longer the Site Builder's).
1244
- - Della's AI answers (unreleased; Pro plan, hosted sites): when the matcher says `none`, `services/chat/ai.js` `aiAnswer()` asks the Manager (`MANAGER_URL` + `FLEET_TOKEN`, `POST /api/fleet/launcher-chat`; on dcm the in-process registry `Symbol.for('domma.launcher-chat')`) with the site's name, `assistantBrief()` (site.json `assistant.context`/`rules` from Site Settings > General > AI assistant, plus the launcher's `chat.aiContext`/`aiRules`), the enabled non-sample Knowledge (most used first, 16,000 characters), the last 10 visitor/bot messages and the question. A non-empty answer is stored as a bot message with `ai: true` (`misses` reset); empty or refused falls back to the usual "do not know". The question is still logged as unanswered. A 403 (no licence) backs off 10 minutes, a 429 (month used) 30 minutes, anything else 1 minute. Per launcher `chat.ai` (default on), `chat.aiUseSite` (default on; off = the launcher's own context only - the site's rules always apply), `chat.aiMaxPerChat` (20; `aiCount` on the session); the default bot name is now Della. A character's chat is called by the character's name, or by `chat.characterName` when set (admin: **Call her** under Use Della) - `characterChat()` in `public/js/characters.mjs` - so Della can be "Dash" on one launcher with her own artwork. Packs in `CHARACTERS`: dot, daisy, della, dash (Job Board) and remy (health care, Regimen; unreleased), each a 3x2 atlas in `public/images/characters/<id>-poses.png`. `aiContext`/`aiRules` never reach the page (`publicLauncher`). `/api/chat/config` says `ai` so the panel can say Della is an AI assistant. Manager side: `plugins/site-manager/services/launcherChatRoutes.js` (fleet token, the `ai-site-builder` licence, 2,000 answers per site per month counting "do not know", 4 at once) and `tools/launcher-chat` (Claude Haiku 5.5, low effort; fixed cached system prompt, then the owner's context and rules as a second system block; the visitor's words only in the user message; `LAUNCHER_CHAT_ANTHROPIC_KEY` read by the job alone).
1246
+ - Della's AI answers (unreleased; Pro plan, hosted sites): when the matcher says `none`, `services/chat/ai.js` `aiAnswer()` asks the Manager (`MANAGER_URL` + `FLEET_TOKEN`, `POST /api/fleet/launcher-chat`; on dcm the in-process registry `Symbol.for('domma.launcher-chat')`) with the site's name, `assistantBrief()` (site.json `assistant.context`/`rules` from Site Settings > General > AI assistant, plus the launcher's `chat.aiContext`/`aiRules`), the enabled non-sample Knowledge (most used first, 48,000 characters), the last 10 visitor/bot messages and the question. A non-empty answer is stored as a bot message with `ai: true` (`misses` reset); empty or refused falls back to the usual "do not know". The question is still logged as unanswered. A 403 (no licence) backs off 10 minutes, a 429 (month used) 30 minutes, anything else 1 minute. Per launcher `chat.ai` (default on), `chat.aiUseSite` (default on; off = the launcher's own context only - the site's rules always apply), `chat.aiMaxPerChat` (20; `aiCount` on the session); the default bot name is now Della. A character's chat is called by the character's name, or by `chat.characterName` when set (admin: **Call her** under Use Della) - `characterChat()` in `public/js/characters.mjs` - so Della can be "Dash" on one launcher with her own artwork. Packs in `CHARACTERS`: dot, daisy, della, dash (Job Board) and remy (health care, Regimen; unreleased), each a 3x2 atlas in `public/images/characters/<id>-poses.png`. `aiContext`/`aiRules` never reach the page (`publicLauncher`). `/api/chat/config` says `ai` so the panel can say Della is an AI assistant. Manager side: `plugins/site-manager/services/launcherChatRoutes.js` (fleet token, the `ai-site-builder` licence, 2,000 answers per site per month counting "do not know", 4 at once) and `tools/launcher-chat` (Claude Haiku 5.5, low effort; fixed cached system prompt, then the owner's context and rules as a second system block; the visitor's words only in the user message; `LAUNCHER_CHAT_ANTHROPIC_KEY` read by the job alone).
1245
1247
  - Saved chats (unreleased): preset `chat-saved` (in `CHAT_PRESET_SLUGS`, `chats.manage` through the generic API, kept out of site repos) - a copy of a chat with `note`, `outcome` (to look at / looking into it / done), visitor, page, dates, who saved it, `transcript` (plain text) and `messages`. `POST /api/chats/:id/save` (reply), `GET /api/chats/saved` and `/saved/:sid` (read), `PUT /saved/:sid` (reply; note, outcome), `DELETE /saved/:sid` (manage); at most 2,000 per site. Chats inbox: a **Saved** tab, the context-menu item **Save for a closer look…**, and an outcome/note bar on an open saved chat (`services/chat/saved.js`, `arrangeSaved()`).
1246
1248
  - Visitor panel look (unreleased): bot and staff avatars, runs of messages grouped (name on the first, avatar on the last), gradient visitor bubbles, soft chips for links and choices, a rounded composer with the send button inside, messages easing in (still for reduced motion), and in a launcher panel the bot's avatar (with a dot while someone answers) and the status under the title. Panel 400 x 600. Per-chat branding: `chat.accent` / `chat.accentText` (a theme token or hex, `launcherColour`) and `chat.avatar` (a site address only, `launcherAvatar()`), in the page's chat block and `/api/chat/config`; the panel sets `--chat-accent` / `--chat-accent-text` on itself (`launcherChatAccentCss()`: a hex accent with no text colour gets black or white by contrast, a token its `--dm-<token>-text`), and the bot's picture replaces its initial in the heading, the typing row and its messages.
1247
1249
  - Chat window and extras (unreleased): `chat.size` sm/md/lg/custom + `width`/`height` (`launcherChatBox()`; desktop only, clamped 300-720 x 380-900 and to the window), `chat.resizable` (a grip in the corner opposite the disc; size kept per launcher in the browser, `launcher-chat-size:<id>`, double-click resets), `chat.starters` (up to 4 buttons under the greeting; a tap within 1.7s of opening waits out the anti-bot window), `chat.personButton` below/header (an icon with a tooltip before the close button), greeting placeholders `{greeting}` `{timeofday}` `{day}` `{date}` `{time}` `{botname}` `{site}`, `chat.times` time/datetime/none on each message (`fillGreeting()`, the visitor's clock, text only), and `chat.keepDays` (0 = the site's `retentionDays`; the hourly tidy-up reads each launcher's).
package/docs/cache.md CHANGED
@@ -60,6 +60,10 @@ Tag-based. When an admin saves a page, only entries tagged `page:<that-url>` are
60
60
 
61
61
  The markdown pipeline auto-attaches the appropriate shortcode tags as it processes a page - embedding `[collection slug="faq"]` causes the rendered page to be tagged `collection:faq`, so a FAQ entry edit transparently busts every page that displays the FAQ. There is no central embed-map to maintain.
62
62
 
63
+ ### The admin-change safety net
64
+
65
+ Besides the tags above, every successful signed-in POST, PUT, PATCH or DELETE clears the whole cache (server.js), so a missed invalidation cannot serve stale pages. A route whose effect is on no page opts out with `config: {keepsCache: true}` (`services/cache/adminChange.js`) - the chat availability check-in, the sidebar's badge counts, the editor previews and the theme, component and view previews do: they are POSTs that only read, some sent by every open admin every 30-60 seconds. Use it only for such routes; when in doubt, leave it off.
66
+
63
67
  ## Manual flush, inspection, and on/off
64
68
 
65
69
  | Endpoint | Behaviour |
@@ -98,6 +102,26 @@ Before the response cache is asked, the route decides whether the viewer may see
98
102
 
99
103
  `services/assetCache.js`: an `onSend` hook added before @fastify/compress's. When @fastify/static has answered a GET with a 200 for a compressible type (its stream carries the file's path), the hook swaps the stream for a buffer kept in memory - the bytes as sent, per encoding (`br`, `gzip`, `identity`), keyed on the path and checked against the file's mtime and size on every request. @fastify/static still resolves the path, sets the type, cache-control, ETag and Last-Modified and answers 304s, HEADs and 404s. Files under 1 KB or over 2 MB, Range requests and non-text types are left to stream. Bounded at 64 MB (LRU by bytes); on while the response cache is on; emptied on a clear or re-init. `GET /api/cache/status` reports it as `assets`.
100
104
 
105
+ ## Fingerprinted assets
106
+
107
+ `services/publicAssets.js`. @fastify/static serves every file `public, max-age=0`, so a browser revalidated every stylesheet and script on every page view. `fingerprintHtml()` is the last step of both render paths:
108
+
109
+ - a local `<link rel="stylesheet">` or classic `<script src>` (under `public/`, Domma's dist or a plugin's `public/`) gains `_pv=<first 16 hex of the file's sha256>`;
110
+ - a module is identified by its URL, so a `<script type="module">` tag is rewritten only when nothing imports that URL. The page gets a `<script type="importmap">` before its first script, mapping every module its scripts import (followed through the files, however deep) from the URL it is imported by to that URL with `_pv`. A module that is both linked and imported keeps its URL in the tag and is left out of the map, so it stays one instance in every browser. A page with its own import map, or a module script from another origin, gets none;
111
+ - a request whose `_pv` matches the file as it is now is answered `Cache-Control: public, max-age=31536000, immutable`. Any other `_pv` (a cached page or an open tab from before the file changed) gets the current file with `max-age=0` - never a 404.
112
+
113
+ Images are not fingerprinted: scripts draw them from data by the plain URL, and one picture under two URLs downloads twice.
114
+
115
+ `content/custom.css` over 4 KB is linked as `/content/custom.css` (served by the same module, compressed once per encoding) instead of being inlined; previews keep it inline, and so does a stylesheet with a relative `url()` or `@import`, which would resolve differently as a file. The hand-written `?v=` tokens stay as they are - `tests/services/asset-cache-busting.test.js` still applies.
116
+
117
+ ## Listings and the per-request memos
118
+
119
+ - `listPages({render: false})` reads front matter and source only, kept per file against mtime and size. Lists, badges, search and the sitemap use it. `listPages()` still renders, through the parsed-page memo while the cache is on.
120
+ - `listProjects()` is kept while the cache is on (30 s at most) and dropped on any invalidation, so switching a project off is immediate.
121
+ - Plugin head/body snippets are kept for 10 s while the cache is on.
122
+ - `readConfig(name)` (config.js) is `getConfig()` for per-request read-only use: one stat, the parsed file reused until it changes, frozen.
123
+ - A cached page's ETag hash is kept beside the cached string and reused only for that very string.
124
+
101
125
  ## Thundering-herd safety
102
126
 
103
127
  If three concurrent requests hit a cold key, the producer runs exactly once - the other two await the first's result via an in-flight promise map. This matters for popular pages on cache cold-start: without coalescing, N parallel requests trigger N parallel renders, each writing the same value back to the cache.
@@ -508,7 +508,7 @@ every public page as `window.__CMS_SEARCH__`, so nothing private belongs in it.
508
508
 
509
509
  ### What gets searched
510
510
 
511
- `listPages()` on every query - there is no index, so cost is linear in the number of pages. Drafts and pages with
511
+ `listPages({render: false})` on every query - there is no index, so cost is linear in the number of pages, but only front matter and source are read (kept per file until it changes), never a rendered page. Drafts and pages with
512
512
  `visibility: private` are skipped. Scoring is weighted by field (title, then tags, then description, then body); the
513
513
  body is reduced to plain prose first (`stripMarkdown` in `server/services/search.js`), which drops fenced code,
514
514
  `<pre>`/`<code>`, shortcode tags and `[dconfig]` while keeping readable shortcode attributes such as
@@ -764,6 +764,32 @@ nothing was stored (an end-form set not to record) - treat that as not sent. An
764
764
  `meta.updatedAt` with `meta.createdAt` if the answers must be as sent. When the person's data is erased, use
765
765
  `removeFormEntry`, and `formEntriesBy(form, userId)` for the entries they sent but your plugin never used. Feature-detect an older core: `import('../../server/services/formContext.js').catch(() => null)`.
766
766
 
767
+ ## AI Assist: listing your AI chats
768
+
769
+ A Tool with its own AI chats (the Site Builder's conversations, the Tool Builder's builds) can list them on
770
+ **AI Assist › Builders**, so a site with AI Assist has every AI chat in one place. Declare it in `plugin.json`:
771
+
772
+ ```json
773
+ "admin": {
774
+ "aiAssist": {
775
+ "label": "Site Builder",
776
+ "url": "#/plugins/ai-site-builder",
777
+ "list": "/api/plugins/ai-site-builder/conversations",
778
+ "permission": "ai-builder",
779
+ "character": "dot"
780
+ }
781
+ }
782
+ ```
783
+
784
+ - `url` must be your own screen (`#/plugins/<name>...`) and `list` your own API (`/api/plugins/<name>/...`, no
785
+ query); anything else is skipped at load with a warning.
786
+ - The tab shows your entry only to people holding `permission` (the resource or any of its actions) whose admin
787
+ scope covers `url`, and reads `list` with **their** token - your route decides what each person sees.
788
+ - `list` answers `{items: [{id, title, updatedAt, status, startedBy}]}` (`{conversations}` and `{builds}` with the
789
+ same fields, or `plugin`/`displayName` for id/title, are read too).
790
+ - A chat opens at `<url>?open=<id>`: read `open` from `location.hash` when your view mounts and open that chat.
791
+ - Older engines ignore the block, so it is safe to ship before the engine has it.
792
+
767
793
  ## Dashboard widgets
768
794
 
769
795
  With **Dashboard Pro**, admins build their own Dashboard from widgets the Tools offer. A widget ships
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.60.0",
3
+ "version": "1.61.1",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",