domma-cms 1.66.8 → 1.66.10
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 +14 -0
- package/admin/css/admin.css +1 -1
- package/admin/js/app.js +2 -2
- package/admin/js/lib/page-editor-reference.js +1 -1
- package/admin/js/templates/docs/usage-shortcodes-components.html +366 -0
- package/admin/js/templates/docs/usage-shortcodes-content.html +550 -0
- package/admin/js/templates/docs/usage-shortcodes-data.html +469 -0
- package/admin/js/templates/docs/usage-shortcodes-effects.html +897 -0
- package/admin/js/templates/docs/usage-shortcodes-layout.html +732 -0
- package/admin/js/templates/docs/usage-shortcodes.html +82 -0
- package/admin/js/templates/documentation.html +20 -0
- package/admin/js/templates/effects.html +1 -1
- package/admin/js/views/doc-pages.js +1 -1
- package/admin/js/views/index.js +1 -1
- package/docs/markdown-shortcodes.md +15 -10
- package/package.json +1 -1
- package/public/css/site.css +1 -1
- package/public/js/effects.js +1 -1
- package/server/server.js +5 -0
- package/server/services/docs.js +5 -0
- package/server/services/markdown.js +104 -34
- package/server/templates/page.html +2 -2
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 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=`
|
|
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 Dt,isConfined as yt,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 Ut}from"./lib/ai-assist.js";import{onPresence as Lt,setAvailable as Z,startPresence as Tt,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=U[t]||At(l,t);return n||(!u&&o==="/system/notifications"?l?.home||"/":(t.split("?")[0]||"/")==="/"&&p&&p!=="/"&&!Vt()?U[p]||p:null)}function I(){document.body.classList.toggle(Dt,yt(l))}const U={},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 D(){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",()=>{D()});let T=null,x=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(H(r),T){x=!0;return}T=(async()=>{do{x=!1;try{await B(await D())}catch{}}while(x)})().finally(()=>{T=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/shortcodes-layout",view:"usageShortcodesLayout",title:"Layout shortcodes - Usage - Domma CMS"},{path:"/docs/usage/shortcodes-components",view:"usageShortcodesComponents",title:"Component shortcodes - Usage - Domma CMS"},{path:"/docs/usage/shortcodes-content",view:"usageShortcodesContent",title:"Content shortcodes - Usage - Domma CMS"},{path:"/docs/usage/shortcodes-data",view:"usageShortcodesData",title:"Data shortcodes - Usage - Domma CMS"},{path:"/docs/usage/shortcodes-effects",view:"usageShortcodesEffects",title:"Effect 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 D(),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 y=dt(),z=y.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))y.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 y.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),Ut(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];y.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&&(U[`/${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: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;
|
|
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;Tt({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?D():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}})})()});
|
|
@@ -97,7 +97,7 @@ Body content here.
|
|
|
97
97
|
[/card]`,"Use [header] and [footer] sub-tags for Markdown-rendered header/footer regions. Sub-tags override the title/subtitle/icon and footer attributes when both are present.")]}),t("Badge",{intro:"Inline badge/label elements. Self-closing renders an empty coloured dot.",rows:[['variant="..."',"primary (default), secondary, success, danger, warning, info, light, dark"],["pill","Flag: rounded pill shape (.badge-pill)"],["outline","Flag: outlined style (.badge-outline)"],['size="small|large"',"Reduced or enlarged badge"]],examples:[e("Basic badge",'[badge variant="success"]New[/badge]'),e("Pill outline badge",'[badge variant="danger" outline pill]Deprecated[/badge]')]}),t("Button",{intro:"Renders a styled anchor as a Domma button. Use the Insert \u2192 Button toolbar item for a guided dialog.",rows:[['href="..."',"Link destination (required)"],['label="..."',"Button text (self-closing form)"],['variant="..."',"primary (default), secondary, success, danger, warning, info, outline, ghost, link, outline-*"],['size="sm|lg"',"Button size modifier"],['icon="..."',"Domma icon name before the label"],['icon-after="..."',"Domma icon name after the label"],['target="..."','Link target, e.g. "_blank"'],['class="..."',"Extra CSS classes"],['id="..."',"Element id"]],examples:[e("Primary button",'[button href="/contact" variant="primary"]Get in touch[/button]'),e("Self-closing with icon",'[button href="/download" variant="success" icon="download" size="sm" label="Download" /]'),e("Opens in new tab",'[button href="https://example.com" variant="outline" target="_blank"]Visit site[/button]')]}),t("Link (shortcode)",{intro:"Renders a plain anchor with optional icon, target, and class. Use Insert \u2192 Link for a guided dialog. For simple inline links, standard Markdown [text](url) is fine.",rows:[['href="..."',"Link destination (required)"],['label="..."',"Link text (self-closing form)"],['target="..."','Link target, e.g. "_blank"'],['class="..."',"CSS classes on the <a>"],['icon="..."',"Domma icon name before the text"],['icon-after="..."',"Domma icon name after the text"],['id="..."',"Element id"]],examples:[e("External link in new tab",'[link href="https://example.com" target="_blank" icon-after="external-link"]Visit site[/link]'),e("Self-closing with icon",'[link href="/about" icon="arrow-right" label="About us" /]')]}),t("Icon",{intro:"Self-closing shortcode that renders any Domma icon inline.",rows:[['name="..."',"Domma icon name (required). Also accepted as src=."],['size="N"',"Width and height in px"],['color="..."',"CSS colour applied via style"],['class="..."',"Extra CSS classes"]],examples:[e("Coloured icon",'[icon name="star" size="24" color="#f5a623" /]')]}),t("Interactive Components",{intro:"Tabs, accordion, carousel, and countdown - no plugin required.",examples:[e("Tabs",`[tabs]
|
|
98
98
|
[tab title="First"]Content **A**[/tab]
|
|
99
99
|
[tab title="Second"]Content **B**[/tab]
|
|
100
|
-
[/tabs]`,'Add style="pills"
|
|
100
|
+
[/tabs]`,'Add style="pills" or style="bordered", and align="center" or align="right".'),e("Accordion",`[accordion]
|
|
101
101
|
[item title="Question 1"]Answer here.[/item]
|
|
102
102
|
[item title="Question 2"]Answer here.[/item]
|
|
103
103
|
[/accordion]`,'Add multiple="true" to allow several panels open at once.'),e("Accordion - collection-bound",'[collection slug="faq" display="accordion" title-field="title" body-field="description" /]',"Renders collection entries as accordion items. Use Insert \u2192 Accordion for a guided dialog."),e("Carousel",`[carousel autoplay="true" interval="5000"]
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
<div class="view-header">
|
|
2
|
+
<h1><span data-icon="layers"></span> Component shortcodes</h1>
|
|
3
|
+
<a href="#/docs/usage/shortcodes" class="btn btn-ghost btn-sm"><span data-icon="arrow-left"></span> Shortcodes</a>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-12">
|
|
8
|
+
<div class="docs-body">
|
|
9
|
+
|
|
10
|
+
<p>These shortcodes add the moving parts of a page: tabs, accordions, carousels, timelines, lists, tables, notices and countdowns. Each one has its own section below, with an example to copy and every attribute it takes.</p>
|
|
11
|
+
<p>Most of them are a pair of tags with smaller tags inside - <code>[tabs]</code> holds <code>[tab]</code>s, <code>[accordion]</code> holds <code>[item]</code>s. Markdown, cards, grids, buttons and pictures all work inside them.</p>
|
|
12
|
+
<h3 id="sc-tabs"><code>tabs</code> and <code>tab</code> - tabbed panels</h3>
|
|
13
|
+
<p>Several panels in the same space, one shown at a time.</p>
|
|
14
|
+
<pre><code>[tabs style="pills"]
|
|
15
|
+
[tab title="Overview" icon="info"]What it is.[/tab]
|
|
16
|
+
[tab title="Pricing"]What it costs.[/tab]
|
|
17
|
+
[tab title="Reviews"]What people say.[/tab]
|
|
18
|
+
[/tabs]
|
|
19
|
+
</code></pre>
|
|
20
|
+
<table class="table table-sm">
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Tag</th>
|
|
24
|
+
<th>Attribute</th>
|
|
25
|
+
<th>What it does</th>
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<tbody><tr>
|
|
29
|
+
<td><code>[tabs]</code></td>
|
|
30
|
+
<td><code>style</code></td>
|
|
31
|
+
<td><code>pills</code> for rounded buttons, or <code>bordered</code> to put the tabs and their panel in one box. Without it, tabs are underlined</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td><code>[tabs]</code></td>
|
|
35
|
+
<td><code>align</code></td>
|
|
36
|
+
<td><code>center</code> centres the tabs, <code>right</code> puts them at the right</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td><code>[tabs]</code></td>
|
|
40
|
+
<td><code>id</code></td>
|
|
41
|
+
<td>Your own id</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td><code>[tab]</code></td>
|
|
45
|
+
<td><code>title</code></td>
|
|
46
|
+
<td>The words on the tab</td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<td><code>[tab]</code></td>
|
|
50
|
+
<td><code>icon</code></td>
|
|
51
|
+
<td>An icon before the title</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</tbody></table>
|
|
54
|
+
<h3 id="sc-accordion"><code>accordion</code> and <code>item</code> - headings that open</h3>
|
|
55
|
+
<p>A stack of headings that open to show their content. Good for questions and answers.</p>
|
|
56
|
+
<pre><code>[accordion]
|
|
57
|
+
[item title="Do you deliver?"]Yes, Monday to Saturday.[/item]
|
|
58
|
+
[item title="Can I return an order?"]Within 30 days.[/item]
|
|
59
|
+
[/accordion]
|
|
60
|
+
</code></pre>
|
|
61
|
+
<table class="table table-sm">
|
|
62
|
+
<thead>
|
|
63
|
+
<tr>
|
|
64
|
+
<th>Tag</th>
|
|
65
|
+
<th>Attribute</th>
|
|
66
|
+
<th>What it does</th>
|
|
67
|
+
</tr>
|
|
68
|
+
</thead>
|
|
69
|
+
<tbody><tr>
|
|
70
|
+
<td><code>[accordion]</code></td>
|
|
71
|
+
<td><code>multiple</code></td>
|
|
72
|
+
<td><code>true</code> lets several items stay open at once. Otherwise opening one closes the others</td>
|
|
73
|
+
</tr>
|
|
74
|
+
<tr>
|
|
75
|
+
<td><code>[accordion]</code></td>
|
|
76
|
+
<td><code>id</code></td>
|
|
77
|
+
<td>Your own id</td>
|
|
78
|
+
</tr>
|
|
79
|
+
<tr>
|
|
80
|
+
<td><code>[item]</code></td>
|
|
81
|
+
<td><code>title</code></td>
|
|
82
|
+
<td>The heading that is clicked</td>
|
|
83
|
+
</tr>
|
|
84
|
+
</tbody></table>
|
|
85
|
+
<h3 id="sc-carousel"><code>carousel</code> and <code>slide</code> - a slideshow</h3>
|
|
86
|
+
<p>Slides shown one at a time, with arrows to move between them.</p>
|
|
87
|
+
<pre><code>[carousel autoplay="true" interval="5000" animation="fade"]
|
|
88
|
+
[slide title="Spring" image="/media/spring.jpg"]New season, new range.[/slide]
|
|
89
|
+
[slide title="Summer" image="/media/summer.jpg"]Now in stock.[/slide]
|
|
90
|
+
[slide title="A slide of text"]No picture needed.[/slide]
|
|
91
|
+
[/carousel]
|
|
92
|
+
</code></pre>
|
|
93
|
+
<table class="table table-sm">
|
|
94
|
+
<thead>
|
|
95
|
+
<tr>
|
|
96
|
+
<th>Tag</th>
|
|
97
|
+
<th>Attribute</th>
|
|
98
|
+
<th>What it does</th>
|
|
99
|
+
</tr>
|
|
100
|
+
</thead>
|
|
101
|
+
<tbody><tr>
|
|
102
|
+
<td><code>[carousel]</code></td>
|
|
103
|
+
<td><code>autoplay</code></td>
|
|
104
|
+
<td><code>true</code> moves on by itself</td>
|
|
105
|
+
</tr>
|
|
106
|
+
<tr>
|
|
107
|
+
<td><code>[carousel]</code></td>
|
|
108
|
+
<td><code>interval</code></td>
|
|
109
|
+
<td>How long each slide stays, in milliseconds</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td><code>[carousel]</code></td>
|
|
113
|
+
<td><code>loop</code></td>
|
|
114
|
+
<td><code>false</code> stops at the last slide. Otherwise it goes round again</td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr>
|
|
117
|
+
<td><code>[carousel]</code></td>
|
|
118
|
+
<td><code>animation</code></td>
|
|
119
|
+
<td><code>slide</code>, <code>fade</code> or <code>crossfade</code> (the two slides overlap for a smoother change)</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td><code>[carousel]</code></td>
|
|
123
|
+
<td><code>animation-duration</code></td>
|
|
124
|
+
<td>How long the change takes, in milliseconds (default 500)</td>
|
|
125
|
+
</tr>
|
|
126
|
+
<tr>
|
|
127
|
+
<td><code>[carousel]</code></td>
|
|
128
|
+
<td><code>animation-easing</code></td>
|
|
129
|
+
<td>The pace of the change: <code>ease</code>, <code>linear</code>, <code>ease-in-out</code></td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td><code>[carousel]</code></td>
|
|
133
|
+
<td><code>height</code></td>
|
|
134
|
+
<td>A fixed height in pixels</td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<td><code>[carousel]</code></td>
|
|
138
|
+
<td><code>height-mode</code></td>
|
|
139
|
+
<td>With pictures of different shapes: <code>crop</code> (every slide as tall as the shortest picture, the default) or <code>average</code></td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td><code>[carousel]</code></td>
|
|
143
|
+
<td><code>arrow-position</code></td>
|
|
144
|
+
<td><code>top</code>, <code>middle</code> (default) or <code>bottom</code></td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr>
|
|
147
|
+
<td><code>[carousel]</code></td>
|
|
148
|
+
<td><code>background</code>, <code>arrow-background</code>, <code>arrow-color</code></td>
|
|
149
|
+
<td>Colours for the carousel and its arrows: a CSS colour or a theme name such as <code>primary</code> or <code>surface</code></td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td><code>[carousel]</code></td>
|
|
153
|
+
<td><code>id</code></td>
|
|
154
|
+
<td>Your own id</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td><code>[slide]</code></td>
|
|
158
|
+
<td><code>title</code></td>
|
|
159
|
+
<td>The slide's heading</td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td><code>[slide]</code></td>
|
|
163
|
+
<td><code>image</code></td>
|
|
164
|
+
<td>The slide's picture</td>
|
|
165
|
+
</tr>
|
|
166
|
+
</tbody></table>
|
|
167
|
+
<p>In the page editor, the picture button beside each slide chooses a picture from Media or uploads one.</p>
|
|
168
|
+
<h3 id="sc-timeline"><code>timeline</code> and <code>event</code> - events in order</h3>
|
|
169
|
+
<p>Events in order, each with a date and a status. Also draws a roadmap.</p>
|
|
170
|
+
<pre><code>[timeline layout="vertical" theme="modern"]
|
|
171
|
+
[event title="Launch" date="2025-01-15" status="completed"]
|
|
172
|
+
We opened the doors.
|
|
173
|
+
[/event]
|
|
174
|
+
[event title="Second shop" date="2026-06-01" status="planned"]
|
|
175
|
+
Opening in Leeds.
|
|
176
|
+
[/event]
|
|
177
|
+
[/timeline]
|
|
178
|
+
</code></pre>
|
|
179
|
+
<table class="table table-sm">
|
|
180
|
+
<thead>
|
|
181
|
+
<tr>
|
|
182
|
+
<th>Tag</th>
|
|
183
|
+
<th>Attribute</th>
|
|
184
|
+
<th>What it does</th>
|
|
185
|
+
</tr>
|
|
186
|
+
</thead>
|
|
187
|
+
<tbody><tr>
|
|
188
|
+
<td><code>[timeline]</code></td>
|
|
189
|
+
<td><code>layout</code></td>
|
|
190
|
+
<td><code>vertical</code>, <code>centred</code> or <code>horizontal</code></td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td><code>[timeline]</code></td>
|
|
194
|
+
<td><code>theme</code></td>
|
|
195
|
+
<td><code>minimal</code>, <code>corporate</code> or <code>modern</code></td>
|
|
196
|
+
</tr>
|
|
197
|
+
<tr>
|
|
198
|
+
<td><code>[timeline]</code></td>
|
|
199
|
+
<td><code>mode</code></td>
|
|
200
|
+
<td><code>timeline</code> or <code>roadmap</code></td>
|
|
201
|
+
</tr>
|
|
202
|
+
<tr>
|
|
203
|
+
<td><code>[timeline]</code></td>
|
|
204
|
+
<td><code>class</code>, <code>id</code></td>
|
|
205
|
+
<td>Your own CSS class or id</td>
|
|
206
|
+
</tr>
|
|
207
|
+
<tr>
|
|
208
|
+
<td><code>[event]</code></td>
|
|
209
|
+
<td><code>title</code></td>
|
|
210
|
+
<td>The event's name</td>
|
|
211
|
+
</tr>
|
|
212
|
+
<tr>
|
|
213
|
+
<td><code>[event]</code></td>
|
|
214
|
+
<td><code>date</code></td>
|
|
215
|
+
<td>When it happened or will happen</td>
|
|
216
|
+
</tr>
|
|
217
|
+
<tr>
|
|
218
|
+
<td><code>[event]</code></td>
|
|
219
|
+
<td><code>status</code></td>
|
|
220
|
+
<td><code>planned</code>, <code>in-progress</code>, <code>completed</code> or <code>blocked</code>. The marker shows the status</td>
|
|
221
|
+
</tr>
|
|
222
|
+
</tbody></table>
|
|
223
|
+
<h3 id="sc-listgroup"><code>listgroup</code> and <code>item</code> - a bordered list</h3>
|
|
224
|
+
<p>A tidy bordered list.</p>
|
|
225
|
+
<pre><code>[listgroup variant="flush" size="sm"]
|
|
226
|
+
[item]**Free** delivery over £30[/item]
|
|
227
|
+
[item]Returns within 30 days[/item]
|
|
228
|
+
[item]See our [delivery page](/delivery)[/item]
|
|
229
|
+
[/listgroup]
|
|
230
|
+
</code></pre>
|
|
231
|
+
<table class="table table-sm">
|
|
232
|
+
<thead>
|
|
233
|
+
<tr>
|
|
234
|
+
<th>Attribute</th>
|
|
235
|
+
<th>What it does</th>
|
|
236
|
+
</tr>
|
|
237
|
+
</thead>
|
|
238
|
+
<tbody><tr>
|
|
239
|
+
<td><code>variant</code></td>
|
|
240
|
+
<td><code>flush</code> (no outer border), <code>numbered</code> or <code>horizontal</code></td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td><code>size</code></td>
|
|
244
|
+
<td><code>sm</code> or <code>lg</code></td>
|
|
245
|
+
</tr>
|
|
246
|
+
<tr>
|
|
247
|
+
<td><code>itemvariant</code></td>
|
|
248
|
+
<td>Colours every item: <code>primary</code>, <code>secondary</code>, <code>success</code>, <code>danger</code>, <code>warning</code> or <code>info</code></td>
|
|
249
|
+
</tr>
|
|
250
|
+
<tr>
|
|
251
|
+
<td><code>action</code></td>
|
|
252
|
+
<td><code>true</code> highlights an item under the pointer</td>
|
|
253
|
+
</tr>
|
|
254
|
+
</tbody></table>
|
|
255
|
+
<p><code>[item]</code> takes no attributes. Its text can use bold, italics and links.</p>
|
|
256
|
+
<h3 id="sc-table"><code>table</code> - a styled table</h3>
|
|
257
|
+
<p>Wraps a Markdown table to give it the site's table styling, and lets it scroll sideways on a phone instead of breaking the page.</p>
|
|
258
|
+
<pre><code>[table striped="true" caption="Prices from March"]
|
|
259
|
+
| Plan | Monthly |
|
|
260
|
+
| ------- | ------: |
|
|
261
|
+
| Starter | £9 |
|
|
262
|
+
| Team | £29 |
|
|
263
|
+
[/table]
|
|
264
|
+
</code></pre>
|
|
265
|
+
<table class="table table-sm">
|
|
266
|
+
<thead>
|
|
267
|
+
<tr>
|
|
268
|
+
<th>Attribute</th>
|
|
269
|
+
<th>What it does</th>
|
|
270
|
+
</tr>
|
|
271
|
+
</thead>
|
|
272
|
+
<tbody><tr>
|
|
273
|
+
<td><code>striped</code></td>
|
|
274
|
+
<td><code>true</code> shades every other row</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td><code>bordered</code></td>
|
|
278
|
+
<td><code>true</code> draws lines around every cell</td>
|
|
279
|
+
</tr>
|
|
280
|
+
<tr>
|
|
281
|
+
<td><code>compact</code></td>
|
|
282
|
+
<td><code>true</code> tightens the rows</td>
|
|
283
|
+
</tr>
|
|
284
|
+
<tr>
|
|
285
|
+
<td><code>caption</code></td>
|
|
286
|
+
<td>A title for the table</td>
|
|
287
|
+
</tr>
|
|
288
|
+
<tr>
|
|
289
|
+
<td><code>class</code>, <code>id</code></td>
|
|
290
|
+
<td>Your own CSS class or id</td>
|
|
291
|
+
</tr>
|
|
292
|
+
</tbody></table>
|
|
293
|
+
<p>To show the entries of a collection as a table, use <code>[collection]</code> instead - see <a href="#/docs/usage/shortcodes-data">Data shortcodes</a>.</p>
|
|
294
|
+
<h3 id="sc-banner"><code>banner</code> - a notice</h3>
|
|
295
|
+
<p>A coloured notice across the page: a warning, a piece of good news, an announcement.</p>
|
|
296
|
+
<pre><code>[banner type="warning" title="Maintenance" icon="alert-triangle" dismissible]
|
|
297
|
+
The site will be read-only on **Sunday** from 8am.
|
|
298
|
+
[/banner]
|
|
299
|
+
</code></pre>
|
|
300
|
+
<table class="table table-sm">
|
|
301
|
+
<thead>
|
|
302
|
+
<tr>
|
|
303
|
+
<th>Attribute</th>
|
|
304
|
+
<th>What it does</th>
|
|
305
|
+
</tr>
|
|
306
|
+
</thead>
|
|
307
|
+
<tbody><tr>
|
|
308
|
+
<td><code>type</code></td>
|
|
309
|
+
<td><code>info</code> (default), <code>success</code>, <code>warning</code>, <code>danger</code> or <code>neutral</code></td>
|
|
310
|
+
</tr>
|
|
311
|
+
<tr>
|
|
312
|
+
<td><code>title</code></td>
|
|
313
|
+
<td>A bold title above the text</td>
|
|
314
|
+
</tr>
|
|
315
|
+
<tr>
|
|
316
|
+
<td><code>icon</code></td>
|
|
317
|
+
<td>An icon at the left</td>
|
|
318
|
+
</tr>
|
|
319
|
+
<tr>
|
|
320
|
+
<td><code>dismissible</code></td>
|
|
321
|
+
<td>Switch: adds a close button</td>
|
|
322
|
+
</tr>
|
|
323
|
+
<tr>
|
|
324
|
+
<td><code>class</code></td>
|
|
325
|
+
<td>Your own CSS class</td>
|
|
326
|
+
</tr>
|
|
327
|
+
</tbody></table>
|
|
328
|
+
<p>Good to know:</p>
|
|
329
|
+
<ul>
|
|
330
|
+
<li>A banner can go inside a card, box, column, tab or accordion item.</li>
|
|
331
|
+
<li>To show a banner only until a date, add <code>expires-at</code> - see "Showing a shortcode for a limited time" in <a href="#/docs/usage/shortcodes">Shortcodes</a>.</li>
|
|
332
|
+
<li>A banner takes the effects <code>reveal</code>, <code>pulse</code>, <code>shake</code>, <code>animate</code> and <code>ambient</code> as switches.</li>
|
|
333
|
+
</ul>
|
|
334
|
+
<h3 id="sc-countdown"><code>countdown</code> - a countdown clock</h3>
|
|
335
|
+
<p>A clock counting down to a date, or for a number of seconds.</p>
|
|
336
|
+
<pre><code>[countdown to="2026-12-31" format="DD:HH:mm:ss" /]
|
|
337
|
+
[countdown duration="300" format="mm:ss" /]
|
|
338
|
+
</code></pre>
|
|
339
|
+
<table class="table table-sm">
|
|
340
|
+
<thead>
|
|
341
|
+
<tr>
|
|
342
|
+
<th>Attribute</th>
|
|
343
|
+
<th>What it does</th>
|
|
344
|
+
</tr>
|
|
345
|
+
</thead>
|
|
346
|
+
<tbody><tr>
|
|
347
|
+
<td><code>to</code></td>
|
|
348
|
+
<td>The date to count down to, such as <code>2026-12-31</code> or <code>2026-12-31T18:00</code></td>
|
|
349
|
+
</tr>
|
|
350
|
+
<tr>
|
|
351
|
+
<td><code>duration</code></td>
|
|
352
|
+
<td>Instead of a date: how many seconds to count</td>
|
|
353
|
+
</tr>
|
|
354
|
+
<tr>
|
|
355
|
+
<td><code>format</code></td>
|
|
356
|
+
<td><code>mm:ss</code>, <code>HH:mm:ss</code> or <code>DD:HH:mm:ss</code></td>
|
|
357
|
+
</tr>
|
|
358
|
+
<tr>
|
|
359
|
+
<td><code>id</code></td>
|
|
360
|
+
<td>Your own id</td>
|
|
361
|
+
</tr>
|
|
362
|
+
</tbody></table>
|
|
363
|
+
|
|
364
|
+
</div>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|