@omniharmonic/openspace-cli 0.1.13 → 0.1.14

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.
@@ -1,9 +1,9 @@
1
1
  import { createRequire as __osCreateRequire } from "node:module"; const require = __osCreateRequire(import.meta.url);
2
2
  import {
3
3
  generateAgentsMd
4
- } from "./chunk-IXN2CNGL.js";
4
+ } from "./chunk-SY5NDWS2.js";
5
5
  import "./chunk-26AZCID5.js";
6
6
  export {
7
7
  generateAgentsMd
8
8
  };
9
- //# sourceMappingURL=agents-md-QBMFXTIQ.js.map
9
+ //# sourceMappingURL=agents-md-63S3T7CX.js.map
package/dist/bin.js CHANGED
@@ -3,9 +3,9 @@ import { createRequire as __osCreateRequire } from "node:module"; const require
3
3
  import {
4
4
  processIo,
5
5
  run
6
- } from "./chunk-B5C7S4S5.js";
7
- import "./chunk-EFSGZWAO.js";
8
- import "./chunk-IXN2CNGL.js";
6
+ } from "./chunk-TDLUJHWB.js";
7
+ import "./chunk-N7WFQYFE.js";
8
+ import "./chunk-SY5NDWS2.js";
9
9
  import "./chunk-26AZCID5.js";
10
10
 
11
11
  // src/bin.ts
@@ -8931,7 +8931,20 @@ function parseBlock(el) {
8931
8931
  const image = img ? imageFrom(img) : void 0;
8932
8932
  if (image) return { kind: "image", image, ...href ? { href } : {} };
8933
8933
  }
8934
- return { kind: "product", ...href ? { path: href } : {} };
8934
+ const shows = (part) => {
8935
+ const m = new RegExp(`--product-block-display-${part}\\s*:\\s*([a-z-]+)`).exec(styles);
8936
+ return m ? m[1] !== "none" : void 0;
8937
+ };
8938
+ const show = {
8939
+ ...shows("price") === false ? { price: false } : {},
8940
+ ...shows("excerpt") === false ? { excerpt: false } : {},
8941
+ ...shows("purchase-controls") === false ? { buy: false } : {}
8942
+ };
8943
+ return {
8944
+ kind: "product",
8945
+ ...href ? { path: href } : {},
8946
+ ...Object.keys(show).length ? { show } : {}
8947
+ };
8935
8948
  }
8936
8949
  case "shape":
8937
8950
  return void 0;
@@ -9101,7 +9114,7 @@ function parseTheme(css, bodyClasses = []) {
9101
9114
  if (style === "solid" || style === "outline" || style === "raised") theme.buttons.style = style;
9102
9115
  if (has2("tweak-fixed-header") || has2("tweak-fixed-header-style-basic") || has2("tweak-fixed-header-style-scroll-back"))
9103
9116
  theme.headerFixed = true;
9104
- if (has2("tweak-transparent-header")) theme.headerTransparent = true;
9117
+ if (has2("tweak-transparent-header") || has2("transparent-header")) theme.headerTransparent = true;
9105
9118
  return theme;
9106
9119
  }
9107
9120
 
@@ -9391,7 +9404,7 @@ var INLINE_TAGS = /* @__PURE__ */ new Set([
9391
9404
  "font",
9392
9405
  "wbr"
9393
9406
  ]);
9394
- var BOILERPLATE = /(?:^|[\s_-])(?:cookie|consent|gdpr|cc-window|popup|modal|skip-link|skip-to|screen-reader|sr-only|visually-hidden|visuallyhidden|w-nav-overlay|mobile-menu|menu-overlay|offcanvas|breadcrumbs?|pagination|nav-links|post-navigation|comments?-area|comment-respond|share-buttons|sharedaddy|jp-relatedposts|wp-block-navigation|search-form|searchform|announcement-bar|back-to-top|wixui-anchor-menu|elementor-hidden|w-form-done|w-form-fail|w-webflow-badge)(?:$|[\s_-])/i;
9407
+ var BOILERPLATE = /(?:^|[\s_-])(?:cookie|consent|gdpr|cc-window|popup|modal|skip-link|skip-to|screen-reader|sr-only|visually-hidden|visuallyhidden|w-nav-overlay|mobile-menu|menu-overlay|offcanvas|breadcrumbs?|pagination|nav-links|post-navigation|comments?-area|comment-respond|share-buttons|sharedaddy|jp-relatedposts|wp-block-navigation|search-form|searchform|announcement-bar|back-to-top|wixui-anchor-menu|elementor-hidden|w-form-done|w-form-fail|w-webflow-badge|contact-form-submission|contact-form-success)(?:$|[\s_-])/i;
9395
9408
  var hiddenClasses = /* @__PURE__ */ new Set();
