@nuasite/cms 0.34.0 → 0.35.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.
package/dist/editor.js CHANGED
@@ -381,7 +381,7 @@ function PS(t, e) {
381
381
  function LS(t, e) {
382
382
  return typeof e == "function" ? e(t) : e;
383
383
  }
384
- const o3 = "0.34.0", a3 = o3, nt = {
384
+ const o3 = "0.35.0", a3 = o3, nt = {
385
385
  /** Highlight overlay for hovered elements */
386
386
  HIGHLIGHT: 2147483644,
387
387
  /** Hover outline for elements/components */
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "directory": "packages/astro-cms"
15
15
  },
16
16
  "license": "Apache-2.0",
17
- "version": "0.34.0",
17
+ "version": "0.35.0",
18
18
  "module": "src/index.ts",
19
19
  "types": "src/index.ts",
20
20
  "type": "module",
@@ -1499,16 +1499,21 @@ export function inferCollectionFromAstroImageUrl(
1499
1499
  }
1500
1500
 
1501
1501
  /**
1502
- * Extract the original image path from an Astro Image optimization URL.
1503
- * Astro's `<Image>` component rewrites src to `/_image?href=%2Fpath.jpg&w=...` in dev.
1504
- * Returns the decoded `href` param, or undefined if the URL isn't an Astro image URL.
1502
+ * Extract the original image path from a dev-mode optimized image URL.
1503
+ * Recognizes:
1504
+ * - Astro's `<Image>`: `/_image?href=%2Fpath.jpg&w=...` → `href` param
1505
+ * - astro-imagetools / vite-imagetools: `/@image/<hash>.<ext>?f=<abs-path>&...` → `f` param
1505
1506
  */
1506
1507
  export function extractAstroImageOriginalUrl(src: string): string | undefined {
1507
1508
  try {
1508
1509
  const url = new URL(src, 'http://localhost')
1509
1510
  if (url.pathname === '/_image' || url.pathname.startsWith('/_image/')) {
1510
1511
  const href = url.searchParams.get('href')
1511
- if (href && href !== src) return href
1512
+ if (href) return href
1513
+ }
1514
+ if (url.pathname.startsWith('/@image/')) {
1515
+ const f = url.searchParams.get('f')
1516
+ if (f) return f
1512
1517
  }
1513
1518
  } catch {
1514
1519
  // Not a valid URL