domma-cms 1.8.6 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/CLAUDE.md +13 -1
  3. package/admin/js/lib/menu-editor-arrange.js +2 -2
  4. package/admin/js/lib/shortcode-registry.js +2 -2
  5. package/admin/js/lib/wordpress-import-arrange.js +1 -1
  6. package/admin/js/templates/docs/usage-editions.html +0 -1
  7. package/admin/js/templates/docs/usage-tools.html +5 -0
  8. package/admin/js/templates/menu-editor.html +6 -0
  9. package/admin/js/templates/wordpress-import.html +23 -1
  10. package/admin/js/views/menu-editor.js +5 -5
  11. package/admin/js/views/wordpress-import.js +30 -7
  12. package/config/cache.json.example +0 -4
  13. package/docs/DommaFeatures.md +5 -4
  14. package/docs/cache.md +3 -3
  15. package/docs/editions-and-licences.md +0 -3
  16. package/docs/plugin-development.md +1 -1
  17. package/package.json +1 -1
  18. package/plugins/_lib/admin/mail/reader-view.js +34 -0
  19. package/plugins/_lib/mail/store.js +59 -1
  20. package/public/css/site.css +1 -1
  21. package/public/js/mobile-ui.mjs +1 -0
  22. package/public/js/site.js +1 -1
  23. package/server/routes/api/wordpress-import.js +81 -4
  24. package/server/server.js +1 -6
  25. package/server/services/cache/index.js +3 -11
  26. package/server/services/markdown.js +2 -1
  27. package/server/services/menus.js +21 -0
  28. package/server/services/passwordReset.js +71 -3
  29. package/server/services/renderer.js +2 -0
  30. package/server/services/wpImport/index.js +183 -20
  31. package/server/services/wpImport/people.js +202 -0
  32. package/server/services/wpImport/plan.js +13 -2
  33. package/server/services/wpImport/wxr.js +5 -2
  34. package/server/templates/page.html +2 -2
package/CHANGELOG.md CHANGED
@@ -1,8 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.8] - 2026-10-16
4
+
5
+ - **Your emails with a contact, on their card.** With Email (Pro), the foot of a contact's card in Contacts lists your ten newest emails to or from any of the contact's addresses - Received or Sent, unread, and the mailbox when you have several - each opening the message in Email. Only your own mailboxes are searched. This release carries the engine side: a whole-address mail query (`listByAddresses`) and links that open the reader at one message (`#/plugins/<mail>?open=<uid>&account=<id>&folder=<path>`).
6
+ - The response cache's unfinished Redis option is gone. Setting `"driver": "redis"` in `config/cache.json` loaded a file that never existed and stopped the site starting; the in-process memory cache is the one driver (`memory`, or `none`).
7
+
8
+ ## [1.8.7] - 2026-10-16
9
+
10
+ - **Import from WordPress brings the authors across.** The preview has a Users card listing everyone the export names as an author, with their email and what they wrote. An author whose email matches a user here (capitals do not matter) is credited with their posts and pages, and that user's account is not changed in any way. Anyone else who wrote something becomes a new account by default; anyone who wrote nothing does not, and each can be switched, or all at once. New accounts get the role you choose - only roles junior to your own are offered (and accepted), the site's least-privileged role by default - and no password: nobody can sign in to one until a password is set. A switch, off unless you turn it on, emails each new account an invitation once the import has finished - an account has been made for them, with a link to set their password that works once and lasts 7 days (ordinary password reset links keep their own, shorter, lifetime). An author with no usable email never gets an account, and two with the same email share one. Blog posts, pages and collection entries are credited to whoever their author became. Run it again and the same people are credited to the same accounts - nobody is made twice. The report and the import history keep names and ids, never the email addresses.
11
+
3
12
  ## [1.8.6] - 2026-10-16
4
13
 
5
14
  - **Security: what is stored in a collection no longer runs as a shortcode.** A `[collection]` or `[view]` used to pass its entries on to the later shortcode steps, so an entry - a public form submission, say - holding `[form]`, `[button]`, `[embed]`, `[slideover]` or another `[collection]` was carried out on the page. Entry values now show exactly as typed, in every display type and in `{{field}}` / `{{{field}}}` block placeholders, while the page's own shortcodes and those written into a block template work as before. Filter, search and export still see the stored values. A value containing `$&` or `` $` `` is also shown as written instead of pulling in other parts of the page.
15
+ - Menus > Behaviour offers independent mobile options for a hamburger without the top bar and for hiding branding. Desktop branding stays visible, and enabled site search remains available with Ctrl+K or Cmd+K.
16
+ - Carousels, including collection and view carousels, offer an optional mobile popup (`mobile-popup="true"`). Tap a card or press Enter or Space on the carousel to read the full card. Links and controls retain their actions and state; Escape, Close or the backdrop dismisses the popup.
6
17
 
7
18
  ## [1.8.5] - 2026-10-16
8
19
 
package/CLAUDE.md CHANGED
@@ -267,7 +267,7 @@ false})` - no injected snippets or beacon near a URL that carries a host key.
267
267
  | `config/effects.json` | Yours | Effects / celebrate shortcode config |
268
268
  | `config/search.json` | Yours | Public site search: enabled, trigger, placement, limits |
269
269
  | `config/content-api.json` | Yours (optional) | Content API: enabled, access, resources, formats, page list - absence = off |
270
- | `config/cache.json` | Yours (optional) | Response cache: enabled, driver (memory/none/redis), TTL - absence = defaults (off in dev, on in prod) |
270
+ | `config/cache.json` | Yours (optional) | Response cache: enabled, driver (memory/none), TTL - absence = defaults (off in dev, on in prod) |
271
271
 
272
272
  See `docs/configuration.md` for full schema reference.
273
273
 
@@ -356,6 +356,18 @@ A built-in Tool (`wordpress-import` in `services/tools.js`, permission `import.w
356
356
  hook is registered whatever the Tool switch says (the redirects belong to the migrated site) and re-reads
357
357
  `map.json` when it changes.
358
358
  - Unknown shortcodes are left as text with `&#91;`/`&#93;` brackets, so Domma never runs a WordPress `[button]`.
359
+ - **Authors** (`people.js`, pure; the run's People phase in `index.js` goes first so content can be credited): matched to a
360
+ user ONLY by exact email (any case) and then only credited - nothing in the importer writes to an existing account.
361
+ Others become accounts with a random, never-shown password (no sign-in until a reset link sets one), or none.
362
+ `peopleContext()` in the route is the one decision about who may make them: `users.create`, and roles strictly junior
363
+ to the importer's (`canManageUser`, never level 0), read from their user file at request time; a role outside that is
364
+ refused at the route (400 unknown / 403), and the run checks it again. The opt-in email is an invitation,
365
+ `adminInvite()` in passwordReset.js: the reset's token store and screen, but a 7-day link (`INVITE_LIFETIME`, stored with
366
+ the token - resets keep `resetTokenExpiry`; the latest link replaces the other; used once). Sent only after the phases
367
+ finish, spaced by `INVITE_LIMITS`.
368
+ `map.json` keeps `author:<wpId> -> {userId, how}` so a re-run links rather than makes; emails reach the preview only,
369
+ never the report, history or map. Pages carry the credited user as frontmatter `createdBy`, entries as
370
+ `meta.createdBy`, Blog posts as `authorId`; an author without an account is credited to whoever ran the import.
359
371
  - **WooCommerce products go to the Shop by feature** (`shopTarget()`): a switched-on plugin shipping `shop-products`
360
372
  with the product fields, AND its extension registry (`globalThis[Symbol.for('domma.shopping-cart')]`) offering
361
373
  `services.saveProduct` - every product is written through that, the Shop's own save, never into the collection
