@tatchi-xyz/sdk 0.32.0 → 0.32.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.
@@ -39,61 +39,19 @@ var LazyErrorBoundary = class extends react.default.Component {
39
39
  const PasskeyAuthMenu = (props) => {
40
40
  const [isClient, setIsClient] = react.default.useState(false);
41
41
  const [retryKey, setRetryKey] = react.default.useState(0);
42
- const [stylesReady, setStylesReady] = react.default.useState(false);
43
42
  const ClientLazy = react.default.useMemo(() => createClientLazy(), [retryKey]);
44
- const skeletonRootRef = react.default.useRef(null);
45
43
  const { theme } = require_ThemeProvider.useTheme();
46
44
  react.default.useEffect(() => {
47
45
  setIsClient(true);
48
46
  require_preload.preloadPasskeyAuthMenu();
49
47
  }, []);
50
- react.default.useEffect(() => {
51
- if (!isClient) return;
52
- if (stylesReady) return;
53
- if (typeof window === "undefined" || typeof requestAnimationFrame !== "function") {
54
- setStylesReady(true);
55
- return;
56
- }
57
- let cancelled = false;
58
- const start = typeof performance !== "undefined" ? performance.now() : Date.now();
59
- const maxWaitMs = 1500;
60
- const tick = () => {
61
- if (cancelled) return;
62
- const el = skeletonRootRef.current;
63
- if (el) try {
64
- const cs = window.getComputedStyle(el);
65
- const sentinelReady = cs.getPropertyValue("--w3a-pam2-css-ready").trim() === "1";
66
- const borderOk = cs.borderTopStyle !== "none" && cs.borderTopWidth !== "0px";
67
- const radiusOk = cs.borderTopLeftRadius !== "0px";
68
- if (sentinelReady || borderOk || radiusOk) {
69
- setStylesReady(true);
70
- return;
71
- }
72
- } catch {}
73
- const now = typeof performance !== "undefined" ? performance.now() : Date.now();
74
- if (now - start >= maxWaitMs) {
75
- setStylesReady(true);
76
- return;
77
- }
78
- requestAnimationFrame(tick);
79
- };
80
- requestAnimationFrame(tick);
81
- return () => {
82
- cancelled = true;
83
- };
84
- }, [isClient, stylesReady]);
85
- const skeletonWithRef = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_skeleton.PasskeyAuthMenuSkeletonInner, {
86
- ref: skeletonRootRef,
87
- className: props.className,
88
- style: props.style
89
- });
90
48
  const skeleton = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_skeleton.PasskeyAuthMenuSkeletonInner, {
91
49
  className: props.className,
92
50
  style: props.style
93
51
  });
94
52
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_themeScope.PasskeyAuthMenuThemeScope, {
95
53
  theme,
96
- children: isClient && stylesReady ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LazyErrorBoundary, {
54
+ children: isClient ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LazyErrorBoundary, {
97
55
  onRetry: () => setRetryKey((k) => k + 1),
98
56
  fallback: ({ retry }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [skeleton, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
99
57
  style: {
@@ -117,7 +75,7 @@ const PasskeyAuthMenu = (props) => {
117
75
  fallback: skeleton,
118
76
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClientLazy, { ...props })
119
77
  })
120
- }) : skeletonWithRef
78
+ }) : skeleton
121
79
  });
122
80
  };
