From ca8dc24343faff2c70fb5e9073fd038322dbe545 Mon Sep 17 00:00:00 2001 From: winstonwumbo Date: Thu, 5 Mar 2026 17:09:15 -0500 Subject: [PATCH 1/3] Better, node-based state handling for idents/outdents in hax-body --- elements/hax-body/hax-body.js | 83 ++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 12 deletions(-) diff --git a/elements/hax-body/hax-body.js b/elements/hax-body/hax-body.js index 789796b39d..7d7466b38b 100755 --- a/elements/hax-body/hax-body.js +++ b/elements/hax-body/hax-body.js @@ -2476,8 +2476,68 @@ class HaxBody extends I18NMixin(UndoManagerBehaviors(SimpleColors)) { // If hax-body isn't the next parent if(currentNode.parentNode && currentNode.parentNode !== bodyNode){ - unwrap(currentNode.parentNode) - return currentNode.parentNode; + const parentNode = currentNode.parentNode; + const grandparentNode = currentNode.parentNode.parentNode; + + if(currentNode.previousElementSibling){ + const prevParent = parentNode.previousElementSibling; + // If the previous parent container is a matching list type, append to it in order + if(prevParent && + prevParent.tagName === parentNode.tagName) { + let prevLI = parentNode.firstChild; + while(prevLI !== currentNode){ + const isPrev = prevLI.nextElementSibling; + prevParent.appendChild(parentNode.firstChild); + prevLI = isPrev; + } + } else { + const beforeNodes = parentNode.cloneNode(false); + let prevLI = currentNode.previousElementSibling; + while(prevLI){ + beforeNodes.prepend(prevLI) + const isPrev = prevLI.previousElementSibling; + prevLI = isPrev; + } + beforeNodes.removeAttribute("data-hax-active"); + grandparentNode.insertBefore(beforeNodes, parentNode); + } + } + + if(currentNode.nextElementSibling){ + const nextParent = parentNode.nextElementSibling; + // If the next parent container is a matching list type, prepend to it in order + if(nextParent && + nextParent.tagName === parentNode.tagName) { + let nextLI = parentNode.lastChild; + while(nextLI !== currentNode){ + const isNext = nextLI.previousElementSibling; + nextParent.prepend(nextLI); + nextLI = isNext; + } + } else { + const afterNodes = parentNode.cloneNode(false); + let nextLI = currentNode.nextElementSibling; + while(nextLI){ + const isNext = nextLI.nextElementSibling; + afterNodes.appendChild(nextLI) + nextLI = isNext; + } + afterNodes.removeAttribute("data-hax-active"); + // If no nextSibling, nextParent is null and insertBefore acts like appendChild + grandparentNode.insertBefore(afterNodes, nextParent); + } + } + // Unwrap original UL/OL + unwrap(parentNode); + + // If we're outdenting into a paragraph, the LI tag shouldn't be preserved + if(grandparentNode.tagName.toLowerCase() !== "ol" || grandparentNode.tagName.toLowerCase() !== "ul" ){ + const strippedLI = globalThis.document.createElement("span"); + strippedLI.innerHTML = currentNode.innerHTML.trim() + "
" + currentNode.replaceWith(strippedLI) + }; + + return grandparentNode; } else { return this.haxChangeTagName(node, "p", true) } @@ -2497,12 +2557,11 @@ class HaxBody extends I18NMixin(UndoManagerBehaviors(SimpleColors)) { ) ) { replacement.innerHTML = - "
  • " + node.innerHTML .trim() - .replace(//g, "
  • \n
  • ") - .replace(/
    /g, "
  • \n
  • ") + - "
  • "; + .replace(//g, "
  • ") + .replace(/
    <\/span>/g, "
  • \n") + .replace(/<\/span>/g, "\n"); } // when converting to list, ensure slot is on the list, not the items if (originalSlot) { @@ -2521,12 +2580,12 @@ class HaxBody extends I18NMixin(UndoManagerBehaviors(SimpleColors)) { node.tagName.toLowerCase() == "ol" ) { // if we're coming from ul or ol strip out the li tags - replacement.innerHTML = replacement.innerHTML - .replace(/
      /g, "") - .replace(/<\/ul>/g, "") - .replace(/
    • <\/li>/g, "") - .replace(/
    • /g, "") - .replace(/<\/li>/g, "
      "); + const items = Array.from(node.children).map((child) => { + const tag = child.tagName.toLowerCase(); + if(tag === "li") return "" + child.innerHTML.trim() + "
      "; + else if(tag === "ul" || tag === "ol") return child.outerHTML; + }); + replacement.innerHTML = items.join(""); } // Switch! try { From 21a938a4bf59ff1221c844b49202273b20c3c18d Mon Sep 17 00:00:00 2001 From: winstonwumbo Date: Thu, 5 Mar 2026 17:15:50 -0500 Subject: [PATCH 2/3] Updated platformConfig keys, removed generic manifest key --- .../lib/core/haxcms-site-editor-ui.js | 6 +-- .../lib/core/haxcms-site-store.js | 5 +- .../lib/core/ui/haxcms-site-platform-ui.js | 52 ++++++++++++++++++- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/elements/haxcms-elements/lib/core/haxcms-site-editor-ui.js b/elements/haxcms-elements/lib/core/haxcms-site-editor-ui.js index 941da89ffd..d083a5df82 100644 --- a/elements/haxcms-elements/lib/core/haxcms-site-editor-ui.js +++ b/elements/haxcms-elements/lib/core/haxcms-site-editor-ui.js @@ -2933,7 +2933,7 @@ class HAXCMSSiteEditorUI extends HAXCMSThemeParts( class="top-bar-button" id="manifestbtn" ?disabled="${this.editMode}" - ?hidden="${this.editMode || !store.platformAllows("manifest")}" + ?hidden="${this.editMode}" label="${this.t.siteSettings} • Ctrl⇧5" > @@ -4949,9 +4949,7 @@ class HAXCMSSiteEditorUI extends HAXCMSThemeParts( ); } else { // Non-edit mode: Site settings - if (store.platformAllows("manifest")) { - this._manifestButtonTap(e); - } + this._manifestButtonTap(e); } }, condition: () => store.isLoggedIn, diff --git a/elements/haxcms-elements/lib/core/haxcms-site-store.js b/elements/haxcms-elements/lib/core/haxcms-site-store.js index 7ba8985176..6084b999c3 100644 --- a/elements/haxcms-elements/lib/core/haxcms-site-store.js +++ b/elements/haxcms-elements/lib/core/haxcms-site-store.js @@ -1091,7 +1091,10 @@ class Store { "styleGuide", "outlineDesigner", "insights", - "manifest", + "siteManifest", + "themeManifest", + "authorManifest", + "seoManifest", "addBlock", "contentMap", "viewSource", diff --git a/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js b/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js index 809a2424fd..0338bd766c 100644 --- a/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js +++ b/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js @@ -15,6 +15,12 @@ const FEATURE_DEFS = [ icon: 'hax:add-page', group: 'CMS', }, + { + key: 'saveAndEdit', + label: 'Add pages', + icon: 'hax:add-page', + group: 'CMS', + }, { key: 'deletePage', label: 'Delete pages', @@ -40,7 +46,25 @@ const FEATURE_DEFS = [ group: 'CMS', }, { - key: 'manifest', + key: 'siteManifest', + label: 'Site settings', + icon: 'hax:home-edit', + group: 'CMS', + }, + { + key: 'themeManifest', + label: 'Site settings', + icon: 'hax:home-edit', + group: 'CMS', + }, + { + key: 'authorManifest', + label: 'Site settings', + icon: 'hax:home-edit', + group: 'CMS', + }, + { + key: 'seoManifest', label: 'Site settings', icon: 'hax:home-edit', group: 'CMS', @@ -57,6 +81,18 @@ const FEATURE_DEFS = [ icon: 'hax:add-brick', group: 'HAX', }, + { + key: 'popularGizmos', + label: 'Add blocks', + icon: 'hax:add-brick', + group: 'HAX', + }, + { + key: 'recentGizmos', + label: 'Add blocks', + icon: 'hax:add-brick', + group: 'HAX', + }, { key: 'contentMap', label: 'Page structure (content map)', @@ -70,7 +106,19 @@ const FEATURE_DEFS = [ group: 'HAX', }, { - key: 'onlineSearch', + key: 'uploadMedia', + label: 'Online search', + icon: 'hax:add-page', + group: 'HAX', + }, + { + key: 'onlineMedia', + label: 'Online search', + icon: 'hax:add-page', + group: 'HAX', + }, + { + key: 'community', label: 'Online search', icon: 'hax:add-page', group: 'HAX', From e4b927f4a96b7749197fb6f99e869e39d216487d Mon Sep 17 00:00:00 2001 From: winstonwumbo Date: Thu, 5 Mar 2026 17:44:00 -0500 Subject: [PATCH 3/3] Fixed platform-ui option labeling --- .../lib/core/ui/haxcms-site-platform-ui.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js b/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js index 0338bd766c..9d8f0182b5 100644 --- a/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js +++ b/elements/haxcms-elements/lib/core/ui/haxcms-site-platform-ui.js @@ -17,7 +17,7 @@ const FEATURE_DEFS = [ }, { key: 'saveAndEdit', - label: 'Add pages', + label: 'Save and continue', icon: 'hax:add-page', group: 'CMS', }, @@ -53,25 +53,25 @@ const FEATURE_DEFS = [ }, { key: 'themeManifest', - label: 'Site settings', + label: 'Theme settings', icon: 'hax:home-edit', group: 'CMS', }, { key: 'authorManifest', - label: 'Site settings', + label: 'Author settings', icon: 'hax:home-edit', group: 'CMS', }, { key: 'seoManifest', - label: 'Site settings', + label: 'SEO settings', icon: 'hax:home-edit', group: 'CMS', }, { key: 'pageBreak', - label: 'Edit Page Details', + label: 'Edit page details', icon: 'hax:page-edit', group: 'CMS', }, @@ -83,19 +83,19 @@ const FEATURE_DEFS = [ }, { key: 'popularGizmos', - label: 'Add blocks', + label: 'Popular blocks section', icon: 'hax:add-brick', group: 'HAX', }, { key: 'recentGizmos', - label: 'Add blocks', + label: 'Recent blocks section', icon: 'hax:add-brick', group: 'HAX', }, { key: 'contentMap', - label: 'Page structure (content map)', + label: 'Page content map', icon: 'hax:newspaper', group: 'HAX', }, @@ -107,19 +107,19 @@ const FEATURE_DEFS = [ }, { key: 'uploadMedia', - label: 'Online search', + label: 'Upload media', icon: 'hax:add-page', group: 'HAX', }, { key: 'onlineMedia', - label: 'Online search', + label: 'Online media search', icon: 'hax:add-page', group: 'HAX', }, { key: 'community', - label: 'Online search', + label: 'Community outreach', icon: 'hax:add-page', group: 'HAX', },