@@ -1,2 +1,2 @@
1
- const p=["separator","spacer","theme-switcher"];export const isStructural=t=>p.includes(t?.type);export function siblingsOf(t,e){const i=t.find(n=>n.id===e);return i?t.filter(n=>n.parentId===i.parentId):[]}export function moveRow(t,e,i){const n=siblingsOf(t,e),r=n.findIndex(l=>l.id===e),a=r+(i<0?-1:1);if(r<0||a<0||a>=n.length)return!1;n[r].touched=!0;const o=t.indexOf(n[r]),s=t.indexOf(n[a]);return[t[o],t[s]]=[t[s],t[o]],!0}export function indentRow(t,e){const i=siblingsOf(t,e),n=i.findIndex(r=>r.id===e);return n<=0||isStructural(i[n-1])?!1:(i[n].parentId=i[n-1].id,i[n].touched=!0,!0)}export function outdentRow(t,e){const i=t.find(r=>r.id===e);if(!i||i.parentId==null)return!1;const n=t.find(r=>r.id===i.parentId);return i.parentId=n?n.parentId:null,i.touched=!0,!0}export function newRow(t,e,i=null){return t==="separator"?{id:e,parentId:i,type:"separator"}:t==="theme-switcher"?{id:e,parentId:i,type:"theme-switcher"}:t==="spacer"?{id:e,parentId:i,type:"spacer",size:"md"}:{id:e,parentId:i,text:"",url:"/",icon:"",visibility:"",permission:"",hidden:!1,bundled:!1}}export function insertBelow(t,e,i,n){const r=t.findIndex(o=>o.id===e);if(r===-1)return null;const a=newRow(i,n,t[r].parentId);return t.splice(r+1,0,a),a}export function addChild(t,e,i){const n=t.find(a=>a.id===e);if(!n||isStructural(n))return null;const r=newRow("item",i,n.id);return t.push(r),n.touched=!0,r}export function duplicateRow(t,e,i){const n=t.find(l=>l.id===e);if(!n||n.tool)return null;const r=new Map,a=[],o=(l,c)=>{if(l.tool)return;const d={...m(l),id:i(),parentId:c};delete d.tool,delete d.locked,d.touched=!0,r.set(l.id,d.id),a.push(d);for(const f of t.filter(u=>u.parentId===l.id))o(f,d.id)};if(o(n,n.parentId),!a.length)return null;a[0].text&&(a[0].text=`${a[0].text} (copy)`);const s=t.indexOf(n);return t.splice(s+1,0,a[0]),t.push(...a.slice(1)),a[0]}function m(t){return JSON.parse(JSON.stringify(t))}export function bindingFrom({slot:t="",projects:e=[],pagesText:i=""}={}){return t?{slot:t,projects:[...e],pages:String(i).split(`
2
- `).map(n=>n.trim()).filter(Boolean)}:null}export function badPagePatterns(t=[]){return t.filter(e=>!/^\/[^\s?#*]*(\/\*)?$|^\/\*$/.test(e))}const g=["fontFamily","fontSize","fontWeight","letterSpacing","iconSize"];export function menuFromForm(t={},e={},i=null,n=[],r={}){const a=Object.fromEntries(g.filter(f=>t[f]).map(f=>[f,t[f]])),o={};if(t.position==="floating"){t.floatAnchor&&(o.anchor=t.floatAnchor);for(const[f,u]of[["offsetX",t.floatOffsetX],["offsetY",t.floatOffsetY],["width",t.floatWidth],["radius",t.floatRadius],["opacity",t.floatOpacity]])u!==""&&u!=null&&Number.isFinite(Number(u))&&(o[f]=Number(u));t.floatShadow&&(o.shadow=t.floatShadow),t.floatAccent&&(o.accent=t.floatAccent),t.floatTitle&&(o.title=String(t.floatTitle).trim()),t.floatCollapsible&&(o.collapsible=!0),t.floatCollapsible&&t.floatCollapsed&&(o.collapsed=!0),t.floatMovable&&(o.movable=!0),t.floatResizable&&(o.resizable=!0)}const s={};t.position!=="floating"&&(t.orientation==="vertical"?(t.dockWidth!==""&&t.dockWidth!=null&&Number.isFinite(Number(t.dockWidth))&&(s.width=Number(t.dockWidth)),t.dockAutohide?s.autohide=!0:t.dockCollapsible&&(s.collapsible=!0,t.dockCollapsed&&(s.collapsed=!0))):t.dockHideOnScroll&&(s.hideOnScroll=!0));const l={};t.highlightHover&&(l.hover=t.highlightHover),t.highlightActive&&(l.active=t.highlightActive),t.highlightAccent&&(l.accent=t.highlightAccent);const c={};t.entranceAnimation&&(c.animation=t.entranceAnimation);for(const[f,u]of[["stagger",t.entranceStagger],["duration",t.entranceDuration]])u!==""&&u!=null&&Number.isFinite(Number(u))&&(c[f]=Number(u));const d=!!t.entranceEnabled||"stagger"in c||"duration"in c||c.animation&&c.animation!=="fade";return{slug:String(e.slug||"").trim(),name:String(e.name||"").trim(),description:String(e.description||"").trim(),...t.variant&&{variant:t.variant},...t.position&&{position:t.position},...t.orientation&&{orientation:t.orientation},...t.orientation==="vertical"&&t.side&&{side:t.side},...t.orientation!=="vertical"&&t.align&&{align:t.align},...Object.keys(o).length&&{float:o},...Object.keys(l).length&&{highlight:l},...d&&{entrance:{enabled:!!t.entranceEnabled,...c}},...Object.keys(s).length&&{dock:s},...t.appearOnHover&&{appearOnHover:!0},...t.class&&String(t.class).trim()&&{class:String(t.class).trim()},...Object.keys(a).length&&{style:a},binding:i,items:n,meta:{...r||{},project:e.project||null}}}export function menuProblems(t){const e=[];/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(t.slug||"")||e.push("The slug must be lowercase letters, numbers and hyphens, no hyphen at either end (Meta tab)."),t.name||e.push("The menu needs a name (Meta tab).");const i=countUnlabelled(t.items);i&&e.push(`${i} item${i===1?" has":"s have"} no label - every item needs one (Items tab).`),t.dock?.width!=null&&!(t.dock.width>=160&&t.dock.width<=480)&&e.push("The rail width must be from 160 to 480 px (Behaviour tab).");const n=t.entrance||{};if(n.stagger!=null&&!(n.stagger>=0&&n.stagger<=1e3)&&e.push("The entrance delay between items must be from 0 to 1000 ms (Behaviour tab - switch Staggered entrance on to edit it)."),n.duration!=null&&!(n.duration>=50&&n.duration<=3e3)&&e.push("Each item's entrance animation must be from 50 to 3000 ms (Behaviour tab - switch Staggered entrance on to edit it)."),t.binding){const r=badPagePatterns(t.binding.pages);r.length&&e.push(`Not valid page patterns: ${r.join(", ")} (Binding tab).`)}return e}export function countUnlabelled(t=[]){let e=0;for(const i of t||[])!isStructural(i)&&!(i.ref===!0&&i.url)&&!String(i.text||"").trim()&&e++,e+=countUnlabelled(i.items);return e}export const snapshot=t=>JSON.stringify(t);export function depthOfItems(t){if(!Array.isArray(t)||!t.length)return 0;let e=0;for(const i of t){const n=Array.isArray(i.items)&&i.items.length?depthOfItems(i.items):0;n>e&&(e=n)}return e+1}export function locationRows(t=[],e={},i={},n=[],r={}){const a=Object.fromEntries(n.map(o=>[o.slug,o.name||o.slug]));return t.map(o=>{const s=e[o.slot]||"",l=s&&r[s]||0,c=!!s&&o.maxDepth!=null&&l>o.maxDepth,d=o.slot==="overlay";return{slot:o.slot,label:o.label||o.slot,source:o.source||"",description:o.description||"",menu:s,menuName:s?a[s]||`${s} (missing)`:"",missing:!!s&&!a[s],tooDeep:c,depthText:c?`Nested ${l} deep - this slot shows ${o.maxDepth}`:"",empty:!s,emptyText:s?"":d?"Optional":"Nothing mapped",changed:(e[o.slot]||"")!==(i[o.slot]||"")}})}export function locationsPayload(t={},e=[]){const i=new Set(e.map(n=>n.slot));return Object.fromEntries(Object.entries(t).filter(([n,r])=>r&&(!e.length||i.has(n))))}export function locationsSnapshot(t={}){return JSON.stringify(Object.keys(t).filter(e=>t[e]).sort().map(e=>[e,t[e]]))}
1
+ const p=["separator","spacer","theme-switcher"];export const isStructural=t=>p.includes(t?.type);export function siblingsOf(t,e){const i=t.find(n=>n.id===e);return i?t.filter(n=>n.parentId===i.parentId):[]}export function moveRow(t,e,i){const n=siblingsOf(t,e),r=n.findIndex(l=>l.id===e),s=r+(i<0?-1:1);if(r<0||s<0||s>=n.length)return!1;n[r].touched=!0;const o=t.indexOf(n[r]),a=t.indexOf(n[s]);return[t[o],t[a]]=[t[a],t[o]],!0}export function indentRow(t,e){const i=siblingsOf(t,e),n=i.findIndex(r=>r.id===e);return n<=0||isStructural(i[n-1])?!1:(i[n].parentId=i[n-1].id,i[n].touched=!0,!0)}export function outdentRow(t,e){const i=t.find(r=>r.id===e);if(!i||i.parentId==null)return!1;const n=t.find(r=>r.id===i.parentId);return i.parentId=n?n.parentId:null,i.touched=!0,!0}export function newRow(t,e,i=null){return t==="separator"?{id:e,parentId:i,type:"separator"}:t==="theme-switcher"?{id:e,parentId:i,type:"theme-switcher"}:t==="spacer"?{id:e,parentId:i,type:"spacer",size:"md"}:{id:e,parentId:i,text:"",url:"/",icon:"",visibility:"",permission:"",hidden:!1,bundled:!1}}export function insertBelow(t,e,i,n){const r=t.findIndex(o=>o.id===e);if(r===-1)return null;const s=newRow(i,n,t[r].parentId);return t.splice(r+1,0,s),s}export function addChild(t,e,i){const n=t.find(s=>s.id===e);if(!n||isStructural(n))return null;const r=newRow("item",i,n.id);return t.push(r),n.touched=!0,r}export function duplicateRow(t,e,i){const n=t.find(l=>l.id===e);if(!n||n.tool)return null;const r=new Map,s=[],o=(l,c)=>{if(l.tool)return;const d={...m(l),id:i(),parentId:c};delete d.tool,delete d.locked,d.touched=!0,r.set(l.id,d.id),s.push(d);for(const f of t.filter(u=>u.parentId===l.id))o(f,d.id)};if(o(n,n.parentId),!s.length)return null;s[0].text&&(s[0].text=`${s[0].text} (copy)`);const a=t.indexOf(n);return t.splice(a+1,0,s[0]),t.push(...s.slice(1)),s[0]}function m(t){return JSON.parse(JSON.stringify(t))}export function bindingFrom({slot:t="",projects:e=[],pagesText:i=""}={}){return t?{slot:t,projects:[...e],pages:String(i).split(`
2
+ `).map(n=>n.trim()).filter(Boolean)}:null}export function badPagePatterns(t=[]){return t.filter(e=>!/^\/[^\s?#*]*(\/\*)?$|^\/\*$/.test(e))}const g=["fontFamily","fontSize","fontWeight","letterSpacing","iconSize"];export function menuFromForm(t={},e={},i=null,n=[],r={}){const s=Object.fromEntries(g.filter(f=>t[f]).map(f=>[f,t[f]])),o={};if(t.position==="floating"){t.floatAnchor&&(o.anchor=t.floatAnchor);for(const[f,u]of[["offsetX",t.floatOffsetX],["offsetY",t.floatOffsetY],["width",t.floatWidth],["radius",t.floatRadius],["opacity",t.floatOpacity]])u!==""&&u!=null&&Number.isFinite(Number(u))&&(o[f]=Number(u));t.floatShadow&&(o.shadow=t.floatShadow),t.floatAccent&&(o.accent=t.floatAccent),t.floatTitle&&(o.title=String(t.floatTitle).trim()),t.floatCollapsible&&(o.collapsible=!0),t.floatCollapsible&&t.floatCollapsed&&(o.collapsed=!0),t.floatMovable&&(o.movable=!0),t.floatResizable&&(o.resizable=!0)}const a={};t.position!=="floating"&&(t.orientation==="vertical"?(t.dockWidth!==""&&t.dockWidth!=null&&Number.isFinite(Number(t.dockWidth))&&(a.width=Number(t.dockWidth)),t.dockAutohide?a.autohide=!0:t.dockCollapsible&&(a.collapsible=!0,t.dockCollapsed&&(a.collapsed=!0))):t.dockHideOnScroll&&(a.hideOnScroll=!0));const l={};t.highlightHover&&(l.hover=t.highlightHover),t.highlightActive&&(l.active=t.highlightActive),t.highlightAccent&&(l.accent=t.highlightAccent);const c={};t.entranceAnimation&&(c.animation=t.entranceAnimation);for(const[f,u]of[["stagger",t.entranceStagger],["duration",t.entranceDuration]])u!==""&&u!=null&&Number.isFinite(Number(u))&&(c[f]=Number(u));const d=!!t.entranceEnabled||"stagger"in c||"duration"in c||c.animation&&c.animation!=="fade";return{slug:String(e.slug||"").trim(),name:String(e.name||"").trim(),description:String(e.description||"").trim(),...t.variant&&{variant:t.variant},...t.position&&{position:t.position},...t.orientation&&{orientation:t.orientation},...t.orientation==="vertical"&&t.side&&{side:t.side},...t.orientation!=="vertical"&&t.align&&{align:t.align},...Object.keys(o).length&&{float:o},...Object.keys(l).length&&{highlight:l},...d&&{entrance:{enabled:!!t.entranceEnabled,...c}},...Object.keys(a).length&&{dock:a},...t.appearOnHover&&{appearOnHover:!0},...(t.mobileHamburgerOnly||t.mobileHideBrand)&&{mobile:{...t.mobileHamburgerOnly&&{hamburgerOnly:!0},...t.mobileHideBrand&&{hideBrand:!0}}},...t.class&&String(t.class).trim()&&{class:String(t.class).trim()},...Object.keys(s).length&&{style:s},binding:i,items:n,meta:{...r||{},project:e.project||null}}}export function menuProblems(t){const e=[];/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(t.slug||"")||e.push("The slug must be lowercase letters, numbers and hyphens, no hyphen at either end (Meta tab)."),t.name||e.push("The menu needs a name (Meta tab).");const i=countUnlabelled(t.items);i&&e.push(`${i} item${i===1?" has":"s have"} no label - every item needs one (Items tab).`),t.dock?.width!=null&&!(t.dock.width>=160&&t.dock.width<=480)&&e.push("The rail width must be from 160 to 480 px (Behaviour tab).");const n=t.entrance||{};if(n.stagger!=null&&!(n.stagger>=0&&n.stagger<=1e3)&&e.push("The entrance delay between items must be from 0 to 1000 ms (Behaviour tab - switch Staggered entrance on to edit it)."),n.duration!=null&&!(n.duration>=50&&n.duration<=3e3)&&e.push("Each item's entrance animation must be from 50 to 3000 ms (Behaviour tab - switch Staggered entrance on to edit it)."),t.binding){const r=badPagePatterns(t.binding.pages);r.length&&e.push(`Not valid page patterns: ${r.join(", ")} (Binding tab).`)}return e}export function countUnlabelled(t=[]){let e=0;for(const i of t||[])!isStructural(i)&&!(i.ref===!0&&i.url)&&!String(i.text||"").trim()&&e++,e+=countUnlabelled(i.items);return e}export const snapshot=t=>JSON.stringify(t);export function depthOfItems(t){if(!Array.isArray(t)||!t.length)return 0;let e=0;for(const i of t){const n=Array.isArray(i.items)&&i.items.length?depthOfItems(i.items):0;n>e&&(e=n)}return e+1}export function locationRows(t=[],e={},i={},n=[],r={}){const s=Object.fromEntries(n.map(o=>[o.slug,o.name||o.slug]));return t.map(o=>{const a=e[o.slot]||"",l=a&&r[a]||0,c=!!a&&o.maxDepth!=null&&l>o.maxDepth,d=o.slot==="overlay";return{slot:o.slot,label:o.label||o.slot,source:o.source||"",description:o.description||"",menu:a,menuName:a?s[a]||`${a} (missing)`:"",missing:!!a&&!s[a],tooDeep:c,depthText:c?`Nested ${l} deep - this slot shows ${o.maxDepth}`:"",empty:!a,emptyText:a?"":d?"Optional":"Nothing mapped",changed:(e[o.slot]||"")!==(i[o.slot]||"")}})}export function locationsPayload(t={},e=[]){const i=new Set(e.map(n=>n.slot));return Object.fromEntries(Object.entries(t).filter(([n,r])=>r&&(!e.length||i.has(n))))}export function locationsSnapshot(t={}){return JSON.stringify(Object.keys(t).filter(e=>t[e]).sort().map(e=>[e,t[e]]))}
@@ -33,7 +33,7 @@ Banner content
33
33
  [/accordion]`,children:{name:"item",min:2,max:12},attrs:[{name:"multiple",type:"checkbox",label:"Allow multiple open"},{name:"id",type:"text",label:"ID"}]},{name:"item",label:"Item",icon:"list",category:"Components",child:!0,selfClosing:!1,container:!0,wrappable:!1,template:'[item title="Item title"]Content[/item]',inline:!0,attrs:[{name:"title",type:"text",label:"Title"}]},{name:"carousel",label:"Carousel",icon:"carousel-insert",category:"Components",selfClosing:!1,container:!0,wrappable:!1,template:`[carousel autoplay="true" interval="5000"]
34
34
  [slide title="Slide 1" image="/media/photo.jpg"]Caption.[/slide]
35
35
  [slide title="Slide 2"]Text-only slide.[/slide]
36
- [/carousel]`,children:{name:"slide",min:2,max:12},quickAttrs:["height-mode","height","arrow-position","background","arrow-background","arrow-color"],attrs:[{name:"autoplay",type:"checkbox",label:"Autoplay"},{name:"interval",type:"number",label:"Interval (ms)"},{name:"loop",type:"checkbox",label:"Loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]]},{name:"animation-duration",type:"number",label:"Animation duration (ms)"},{name:"animation-easing",type:"text",label:"Animation easing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]]},{name:"height",type:"number",label:"Fixed height (px, optional)"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Background colour"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"id",type:"text",label:"ID"}]},{name:"slide",label:"Slide",icon:"image",category:"Components",child:!0,selfClosing:!1,container:!0,wrappable:!1,template:'[slide title="Slide title" image="/media/photo.jpg"]Caption[/slide]',inline:!0,attrs:[{name:"title",type:"text",label:"Title"},{name:"image",type:"image",label:"Image"}]},{name:"countdown",label:"Countdown",icon:"stopwatch",category:"Components",selfClosing:!0,container:!1,wrappable:!1,template:'[countdown to="2026-12-31" format="DD:HH:mm:ss" /]',attrs:[{name:"to",type:"text",label:"Target date (ISO)"},{name:"duration",type:"number",label:"Duration (seconds)"},{name:"format",type:"select",label:"Format",options:[["mm:ss","mm:ss"],["HH:mm:ss","HH:mm:ss"],["DD:HH:mm:ss","DD:HH:mm:ss"]]},{name:"id",type:"text",label:"ID"}]},{name:"timeline",label:"Timeline",icon:"activity",category:"Components",selfClosing:!1,container:!0,wrappable:!1,template:`[timeline layout="vertical" theme="modern"]
36
+ [/carousel]`,children:{name:"slide",min:2,max:12},quickAttrs:["height-mode","height","arrow-position","background","arrow-background","arrow-color"],attrs:[{name:"autoplay",type:"checkbox",label:"Autoplay"},{name:"interval",type:"number",label:"Interval (ms)"},{name:"loop",type:"checkbox",label:"Loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]]},{name:"animation-duration",type:"number",label:"Animation duration (ms)"},{name:"animation-easing",type:"text",label:"Animation easing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]]},{name:"height",type:"number",label:"Fixed height (px, optional)"},{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:"Background colour"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"id",type:"text",label:"ID"}]},{name:"slide",label:"Slide",icon:"image",category:"Components",child:!0,selfClosing:!1,container:!0,wrappable:!1,template:'[slide title="Slide title" image="/media/photo.jpg"]Caption[/slide]',inline:!0,attrs:[{name:"title",type:"text",label:"Title"},{name:"image",type:"image",label:"Image"}]},{name:"countdown",label:"Countdown",icon:"stopwatch",category:"Components",selfClosing:!0,container:!1,wrappable:!1,template:'[countdown to="2026-12-31" format="DD:HH:mm:ss" /]',attrs:[{name:"to",type:"text",label:"Target date (ISO)"},{name:"duration",type:"number",label:"Duration (seconds)"},{name:"format",type:"select",label:"Format",options:[["mm:ss","mm:ss"],["HH:mm:ss","HH:mm:ss"],["DD:HH:mm:ss","DD:HH:mm:ss"]]},{name:"id",type:"text",label:"ID"}]},{name:"timeline",label:"Timeline",icon:"activity",category:"Components",selfClosing:!1,container:!0,wrappable:!1,template:`[timeline layout="vertical" theme="modern"]
37
37
  [event title="Launch" date="2025-01-15" status="completed"]Launched.[/event]
38
38
  [/timeline]`,children:{name:"event",min:1,max:20},custom:"timeline",attrs:[{name:"layout",type:"select",label:"Layout",options:[["vertical","Vertical"],["centred","Centred"],["horizontal","Horizontal"]]},{name:"theme",type:"select",label:"Theme",options:[["minimal","Minimal"],["corporate","Corporate"],["modern","Modern"]]},{name:"mode",type:"select",label:"Mode",options:[["timeline","Timeline"],["roadmap","Roadmap"]]},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"event",label:"Event",icon:"dot",category:"Components",child:!0,selfClosing:!1,container:!0,wrappable:!1,template:'[event title="Milestone" date="2025-01-15" status="completed"]Description[/event]',inline:!0,attrs:[{name:"title",type:"text",label:"Title"},{name:"date",type:"text",label:"Date"},{name:"status",type:"select",label:"Status",options:[["planned","Planned"],["in-progress","In progress"],["completed","Completed"],["blocked","Blocked"]]},{name:"icon",type:"icon",label:"Icon"}]},{name:"hero",label:"Hero",icon:"hero",category:"Content",selfClosing:!1,container:!0,wrappable:!0,template:`[hero title="Welcome" tagline="Build something great" size="lg" variant="gradient-blue"]
39
39
  Optional body content.
@@ -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,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:[["Georgia","Georgia"],["Arial","Arial"],["Verdana","Verdana"],["Courier New","Courier New"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"]]},{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"]]},{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:"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"},{name:"interval",type:"number",label:"Interval (ms)"},{name:"loop",type:"checkbox",label:"Loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]]},{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:"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"},{name:"interval",type:"number",label:"Interval (ms)"},{name:"loop",type:"checkbox",label:"Loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]]},{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:"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 l)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"}];
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"},{name:"interval",type:"number",label:"Interval (ms)"},{name:"loop",type:"checkbox",label:"Loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]]},{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"},{name:"interval",type:"number",label:"Interval (ms)"},{name:"loop",type:"checkbox",label:"Loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]]},{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:"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 l)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"}];
@@ -1 +1 @@
1
- export const KIND_LABEL={page:"Page",post:"Post",product:"Product",custom:"Custom item",collection:"Collection",media:"Media",menu:"Menu",category:"Category"},KIND_PLURAL={page:"Pages",post:"Posts",product:"Products",custom:"Custom items",collection:"Collections",media:"Media",menu:"Menus",category:"Categories"},KIND_ICON={page:"file-text",post:"edit-3",product:"shopping-bag",custom:"box",collection:"database",media:"image",menu:"menu",category:"tag"},TYPE_AS={collection:{text:"Collection",tone:"ok"},pages:{text:"Pages",tone:"info"},skip:{text:"Skipped",tone:"muted"}},PRODUCT_TYPE_LABEL={simple:"Simple",variable:"With options",grouped:"Grouped",external:"External"},ACTION={create:{text:"New",tone:"ok"},rename:{text:"New, renamed",tone:"warn"},update:{text:"Update",tone:"info"},keep:{text:"Left as is",tone:"muted"},skip:{text:"Skipped",tone:"muted"}},RESULT={created:{text:"Made",tone:"ok"},updated:{text:"Updated",tone:"info"},kept:{text:"Left as is",tone:"muted"},skipped:{text:"Skipped",tone:"muted"},failed:{text:"Failed",tone:"bad"}},PLAN_FILTERS=[{id:"all",label:"All"},{id:"new",label:"New"},{id:"update",label:"Updates"},{id:"renamed",label:"Renamed"},{id:"keep",label:"Left as is"},{id:"skip",label:"Skipped"},{id:"rebuild",label:"Needs rebuilding"}],REPORT_FILTERS=[{id:"all",label:"All"},{id:"created",label:"Made"},{id:"updated",label:"Updated"},{id:"kept",label:"Left as is"},{id:"skipped",label:"Skipped"},{id:"failed",label:"Failed"},{id:"rebuild",label:"Needs rebuilding"}];const d=e=>!!(e.builder||e.needs||e.shortcodes?.length),u=e=>[e.builder?`Built with ${e.builder}`:"",e.needs||"",...(e.shortcodes||[]).map(t=>`[${t}]`)].filter(Boolean).join(" ");export function planMatches(e,t){switch(t){case"new":return e.action==="create"||e.action==="rename";case"update":return e.action==="update";case"renamed":return e.action==="rename"||!!e.replaces;case"keep":return e.action==="keep";case"skip":return e.action==="skip";case"rebuild":return d(e);default:return!0}}export function reportMatches(e,t){return t==="rebuild"?d(e):t==="all"||!t||e.result===t}export function counts(e,t,s,i=""){const n=e.filter(o=>!i||o.kind===i);return Object.fromEntries(t.map(o=>[o.id,n.filter(a=>s(a,o.id)).length]))}export function kindTabs(e){const t=["page","post","product","custom","collection","media","menu","category"],s={};for(const i of e)s[i.kind]=(s[i.kind]||0)+1;return[{id:"",label:"Everything",count:e.length},...t.filter(i=>s[i]).map(i=>({id:i,label:KIND_PLURAL[i],count:s[i]}))]}export function planRow(e){const t=ACTION[e.action]||ACTION.skip;let s=e.target?e.kind==="menu"?`Menu "${e.target}"`:e.kind==="collection"?`Collection "${e.target}"`:e.target:"";e.kind==="custom"&&e.as==="collection"&&e.collection&&e.action!=="skip"&&(s=`In the collection "${e.collection}"${e.listAt?`, listed at ${e.listAt}`:""}`);const i=[e.kind==="custom"&&e.postType?`${KIND_LABEL.custom} (${e.postType})`:KIND_LABEL[e.kind]||e.kind];return e.listFor&&i.push("list page"),e.status&&(e.kind==="page"||e.kind==="post"||e.kind==="custom")&&i.push(e.status),e.kind==="collection"&&e.fields&&i.push(`${e.fields} fields`),e.kind==="product"&&(e.productType&&i.push(PRODUCT_TYPE_LABEL[e.productType]||e.productType),e.variants&&i.push(`${e.variants} option${e.variants===1?"":"s"}`),e.action!=="skip"&&e.status&&i.push(e.status==="active"?"on sale":"draft")),e.comments&&i.push(`${e.comments} comment${e.comments===1?"":"s"}`),e.count&&i.push(`${e.count} item${e.count===1?"":"s"}`),{key:e.key,kind:e.kind,icon:KIND_ICON[e.kind]||"file",title:e.title||"(untitled)",pill:e.replaces?"Replaces a page":t.text,pillClass:`is-${e.replaces?"warn":t.tone}`,where:s,meta:i.join(" \xB7 "),reason:e.reason||"",rebuild:u(e),chosen:!!e.choice}}export function reportRow(e){const t=RESULT[e.result]||RESULT.skipped;return{key:e.key,kind:e.kind,icon:KIND_ICON[e.kind]||"file",title:e.title||"(untitled)",pill:t.text,pillClass:`is-${t.tone}`,where:e.target||"",meta:[KIND_LABEL[e.kind]||e.kind,e.format==="html"?"kept as HTML":""].filter(Boolean).join(" \xB7 "),reason:[e.reason,...e.notes||[]].filter(Boolean).join(" "),rebuild:u(e)}}export function choiceItems(e,t){const s=[];return t&&s.push({id:"reset",label:"Undo my choice",icon:"rotate-ccw"}),t!=="skip"&&e.action!=="skip"&&e.action!=="keep"&&s.push({id:"skip",label:"Skip this",icon:"x-circle"}),t!=="overwrite"&&e.action==="keep"&&s.push({id:"overwrite",label:"Overwrite my changes here",icon:"refresh-cw"}),t!=="overwrite"&&e.action==="rename"&&(e.kind==="page"||e.kind==="post")&&e.wanted&&e.kind==="page"&&s.push({id:"overwrite",label:`Replace the page at ${e.wanted}`,icon:"refresh-cw"}),t!=="import"&&e.action==="skip"&&/Deleted (on this site|from the Blog|from the Shop|from the collection)/.test(e.reason||"")&&s.push({id:"import",label:"Import again",icon:"download"}),s}export function applyChoice(e,t,s){const i={...e||{}};return!s||s==="reset"?delete i[t]:i[t]=s,i}export function defaultOptions(e=!1){return{posts:e?"blog":"pages",media:"download",comments:!0,menus:!0,redirects:!0,drafts:!0,products:!0,types:{},listPages:{},choices:{}}}export function cleanOptions(e={},t=!1){const s=defaultOptions(t),i=(n,o,a)=>o.includes(n)?n:a;return{posts:i(e.posts,t?["blog","pages","skip"]:["pages","skip"],s.posts),media:i(e.media,["download","zip","skip"],s.media),comments:e.comments!==!1,menus:e.menus!==!1,redirects:e.redirects!==!1,drafts:e.drafts!==!1,products:e.products!==!1,types:Object.fromEntries(Object.entries(e.types||{}).filter(([n,o])=>f.test(n)&&(o==="pages"||o==="skip"))),listPages:Object.fromEntries(Object.entries(e.listPages||{}).filter(([n,o])=>f.test(n)&&o===!1)),choices:Object.fromEntries(Object.entries(e.choices||{}).filter(([n,o])=>typeof n=="string"&&["skip","overwrite","import"].includes(o)))}}export function optionsSnapshot(e){const t=cleanOptions(e,!0),s=Object.keys(t.choices).sort().map(o=>`${o}=${t.choices[o]}`).join(","),i=Object.keys(t.types).sort().map(o=>`${o}=${t.types[o]}`).join(","),n=Object.keys(t.listPages).sort().join(",");return[t.posts,t.media,t.comments,t.menus,t.redirects,t.drafts,t.products,s,i,n].join("|")}const f=/^[a-z0-9_-]{1,40}$/;export function withTypeChoice(e,t,s){const i={...e.types||{}};return s==="pages"||s==="skip"?i[t]=s:delete i[t],{...e,types:i}}export function withListPage(e,t,s){const i={...e.listPages||{}};return s?delete i[t]:i[t]=!1,{...e,listPages:i}}export const isDirty=(e,t)=>optionsSnapshot(e)!==optionsSnapshot(defaultOptions(t)),draftKey=e=>e?`wordpress-import.draft.${e}`:"";export function liveDrafts(e,t,s){if(!e||typeof e!="object"||!e.items||typeof e.items!="object")return{items:{},pruned:!1};if(e.owner&&s&&e.owner!==s)return{items:{},pruned:!1};const i={};let n=!1;for(const[o,a]of Object.entries(e.items))t.includes(o)&&a?.options&&a.was===o?i[o]=a:n=!0;return{items:i,pruned:n}}export function withDraft(e,t,s,i){const n={...e&&e.owner===t&&e.items||{}};return i?n[s]=i:delete n[s],{owner:t,items:n}}export function draftQuestion({when:e="",file:t=""}={}){return{title:"Choices you left last time",text:`You changed the import options${t?` for ${t}`:""}${e?` (${e})`:""} and left before running it. Throw away those choices and start from the defaults?`,confirmText:"Throw away",cancelText:"Keep them"}}export function progressText(e){if(!e)return"";const t=e.total?` \xB7 ${e.done} of ${e.total}`:"";return`${e.phase||"Working"}${t}${e.current?` \xB7 ${String(e.current).slice(0,80)}`:""}`}export const progressPercent=e=>e?.total?Math.min(100,Math.round(e.done/e.total*100)):0;export function planTiles(e){const t=e?.summary?.counts||{},s=i=>t[i]?t[i].total-t[i].skip:0;return[{id:"page",label:"Pages",value:s("page"),of:t.page?.total||0},{id:"post",label:"Posts",value:s("post"),of:t.post?.total||0},...t.product?[{id:"product",label:"Products",value:s("product"),of:t.product.total}]:[],...t.custom?[{id:"custom",label:"Custom items",value:s("custom"),of:t.custom.total}]:[],{id:"media",label:"Media",value:s("media"),of:t.media?.total||0},{id:"menu",label:"Menus",value:s("menu"),of:t.menu?.total||0},{id:"comments",label:"Comments",value:e?.summary?.comments||0,of:0},{id:"redirects",label:"Redirects",value:e?.summary?.redirects||0,of:0}].map(i=>({...i,sub:i.of&&i.of!==i.value?`of ${i.of}`:""}))}export function historyRow(e,t=s=>s){const s=e.summary||{},i=Object.values(s.kinds||{}).reduce((a,l)=>a+(l.created||0),0),n=Object.values(s.kinds||{}).reduce((a,l)=>a+(l.updated||0),0),o=[];return i&&o.push(`${i} made`),n&&o.push(`${n} updated`),s.redirects?.created&&o.push(`${s.redirects.created} redirect${s.redirects.created===1?"":"s"}`),s.rebuild&&o.push(`${s.rebuild} to rebuild`),s.failed&&o.push(`${s.failed} failed`),e.status==="failed"&&o.splice(0,o.length,"Stopped before the end - run it again to finish"),{id:e.id,title:e.siteTitle||e.source||"WordPress site",meta:[t(e.at),e.by,e.file].filter(Boolean).join(" \xB7 "),summary:o.join(", ")||"Nothing changed",pill:e.status==="failed"?"Stopped":e.status==="partial"?"Some failed":"Done",pillClass:e.status==="failed"||e.status==="partial"?"is-bad":"is-ok"}}export function stagedRow(e,t=s=>s){const s=e.counts||{},i=[s.page&&`${s.page} pages`,s.post&&`${s.post} posts`,s.product&&`${s.product} products`,s.attachment&&`${s.attachment} media`].filter(Boolean);return{id:e.id,title:e.siteTitle||e.fileName||"WordPress export",meta:[e.fileName,t(e.at),i.join(", ")].filter(Boolean).join(" \xB7 "),pill:e.uploads?"Uploads zip added":"Waiting",pillClass:e.uploads?"is-ok":"is-muted"}}export function productSummary(e){const t=e?.summary?.products;if(!t?.total)return null;const s=t.shop||e.shop||{},i=e.options?.products!==!1,n=Object.entries(t.types||{}).map(([r,m])=>`${m} ${(PRODUCT_TYPE_LABEL[r]||r).toLowerCase()}`).join(", "),o=e.summary.counts?.product||{},a=[{label:"In the export",value:`${t.total}${n?` (${n})`:""}`}];s.available&&i&&(a.push({label:"On sale in the Shop",value:String(t.onSale||0)}),a.push({label:"As drafts",value:String(t.drafts||0)}),o.keep&&a.push({label:"Left as is",value:String(o.keep)}),a.push({label:"Skipped",value:String(o.skip||0)})),t.rebuild&&a.push({label:"Need rebuilding",value:String(t.rebuild)});let l,c="info";return s.available?i?l=`Products go to the Shop at ${s.basePath||"/shop"}.`:l='Products are not being imported - switch on "WooCommerce products" above to bring them in.':(l=s.reason||"Switch on the Shop to bring these in.",c="warn"),{note:l,tone:c,rows:a,notes:Array.isArray(t.notes)?t.notes:[]}}const p=(e,t,s=`${t}s`)=>`${e} ${e===1?t:s}`;export function customTypeRows(e){return(e?.summary?.customTypes||[]).map(t=>{const s=TYPE_AS[t.as]?t.as:"collection",i=TYPE_AS[s],n=t.rewrite?`was at /${t.rewrite}/\u2026`:"its old addresses are not in the export";let o;if(s==="skip")o="Nothing - left out.";else if(s==="pages")o=`${p(t.importing||0,"page")} under ${t.prefix}${t.drafts?` (${t.drafts} as draft${t.drafts===1?"":"s"})`:""}.`;else{const a=t.collection||{},l=a.action==="skip"?`The collection "${a.slug}" was deleted here - choose Import again on it below.`:`${a.action==="update"?"The collection":"A new collection"} "${a.slug}" with ${p(t.fields?.length||0,"field")}: ${p(t.importing||0,"entry","entries")}${t.drafts?` (${t.drafts} draft${t.drafts===1?"":"s"}, not shown on the site)`:""}.`,c=t.listPage?t.listAt?` A list page at ${t.listAt}${t.listAction==="keep"?" (edited here - left as it is)":""}; the old addresses lead there.`:"":" No list page - the old addresses are not redirected.";o=`${l}${c}`}return{type:t.type,label:t.label||t.type,meta:[p(t.count||0,"item"),`"${t.type}"`,n].join(" \xB7 "),samples:(t.samples||[]).length?`For example: ${t.samples.join(", ")}`:"",creates:o,pill:i.text,pillClass:`is-${i.tone}`,as:s,listOn:s==="collection"&&t.listPage!==!1,canList:s==="collection",listLabel:`List page at ${t.prefix||`/${t.type}`}`,segCollection:s==="collection"?"is-on":"",segPages:s==="pages"?"is-on":"",segSkip:s==="skip"?"is-on":""}})}export function internalTypeRows(e){return(e?.summary?.internalTypes||[]).map(t=>({type:t.type,text:`${t.type} (${t.count}) - ${t.reason}`}))}export function typeMenuItems(e){if(!e)return[];const t=[];return e.as!=="collection"&&t.push({id:"collection",label:"Import as a collection",icon:"database"}),e.as!=="pages"&&t.push({id:"pages",label:"Import as pages",icon:"file-text"}),e.as!=="skip"&&t.push({id:"skip",label:"Leave this type out",icon:"x-circle"}),e.as==="collection"&&t.push(e.listOn?{id:"nolist",label:"No list page",icon:"eye-off"}:{id:"list",label:"Make a list page",icon:"list"}),t.push({id:"show",label:"Show its items",icon:"filter"}),t}
1
+ export const KIND_LABEL={page:"Page",post:"Post",product:"Product",custom:"Custom item",collection:"Collection",media:"Media",menu:"Menu",category:"Category"},KIND_PLURAL={page:"Pages",post:"Posts",product:"Products",custom:"Custom items",collection:"Collections",media:"Media",menu:"Menus",category:"Categories"},KIND_ICON={page:"file-text",post:"edit-3",product:"shopping-bag",custom:"box",collection:"database",media:"image",menu:"menu",category:"tag"},TYPE_AS={collection:{text:"Collection",tone:"ok"},pages:{text:"Pages",tone:"info"},skip:{text:"Skipped",tone:"muted"}},PRODUCT_TYPE_LABEL={simple:"Simple",variable:"With options",grouped:"Grouped",external:"External"},ACTION={create:{text:"New",tone:"ok"},rename:{text:"New, renamed",tone:"warn"},update:{text:"Update",tone:"info"},keep:{text:"Left as is",tone:"muted"},skip:{text:"Skipped",tone:"muted"}},RESULT={created:{text:"Made",tone:"ok"},updated:{text:"Updated",tone:"info"},kept:{text:"Left as is",tone:"muted"},skipped:{text:"Skipped",tone:"muted"},failed:{text:"Failed",tone:"bad"}},PLAN_FILTERS=[{id:"all",label:"All"},{id:"new",label:"New"},{id:"update",label:"Updates"},{id:"renamed",label:"Renamed"},{id:"keep",label:"Left as is"},{id:"skip",label:"Skipped"},{id:"rebuild",label:"Needs rebuilding"}],REPORT_FILTERS=[{id:"all",label:"All"},{id:"created",label:"Made"},{id:"updated",label:"Updated"},{id:"kept",label:"Left as is"},{id:"skipped",label:"Skipped"},{id:"failed",label:"Failed"},{id:"rebuild",label:"Needs rebuilding"}];const d=e=>!!(e.builder||e.needs||e.shortcodes?.length),u=e=>[e.builder?`Built with ${e.builder}`:"",e.needs||"",...(e.shortcodes||[]).map(t=>`[${t}]`)].filter(Boolean).join(" ");export function planMatches(e,t){switch(t){case"new":return e.action==="create"||e.action==="rename";case"update":return e.action==="update";case"renamed":return e.action==="rename"||!!e.replaces;case"keep":return e.action==="keep";case"skip":return e.action==="skip";case"rebuild":return d(e);default:return!0}}export function reportMatches(e,t){return t==="rebuild"?d(e):t==="all"||!t||e.result===t}export function counts(e,t,o,s=""){const n=e.filter(i=>!s||i.kind===s);return Object.fromEntries(t.map(i=>[i.id,n.filter(a=>o(a,i.id)).length]))}export function kindTabs(e){const t=["page","post","product","custom","collection","media","menu","category"],o={};for(const s of e)o[s.kind]=(o[s.kind]||0)+1;return[{id:"",label:"Everything",count:e.length},...t.filter(s=>o[s]).map(s=>({id:s,label:KIND_PLURAL[s],count:o[s]}))]}export function planRow(e){const t=ACTION[e.action]||ACTION.skip;let o=e.target?e.kind==="menu"?`Menu "${e.target}"`:e.kind==="collection"?`Collection "${e.target}"`:e.target:"";e.kind==="custom"&&e.as==="collection"&&e.collection&&e.action!=="skip"&&(o=`In the collection "${e.collection}"${e.listAt?`, listed at ${e.listAt}`:""}`);const s=[e.kind==="custom"&&e.postType?`${KIND_LABEL.custom} (${e.postType})`:KIND_LABEL[e.kind]||e.kind];return e.listFor&&s.push("list page"),e.status&&(e.kind==="page"||e.kind==="post"||e.kind==="custom")&&s.push(e.status),e.kind==="collection"&&e.fields&&s.push(`${e.fields} fields`),e.kind==="product"&&(e.productType&&s.push(PRODUCT_TYPE_LABEL[e.productType]||e.productType),e.variants&&s.push(`${e.variants} option${e.variants===1?"":"s"}`),e.action!=="skip"&&e.status&&s.push(e.status==="active"?"on sale":"draft")),e.comments&&s.push(`${e.comments} comment${e.comments===1?"":"s"}`),e.count&&s.push(`${e.count} item${e.count===1?"":"s"}`),{key:e.key,kind:e.kind,icon:KIND_ICON[e.kind]||"file",title:e.title||"(untitled)",pill:e.replaces?"Replaces a page":t.text,pillClass:`is-${e.replaces?"warn":t.tone}`,where:o,meta:s.join(" \xB7 "),reason:e.reason||"",rebuild:u(e),chosen:!!e.choice}}export function reportRow(e){const t=RESULT[e.result]||RESULT.skipped;return{key:e.key,kind:e.kind,icon:KIND_ICON[e.kind]||"file",title:e.title||"(untitled)",pill:t.text,pillClass:`is-${t.tone}`,where:e.target||"",meta:[KIND_LABEL[e.kind]||e.kind,e.format==="html"?"kept as HTML":""].filter(Boolean).join(" \xB7 "),reason:[e.reason,...e.notes||[]].filter(Boolean).join(" "),rebuild:u(e)}}export function choiceItems(e,t){const o=[];return t&&o.push({id:"reset",label:"Undo my choice",icon:"rotate-ccw"}),t!=="skip"&&e.action!=="skip"&&e.action!=="keep"&&o.push({id:"skip",label:"Skip this",icon:"x-circle"}),t!=="overwrite"&&e.action==="keep"&&o.push({id:"overwrite",label:"Overwrite my changes here",icon:"refresh-cw"}),t!=="overwrite"&&e.action==="rename"&&(e.kind==="page"||e.kind==="post")&&e.wanted&&e.kind==="page"&&o.push({id:"overwrite",label:`Replace the page at ${e.wanted}`,icon:"refresh-cw"}),t!=="import"&&e.action==="skip"&&/Deleted (on this site|from the Blog|from the Shop|from the collection)/.test(e.reason||"")&&o.push({id:"import",label:"Import again",icon:"download"}),o}export function applyChoice(e,t,o){const s={...e||{}};return!o||o==="reset"?delete s[t]:s[t]=o,s}export function defaultOptions(e=!1){return{posts:e?"blog":"pages",media:"download",comments:!0,menus:!0,redirects:!0,drafts:!0,products:!0,types:{},listPages:{},choices:{},users:{},userRole:"",invite:!1}}export function cleanOptions(e={},t=!1){const o=defaultOptions(t),s=(n,i,a)=>i.includes(n)?n:a;return{posts:s(e.posts,t?["blog","pages","skip"]:["pages","skip"],o.posts),media:s(e.media,["download","zip","skip"],o.media),comments:e.comments!==!1,menus:e.menus!==!1,redirects:e.redirects!==!1,drafts:e.drafts!==!1,products:e.products!==!1,types:Object.fromEntries(Object.entries(e.types||{}).filter(([n,i])=>f.test(n)&&(i==="pages"||i==="skip"))),listPages:Object.fromEntries(Object.entries(e.listPages||{}).filter(([n,i])=>f.test(n)&&i===!1)),choices:Object.fromEntries(Object.entries(e.choices||{}).filter(([n,i])=>typeof n=="string"&&["skip","overwrite","import"].includes(i))),users:Object.fromEntries(Object.entries(e.users||{}).filter(([n,i])=>h.test(n)&&(i==="create"||i==="skip"))),userRole:typeof e.userRole=="string"&&g.test(e.userRole)?e.userRole:"",invite:e.invite===!0}}export function optionsSnapshot(e){const t=cleanOptions(e,!0),o=Object.keys(t.choices).sort().map(a=>`${a}=${t.choices[a]}`).join(","),s=Object.keys(t.types).sort().map(a=>`${a}=${t.types[a]}`).join(","),n=Object.keys(t.listPages).sort().join(","),i=Object.keys(t.users).sort().map(a=>`${a}=${t.users[a]}`).join(",");return[t.posts,t.media,t.comments,t.menus,t.redirects,t.drafts,t.products,o,s,n,i,t.userRole,t.invite].join("|")}const f=/^[a-z0-9_-]{1,40}$/;export function withTypeChoice(e,t,o){const s={...e.types||{}};return o==="pages"||o==="skip"?s[t]=o:delete s[t],{...e,types:s}}export function withListPage(e,t,o){const s={...e.listPages||{}};return o?delete s[t]:s[t]=!1,{...e,listPages:s}}export const isDirty=(e,t)=>optionsSnapshot(e)!==optionsSnapshot(defaultOptions(t)),draftKey=e=>e?`wordpress-import.draft.${e}`:"";export function liveDrafts(e,t,o){if(!e||typeof e!="object"||!e.items||typeof e.items!="object")return{items:{},pruned:!1};if(e.owner&&o&&e.owner!==o)return{items:{},pruned:!1};const s={};let n=!1;for(const[i,a]of Object.entries(e.items))t.includes(i)&&a?.options&&a.was===i?s[i]=a:n=!0;return{items:s,pruned:n}}export function withDraft(e,t,o,s){const n={...e&&e.owner===t&&e.items||{}};return s?n[o]=s:delete n[o],{owner:t,items:n}}export function draftQuestion({when:e="",file:t=""}={}){return{title:"Choices you left last time",text:`You changed the import options${t?` for ${t}`:""}${e?` (${e})`:""} and left before running it. Throw away those choices and start from the defaults?`,confirmText:"Throw away",cancelText:"Keep them"}}export function progressText(e){if(!e)return"";const t=e.total?` \xB7 ${e.done} of ${e.total}`:"";return`${e.phase||"Working"}${t}${e.current?` \xB7 ${String(e.current).slice(0,80)}`:""}`}export const progressPercent=e=>e?.total?Math.min(100,Math.round(e.done/e.total*100)):0;export function planTiles(e){const t=e?.summary?.counts||{},o=s=>t[s]?t[s].total-t[s].skip:0;return[{id:"page",label:"Pages",value:o("page"),of:t.page?.total||0},{id:"post",label:"Posts",value:o("post"),of:t.post?.total||0},...t.product?[{id:"product",label:"Products",value:o("product"),of:t.product.total}]:[],...t.custom?[{id:"custom",label:"Custom items",value:o("custom"),of:t.custom.total}]:[],{id:"media",label:"Media",value:o("media"),of:t.media?.total||0},{id:"menu",label:"Menus",value:o("menu"),of:t.menu?.total||0},...e?.people?.rows?.length?[{id:"people",label:"New accounts",value:e.people.counts?.create||0,of:0}]:[],{id:"comments",label:"Comments",value:e?.summary?.comments||0,of:0},{id:"redirects",label:"Redirects",value:e?.summary?.redirects||0,of:0}].map(s=>({...s,sub:s.of&&s.of!==s.value?`of ${s.of}`:""}))}const h=/^author:(\d{1,12}|login-[\w.-]{1,60})$/,g=/^[a-z0-9][a-z0-9_-]{0,59}$/i;export const PERSON={create:{text:"New account",tone:"ok"},match:{text:"Matched",tone:"info"},linked:{text:"Linked before",tone:"info"},same:{text:"Same email",tone:"muted"},skip:{text:"No account",tone:"muted"}};export function creditText(e={}){const t=(o,s,n)=>e[o]?`${e[o]} ${e[o]===1?s:n}`:"";return[t("post","post","posts"),t("page","page","pages"),t("product","product","products"),t("custom","item","items")].filter(Boolean).join(", ")||"nothing in this import"}export function personRow(e){const t=PERSON[e.action]||PERSON.skip,o=e.problem==="email";return{key:e.key,name:e.name||"Author",meta:[e.email||(o?"no usable email":""),creditText(e.items)].filter(Boolean).join(" \xB7 "),reason:e.reason||"",pill:o?"No email":t.text,pillClass:`is-${o?"warn":t.tone}${e.choice?" is-chosen":""}`,choosable:!!e.choosable,segCreate:e.action==="create"?"is-on":"",segSkip:e.action==="skip"?"is-on":""}}export function chooseAllPeople(e,t){const o={};for(const s of e?.rows||[])s.choosable&&(o[s.key]=t);return o}export function choosePerson(e,t,o){const s={...e||{}},n=t.total?"create":"skip";return!o||o==="reset"||o===n?delete s[t.key]:s[t.key]=o,s}export function personMenuItems(e){const t=[];return e.choosable&&e.action!=="create"&&t.push({id:"create",label:"Make a new account",icon:"user-plus"}),e.choosable&&e.action!=="skip"&&t.push({id:"skip",label:"Do not make an account",icon:"user-x"}),e.choice&&t.push({id:"reset",label:"Undo my choice",icon:"rotate-ccw"}),e.email&&e.problem!=="email"&&t.push({id:"copy",label:"Copy the email address",icon:"copy"}),t.length||t.push({id:"none",label:"Nothing to choose for them",icon:"info",disabled:!0}),t}export function peopleSummary(e){const t=e?.counts||{};if(!e?.rows?.length)return{text:"This export names no authors.",tone:"info"};const o=[];t.create&&o.push(`${t.create} new account${t.create===1?"":"s"}`),t.match+t.linked&&o.push(`${t.match+t.linked} matched to ${t.match+t.linked===1?"a user":"users"} here`),t.skip&&o.push(`${t.skip} without an account`);let s=`${e.rows.length} author${e.rows.length===1?"":"s"}: ${o.join(", ")||"nothing to do"}.`;return t.create&&(s+=" New accounts have no password - nobody can sign in to one until a password is set."),!e.canCreate&&e.why&&(s+=` ${e.why}`),{text:s,tone:t.problems||!e.canCreate?"warn":"info"}}export function inviteNote(e){return e?.canCreate?e.mailReady?e.counts?.create?"Sent once the import has finished: an invitation saying an account has been made for them, with a link to set their password that works for 7 days.":"Nobody new to email.":"No mail server is set up (Settings \u203A Email), so this cannot be sent. After the import, use Users \u203A \u22EE \u203A Copy a reset link instead.":""}export function reportPersonRow(e){const t={created:{text:"Account made",tone:"ok"},matched:{text:"Matched",tone:"info"},linked:{text:"Linked before",tone:"info"},same:{text:"Same email",tone:"muted"},skipped:{text:"No account",tone:"muted"},failed:{text:"Failed",tone:"bad"}},o=t[e.result]||t.skipped,s=[creditText(e.items)];return e.result==="created"&&s.push(e.invited?"invited by email":e.inviteFailed?"the invitation was not sent":"no password set yet"),{key:e.key,name:e.name||"Author",meta:s.join(" \xB7 "),reason:e.reason||"",pill:o.text,pillClass:`is-${o.tone}`,userId:e.userId||""}}export function historyRow(e,t=o=>o){const o=e.summary||{},s=Object.values(o.kinds||{}).reduce((a,l)=>a+(l.created||0),0),n=Object.values(o.kinds||{}).reduce((a,l)=>a+(l.updated||0),0),i=[];return s&&i.push(`${s} made`),o.people?.created&&i.push(`${o.people.created} account${o.people.created===1?"":"s"}`),n&&i.push(`${n} updated`),o.redirects?.created&&i.push(`${o.redirects.created} redirect${o.redirects.created===1?"":"s"}`),o.rebuild&&i.push(`${o.rebuild} to rebuild`),o.failed&&i.push(`${o.failed} failed`),e.status==="failed"&&i.splice(0,i.length,"Stopped before the end - run it again to finish"),{id:e.id,title:e.siteTitle||e.source||"WordPress site",meta:[t(e.at),e.by,e.file].filter(Boolean).join(" \xB7 "),summary:i.join(", ")||"Nothing changed",pill:e.status==="failed"?"Stopped":e.status==="partial"?"Some failed":"Done",pillClass:e.status==="failed"||e.status==="partial"?"is-bad":"is-ok"}}export function stagedRow(e,t=o=>o){const o=e.counts||{},s=[o.page&&`${o.page} pages`,o.post&&`${o.post} posts`,o.product&&`${o.product} products`,o.attachment&&`${o.attachment} media`].filter(Boolean);return{id:e.id,title:e.siteTitle||e.fileName||"WordPress export",meta:[e.fileName,t(e.at),s.join(", ")].filter(Boolean).join(" \xB7 "),pill:e.uploads?"Uploads zip added":"Waiting",pillClass:e.uploads?"is-ok":"is-muted"}}export function productSummary(e){const t=e?.summary?.products;if(!t?.total)return null;const o=t.shop||e.shop||{},s=e.options?.products!==!1,n=Object.entries(t.types||{}).map(([p,m])=>`${m} ${(PRODUCT_TYPE_LABEL[p]||p).toLowerCase()}`).join(", "),i=e.summary.counts?.product||{},a=[{label:"In the export",value:`${t.total}${n?` (${n})`:""}`}];o.available&&s&&(a.push({label:"On sale in the Shop",value:String(t.onSale||0)}),a.push({label:"As drafts",value:String(t.drafts||0)}),i.keep&&a.push({label:"Left as is",value:String(i.keep)}),a.push({label:"Skipped",value:String(i.skip||0)})),t.rebuild&&a.push({label:"Need rebuilding",value:String(t.rebuild)});let l,c="info";return o.available?s?l=`Products go to the Shop at ${o.basePath||"/shop"}.`:l='Products are not being imported - switch on "WooCommerce products" above to bring them in.':(l=o.reason||"Switch on the Shop to bring these in.",c="warn"),{note:l,tone:c,rows:a,notes:Array.isArray(t.notes)?t.notes:[]}}const r=(e,t,o=`${t}s`)=>`${e} ${e===1?t:o}`;export function customTypeRows(e){return(e?.summary?.customTypes||[]).map(t=>{const o=TYPE_AS[t.as]?t.as:"collection",s=TYPE_AS[o],n=t.rewrite?`was at /${t.rewrite}/\u2026`:"its old addresses are not in the export";let i;if(o==="skip")i="Nothing - left out.";else if(o==="pages")i=`${r(t.importing||0,"page")} under ${t.prefix}${t.drafts?` (${t.drafts} as draft${t.drafts===1?"":"s"})`:""}.`;else{const a=t.collection||{},l=a.action==="skip"?`The collection "${a.slug}" was deleted here - choose Import again on it below.`:`${a.action==="update"?"The collection":"A new collection"} "${a.slug}" with ${r(t.fields?.length||0,"field")}: ${r(t.importing||0,"entry","entries")}${t.drafts?` (${t.drafts} draft${t.drafts===1?"":"s"}, not shown on the site)`:""}.`,c=t.listPage?t.listAt?` A list page at ${t.listAt}${t.listAction==="keep"?" (edited here - left as it is)":""}; the old addresses lead there.`:"":" No list page - the old addresses are not redirected.";i=`${l}${c}`}return{type:t.type,label:t.label||t.type,meta:[r(t.count||0,"item"),`"${t.type}"`,n].join(" \xB7 "),samples:(t.samples||[]).length?`For example: ${t.samples.join(", ")}`:"",creates:i,pill:s.text,pillClass:`is-${s.tone}`,as:o,listOn:o==="collection"&&t.listPage!==!1,canList:o==="collection",listLabel:`List page at ${t.prefix||`/${t.type}`}`,segCollection:o==="collection"?"is-on":"",segPages:o==="pages"?"is-on":"",segSkip:o==="skip"?"is-on":""}})}export function internalTypeRows(e){return(e?.summary?.internalTypes||[]).map(t=>({type:t.type,text:`${t.type} (${t.count}) - ${t.reason}`}))}export function typeMenuItems(e){if(!e)return[];const t=[];return e.as!=="collection"&&t.push({id:"collection",label:"Import as a collection",icon:"database"}),e.as!=="pages"&&t.push({id:"pages",label:"Import as pages",icon:"file-text"}),e.as!=="skip"&&t.push({id:"skip",label:"Leave this type out",icon:"x-circle"}),e.as==="collection"&&t.push(e.listOn?{id:"nolist",label:"No list page",icon:"eye-off"}:{id:"list",label:"Make a list page",icon:"list"}),t.push({id:"show",label:"Show its items",icon:"filter"}),t}
@@ -49,7 +49,6 @@
49
49
  <p>Add a connection under <strong>Data &gt; Collections &gt; Database connections</strong> (admins only), or
