domma-cms 1.66.6 → 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 +12 -0
- package/admin/js/app.js +2 -2
- package/admin/js/lib/chat-toast.js +2 -2
- package/admin/js/lib/collection-editor-arrange.js +2 -2
- package/admin/js/lib/notifications-arrange.js +1 -1
- package/admin/js/templates/collection-editor.html +4 -0
- package/admin/js/templates/contacts.html +1 -1
- package/admin/js/templates/docs/usage-collections.html +5 -0
- package/docs/DommaFeatures.md +3 -1
- package/docs/markdown-shortcodes.md +6 -0
- 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/server/routes/api/collections.js +4 -3
- package/server/routes/api/pages.js +2 -1
- package/server/routes/outreach-public.js +3 -1
- package/server/server.js +5 -0
- package/server/services/collectionAccess.js +29 -1
- package/server/services/collections.js +58 -6
- package/server/services/markdown.js +18 -2
- package/server/services/presetCollections.js +26 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
10
|
+
## [1.66.7] - 2026-11-14
|
|
11
|
+
|
|
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.
|
|
13
|
+
- **Security: the `[collection]` tag asks the collection first.** The tag showed any collection's entries to whoever could write the text - a page, a blog post, a survey's intro, a product description, the page preview. Each collection now has **Show on pages** (Collections, API & Export). It starts on for a collection you made yourself, and off for a Tool's collection, a built-in one and one that holds a form's submissions; a tag for one that is off shows nothing (a preview says why). `scope="mine"` is unchanged. Switch it off for any collection of your own that holds private entries.
|
|
14
|
+
|
|
3
15
|
## [1.66.6] - 2026-11-14
|
|
4
16
|
|
|
5
17
|
- Pictures in Media now show in emails read in webmail. They are sent with `Cross-Origin-Resource-Policy: cross-origin`, so a campaign's or survey's banner and footer no longer arrive as alt text only. Every other response keeps `same-origin`.
|
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,3 +1,3 @@
|
|
|
1
|
-
export const FIELD_TYPES=[{value:"string",label:"Text (single line)"},{value:"email",label:"Email"},{value:"tel",label:"Phone"},{value:"number",label:"Number"},{value:"textarea",label:"Textarea (multi-line)"},{value:"select",label:"Dropdown (select)"},{value:"radio",label:"Radio buttons"},{value:"checkbox",label:"Single checkbox"},{value:"checkbox-group",label:"Checkbox group"},{value:"date",label:"Date"},{value:"time",label:"Time"},{value:"url",label:"URL"},{value:"hidden",label:"Hidden field"},{value:"file",label:"Files (uploaded with a form)"}],OPTION_TYPES=new Set(["select","radio","checkbox-group"]),ADDON_TYPES=new Set(["string","email","tel","number","textarea","select","date","time","url"]);const
|
|
1
|
+
const f=["outreach-contacts","outreach-groups","outreach-unsubscribes"];export const FIELD_TYPES=[{value:"string",label:"Text (single line)"},{value:"email",label:"Email"},{value:"tel",label:"Phone"},{value:"number",label:"Number"},{value:"textarea",label:"Textarea (multi-line)"},{value:"select",label:"Dropdown (select)"},{value:"radio",label:"Radio buttons"},{value:"checkbox",label:"Single checkbox"},{value:"checkbox-group",label:"Checkbox group"},{value:"date",label:"Date"},{value:"time",label:"Time"},{value:"url",label:"URL"},{value:"hidden",label:"Hidden field"},{value:"file",label:"Files (uploaded with a form)"}],OPTION_TYPES=new Set(["select","radio","checkbox-group"]),ADDON_TYPES=new Set(["string","email","tel","number","textarea","select","date","time","url"]);const m=/^[a-z0-9-]+$/i;export const EXTRA_TYPES={clear:new Set(["string","email","tel","url","textarea"]),stepper:new Set(["number"]),counter:new Set(["string","textarea"])};const g=24;function p(e){return e?typeof e=="string"?{icon:"",text:e}:{icon:e.icon||"",text:e.icon?"":String(e.text??"")}:{icon:"",text:""}}export function addonFromBoxes(e,r){const n=String(e??"").trim(),t=String(r??"").trim();return n&&m.test(n)?{icon:n}:t?{text:t.slice(0,g)}:null}export const OPERATIONS=["create","read","update","delete"],EXPORT_FORMATS=["csv","json"],FIELD_NAME_RE=/^[A-Za-z_][A-Za-z0-9_-]*$/;export function slugify(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}export const nameFromLabel=e=>slugify(e).replace(/-/g,"_"),typeLabel=e=>FIELD_TYPES.find(r=>r.value===e)?.label||e||"";export function optionsText(e){return(Array.isArray(e)?e:[]).map(r=>typeof r=="string"?`${r}: ${r}`:`${r?.value??""}: ${r?.label??r?.value??""}`).join(`
|
|
2
2
|
`)}export function parseOptions(e){return String(e??"").split(`
|
|
3
|
-
`).filter(r=>r.trim()).map(r=>{const[n,...t]=r.split(":");return{value:n.trim(),label:t.join(":").trim()||n.trim()}})}const
|
|
3
|
+
`).filter(r=>r.trim()).map(r=>{const[n,...t]=r.split(":");return{value:n.trim(),label:t.join(":").trim()||n.trim()}})}const b=()=>({create:{enabled:!1,access:"admin"},read:{enabled:!0,access:"public"},update:{enabled:!1,access:"admin"},delete:{enabled:!1,access:"admin"}}),x=e=>({enabled:!0,access:e||"",formats:["csv","json"]});export function roleLadder(e){return(Array.isArray(e)?e:e?.entries||[]).map(n=>({name:n?.data?.name,label:n?.data?.label||n?.data?.name,level:Number(n?.data?.level)})).filter(n=>typeof n.name=="string"&&n.name&&Number.isFinite(n.level)).sort((n,t)=>n.level-t.level||n.name.localeCompare(t.name))}export function accessOptions(e,r,{token:n=!0}={}){const t=[{value:"public",label:"Public - anyone"}];n&&t.push({value:"token",label:"API token"});for(const i of[...e||[]].reverse())t.push({value:i.name,label:i.level===0?`${i.label} only`:`${i.label} and above`});return typeof r=="string"&&r&&!t.some(i=>i.value===r)&&t.push(e?.length?{value:r,label:`${r} (role not found)`,missing:!0}:{value:r,label:r}),t}let y=0;export const fieldKey=()=>`f${Date.now().toString(36)}${(y++).toString(36)}`;export function formFromCollection(e=null,{project:r="",defaultRole:n=""}={}){const t=e||{},i={...b(),...t.api||{}},l={...x(n),...t.export||{}},s={title:String(t.title??""),slug:String(t.slug??""),description:String(t.description??""),layout:t.layout==="grid"?"grid":"stacked",columns:String(Number.parseInt(t.columns,10)||2),project:String(t.meta?.project??r??""),bundled:t.bundled===!0,storageAdapter:t.storage?.adapter==="mongodb"?"mongodb":"file",storageConnection:String(t.storage?.connection||"default"),fields:(Array.isArray(t.fields)?t.fields:[]).map(o=>({...o,_key:fieldKey()})),readFields:Array.isArray(i.read?.fields)?i.read.fields.join(", "):"",mineEnabled:i.mine===void 0||i.mine===!0,pagesEnabled:i.pages!==void 0?i.pages===!0:!(t.plugin||t.builtIn||t.systemManaged||t.meta?.generatedFromForm||f.includes(t.slug)),mineLocked:!!t.plugin&&!(i.mine===void 0||i.mine===!0),exportEnabled:l.enabled!==!1,exportAccess:typeof l.access=="string"&&l.access?l.access:String(n||""),exportCsv:(Array.isArray(l.formats)?l.formats:EXPORT_FORMATS).includes("csv"),exportJson:(Array.isArray(l.formats)?l.formats:EXPORT_FORMATS).includes("json")};for(const o of OPERATIONS){s[`${o}Enabled`]=i[o]?.enabled===!0;const a=i[o]?.access;s[`${o}Access`]=typeof a=="string"&&a?a:"admin"}return s}export function cleanField(e){const{_key:r,...n}=e||{};return n}export function payloadFromForm(e,{isNew:r=!1,meta:n={}}={}){const t=e||{},i={};for(const o of OPERATIONS)i[o]={enabled:t[`${o}Enabled`]===!0,access:t[`${o}Access`]||"admin"};const l=String(t.readFields??"").split(",").map(o=>o.trim()).filter(Boolean);l.length&&(i.read.fields=l),i.mine=t.mineLocked?!1:t.mineEnabled!==!1,i.pages=t.pagesEnabled===!0;const s=Math.min(6,Math.max(1,Number.parseInt(t.columns,10)||2));return{title:String(t.title??"").trim(),...r&&{slug:slugify(t.slug||t.title)},description:String(t.description??"").trim(),layout:t.layout==="grid"?"grid":"stacked",columns:s,fields:(t.fields||[]).map(cleanField),api:i,export:{enabled:t.exportEnabled!==!1,...t.exportAccess&&{access:t.exportAccess},formats:EXPORT_FORMATS.filter(o=>o==="csv"?t.exportCsv:t.exportJson)},storage:t.storageAdapter==="mongodb"?{adapter:"mongodb",connection:t.storageConnection||"default"}:{adapter:"file"},meta:{...n||{},project:String(t.project??"")||null},bundled:t.bundled===!0}}export function snapshot(e){const{fields:r=[],...n}=e||{};return JSON.stringify({...n,fields:r.map(cleanField)})}export function checkForm(e,{isNew:r=!1,taken:n=[],original:t={}}={}){const i=e||{},l={};if(String(i.title??"").trim()||(l.title="A collection needs a title."),r){const c=slugify(i.slug||i.title);c?n.includes(c)&&(l.slug=`"${c}" is already a collection.`):l.slug="The slug needs a letter or a number."}const s=Number.parseInt(i.columns,10);i.layout==="grid"&&!(s>=1&&s<=6)&&(l.columns="Between 1 and 6 columns.");const o={},a=new Map;return(i.fields||[]).forEach(c=>{const d=fieldProblem(c,t[c._key]);d&&(o[c._key]=d);const u=String(c.name??"").trim();u&&(a.has(u)?o[c._key]=o[c._key]||`"${u}" is used by another field.`:a.set(u,c._key))}),Object.keys(o).length&&(l.fields=o),i.exportEnabled&&!i.exportCsv&&!i.exportJson&&(l.export="Pick at least one export format, or turn export off."),l}export function fieldProblem(e,r){const n=String(e?.name??"").trim();return n?n!==r&&!FIELD_NAME_RE.test(n)?"Names start with a letter or _, then letters, digits, _ or -.":OPTION_TYPES.has(e.type)&&!(Array.isArray(e.options)&&e.options.length)?`A ${typeLabel(e.type).toLowerCase()} needs at least one option.`:"":"A field needs a name - it is what each entry is keyed by."}export const errorCount=e=>Object.keys(e||{}).filter(r=>r!=="fields").length+Object.keys(e?.fields||{}).length;export function fieldRow(e,r={},{grid:n=!1}={}){const t=[e.name||"(no name)",typeLabel(e.type)];return OPTION_TYPES.has(e.type)&&t.push(`${(e.options||[]).length} options`),n&&t.push(e.fullWidth?"full width":`span ${e.span>1?e.span:1}`),{key:e._key,label:e.label||"(Untitled field)",meta:t.join(" \xB7 "),required:e.required===!0,hidden:e.type==="hidden",notInLists:e.listHidden===!0&&e.type!=="hidden",problem:r[e._key]||"",rowCls:r[e._key]?"is-bad":""}}export function moveField(e,r,n){const t=[...e];if(r<0||r>=t.length||n<0||n>=t.length||r===n)return t;const[i]=t.splice(r,1);return t.splice(n,0,i),t}export function duplicateField(e,r){const n=e[r];if(!n)return[...e];const t=new Set(e.map(a=>a.name)),i=`${n.name||"field"}_copy`;let l=i;for(let a=2;t.has(l);a++)l=`${i}_${a}`;const s={...JSON.parse(JSON.stringify(cleanField(n))),name:l,label:`${n.label||"Field"} (copy)`,_key:fieldKey()};delete s.id;const o=[...e];return o.splice(r+1,0,s),o}export const newField=()=>({id:`field-${Date.now()}`,name:"",label:"",type:"string",required:!1,placeholder:"",helper:"",options:[],validation:[],logic:null,_key:fieldKey()});export function panelForm(e){return{label:String(e.label??""),name:String(e.name??""),type:e.type||"string",required:e.required===!0,placeholder:String(e.placeholder??""),helper:String(e.helper??""),options:optionsText(e.options),span:String(e.span>1?e.span:1),fullWidth:e.fullWidth===!0,prefixIcon:p(e.prefix).icon,prefixText:p(e.prefix).text,suffixIcon:p(e.suffix).icon,suffixText:p(e.suffix).text,clear:e.clear===!0,stepper:e.stepper===!0,counter:e.counter===!0,inLists:e.listHidden!==!0}}export function fieldFromPanel(e,r){const n={...e,label:String(r.label??"").trim(),name:String(r.name??"").trim(),type:r.type||"string",required:r.required===!0,placeholder:String(r.placeholder??"").trim(),helper:String(r.helper??"").trim()};OPTION_TYPES.has(n.type)&&(n.options=parseOptions(r.options)),"inLists"in r&&(r.inLists===!1?n.listHidden=!0:delete n.listHidden);for(const[t,i]of Object.entries(EXTRA_TYPES)){if(!i.has(n.type)){delete n[t];continue}t in r&&(r[t]===!0?n[t]=!0:delete n[t])}for(const t of["prefix","suffix"]){const i=`${t}Icon`in r||`${t}Text`in r;if(!ADDON_TYPES.has(n.type)){delete n[t];continue}if(!i)continue;const l=addonFromBoxes(r[`${t}Icon`],r[`${t}Text`]);l?n[t]=l:delete n[t]}if(r.fullWidth)n.fullWidth=!0,delete n.span;else{delete n.fullWidth;const t=Number.parseInt(r.span,10);t>1?n.span=Math.min(6,t):delete n.span}return n}export function storageChange(e,r){const n=e||"file",t=r||"file";return n===t?"":`${n} \u2192 ${t}`}export function draftOf(e){const{fields:r=[],...n}=e||{};return{...n,fields:r.map(cleanField)}}export function formFromDraft(e,r){const n=e||{};return{...r,...n,fields:(Array.isArray(n.fields)?n.fields:r.fields).map(t=>({...cleanField(t),_key:fieldKey()}))}}
|
|
@@ -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"}}}
|
|
@@ -114,6 +114,10 @@
|
|
|
114
114
|
<label class="cex-check"><input type="checkbox" data-model="mineEnabled.value" data-bind-disabled="mineLocked.value"> Users can read their own entries (scope=mine)
|
|
115
115
|
<span data-help-title="Their own entries" data-help="A signed-in user may read the entries they created - [collection scope="mine"] and ?scope=mine - even when Read is off. Turn this off when entries hold something their creator must not see."></span></label>
|
|
116
116
|
</div>
|
|
117
|
+
<div class="cex-op cex-op-sub">
|
|
118
|
+
<label class="cex-check"><input type="checkbox" data-model="pagesEnabled.value"> Show on pages ([collection] tag)
|
|
119
|
+
<span data-help-title="Show on pages" data-help="Lets the [collection] tag show these entries on a page, a blog post or any other text that takes tags. Anyone who can write that text decides what visitors see, so leave this off for entries that are private - enquiries, orders, people's details. It is off to begin with for a Tool's collection, a built-in one and one that holds a form's submissions. Read (above) is separate: it is for the API."></span></label>
|
|
120
|
+
</div>
|
|
117
121
|
<div class="cex-op"><strong>Update</strong>
|
|
118
122
|
<label class="cex-check"><input type="checkbox" data-model="updateEnabled.value"> Allowed</label>
|
|
119
123
|
<select class="form-input" aria-label="Who may update" data-model="updateAccess.value" data-bind-disabled="!updateEnabled.value"></select></div>
|
|
@@ -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 {{…}}.
|
|
@@ -84,6 +84,11 @@
|
|
|
84
84
|
delete entries.</li>
|
|
85
85
|
<li>On pages, a <code>[collection]</code> shows its entries to anyone who can open the page -
|
|
86
86
|
gate the page, or use <code>scope="mine"</code> or a View with a row-level rule.</li>
|
|
87
|
+
<li><strong>Show on pages</strong> (API & Export) decides whether <code>[collection]</code> may
|
|
88
|
+
show a collection at all. It is on for a collection you made, and off for a Tool's collection,
|
|
89
|
+
a built-in one and one that holds a form's submissions. Anyone who can write a page, a blog
|
|
90
|
+
post or other text that takes tags could otherwise put those entries on the site - so switch
|
|
91
|
+
it off for any collection of your own that holds private entries.</li>
|
|
87
92
|
<li>Through the API, the API & Export tab decides: Public, Token (an API token), or signed-in
|
|
88
93
|
users with a role and above. A role the site does not have admits only the level-0
|
|
89
94
|
role.</li>
|
package/docs/DommaFeatures.md
CHANGED
|
@@ -666,6 +666,8 @@ Where: `server/services/presetCollections.js` (`PRESETS`, `seedAll()`), `server/
|
|
|
666
666
|
- **Eight display types**: `table` (the default, a Domma Table with search, sort, paging and column chooser), `cards`, `list`, `accordion`, `timeline`, `carousel`, `listgroup`, `block` (each entry rendered through a reusable block template).
|
|
667
667
|
Since: 0.14.3 (`timeline`), 0.38.0 (`carousel`, `listgroup`); see [Feature history](#feature-history).
|
|
668
668
|
Where: server-side rendering in `server/services/markdown.js`; browser behaviour in `public/js/site.js`, `collection-context.js` and `collection-browser.js`.
|
|
669
|
+
- **Show on pages** (`api.pages`, unreleased): `[collection]` reads entries with no viewer check, so the collection decides whether it may be shown. Absent, it is on for a content collection and off for a Tool's (`plugin`), a built-in (known by name: `BUILT_IN_SLUGS`; or `systemManaged`), a form's submissions (`meta.generatedFromForm`) and the outreach lists; `true`/`false` is the site's choice (Collections, API & Export). A refused tag renders nothing, or a note in a preview. `scope="mine"` is governed by `api.mine`, not this.
|
|
670
|
+
Where: `pagesAllowed()` in `server/services/collectionAccess.js`, applied in `processCollectionBlocks()`; the editor mirrors the rule in `admin/js/lib/collection-editor-arrange.js`.
|
|
669
671
|
- **Common attributes**:
|
|
670
672
|
- `slug` (required)
|
|
671
673
|
- `display`
|
|
@@ -980,7 +982,7 @@ Where: `server/services/presetCollections.js` (`PRESETS`, `seedAll()`), `server/
|
|
|
980
982
|
- a role name (a signed-in user at that level or above)
|
|
981
983
|
- `token` (a project API token)
|
|
982
984
|
|
|
983
|
-
A default collection allows public read and nothing else. `api.read.fields` limits which fields reads return. Admin screens are never governed by these settings.
|
|
985
|
+
A default collection allows public read and nothing else; a collection a Tool makes (`plugin` set) allows nothing unless its schema says so (unreleased - before that, Tools' collections made with no `api` block were readable by anyone; `closeToolCollections()` closes those once at boot and marks them `apiDefault: 'closed'`, after which the site's own choice is kept). `api.read.fields` limits which fields reads return. Admin screens are never governed by these settings.
|
|
984
986
|
- **A role the site does not have admits only the level-0 role** (0.92.1), on `/api/v1`, the public collection route and API Builder endpoints alike; the same for a collection's export access. Before 0.92.1 an unknown role came out as the lowest level, which every signed-in user met. The editor lists the site's real roles ("User and above") and marks a stale one "manager (role not found)" with a note instead of quietly swapping it.
|
|
985
987
|
Where: collection editor **API & Export** tab; `schema.api`.
|
|
986
988
|
- **`/api/v1` external REST**. A stable, versioned alias of the public collection endpoints.
|
|
@@ -1049,6 +1049,12 @@ The form's own CSS classes (set in the form builder: Settings, Submit Button and
|
|
|
1049
1049
|
Self-closing. Renders a CMS collection inline on a public page. Supports table, cards, list, accordion, timeline, and
|
|
1050
1050
|
block display modes, with structured filtering and per-user scoping.
|
|
1051
1051
|
|
|
1052
|
+
The collection must be set to **Show on pages** (Collections, API & Export - `api.pages` in its schema). That is on for a
|
|
1053
|
+
collection made to hold content, and off until switched on for a Tool's collection, a built-in one and one that holds a
|
|
1054
|
+
form's submissions: the tag reads entries for whoever wrote the text, so the collection decides whether it may be shown at
|
|
1055
|
+
all. A tag for a collection that is off renders nothing (a preview shows a note saying why). `scope="mine"` is not
|
|
1056
|
+
affected - it shows a signed-in visitor their own entries, and `api.mine` governs it.
|
|
1057
|
+
|
|
1052
1058
|
```
|
|
1053
1059
|
[collection slug="enquiries" display="table" /]
|
|
1054
1060
|
[collection slug="team" display="cards" columns="3" title-field="name" /]
|
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.
|