123
81
  var shell_default = PasskeyAuthMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"shell.js","names":["React","PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps>","useTheme","PasskeyAuthMenuSkeletonInner","PasskeyAuthMenuThemeScope"],"sources":["../../../../../src/react/components/PasskeyAuthMenu/shell.tsx"],"sourcesContent":["import React from 'react';\nimport { PasskeyAuthMenuSkeletonInner } from './skeleton';\nimport { PasskeyAuthMenuThemeScope } from './themeScope';\nimport type { PasskeyAuthMenuProps } from './types';\nimport { useTheme } from '../theme';\nimport { preloadPasskeyAuthMenu } from './preload';\n\nfunction createClientLazy() {\n return React.lazy(() => import('./client').then((m) => ({ default: m.PasskeyAuthMenuClient })));\n}\n\nclass LazyErrorBoundary extends React.Component<\n {\n fallback: (args: { error: Error; retry: () => void }) => React.ReactNode;\n onRetry: () => void;\n children: React.ReactNode;\n },\n { error: Error | null }\n> {\n state: { error: Error | null } = { error: null };\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n return { error };\n }\n\n retry = () => {\n this.setState({ error: null });\n this.props.onRetry();\n };\n\n render() {\n if (this.state.error) {\n return this.props.fallback({ error: this.state.error, retry: this.retry });\n }\n return this.props.children;\n }\n}\n\n/**\n * `PasskeyAuthMenu` — SSR-safe shell.\n *\n * - Server: renders a skeleton only.\n * - Client: lazy-loads the full implementation after mount.\n */\nexport const PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps> = (props) => {\n const [isClient, setIsClient] = React.useState(false);\n const [retryKey, setRetryKey] = React.useState(0);\n const [stylesReady, setStylesReady] = React.useState(false);\n const ClientLazy = React.useMemo(() => createClientLazy(), [retryKey]);\n const skeletonRootRef = React.useRef<HTMLDivElement | null>(null);\n\n // Align with the SDK Theme boundary when present (TatchiPasskeyProvider wraps one by default).\n // Falls back to system preference when used standalone.\n const { theme } = useTheme();\n\n React.useEffect(() => {\n setIsClient(true);\n // Start fetching the client chunk immediately; we’ll still gate showing it on `stylesReady`.\n preloadPasskeyAuthMenu();\n }, []);\n\n // Avoid FOUC when PasskeyAuthMenu is code-split and styles are still streaming in:\n // keep rendering the skeleton until we can observe CSS being applied.\n React.useEffect(() => {\n if (!isClient) return;\n if (stylesReady) return;\n if (typeof window === 'undefined' || typeof requestAnimationFrame !== 'function') {\n setStylesReady(true);\n return;\n }\n\n let cancelled = false;\n const start = typeof performance !== 'undefined' ? performance.now() : Date.now();\n const maxWaitMs = 1500;\n\n const tick = () => {\n if (cancelled) return;\n const el = skeletonRootRef.current;\n if (el) {\n try {\n const cs = window.getComputedStyle(el);\n const sentinelReady = cs.getPropertyValue('--w3a-pam2-css-ready').trim() === '1';\n // Back-compat heuristic if the sentinel is ever missing.\n const borderOk = cs.borderTopStyle !== 'none' && cs.borderTopWidth !== '0px';\n const radiusOk = cs.borderTopLeftRadius !== '0px';\n if (sentinelReady || borderOk || radiusOk) {\n setStylesReady(true);\n return;\n }\n } catch {}\n }\n const now = typeof performance !== 'undefined' ? performance.now() : Date.now();\n if (now - start >= maxWaitMs) {\n setStylesReady(true);\n return;\n }\n requestAnimationFrame(tick);\n };\n\n requestAnimationFrame(tick);\n return () => {\n cancelled = true;\n };\n }, [isClient, stylesReady]);\n\n const skeletonWithRef = (\n <PasskeyAuthMenuSkeletonInner\n ref={skeletonRootRef}\n className={props.className}\n style={props.style}\n />\n );\n\n const skeleton = (\n <PasskeyAuthMenuSkeletonInner className={props.className} style={props.style} />\n );\n\n return (\n <PasskeyAuthMenuThemeScope theme={theme}>\n {isClient && stylesReady ? (\n <LazyErrorBoundary\n onRetry={() => setRetryKey((k) => k + 1)}\n fallback={({ retry }) => (\n <div>\n {skeleton}\n <div style={{ marginTop: 10, fontSize: 12, textAlign: 'center', opacity: 0.9 }}>\n Failed to load menu.{' '}\n <button type=\"button\" onClick={retry} style={{ textDecoration: 'underline' }}>\n Retry\n </button>\n </div>\n </div>\n )}\n >\n <React.Suspense\n fallback={skeleton}\n >\n <ClientLazy {...props} />\n </React.Suspense>\n </LazyErrorBoundary>\n ) : (\n skeletonWithRef\n )}\n </PasskeyAuthMenuThemeScope>\n );\n};\n\nexport default PasskeyAuthMenu;\n"],"mappings":";;;;;;;;;;;;AAOA,SAAS,mBAAmB;AAC1B,QAAOA,cAAM,gDAAW,gBAAmB,MAAM,OAAO,EAAE,SAAS,EAAE;;AAGvE,IAAM,oBAAN,cAAgCA,cAAM,UAOpC;CACA,QAAiC,EAAE,OAAO;CAE1C,OAAO,yBAAyB,OAAgC;AAC9D,SAAO,EAAE;;CAGX,cAAc;AACZ,OAAK,SAAS,EAAE,OAAO;AACvB,OAAK,MAAM;;CAGb,SAAS;AACP,MAAI,KAAK,MAAM,MACb,QAAO,KAAK,MAAM,SAAS;GAAE,OAAO,KAAK,MAAM;GAAO,OAAO,KAAK;;AAEpE,SAAO,KAAK,MA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X,2CAAC;GACC,eAAe,aAAa,MAAM,IAAI;GACtC,WAAW,EAAE,YACX,4CAAC,oBACE,UACD,4CAAC;IAAI,OAAO;KAAE,WAAW;KAAI,UAAU;KAAI,WAAW;KAAU,SAAS;;;KAAO;KACzD;KACrB,2CAAC;MAAO,MAAK;MAAS,SAAS;MAAO,OAAO,EAAE,gBAAgB;gBAAe;;;;aAOpF,2CAACJ,cAAM;IACL,UAAU;cAEV,2CAAC,cAAW,GAAI;;OAIpB;;;AAMR,oBAAe"}
