domma-cms 1.66.7 → 1.66.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/admin/js/app.js +2 -2
- package/admin/js/lib/chat-toast.js +2 -2
- package/admin/js/lib/notifications-arrange.js +1 -1
- package/admin/js/templates/contacts.html +1 -1
- package/package.json +1 -1
- package/plugins/_lib/admin/mail/body-menu.js +1 -1
- package/plugins/_lib/admin/mail/cms-host.js +1 -1
- package/plugins/_lib/admin/mail/compose-window.js +1 -1
- package/plugins/_lib/admin/mail/contacts.js +1 -1
- package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
- package/plugins/_lib/admin/mail/drag-drop.js +1 -1
- package/plugins/_lib/admin/mail/folder-tree.js +1 -1
- package/plugins/_lib/admin/mail/font-controls.js +1 -1
- package/plugins/_lib/admin/mail/fonts.js +1 -1
- package/plugins/_lib/admin/mail/host-context.js +1 -1
- package/plugins/_lib/admin/mail/identity.js +1 -1
- package/plugins/_lib/admin/mail/image-senders-section.js +1 -1
- package/plugins/_lib/admin/mail/keyboard.js +1 -1
- package/plugins/_lib/admin/mail/mail.html +1 -1
- package/plugins/_lib/admin/mail/message-actions.js +1 -1
- package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
- package/plugins/_lib/admin/mail/panes.js +1 -1
- package/plugins/_lib/admin/mail/reader-kit.js +1 -1
- package/plugins/_lib/admin/mail/reader-runtime.js +1 -34
- package/plugins/_lib/admin/mail/reader-view.js +1 -1
- package/plugins/_lib/admin/mail/resizable.js +1 -1
- package/plugins/_lib/admin/mail/restore-spam.js +1 -1
- package/plugins/_lib/admin/mail/rules.js +1 -1
- package/plugins/_lib/admin/mail/scheduling.js +1 -1
- package/plugins/_lib/admin/mail/section-kit.js +1 -1
- package/plugins/_lib/admin/mail/security-note.js +1 -1
- package/plugins/_lib/admin/mail/settings-section.js +1 -1
- package/plugins/_lib/admin/mail/templates.js +1 -1
- package/plugins/_lib/admin/mail/threads.js +1 -1
- package/plugins/_lib/admin/mail/vacation.js +1 -1
- package/plugins/_lib/admin/mail/when-closed.js +1 -1
- package/plugins/_lib/admin/ui/dates.js +1 -1
- package/plugins/_lib/admin/ui/resizable.js +1 -1
- package/plugins/_lib/contacts/mailContact.js +1 -1
- package/plugins/_lib/contacts/model.js +1 -1
- package/plugins/_lib/domma-mail-contacts.lock.json +18 -18
- package/plugins/_lib/domma-mail.lock.json +80 -80
- package/plugins/_lib/mail/accountFileStore.js +1 -1
- package/plugins/_lib/mail/accountRepository.js +1 -1
- package/plugins/_lib/mail/accountRoutes.js +1 -1
- package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
- package/plugins/_lib/mail/bodyTokens.js +1 -1
- package/plugins/_lib/mail/compose.js +1 -1
- package/plugins/_lib/mail/defaults.js +1 -1
- package/plugins/_lib/mail/envelope.js +1 -1
- package/plugins/_lib/mail/folderActions.js +1 -1
- package/plugins/_lib/mail/folderRuntime.js +1 -1
- package/plugins/_lib/mail/folders.js +1 -1
- package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
- package/plugins/_lib/mail/mbox.js +1 -1
- package/plugins/_lib/mail/message-action.js +1 -1
- package/plugins/_lib/mail/messageSecurity.js +1 -1
- package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
- package/plugins/_lib/mail/networkAddresses.js +1 -1
- package/plugins/_lib/mail/networkPolicy.js +1 -1
- package/plugins/_lib/mail/oauthAccounts.js +1 -1
- package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
- package/plugins/_lib/mail/oauthRuntime.js +1 -1
- package/plugins/_lib/mail/pollSchedule.js +1 -1
- package/plugins/_lib/mail/poller.js +1 -1
- package/plugins/_lib/mail/pollerRuntime.js +1 -1
- package/plugins/_lib/mail/priority.js +1 -1
- package/plugins/_lib/mail/publicMailbox.js +1 -1
- package/plugins/_lib/mail/readRuntime.js +1 -1
- package/plugins/_lib/mail/render.js +1 -1
- package/plugins/_lib/mail/ruleRunner.js +1 -1
- package/plugins/_lib/mail/schedulerRuntime.js +1 -1
- package/plugins/_lib/mail/secretProvider.js +1 -1
- package/plugins/_lib/mail/secretbox.js +1 -1
- package/plugins/_lib/mail/senderAuth.js +1 -1
- package/plugins/_lib/mail/sieve.js +1 -1
- package/plugins/_lib/mail/smtpService.js +1 -1
- package/plugins/_lib/mail/snoozeRuntime.js +1 -1
- package/plugins/_lib/mail/store.js +1 -1
- package/plugins/_lib/mail/subscriptions.js +1 -1
- package/plugins/_lib/mail/syncPlan.js +1 -1
- package/plugins/_lib/mail/syncRuntime.js +1 -1
- package/plugins/_lib/mail/syncSelection.js +1 -1
- package/plugins/_lib/mail/unreadBadge.js +1 -1
- package/plugins/_lib/mail/unsubscribe.js +1 -1
- package/plugins/_lib/mail/vacationRuntime.js +1 -1
- package/plugins/_lib/mail/write.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.66.8] - 2026-11-14
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Email Pro shows Empty Trash once.** The folder menu listed "Empty Trash..." twice; the shared mail core now comes from Domma Mail 0.92.1 (shared mail core 0.29.1).
|
|
8
|
+
- **Chat pop-ups that wait for you now show in every open admin tab.** "A visitor started a chat" and "wants to talk to a person" appeared only in whichever tab checked first - often one in the background - and never in the others. They now show in every tab, appear when you open or return to the admin while a visitor is still waiting, and closing one closes it in the other tabs too.
|
|
9
|
+
|
|
3
10
|
## [1.66.7] - 2026-11-14
|
|
4
11
|
|
|
5
12
|
- **Security: Tools' collections are no longer readable through the public API.** A collection made with no API settings was readable by anyone at `/api/collections/<slug>/public`, and several Tools (Campaigns Pro, Surveys, Onboard Pro, eCards, Invoice, Site Builder, Blog and Blog Pro) made theirs that way - so invitations, contacts, deliveries and unsubscribes could be read without signing in. A Tool's collection is now closed unless its own schema opens it, and on the first start after this update every Tool collection still on the old setting is closed once (the log lists them). A site that wants one open can switch Read back on in Collections, under API & Export, and that choice is kept. The Tools' own screens and pages are not affected.
|
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,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=`
|
|
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 N,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 k,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 j(t){if(L[t])return E.toast(`${L[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&&k(l,i.split("?")[0]))return i;const s=It(t);if(s&&!k(l,o)&&k(l,s.split("?")[0]))return s;const n=T[t]||At(l,t);return n||(!u&&o==="/system/notifications"?l?.home||"/":(t.split("?")[0]||"/")==="/"&&p&&p!=="/"&&!Vt()?T[p]||p:null)}function I(){document.body.classList.toggle(yt,Dt(l))}const T={},L={};R.use(async(t,o,e)=>{if(N(t.path))return e();if(!m()){ht();return}const a=j(t.path);if(a){R.navigate(a);return}e()});async function y(){try{const t=await r.get("/auth/permissions");l=t.adminScope||null,I(),v=t.adminBrand||null,at(v),p=t.adminHome||"/",Y(t.versions||{});const o=t.permissions||[];return b=k(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,I(),p="/",v||at(null),b=!1,w=null,d=null,u=!0,C=!1,[]}}document.addEventListener("dm:admin-home-changed",()=>{y()});let U=null,x=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(H(r),U){x=!0;return}U=(async()=>{do{x=!1;try{await B(await y())}catch{}}while(x)})().finally(()=>{U=null})});async function B(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})=>{N(t.path)&&(f&&(clearInterval(f),f=null),l=null,I(),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(!N(t.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),N(o?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(i=>i.refreshAdminTheme(r)),await V();const e=await y(),a=j(t.path);if(a&&R.navigate(a),B(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 P=document.querySelector(K);if(!P)continue;if(Array.from(P.options||[]).find(lt=>lt.value===a)){P.value=a,P.dispatchEvent(new Event("change",{bubbles:!0}));return}}i<n&&setTimeout(c,s)};setTimeout(c,s)});const q="cms_card_states",F=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&&F[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&&(F[e]=o.hasClass("card-collapsed")?"collapsed":"open",S.set(q,F))}),_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 O=[...it];async function V(){if(m()){g=await r.get("/ai-assist").catch(()=>g),Tt(g);try{const t=await r.plugins.adminConfig(),o=new Set(O.map(e=>e.path));for(const e of t.routes||[])o.has(e.path)||O.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&&(T[`/${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&&(L[`/${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=!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:
|
|
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:A,canRead:()=>w!==!1,own:()=>!u}),xt(t),rt(t),Y(),St(),H(r),A(),f||(f=setInterval(A,3e4),document.addEventListener("visibilitychange",()=>{document.hidden||A()}))}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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}let f=null,_=null;async function A(){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&&(_===null||t>_);_=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([]),V()]);if(a){const s=(window.location.hash||"#/").slice(1)||"/",n=j(s);n&&(window.location.hash=`#${n}`),B(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 V(),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:O,views:z,default:"/",transitions:{enter:"fadeIn",leave:"fadeOut",duration:150}})})()});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{chatToastsDue as
|
|
2
|
-
`).filter(Boolean)[0]||"",
|
|
1
|
+
import{chatToastsDue as m,chatToastSticks as T,chatToastsSettled as A,rememberSeen as d,safeLink as f}from"./notifications-arrange.js";const y="notifications.chatToastSeen",p="notifications.chatToastClosed",b="#/launchers/chats",s=new Map;function v(){try{const t=S.get(y);return Array.isArray(t)?t:null}catch{return null}}function w(t){try{S.set(y,t)}catch{}}function l(){try{const t=S.get(p);return Array.isArray(t)?t:[]}catch{return[]}}function O(t){try{S.set(p,t)}catch{}}export const chatToastsOpen=()=>s.size>0;export function deliverChatToasts(t,{enabled:o=!0}={}){const c=v(),a=o?m(t,{seen:c,open:[...s.keys()],closed:l()}):[];for(const e of a){const n=e.data||{},r=T(e),C=n.source==="core:chat"&&n.severity==="warning",h=/^#\//.test(f(n.link))?f(n.link):b,k=String(n.body||"").split(`
|
|
2
|
+
`).filter(Boolean)[0]||"",i=String(e.id),u=E.toast(k.slice(0,200),{title:String(n.title||"Visitor chat"),type:C?"warning":"info",duration:r?0:15e3,closable:!0,className:r?"dm-chat-toast is-sticky":"dm-chat-toast",actions:[{label:/ai-assist/.test(h)?"Open in AI Assist":"Open Chats",primary:!0,closeOnClick:!0,onClick:()=>{location.hash=h}}],onClose:()=>{s.delete(i)&&O(d(l(),[i]))}});r&&u&&s.set(i,u)}const g=(t||[]).filter(e=>e?.unread&&String(e.data?.source||"").startsWith("core:chat")).map(e=>e.id);return w(d(c||[],g)),a.length}export function settleChatToasts(t){const o=A([...s.keys()],t,l());for(const c of o){const a=s.get(c);s.delete(c);try{a?.close?.()}catch{}}return o.length}export function closeChatToasts(){const t=[...s.values()];s.clear();for(const o of t)try{o?.close?.()}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fmtDate as
|
|
1
|
+
import{fmtDate as c}from"./dates.js";export const SEVERITIES=["critical","warning","info","success"],FILTERS=["all","new",...SEVERITIES],SEVERITY_TONE={critical:"danger",warning:"warn",success:"ok",info:"info"};const l=(t,e,n=`${e}s`)=>`${t} ${t===1?e:n}`;export function severityOf(t){const e=t?.data?.severity;return SEVERITIES.includes(e)?e:"info"}export function ago(t,e=Date.now()){const n=new Date(t).getTime();if(!Number.isFinite(n))return"";const r=Math.max(0,Math.round((e-n)/1e3));return r<60?"just now":r<3600?`${Math.round(r/60)} min ago`:r<86400?`${l(Math.round(r/3600),"hour")} ago`:r<86400*14?`${l(Math.round(r/86400),"day")} ago`:c(n)}export function arrangeNotifications(t,{filter:e="all",query:n=""}={}){const r=String(n).trim().toLowerCase();return[...t||[]].filter(o=>e==="all"?!0:e==="new"?o.isNew:severityOf(o)===e).filter(o=>!r||[o.data?.title,o.data?.body,o.data?.link].some(i=>String(i||"").toLowerCase().includes(r))).sort((o,i)=>String(i.data?.createdAt||"").localeCompare(String(o.data?.createdAt||"")))}export function filterCounts(t){const e={all:0,new:0,critical:0,warning:0,info:0,success:0};for(const n of t||[])e.all++,n.isNew&&e.new++,e[severityOf(n)]++;return e}export function safeLink(t){const e=String(t||"").trim();return/^https?:\/\/\S+$/i.test(e)||/^#\/\S*$/.test(e)?e:""}export function sourceLabel(t={}){return t.source==="manager"?"from the manager":t.source==="sample"?"sample":t.sourceLabel?String(t.sourceLabel):t.source?String(t.source).startsWith("core:")?"System":String(t.source).split(":")[0]:""}export function notificationRow(t,{now:e=Date.now(),expanded:n=""}={}){const r=t?.data||{},o=severityOf(t),i=String(r.body||""),s=i.replace(/\s+/g," ").trim();return{id:String(t.id),title:String(r.title||"(no title)"),severity:o,severityLabel:o[0].toUpperCase()+o.slice(1),tone:SEVERITY_TONE[o],meta:[r.createdAt?ago(r.createdAt,e):"",sourceLabel(r),/^https?:\/\//i.test(String(r.link||""))?"has a link":"",r.expiresAt&&Date.parse(r.expiresAt)>e?`until ${c(r.expiresAt)}`:""].filter(Boolean).join(" \xB7 "),preview:s.length>140?`${s.slice(0,139)}\u2026`:s,body:i,link:safeLink(r.link),linkTarget:/^#\//.test(safeLink(r.link))?"_self":"_blank",linkText:/^#\//.test(safeLink(r.link))?"Go there \u2192":"Open link \u2197",isNew:!!t.isNew,unread:!!t.unread,open:n===String(t.id),rowCls:[t.unread?"is-unread":"",n===String(t.id)?"is-open":"",`is-${o}`].filter(Boolean).join(" ")}}const p={boot:"at start-up","15m":"every 15 minutes",hourly:"hourly",daily:"daily at 08:00"};export function sourceRow(t,e=Date.now()){const n=t.every?`${p[t.every]||t.every}${t.atBoot&&t.every!=="boot"?" and at start-up":""}`:"as it happens";return{id:String(t.id),label:String(t.label||t.id),description:String(t.description||""),meta:[t.ownerLabel||t.owner,n,t.lastRun?`last run ${ago(t.lastRun,e)}`:""].filter(Boolean).join(" \xB7 "),enabled:!!t.enabled,audience:t.audience||"super-admin",every:t.every||"",lastError:t.lastError?`Last run failed: ${t.lastError}`:""}}export const DESKTOP_LEVELS=["all","warning","critical"],DEFAULT_SETTINGS=Object.freeze({desktop:!1,desktopLevel:"all",signInToasts:!0,chatToasts:!0});export function normaliseSettings(t){const e=t&&typeof t=="object"?t:{},n=DEFAULT_SETTINGS;return{desktop:typeof e.desktop=="boolean"?e.desktop:n.desktop,desktopLevel:DESKTOP_LEVELS.includes(e.desktopLevel)?e.desktopLevel:n.desktopLevel,signInToasts:typeof e.signInToasts=="boolean"?e.signInToasts:n.signInToasts,chatToasts:typeof e.chatToasts=="boolean"?e.chatToasts:n.chatToasts}}export function meetsLevel(t,e="all"){return e==="critical"?t==="critical":e==="warning"?t==="critical"||t==="warning":!0}export function desktopWorthy(t,{seen:e=[],level:n="all",max:r=3}={}){const o=new Set((e||[]).map(String));return[...t||[]].filter(i=>i&&i.unread&&!o.has(String(i.id))&&meetsLevel(severityOf(i),n)).sort((i,s)=>String(i.data?.createdAt||"").localeCompare(String(s.data?.createdAt||""))).slice(-r)}export const CHAT_SOURCES=Object.freeze(["core:chat","core:chat-started","core:chat-declined"]),CHAT_TOAST_RECENT_MS=10*6e4;export function chatToastsDue(t,{seen:e=null,open:n=[],closed:r=[],now:o=Date.now(),max:i=3}={}){const s=new Set((e||[]).map(String)),u=new Set([...n||[],...r||[]].map(String));return[...t||[]].filter(a=>a&&a.unread&&CHAT_SOURCES.includes(a.data?.source)).filter(a=>chatToastSticks(a)?!u.has(String(a.id)):!s.has(String(a.id))&&(!!e||o-Date.parse(a.data?.createdAt||0)<CHAT_TOAST_RECENT_MS)).sort((a,d)=>String(a.data?.createdAt||"").localeCompare(String(d.data?.createdAt||""))).slice(-i)}export function chatToastSticks(t){const e=t?.data||{};return e.source==="core:chat-started"||e.source==="core:chat"&&e.severity==="warning"}export function chatToastsSettled(t,e,n=[]){const r=new Set((e||[]).filter(i=>i?.unread).map(i=>String(i.id))),o=new Set((n||[]).map(String));return(t||[]).map(String).filter(i=>!r.has(i)||o.has(i))}export function rememberSeen(t,e,n=200){const r=[...(t||[]).map(String)];for(const o of e||[])r.includes(String(o))||r.push(String(o));return r.slice(-n)}export function desktopPayload(t){const e=t?.data||{},n=severityOf(t),r=String(e.body||"").replace(/\s+/g," ").trim();return{title:String(e.title||"Notification").slice(0,120),options:{body:r.length>240?`${r.slice(0,239)}\u2026`:r,tag:`dcms-notification-${t?.id}`,requireInteraction:n==="critical"}}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Source: @domma-mail/core 0.29.
|
|
1
|
+
<!-- Source: @domma-mail/core 0.29.1, packages/core/src/admin/contacts/view.html. -->
|
|
2
2
|
<!-- No heading: the banner above (admin/js/lib/plugin-chrome.js) is the title.
|
|
3
3
|
Everything that changes is bound (M.applyBindings) - see admin/js/views/contacts.js, which also
|
|
4
4
|
inserts the row and chip templates: the router renders this file through _.render, eating any {{…}}.
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/body-menu.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The reading pane's right-click menu - the pure parts.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/cms-host.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** The CMS shell boundary. Standalone never imports this adapter. */
|
|
4
4
|
const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/compose-window.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/contacts.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Recipient suggestions from the host address book.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/diagnostics-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The settings section that answers "which build is this, and what went wrong".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/drag-drop.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Drag identities include the mailbox and source folder: UIDs alone are not unique. */
|
|
4
4
|
const PROTECTED_USES = new Set(['\\Inbox', '\\Sent', '\\Drafts', '\\Trash', '\\Junk', '\\Archive', '\\All', '\\Flagged']);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/folder-tree.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Mail folder presentation, shared by the Mail Reader and Email Pro.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/font-controls.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/fonts.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The fonts and sizes the mail editor offers - pure, so both the compose
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/host-context.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Services supplied by the application that hosts the shared mail interface. */
|
|
4
4
|
export function createMailApi({getToken, fetch: request = globalThis.fetch, onUnauthorized = () => {}}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/identity.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Who a mailbox sends as, and what it signs off with.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/image-senders-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The settings section for senders whose images always load.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/keyboard.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Keyboard navigation for the reader.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/message-actions.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* What other Tools add to a message's menu - Booking's "Book Sam...".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/oauth-panel.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* "Sign in with Microsoft / Google" for a mailbox - the part of the mailbox
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/panes.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Pane sizing for the mail reader, shared by the Mail Reader and Email Pro.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/reader-kit.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The reader view's decisions that need no DOM - escaping, the mailbox form's
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/reader-runtime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
@@ -5444,12 +5444,6 @@ return {
|
|
|
5444
5444
|
action: () => setFolderVisible(folder, folder.subscribed === false)
|
|
5445
5445
|
},
|
|
5446
5446
|
{type: 'divider'},
|
|
5447
|
-
...(folder.specialUse === '\\Trash' && features.emptyTrash ? [{
|
|
5448
|
-
label: 'Empty Trash...',
|
|
5449
|
-
icon: 'trash',
|
|
5450
|
-
danger: true,
|
|
5451
|
-
action: () => emptyTrashFolder(folder)
|
|
5452
|
-
}, {type: 'divider'}] : []),
|
|
5453
5447
|
{
|
|
5454
5448
|
label: 'Rename',
|
|
5455
5449
|
icon: 'edit-3',
|
|
@@ -5817,33 +5811,6 @@ return {
|
|
|
5817
5811
|
}
|
|
5818
5812
|
}
|
|
5819
5813
|
|
|
5820
|
-
/** Empty Trash after explicitly confirming permanent deletion. */
|
|
5821
|
-
async function emptyTrashFolder(folder) {
|
|
5822
|
-
const accountId = currentAccountId;
|
|
5823
|
-
const count = Number.isFinite(folder.messages) ? `${folder.messages} message${folder.messages === 1 ? '' : 's'}` : 'all messages';
|
|
5824
|
-
const question = `Are you sure you want to permanently delete ${count} from "${folder.path}"? This cannot be undone. The folder and its subfolders will be kept.`;
|
|
5825
|
-
if (!dialogOnce.claim()) return;
|
|
5826
|
-
let confirmed;
|
|
5827
|
-
try {
|
|
5828
|
-
confirmed = await ask(esc(question), {title: 'Empty Trash?', confirmText: 'Permanently delete', cancelText: 'Cancel'});
|
|
5829
|
-
} finally {
|
|
5830
|
-
dialogOnce.release();
|
|
5831
|
-
}
|
|
5832
|
-
if (!confirmed || !here() || accountId !== currentAccountId) return;
|
|
5833
|
-
try {
|
|
5834
|
-
const params = new URLSearchParams({account: accountId ?? ''});
|
|
5835
|
-
const result = await api(`${BASE}/folders/empty?${params}`, 'POST', {path: folder.path, confirmed: true});
|
|
5836
|
-
if (!here() || accountId !== currentAccountId) return;
|
|
5837
|
-
E.toast(`Permanently deleted ${result.deleted} message${result.deleted === 1 ? '' : 's'} from Trash.`, {type: 'success'});
|
|
5838
|
-
const open = currentFolder;
|
|
5839
|
-
await loadFolders({quiet: true});
|
|
5840
|
-
const shown = folders.find(f => f.path === open);
|
|
5841
|
-
if (here() && accountId === currentAccountId && shown && currentFolder !== open) await selectFolder(shown);
|
|
5842
|
-
} catch (err) {
|
|
5843
|
-
E.toast(err.message || 'Trash could not be emptied.', {type: 'error'});
|
|
5844
|
-
}
|
|
5845
|
-
}
|
|
5846
|
-
|
|
5847
5814
|
/**
|
|
5848
5815
|
* Delete a folder and everything inside it.
|
|
5849
5816
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/reader-view.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Existing CMS entry point for the shared mail view. */
|
|
4
4
|
const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/resizable.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The mail reader's resizable slideovers.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/restore-spam.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Undo restores both junk status and the original folder, following each UID remap. */
|
|
4
4
|
export async function restoreSpam({api, base, account, from, destination, uids, spam}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/scheduling.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/section-kit.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/security-note.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* What the reader says about a signed or encrypted (S/MIME) message.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/settings-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Browser preferences for the shared mail reader. */
|
|
4
4
|
export const READ_DELAY_KEY = 'domma-mail.mark-read-seconds';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/templates.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/threads.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Grouping messages into conversations.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/vacation.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The automatic reply, and everything that must stop it.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/mail/when-closed.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Run code when a Domma modal or slideover actually closes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/admin/ui/dates.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Dates as a plugin shows them to a person: dd/mm/yyyy, and dd/mm/yyyy HH:mm
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/contacts/mailContact.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-contacts.mjs; edit the shared source.
|
|
3
3
|
import {buildContact} from './model.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.29.
|
|
1
|
+
// Source: @domma-mail/core 0.29.1, packages/core/src/contacts/model.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-contacts.mjs; edit the shared source.
|
|
3
3
|
/** Portable CMS contact records. Storage, access checks and identity belong to the host. */
|
|
4
4
|
/**
|