@bagelink/blox 1.15.218 → 1.15.220

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.
@@ -63,20 +63,24 @@ async function expandRoutes(apiBase, pages) {
63
63
  const b = binding;
64
64
  if (b.adapter === "datastore" && b.collection != null && b.collection !== "" && b.store != null && b.store !== "" && b.bind_by != null && b.bind_by !== "") {
65
65
  try {
66
+ const q = b.filter ? `&q=${encodeURIComponent(b.filter)}` : "";
66
67
  const itemsRes = await fetch(
67
- `${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200`
68
+ `${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200${q}`
68
69
  );
69
70
  const itemsData = await itemsRes.json();
70
71
  const items = Array.isArray(itemsData) ? itemsData : itemsData.data ?? [];
71
72
  for (const item of items) {
72
73
  const bindValue = item[b.bind_by];
73
- if (bindValue != null && bindValue !== "") {
74
- const concrete = slug.replace(
75
- /:([a-z_]+)/g,
76
- (_m, p) => p === b.bind_by ? String(bindValue) : String(item[p] ?? "")
77
- );
78
- routes.push(concrete);
79
- }
74
+ if (typeof bindValue !== "string" || bindValue === "") continue;
75
+ const concrete = slug.replace(
76
+ /:([a-z_]+)/g,
77
+ (_m, p) => {
78
+ const v = p === b.bind_by ? bindValue : item[p];
79
+ return typeof v === "string" ? v : "";
80
+ }
81
+ );
82
+ if (concrete.includes("//") || concrete.endsWith("/")) continue;
83
+ routes.push(concrete);
80
84
  }
81
85
  } catch (e) {
82
86
  console.warn(` [blox-ssg] Could not expand ${slug}: ${e.message}`);
@@ -597,6 +601,7 @@ function discoverInternalLinks(html) {
597
601
  while ((m = hrefRe.exec(html)) !== null) {
598
602
  const raw = (m[1] ?? m[2] ?? "").trim();
599
603
  if (!raw) continue;
604
+ if (raw.includes("[object Object]") || raw.includes("undefined") || raw.includes("/null")) continue;
600
605
  if (raw.startsWith("mailto:") || raw.startsWith("tel:") || raw.startsWith("javascript:") || raw.startsWith("#")) {
601
606
  continue;
602
607
  }
@@ -86,20 +86,24 @@ async function expandRoutes(apiBase, pages) {
86
86
  const b = binding;
87
87
  if (b.adapter === "datastore" && b.collection != null && b.collection !== "" && b.store != null && b.store !== "" && b.bind_by != null && b.bind_by !== "") {
88
88
  try {
89
+ const q = b.filter ? `&q=${encodeURIComponent(b.filter)}` : "";
89
90
  const itemsRes = await fetch(
90
- `${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200`
91
+ `${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200${q}`
91
92
  );
92
93
  const itemsData = await itemsRes.json();
93
94
  const items = Array.isArray(itemsData) ? itemsData : itemsData.data ?? [];
94
95
  for (const item of items) {
95
96
  const bindValue = item[b.bind_by];
96
- if (bindValue != null && bindValue !== "") {
97
- const concrete = slug.replace(
98
- /:([a-z_]+)/g,
99
- (_m, p) => p === b.bind_by ? String(bindValue) : String(item[p] ?? "")
100
- );
101
- routes.push(concrete);
102
- }
97
+ if (typeof bindValue !== "string" || bindValue === "") continue;
98
+ const concrete = slug.replace(
99
+ /:([a-z_]+)/g,
100
+ (_m, p) => {
101
+ const v = p === b.bind_by ? bindValue : item[p];
102
+ return typeof v === "string" ? v : "";
103
+ }
104
+ );
105
+ if (concrete.includes("//") || concrete.endsWith("/")) continue;
106
+ routes.push(concrete);
103
107
  }
104
108
  } catch (e) {
105
109
  console.warn(` [blox-ssg] Could not expand ${slug}: ${e.message}`);
@@ -620,6 +624,7 @@ function discoverInternalLinks(html) {
620
624
  while ((m = hrefRe.exec(html)) !== null) {
621
625
  const raw = (m[1] ?? m[2] ?? "").trim();
622
626
  if (!raw) continue;
627
+ if (raw.includes("[object Object]") || raw.includes("undefined") || raw.includes("/null")) continue;
623
628
  if (raw.startsWith("mailto:") || raw.startsWith("tel:") || raw.startsWith("javascript:") || raw.startsWith("#")) {
624
629
  continue;
625
630
  }
package/dist/ssg/cli.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
  "use strict";
3
3
  const process = require("node:process");
4
- const prerender = require("../prerender-BkTA1QZ6.cjs");
4
+ const prerender = require("../prerender-DQfXe7gk.cjs");
5
5
  function installFetchTimeout() {
6
6
  const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
7
7
  const original = globalThis.fetch;
package/dist/ssg/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  import process from "node:process";
3
- import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-wIuYNW6N.js";
3
+ import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-CDlP5pQU.js";
4
4
  function installFetchTimeout() {
5
5
  const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
6
6
  const original = globalThis.fetch;
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const prerender = require("../prerender-BkTA1QZ6.cjs");
25
+ const prerender = require("../prerender-DQfXe7gk.cjs");
26
26
  const ssg_client = require("./client.cjs");
27
27
  const pinia = require("pinia");
28
28
  const vue = require("vue");
@@ -1,5 +1,5 @@
1
- import { b as buildPageHead } from "../prerender-wIuYNW6N.js";
2
- import { c, d, f, g, e, h, i, p, a } from "../prerender-wIuYNW6N.js";
1
+ import { b as buildPageHead } from "../prerender-CDlP5pQU.js";
2
+ import { c, d, f, g, e, h, i, p, a } from "../prerender-CDlP5pQU.js";
3
3
  import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
4
4
  import { BLOX_DATA_WINDOW_KEY, BLOX_PAGE_SEO_WINDOW_KEY, getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
5
5
  import { createPinia } from "pinia";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.15.218",
4
+ "version": "1.15.220",
5
5
  "description": "Blox page builder library for drag-and-drop page building and static data management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",