50
50
  with <code>npm run pro enable</code>. On a site run by the Domma Manager, the MongoDB Adapter plugin sets the
51
51
  connection up for you (see below).</p>
52
- <p>The optional Redis cache driver is also described as a Pro feature. It needs Redis, not a licence.</p>
53
52
 
54
53
  <h3>Free plugins</h3>
55
54
  <p>These are marked <code>free</code> in their manifests and ship in the CMS <code>plugins/</code> folder.
@@ -65,6 +65,11 @@
65
65
  it and Admin is given it once. Groups made before 0.93.0 have no recorded creator, so only
66
66
  holders of the permission can change them. In Manage groups, Rename and Delete are greyed out
67
67
  where you may not, with a note saying why.</p>
68
+ <p><strong>The foot of a contact's card</strong> lists what other Tools hold about them, one
69
+ section per Tool: Bookings, Calls, Events, Quotes and, with <strong>Email</strong> (Pro), your
70
+ ten newest emails to or from any of the contact's addresses. Each entry opens where it lives -
71
+ an email opens in Email. Only your own mailboxes are searched. A Tool that is not installed
72
+ adds no section.</p>
68
73
 
69
74
  <h3>Call someone now (Pro)</h3>
70
75
  <p>With a Pro Tool that has calls - <strong>Booking Pro</strong>, <strong>Contacts Pro</strong> or