9396
9409
  function hiddenClassesFromCss(css) {
9397
9410
  const out = /* @__PURE__ */ new Set();
@@ -9943,13 +9956,30 @@ function leafBlocks(el, ctx, out) {
9943
9956
  }
9944
9957
  if (imgEl) {
9945
9958
  const im = imageFromImg(imgEl, ctx.base);
9946
- const cap = text(find(el, (e) => e.tagName === "figcaption"));
9959
+ const capEl = find(el, (e) => e.tagName === "figcaption");
9960
+ const structured = capEl && !!find(capEl, (e) => HEADINGS.has(e.tagName) || e.tagName === "p");
9961
+ if (structured && im) {
9962
+ const declared2 = Number(attr(imgEl, "width") ?? 0);
9963
+ const a2 = find(el, (e) => e.tagName === "a" && !!find(e, (x) => x === imgEl));
9964
+ const href2 = a2 ? attr(a2, "href") : void 0;
9965
+ out.push({
9966
+ kind: "image",
9967
+ image: im,
9968
+ ...declared2 > 0 && declared2 <= 400 ? { natural: true } : {},
9969
+ ...href2 && !/\.(?:jpe?g|png|webp|gif|avif)(?:\?|$)/i.test(href2) && !href2.startsWith("#") ? { href: href2 } : {}
9970
+ });
9971
+ walk(capEl, ctx, out, 1);
9972
+ return;
9973
+ }
9974
+ const cap = text(capEl);
9947
9975
  const a = tag2 === "a" ? el : find(el, (e) => e.tagName === "a" && !!find(e, (x) => x === imgEl));
9948
9976
  const href = a ? attr(a, "href") : void 0;
9977
+ const declared = Number(attr(imgEl, "width") ?? 0);
9949
9978
  if (im)
9950
9979
  out.push({
9951
9980
  kind: "image",
9952
9981
  image: im,
9982
+ ...declared > 0 && declared <= 400 ? { natural: true } : {},
9953
9983
  ...cap ? { caption: cap } : {},
9954
9984
  ...href && !/\.(?:jpe?g|png|webp|gif|avif)(?:\?|$)/i.test(href) && !href.startsWith("#") ? { href } : {}
9955
9985
  });
@@ -10244,10 +10274,34 @@ function liftHeading(sec) {
10244
10274
  return;
10245
10275
  }
10246
10276
  }
10277
+ function thumbnailRuns(blocks) {
10278
+ const out = [];
10279
+ let run = [];
10280
+ const flush = () => {
10281
+ if (run.length >= 3)
10282
+ out.push({
10283
+ kind: "gallery",
10284
+ layout: "grid",
10285
+ images: run.map((b) => b.image)
10286
+ });
10287
+ else out.push(...run);
10288
+ run = [];
10289
+ };
10290
+ for (const b of blocks) {
10291
+ if (b.kind === "image" && !b.caption && (b.image.width ?? 999) <= 240) run.push(b);
10292
+ else {
10293
+ flush();
10294
+ out.push(b);
10295
+ }
10296
+ }
10297
+ flush();
10298
+ return out;
10299
+ }
10247
10300
  function toSection(el, ctx) {
10248
10301
  const bg = sectionBackground(el, ctx.base);
10249
10302
  const inner = withoutBackground(el, bg, ctx.base);
10250
10303
  const rows = rowsOf(inner, ctx).filter((r) => r.columns.some((c) => c.blocks.length));
10304
+ for (const r of rows) for (const c of r.columns) c.blocks = thumbnailRuns(c.blocks);
10251
10305
  if (!rows.length && !bg) return void 0;
10252
10306
  const style = attr(el, "style") ?? "";
10253
10307
  const tall = /min-height\s*:\s*(\d+)(vh|px)/i.exec(style);
@@ -10317,6 +10371,23 @@ function sectionsFrom(main, base, opts = {}) {
10317
10371
  }
10318
10372
  out.push(s);
10319
10373
  }
10374
+ return mergeTitleSections(out);
10375
+ }
10376
+ function mergeTitleSections(sections) {
10377
+ const out = [];
10378
+ for (let i = 0; i < sections.length; i++) {
10379
+ const s = sections[i];
10380
+ const next = sections[i + 1];
10381
+ const blocks = s.layout.mode === "classic" ? s.layout.rows.flatMap((r) => r.columns.flatMap((c) => c.blocks)) : [];
10382
+ const onlyTitle = blocks.length === 1 && !s.background && !s.role && (blocks[0]?.kind === "heading" && blocks[0].level <= 2 || blocks[0]?.kind === "text" && /^\s*<h[12][^>]*>[^<]*(?:<[^h/][^>]*>[^<]*<\/[^>]+>[^<]*)*<\/h[12]>\s*$/i.test(
10383
+ blocks[0].html
10384
+ ));
10385
+ if (onlyTitle && next && !next.background && !next.role && next.layout.mode === "classic" && next.layout.rows[0]?.columns.length === 1) {
10386
+ next.layout.rows[0].columns[0]?.blocks.unshift(blocks[0]);
10387
+ continue;
10388
+ }
10389
+ out.push(s);
10390
+ }
10320
10391
  return out;
10321
10392
  }