1
+ {"version":3,"file":"shell.js","names":["React","PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps>","useTheme","PasskeyAuthMenuSkeletonInner","PasskeyAuthMenuThemeScope"],"sources":["../../../../../src/react/components/PasskeyAuthMenu/shell.tsx"],"sourcesContent":["import React from 'react';\nimport { PasskeyAuthMenuSkeletonInner } from './skeleton';\nimport { PasskeyAuthMenuThemeScope } from './themeScope';\nimport type { PasskeyAuthMenuProps } from './types';\nimport { useTheme } from '../theme';\nimport { preloadPasskeyAuthMenu } from './preload';\n\nfunction createClientLazy() {\n return React.lazy(() => import('./client').then((m) => ({ default: m.PasskeyAuthMenuClient })));\n}\n\nclass LazyErrorBoundary extends React.Component<\n {\n fallback: (args: { error: Error; retry: () => void }) => React.ReactNode;\n onRetry: () => void;\n children: React.ReactNode;\n },\n { error: Error | null }\n> {\n state: { error: Error | null } = { error: null };\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n return { error };\n }\n\n retry = () => {\n this.setState({ error: null });\n this.props.onRetry();\n };\n\n render() {\n if (this.state.error) {\n return this.props.fallback({ error: this.state.error, retry: this.retry });\n }\n return this.props.children;\n }\n}\n\n/**\n * `PasskeyAuthMenu` — SSR-safe shell.\n *\n * - Server: renders a skeleton only.\n * - Client: lazy-loads the full implementation after mount.\n */\nexport const PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps> = (props) => {\n const [isClient, setIsClient] = React.useState(false);\n const [retryKey, setRetryKey] = React.useState(0);\n const ClientLazy = React.useMemo(() => createClientLazy(), [retryKey]);\n\n // Align with the SDK Theme boundary when present (TatchiPasskeyProvider wraps one by default).\n // Falls back to system preference when used standalone.\n const { theme } = useTheme();\n\n React.useEffect(() => {\n setIsClient(true);\n // Start fetching the client chunk immediately; the skeleton remains as the Suspense fallback.\n preloadPasskeyAuthMenu();\n }, []);\n\n const skeleton = (\n <PasskeyAuthMenuSkeletonInner className={props.className} style={props.style} />\n );\n\n return (\n <PasskeyAuthMenuThemeScope theme={theme}>\n {isClient ? (\n <LazyErrorBoundary\n onRetry={() => setRetryKey((k) => k + 1)}\n fallback={({ retry }) => (\n <div>\n {skeleton}\n <div style={{ marginTop: 10, fontSize: 12, textAlign: 'center', opacity: 0.9 }}>\n Failed to load menu.{' '}\n <button type=\"button\" onClick={retry} style={{ textDecoration: 'underline' }}>\n Retry\n </button>\n </div>\n </div>\n )}\n >\n <React.Suspense\n fallback={skeleton}\n >\n <ClientLazy {...props} />\n </React.Suspense>\n </LazyErrorBoundary>\n ) : (\n skeleton\n )}\n </PasskeyAuthMenuThemeScope>\n );\n};\n\nexport default PasskeyAuthMenu;\n"],"mappings":";;;;;;;;;;;;AAOA,SAAS,mBAAmB;AAC1B,QAAOA,cAAM,gDAAW,gBAAmB,MAAM,OAAO,EAAE,SAAS,EAAE;;AAGvE,IAAM,oBAAN,cAAgCA,cAAM,UAOpC;CACA,QAAiC,EAAE,OAAO;CAE1C,OAAO,yBAAyB,OAAgC;AAC9D,SAAO,EAAE;;CAGX,cAAc;AACZ,OAAK,SAAS,EAAE,OAAO;AACvB,OAAK,MAAM;;CAGb,SAAS;AACP,MAAI,KAAK,MAAM,MACb,QAAO,KAAK,MAAM,SAAS;GAAE,OAAO,KAAK,MAAM;GAAO,OAAO,KAAK;;AAEpE,SAAO,KAAK,MAAM;;;;;;;;;AAUtB,MAAaC,mBAAmD,UAAU;CACxE,MAAM,CAAC,UAAU,eAAeD,cAAM,SAAS;CAC/C,MAAM,CAAC,UAAU,eAAeA,cAAM,SAAS;CAC/C,MAAM,aAAaA,cAAM,cAAc,oBAAoB,CAAC;CAI5D,MAAM,EAAE,UAAUE;AAElB,eAAM,gBAAgB;AACpB,cAAY;AAEZ;IACC;CAEH,MAAM,WACJ,2CAACC;EAA6B,WAAW,MAAM;EAAW,OAAO,MAAM;;AAGzE,QACE,2CAACC;EAAiC;YAC/B,WACC,2CAAC;GACC,eAAe,aAAa,MAAM,IAAI;GACtC,WAAW,EAAE,YACX,4CAAC,oBACE,UACD,4CAAC;IAAI,OAAO;KAAE,WAAW;KAAI,UAAU;KAAI,WAAW;KAAU,SAAS;;;KAAO;KACzD;KACrB,2CAAC;MAAO,MAAK;MAAS,SAAS;MAAO,OAAO,EAAE,gBAAgB;gBAAe;;;;aAOpF,2CAACJ,cAAM;IACL,UAAU;cAEV,2CAAC,cAAW,GAAI;;OAIpB;;;AAMR,oBAAe"}
@@ -35,61 +35,19 @@ var LazyErrorBoundary = class extends React.Component {
35
35
  const PasskeyAuthMenu = (props) => {
36
36
  const [isClient, setIsClient] = React.useState(false);
37
37
  const [retryKey, setRetryKey] = React.useState(0);
38
- const [stylesReady, setStylesReady] = React.useState(false);
39
38
  const ClientLazy = React.useMemo(() => createClientLazy(), [retryKey]);
40
- const skeletonRootRef = React.useRef(null);
41
39
  const { theme } = useTheme();
42
40
  React.useEffect(() => {
43
41
  setIsClient(true);
44
42
  preloadPasskeyAuthMenu();
45
43
  }, []);
46
- React.useEffect(() => {
47
- if (!isClient) return;
48
- if (stylesReady) return;
49
- if (typeof window === "undefined" || typeof requestAnimationFrame !== "function") {
50
- setStylesReady(true);
51
- return;
52
- }
53
- let cancelled = false;
54
- const start = typeof performance !== "undefined" ? performance.now() : Date.now();
55
- const maxWaitMs = 1500;
56
- const tick = () => {
57
- if (cancelled) return;
58
- const el = skeletonRootRef.current;
59
- if (el) try {
60
- const cs = window.getComputedStyle(el);
61
- const sentinelReady = cs.getPropertyValue("--w3a-pam2-css-ready").trim() === "1";
62
- const borderOk = cs.borderTopStyle !== "none" && cs.borderTopWidth !== "0px";
63
- const radiusOk = cs.borderTopLeftRadius !== "0px";
64
- if (sentinelReady || borderOk || radiusOk) {
65
- setStylesReady(true);
66
- return;
67
- }
68
- } catch {}
69
- const now = typeof performance !== "undefined" ? performance.now() : Date.now();
70
- if (now - start >= maxWaitMs) {
71
- setStylesReady(true);
72
- return;
73
- }
74
- requestAnimationFrame(tick);
75
- };
76
- requestAnimationFrame(tick);
77
- return () => {
78
- cancelled = true;
79
- };
80
- }, [isClient, stylesReady]);
81
- const skeletonWithRef = /* @__PURE__ */ jsx(PasskeyAuthMenuSkeletonInner, {
82
- ref: skeletonRootRef,
83
- className: props.className,
84
- style: props.style
85
- });
86
44
  const skeleton = /* @__PURE__ */ jsx(PasskeyAuthMenuSkeletonInner, {
87
45
  className: props.className,
88
46
  style: props.style
89
47
  });
90
48
  return /* @__PURE__ */ jsx(PasskeyAuthMenuThemeScope, {
91
49
  theme,
92
- children: isClient && stylesReady ? /* @__PURE__ */ jsx(LazyErrorBoundary, {
50
+ children: isClient ? /* @__PURE__ */ jsx(LazyErrorBoundary, {
93
51
  onRetry: () => setRetryKey((k) => k + 1),
94
52
  fallback: ({ retry }) => /* @__PURE__ */ jsxs("div", { children: [skeleton, /* @__PURE__ */ jsxs("div", {
95
53
  style: {
@@ -113,7 +71,7 @@ const PasskeyAuthMenu = (props) => {
113
71
  fallback: skeleton,
114
72
  children: /* @__PURE__ */ jsx(ClientLazy, { ...props })
115
73
  })
116
- }) : skeletonWithRef
74
+ }) : skeleton
117
75
  });
118
76
  };
119
77
  var shell_default = PasskeyAuthMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"shell.js","names":["PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps>"],"sources":["../../../../../src/react/components/PasskeyAuthMenu/shell.tsx"],"sourcesContent":["import React from 'react';\nimport { PasskeyAuthMenuSkeletonInner } from './skeleton';\nimport { PasskeyAuthMenuThemeScope } from './themeScope';\nimport type { PasskeyAuthMenuProps } from './types';\nimport { useTheme } from '../theme';\nimport { preloadPasskeyAuthMenu } from './preload';\n\nfunction createClientLazy() {\n return React.lazy(() => import('./client').then((m) => ({ default: m.PasskeyAuthMenuClient })));\n}\n\nclass LazyErrorBoundary extends React.Component<\n {\n fallback: (args: { error: Error; retry: () => void }) => React.ReactNode;\n onRetry: () => void;\n children: React.ReactNode;\n },\n { error: Error | null }\n> {\n state: { error: Error | null } = { error: null };\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n return { error };\n }\n\n retry = () => {\n this.setState({ error: null });\n this.props.onRetry();\n };\n\n render() {\n if (this.state.error) {\n return this.props.fallback({ error: this.state.error, retry: this.retry });\n }\n return this.props.children;\n }\n}\n\n/**\n * `PasskeyAuthMenu` — SSR-safe shell.\n *\n * - Server: renders a skeleton only.\n * - Client: lazy-loads the full implementation after mount.\n */\nexport const PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps> = (props) => {\n const [isClient, setIsClient] = React.useState(false);\n const [retryKey, setRetryKey] = React.useState(0);\n const [stylesReady, setStylesReady] = React.useState(false);\n const ClientLazy = React.useMemo(() => createClientLazy(), [retryKey]);\n const skeletonRootRef = React.useRef<HTMLDivElement | null>(null);\n\n // Align with the SDK Theme boundary when present (TatchiPasskeyProvider wraps one by default).\n // Falls back to system preference when used standalone.\n const { theme } = useTheme();\n\n React.useEffect(() => {\n setIsClient(true);\n // Start fetching the client chunk immediately; we’ll still gate showing it on `stylesReady`.\n preloadPasskeyAuthMenu();\n }, []);\n\n // Avoid FOUC when PasskeyAuthMenu is code-split and styles are still streaming in:\n // keep rendering the skeleton until we can observe CSS being applied.\n React.useEffect(() => {\n if (!isClient) return;\n if (stylesReady) return;\n if (typeof window === 'undefined' || typeof requestAnimationFrame !== 'function') {\n setStylesReady(true);\n return;\n }\n\n let cancelled = false;\n const start = typeof performance !== 'undefined' ? performance.now() : Date.now();\n const maxWaitMs = 1500;\n\n const tick = () => {\n if (cancelled) return;\n const el = skeletonRootRef.current;\n if (el) {\n try {\n const cs = window.getComputedStyle(el);\n const sentinelReady = cs.getPropertyValue('--w3a-pam2-css-ready').trim() === '1';\n // Back-compat heuristic if the sentinel is ever missing.\n const borderOk = cs.borderTopStyle !== 'none' && cs.borderTopWidth !== '0px';\n const radiusOk = cs.borderTopLeftRadius !== '0px';\n if (sentinelReady || borderOk || radiusOk) {\n setStylesReady(true);\n return;\n }\n } catch {}\n }\n const now = typeof performance !== 'undefined' ? performance.now() : Date.now();\n if (now - start >= maxWaitMs) {\n setStylesReady(true);\n return;\n }\n requestAnimationFrame(tick);\n };\n\n requestAnimationFrame(tick);\n return () => {\n cancelled = true;\n };\n }, [isClient, stylesReady]);\n\n const skeletonWithRef = (\n <PasskeyAuthMenuSkeletonInner\n ref={skeletonRootRef}\n className={props.className}\n style={props.style}\n />\n );\n\n const skeleton = (\n <PasskeyAuthMenuSkeletonInner className={props.className} style={props.style} />\n );\n\n return (\n <PasskeyAuthMenuThemeScope theme={theme}>\n {isClient && stylesReady ? (\n <LazyErrorBoundary\n onRetry={() => setRetryKey((k) => k + 1)}\n fallback={({ retry }) => (\n <div>\n {skeleton}\n <div style={{ marginTop: 10, fontSize: 12, textAlign: 'center', opacity: 0.9 }}>\n Failed to load menu.{' '}\n <button type=\"button\" onClick={retry} style={{ textDecoration: 'underline' }}>\n Retry\n </button>\n </div>\n </div>\n )}\n >\n <React.Suspense\n fallback={skeleton}\n >\n <ClientLazy {...props} />\n </React.Suspense>\n </LazyErrorBoundary>\n ) : (\n skeletonWithRef\n )}\n </PasskeyAuthMenuThemeScope>\n );\n};\n\nexport default PasskeyAuthMenu;\n"],"mappings":";;;;;;;;AAOA,SAAS,mBAAmB;AAC1B,QAAO,MAAM,WAAW,OAAO,eAAY,MAAM,OAAO,EAAE,SAAS,EAAE;;AAGvE,IAAM,oBAAN,cAAgC,MAAM,UAOpC;CACA,QAAiC,EAAE,OAAO;CAE1C,OAAO,yBAAyB,OAAgC;AAC9D,SAAO,EAAE;;CAGX,cAAc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AM,kBACJ,oBAAC;EACC,KAAK;EACL,WAAW,MAAM;EACjB,OAAO,MAAM;;CAIjB,MAAM,WACJ,oBAAC;EAA6B,WAAW,MAAM;EAAW,OAAO,MAAM;;AAGzE,QACE,oBAAC;EAAiC;YAC/B,YAAY,cACX,oBAAC;GACC,eAAe,aAAa,MAAM,IAAI;GACtC,WAAW,EAAE,YACX,qBAAC,oBACE,UACD,qBAAC;IAAI,OAAO;KAAE,WAAW;KAAI,UAAU;KAAI,WAAW;KAAU,SAAS;;;KAAO;KACzD;KACrB,oBAAC;MAAO,MAAK;MAAS,SAAS;MAAO,OAAO,EAAE,gBAAgB;gBAAe;;;;aAOpF,oBAAC,MAAM;IACL,UAAU;cAEV,oBAAC,cAAW,GAAI;;OAIpB;;;AAMR,oBAAe"}
1
+ {"version":3,"file":"shell.js","names":["PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps>"],"sources":["../../../../../src/react/components/PasskeyAuthMenu/shell.tsx"],"sourcesContent":["import React from 'react';\nimport { PasskeyAuthMenuSkeletonInner } from './skeleton';\nimport { PasskeyAuthMenuThemeScope } from './themeScope';\nimport type { PasskeyAuthMenuProps } from './types';\nimport { useTheme } from '../theme';\nimport { preloadPasskeyAuthMenu } from './preload';\n\nfunction createClientLazy() {\n return React.lazy(() => import('./client').then((m) => ({ default: m.PasskeyAuthMenuClient })));\n}\n\nclass LazyErrorBoundary extends React.Component<\n {\n fallback: (args: { error: Error; retry: () => void }) => React.ReactNode;\n onRetry: () => void;\n children: React.ReactNode;\n },\n { error: Error | null }\n> {\n state: { error: Error | null } = { error: null };\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n return { error };\n }\n\n retry = () => {\n this.setState({ error: null });\n this.props.onRetry();\n };\n\n render() {\n if (this.state.error) {\n return this.props.fallback({ error: this.state.error, retry: this.retry });\n }\n return this.props.children;\n }\n}\n\n/**\n * `PasskeyAuthMenu` — SSR-safe shell.\n *\n * - Server: renders a skeleton only.\n * - Client: lazy-loads the full implementation after mount.\n */\nexport const PasskeyAuthMenu: React.FC<PasskeyAuthMenuProps> = (props) => {\n const [isClient, setIsClient] = React.useState(false);\n const [retryKey, setRetryKey] = React.useState(0);\n const ClientLazy = React.useMemo(() => createClientLazy(), [retryKey]);\n\n // Align with the SDK Theme boundary when present (TatchiPasskeyProvider wraps one by default).\n // Falls back to system preference when used standalone.\n const { theme } = useTheme();\n\n React.useEffect(() => {\n setIsClient(true);\n // Start fetching the client chunk immediately; the skeleton remains as the Suspense fallback.\n preloadPasskeyAuthMenu();\n }, []);\n\n const skeleton = (\n <PasskeyAuthMenuSkeletonInner className={props.className} style={props.style} />\n );\n\n return (\n <PasskeyAuthMenuThemeScope theme={theme}>\n {isClient ? (\n <LazyErrorBoundary\n onRetry={() => setRetryKey((k) => k + 1)}\n fallback={({ retry }) => (\n <div>\n {skeleton}\n <div style={{ marginTop: 10, fontSize: 12, textAlign: 'center', opacity: 0.9 }}>\n Failed to load menu.{' '}\n <button type=\"button\" onClick={retry} style={{ textDecoration: 'underline' }}>\n Retry\n </button>\n </div>\n </div>\n )}\n >\n <React.Suspense\n fallback={skeleton}\n >\n <ClientLazy {...props} />\n </React.Suspense>\n </LazyErrorBoundary>\n ) : (\n skeleton\n )}\n </PasskeyAuthMenuThemeScope>\n );\n};\n\nexport default PasskeyAuthMenu;\n"],"mappings":";;;;;;;;AAOA,SAAS,mBAAmB;AAC1B,QAAO,MAAM,WAAW,OAAO,eAAY,MAAM,OAAO,EAAE,SAAS,EAAE;;AAGvE,IAAM,oBAAN,cAAgC,MAAM,UAOpC;CACA,QAAiC,EAAE,OAAO;CAE1C,OAAO,yBAAyB,OAAgC;AAC9D,SAAO,EAAE;;CAGX,cAAc;AACZ,OAAK,SAAS,EAAE,OAAO;AACvB,OAAK,MAAM;;CAGb,SAAS;AACP,MAAI,KAAK,MAAM,MACb,QAAO,KAAK,MAAM,SAAS;GAAE,OAAO,KAAK,MAAM;GAAO,OAAO,KAAK;;AAEpE,SAAO,KAAK,MAAM;;;;;;;;;AAUtB,MAAaA,mBAAmD,UAAU;CACxE,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS;CAC/C,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS;CAC/C,MAAM,aAAa,MAAM,cAAc,oBAAoB,CAAC;CAI5D,MAAM,EAAE,UAAU;AAElB,OAAM,gBAAgB;AACpB,cAAY;AAEZ;IACC;CAEH,MAAM,WACJ,oBAAC;EAA6B,WAAW,MAAM;EAAW,OAAO,MAAM;;AAGzE,QACE,oBAAC;EAAiC;YAC/B,WACC,oBAAC;GACC,eAAe,aAAa,MAAM,IAAI;GACtC,WAAW,EAAE,YACX,qBAAC,oBACE,UACD,qBAAC;IAAI,OAAO;KAAE,WAAW;KAAI,UAAU;KAAI,WAAW;KAAU,SAAS;;;KAAO;KACzD;KACrB,oBAAC;MAAO,MAAK;MAAS,SAAS;MAAO,OAAO,EAAE,gBAAgB;gBAAe;;;;aAOpF,oBAAC,MAAM;IACL,UAAU;cAEV,oBAAC,cAAW,GAAI;;OAIpB;;;AAMR,oBAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../../../../src/react/components/PasskeyAuthMenu/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAmCpD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqG1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../../../../src/react/components/PasskeyAuthMenu/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAmCpD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+C1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tatchi-xyz/sdk",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "type": "module",
5
5
  "description": "An embedded passkey wallet SDK built on NEAR protocol",
6
6
  "main": "./dist/cjs/index.js",