@@ -82,6 +82,12 @@
82
82
  </select>
83
83
  <small class="form-hint">Where the items sit along a horizontal menu. On the public navbar the default is <strong>centre</strong>, measured on the bar itself rather than on the room left beside the brand. A <code>[menu]</code> in the page body packs left unless you choose otherwise. Vertical menus and the mobile drawer ignore this.</small>
84
84
  </div>
85
+ <div class="form-group">
86
+ <label>Mobile navbar</label>
87
+ <label class="flex items-center gap-2"><input type="checkbox" id="me-mobile-hamburger" name="mobileHamburgerOnly" style="width:auto;margin:0"> Hamburger only (hide the top bar)</label>
88
+ <label class="flex items-center gap-2"><input type="checkbox" id="me-mobile-brand" name="mobileHideBrand" style="width:auto;margin:0"> Hide branding on mobile</label>
89
+ <small class="form-hint">Applies below 993px when this menu fills the navbar slot. Hamburger only leaves a floating menu button and hides the bar and its action icons. Branding stays visible unless hidden separately. Search remains available through Ctrl+K or Cmd+K.</small>
90
+ </div>
85
91
  <div class="form-group dm-vertical-field" style="display:none">
86
92
  <label for="me-side">Rail side</label>
87
93
  <select id="me-side" name="side" class="form-input">
