@reforma/site 0.1.0 → 0.1.1

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.
@@ -4,7 +4,10 @@ export type FixErrorDetail = {
4
4
  digest: string | null;
5
5
  stack: string | null;
6
6
  };
7
- /** Fallback for `error.tsx` and `global-error.tsx`. Details and Fix with AI show in development only. */
7
+ /**
8
+ * Fallback for `error.tsx` and `global-error.tsx`. Details and Fix with AI show in development only.
9
+ * `data-reforma-error-page` tells the editor to lift its design overlay so the buttons take clicks.
10
+ */
8
11
  export declare function ErrorState({ error }: {
9
12
  error: unknown;
10
13
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"error-state.d.ts","sourceRoot":"","sources":["../src/error-state.tsx"],"names":[],"mappings":"AAIA,+FAA+F;AAC/F,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AA+CF,yGAAyG;AACzG,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,+BAmCvD"}
1
+ {"version":3,"file":"error-state.d.ts","sourceRoot":"","sources":["../src/error-state.tsx"],"names":[],"mappings":"AAIA,+FAA+F;AAC/F,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AA+CF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,+BAmCvD"}
@@ -43,7 +43,10 @@ const styles = {
43
43
  digest: { fontFamily: 'ui-monospace, Menlo, monospace', fontSize: '12px', margin: '20px 0 0', opacity: 0.6 },
44
44
  };
45
45
  const subscribe = () => () => { };
46
- /** Fallback for `error.tsx` and `global-error.tsx`. Details and Fix with AI show in development only. */
46
+ /**
47
+ * Fallback for `error.tsx` and `global-error.tsx`. Details and Fix with AI show in development only.
48
+ * `data-reforma-error-page` tells the editor to lift its design overlay so the buttons take clicks.
49
+ */
47
50
  export function ErrorState({ error }) {
48
51
  const isDev = process.env.NODE_ENV === 'development';
49
52
  // Server snapshot is false, so hydration matches and the button appears right after.
@@ -58,7 +61,7 @@ export function ErrorState({ error }) {
58
61
  };
59
62
  window.dispatchEvent(new CustomEvent('reforma:fix-error', { detail }));
60
63
  };
61
- return (_jsx("main", { style: styles.main, children: _jsxs("div", { style: styles.card, children: [_jsx("h1", { style: styles.title, children: "Something went wrong" }), _jsx("p", { style: styles.message, children: "This page didn't load." }), isDev && message ? _jsx("pre", { style: styles.details, children: message }) : null, _jsxs("div", { style: styles.buttons, children: [_jsx("button", { type: "button", style: styles.button, onClick: () => window.location.reload(), children: "Reload" }), isDev && isEmbedded
64
+ return (_jsx("main", { "data-reforma-error-page": "", style: styles.main, children: _jsxs("div", { style: styles.card, children: [_jsx("h1", { style: styles.title, children: "Something went wrong" }), _jsx("p", { style: styles.message, children: "This page didn't load." }), isDev && message ? _jsx("pre", { style: styles.details, children: message }) : null, _jsxs("div", { style: styles.buttons, children: [_jsx("button", { type: "button", style: styles.button, onClick: () => window.location.reload(), children: "Reload" }), isDev && isEmbedded
62
65
  ? _jsx("button", { type: "button", style: styles.secondary, onClick: fixWithAi, children: "Fix with AI" })
63
66
  : null] }), digest ? _jsxs("p", { style: styles.digest, children: ["Error ID: ", digest] }) : null] }) }));
64
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reforma/site",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Visitor runtime for a Reforma site: mode, publish metadata, and the PostCSS url guard.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",