@decocms/start 1.4.3 → 1.4.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/start",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "type": "module",
5
5
  "description": "Deco framework for TanStack Start - CMS bridge, admin protocol, hooks, schema generation",
6
6
  "main": "./src/index.ts",
@@ -121,11 +121,20 @@ export async function handleRender(request: Request): Promise<Response> {
121
121
  const url = new URL(request.url);
122
122
  const resolveChain = url.searchParams.get("resolveChain");
123
123
  const propsParam = url.searchParams.get("props");
124
+ console.log("handleRender", request.url);
124
125
 
125
126
  const pathPrefix = "/live/previews/";
126
- const pathComponent = url.pathname.startsWith(pathPrefix)
127
+ const rawPathComponent = url.pathname.startsWith(pathPrefix)
127
128
  ? url.pathname.slice(pathPrefix.length)
128
129
  : "";
130
+ // Admin sends double-encoded path segments (e.g. space → %20 → %2520).
131
+ // Decode until stable so the block key matches the decofile.
132
+ const pathComponent = (() => {
133
+ try {
134
+ const once = decodeURIComponent(rawPathComponent);
135
+ try { return decodeURIComponent(once); } catch { return once; }
136
+ } catch { return rawPathComponent; }
137
+ })();
129
138
  let component = resolveChain || pathComponent || "";
130
139
  let props: Record<string, unknown> = {};
131
140
  let decofileOverride: Record<string, unknown> | null = null;
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // @decocms/start — framework layer for Deco storefronts
1
2
  export * from "./admin/index";
2
3
  export * from "./cms/index";
3
4
  export * from "./hooks/index";