@@ -64,7 +64,7 @@
64
64
  <div class="wpx-options">
65
65
  <div class="wpx-option">
66
66
  <span class="form-label">Posts
67
- <span data-help-title="Posts" data-help="To the Blog: each post becomes a Blog post, with its categories, tags, featured image, author (matched by email to a user here, otherwise you) and approved comments. As pages: each post becomes a page - under /blog when the site has no Blog switched on, under /posts when it has (the Blog answers at its own address). A post scheduled in WordPress stays scheduled in the Blog; drafts, pending and private posts arrive as drafts."></span></span>
67
+ <span data-help-title="Posts" data-help="To the Blog: each post becomes a Blog post, with its categories, tags, featured image, author (the account they match or get here - see Users below - otherwise you) and approved comments. As pages: each post becomes a page - under /blog when the site has no Blog switched on, under /posts when it has (the Blog answers at its own address). A post scheduled in WordPress stays scheduled in the Blog; drafts, pending and private posts arrive as drafts."></span></span>
68
68
  <div class="wpx-seg" role="group" aria-label="Posts">
69
69
  <button type="button" data-on-click="postsBlog" data-bind-class="opt.value.posts === 'blog' && 'is-on'" data-bind-disabled="!blogAvailable.value">To the Blog</button>
70
70
  <button type="button" data-on-click="postsPages" data-bind-class="opt.value.posts === 'pages' && 'is-on'">As pages</button>
