domma-cms 1.27.3 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/CLAUDE.md +2 -2
- package/admin/js/app.js +4 -4
- package/admin/js/lib/chats-arrange.js +2 -0
- package/admin/js/lib/launchers-arrange.js +2 -0
- package/admin/js/lib/menu-item-help.js +1 -1
- package/admin/js/lib/page-image-hosts.js +2 -2
- package/admin/js/lib/shortcode-form.js +6 -6
- package/admin/js/lib/shortcode-registry.js +1 -1
- package/admin/js/templates/chat-knowledge.html +96 -0
- package/admin/js/templates/chats.html +146 -0
- package/admin/js/templates/docs/usage-chat.html +96 -0
- package/admin/js/templates/docs/usage-launchers.html +83 -0
- package/admin/js/templates/docs/usage-media.html +14 -0
- package/admin/js/templates/docs/usage-navigation.html +3 -0
- package/admin/js/templates/docs/usage-shortcodes.html +8 -0
- package/admin/js/templates/documentation.html +8 -0
- package/admin/js/templates/launchers.html +105 -0
- package/admin/js/views/chat-knowledge.js +60 -0
- package/admin/js/views/chats.js +53 -0
- package/admin/js/views/doc-pages.js +1 -1
- package/admin/js/views/index.js +1 -1
- package/admin/js/views/launchers.js +230 -0
- package/admin/js/views/menu-editor.js +22 -22
- package/admin/js/views/page-editor.js +10 -10
- package/docs/DommaFeatures.md +30 -0
- package/docs/markdown-shortcodes.md +69 -16
- package/package.json +1 -1
- package/public/css/image-zoom.css +1 -0
- package/public/css/launcher-chat.css +1 -0
- package/public/css/launchers.css +1 -0
- package/public/css/site.css +1 -1
- package/public/js/image-zoom.mjs +30 -0
- package/public/js/launcher-chat.mjs +47 -0
- package/public/js/launcher-settings.mjs +2 -0
- package/public/js/launchers.mjs +12 -0
- package/public/js/motion-control.mjs +1 -1
- package/public/js/site.js +1 -1
- package/server/routes/api/chat.js +203 -0
- package/server/routes/api/chats.js +235 -0
- package/server/routes/api/launchers.js +50 -0
- package/server/routes/launcher-public.js +96 -0
- package/server/server.js +33 -0
- package/server/services/adapterRegistry.js +4 -4
- package/server/services/adapters/FileAdapter.js +18 -0
- package/server/services/adapters/MongoAdapter.js +14 -0
- package/server/services/chat/conversation.js +458 -0
- package/server/services/chat/launcher-bridge.js +73 -0
- package/server/services/chat/matcher.js +324 -0
- package/server/services/chat/settings.js +118 -0
- package/server/services/chat/store.js +532 -0
- package/server/services/collectionAccess.js +16 -0
- package/server/services/docs.js +2 -0
- package/server/services/launchers.js +172 -0
- package/server/services/markdown.js +175 -4
- package/server/services/number-fields-migration.js +4 -0
- package/server/services/permissionRegistry.js +12 -0
- package/server/services/presetCollections.js +75 -2
- package/server/services/renderer.js +86 -18
- package/server/services/roles.js +1 -1
- package/server/services/tools.js +1 -0
- package/server/templates/page.html +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.28.1] - 2026-11-01
|
|
4
|
+
|
|
5
|
+
- Launchers: while a launcher's modal or slideover is open, or its chat fills a phone screen, Search, Back to top, Reduce motion and the theme switcher are hidden. They were drawn over the panel, covering its close button on phones and the top corners of a full-screen modal.
|
|
6
|
+
|
|
7
|
+
## [1.28.0] - 2026-11-01
|
|
8
|
+
|
|
9
|
+
- Pages: a new `[image]` shortcode with a full set of options - caption, width, max width, height and fit, alignment (including floats that text wraps around), corners, border, shadow, hover text, lazy or eager loading, a link, a class and an id. With `zoom` on, visitors click the picture (or press Enter on it) to see it full size in a viewer: fitted to the window first, then actual size with drag to pan, wheel and pinch zoom; pictures sharing a `group` step with arrows and the arrow keys. Made for screenshots whose small text could not be read. The viewer loads only on pages that have a zoomable picture and does not animate under reduced motion. Page Editor: Insert > Image now picks from Media and then opens the Image form (zoom on) instead of writing a Markdown picture; right-click an existing tag for Edit Image. Shortcode forms show a line of help under fields that have it.
|
|
10
|
+
- Launchers: a new built-in Tool at Content > Launchers. Pin as many discs (or pills with words) as you like to any of eight spots on the window - a corner, the middle of an edge, the top or bottom centre - each opening a page, form or block in a modal or a slideover, or a chat. Set offsets, size, roundness, theme or custom colours and a spot of its own on phones; show it on every page, only some, or all but some (with `*` wildcards), to everyone, signed-in people or signed-out visitors; switch each one on or off, drag to reorder. Discs step clear of each other and of Search, Back to top, the theme switcher and Reduce motion. A panel shows the page alone from `/_launcher/<id>`, so the page's own visibility rules apply and its forms and components work as they do on the page. The chat panel's body comes from the chat module (`/public/js/launcher-chat.mjs`). Stored in `config/launchers.json`; the Tool can be switched off like the other built-in Tools. The Reduce motion disc now also keeps clear of launchers. Any menu or sub-menu item can open a launcher (a Launcher list under the item's URL), as can any link to `#launcher-<id>`; a launcher can also have no disc and open only from links. Each launcher has a tooltip on hover and focus: its label, words of its own, or none. A modal can be extra small to huge, nearly full width, full screen or a custom width (px or % of the window), and either fit its page or keep a fixed height.
|
|
11
|
+
- Chat: a chat launcher now holds a real conversation. A bot answers visitors straight away from your Knowledge (Content > Chats > Knowledge) - no AI, only what you wrote - matching their words with plurals, common synonyms and small typos taken care of; when it is not sure it offers "Did you mean...?" choices, and what it cannot answer goes on an Unanswered list you can turn into new entries in one click. Visitors can ask for a person at any time: whoever has Content > Chats open and is Available gets it (with a notification and a sidebar badge), and when nobody is available the visitor leaves their name and email instead. Chats, messages and the Knowledge are kept in MongoDB where the site has it, in files otherwise. Permission Chats (View, Answer, Manage); Documentation > Usage > Chat & Knowledge.
|
|
12
|
+
|
|
3
13
|
## [1.27.3] - 2026-10-31
|
|
4
14
|
|
|
5
15
|
- SEO: the audit no longer keeps every page's HTML in memory while it runs. The facts it reads from each page were slices of the page, so a large site could run out of memory mid-audit and restart every few minutes (domma-cms.com did). SEO Pro's Monitor gets the same copy through `scanHtml`.
|
package/CLAUDE.md
CHANGED
|
@@ -68,7 +68,7 @@ Processing order (`parseMarkdown()` in `server/services/markdown.js`; earlier st
|
|
|
68
68
|
3. `[dconfig]`
|
|
69
69
|
4. Effects shortcodes, then plugin shortcodes
|
|
70
70
|
5. `[tabs]`, `[accordion]`, `[carousel]`, `[countdown]`, `[timeline]`, `[listgroup]`, `[spacer]`, `[center]`, `[icon]`,
|
|
71
|
-
`[demo]`, `[embed]`, `[form]`, `[hero]`, `[table]`
|
|
71
|
+
`[demo]`, `[embed]`, `[image]`, `[form]`, `[hero]`, `[table]`
|
|
72
72
|
6. Inline tags: `[badge]`, `[text]`, `[button]`, `[link]`, `[cta]`
|
|
73
73
|
7. `[grid]` / `[row]` / `[col]`
|
|
74
74
|
8. `[card]` (and `[box]` - a headerless card, handled at the top of `processCardBlocks`)
|
|
@@ -77,7 +77,7 @@ Processing order (`parseMarkdown()` in `server/services/markdown.js`; earlier st
|
|
|
77
77
|
11. marked → sanitise → `markdown:afterParse` transforms
|
|
78
78
|
|
|
79
79
|
Containers that render their own body (tabs, accordion, carousel, timeline, hero, grid, card, slideover, effect
|
|
80
|
-
wrappers) run the inline tags plus `[grid]`/`[card]` over it first - keep that set in step with
|
|
80
|
+
wrappers) run the inline tags (`[image]` among them) plus `[grid]`/`[card]` over it first - keep that set in step with
|
|
81
81
|
`processInlineShortcodes()` when adding an inline tag. The full order is in `docs/markdown-shortcodes.md`.
|
|
82
82
|
|
|
83
83
|
**Entry data never runs as a shortcode.** `[collection]` / `[view]` output carries entry values into stages 3-10,
|
package/admin/js/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{wireNotificationMenu as Q}from"./lib/topbar-notifications.js";import{installSmoothCarets as X}from"./lib/smooth-caret.js";import{viewLoaders as Z}from"./views/index.js";import{createLazyViews as tt}from"./lib/lazy-views.js";import{withPluginChrome as _}from"./lib/plugin-chrome.js";import{api as r,getUser as L,isAuthenticated as m,logout as et,sendToLogin as at}from"./api.js";import{claimDrafts as it}from"./lib/draft-owner.js";import{isAuthScreen as C,loginHashFor as ot}from"./lib/login-arrange.js";import{installHttpInterceptor as st}from"./http-interceptor.js";import{installResizableSlideovers as nt}from"./lib/slideover-resizable.js";import{installActivityThrobber as rt}from"./lib/activity-throbber.js";import{installUpdateNotice as lt,renderCmsVersion as ct}from"./lib/update-notice.js";import{renderFrameworkVersions as W,wireAccountMenu as mt}from"./lib/topbar-account.js";import{refreshTopbarProject as B}from"./lib/topbar-project.js";import{isPathAllowed as pt,redirectFor as dt}from"./lib/admin-scope.js";import{deliverDesktop as ut,desktopActive as ht,notificationSettings as wt}from"./lib/desktop-notify.js";import{avatarUrl as gt,installAccountAvatar as ft}from"./lib/avatar.js";import{installCalculator as vt}from"./lib/calculator.js";import{takeOverviewPass as bt,withDashboardStrip as H}from"./lib/dashboards-strip.js";import{installHotkeys as St}from"./lib/hotkeys-ui.js";import{applyAdminBrand as q}from"./lib/admin-brand.js";import{installRouterCatchUp as Ct}from"./lib/router-catch-up.js";import{installSidebarDrawer as Mt}from"./lib/sidebar-drawer.js";$(()=>{X(document),st(),vt(),lt(),rt(),nt(),Mt(),(async()=>{const{applyAdminTheme:t,refreshAdminTheme:i}=await import("./lib/admin-theme.js");m()?await i(r,{init:!0}):t({dommaTheme:"charcoal-dark"},{init:!0})})();let p=null,h=null,c="/",w=!1,g=null;function D(t){if(P[t])return E.toast(`${P[t]} is switched off on this site.`,{type:"info"}),"/";const[i,e]=t.split("?"),a=new URLSearchParams(e||"").get("tab");if(i==="/settings"&&["favicon","pageNavigation","breadcrumbs","motion","search"].includes(a))return`/appearance?tab=${a}`;if(t.split("?")[0]==="/my-dashboard")return"/dashboards";const o=y[t]||dt(p,t);return o||((t.split("?")[0]||"/")==="/"&&c&&c!=="/"&&!bt()?y[c]||c:null)}const y={},P={};R.use(async(t,i,e)=>{if(C(t.path))return e();if(!m()){at();return}const a=D(t.path);if(a){R.navigate(a);return}e()});async function f(){try{const t=await r.get("/auth/permissions");p=t.adminScope||null,h=t.adminBrand||null,q(h),c=t.adminHome||"/",W(t.versions);const i=t.permissions||[];return w=pt(p,"/settings")&&i.some(e=>e==="settings"||e.startsWith("settings.")),g=i.some(e=>e==="notifications"||e.startsWith("notifications.")),i}catch{return p=null,c="/",h||q(null),w=!1,g=null,[]}}document.addEventListener("dm:admin-home-changed",()=>{f()});let N=null,A=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(B(r),N){A=!0;return}N=(async()=>{do{A=!1;try{await j(await f())}catch{}}while(A)})().finally(()=>{N=null})});async function j(t){const{renderAdminSidebar:i}=await import("./lib/sidebar-renderer.js");await i({mount:"#admin-sidebar",permissions:t,adminScope:p,brand:h})}M.subscribe("router:afterChange",({to:t})=>{C(t.path)&&(u&&(clearInterval(u),u=null),p=null,c="/",w=!1,g=null)});const z=[{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:"/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/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:"/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 from WordPress - 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()}},{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:i})=>{if(!C(t.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),C(i?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(o=>o.refreshAdminTheme(r)),await T();const e=await f(),a=D(t.path);if(a&&R.navigate(a),j(e),wt.read().signInToasts)try{const o=await r.system.notifications.list().catch(()=>[]),n=(Array.isArray(o)?o:[]).filter(s=>s.unread&&["warning","critical"].includes(s.data?.severity)).slice(0,3);for(const s of n){const l=d(s.data?.title||""),x=d((s.data?.body||"").slice(0,120));E.toast(`${l} - ${x}`,{type:s.data?.severity==="critical"?"error":"warning",duration:0})}}catch{}}V()}}),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 G=["#field-project","#menu-project","#collection-project","#endpoint-project","#action-project","#view-project","#block-project","#component-project","#role-project",'[name="project"]','[name="ownedByProject"]'];function J(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 i=t?String(t.path).split("?")[0]:"";if(!t||!J(i))return;const a=new URLSearchParams(location.hash.split("?")[1]||"").get("project");if(!a||!/\/new$/.test(i))return;let o=0;const n=60,s=1500,l=()=>{o+=n;for(const x of G){const b=document.querySelector(x);if(!b)continue;if(Array.from(b.options||[]).find(Y=>Y.value===a)){b.value=a,b.dispatchEvent(new Event("change",{bubbles:!0}));return}}o<s&&setTimeout(l,n)};setTimeout(l,n)});const F="cms_card_states",k=S.get(F)||{};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&&k[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 i=$(this).closest(".card");i.toggleClass("card-collapsed");const e=$(this).find("h2, h3").first().text().trim();e&&(k[e]=i.hasClass("card-collapsed")?"collapsed":"open",S.set(F,k))}),St(),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 i=document.querySelector("#view-container .view-header button.btn-primary");i&&(t.preventDefault(),i.click())});const v=tt(),O=v.views,K={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 from WordPress",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"},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"},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"}};for(const[t,i]of Object.entries(Z))v.register(t,async()=>{let e=await i();const a=K[t];return a&&(e=_(e,{plugin:t,licence:"Built in",...a})),t==="dashboard"?H(e):e});R.use(async(t,i,e)=>{try{await v.load(t.view)}catch(a){console.error("[admin] Screen failed to load",a),O[t.view]={template:'<p role="alert">This screen could not load. Reload the page to try again.</p>'}}e()});const I=[...z];async function T(){if(m())try{const t=await r.plugins.adminConfig(),i=new Set(I.map(e=>e.path));for(const e of t.routes||[])i.has(e.path)||I.push(e);for(const[e,a]of Object.entries(t.views||{})){const o=(t.meta||{})[e];v.register(e,async()=>{const s=(await import(`/plugins/${a.entry}`))[a.exportName];if(!s)throw new Error(`Missing plugin screen: ${e}`);const l=_(s,o);return e==="dashboard"?H(l):l},JSON.stringify([a,o]))}for(const[e,{route:a}]of Object.entries(t.takeovers||{}))a&&(y[`/${e}`]=a);for(const[e,{enabled:a,displayName:o}]of Object.entries(t.tools||{}))a===!1&&(P[`/${e}`]=o);for(const{id:e,href:a}of t.css||[])if(!document.getElementById(e)){const o=document.createElement("link");o.id=e,o.rel="stylesheet",o.href=a,document.head.appendChild(o)}}catch{}}function V(){const t=L();if(!t)return;if($("#topbar-user-name").length){B(r);return}const e={"super-admin":"Super Admin",admin:"Admin",user:"User"}[t.role]||t.role,a=gt(t);$("#topbar-user").get(0).innerHTML=`
|
|
1
|
+
import{wireNotificationMenu as Q}from"./lib/topbar-notifications.js";import{installSmoothCarets as X}from"./lib/smooth-caret.js";import{viewLoaders as Z}from"./views/index.js";import{createLazyViews as ee}from"./lib/lazy-views.js";import{withPluginChrome as _}from"./lib/plugin-chrome.js";import{api as r,getUser as x,isAuthenticated as m,logout as te,sendToLogin as ae}from"./api.js";import{claimDrafts as ie}from"./lib/draft-owner.js";import{isAuthScreen as C,loginHashFor as oe}from"./lib/login-arrange.js";import{installHttpInterceptor as se}from"./http-interceptor.js";import{installResizableSlideovers as ne}from"./lib/slideover-resizable.js";import{installActivityThrobber as re}from"./lib/activity-throbber.js";import{installUpdateNotice as le,renderCmsVersion as ce}from"./lib/update-notice.js";import{renderFrameworkVersions as W,wireAccountMenu as me}from"./lib/topbar-account.js";import{refreshTopbarProject as B}from"./lib/topbar-project.js";import{isPathAllowed as pe,redirectFor as de}from"./lib/admin-scope.js";import{deliverDesktop as ue,desktopActive as he,notificationSettings as we}from"./lib/desktop-notify.js";import{avatarUrl as ge,installAccountAvatar as fe}from"./lib/avatar.js";import{installCalculator as ve}from"./lib/calculator.js";import{takeOverviewPass as be,withDashboardStrip as H}from"./lib/dashboards-strip.js";import{installHotkeys as Ce}from"./lib/hotkeys-ui.js";import{applyAdminBrand as K}from"./lib/admin-brand.js";import{installRouterCatchUp as Se}from"./lib/router-catch-up.js";import{installSidebarDrawer as Me}from"./lib/sidebar-drawer.js";$(()=>{X(document),se(),ve(),le(),re(),ne(),Me(),(async()=>{const{applyAdminTheme:e,refreshAdminTheme:i}=await import("./lib/admin-theme.js");m()?await i(r,{init:!0}):e({dommaTheme:"charcoal-dark"},{init:!0})})();let p=null,h=null,c="/",w=!1,g=null;function D(e){if(N[e])return E.toast(`${N[e]} is switched off on this site.`,{type:"info"}),"/";const[i,t]=e.split("?"),a=new URLSearchParams(t||"").get("tab");if(i==="/settings"&&["favicon","pageNavigation","breadcrumbs","motion","search"].includes(a))return`/appearance?tab=${a}`;if(e.split("?")[0]==="/my-dashboard")return"/dashboards";const o=y[e]||de(p,e);return o||((e.split("?")[0]||"/")==="/"&&c&&c!=="/"&&!be()?y[c]||c:null)}const y={},N={};R.use(async(e,i,t)=>{if(C(e.path))return t();if(!m()){ae();return}const a=D(e.path);if(a){R.navigate(a);return}t()});async function f(){try{const e=await r.get("/auth/permissions");p=e.adminScope||null,h=e.adminBrand||null,K(h),c=e.adminHome||"/",W(e.versions);const i=e.permissions||[];return w=pe(p,"/settings")&&i.some(t=>t==="settings"||t.startsWith("settings.")),g=i.some(t=>t==="notifications"||t.startsWith("notifications.")),i}catch{return p=null,c="/",h||K(null),w=!1,g=null,[]}}document.addEventListener("dm:admin-home-changed",()=>{f()});let P=null,A=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(B(r),P){A=!0;return}P=(async()=>{do{A=!1;try{await j(await f())}catch{}}while(A)})().finally(()=>{P=null})});async function j(e){const{renderAdminSidebar:i}=await import("./lib/sidebar-renderer.js");await i({mount:"#admin-sidebar",permissions:e,adminScope:p,brand:h})}M.subscribe("router:afterChange",({to:e})=>{C(e.path)&&(u&&(clearInterval(u),u=null),p=null,c="/",w=!1,g=null)});const q=[{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:"/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 from WordPress - 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()}},{path:"/reset-password",view:"login",title:"Reset Password - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}}];M.subscribe("router:afterChange",async({to:e,from:i})=>{if(!C(e.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),C(i?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(o=>o.refreshAdminTheme(r)),await U();const t=await f(),a=D(e.path);if(a&&R.navigate(a),j(t),we.read().signInToasts)try{const o=await r.system.notifications.list().catch(()=>[]),n=(Array.isArray(o)?o:[]).filter(s=>s.unread&&["warning","critical"].includes(s.data?.severity)).slice(0,3);for(const s of n){const l=d(s.data?.title||""),L=d((s.data?.body||"").slice(0,120));E.toast(`${l} - ${L}`,{type:s.data?.severity==="critical"?"error":"warning",duration:0})}}catch{}}V()}}),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 z=["#field-project","#menu-project","#collection-project","#endpoint-project","#action-project","#view-project","#block-project","#component-project","#role-project",'[name="project"]','[name="ownedByProject"]'];function G(e){return/^\/(pages|menus|context-menus|collections|forms|actions|views|blocks|components|users|roles|api-endpoints)\/(new|edit\/)/.test(e)}M.subscribe("router:afterChange",({to:e})=>{const i=e?String(e.path).split("?")[0]:"";if(!e||!G(i))return;const a=new URLSearchParams(location.hash.split("?")[1]||"").get("project");if(!a||!/\/new$/.test(i))return;let o=0;const n=60,s=1500,l=()=>{o+=n;for(const L of z){const b=document.querySelector(L);if(!b)continue;if(Array.from(b.options||[]).find(Y=>Y.value===a)){b.value=a,b.dispatchEvent(new Event("change",{bubbles:!0}));return}}o<s&&setTimeout(l,n)};setTimeout(l,n)});const F="cms_card_states",k=S.get(F)||{};M.subscribe("router:afterChange",()=>{setTimeout(()=>{$("#view-container .card-collapsible").each(function(){const e=$(this).find(".card-header h2, .card-header h3").first().text().trim();e&&k[e]==="collapsed"&&$(this).addClass("card-collapsed")})},200)}),$("#view-container").on("click",".card-collapsible .card-header",function(e){if($(e.target).closest("button, a").length)return;const i=$(this).closest(".card");i.toggleClass("card-collapsed");const t=$(this).find("h2, h3").first().text().trim();t&&(k[t]=i.hasClass("card-collapsed")?"collapsed":"open",S.set(F,k))}),Ce(),document.addEventListener("keydown",e=>{if(!(e.ctrlKey||e.metaKey)||e.key!=="s"||window.location.hash.startsWith("#/login")||window.location.hash.startsWith("#/reset-password"))return;const i=document.querySelector("#view-container .view-header button.btn-primary");i&&(e.preventDefault(),i.click())});const v=ee(),O=v.views,J={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 from WordPress",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"}};for(const[e,i]of Object.entries(Z))v.register(e,async()=>{let t=await i();const a=J[e];return a&&(t=_(t,{plugin:e,licence:"Built in",...a})),e==="dashboard"?H(t):t});R.use(async(e,i,t)=>{try{await v.load(e.view)}catch(a){console.error("[admin] Screen failed to load",a),O[e.view]={template:'<p role="alert">This screen could not load. Reload the page to try again.</p>'}}t()});const I=[...q];async function U(){if(m())try{const e=await r.plugins.adminConfig(),i=new Set(I.map(t=>t.path));for(const t of e.routes||[])i.has(t.path)||I.push(t);for(const[t,a]of Object.entries(e.views||{})){const o=(e.meta||{})[t];v.register(t,async()=>{const s=(await import(`/plugins/${a.entry}`))[a.exportName];if(!s)throw new Error(`Missing plugin screen: ${t}`);const l=_(s,o);return t==="dashboard"?H(l):l},JSON.stringify([a,o]))}for(const[t,{route:a}]of Object.entries(e.takeovers||{}))a&&(y[`/${t}`]=a);for(const[t,{enabled:a,displayName:o}]of Object.entries(e.tools||{}))a===!1&&(N[`/${t}`]=o);for(const{id:t,href:a}of e.css||[])if(!document.getElementById(t)){const o=document.createElement("link");o.id=t,o.rel="stylesheet",o.href=a,document.head.appendChild(o)}}catch{}}function V(){const e=x();if(!e)return;if($("#topbar-user-name").length){B(r);return}const t={"super-admin":"Super Admin",admin:"Admin",user:"User"}[e.role]||e.role,a=ge(e);$("#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>
|
|
@@ -33,8 +33,8 @@ import{wireNotificationMenu as Q}from"./lib/topbar-notifications.js";import{inst
|
|
|
33
33
|
<div id="topbar-account-menu" class="topbar-account-menu" hidden>
|
|
34
34
|
<div class="topbar-account-identity">
|
|
35
35
|
${a?`<img id="topbar-avatar" class="topbar-avatar" src="${d(a)}" alt="">`:""}
|
|
36
|
-
<span id="topbar-user-name" class="topbar-user-name">${d(
|
|
37
|
-
<span class="topbar-role-badge topbar-role-badge--${d(
|
|
36
|
+
<span id="topbar-user-name" class="topbar-user-name">${d(e.name)}</span>
|
|
37
|
+
<span class="topbar-role-badge topbar-role-badge--${d(e.role)}">${d(t)}</span>
|
|
38
38
|
</div>
|
|
39
39
|
<a href="#/my-profile" class="topbar-action-link" data-tooltip="My Profile" data-tooltip-placement="bottom">
|
|
40
40
|
<span data-icon="user"></span>
|
|
@@ -50,4 +50,4 @@ import{wireNotificationMenu as Q}from"./lib/topbar-notifications.js";import{inst
|
|
|
50
50
|
</a>
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
|
-
`;const o=$("#topbar-bell").get(0);o&&(o.hidden=!0);const n=$("#topbar-settings").get(0);n&&(n.hidden=!w),$("#topbar-logout-btn").on("click",s=>{s.preventDefault(),
|
|
53
|
+
`;const o=$("#topbar-bell").get(0);o&&(o.hidden=!0);const n=$("#topbar-settings").get(0);n&&(n.hidden=!w),$("#topbar-logout-btn").on("click",s=>{s.preventDefault(),te()}),Domma.icons.scan("#admin-topbar"),E.tooltip("#topbar-actions [data-tooltip]",{placement:"bottom"}),me(e),Q({refreshBadge:T}),fe(e),W(),ce(),B(r),T(),u||(u=setInterval(T,6e4))}function d(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}let u=null;async function T(){if(!(!m()||g===!1))try{const{count:e}=await r.system.notifications.unreadCount();$("#topbar-bell").removeAttr("hidden");const i=$("#topbar-bell-badge");e>0?i.text(e>99?"99+":String(e)).removeAttr("hidden"):i.attr("hidden","").text(""),e>0&&he()&&ue(await r.system.notifications.list().catch(()=>[]))}catch{}}(async()=>{if(!m()&&!window.location.hash.startsWith("#/reset-password"))window.location.hash.startsWith("#/login")||(window.location.hash=oe(window.location.hash));else{ie(x()?.id);const a=x(),[o]=await Promise.all([a?f():Promise.resolve([]),U()]);if(a){const n=(window.location.hash||"#/").slice(1)||"/",s=D(n);s&&(window.location.hash=`#${s}`),j(o).catch(l=>console.error("[admin] Sidebar failed to load",l)),V()}}const e=R._extractParams.bind(R);R._extractParams=function(a,o){const n=o.indexOf("?");if(n!==-1&&(o=o.slice(0,n)),a.endsWith("/*")){const s=a.slice(0,-2);return o.startsWith(s+"/")?{}:null}return e(a,o)};const i=R._renderNotFound.bind(R);let t="";R._renderNotFound=async function(a){return m()&&t!==a&&(t=a,await U(),R._matchRoute(a).route)?(t="",R._handleRouteChange()):(t="",m()&&$("#admin-sidebar").get(0)?.style.display==="none"?(E.toast("That link goes nowhere - here is your home page.",{type:"warning"}),R.navigate("/")):i(a))},Se(R),R.init({container:"#view-container",routes:I,views:O,default:"/",transitions:{enter:"fadeIn",leave:"fadeOut",duration:150}})})()});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const STATUS=Object.freeze({bot:{label:"With the bot",tone:"muted"},waiting:{label:"Waiting",tone:"danger"},open:{label:"Chatting",tone:"ok"},message:{label:"Message left",tone:"warn"},closed:{label:"Ended",tone:"muted"}});const l={waiting:0,message:1,open:2,bot:3,closed:4};export function mayDo(e=[],r,s){return e.includes(r)||e.includes(`${r}.${s}`)}export function shortSpan(e){const r=Math.max(0,Math.round(Number(e)/1e3)||0);if(r<60)return`${r}s`;const s=Math.round(r/60);if(s<60)return`${s} min`;const o=Math.round(s/60);return o<48?`${o} h`:`${Math.round(o/24)} d`}export function arrangeChats(e,{query:r="",now:s=Date.now()}={}){const o=String(r||"").trim().toLowerCase();return(Array.isArray(e)?e:[]).filter(n=>!o||[n.name,n.email,n.page,n.summary].some(t=>String(t||"").toLowerCase().includes(o))).slice().sort((n,t)=>{const a=l[n.status]??9,i=l[t.status]??9;return a!==i?a-i:n.status==="waiting"?Date.parse(n.waitingSince||0)-Date.parse(t.waitingSince||0):Date.parse(t.lastAt||0)-Date.parse(n.lastAt||0)}).map(n=>{const t=STATUS[n.status]||{label:n.status,tone:"muted"},a=n.waitingSince?Math.max(0,s-Date.parse(n.waitingSince)):0,i=n.status==="waiting"&&a>=5*6e4;return{id:n.id,who:n.name||"Visitor",email:n.email||"",line:n.summary||(n.count?"(no question yet)":"Just opened"),chip:t.label,chipClass:`chat-chip chat-chip--${i?"danger":t.tone}`,meta:n.status==="waiting"?`waiting ${shortSpan(a)}`:n.page||"",unread:Number(n.unread)||0,unreadText:Number(n.unread)?String(n.unread):"",status:n.status}})}export function threadRow(e){const r=e.from==="visitor"?"Visitor":e.from==="bot"?"Bot":e.from==="staff"?e.name||"Staff":"",s=e.answer?`Answered from: ${e.answer}`:Array.isArray(e.suggestions)&&e.suggestions.length?`Offered: ${e.suggestions.join(" \xB7 ")}`:"";return{key:`m${e.n}`,n:e.n,cls:`chat-msg chat-msg--${e.from}`,who:r,text:e.text||"",note:s,time:e.at?new Date(e.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}}export function arrangeKnowledge(e,{query:r="",sort:s="question"}={}){const o=String(r||"").trim().toLowerCase(),u=(Array.isArray(e)?e:[]).filter(t=>!o||[t.question,t.alternatives,t.keywords,t.answer].some(a=>String(a||"").toLowerCase().includes(o))),n={question:(t,a)=>t.question.localeCompare(a.question),hits:(t,a)=>a.hits-t.hits||t.question.localeCompare(a.question),recent:(t,a)=>Date.parse(a.updatedAt||0)-Date.parse(t.updatedAt||0)}[s]||((t,a)=>t.question.localeCompare(a.question));return u.slice().sort(n).map(t=>({id:t.id,question:t.question,preview:String(t.answer||"").replace(/[*_`#>\[\]()]/g,"").replace(/\s+/g," ").trim().slice(0,140),ways:String(t.alternatives||"").split(`
|
|
2
|
+
`).filter(Boolean).length,meta:t.hits?`answered ${t.hits} time${t.hits===1?"":"s"}`:"not used yet",off:!t.enabled,sample:!!t.sample}))}export function linksToRows(e){return(Array.isArray(e)?e:[]).map((r,s)=>({key:`l${s}-${Date.now()}`,label:r.label||"",url:r.url||""}))}export function rowsToLinks(e){return(Array.isArray(e)?e:[]).map(r=>({label:String(r.label??"").trim(),url:String(r.url??"").trim()})).filter(r=>r.url)}export function describeTest(e){if(!e)return"";switch(e.kind){case"answer":return`Answers with "${e.answer.question}" (score ${Math.round(e.answer.score*100)}%).`;case"suggest":return`Not sure - offers: ${e.suggestions.map(r=>`"${r.question}" (${Math.round(r.score*100)}%)`).join(", ")}.`;case"handover":return"Hands over to a person (the visitor asked for one).";case"greeting":return"Says hello back.";case"thanks":return"Says you are welcome.";default:return e.ranked?.length?`No answer - the closest was "${e.ranked[0].question}" at ${Math.round(e.ranked[0].score*100)}%. It goes on the Unanswered list.`:"No answer - nothing came close. It goes on the Unanswered list."}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{LAUNCHER_DEFAULTS as m,LAUNCHER_LIMITS as r,LAUNCHER_POSITION_LABEL as d,launcherColourCss as p,launcherReady as f,launcherSpot as b,normaliseLauncher as c,normaliseLauncherPath as u}from"../../../public/js/launcher-settings.mjs";export const FILTERS=["all","on","off"];const g={modal:"Modal",slideover:"Slideover",chat:"Chat"},x={page:"page",form:"form",block:"block"};export function describeAction(e){const t=e.action;return t.type==="chat"?`Chat${e.chat.bot?" (bot first)":""}`:t.ref?`${g[t.type]}: ${t.kind==="page"?t.ref:`${x[t.kind]} ${t.ref}`}`:`${g[t.type]}: nothing chosen yet`}export function describeWhere(e){const t=e.pages.paths.length,n=e.pages.mode==="all"?"every page":e.pages.mode==="only"?t?`${t} page rule${t===1?"":"s"}`:"no pages":`every page but ${t} rule${t===1?"":"s"}`,o=e.audience==="signed-in"?", signed-in only":e.audience==="signed-out"?", signed-out only":"",i=e.devices==="desktop"?", desktop only":e.devices==="phone"?", phones only":"";return`${n}${o}${i}`}export function launcherProblem(e){return f(e)?e.pages.mode==="only"&&!e.pages.paths.length?"Shows on no pages":"":"Choose what it opens"}export function launcherRow(e){const t=launcherProblem(e),n=e.triggerStyle==="icon-text",o=p(e.colours.background)||"var(--dm-primary)",i=p(e.colours.text)||"var(--dm-primary-text)";return{id:e.id,name:e.name,meta:`${e.showDisc?d[e.position]:"No disc - opened from links"} \xB7 ${describeAction(e)} \xB7 ${describeWhere(e)}`,label:e.label,icon:e.icon,pill:n,off:!e.enabled,on:e.enabled,problem:t,rowCls:[e.enabled?"":"is-off",t&&e.enabled?"is-warn":""].filter(Boolean).join(" "),discStyle:{"--lnx-bg":o,"--lnx-fg":i,"border-radius":n?"999px":`${Math.round(e.radius/e.size*100)}%`}}}export function arrangeLaunchers(e,{filter:t="all",query:n=""}={}){const o=String(n||"").trim().toLowerCase();return e.filter(i=>t==="on"?i.enabled:t==="off"?!i.enabled:!0).filter(i=>!o||[i.name,i.label,i.action.ref,i.action.title].some(s=>String(s||"").toLowerCase().includes(o)))}export function countLaunchers(e){const t=e.filter(n=>n.enabled).length;return{all:e.length,on:t,off:e.length-t}}export function moveItem(e,t,n){const o=[...e];if(t<0||t>=o.length||n<0||n>=o.length||t===n)return o;const[i]=o.splice(t,1);return o.splice(n,0,i),o}export function blankLauncher(e=[]){const t=new Set(e.map(o=>o.name));let n="New launcher";for(let o=2;t.has(n);o++)n=`New launcher ${o}`;return c({name:n})}export function duplicateLauncher(e,t=[]){const n=new Set(t.map(i=>i.name));let o=`${e.name} (copy)`.slice(0,r.nameMax);for(let i=2;n.has(o);i++)o=`${e.name} (copy ${i})`.slice(0,r.nameMax);return c({...structuredClone(e),id:"",name:o,enabled:!1})}export function formFromLauncher(e){const t=c(e);return{enabled:t.enabled,showDisc:t.showDisc,name:t.name,label:t.label,tooltipMode:t.tooltipMode,tooltip:t.tooltip,icon:t.icon,triggerStyle:t.triggerStyle,position:t.position,offsetX:t.offsetX,offsetY:t.offsetY,size:t.size,radius:t.radius,devices:t.devices,phoneOverride:t.phone.override,phonePosition:t.phone.position,phoneOffsetX:t.phone.offsetX,phoneOffsetY:t.phone.offsetY,phoneSize:t.phone.size,background:t.colours.background,text:t.colours.text,cls:t.class,pagesMode:t.pages.mode,paths:t.pages.paths.join(`
|
|
2
|
+
`),audience:t.audience,actionType:t.action.type,kind:t.action.kind,ref:t.action.ref,title:t.action.title,modalSize:t.action.size,side:t.action.side,width:t.action.width,customWidth:t.action.customWidth,widthUnit:t.action.widthUnit,modalHeight:t.action.height,customHeight:t.action.customHeight,heightUnit:t.action.heightUnit,greeting:t.chat.greeting,botName:t.chat.botName,bot:t.chat.bot,staff:t.chat.staff,askDetails:t.chat.askDetails}}export function launcherFromForm(e,t=""){return c({id:t,enabled:e.enabled,showDisc:e.showDisc,name:e.name,label:e.label,tooltipMode:e.tooltipMode,tooltip:e.tooltip,icon:e.icon,triggerStyle:e.triggerStyle,position:e.position,offsetX:e.offsetX,offsetY:e.offsetY,size:e.size,radius:e.radius,devices:e.devices,phone:{override:e.phoneOverride,position:e.phonePosition,offsetX:e.phoneOffsetX,offsetY:e.phoneOffsetY,size:e.phoneSize},colours:{background:e.background,text:e.text},class:e.cls,pages:{mode:e.pagesMode,paths:String(e.paths||"").split(/\n+/)},audience:e.audience,action:{type:e.actionType,kind:e.kind,ref:e.ref,title:e.title,size:e.modalSize,side:e.side,width:e.width,customWidth:e.customWidth,widthUnit:e.widthUnit,height:e.modalHeight,customHeight:e.customHeight,heightUnit:e.heightUnit},chat:{greeting:e.greeting,botName:e.botName,bot:e.bot,staff:e.staff,askDetails:e.askDetails}})}export function checkLauncherForm(e){const t={},n={};if(String(e.name||"").trim()||(t.name="Give it a name - only you see it."),String(e.label||"").trim()||(t.label="Visitors need words for it: they are read out, and shown on a pill."),e.actionType!=="chat"){const s=String(e.ref||"").trim();s?e.kind==="page"&&(!u(s)||s.includes("*"))?t.ref="A page address starts with / - e.g. /about.":e.kind!=="page"&&!/^[a-z0-9][a-z0-9_-]*$/i.test(s)&&(t.ref="Choose one from the list."):n.ref="Nothing chosen yet - the launcher stays off the page until it opens something."}const o=String(e.paths||"").split(/\n+/).map(s=>s.trim()).filter(Boolean),i=o.filter(s=>!u(s));i.length?t.paths=`Not an address: ${i.slice(0,3).join(", ")}`:o.length>r.pathsMax?t.paths=`At most ${r.pathsMax} rules.`:e.pagesMode==="only"&&!o.length&&(n.paths="With no pages listed it shows nowhere.");for(const s of["background","text"]){const a=String(e[s]||"").trim();a&&!p(a)&&(t[s]="A theme colour, or a hex colour such as #3366ff.")}return{errors:t,warnings:n}}export function previewSpot(e,{vw:t=320,vh:n=200,scale:o=.5,phone:i=!1}={}){const s=i&&e.phoneOverride,a=Math.max(10,Math.round((s?e.phoneSize:e.size)*o)),h=e.triggerStyle==="icon-text"?Math.round(a*2.4):a,l=b(s?e.phonePosition:e.position,{w:h,h:a,vw:t,vh:n,offsetX:Math.round((s?e.phoneOffsetX:e.offsetX)*o),offsetY:Math.round((s?e.phoneOffsetY:e.offsetY)*o)});return{left:Math.max(0,Math.min(t-h,l.left)),top:Math.max(0,Math.min(n-a,l.top)),size:a,w:h}}export{m as LAUNCHER_DEFAULTS,d as LAUNCHER_POSITION_LABEL};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const MENU_ITEM_HELP={Label:"The text visitors see for this menu item. Use a short, recognisable destination or action. This is independent of the URL and icon. A Tool may supply its own label until you customise it. Apply changes to this item, then Save the menu to keep them.",URL:"Where the item links: use a site path beginning with /, a # anchor, an https:// address or a mailto: address. Leave it empty for a parent that only groups sub-items. A Tool address identifies the Tool and is read-only here. Changing a label does not change its destination.",Icon:"Choose the symbol beside the label using Browse, or enter an icon name. A clear icon is particularly useful for rails that collapse to icons. Leaving it empty gives a text-only link. Choosing an icon does not affect the destination or who can see the item.",Visibility:"Choose who sees this item. Everyone and Public include logged-out visitors. A role and above includes more senior roles; Role only includes that role and the super-admin. Private is super-admin only. Permission is an additional gate and both must pass. Locked sidebar Tools keep their required visibility. Hiding a link does not secure its destination.",Permission:"Show this item only when the viewer holds the selected permission. This works alongside Visibility, so both checks must pass. Leaving it empty adds no item-specific permission gate. Tools retain their own permission and cannot have that requirement removed here. The destination still needs its own access controls.","Badge text":"Add a short badge beside the label, such as New or Beta. Leave it empty for no text badge. Badge count from can supply a live collection count instead of a fixed label. Keep the words short so the menu remains easy to scan; Badge colour changes the badge appearance.","Badge count from":"Choose a collection whose entry count supplies a live badge beside this item. This is useful for a navigation link to a collection. Leave it on None for no count. It changes the badge only, not the item destination or access permissions. A text badge can be supplied separately.","Badge colour":"Choose a theme colour for this item badge, or Custom for a fixed hex colour. Theme colours follow the active theme. Leaving it unset uses the normal badge styling. This has no effect unless the item has badge text or a count, and does not change the link text colour.","Render as":"Link uses the normal navigation link. Pill draws a rounded button-like item so a call to action stands out. Pill styling applies to top-level navbar items and reveals Pill style and Pill colour below. The destination, permissions and label remain the same whichever appearance you choose.","Pill style":"Filled gives a pill item a solid coloured surface. Outline uses a border with a quieter interior. This applies when Render as is Pill and is intended for top-level navbar items. Choose Pill colour separately, then check contrast with the navbar background and the label.","Pill colour":"Choose the colour of this item pill, using a theme colour or a fixed custom hex colour. It applies when Render as is Pill; it does not colour every item in the menu. Leaving it unset uses the normal pill styling. Text colour and highlight colour are separate controls.","Text colour":"Override this item label colour with a theme colour or a custom hex colour. Leave it unset to inherit the menu text colour. This affects the item rather than the whole bar, badge or card icon tile. Check readability against the bar surface in normal, hovered and selected states.","Hover effect":"Override the menu-wide pointer effect for this item. Use the menu default inherits the Behaviour tab; None explicitly turns the effect off for this item. Other choices add the named highlight while the pointer is over it. This is separate from the marker for the page currently being viewed. Colour change tints the text; Underline and Overline add a line below or above it; Background tint adds a coloured wash; Darkened darkens the item; Uppercase changes letter case; Grow enlarges it; Breathe pulses its scale; Glow adds a soft glow. None leaves it still.","When selected":"Choose how this item is marked when it points to the page being viewed. Use the menu default inherits the menu-wide selected effect; None explicitly removes it for this item. This helps visitors locate themselves in the navigation. It is separate from hover feedback and does not change the URL. Bold increases text weight; Underline and Overline add a line; Background tint adds a wash; Darkened darkens the link; Filled pill encloses it in a rounded surface. None removes the selected marker.","Highlight colour":"Override the colour used by this item hover and selected effects. Leave it empty to use the menu-wide highlight colour, or choose a theme colour or custom hex colour. This does not enable an effect by itself and is separate from Text colour, Pill colour and Badge colour.","CSS classes":"Add class names separated by spaces to this item outer list element, for example nav-cta push-right. Write the matching rules in Custom CSS; target its link with .nav-cta > a. Enter names without leading dots or CSS declarations. Menu-wide classes are set separately on the Behaviour tab.",Description:"A short supporting line beneath this item label inside a Cards dropdown. Use it to explain the destination without making the label long. It is not the menu administrative description. Leave it empty for a label-only entry. This field is used when Dropdown style is Cards on the Behaviour tab.","Tile colour":"Override the background colour of this item icon tile inside a Cards dropdown. The item choice wins over the menu-wide Icon tiles setting, including its rainbow sequence. Leave it unset to inherit that setting. This does not set the label, badge or card side-box colour.","Card heading":"A short heading above the entries in this top-level item Cards dropdown. It is shown in small capitals and is separate from the top-level navigation label. Leave it empty to omit the heading. This applies to the card panel, not the headings of nested groups.","Link text":"The visible words for the card heading link, such as View all services. Supply its destination in Link URL as well. This link belongs to the dropdown card header; it is separate from the parent navigation item URL. Leave both fields empty when the card does not need a header link.","Link URL":"The destination of the card header link. Pair it with Link text so the visitor has words to click. Use a site path or an allowed external destination. This does not change the parent menu item destination or any individual entry link inside the dropdown.",Columns:"Choose one to four columns for entries in this Cards dropdown. Automatic lets the layout choose. More columns can help a large menu scan quickly, but need space for labels and descriptions. This controls the dropdown card entries, not the site page grid or the footer layout.","Chip strip label":"Words introducing the compact links at the bottom of this Cards dropdown, such as Popular tools. Select Show as a small chip on the sub-items that should appear there. Leaving this label empty omits the introductory words. This is separate from a badge on an individual item.","Side box":"Add a feature box down the right side of this Cards dropdown, using a dark, light or theme-coloured surface. It can hold headings, points and a button, configured below. No side box hides it while leaving the rest of the card. Use it for a focused call to action or a short supporting message.","Box small heading":"A short introductory line above the side-box title, such as Free consultation. It is separate from the main card heading and only appears when the card side box is enabled. Leave it blank when the title needs no introduction. Keep it brief so the box remains easy to scan.","Box title":"The main headline in the card side box, such as See it live. It is separate from the navigation label and card heading. Use it to state the offer or purpose of the box. Supporting points and an optional button can be supplied below. This requires a Side box style.","Box points":"Add one short supporting point per line, up to six. These appear as a list in the card side box beneath its heading. Use them for benefits or useful facts and leave empty for no list. They do not create menu links; the optional button has its own destination.","Button text":"The words on the side-box call-to-action button, such as Book a demo. Supply Button URL as well so the button has a destination. This belongs to the card feature box, rather than the card header link or parent navigation item. Leave both button fields empty for no button.","Button URL":"The destination of the card side-box button. Pair it with Button text, using a site path or allowed external address. This changes the feature-box call to action only. It does not alter the card header link, parent item or other entries in the dropdown."};
|
|
1
|
+
export const MENU_ITEM_HELP={Label:"The text visitors see for this menu item. Use a short, recognisable destination or action. This is independent of the URL and icon. A Tool may supply its own label until you customise it. Apply changes to this item, then Save the menu to keep them.",URL:"Where the item links: use a site path beginning with /, a # anchor, an https:// address or a mailto: address. Leave it empty for a parent that only groups sub-items. A Tool address identifies the Tool and is read-only here. Changing a label does not change its destination.",Launcher:"Make the item open one of your launchers (Content > Launchers) - its modal, slideover or chat - over the page instead of going somewhere. Choosing one sets the URL to #launcher- and its id; choosing none clears it. It works for top-level and sub-menu items alike. The launcher's own page and audience settings still apply, and it can be set to show no disc of its own.",Icon:"Choose the symbol beside the label using Browse, or enter an icon name. A clear icon is particularly useful for rails that collapse to icons. Leaving it empty gives a text-only link. Choosing an icon does not affect the destination or who can see the item.",Visibility:"Choose who sees this item. Everyone and Public include logged-out visitors. A role and above includes more senior roles; Role only includes that role and the super-admin. Private is super-admin only. Permission is an additional gate and both must pass. Locked sidebar Tools keep their required visibility. Hiding a link does not secure its destination.",Permission:"Show this item only when the viewer holds the selected permission. This works alongside Visibility, so both checks must pass. Leaving it empty adds no item-specific permission gate. Tools retain their own permission and cannot have that requirement removed here. The destination still needs its own access controls.","Badge text":"Add a short badge beside the label, such as New or Beta. Leave it empty for no text badge. Badge count from can supply a live collection count instead of a fixed label. Keep the words short so the menu remains easy to scan; Badge colour changes the badge appearance.","Badge count from":"Choose a collection whose entry count supplies a live badge beside this item. This is useful for a navigation link to a collection. Leave it on None for no count. It changes the badge only, not the item destination or access permissions. A text badge can be supplied separately.","Badge colour":"Choose a theme colour for this item badge, or Custom for a fixed hex colour. Theme colours follow the active theme. Leaving it unset uses the normal badge styling. This has no effect unless the item has badge text or a count, and does not change the link text colour.","Render as":"Link uses the normal navigation link. Pill draws a rounded button-like item so a call to action stands out. Pill styling applies to top-level navbar items and reveals Pill style and Pill colour below. The destination, permissions and label remain the same whichever appearance you choose.","Pill style":"Filled gives a pill item a solid coloured surface. Outline uses a border with a quieter interior. This applies when Render as is Pill and is intended for top-level navbar items. Choose Pill colour separately, then check contrast with the navbar background and the label.","Pill colour":"Choose the colour of this item pill, using a theme colour or a fixed custom hex colour. It applies when Render as is Pill; it does not colour every item in the menu. Leaving it unset uses the normal pill styling. Text colour and highlight colour are separate controls.","Text colour":"Override this item label colour with a theme colour or a custom hex colour. Leave it unset to inherit the menu text colour. This affects the item rather than the whole bar, badge or card icon tile. Check readability against the bar surface in normal, hovered and selected states.","Hover effect":"Override the menu-wide pointer effect for this item. Use the menu default inherits the Behaviour tab; None explicitly turns the effect off for this item. Other choices add the named highlight while the pointer is over it. This is separate from the marker for the page currently being viewed. Colour change tints the text; Underline and Overline add a line below or above it; Background tint adds a coloured wash; Darkened darkens the item; Uppercase changes letter case; Grow enlarges it; Breathe pulses its scale; Glow adds a soft glow. None leaves it still.","When selected":"Choose how this item is marked when it points to the page being viewed. Use the menu default inherits the menu-wide selected effect; None explicitly removes it for this item. This helps visitors locate themselves in the navigation. It is separate from hover feedback and does not change the URL. Bold increases text weight; Underline and Overline add a line; Background tint adds a wash; Darkened darkens the link; Filled pill encloses it in a rounded surface. None removes the selected marker.","Highlight colour":"Override the colour used by this item hover and selected effects. Leave it empty to use the menu-wide highlight colour, or choose a theme colour or custom hex colour. This does not enable an effect by itself and is separate from Text colour, Pill colour and Badge colour.","CSS classes":"Add class names separated by spaces to this item outer list element, for example nav-cta push-right. Write the matching rules in Custom CSS; target its link with .nav-cta > a. Enter names without leading dots or CSS declarations. Menu-wide classes are set separately on the Behaviour tab.",Description:"A short supporting line beneath this item label inside a Cards dropdown. Use it to explain the destination without making the label long. It is not the menu administrative description. Leave it empty for a label-only entry. This field is used when Dropdown style is Cards on the Behaviour tab.","Tile colour":"Override the background colour of this item icon tile inside a Cards dropdown. The item choice wins over the menu-wide Icon tiles setting, including its rainbow sequence. Leave it unset to inherit that setting. This does not set the label, badge or card side-box colour.","Card heading":"A short heading above the entries in this top-level item Cards dropdown. It is shown in small capitals and is separate from the top-level navigation label. Leave it empty to omit the heading. This applies to the card panel, not the headings of nested groups.","Link text":"The visible words for the card heading link, such as View all services. Supply its destination in Link URL as well. This link belongs to the dropdown card header; it is separate from the parent navigation item URL. Leave both fields empty when the card does not need a header link.","Link URL":"The destination of the card header link. Pair it with Link text so the visitor has words to click. Use a site path or an allowed external destination. This does not change the parent menu item destination or any individual entry link inside the dropdown.",Columns:"Choose one to four columns for entries in this Cards dropdown. Automatic lets the layout choose. More columns can help a large menu scan quickly, but need space for labels and descriptions. This controls the dropdown card entries, not the site page grid or the footer layout.","Chip strip label":"Words introducing the compact links at the bottom of this Cards dropdown, such as Popular tools. Select Show as a small chip on the sub-items that should appear there. Leaving this label empty omits the introductory words. This is separate from a badge on an individual item.","Side box":"Add a feature box down the right side of this Cards dropdown, using a dark, light or theme-coloured surface. It can hold headings, points and a button, configured below. No side box hides it while leaving the rest of the card. Use it for a focused call to action or a short supporting message.","Box small heading":"A short introductory line above the side-box title, such as Free consultation. It is separate from the main card heading and only appears when the card side box is enabled. Leave it blank when the title needs no introduction. Keep it brief so the box remains easy to scan.","Box title":"The main headline in the card side box, such as See it live. It is separate from the navigation label and card heading. Use it to state the offer or purpose of the box. Supporting points and an optional button can be supplied below. This requires a Side box style.","Box points":"Add one short supporting point per line, up to six. These appear as a list in the card side box beneath its heading. Use them for benefits or useful facts and leave empty for no list. They do not create menu links; the optional button has its own destination.","Button text":"The words on the side-box call-to-action button, such as Book a demo. Supply Button URL as well so the button has a destination. This belongs to the card feature box, rather than the card header link or parent navigation item. Leave both button fields empty for no button.","Button URL":"The destination of the card side-box button. Pair it with Button text, using a site path or allowed external address. This changes the feature-box call to action only. It does not alter the card header link, parent item or other entries in the dropdown."};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function imageReferences(o){const
|
|
2
|
-
`);for(const t of i.matchAll(/url\(\s*(?:"([^"\n]*)"|'([^'\n]*)'|([^\s)]+))\s*\)/gi))
|
|
1
|
+
export function imageReferences(o){const r=[];for(const t of o.querySelectorAll('img[src], input[type="image"][src], video[poster], svg image')){const s=t.getAttribute("src")||t.getAttribute("poster")||t.getAttribute("href")||t.getAttribute("xlink:href");s&&r.push(s)}for(const t of o.querySelectorAll("img[data-zoom-src]"))r.push(t.getAttribute("data-zoom-src"));for(const t of o.querySelectorAll("img[srcset], picture source[srcset]"))for(const s of t.getAttribute("srcset").matchAll(/(?:^|,\s*)((?:https?:)?\/\/[^\s,]+)/g))r.push(s[1]);const i=[...o.querySelectorAll("[style]")].map(t=>t.getAttribute("style")).concat([...o.querySelectorAll("style")].map(t=>t.textContent)).join(`
|
|
2
|
+
`);for(const t of i.matchAll(/url\(\s*(?:"([^"\n]*)"|'([^'\n]*)'|([^\s)]+))\s*\)/gi))r.push(t[1]??t[2]??t[3]);return r}export function externalImageHosts(o,r,i=[]){const t=new URL(r),s=new Set(i),n=new Map;for(const l of o){let e;try{e=new URL(l,t)}catch{continue}if(!["https:","http:"].includes(e.protocol)||e.origin===t.origin)continue;const c=e.protocol==="https:"&&!e.port&&/^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/.test(e.hostname),a=c&&s.has(e.hostname);n.has(e.origin)||n.set(e.origin,{origin:e.origin,host:e.hostname,allowed:a,eligible:c,count:0,status:a?"Allowed":c?"Blocked by image policy":"Use an HTTPS URL with a standard hostname and port"}),n.get(e.origin).count++}return[...n.values()].sort((l,e)=>l.origin.localeCompare(e.origin))}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{enhanceFontSelect as te}from"./font-picker.js";import{replaceRange as de}from"./markdown-toolbar.js";import{boolState as pe,boolValue as me,parseAttrs as ne,serialiseTag as oe,setAttrs as ue}from"./shortcode-tags.js";import{SHORTCODES as fe}from"./shortcode-registry.js";import{clearLookupCache as he,lookupOptions as be}from"./shortcode-lookups.js";import{PREVIEW_RENDERERS as ge}from"./shortcode-preview.js";import{dommaHelp as xe,whenCatalogue as ye}from"./domma-catalogue.js";import{SHORTCODE_EXPIRY_FIELDS as ve}from"../../../public/js/shortcode-expiry.mjs";import{makeCheckbox as Ee,makeColourInput as Ce,makeField as v,makeIconInput as le,makeImageInput as se,makeLivePreview as we,makeSelect as
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
`)}export function emitSnippet(e,n,
|
|
1
|
+
import{enhanceFontSelect as te}from"./font-picker.js";import{replaceRange as de}from"./markdown-toolbar.js";import{boolState as pe,boolValue as me,parseAttrs as ne,serialiseTag as oe,setAttrs as ue}from"./shortcode-tags.js";import{SHORTCODES as fe}from"./shortcode-registry.js";import{clearLookupCache as he,lookupOptions as be}from"./shortcode-lookups.js";import{PREVIEW_RENDERERS as ge}from"./shortcode-preview.js";import{dommaHelp as xe,whenCatalogue as ye}from"./domma-catalogue.js";import{SHORTCODE_EXPIRY_FIELDS as ve}from"../../../public/js/shortcode-expiry.mjs";import{makeCheckbox as Ee,makeColourInput as Ce,makeField as v,makeIconInput as le,makeImageInput as se,makeLivePreview as we,makeSelect as H,makeTextInput as Y}from"./shortcode-modal.js";const ke=new Map(fe.map(e=>[e.name,e])),re=new Set(ve.map(e=>e.name)),ie=6;export function templateAttrs(e){const n=String(e.template||"").match(new RegExp(`^\\[${e.name}([\\s\\S]*?)\\s*/?\\]`));return n?ne(n[1]):{}}export function templateBody(e){if(e.selfClosing)return"";const n=String(e.template||"").match(new RegExp(`^\\[${e.name}[^\\]]*\\]([\\s\\S]*)\\[/${e.name}\\]$`));return n?n[1].replace(/^\n/,"").replace(/\n$/,""):""}export function templateChildren(e){if(!e.children)return[];const n=e.children.name,l=new RegExp(`\\[${n}([^\\]]*)\\]([\\s\\S]*?)\\[/${n}\\]`,"g"),d=[];for(const s of templateBody(e).matchAll(l))d.push({attrs:ne(s[1]),body:s[2].replace(/^\n/,"").replace(/\n$/,"")});return d}const Se=new Set(["lookup","url"]);export function seedAttrs(e,n){const l=new Map((e.attrs||[]).map(s=>[s.name,s.type])),d={};for(const[s,p]of Object.entries(n))Se.has(l.get(s))||(d[s]=p);return d}export function buildSnippet(e,n,l=""){const d=oe(e.name,n,e.selfClosing);if(e.selfClosing)return d;const s=`[/${e.name}]`;return e.inline?`${d}${l}${s}`:`${d}
|
|
2
|
+
${l}
|
|
3
|
+
${s}`}export function buildChildrenBody(e,n){return n.map(l=>buildSnippet(e,l.attrs,l.body)).join(`
|
|
4
|
+
`)}export function emitSnippet(e,n,l,d){const s=(e.formats||[]).find(p=>p.value===d);if(s&&typeof s.emit=="function"){const p=s.emit(n,l);if(p!=null)return p}return buildSnippet(e,n,l)}const Le="display:block;font-size:.7rem;font-weight:600;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;margin-bottom:.25rem;";function ae(e,n,l,d){const s=n===!0||n==null?"":String(n);if(e.type==="checkbox"){const i=Ee(e.label),c=i.querySelector("input");return c.checked=pe(n,e.default),c.addEventListener("change",l),{el:i,bare:!0,get:()=>me(e,c.checked)}}if(e.type==="select"){const i=e.options.some(([h])=>h==="")?e.options:[["","- none -"],...e.options],c=H(i);c.value=s,c.addEventListener("change",l);const w=v(e.label,c);return e.name==="font"&&te(c,{label:e.label}),{el:w,get:()=>c.value||null}}if(e.type==="icon"){const{el:i,input:c}=le("icon name (optional)",s);return c.addEventListener("input",l),{el:v(e.label,i),get:()=>c.value.trim()||null}}if(e.type==="image"){const{el:i,input:c}=se("/media/photo.jpg",s);return c.addEventListener("input",l),{el:v(e.label,i),get:()=>c.value.trim()||null}}if(e.type==="colour"){const{el:i,input:c}=Ce("#0f172a or a theme colour",s);return c.addEventListener("input",l),{el:v(e.label,i),get:()=>c.value.trim()||null}}if(e.type==="lookup"){const i=H([["","Loading\u2026"]]);i.disabled=!0,i.addEventListener("change",l);let c;const w=()=>{const h=d(),P=e.source==="collection-fields"?String(h.slug??""):e.source;P!==c&&(c=P,i.disabled=!0,be(e.source,h).then(f=>{const y=i.value||s,g=f.some(([T])=>T===y),k=[["","- none -"],...f];y&&!g&&k.push([y,`${y} (missing)`]),i.replaceChildren();for(const[T,x]of k){const $=document.createElement("option");$.value=T,$.textContent=x,i.appendChild($)}i.value=y,i.disabled=!1,l()}))};return w(),{el:v(e.label,i),get:()=>i.value||null,refresh:e.source==="collection-fields"?w:null}}const p=Y(e.placeholder||(e.type==="url"?"/about or https://example.com":""),s);return e.type==="number"&&(p.type="number"),p.addEventListener("input",l),{el:v(e.label,p),get:()=>p.value.trim()||null}}function Te(e,n){const l=document.createElement("small");l.className="sc-attr-help",l.style.cssText="display:block;margin-top:.2rem;font-size:.75em;color:var(--dm-text-muted,#999);",l.textContent=n,e.appendChild(l)}function $e(e,n){ye(l=>{const d=xe(l,n);if(!d)return;const s=document.createElement("small");s.className="sc-domma-help",s.style.cssText="display:block;margin-top:.2rem;font-size:.75em;color:var(--dm-text-muted,#999);",s.textContent=d,e.appendChild(s)})}export function openShortcodeForm(e,n,l={}){const{span:d=null,defaults:s=null}=l,p=!!d;he();const i=e.selectionStart,c=e.selectionEnd,w=e.value.slice(i,c),h=n.children?ke.get(n.children.name):null,P={...seedAttrs(n,templateAttrs(n)),...s||{}},f=document.createElement("div");f.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const y=[],g=[];let k=()=>{};const T=()=>{const t={};for(const{attr:o,w:m}of y){const a=m.get();a!=null&&a!==""&&(t[o.name]=a)}return t},x=()=>k(),$=()=>T();let N=null;!p&&n.formats?.length&&(N=H(n.formats.map(t=>[t.value,t.label])),N.addEventListener("change",x),f.appendChild(v("Format",N)));const R=n.attrs||[],_=R.length>ie+2?ie:R.length,q=(t,o)=>{const m=p?d.attrs[t.name]:P[t.name],a=ae(t,m,x,$);y.push({attr:t,w:a,initial:a.get()});const b=(t.domma||t.help)&&a.bare?document.createElement("div"):a.el;b!==a.el&&b.appendChild(a.el),o.appendChild(b),t.help&&Te(b,t.help),t.domma&&$e(b,t)};for(const t of R.slice(0,_))q(t,f);if(_<R.length){const t=document.createElement("details");t.style.cssText="border-top:1px solid var(--dm-border,#333);padding-top:.6rem;";const o=document.createElement("summary");o.textContent=`More options (${R.length-_})`,o.style.cssText="cursor:pointer;font-size:.75rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",t.appendChild(o);const m=document.createElement("div");m.style.cssText="display:flex;flex-direction:column;gap:.75rem;padding-top:.75rem;",t.appendChild(m);for(const a of R.slice(_))q(a,m);f.appendChild(t)}let S=null,L=null;const M=document.createElement("div");if(!p&&h){const t=document.createElement("div");t.style.cssText=Le,t.textContent=`${h.label}s`,f.appendChild(t),M.style.cssText="display:flex;flex-direction:column;gap:.4rem;",f.appendChild(M),L=document.createElement("button"),L.type="button",L.textContent=`+ Add ${h.label.toLowerCase()}`,L.style.cssText="padding:.35rem .75rem;background:transparent;border:1px dashed var(--dm-border,#555);border-radius:4px;color:var(--dm-text-muted,#aaa);cursor:pointer;font-size:.85em;align-self:flex-start;",L.addEventListener("click",()=>{V({attrs:{},body:templateBody(h)||"Content"}),k()}),f.appendChild(L);const o=templateChildren(n),m=o.length?o:[{attrs:{},body:"Content"}];for(const a of m)V({attrs:seedAttrs(h,a.attrs),body:a.body});w&&(g[0].bodyInput.value=w)}else!p&&!n.selfClosing&&(S=document.createElement("textarea"),S.rows=n.inline?2:4,S.value=w||templateBody(n),S.style.cssText="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;font-family:inherit;box-sizing:border-box;resize:vertical;",S.addEventListener("input",x),f.appendChild(v("Content",S)));function V(t){if(g.length>=(n.children.max??20))return;const o=document.createElement("div");o.style.cssText="display:flex;flex-direction:column;gap:.25rem;";const m=document.createElement("div");m.style.cssText="display:flex;gap:.35rem;align-items:center;",o.appendChild(m);const a=[],b=(h.attrs||[]).filter(r=>!re.has(r.name)),W=(h.attrs||[]).filter(r=>re.has(r.name));for(const r of b)if(r.type==="icon"){const{el:u,input:C}=le(r.label.toLowerCase(),t.attrs[r.name]||"");u.style.flex=".7",C.addEventListener("input",x),a.push({attr:r,get:()=>C.value.trim()||null}),m.appendChild(u)}else if(r.type==="image"){const{el:u,input:C}=se(r.label,t.attrs[r.name]||"");u.style.flex="1",C.addEventListener("input",x),a.push({attr:r,get:()=>C.value.trim()||null}),m.appendChild(u)}else if(r.type==="select"){const u=H(r.options);u.value=t.attrs[r.name]||r.options[0][0],u.style.flex=".7",u.addEventListener("change",x),a.push({attr:r,get:()=>u.value||null}),m.appendChild(u),r.name==="font"&&te(u,{label:r.label})}else{const u=Y(r.label,t.attrs[r.name]||"");u.style.flex="1",u.addEventListener("input",x),a.push({attr:r,get:()=>u.value.trim()||null}),m.appendChild(u)}const F=Y("Content",t.body||"");F.style.flex="1.2",F.addEventListener("input",x),m.appendChild(F);const A=document.createElement("button");if(A.type="button",A.textContent="\xD7",A.style.cssText="padding:.3rem .5rem;background:transparent;border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text-muted,#aaa);cursor:pointer;font-size:.85em;flex-shrink:0;",W.length){const r=document.createElement("details");r.style.cssText="margin-left:.15rem;";const u=document.createElement("summary");u.textContent="Expiry",u.style.cssText="cursor:pointer;font-size:.7rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",r.appendChild(u);const C=document.createElement("div");C.style.cssText="display:flex;flex-direction:column;gap:.6rem;padding:.5rem 0 .25rem .75rem;",r.appendChild(C);for(const O of W){const ee=ae(O,t.attrs[O.name],x,$);a.push({attr:O,get:ee.get}),C.appendChild(ee.el)}W.some(O=>t.attrs[O.name]!=null)&&(r.open=!0),o.appendChild(r)}const Z={row:o,fields:a,bodyInput:F,remove:A};A.addEventListener("click",()=>{g.length<=(n.children.min??1)||(g.splice(g.indexOf(Z),1),o.remove(),k())}),m.appendChild(A),g.push(Z),M.appendChild(o),window.I?.scan?.(o)}const X=ge[n.preview];let I=null;if(X){const t=document.createElement("div");t.style.cssText="background:var(--dm-background-alt,#111);border:1px solid var(--dm-border,#333);border-radius:4px;padding:.75rem;min-height:2.5rem;display:flex;align-items:center;overflow-x:auto;",I=document.createElement("span"),t.appendChild(I),f.appendChild(v("Preview",t))}const K=we();f.appendChild(v(p?"Tag preview":"Shortcode preview",K.el));const D=document.createElement("div");D.style.cssText="display:flex;justify-content:flex-end;gap:.75rem;padding-top:.75rem;border-top:1px solid var(--dm-border,#333);";const B=document.createElement("button");B.type="button",B.className="btn btn-ghost",B.textContent="Cancel";const z=document.createElement("button");z.type="button",z.className="btn btn-primary",z.textContent=p?"Apply":`Insert ${n.label}`,D.appendChild(B),D.appendChild(z),f.appendChild(D);const G=()=>h&&g.length?buildChildrenBody(h,g.map(t=>({attrs:Object.fromEntries(t.fields.map(o=>[o.attr.name,o.get()]).filter(([,o])=>o!=null)),body:t.bodyInput.value}))):S?S.value:templateBody(n),J=()=>emitSnippet(n,T(),G(),N?.value),ce=t=>{if(n.inline||n.selfClosing||!t.startsWith("["))return t;const o=e.value.slice(0,i),m=e.value.slice(c),a=o===""||o.endsWith(`
|
|
5
5
|
`)?"":`
|
|
6
|
-
`,
|
|
6
|
+
`,b=m===""||m.startsWith(`
|
|
7
7
|
`)?"":`
|
|
8
|
-
`;return`${
|
|
8
|
+
`;return`${a}${t}${b}`};k=()=>{L&&(L.disabled=g.length>=(n.children.max??20));for(const{w:t}of y)t.refresh?.();if(I){const t=X(p?{...d.attrs,...Q()}:T(),p?"":G());I.style.cssText=t.css,I.textContent=t.text}K.update(p?oe(d.name,{...d.attrs,...U()},d.selfClosing,{keepEmpty:!!n.block}):J())};function Q(){const t={};for(const{attr:o,w:m,initial:a}of y){const b=m.get();b!==a&&(t[o.name]=b)}return t}function U(){const t=Q();if(n.block)for(const o of Object.keys(t))t[o]==null&&(t[o]="");return t}const j=E.slideover({title:p?`Edit ${n.label}`:`Insert ${n.label}`,size:h?"lg":"md",position:"right",content:f});return j.open(),window.I?.scan?.(f),k(),B.addEventListener("click",()=>j.close()),z.addEventListener("click",()=>{if(j.close(),p)ue(e,d,U(),{keepEmpty:!!n.block});else{const t=ce(J());de(e,i,c,t),e.setSelectionRange(i+t.length,i+t.length)}e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()}),requestAnimationFrame(()=>{f.querySelector("input:not([type=checkbox]):not([type=color]), select, textarea")?.focus()}),j}
|
|
@@ -44,4 +44,4 @@ Optional body content.
|
|
|
44
44
|
[/table]`,attrs:[{name:"striped",type:"checkbox",label:"Striped"},{name:"bordered",type:"checkbox",label:"Bordered"},{name:"compact",type:"checkbox",label:"Compact"},{name:"caption",type:"text",label:"Caption"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"badge",label:"Badge",icon:"badge",category:"Content",selfClosing:!1,container:!1,wrappable:!1,template:'[badge variant="success"]New[/badge]',inline:!0,attrs:[{name:"variant",type:"select",label:"Variant",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"],["light","Light"],["dark","Dark"]]},{name:"pill",type:"checkbox",label:"Pill"},{name:"outline",type:"checkbox",label:"Outline"},{name:"size",type:"select",label:"Size",options:[["","Default"],["small","Small"],["large","Large"]]}]},{name:"text",label:"Text",icon:"text-style",preview:"text",category:"Content",selfClosing:!1,container:!0,wrappable:!0,template:"[text]Styled text[/text]",inline:!0,actions:[{label:"Highlight - gradient with a shine",icon:"star",set:{gradient:"sunset",shine:"hover"}},{label:"Highlight that sweeps by itself",icon:"star",set:{gradient:"sunset",shine:"sweep"}},{label:"Light up as you read",icon:"eye",set:{"light-up":"true"}},{label:"Rise in word by word",icon:"arrow-up",set:{words:"true"}},{label:"Plain - no highlight or motion",icon:"minimize",set:{gradient:null,shine:null,"light-up":null,words:null}}],quickAttrs:["gradient","shine","align","size","bold","color"],attrs:[{name:"size",type:"select",label:"Size",options:[["xs","XS"],["sm","Small"],["base","Base"],["lg","Large"],["xl","XL"],["2xl","2XL"],["3xl","3XL"],["4xl","4XL"]]},{name:"weight",type:"select",label:"Weight",options:[["thin","Thin"],["light","Light"],["normal","Normal"],["medium","Medium"],["semibold","Semibold"],["bold","Bold"],["extrabold","Extra bold"],["black","Black"]]},{name:"point-size",type:"number",label:"Point size"},{name:"bold",type:"checkbox",label:"Bold"},{name:"italic",type:"checkbox",label:"Italic"},{name:"color",type:"colour",label:"Colour"},{name:"font",type:"select",label:"Font",options:Object.keys(l).map(e=>[e,n(e)?`${e} (licensed)`:e])},{name:"transform",type:"select",label:"Transform",options:[["upper","Uppercase"],["lower","Lowercase"],["capitalize","Capitalise"],["none","None"]]},{name:"decoration",type:"select",label:"Decoration",options:[["underline","Underline"],["line-through","Line through"],["none","None"]]},{name:"spacing",type:"select",label:"Letter spacing",options:[["tight","Tight"],["normal","Normal"],["wide","Wide"],["wider","Wider"]]},{name:"align",type:"select",label:"Align",options:[["","None"],["left","Left"],["center","Centre"],["right","Right"],["justify","Justify"]]},{name:"gradient",type:"select",label:"Gradient",options:[["","None"],["brand","Theme"],["sunset","Sunset"],["ocean","Ocean"],["forest","Forest"],["fire","Fire"],["candy","Candy"],["newspaper","Newspaper"],["grey-fire","Grey-fire"],["ice","Ice"],["summer","Summer"],["autumn","Autumn"],["spring","Spring"],["winter","Winter"],["aurora","Aurora"],["twilight","Twilight"],["rose-gold","Rose-gold"],["copper","Copper"],["amethyst","Amethyst"],["lagoon","Lagoon"],["cherry","Cherry"],["lavender","Lavender"],["midnight","Midnight"]]},{name:"shine",type:"select",label:"Shine (gradient)",options:[["","None"],["hover","Follows the pointer"],["sweep","Sweeps across"]]},{name:"light-up",type:"checkbox",label:"Words light up as you scroll"},{name:"words",type:"checkbox",label:"Rise in word by word"},{name:"style",type:"text",label:"Inline CSS"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"button",label:"Button",icon:"btn-insert",category:"Content",selfClosing:!0,container:!1,wrappable:!1,template:'[button href="/contact" variant="primary" label="Get in touch" /]',attrs:[{name:"href",type:"url",label:"Link"},{name:"label",type:"text",label:"Label"},{name:"variant",type:"select",label:"Variant",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"],["outline","Outline"],["ghost","Ghost"],["link","Link"],["outline-success","Outline success"],["outline-danger","Outline danger"],["outline-warning","Outline warning"],["outline-info","Outline info"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"icon",type:"icon",label:"Icon (before)"},{name:"icon-after",type:"icon",label:"Icon (after)"},{name:"target",type:"text",label:"Target"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"link",label:"Link",icon:"link-shortcode",category:"Content",selfClosing:!0,container:!1,wrappable:!1,template:'[link href="/about" label="About us" /]',formats:[{value:"markdown",label:"Markdown link",emit:e=>Object.keys(e).some(t=>t!=="href"&&t!=="label"&&e[t])||!e.href?null:`[${e.label||e.href}](${e.href})`},{value:"shortcode",label:"Link shortcode"}],attrs:[{name:"href",type:"url",label:"Link"},{name:"label",type:"text",label:"Label"},{name:"target",type:"text",label:"Target"},{name:"class",type:"text",label:"CSS class"},{name:"icon",type:"icon",label:"Icon (before)"},{name:"icon-after",type:"icon",label:"Icon (after)"},{name:"id",type:"text",label:"ID"}]},{name:"listgroup",label:"List group",icon:"list",category:"Content",selfClosing:!1,container:!0,wrappable:!1,template:`[listgroup]
|
|
45
45
|
[item]First item[/item]
|
|
46
46
|
[item]Second item[/item]
|
|
47
|
-
[/listgroup]`,children:{name:"item",min:1,max:20},attrs:[{name:"variant",type:"select",label:"Variant",options:[["","Default"],["flush","Flush"],["numbered","Numbered"],["horizontal","Horizontal"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"itemvariant",type:"select",label:"Item variant",options:[["","Default"],["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"action",type:"checkbox",label:"Actionable items"}]},{name:"collection",label:"Collection",icon:"database",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[collection slug="enquiries" display="table" /]',attrs:[{name:"slug",type:"lookup",source:"collections",label:"Collection"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"limit",type:"number",label:"Limit"},{name:"sort",type:"lookup",source:"collection-fields",label:"Sort field"},{name:"order",type:"select",label:"Order",options:[["desc","Descending"],["asc","Ascending"]]},{name:"title-field",type:"lookup",source:"collection-fields",label:"Title field"},{name:"image-field",type:"lookup",source:"collection-fields",label:"Image field"},{name:"body-field",type:"lookup",source:"collection-fields",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"search",type:"checkbox",label:"Search (table)",default:!0},{name:"sortable",type:"checkbox",label:"Sortable (table)",default:!0},{name:"exportable",type:"checkbox",label:"CSV export"},{name:"page-size",type:"number",label:"Page size"},{name:"empty",type:"text",label:"Empty message"},{name:"scope",type:"select",label:"Scope",options:[["","All"],["mine","Current user"]]},{name:"cta",type:"lookup",source:"actions",label:"CTA action"},{name:"cta-label",type:"text",label:"CTA label"},{name:"cta-icon",type:"icon",label:"CTA icon"},{name:"cta-style",type:"select",label:"CTA style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"cta-confirm",type:"text",label:"CTA confirm text"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"view",label:"View",icon:"eye",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[view slug="products" display="table" limit="50" /]',attrs:[{name:"slug",type:"lookup",source:"views",label:"View"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"limit",type:"number",label:"Limit"},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"title-field",type:"text",label:"Title field"},{name:"image-field",type:"text",label:"Image field"},{name:"body-field",type:"text",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"empty",type:"text",label:"Empty message"}]},{name:"block",label:"Block",icon:"layout",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[block template="post-card" title="My Post" /]',attrs:[{name:"template",type:"lookup",source:"blocks",label:"Template"}]},{name:"form",label:"Form",icon:"file-text",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[form name="contact" /]',attrs:[{name:"name",type:"lookup",source:"forms",label:"Form"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"cta",label:"CTA",icon:"mouse-pointer",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[cta action="send-welcome" entry="abc123" style="primary" label="Send" /]',attrs:[{name:"action",type:"lookup",source:"actions",label:"Action"},{name:"entry",type:"text",label:"Entry ID"},{name:"style",type:"select",label:"Style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"icon",type:"icon",label:"Icon"},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"confirm",type:"text",label:"Confirm text"},{name:"label",type:"text",label:"Label"}]},{name:"menu",label:"Menu",icon:"menu",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[menu slug="legal" /]',attrs:[{name:"slug",type:"lookup",source:"menus",label:"Menu"},{name:"location",type:"lookup",source:"menu-locations",label:"Location slot"},{name:"variant",type:"text",label:"Variant"},{name:"class",type:"text",label:"CSS class"},{name:"depth",type:"number",label:"Max depth"},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"float",type:"select",label:"Floating",options:[["","Menu default"],["no","Render inline here"]]}]},{name:"contents",label:"Page contents (this page)",icon:"list",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[contents numbered="true" /]',actions:[{label:"Number the contents",icon:"hash",set:{numbered:"true"}},{label:"List H2 and H3 headings",icon:"list",set:{headings:"h2h3"}},{label:"Contents on the right",icon:"sidebar-right",set:{side:"right"}},{label:"Collapse the contents to a button",icon:"minimize",set:{collapsible:"true",collapsed:"true"}},{label:"Float the contents",icon:"move",set:{floating:"true","float-anchor":"TR",movable:"true"}},{label:"No contents on this page",icon:"eye-off",set:{hidden:"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["side","headings","numbered","title","collapsible","floating","hidden"],attrs:[{name:"side",type:"select",label:"Side",options:[["","Layout default"],["left","Left"],["right","Right"]]},{name:"width",type:"number",label:"Width (px, 160-480)"},{name:"headings",type:"select",label:"Headings",options:[["","Layout default"],["auto","Sections (H2s, else H3s)"],["h2","H2 only"],["h3","H3 only"],["h2h3","H2 and H3"]]},{name:"numbered",type:"select",label:"Numbered",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"title",type:"text",label:"Title above the list"},{name:"exclude",type:"text",label:"Leave out (headings, comma separated)"},{name:"sticky",type:"select",label:"Stays in view",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"scroll-spy",type:"select",label:"Marks the section being read",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsible",type:"select",label:"Collapsible to a button",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off its edge",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"floating",type:"select",label:"Floating panel",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Layout default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"movable",type:"select",label:"Visitors can move it",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hidden",type:"select",label:"No contents on this page",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Accent"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"}]},{name:"navbar",label:"Navbar settings (this page)",icon:"sliders",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[navbar collapsed="true" /]',actions:[{label:"Collapse the rail on this page",icon:"chevrons-right",set:{collapsible:"true",collapsed:"true",autohide:"false"}},{label:"Autohide the rail on this page",icon:"eye-off",set:{autohide:"true",collapsed:null}},{label:"Keep the rail open on this page",icon:"eye",set:{autohide:"false",collapsed:"false"}},{label:"Hide the bar on scroll on this page",icon:"arrow-up",set:{"hide-on-scroll":"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["position","width","collapsible","collapsed","autohide","hide-on-scroll"],attrs:[{name:"position",type:"select",label:"Position",options:[["","Menu default"],["sticky","Sticky"],["fixed","Fixed"],["static","Static"],["floating","Floating"]]},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"side",type:"select",label:"Rail side",options:[["","Menu default"],["left","Left"],["right","Right"]]},{name:"align",type:"select",label:"Alignment",options:[["","Menu default"],["left","Left"],["centre","Centre"],["right","Right"],["spread","Spread"]]},{name:"width",type:"number",label:"Rail width (px, 160-480)"},{name:"collapsible",type:"select",label:"Collapsible to icons",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off-screen",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hide-on-scroll",type:"select",label:"Hide on scroll (bar)",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover-open",type:"select",label:"Open dropdowns on hover",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"bar",type:"select",label:"Bar shape",options:[["","Menu default"],["pill","Pill"],["segmented","Segmented"],["underline","Underline glide"],["dock","Dock"],["neon","Neon"],["tabs","Tabs"],["tiles","Tiles"],["bubbles","Bubbles"],["brutalist","Brutalist"],["gradient","Gradient band"]]},{name:"shrink",type:"select",label:"Shrink on scroll",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"icons",type:"select",label:"Bar icons",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Accent"]]},{name:"brand",type:"select",label:"Branding shape",options:[["","Menu default"],["pill","Pill"]]},{name:"strip",type:"select",label:"Bar background",options:[["","Menu default"],["none","None - floating pills"],["band","Strip - keep the band"]]},{name:"dropdown",type:"select",label:"Dropdown style",options:[["","Menu default"],["cards","Cards"]]},{name:"tiles",type:"select",label:"Icon tiles (cards)",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Theme colour"],["neutral","Neutral"],["none","No tiles"]]},{name:"morph",type:"select",label:"Slide between cards",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Highlight colour"},{name:"variant",type:"text",label:"Variant"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"},{name:"letter-spacing",type:"text",label:"Letter spacing"},{name:"icon-size",type:"text",label:"Icon size"},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Menu default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"float-x",type:"number",label:"Float offset X (px)"},{name:"float-y",type:"number",label:"Float offset Y (px)"},{name:"float-width",type:"number",label:"Float width (px)"},{name:"float-collapsible",type:"select",label:"Float: collapsible",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"float-movable",type:"select",label:"Float: movable",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"class",type:"text",label:"CSS classes"}]},{name:"theme-switcher",label:"Theme switcher",icon:"palette",category:"Components",selfClosing:!0,container:!1,wrappable:!1,template:"[theme-switcher /]",attrs:[{name:"position",type:"select",label:"Position",options:[["","Inline - where the tag is"],["top-left","Top left"],["top-right","Top right"],["left-center","Left, centred"],["right-center","Right, centred"],["bottom-left","Bottom left"],["bottom-right","Bottom right"]]},{name:"offset-x",type:"number",label:"Offset from the side (px, pinned only)"},{name:"offset-y",type:"number",label:"Offset from the top/bottom (px, pinned only)"},{name:"themes",type:"text",label:"Themes (comma list - blank for the site's)"}]},{name:"icon",label:"Icon",icon:"icon-pick",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[icon name="arrow-right" /]',attrs:[{name:"name",type:"icon",label:"Icon name"},{name:"size",type:"number",label:"Size (px)"},{name:"color",type:"colour",label:"Colour"},{name:"class",type:"text",label:"CSS class"}]},{name:"embed",label:"Embed",icon:"video",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[embed url="https://youtu.be/dQw4w9WgXcQ" /]',custom:"embed",attrs:[{name:"url",type:"url",label:"URL"},{name:"ratio",type:"select",label:"Aspect ratio",options:[["16:9","16:9"],["4:3","4:3"],["1:1","1:1"],["21:9","21:9"],["9:16","9:16"],["3:4","3:4"]]},{name:"title",type:"text",label:"Title / caption"},{name:"width",type:"text",label:"Width"},{name:"align",type:"select",label:"Alignment",options:[["left","Left"],["center","Centre"],["right","Right"]]},{name:"autoplay",type:"checkbox",label:"Autoplay"},{name:"loop",type:"checkbox",label:"Loop"},{name:"muted",type:"checkbox",label:"Muted"}]}];for(const e of SHORTCODES){e.attrs||(e.attrs=[]);for(const a of o)e.attrs.some(t=>t.name===a.name)||e.attrs.push(a)}export const EDITOR_TOOLS=[{name:"image",label:"Image",icon:"image-add",category:"Media",custom:"image"},{name:"colourpick",label:"Colour picker",icon:"colour-picker",category:"Media",custom:"colourpick"},{name:"component",label:"Component",icon:"component",category:"Components",custom:"component"},{name:"scribe",label:"Scribe",icon:"scribe-insert",category:"Content",custom:"scribe"},{name:"highlight-text",label:"Highlight text",icon:"star",category:"Content",custom:"highlighttext",wrappable:!0}];
|
|
47
|
+
[/listgroup]`,children:{name:"item",min:1,max:20},attrs:[{name:"variant",type:"select",label:"Variant",options:[["","Default"],["flush","Flush"],["numbered","Numbered"],["horizontal","Horizontal"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"itemvariant",type:"select",label:"Item variant",options:[["","Default"],["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"action",type:"checkbox",label:"Actionable items"}]},{name:"collection",label:"Collection",icon:"database",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[collection slug="enquiries" display="table" /]',attrs:[{name:"slug",type:"lookup",source:"collections",label:"Collection"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"limit",type:"number",label:"Limit"},{name:"sort",type:"lookup",source:"collection-fields",label:"Sort field"},{name:"order",type:"select",label:"Order",options:[["desc","Descending"],["asc","Ascending"]]},{name:"title-field",type:"lookup",source:"collection-fields",label:"Title field"},{name:"image-field",type:"lookup",source:"collection-fields",label:"Image field"},{name:"body-field",type:"lookup",source:"collection-fields",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"search",type:"checkbox",label:"Search (table)",default:!0},{name:"sortable",type:"checkbox",label:"Sortable (table)",default:!0},{name:"exportable",type:"checkbox",label:"CSV export"},{name:"page-size",type:"number",label:"Page size"},{name:"empty",type:"text",label:"Empty message"},{name:"scope",type:"select",label:"Scope",options:[["","All"],["mine","Current user"]]},{name:"cta",type:"lookup",source:"actions",label:"CTA action"},{name:"cta-label",type:"text",label:"CTA label"},{name:"cta-icon",type:"icon",label:"CTA icon"},{name:"cta-style",type:"select",label:"CTA style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"cta-confirm",type:"text",label:"CTA confirm text"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"view",label:"View",icon:"eye",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[view slug="products" display="table" limit="50" /]',attrs:[{name:"slug",type:"lookup",source:"views",label:"View"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"limit",type:"number",label:"Limit"},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"title-field",type:"text",label:"Title field"},{name:"image-field",type:"text",label:"Image field"},{name:"body-field",type:"text",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"empty",type:"text",label:"Empty message"}]},{name:"block",label:"Block",icon:"layout",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[block template="post-card" title="My Post" /]',attrs:[{name:"template",type:"lookup",source:"blocks",label:"Template"}]},{name:"form",label:"Form",icon:"file-text",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[form name="contact" /]',attrs:[{name:"name",type:"lookup",source:"forms",label:"Form"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"cta",label:"CTA",icon:"mouse-pointer",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[cta action="send-welcome" entry="abc123" style="primary" label="Send" /]',attrs:[{name:"action",type:"lookup",source:"actions",label:"Action"},{name:"entry",type:"text",label:"Entry ID"},{name:"style",type:"select",label:"Style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"icon",type:"icon",label:"Icon"},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"confirm",type:"text",label:"Confirm text"},{name:"label",type:"text",label:"Label"}]},{name:"menu",label:"Menu",icon:"menu",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[menu slug="legal" /]',attrs:[{name:"slug",type:"lookup",source:"menus",label:"Menu"},{name:"location",type:"lookup",source:"menu-locations",label:"Location slot"},{name:"variant",type:"text",label:"Variant"},{name:"class",type:"text",label:"CSS class"},{name:"depth",type:"number",label:"Max depth"},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"float",type:"select",label:"Floating",options:[["","Menu default"],["no","Render inline here"]]}]},{name:"contents",label:"Page contents (this page)",icon:"list",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[contents numbered="true" /]',actions:[{label:"Number the contents",icon:"hash",set:{numbered:"true"}},{label:"List H2 and H3 headings",icon:"list",set:{headings:"h2h3"}},{label:"Contents on the right",icon:"sidebar-right",set:{side:"right"}},{label:"Collapse the contents to a button",icon:"minimize",set:{collapsible:"true",collapsed:"true"}},{label:"Float the contents",icon:"move",set:{floating:"true","float-anchor":"TR",movable:"true"}},{label:"No contents on this page",icon:"eye-off",set:{hidden:"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["side","headings","numbered","title","collapsible","floating","hidden"],attrs:[{name:"side",type:"select",label:"Side",options:[["","Layout default"],["left","Left"],["right","Right"]]},{name:"width",type:"number",label:"Width (px, 160-480)"},{name:"headings",type:"select",label:"Headings",options:[["","Layout default"],["auto","Sections (H2s, else H3s)"],["h2","H2 only"],["h3","H3 only"],["h2h3","H2 and H3"]]},{name:"numbered",type:"select",label:"Numbered",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"title",type:"text",label:"Title above the list"},{name:"exclude",type:"text",label:"Leave out (headings, comma separated)"},{name:"sticky",type:"select",label:"Stays in view",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"scroll-spy",type:"select",label:"Marks the section being read",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsible",type:"select",label:"Collapsible to a button",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off its edge",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"floating",type:"select",label:"Floating panel",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Layout default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"movable",type:"select",label:"Visitors can move it",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hidden",type:"select",label:"No contents on this page",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Accent"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"}]},{name:"navbar",label:"Navbar settings (this page)",icon:"sliders",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[navbar collapsed="true" /]',actions:[{label:"Collapse the rail on this page",icon:"chevrons-right",set:{collapsible:"true",collapsed:"true",autohide:"false"}},{label:"Autohide the rail on this page",icon:"eye-off",set:{autohide:"true",collapsed:null}},{label:"Keep the rail open on this page",icon:"eye",set:{autohide:"false",collapsed:"false"}},{label:"Hide the bar on scroll on this page",icon:"arrow-up",set:{"hide-on-scroll":"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["position","width","collapsible","collapsed","autohide","hide-on-scroll"],attrs:[{name:"position",type:"select",label:"Position",options:[["","Menu default"],["sticky","Sticky"],["fixed","Fixed"],["static","Static"],["floating","Floating"]]},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"side",type:"select",label:"Rail side",options:[["","Menu default"],["left","Left"],["right","Right"]]},{name:"align",type:"select",label:"Alignment",options:[["","Menu default"],["left","Left"],["centre","Centre"],["right","Right"],["spread","Spread"]]},{name:"width",type:"number",label:"Rail width (px, 160-480)"},{name:"collapsible",type:"select",label:"Collapsible to icons",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off-screen",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hide-on-scroll",type:"select",label:"Hide on scroll (bar)",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover-open",type:"select",label:"Open dropdowns on hover",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"bar",type:"select",label:"Bar shape",options:[["","Menu default"],["pill","Pill"],["segmented","Segmented"],["underline","Underline glide"],["dock","Dock"],["neon","Neon"],["tabs","Tabs"],["tiles","Tiles"],["bubbles","Bubbles"],["brutalist","Brutalist"],["gradient","Gradient band"]]},{name:"shrink",type:"select",label:"Shrink on scroll",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"icons",type:"select",label:"Bar icons",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Accent"]]},{name:"brand",type:"select",label:"Branding shape",options:[["","Menu default"],["pill","Pill"]]},{name:"strip",type:"select",label:"Bar background",options:[["","Menu default"],["none","None - floating pills"],["band","Strip - keep the band"]]},{name:"dropdown",type:"select",label:"Dropdown style",options:[["","Menu default"],["cards","Cards"]]},{name:"tiles",type:"select",label:"Icon tiles (cards)",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Theme colour"],["neutral","Neutral"],["none","No tiles"]]},{name:"morph",type:"select",label:"Slide between cards",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Highlight colour"},{name:"variant",type:"text",label:"Variant"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"},{name:"letter-spacing",type:"text",label:"Letter spacing"},{name:"icon-size",type:"text",label:"Icon size"},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Menu default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"float-x",type:"number",label:"Float offset X (px)"},{name:"float-y",type:"number",label:"Float offset Y (px)"},{name:"float-width",type:"number",label:"Float width (px)"},{name:"float-collapsible",type:"select",label:"Float: collapsible",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"float-movable",type:"select",label:"Float: movable",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"class",type:"text",label:"CSS classes"}]},{name:"theme-switcher",label:"Theme switcher",icon:"palette",category:"Components",selfClosing:!0,container:!1,wrappable:!1,template:"[theme-switcher /]",attrs:[{name:"position",type:"select",label:"Position",options:[["","Inline - where the tag is"],["top-left","Top left"],["top-right","Top right"],["left-center","Left, centred"],["right-center","Right, centred"],["bottom-left","Bottom left"],["bottom-right","Bottom right"]]},{name:"offset-x",type:"number",label:"Offset from the side (px, pinned only)"},{name:"offset-y",type:"number",label:"Offset from the top/bottom (px, pinned only)"},{name:"themes",type:"text",label:"Themes (comma list - blank for the site's)"}]},{name:"icon",label:"Icon",icon:"icon-pick",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[icon name="arrow-right" /]',attrs:[{name:"name",type:"icon",label:"Icon name"},{name:"size",type:"number",label:"Size (px)"},{name:"color",type:"colour",label:"Colour"},{name:"class",type:"text",label:"CSS class"}]},{name:"image",label:"Image",icon:"image-add",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[image src="/media/photo.jpg" alt="" /]',custom:"image",quickAttrs:["zoom","align","width","shadow"],attrs:[{name:"src",type:"image",label:"Image",help:"The picture: choose it from Media, or type a /media/\u2026 path or an https:// address."},{name:"alt",type:"text",label:"Description (alt)",help:"What the picture shows, in a few words. Screen readers and search engines read it. Leave empty only for decoration."},{name:"caption",type:"text",label:"Caption",help:"Shown under the picture, and in the zoom view."},{name:"zoom",type:"checkbox",label:"Click to zoom",help:"Visitors click the picture to see it full size in a viewer: fitted first, then actual size with drag to pan. Best for screenshots with small text. Ignored when the picture has a link."},{name:"width",type:"text",label:"Width (480, 60%, 30rem)",help:"How wide the picture shows. A bare number is pixels. Empty: its own size, never wider than the column."},{name:"align",type:"select",label:"Alignment",options:[["","Default (left)"],["center","Centre"],["right","Right"],["float-left","Float left (text wraps)"],["float-right","Float right (text wraps)"]],help:"Floats let the text run beside the picture; on phones they stack."},{name:"group",type:"text",label:"Zoom group",help:"Give zoomable pictures the same group name and the viewer steps between them with arrows - a gallery or a tour."},{name:"zoom-src",type:"image",label:"Full-size file (zoom)",help:"Optional: a larger file for the zoom view, when the page shows a smaller copy."},{name:"title",type:"text",label:"Hover text (title)"},{name:"max-width",type:"text",label:"Max width (800, 50%)"},{name:"height",type:"text",label:"Height (240, 20rem)",help:"A set height crops the picture to fill the box (see Fit)."},{name:"fit",type:"select",label:"Fit (with a height)",options:[["","Fill and crop (default)"],["contain","Show it all"],["fill","Stretch"],["none","Actual size"],["scale-down","Shrink only"]]},{name:"radius",type:"select",label:"Corners",options:[["","Square"],["sm","Slightly rounded"],["md","Rounded"],["lg","Very rounded"],["full","Circle / pill"]]},{name:"border",type:"checkbox",label:"Border"},{name:"shadow",type:"select",label:"Shadow",options:[["","None"],["sm","Small"],["md","Medium"],["lg","Large"]]},{name:"link",type:"url",label:"Link to",help:"Clicking the picture goes here instead of zooming."},{name:"target",type:"select",label:"Open link in",options:[["","Same tab"],["_blank","New tab"]]},{name:"loading",type:"select",label:"Loading",options:[["","When scrolled near (lazy)"],["eager","Straight away (top of page)"]]},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"embed",label:"Embed",icon:"video",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[embed url="https://youtu.be/dQw4w9WgXcQ" /]',custom:"embed",attrs:[{name:"url",type:"url",label:"URL"},{name:"ratio",type:"select",label:"Aspect ratio",options:[["16:9","16:9"],["4:3","4:3"],["1:1","1:1"],["21:9","21:9"],["9:16","9:16"],["3:4","3:4"]]},{name:"title",type:"text",label:"Title / caption"},{name:"width",type:"text",label:"Width"},{name:"align",type:"select",label:"Alignment",options:[["left","Left"],["center","Centre"],["right","Right"]]},{name:"autoplay",type:"checkbox",label:"Autoplay"},{name:"loop",type:"checkbox",label:"Loop"},{name:"muted",type:"checkbox",label:"Muted"}]}];for(const e of SHORTCODES){e.attrs||(e.attrs=[]);for(const a of o)e.attrs.some(t=>t.name===a.name)||e.attrs.push(a)}export const EDITOR_TOOLS=[{name:"colourpick",label:"Colour picker",icon:"colour-picker",category:"Media",custom:"colourpick"},{name:"component",label:"Component",icon:"component",category:"Components",custom:"component"},{name:"scribe",label:"Scribe",icon:"scribe-insert",category:"Content",custom:"scribe"},{name:"highlight-text",label:"Highlight text",icon:"star",category:"Content",custom:"highlighttext",wrappable:!0}];
|