@mx-space/cli 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/mxs.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as run } from "../mxs-ClNF0UNu.mjs";
2
+ import { t as run } from "../mxs-DFe4-jre.mjs";
3
3
  export { run };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-ClNF0UNu.mjs";
1
+ import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-DFe4-jre.mjs";
2
2
  export { codeForTag, defaultGlobalFlags, defaultMessageFor, exitCodeForError, exitCodeForTag, parseGlobalFlags, run, tagToCode, toErrorEnvelope };
@@ -12618,7 +12618,7 @@ function customAlphabet(alphabet, size = 21) {
12618
12618
  return customRandom(alphabet, size, random);
12619
12619
  }
12620
12620
  //#endregion
12621
- //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.3/node_modules/@haklex/rich-litexml/dist/src-Chu1pfGY.js
12621
+ //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.6/node_modules/@haklex/rich-litexml/dist/src-z3l9E6En.js
12622
12622
  var impl = null;
12623
12623
  function registerParseHTML(fn) {
12624
12624
  impl = fn;
@@ -13628,8 +13628,66 @@ function isFormatTag(tagName) {
13628
13628
  function getFormatBit(tagName) {
13629
13629
  return FORMAT_TAG_TO_BIT[tagName.toLowerCase()] ?? 0;
13630
13630
  }
13631
+ /**
13632
+ * HTML5 void elements — tags the HTML parser already treats as self-closing
13633
+ * regardless of `/>` syntax. Custom or non-void tags written as `<tag … />`
13634
+ * are otherwise interpreted as opening tags by the HTML parser, which then
13635
+ * swallows all following siblings as children until a matching close tag (or
13636
+ * end of document) is found. We expand those into explicit `<tag …></tag>`
13637
+ * before handing the string to linkedom / DOMParser.
13638
+ */
13639
+ var HTML_VOID_ELEMENTS = new Set([
13640
+ "area",
13641
+ "base",
13642
+ "br",
13643
+ "col",
13644
+ "embed",
13645
+ "hr",
13646
+ "img",
13647
+ "input",
13648
+ "link",
13649
+ "meta",
13650
+ "param",
13651
+ "source",
13652
+ "track",
13653
+ "wbr"
13654
+ ]);
13655
+ var SELF_CLOSING_RE = /<([\w-]+)((?:\s+[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'))?)*)\s*\/>/g;
13656
+ var CDATA_OPEN = "<![CDATA[";
13657
+ var CDATA_CLOSE = "]]>";
13658
+ function expandSelfClosing(chunk) {
13659
+ return chunk.replaceAll(SELF_CLOSING_RE, (match, tag, attrs) => {
13660
+ if (HTML_VOID_ELEMENTS.has(tag.toLowerCase())) return match;
13661
+ return `<${tag}${attrs}></${tag}>`;
13662
+ });
13663
+ }
13664
+ /**
13665
+ * Expand `<custom-tag … />` to `<custom-tag …></custom-tag>` outside CDATA.
13666
+ * Leaves HTML void elements and already-paired tags untouched. CDATA content
13667
+ * is sliced out verbatim with `indexOf` to avoid regex pitfalls around `]]>`.
13668
+ */
13669
+ function normalizeSelfClosingTags(xml) {
13670
+ const out = [];
13671
+ let cursor = 0;
13672
+ while (cursor < xml.length) {
13673
+ const start = xml.indexOf(CDATA_OPEN, cursor);
13674
+ if (start < 0) {
13675
+ out.push(expandSelfClosing(xml.slice(cursor)));
13676
+ break;
13677
+ }
13678
+ out.push(expandSelfClosing(xml.slice(cursor, start)));
13679
+ const end = xml.indexOf(CDATA_CLOSE, start + 9);
13680
+ if (end < 0) {
13681
+ out.push(xml.slice(start));
13682
+ break;
13683
+ }
13684
+ out.push(xml.slice(start, end + 3));
13685
+ cursor = end + 3;
13686
+ }
13687
+ return out.join("");
13688
+ }
13631
13689
  function parseXml(xml) {
13632
- return parseHTML$1(`<!DOCTYPE html><html><body>${xml}</body></html>`);
13690
+ return parseHTML$1(`<!DOCTYPE html><html><body>${normalizeSelfClosingTags(xml)}</body></html>`);
13633
13691
  }
13634
13692
  function deserializeFromXml(xml, registry) {
13635
13693
  const doc = parseXml(xml);
@@ -13645,7 +13703,6 @@ function deserializeFromXml(xml, registry) {
13645
13703
  }
13646
13704
  /** Structural containers whose whitespace-only text nodes are layout artifacts, not content */
13647
13705
  var BLOCK_TAGS = new Set([
13648
- "body",
13649
13706
  "doc",
13650
13707
  "fragment",
13651
13708
  "root",
@@ -13674,16 +13731,24 @@ function createReaderContext(registry) {
13674
13731
  parseChildren(element) {
13675
13732
  const blockLevel = isBlockContainer(element);
13676
13733
  const nodes = [];
13677
- for (const child of element.childNodes) if (child.nodeType === 3) {
13678
- const text = child.textContent ?? "";
13679
- if (blockLevel && text.trim() === "") continue;
13680
- if (text === "") continue;
13681
- nodes.push(makeTextNode(text, 0));
13682
- } else if (child.nodeType === 1) {
13734
+ let pendingText = "";
13735
+ const flushText = () => {
13736
+ if (pendingText === "") return;
13737
+ if (blockLevel && pendingText.trim() === "") {
13738
+ pendingText = "";
13739
+ return;
13740
+ }
13741
+ nodes.push(makeTextNode(pendingText, 0));
13742
+ pendingText = "";
13743
+ };
13744
+ for (const child of element.childNodes) if (child.nodeType === 3) pendingText += child.textContent ?? "";
13745
+ else if (child.nodeType === 1) {
13746
+ flushText();
13683
13747
  const parsed = parseElement(child, registry, ctx, 0);
13684
13748
  if (parsed) if (Array.isArray(parsed)) nodes.push(...parsed);
13685
13749
  else nodes.push(parsed);
13686
13750
  }
13751
+ flushText();
13687
13752
  return nodes;
13688
13753
  },
13689
13754
  parseNestedState(xml) {
@@ -13709,15 +13774,20 @@ function parseElement(element, registry, ctx, inheritedFormat) {
13709
13774
  }
13710
13775
  function parseInlineChildren(element, registry, ctx, format) {
13711
13776
  const nodes = [];
13712
- for (const child of element.childNodes) if (child.nodeType === 3) {
13713
- const text = child.textContent ?? "";
13714
- if (text === "") continue;
13715
- nodes.push(makeTextNode(text, format));
13716
- } else if (child.nodeType === 1) {
13777
+ let pendingText = "";
13778
+ const flushText = () => {
13779
+ if (pendingText === "") return;
13780
+ nodes.push(makeTextNode(pendingText, format));
13781
+ pendingText = "";
13782
+ };
13783
+ for (const child of element.childNodes) if (child.nodeType === 3) pendingText += child.textContent ?? "";
13784
+ else if (child.nodeType === 1) {
13785
+ flushText();
13717
13786
  const parsed = parseElement(child, registry, ctx, format);
13718
13787
  if (parsed) if (Array.isArray(parsed)) nodes.push(...parsed);
13719
13788
  else nodes.push(parsed);
13720
13789
  }
13790
+ flushText();
13721
13791
  return nodes;
13722
13792
  }
13723
13793
  function parseFallbackNode(element) {
@@ -24886,7 +24956,7 @@ function Document() {
24886
24956
  }
24887
24957
  setPrototypeOf(Document, Document$1).prototype = Document$1.prototype;
24888
24958
  //#endregion
24889
- //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.3/node_modules/@haklex/rich-litexml/dist/node.mjs
24959
+ //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.6/node_modules/@haklex/rich-litexml/dist/node.mjs
24890
24960
  registerParseHTML((html) => parseHTML(html).document);
24891
24961
  //#endregion
24892
24962
  //#region src/services/Renderer/content.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",
@@ -53,8 +53,8 @@
53
53
  "@effect/platform": "0.96.1",
54
54
  "@effect/platform-node": "0.106.0",
55
55
  "@haklex/rich-headless": "0.13.0",
56
- "@haklex/rich-litexml": "0.15.3",
57
- "@haklex/rich-litexml-cli": "0.15.3",
56
+ "@haklex/rich-litexml": "0.15.6",
57
+ "@haklex/rich-litexml-cli": "0.15.6",
58
58
  "@lexical/headless": "^0.44.0",
59
59
  "better-auth": "^1.6.9",
60
60
  "effect": "3.21.2",