@@ -127,6 +127,24 @@
127
127
  <ul class="wpx-note wpx-product-notes" data-each="productNotes.value key=text"></ul>
128
128
  </div>
129
129
 
130
+ <div class="wpx-card wpx-people" hidden data-bind-hidden="!hasPeople.value">
131
+ <div class="wpx-card-title"><span data-icon="users" data-icon-size="16"></span> Users
132
+ <span data-help-title="WordPress authors" data-help="Everyone the export names as an author, and what they come to here. Matched: a user here has the same email address (capitals do not matter) - what they wrote is credited to them, and their account is not changed in any way. New account: an account is made with the role you choose below and no password - nobody can sign in to it until a password is set, from a link you send (the invitation switch below, or Users › Send password reset). No account: what they wrote is credited to you. Authors who wrote nothing that is being imported get no account unless you choose one. An author with no usable email address never gets an account, and two authors with the same email share one. WordPress passwords and roles are not in the export, so they never come across. Run the import again and the same people are credited to the same accounts - nobody is made twice, and nobody's account is changed."></span>
133
+ <span class="wpx-spacer"></span>
134
+ <button type="button" class="btn btn-sm btn-ghost" data-on-click="peopleAll" data-bind-disabled="!peopleChoosable.value">All</button>
135
+ <button type="button" class="btn btn-sm btn-ghost" data-on-click="peopleNone" data-bind-disabled="!peopleChoosable.value">None</button></div>
136
+ <p class="wpx-alert" data-bind-class="peopleNoteCls.value"><span data-bind-text="peopleNote.value"></span></p>
137
+ <div class="wpx-people-ctl" hidden data-bind-hidden="!peopleCanCreate.value">
138
+ <label class="wpx-role-pick"><span class="form-label">Role for new accounts
139
+ <span data-help="The role every new account gets. Only roles junior to your own are offered, as in Users › New user; the default is the site's least-privileged role. Change any account's role later in Users."></span></span>
140
+ <select class="form-select form-select-sm wpx-role" aria-label="Role for new accounts"></select></label>
141
+ <label class="wpx-toggle"><input type="checkbox" class="form-switch" data-model="optInvite.value" data-bind-disabled="!inviteAvailable.value"> Email each new user an invitation to set their password
142
+ <span data-help-title="Invitations" data-help="Off unless you switch it on. When the import has finished, each new account is emailed an invitation - an account has been made for them on this site - with a link to set their password. The link works once and lasts 7 days; if it runs out, send a password reset from Users. A reset sent later replaces the invitation's link. Leave it off to tell people yourself first."></span></label>
143
+ <small class="wpx-note" hidden data-bind-hidden="!inviteText.value" data-bind-text="inviteText.value"></small>
144
+ </div>
145
+ <div class="wpx-list wpx-people-list" data-each="peopleRows.value key=key"></div>
146
+ </div>
147
+
130
148
  <div class="wpx-card wpx-custom" hidden data-bind-hidden="!hasCustom.value">
