@haklex/rich-litexml-cli 0.33.0 → 0.34.0

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 (2) hide show
  1. package/dist/cli.mjs +38 -3
  2. package/package.json +4 -4
package/dist/cli.mjs CHANGED
@@ -10975,9 +10975,18 @@ var EmbedNode = headlessDecorator("embed", ["url", "source"], {
10975
10975
  source: null
10976
10976
  });
10977
10977
  var CodeSnippetNode = headlessDecorator("code-snippet", ["files"], { files: [] });
10978
- var GalleryNode = headlessDecorator("gallery", ["images", "layout"], {
10978
+ var GalleryNode = headlessDecorator("gallery", [
10979
+ "images",
10980
+ "layout",
10981
+ "aspect",
10982
+ "fit",
10983
+ "maxItemHeight"
10984
+ ], {
10979
10985
  images: [],
10980
- layout: "grid"
10986
+ layout: "grid",
10987
+ aspect: "auto",
10988
+ fit: "cover",
10989
+ maxItemHeight: void 0
10981
10990
  });
10982
10991
  var ExcalidrawNode = headlessDecorator("excalidraw", ["snapshot"], { snapshot: "" });
10983
10992
  var DynamicNode = headlessDecorator("dynamic", [
@@ -23699,6 +23708,26 @@ function imageLayoutAttr(el) {
23699
23708
  const v = el.getAttribute("layout");
23700
23709
  return v !== null && IMAGE_LAYOUTS.has(v) ? v : void 0;
23701
23710
  }
23711
+ var GALLERY_ASPECTS = /* @__PURE__ */ new Set([
23712
+ "auto",
23713
+ "1:1",
23714
+ "4:3",
23715
+ "16:9",
23716
+ "3:4"
23717
+ ]);
23718
+ var GALLERY_FITS = /* @__PURE__ */ new Set(["cover", "contain"]);
23719
+ function galleryAspectAttr(el) {
23720
+ const v = el.getAttribute("aspect");
23721
+ return v !== null && GALLERY_ASPECTS.has(v) ? v : "auto";
23722
+ }
23723
+ function galleryFitAttr(el) {
23724
+ const v = el.getAttribute("fit");
23725
+ return v !== null && GALLERY_FITS.has(v) ? v : "cover";
23726
+ }
23727
+ function galleryMaxItemHeightAttr(el) {
23728
+ const v = numAttr(el, "max-item-height");
23729
+ return v !== void 0 && Number.isFinite(v) && v > 0 ? v : void 0;
23730
+ }
23702
23731
  /**
23703
23732
  * Extract CDATA text content from an element.
23704
23733
  * linkedom (HTML parser) converts <![CDATA[...]]> to a comment node
@@ -23923,6 +23952,9 @@ function registerCustomReaders(registry) {
23923
23952
  ...extractBlockId(el),
23924
23953
  images,
23925
23954
  layout: el.getAttribute("layout") ?? "grid",
23955
+ aspect: galleryAspectAttr(el),
23956
+ fit: galleryFitAttr(el),
23957
+ maxItemHeight: galleryMaxItemHeightAttr(el),
23926
23958
  version: 1
23927
23959
  };
23928
23960
  });
@@ -24469,7 +24501,10 @@ function registerCustomWriters(registry) {
24469
24501
  tag: "gallery",
24470
24502
  attrs: optAttr({
24471
24503
  ...blockId(n),
24472
- layout: n.layout
24504
+ "layout": n.layout,
24505
+ "aspect": n.aspect && n.aspect !== "auto" ? n.aspect : void 0,
24506
+ "fit": n.fit && n.fit !== "cover" ? n.fit : void 0,
24507
+ "max-item-height": n.maxItemHeight != null ? String(n.maxItemHeight) : void 0
24473
24508
  }),
24474
24509
  children: images
24475
24510
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-litexml-cli",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "Unified CLI for haklex LiteXML: convert LiteXML or Lexical JSON to HTML, JSON, or Markdown.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@lexical/headless": "^0.49.0",
20
20
  "lexical": "^0.49.0",
21
- "@haklex/rich-compose": "0.33.0",
22
- "@haklex/rich-litexml": "0.33.0",
23
- "@haklex/rich-headless": "0.33.0"
21
+ "@haklex/rich-compose": "0.34.0",
22
+ "@haklex/rich-litexml": "0.34.0",
23
+ "@haklex/rich-headless": "0.34.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "26.1.0",