10322
10393
  var SOCIAL_HOSTS = /(?:^|\.)(?:instagram\.com|facebook\.com|fb\.com|twitter\.com|x\.com|threads\.net|bsky\.app|linkedin\.com|youtube\.com|youtu\.be|tiktok\.com|pinterest\.[a-z.]+|github\.com|spotify\.com|soundcloud\.com|bandcamp\.com|vimeo\.com|behance\.net|dribbble\.com|substack\.com|patreon\.com|yelp\.[a-z.]+|tripadvisor\.[a-z.]+|mastodon\.social|tumblr\.com|medium\.com|whatsapp\.com|wa\.me|t\.me|discord\.gg)$/i;
@@ -11316,7 +11387,7 @@ function parsePlatform(s) {
11316
11387
  function parseLayout(layout) {
11317
11388
  const rows = [];
11318
11389
  for (const row of children(layout).filter((e) => hasClass(e, "sqs-row")))
11319
- rows.push(parseRow(row));
11390
+ rows.push(...expandRow(row));
11320
11391
  const loose = children(layout).filter((e) => hasClass(e, "sqs-block"));
11321
11392
  if (loose.length) {
11322
11393
  const blocks = loose.map(parseBlock).filter((b) => !!b);
@@ -11324,6 +11395,37 @@ function parseLayout(layout) {
11324
11395
  }
11325
11396
  return expandImageCards(rows.filter((r) => r.columns.some((c) => c.blocks.length)));
11326
11397
  }
11398
+ function expandRow(row) {
11399
+ const cols = children(row).filter((e) => classes(e).some((c) => /^sqs-col-\d+$/.test(c)));
11400
+ if (cols.length !== 1) return [parseRow(row)];
11401
+ const span = Number(classValue(cols[0], "span-") ?? 12);
11402
+ if (span < 12) return [parseRow(row)];
11403
+ const out = [];
11404
+ let run = [];
11405
+ let split = false;
11406
+ const flush = () => {
11407
+ if (run.length) out.push({ columns: [{ span: 12, blocks: run }] });
11408
+ run = [];
11409
+ };
11410
+ const visit = (el) => {
11411
+ for (const c of children(el)) {
11412
+ if (hasClass(c, "sqs-block")) {
11413
+ const b = parseBlock(c);
11414
+ if (b) run.push(b);
11415
+ } else if (hasClass(c, "sqs-row")) {
11416
+ const nested = expandRow(c);
11417
+ if (nested.some((r) => r.columns.filter((x) => x.blocks.length).length > 1)) {
11418
+ split = true;
11419
+ flush();
11420
+ out.push(...nested);
11421
+ } else for (const r of nested) for (const x of r.columns) run.push(...x.blocks);
11422
+ } else visit(c);
11423
+ }
11424
+ };
11425
+ visit(cols[0]);
11426
+ flush();
11427
+ return split ? out : [parseRow(row)];
11428
+ }
11327
11429
  function columnBlocks(col) {
11328
11430
  const out = [];
11329
11431
  for (const c of children(col)) {
@@ -11402,12 +11504,19 @@ function cardBlocks(card) {
11402
11504
  return out;
11403
11505
  }
11404
11506
  function parseRow(row) {
11405
- const columns = children(row).filter((e) => classes(e).some((c) => /^sqs-col-\d+$/.test(c))).map((col) => {
11507
+ const columns = children(row).filter((e) => classes(e).some((c) => /^sqs-col-\d+$/.test(c))).flatMap((col) => {
11406
11508
  const span = Number(classValue(col, "span-") ?? classValue(col, "sqs-col-") ?? 12);
11407
- return {
11408
- span: Number.isFinite(span) && span > 0 ? Math.min(12, span) : 12,
11409
- blocks: columnBlocks(col)
11410
- };
11509
+ const inner = children(col).filter((c) => !/^(?:SCRIPT|STYLE)$/i.test(c.tagName));
11510
+ if (inner.length === 1 && hasClass(inner[0], "sqs-row")) {
11511
+ const nested = parseRow(inner[0]).columns.filter((c) => c.blocks.length);
11512
+ if (nested.length > 1) return nested;
11513
+ }
11514
+ return [
11515
+ {
11516
+ span: Number.isFinite(span) && span > 0 ? Math.min(12, span) : 12,
11517
+ blocks: columnBlocks(col)
11518
+ }
11519
+ ];
11411
11520
  });
11412
11521
  if (!columns.length) return { columns: [{ span: 12, blocks: columnBlocks(row) }] };
11413
11522
  return { columns };
@@ -11480,7 +11589,8 @@ function gallerySectionBlock(section) {
11480
11589
  }
11481
11590
  if (!images.length) return void 0;
11482
11591
  const layout = /slideshow|fullscreen/.test(cls) ? "slideshow" : /reel/.test(cls) ? "carousel" : /strips/.test(cls) ? "strips" : /masonry/.test(cls) ? "masonry" : "grid";
11483
- return { kind: "gallery", images, layout };
11592
+ const contain = layout === "slideshow" && !!find(section, (e) => classes(e).some((c) => c === "content-fit"));
11593
+ return { kind: "gallery", images, layout, ...contain ? { fit: "contain" } : {} };
11484
11594
  }
11485
11595
  function listSectionBlocks(section) {
11486
11596
  const out = [];
@@ -11588,6 +11698,7 @@ function parseSection(section) {
11588
11698
  const layouts = findAll(content, (e) => hasClass(e, "sqs-layout"), { deep: false });
11589
11699
  const rows = layouts.flatMap(parseLayout);
11590
11700
  out.layout = { mode: "classic", rows };
11701
+ if (rows.length > 1) out.together = true;
11591
11702
  return rows.length || out.background ? out : void 0;
11592
11703
  }
11593
11704
  function navFrom(root) {
@@ -11677,7 +11788,7 @@ function parsePage(html) {
11677
11788
  headerEl2,
11678
11789
  (e) => e.tagName === "img" && !!closest(
11679
11790
  e,
11680
- (p) => classes(p).some(
11791
+ (p) => attr(p, "id") === "logoImage" || attr(p, "id") === "logo" || classes(p).some(
11681
11792
  (c) => c === "header-title-logo" || c === "logo-image" || c === "site-logo" || c === "logo"
11682
11793
  )
11683
11794
  )
@@ -11886,7 +11997,9 @@ function bannerSection(body, skip) {
11886
11997
  level: 2,
11887
11998
  ...before.length === 1 && text(before[0]).length <= 60 ? { eyebrow: text(before[0]) } : {},
11888
11999
  ...after.length && after.map((p) => text(p)).join(" ").length <= 280 ? { subheading: after.map((p) => text(p)).join(" ") } : {},
11889
- align: "center"
12000
+ align: "center",
12001
+ // The banner's title is set larger than any heading (the display size).
12002
+ display: true
11890
12003
  });
11891
12004
  links.forEach((p, i) => {
11892
12005
  const a = p.tagName === "a" ? p : find(p, byTag("a"));
@@ -12288,7 +12401,7 @@ function itemFromHtml(path, page, kind) {
12288
12401
  const p = ldOf(page, "Product");
12289
12402
  const rawOffers = p?.offers;
12290
12403
  const offers = Array.isArray(rawOffers) ? rawOffers[0] : rawOffers;
12291
- const price = Number(offers?.price);
12404
+ const price = Number(offers?.price ?? offers?.lowPrice);
12292
12405
  item.product = {
12293
12406
  price: Number.isFinite(price) ? Math.round(price * 100) : 0,
12294
12407
  currency: typeof offers?.priceCurrency === "string" ? offers.priceCurrency : "USD",
@@ -12511,7 +12624,10 @@ ${r.text}`;
12511
12624
  const itemPaths = all.filter(
12512
12625
  (p) => (path === "/" ? (
12513
12626
  // A shop as the home page lists items under its own address too (`/shop/p/x`).
12514
- (kind === "products" ? /^\/(?:[^/]+\/)?p\/[^/]+$/ : /^\/(?:p\/[^/]+|\d{4}\/\d{1,2}\/\d{1,2}\/[^/]+)$/).test(p)
12627
+ (kind === "products" ? (
12628
+ // Variant products keep a slash in their slug (`/shop/p/linen-top-/-blue`).
12629
+ /^\/(?:[^/]+\/)?p\/[^/].*$/
12630
+ ) : /^\/(?:p\/[^/]+|\d{4}\/\d{1,2}\/\d{1,2}\/[^/]+)$/).test(p)
12515
12631
  ) : p.startsWith(`${path}/`)) && !handled.has(p) && !/\/(?:category|tag|tags|categories)\//.test(p.slice(path.length))
12516
12632
  );
12517
12633
  for (const ip of itemPaths) {
@@ -12993,4 +13109,4 @@ export {
12993
13109
  crawlSquarespace,
12994
13110
  crawlGeneric
12995
13111
  };
12996
- //# sourceMappingURL=chunk-EFSGZWAO.js.map
13112
+ //# sourceMappingURL=chunk-N7WFQYFE.js.map