131
149
  <div class="wpx-card-title"><span data-icon="box" data-icon-size="16"></span> Custom types
132
150
  <span data-help-title="Custom types" data-help="Content a theme or plugin added to WordPress - events, team members, portfolio pieces. Collection (the usual choice): each type becomes a collection named wp-…, with the title, address, text, excerpt, date, status and featured image of each item, plus its categories and every custom field it had (Advanced Custom Fields included). Drafts come across but are never shown on the site. A list page at the type's old address shows the published ones, and the old single-item addresses lead to it. Pages: each item becomes a page at its old address, its categories as tags. Skip: left out. Run it again later and entries you edited here are left alone unless you choose Overwrite; a collection only ever gains fields."></span></div>
@@ -250,6 +268,10 @@
250
268
  .wpx-type-row .wpx-where { font-family: inherit; font-size: var(--dm-text-sm); }
251
269
  .wpx-internal-box summary { cursor: pointer; color: var(--dm-text-muted); font-size: var(--dm-text-sm); }
252
270
  .wpx-internal { padding-left: 1.1rem; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .25rem; }
271
+ .wpx-people-ctl { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
272
+ .wpx-role-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
273
+ .wpx-role { width: auto; max-width: 100%; }
274
+ .wpx-people-ctl .wpx-note { flex-basis: 100%; }
253
275
  .wpx-report { display: flex; flex-direction: column; gap: .75rem; padding: .25rem 0; }
254
276
  @media (max-width: 720px) { .wpx-toggles { grid-template-columns: 1fr; } .wpx-row { flex-wrap: wrap; } .wpx-chips { justify-content: flex-start; } }
255
277
  </style>