@knapsack/renderer-react 4.70.0--canary.3797.b249674.0 → 4.70.0--canary.4821.e250df4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +1,71 @@
1
- 'use strict';
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
2
24
 
3
- var client = require('@knapsack/renderer-webpack-base/client');
4
- var E = require('react');
5
- var D = require('react-dom/client');
6
- var jsxRuntime = require('react/jsx-runtime');
25
+ // src/client/init.tsx
26
+ var import_react = __toESM(require("react"));
27
+ var import_client = __toESM(require("react-dom/client"));
28
+ var import_client2 = require("@knapsack/renderer-webpack-base/client");
7
29
 
8
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
30
+ // src/types.ts
31
+ var rendererMetaScriptTagId = "ks-react-meta";
9
32
 
10
- var E__default = /*#__PURE__*/_interopDefault(E);
11
- var D__default = /*#__PURE__*/_interopDefault(D);
12
-
13
- var x=Object.defineProperty;var a=(t,e)=>x(t,"name",{value:e,configurable:!0});var m=(t,e)=>()=>(t&&(e=t(t=0)),e);var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var d,s=m(()=>{d="ks-react-meta";});var c,w,A,T,B,N,v,i,l,M=m(()=>{s();({getAllImports:c,getExtraImport:w,getImport:A,getImports:T,getPatternImport:B,importedModules:N,meta:v,rendererMeta:i,rendererMethods:l}=client.getKsRendererClientGlobal({rendererMetaScriptTagId:d}));});var P=C(()=>{M();async function b(){let{neededImports:t,disableReactStrictMode:e,demoWrapperProps:y}=i,R=await c({patterns:t.filter(r=>r.type!=="extra"),extras:t.filter(r=>r.type==="extra").map(({importInfo:r})=>({name:r.name}))}),p=document.getElementById("render-root");if(!p)throw new Error("No root element found");let{DemoWrapper:g,ErrorCatcher:f,...h}=R,I=l.getDemoApp(h),n=jsxRuntime.jsx(f,{children:jsxRuntime.jsx(g,{...y,children:jsxRuntime.jsx(I,{})})});D__default.default.createRoot(p).render(e?n:jsxRuntime.jsx(E__default.default.StrictMode,{children:n}));}a(b,"init");try{b();}catch(t){console.error(t);let e=document.createElement("div");e.innerHTML=`
33
+ // src/client/init.tsx
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ async function init() {
36
+ try {
37
+ const {
38
+ getNeededImports,
39
+ getExtraImports,
40
+ rendererMeta: { disableReactStrictMode, demoWrapperProps },
41
+ rendererMethods: { getDemoApp }
42
+ } = (0, import_client2.getKsRendererClientUtils)({
43
+ rendererMetaScriptTagId
44
+ });
45
+ const [neededImports, { DemoWrapper, ErrorCatcher }] = await Promise.all([
46
+ getNeededImports(),
47
+ getExtraImports()
48
+ ]);
49
+ const root = document.getElementById("render-root");
50
+ if (!root) {
51
+ throw new Error("No root element found");
52
+ }
53
+ const demoComponents = neededImports;
54
+ const DemoApp = getDemoApp(demoComponents);
55
+ const app = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorCatcher, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DemoWrapper, { ...demoWrapperProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DemoApp, {}) }) });
56
+ import_client.default.createRoot(root).render(
57
+ disableReactStrictMode ? app : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.StrictMode, { children: app })
58
+ );
59
+ } catch (e) {
60
+ console.error(e);
61
+ const errorElement = document.createElement("div");
62
+ errorElement.innerHTML = `
14
63
  <h1>Error</h1>
15
- <p>${t.message}</p>
16
- `,document.body.appendChild(e);}});var init = P();
17
-
18
- module.exports = init;
19
- //# sourceMappingURL=init.js.map
64
+ <p>${e.message}</p>
65
+ `;
66
+ document.body.appendChild(errorElement);
67
+ }
68
+ }
69
+ __name(init, "init");
70
+ init();
20
71
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types.ts","../../src/client/ks-utils.ts","../../src/client/init.tsx"],"names":["rendererMetaScriptTagId","init_types","__esmMin","getAllImports","getExtraImport","getImport","getImports","getPatternImport","importedModules","meta","rendererMeta","rendererMethods","init_ks_utils","getKsRendererClientGlobal","require_init","__commonJSMin","init","neededImports","disableReactStrictMode","demoWrapperProps","all","i","importInfo","root","DemoWrapper","ErrorCatcher","demoComponents","DemoApp","app","jsx","ReactDOM","React","__name","e","errorElement"],"mappings":";;;;;;;;;;;;gLAAA,IAyBaA,CAAAA,CAzBbC,EAAAC,CAAA,CAAA,IAAA,CAyBaF,EAA0B,gBCzBvC,CAAA,CAAA,CAAA,IASEG,CACAC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,EAjBFC,CAAAV,CAAAA,CAAAA,CAAA,KACAD,CAOa,EAAA,CAAA,CAAA,CACX,cAAAE,CACA,CAAA,cAAA,CAAAC,EACA,SAAAC,CAAAA,CAAAA,CACA,WAAAC,CACA,CAAA,gBAAA,CAAAC,EACA,eAAAC,CAAAA,CAAAA,CACA,KAAAC,CACA,CAAA,YAAA,CAAAC,EACA,eAAAC,CAAAA,CAAAA,CAAAA,CACEE,gCAAmE,CAAA,CACrE,uBAAAb,CAAAA,CACF,CAAC,CCnBD,EAAA,CAAA,CAAA,CADA,IAAAc,EAAAC,CAAA,CAAA,IAAA,CAGAH,IAEA,eAAeI,CAAAA,EAAO,CACpB,GAAM,CAAE,cAAAC,CAAe,CAAA,sBAAA,CAAAC,EAAwB,gBAAAC,CAAAA,CAAiB,EAC9DT,CACIU,CAAAA,CAAAA,CAAM,MAAMjB,CAAc,CAAA,CAC9B,SAAUc,CAAc,CAAA,MAAA,CAAQI,GAAMA,CAAE,CAAA,IAAA,GAAS,OAAO,CACxD,CAAA,MAAA,CAAQJ,EACL,MAAQI,CAAAA,CAAAA,EAAMA,CAAE,CAAA,IAAA,GAAS,OAAO,CAAA,CAChC,IAAI,CAAC,CAAE,WAAAC,CAAW,CAAA,IAAO,CAAE,IAAMA,CAAAA,CAAAA,CAAW,IAAK,CAAE,CAAA,CACxD,CAAC,CAEKC,CAAAA,CAAAA,CAAO,SAAS,cAAe,CAAA,aAAa,EAClD,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,uBAAuB,CAAA,CAEzC,GAAM,CAAE,WAAA,CAAAC,EAAa,YAAAC,CAAAA,CAAAA,CAAc,GAAGC,CAAe,CAAA,CAAIN,EACnDO,CAAUhB,CAAAA,CAAAA,CAAgB,WAAWe,CAAc,CAAA,CACnDE,EACJC,cAACJ,CAAAA,CAAAA,CAAA,CACC,QAAA,CAAAI,cAACL,CAAAA,CAAAA,CAAA,CAAa,GAAGL,CAAAA,CACf,SAAAU,cAACF,CAAAA,CAAAA,CAAA,EAAQ,CACX,CAAA,CAAA,CACF,EAGFG,kBAAS,CAAA,UAAA,CAAWP,CAAI,CAAE,CAAA,MAAA,CACxBL,EAAyBU,CAAMC,CAAAA,cAAAA,CAACE,mBAAM,UAAN,CAAA,CAAkB,SAAAH,CAAI,CAAA,CACxD,EACF,CA3BeI,CAAAA,CAAAhB,EAAA,MA6Bf,CAAA,CAAA,GAAI,CACFA,CAAK,GACP,OAASiB,CAAG,CAAA,CACV,QAAQ,KAAMA,CAAAA,CAAC,EAEf,IAAMC,CAAAA,CAAe,SAAS,aAAc,CAAA,KAAK,CACjDA,CAAAA,CAAAA,CAAa,SAAY,CAAA,CAAA;AAAA;AAAA,OAAA,EAElBD,EAAE,OAAO,CAAA;AAAA,EAAA,CAAA,CAEhB,QAAS,CAAA,IAAA,CAAK,WAAYC,CAAAA,CAAY,EACxC,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,EAAA","file":"init.js","sourcesContent":["import type { Demo, Except } from '@knapsack/types';\nimport type { ComponentType } from 'react';\nimport type { RendererMetaBase } from '@knapsack/renderer-webpack-base/client';\nimport type { KnapsackRenderParams } from '@knapsack/app/types';\n\nexport type Component = ComponentType<Record<string, unknown>>;\n\nexport type DemoWrapperProps = {\n children: React.ReactNode;\n patternsUsed: {\n patternId: string;\n templateId: string;\n demoId?: string;\n }[];\n} & Except<KnapsackRenderParams, 'patternManifest'>;\n\n/**\n * Found as JSON in HTML `#ks-react-meta`\n */\nexport type KsReactMeta = {\n disableReactStrictMode: boolean;\n demo: Demo;\n demoWrapperProps: Except<DemoWrapperProps, 'children'>;\n} & RendererMetaBase;\n\nexport const rendererMetaScriptTagId = 'ks-react-meta';\n\nexport type RendererMethods = {\n getDemoApp: (components: Record<string, Component>) => Component;\n};\n","import { getKsRendererClientGlobal } from '@knapsack/renderer-webpack-base/client';\nimport {\n rendererMetaScriptTagId,\n type KsReactMeta,\n type Component,\n type RendererMethods,\n} from '../types';\n\nexport const {\n getAllImports,\n getExtraImport,\n getImport,\n getImports,\n getPatternImport,\n importedModules,\n meta,\n rendererMeta,\n rendererMethods,\n} = getKsRendererClientGlobal<Component, KsReactMeta, RendererMethods>({\n rendererMetaScriptTagId,\n});\n","/// <reference lib=\"dom\" />\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { rendererMeta, rendererMethods, getAllImports } from './ks-utils';\n\nasync function init() {\n const { neededImports, disableReactStrictMode, demoWrapperProps } =\n rendererMeta;\n const all = await getAllImports({\n patterns: neededImports.filter((i) => i.type !== 'extra'),\n extras: neededImports\n .filter((i) => i.type === 'extra')\n .map(({ importInfo }) => ({ name: importInfo.name })),\n });\n\n const root = document.getElementById('render-root');\n if (!root) {\n throw new Error('No root element found');\n }\n const { DemoWrapper, ErrorCatcher, ...demoComponents } = all;\n const DemoApp = rendererMethods.getDemoApp(demoComponents);\n const app = (\n <ErrorCatcher>\n <DemoWrapper {...demoWrapperProps}>\n <DemoApp />\n </DemoWrapper>\n </ErrorCatcher>\n );\n\n ReactDOM.createRoot(root).render(\n disableReactStrictMode ? app : <React.StrictMode>{app}</React.StrictMode>,\n );\n}\n\ntry {\n init();\n} catch (e) {\n console.error(e);\n // create html element with error message\n const errorElement = document.createElement('div');\n errorElement.innerHTML = `\n <h1>Error</h1>\n <p>${e.message}</p>\n `;\n document.body.appendChild(errorElement);\n}\n"]}
1
+ {"version":3,"sources":["../../src/client/init.tsx","../../src/types.ts"],"sourcesContent":["/// <reference lib=\"dom\" />\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { getKsRendererClientUtils } from '@knapsack/renderer-webpack-base/client';\nimport {\n rendererMetaScriptTagId,\n type KsReactMeta,\n type Component,\n type RendererMethods,\n} from '../types';\n\nasync function init() {\n try {\n const {\n getNeededImports,\n getExtraImports,\n rendererMeta: { disableReactStrictMode, demoWrapperProps },\n rendererMethods: { getDemoApp },\n } = getKsRendererClientUtils<Component, KsReactMeta, RendererMethods>({\n rendererMetaScriptTagId,\n });\n const [neededImports, { DemoWrapper, ErrorCatcher }] = await Promise.all([\n getNeededImports(),\n getExtraImports(),\n ]);\n const root = document.getElementById('render-root');\n if (!root) {\n throw new Error('No root element found');\n }\n const demoComponents = neededImports;\n const DemoApp = getDemoApp(demoComponents);\n const app = (\n <ErrorCatcher>\n <DemoWrapper {...demoWrapperProps}>\n <DemoApp />\n </DemoWrapper>\n </ErrorCatcher>\n );\n\n ReactDOM.createRoot(root).render(\n disableReactStrictMode ? app : <React.StrictMode>{app}</React.StrictMode>,\n );\n } catch (e) {\n console.error(e);\n // create html element with error message\n const errorElement = document.createElement('div');\n errorElement.innerHTML = `\n <h1>Error</h1>\n <p>${e.message}</p>\n `;\n document.body.appendChild(errorElement);\n }\n}\n\ninit();\n","import type { Demo, Except } from '@knapsack/types';\nimport type { ComponentType } from 'react';\nimport type { RendererMetaBase } from '@knapsack/renderer-webpack-base/client';\n\nexport type Component = ComponentType<Record<string, unknown>>;\n\nexport type DemoWrapperProps = {\n children: React.ReactNode;\n // patternsUsed: {\n // patternId: string;\n // templateId: string;\n // demoId?: string;\n // }[];\n demo: Demo;\n patternId: string;\n templateId: string;\n};\n\n/**\n * Found as JSON in HTML `#ks-react-meta`\n */\nexport type KsReactMeta = {\n disableReactStrictMode: boolean;\n demo: Demo;\n demoWrapperProps: Except<DemoWrapperProps, 'children'>;\n} & RendererMetaBase<'DemoWrapper' | 'ErrorCatcher'>;\n\nexport const rendererMetaScriptTagId = 'ks-react-meta';\n\nexport type RendererMethods = {\n getDemoApp: (components: Record<string, Component>) => Component;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,mBAAkB;AAClB,oBAAqB;AACrB,IAAAA,iBAAyC;;;ACwBlC,IAAM,0BAA0B;;;ADO7B;AAvBV,eAAe,OAAO;AACpB,MAAI;AACF,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,cAAc,EAAE,wBAAwB,iBAAiB;AAAA,MACzD,iBAAiB,EAAE,WAAW;AAAA,IAChC,QAAI,yCAAkE;AAAA,MACpE;AAAA,IACF,CAAC;AACD,UAAM,CAAC,eAAe,EAAE,aAAa,aAAa,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,MACvE,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,IAClB,CAAC;AACD,UAAM,OAAO,SAAS,eAAe,aAAa;AAClD,QAAI,CAAC,MAAM;AACT,YAAM,IAAI,MAAM,uBAAuB;AAAA,IACzC;AACA,UAAM,iBAAiB;AACvB,UAAM,UAAU,WAAW,cAAc;AACzC,UAAM,MACJ,4CAAC,gBACC,sDAAC,eAAa,GAAG,kBACf,sDAAC,WAAQ,GACX,GACF;AAGF,kBAAAC,QAAS,WAAW,IAAI,EAAE;AAAA,MACxB,yBAAyB,MAAM,4CAAC,aAAAC,QAAM,YAAN,EAAkB,eAAI;AAAA,IACxD;AAAA,EACF,SAAS,GAAG;AACV,YAAQ,MAAM,CAAC;AAEf,UAAM,eAAe,SAAS,cAAc,KAAK;AACjD,iBAAa,YAAY;AAAA;AAAA,SAEpB,EAAE,OAAO;AAAA;AAEd,aAAS,KAAK,YAAY,YAAY;AAAA,EACxC;AACF;AAzCe;AA2Cf,KAAK;","names":["import_client","ReactDOM","React"]}
@@ -1,13 +1,74 @@
1
- import { getKsRendererClientGlobal } from '@knapsack/renderer-webpack-base/client';
2
- import E from 'react';
3
- import D from 'react-dom/client';
4
- import { jsx } from 'react/jsx-runtime';
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
+ var __esm = (fn, res) => function __init() {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ };
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
5
10
 
6
- var x=Object.defineProperty;var a=(t,e)=>x(t,"name",{value:e,configurable:!0});var m=(t,e)=>()=>(t&&(e=t(t=0)),e);var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var d,s=m(()=>{d="ks-react-meta";});var c,w,A,T,B,N,v,i,l,M=m(()=>{s();({getAllImports:c,getExtraImport:w,getImport:A,getImports:T,getPatternImport:B,importedModules:N,meta:v,rendererMeta:i,rendererMethods:l}=getKsRendererClientGlobal({rendererMetaScriptTagId:d}));});var P=C(()=>{M();async function b(){let{neededImports:t,disableReactStrictMode:e,demoWrapperProps:y}=i,R=await c({patterns:t.filter(r=>r.type!=="extra"),extras:t.filter(r=>r.type==="extra").map(({importInfo:r})=>({name:r.name}))}),p=document.getElementById("render-root");if(!p)throw new Error("No root element found");let{DemoWrapper:g,ErrorCatcher:f,...h}=R,I=l.getDemoApp(h),n=jsx(f,{children:jsx(g,{...y,children:jsx(I,{})})});D.createRoot(p).render(e?n:jsx(E.StrictMode,{children:n}));}a(b,"init");try{b();}catch(t){console.error(t);let e=document.createElement("div");e.innerHTML=`
7
- <h1>Error</h1>
8
- <p>${t.message}</p>
9
- `,document.body.appendChild(e);}});var init = P();
11
+ // ../../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.8_@types+node@20.16.6__@swc+core@1.3.57_@swc+helpers_iqa4vqpgdlzwuubzthdmdz7nfe/node_modules/tsup/assets/esm_shims.js
12
+ var init_esm_shims = __esm({
13
+ "../../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.8_@types+node@20.16.6__@swc+core@1.3.57_@swc+helpers_iqa4vqpgdlzwuubzthdmdz7nfe/node_modules/tsup/assets/esm_shims.js"() {
14
+ }
15
+ });
16
+
17
+ // src/types.ts
18
+ var rendererMetaScriptTagId;
19
+ var init_types = __esm({
20
+ "src/types.ts"() {
21
+ init_esm_shims();
22
+ rendererMetaScriptTagId = "ks-react-meta";
23
+ }
24
+ });
10
25
 
11
- export { init as default };
12
- //# sourceMappingURL=init.mjs.map
26
+ // src/client/init.tsx
27
+ import React from "react";
28
+ import ReactDOM from "react-dom/client";
29
+ import { getKsRendererClientUtils } from "@knapsack/renderer-webpack-base/client";
30
+ import { jsx } from "react/jsx-runtime";
31
+ var require_init = __commonJS({
32
+ "src/client/init.tsx"() {
33
+ init_esm_shims();
34
+ init_types();
35
+ async function init() {
36
+ try {
37
+ const {
38
+ getNeededImports,
39
+ getExtraImports,
40
+ rendererMeta: { disableReactStrictMode, demoWrapperProps },
41
+ rendererMethods: { getDemoApp }
42
+ } = getKsRendererClientUtils({
43
+ rendererMetaScriptTagId
44
+ });
45
+ const [neededImports, { DemoWrapper, ErrorCatcher }] = await Promise.all([
46
+ getNeededImports(),
47
+ getExtraImports()
48
+ ]);
49
+ const root = document.getElementById("render-root");
50
+ if (!root) {
51
+ throw new Error("No root element found");
52
+ }
53
+ const demoComponents = neededImports;
54
+ const DemoApp = getDemoApp(demoComponents);
55
+ const app = /* @__PURE__ */ jsx(ErrorCatcher, { children: /* @__PURE__ */ jsx(DemoWrapper, { ...demoWrapperProps, children: /* @__PURE__ */ jsx(DemoApp, {}) }) });
56
+ ReactDOM.createRoot(root).render(
57
+ disableReactStrictMode ? app : /* @__PURE__ */ jsx(React.StrictMode, { children: app })
58
+ );
59
+ } catch (e) {
60
+ console.error(e);
61
+ const errorElement = document.createElement("div");
62
+ errorElement.innerHTML = `
63
+ <h1>Error</h1>
64
+ <p>${e.message}</p>
65
+ `;
66
+ document.body.appendChild(errorElement);
67
+ }
68
+ }
69
+ __name(init, "init");
70
+ init();
71
+ }
72
+ });
73
+ export default require_init();
13
74
  //# sourceMappingURL=init.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types.ts","../../src/client/ks-utils.ts","../../src/client/init.tsx"],"names":["rendererMetaScriptTagId","init_types","__esmMin","getAllImports","getExtraImport","getImport","getImports","getPatternImport","importedModules","meta","rendererMeta","rendererMethods","init_ks_utils","getKsRendererClientGlobal","require_init","__commonJSMin","init","neededImports","disableReactStrictMode","demoWrapperProps","all","i","importInfo","root","DemoWrapper","ErrorCatcher","demoComponents","DemoApp","app","jsx","ReactDOM","React","__name","e","errorElement"],"mappings":";;;;;gLAAA,IAyBaA,CAAAA,CAzBbC,EAAAC,CAAA,CAAA,IAAA,CAyBaF,EAA0B,gBCzBvC,CAAA,CAAA,CAAA,IASEG,CACAC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,EAjBFC,CAAAV,CAAAA,CAAAA,CAAA,KACAD,CAOa,EAAA,CAAA,CAAA,CACX,cAAAE,CACA,CAAA,cAAA,CAAAC,EACA,SAAAC,CAAAA,CAAAA,CACA,WAAAC,CACA,CAAA,gBAAA,CAAAC,EACA,eAAAC,CAAAA,CAAAA,CACA,KAAAC,CACA,CAAA,YAAA,CAAAC,EACA,eAAAC,CAAAA,CAAAA,CAAAA,CACEE,yBAAmE,CAAA,CACrE,uBAAAb,CAAAA,CACF,CAAC,CCnBD,EAAA,CAAA,CAAA,CADA,IAAAc,EAAAC,CAAA,CAAA,IAAA,CAGAH,IAEA,eAAeI,CAAAA,EAAO,CACpB,GAAM,CAAE,cAAAC,CAAe,CAAA,sBAAA,CAAAC,EAAwB,gBAAAC,CAAAA,CAAiB,EAC9DT,CACIU,CAAAA,CAAAA,CAAM,MAAMjB,CAAc,CAAA,CAC9B,SAAUc,CAAc,CAAA,MAAA,CAAQI,GAAMA,CAAE,CAAA,IAAA,GAAS,OAAO,CACxD,CAAA,MAAA,CAAQJ,EACL,MAAQI,CAAAA,CAAAA,EAAMA,CAAE,CAAA,IAAA,GAAS,OAAO,CAAA,CAChC,IAAI,CAAC,CAAE,WAAAC,CAAW,CAAA,IAAO,CAAE,IAAMA,CAAAA,CAAAA,CAAW,IAAK,CAAE,CAAA,CACxD,CAAC,CAEKC,CAAAA,CAAAA,CAAO,SAAS,cAAe,CAAA,aAAa,EAClD,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,uBAAuB,CAAA,CAEzC,GAAM,CAAE,WAAA,CAAAC,EAAa,YAAAC,CAAAA,CAAAA,CAAc,GAAGC,CAAe,CAAA,CAAIN,EACnDO,CAAUhB,CAAAA,CAAAA,CAAgB,WAAWe,CAAc,CAAA,CACnDE,EACJC,GAACJ,CAAAA,CAAAA,CAAA,CACC,QAAA,CAAAI,GAACL,CAAAA,CAAAA,CAAA,CAAa,GAAGL,CAAAA,CACf,SAAAU,GAACF,CAAAA,CAAAA,CAAA,EAAQ,CACX,CAAA,CAAA,CACF,EAGFG,CAAS,CAAA,UAAA,CAAWP,CAAI,CAAE,CAAA,MAAA,CACxBL,EAAyBU,CAAMC,CAAAA,GAAAA,CAACE,EAAM,UAAN,CAAA,CAAkB,SAAAH,CAAI,CAAA,CACxD,EACF,CA3BeI,CAAAA,CAAAhB,EAAA,MA6Bf,CAAA,CAAA,GAAI,CACFA,CAAK,GACP,OAASiB,CAAG,CAAA,CACV,QAAQ,KAAMA,CAAAA,CAAC,EAEf,IAAMC,CAAAA,CAAe,SAAS,aAAc,CAAA,KAAK,CACjDA,CAAAA,CAAAA,CAAa,SAAY,CAAA,CAAA;AAAA;AAAA,OAAA,EAElBD,EAAE,OAAO,CAAA;AAAA,EAAA,CAAA,CAEhB,QAAS,CAAA,IAAA,CAAK,WAAYC,CAAAA,CAAY,EACxC,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,EAAA","file":"init.mjs","sourcesContent":["import type { Demo, Except } from '@knapsack/types';\nimport type { ComponentType } from 'react';\nimport type { RendererMetaBase } from '@knapsack/renderer-webpack-base/client';\nimport type { KnapsackRenderParams } from '@knapsack/app/types';\n\nexport type Component = ComponentType<Record<string, unknown>>;\n\nexport type DemoWrapperProps = {\n children: React.ReactNode;\n patternsUsed: {\n patternId: string;\n templateId: string;\n demoId?: string;\n }[];\n} & Except<KnapsackRenderParams, 'patternManifest'>;\n\n/**\n * Found as JSON in HTML `#ks-react-meta`\n */\nexport type KsReactMeta = {\n disableReactStrictMode: boolean;\n demo: Demo;\n demoWrapperProps: Except<DemoWrapperProps, 'children'>;\n} & RendererMetaBase;\n\nexport const rendererMetaScriptTagId = 'ks-react-meta';\n\nexport type RendererMethods = {\n getDemoApp: (components: Record<string, Component>) => Component;\n};\n","import { getKsRendererClientGlobal } from '@knapsack/renderer-webpack-base/client';\nimport {\n rendererMetaScriptTagId,\n type KsReactMeta,\n type Component,\n type RendererMethods,\n} from '../types';\n\nexport const {\n getAllImports,\n getExtraImport,\n getImport,\n getImports,\n getPatternImport,\n importedModules,\n meta,\n rendererMeta,\n rendererMethods,\n} = getKsRendererClientGlobal<Component, KsReactMeta, RendererMethods>({\n rendererMetaScriptTagId,\n});\n","/// <reference lib=\"dom\" />\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { rendererMeta, rendererMethods, getAllImports } from './ks-utils';\n\nasync function init() {\n const { neededImports, disableReactStrictMode, demoWrapperProps } =\n rendererMeta;\n const all = await getAllImports({\n patterns: neededImports.filter((i) => i.type !== 'extra'),\n extras: neededImports\n .filter((i) => i.type === 'extra')\n .map(({ importInfo }) => ({ name: importInfo.name })),\n });\n\n const root = document.getElementById('render-root');\n if (!root) {\n throw new Error('No root element found');\n }\n const { DemoWrapper, ErrorCatcher, ...demoComponents } = all;\n const DemoApp = rendererMethods.getDemoApp(demoComponents);\n const app = (\n <ErrorCatcher>\n <DemoWrapper {...demoWrapperProps}>\n <DemoApp />\n </DemoWrapper>\n </ErrorCatcher>\n );\n\n ReactDOM.createRoot(root).render(\n disableReactStrictMode ? app : <React.StrictMode>{app}</React.StrictMode>,\n );\n}\n\ntry {\n init();\n} catch (e) {\n console.error(e);\n // create html element with error message\n const errorElement = document.createElement('div');\n errorElement.innerHTML = `\n <h1>Error</h1>\n <p>${e.message}</p>\n `;\n document.body.appendChild(errorElement);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.8_@types+node@20.16.6__@swc+core@1.3.57_@swc+helpers_iqa4vqpgdlzwuubzthdmdz7nfe/node_modules/tsup/assets/esm_shims.js","../../src/types.ts","../../src/client/init.tsx"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import type { Demo, Except } from '@knapsack/types';\nimport type { ComponentType } from 'react';\nimport type { RendererMetaBase } from '@knapsack/renderer-webpack-base/client';\n\nexport type Component = ComponentType<Record<string, unknown>>;\n\nexport type DemoWrapperProps = {\n children: React.ReactNode;\n // patternsUsed: {\n // patternId: string;\n // templateId: string;\n // demoId?: string;\n // }[];\n demo: Demo;\n patternId: string;\n templateId: string;\n};\n\n/**\n * Found as JSON in HTML `#ks-react-meta`\n */\nexport type KsReactMeta = {\n disableReactStrictMode: boolean;\n demo: Demo;\n demoWrapperProps: Except<DemoWrapperProps, 'children'>;\n} & RendererMetaBase<'DemoWrapper' | 'ErrorCatcher'>;\n\nexport const rendererMetaScriptTagId = 'ks-react-meta';\n\nexport type RendererMethods = {\n getDemoApp: (components: Record<string, Component>) => Component;\n};\n","/// <reference lib=\"dom\" />\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { getKsRendererClientUtils } from '@knapsack/renderer-webpack-base/client';\nimport {\n rendererMetaScriptTagId,\n type KsReactMeta,\n type Component,\n type RendererMethods,\n} from '../types';\n\nasync function init() {\n try {\n const {\n getNeededImports,\n getExtraImports,\n rendererMeta: { disableReactStrictMode, demoWrapperProps },\n rendererMethods: { getDemoApp },\n } = getKsRendererClientUtils<Component, KsReactMeta, RendererMethods>({\n rendererMetaScriptTagId,\n });\n const [neededImports, { DemoWrapper, ErrorCatcher }] = await Promise.all([\n getNeededImports(),\n getExtraImports(),\n ]);\n const root = document.getElementById('render-root');\n if (!root) {\n throw new Error('No root element found');\n }\n const demoComponents = neededImports;\n const DemoApp = getDemoApp(demoComponents);\n const app = (\n <ErrorCatcher>\n <DemoWrapper {...demoWrapperProps}>\n <DemoApp />\n </DemoWrapper>\n </ErrorCatcher>\n );\n\n ReactDOM.createRoot(root).render(\n disableReactStrictMode ? app : <React.StrictMode>{app}</React.StrictMode>,\n );\n } catch (e) {\n console.error(e);\n // create html element with error message\n const errorElement = document.createElement('div');\n errorElement.innerHTML = `\n <h1>Error</h1>\n <p>${e.message}</p>\n `;\n document.body.appendChild(errorElement);\n }\n}\n\ninit();\n"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA,IA2Ba;AA3Bb;AAAA;AAAA;AA2BO,IAAM,0BAA0B;AAAA;AAAA;;;AC1BvC,OAAO,WAAW;AAClB,OAAO,cAAc;AACrB,SAAS,gCAAgC;AA+B/B;AAlCV;AAAA;AAAA;AAIA;AAOA,mBAAe,OAAO;AACpB,UAAI;AACF,cAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA,cAAc,EAAE,wBAAwB,iBAAiB;AAAA,UACzD,iBAAiB,EAAE,WAAW;AAAA,QAChC,IAAI,yBAAkE;AAAA,UACpE;AAAA,QACF,CAAC;AACD,cAAM,CAAC,eAAe,EAAE,aAAa,aAAa,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,UACvE,iBAAiB;AAAA,UACjB,gBAAgB;AAAA,QAClB,CAAC;AACD,cAAM,OAAO,SAAS,eAAe,aAAa;AAClD,YAAI,CAAC,MAAM;AACT,gBAAM,IAAI,MAAM,uBAAuB;AAAA,QACzC;AACA,cAAM,iBAAiB;AACvB,cAAM,UAAU,WAAW,cAAc;AACzC,cAAM,MACJ,oBAAC,gBACC,8BAAC,eAAa,GAAG,kBACf,8BAAC,WAAQ,GACX,GACF;AAGF,iBAAS,WAAW,IAAI,EAAE;AAAA,UACxB,yBAAyB,MAAM,oBAAC,MAAM,YAAN,EAAkB,eAAI;AAAA,QACxD;AAAA,MACF,SAAS,GAAG;AACV,gBAAQ,MAAM,CAAC;AAEf,cAAM,eAAe,SAAS,cAAc,KAAK;AACjD,qBAAa,YAAY;AAAA;AAAA,SAEpB,EAAE,OAAO;AAAA;AAEd,iBAAS,KAAK,YAAY,YAAY;AAAA,MACxC;AAAA,IACF;AAzCe;AA2Cf,SAAK;AAAA;AAAA;","names":[]}
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { D as DemoWrapperProps } from './types-D2eCZXsg.mjs';
2
+ import { D as DemoWrapperProps } from './types-CivTHEEo.mjs';
3
3
  import '@knapsack/types';
4
- import '@knapsack/app/types';
5
4
 
6
5
  declare const DemoWrapper: ({ children }: DemoWrapperProps) => react_jsx_runtime.JSX.Element;
7
6
 
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { D as DemoWrapperProps } from './types-D2eCZXsg.js';
2
+ import { D as DemoWrapperProps } from './types-CivTHEEo.js';
3
3
  import '@knapsack/types';
4
- import '@knapsack/app/types';
5
4
 
6
5
  declare const DemoWrapper: ({ children }: DemoWrapperProps) => react_jsx_runtime.JSX.Element;
7
6
 
@@ -1,9 +1,29 @@
1
- 'use strict';
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
- var jsxRuntime = require('react/jsx-runtime');
4
-
5
- var o=Object.defineProperty;var e=(p,r)=>o(p,"name",{value:r,configurable:!0});var a=e(({children:p})=>jsxRuntime.jsx("div",{className:"demo-wrapper",children:p}),"DemoWrapper"),d=a;
6
-
7
- module.exports = d;
8
- //# sourceMappingURL=demo-wrapper.js.map
20
+ // src/demo-wrapper.tsx
21
+ var demo_wrapper_exports = {};
22
+ __export(demo_wrapper_exports, {
23
+ default: () => demo_wrapper_default
24
+ });
25
+ module.exports = __toCommonJS(demo_wrapper_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ var DemoWrapper = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "demo-wrapper", children }), "DemoWrapper");
28
+ var demo_wrapper_default = DemoWrapper;
9
29
  //# sourceMappingURL=demo-wrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/demo-wrapper.tsx"],"names":["DemoWrapper","__name","children","jsx","demo_wrapper_default"],"mappings":";;;;AAGE,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CADF,IAAMA,EAAcC,CAAA,CAAA,CAAC,CAAE,QAAAC,CAAAA,CAAS,CAC9BC,GAAAA,cAAAA,CAAC,OAAI,SAAU,CAAA,cAAA,CAAgB,SAAAD,CAAS,CAAA,CAAA,CADtB,eAIbE,CAAQJ,CAAAA","file":"demo-wrapper.js","sourcesContent":["import type { DemoWrapperProps } from './types';\n\nconst DemoWrapper = ({ children }: DemoWrapperProps) => (\n <div className=\"demo-wrapper\">{children}</div>\n);\n\nexport default DemoWrapper;\n"]}
1
+ {"version":3,"sources":["../src/demo-wrapper.tsx"],"sourcesContent":["import type { DemoWrapperProps } from './types';\n\nconst DemoWrapper = ({ children }: DemoWrapperProps) => (\n <div className=\"demo-wrapper\">{children}</div>\n);\n\nexport default DemoWrapper;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGE;AADF,IAAM,cAAc,wBAAC,EAAE,SAAS,MAC9B,4CAAC,SAAI,WAAU,gBAAgB,UAAS,GADtB;AAIpB,IAAO,uBAAQ;","names":[]}
@@ -1,7 +1,11 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
2
3
 
3
- var o=Object.defineProperty;var e=(p,r)=>o(p,"name",{value:r,configurable:!0});var a=e(({children:p})=>jsx("div",{className:"demo-wrapper",children:p}),"DemoWrapper"),d=a;
4
-
5
- export { d as default };
6
- //# sourceMappingURL=demo-wrapper.mjs.map
4
+ // src/demo-wrapper.tsx
5
+ import { jsx } from "react/jsx-runtime";
6
+ var DemoWrapper = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx("div", { className: "demo-wrapper", children }), "DemoWrapper");
7
+ var demo_wrapper_default = DemoWrapper;
8
+ export {
9
+ demo_wrapper_default as default
10
+ };
7
11
  //# sourceMappingURL=demo-wrapper.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/demo-wrapper.tsx"],"names":["DemoWrapper","__name","children","jsx","demo_wrapper_default"],"mappings":";;AAGE,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CADF,IAAMA,EAAcC,CAAA,CAAA,CAAC,CAAE,QAAAC,CAAAA,CAAS,CAC9BC,GAAAA,GAAAA,CAAC,OAAI,SAAU,CAAA,cAAA,CAAgB,SAAAD,CAAS,CAAA,CAAA,CADtB,eAIbE,CAAQJ,CAAAA","file":"demo-wrapper.mjs","sourcesContent":["import type { DemoWrapperProps } from './types';\n\nconst DemoWrapper = ({ children }: DemoWrapperProps) => (\n <div className=\"demo-wrapper\">{children}</div>\n);\n\nexport default DemoWrapper;\n"]}
1
+ {"version":3,"sources":["../src/demo-wrapper.tsx"],"sourcesContent":["import type { DemoWrapperProps } from './types';\n\nconst DemoWrapper = ({ children }: DemoWrapperProps) => (\n <div className=\"demo-wrapper\">{children}</div>\n);\n\nexport default DemoWrapper;\n"],"mappings":";;;;AAGE;AADF,IAAM,cAAc,wBAAC,EAAE,SAAS,MAC9B,oBAAC,SAAI,WAAU,gBAAgB,UAAS,GADtB;AAIpB,IAAO,uBAAQ;","names":[]}
@@ -1,30 +1,96 @@
1
- 'use strict';
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
29
 
3
- var n = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
-
6
- function _interopNamespace(e) {
7
- if (e && e.__esModule) return e;
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () { return e[k]; }
16
- });
17
- }
18
- });
19
- }
20
- n.default = e;
21
- return Object.freeze(n);
22
- }
23
-
24
- var n__namespace = /*#__PURE__*/_interopNamespace(n);
25
-
26
- var d=Object.defineProperty;var a=(s,t)=>d(s,"name",{value:t,configurable:!0});var o=class extends n__namespace.Component{static{a(this,"ErrorCatcher");}constructor(t){super(t),this.state={hasError:!1,componentStack:"",error:null};}static getDerivedStateFromError(t){return {hasError:!0}}componentDidCatch(t,h){let{componentStack:i}=h;this.setState({error:t,componentStack:i});}render(){return this.state.hasError?jsxRuntime.jsxs("div",{style:{padding:"5px"},children:[jsxRuntime.jsx("h5",{children:"Error caught in React Components"}),this.state.error?.name&&jsxRuntime.jsxs("h5",{children:["Error Name: ",jsxRuntime.jsx("code",{children:this.state.error?.name})]}),this.state.error?.message&&jsxRuntime.jsxs("h5",{children:["Message:",this.state.error?.message]}),this.state.componentStack&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("h6",{children:"Component Stack:"}),jsxRuntime.jsx("pre",{children:jsxRuntime.jsx("code",{children:this.state.componentStack})}),jsxRuntime.jsx("br",{})]}),this.state.error?.stack&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("h6",{children:"Error Stack:"}),jsxRuntime.jsx("pre",{children:jsxRuntime.jsx("code",{children:this.state.error?.stack})})]})]}):this.props.children}};
27
-
28
- module.exports = o;
29
- //# sourceMappingURL=error-catcher.js.map
30
+ // src/error-catcher.tsx
31
+ var error_catcher_exports = {};
32
+ __export(error_catcher_exports, {
33
+ default: () => ErrorCatcher
34
+ });
35
+ module.exports = __toCommonJS(error_catcher_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var ErrorCatcher = class extends React.Component {
39
+ static {
40
+ __name(this, "ErrorCatcher");
41
+ }
42
+ constructor(props) {
43
+ super(props);
44
+ this.state = {
45
+ hasError: false,
46
+ componentStack: "",
47
+ error: null
48
+ };
49
+ }
50
+ static getDerivedStateFromError(error) {
51
+ return {
52
+ hasError: true
53
+ };
54
+ }
55
+ componentDidCatch(error, errorInfo) {
56
+ const { componentStack } = errorInfo;
57
+ this.setState({
58
+ error,
59
+ componentStack
60
+ });
61
+ }
62
+ render() {
63
+ if (this.state.hasError) {
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
65
+ "div",
66
+ {
67
+ style: {
68
+ padding: "5px"
69
+ },
70
+ children: [
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h5", { children: "Error caught in React Components" }),
72
+ this.state.error?.name && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h5", { children: [
73
+ "Error Name: ",
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: this.state.error?.name })
75
+ ] }),
76
+ this.state.error?.message && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h5", { children: [
77
+ "Message:",
78
+ this.state.error?.message
79
+ ] }),
80
+ this.state.componentStack && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { children: "Component Stack:" }),
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: this.state.componentStack }) }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {})
84
+ ] }),
85
+ this.state.error?.stack && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { children: "Error Stack:" }),
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: this.state.error?.stack }) })
88
+ ] })
89
+ ]
90
+ }
91
+ );
92
+ }
93
+ return this.props.children;
94
+ }
95
+ };
30
96
  //# sourceMappingURL=error-catcher.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error-catcher.tsx"],"names":["ErrorCatcher","n","__name","props","error","errorInfo","componentStack","jsxs","jsx","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAQqBA,CAArB,CAAA,cAAgDC,sBAG9C,CAXF,OAWEC,CAAA,CAAA,IAAA,CAAA,cAAA,EAAA,CACA,WAAYC,CAAAA,CAAAA,CAAO,CACjB,KAAMA,CAAAA,CAAK,CACX,CAAA,IAAA,CAAK,MAAQ,CACX,QAAA,CAAU,CACV,CAAA,CAAA,cAAA,CAAgB,GAChB,KAAO,CAAA,IACT,EACF,CAEA,OAAO,yBAAyBC,CAAc,CAAA,CAE5C,OAAO,CACL,SAAU,CACZ,CAAA,CACF,CAES,iBAAA,CAAkBA,EAAcC,CAAkC,CAAA,CACzE,GAAM,CAAE,eAAAC,CAAe,CAAA,CAAID,EAC3B,IAAK,CAAA,QAAA,CAAS,CACZ,KAAAD,CAAAA,CAAAA,CACA,cAAAE,CAAAA,CACF,CAAC,EACH,CAES,MAAS,EAAA,CAChB,OAAI,IAAK,CAAA,KAAA,CAAM,QAEXC,CAAAA,eAAAA,CAAC,OACC,KAAO,CAAA,CACL,QAAS,KACX,CAAA,CAEA,UAAAC,cAAC,CAAA,IAAA,CAAA,CAAG,QAAgC,CAAA,kCAAA,CAAA,CAAA,CACnC,KAAK,KAAM,CAAA,KAAA,EAAO,IACjBD,EAAAA,eAAAA,CAAC,MAAG,QACUC,CAAAA,CAAAA,cAAAA,CAAAA,cAAAA,CAAC,MAAM,CAAA,CAAA,QAAA,CAAA,IAAA,CAAK,MAAM,KAAO,EAAA,IAAA,CAAK,GAC5C,CAED,CAAA,IAAA,CAAK,MAAM,KAAO,EAAA,OAAA,EACjBD,eAAC,CAAA,IAAA,CAAA,CAAG,qBAED,IAAK,CAAA,KAAA,CAAM,KAAO,EAAA,OAAA,CAAA,CACrB,EAED,IAAK,CAAA,KAAA,CAAM,cACVA,EAAAA,eAAAA,CAAAE,oBAAA,CACE,QAAA,CAAA,CAAAD,eAAC,IAAG,CAAA,CAAA,QAAA,CAAA,kBAAA,CAAgB,EACpBA,cAAC,CAAA,KAAA,CAAA,CACC,QAAAA,CAAAA,cAAAA,CAAC,QAAM,QAAK,CAAA,IAAA,CAAA,KAAA,CAAM,cAAe,CAAA,CAAA,CACnC,EACAA,cAAC,CAAA,IAAA,CAAA,EAAG,CACN,CAAA,CAAA,CAAA,CAED,KAAK,KAAM,CAAA,KAAA,EAAO,OACjBD,eAAAE,CAAAA,mBAAAA,CAAA,CACE,QAAAD,CAAAA,CAAAA,cAAAA,CAAC,IAAG,CAAA,CAAA,QAAA,CAAA,cAAA,CAAY,EAChBA,cAAC,CAAA,KAAA,CAAA,CACC,QAAAA,CAAAA,cAAAA,CAAC,QAAM,QAAK,CAAA,IAAA,CAAA,KAAA,CAAM,KAAO,EAAA,KAAA,CAAM,EACjC,CACF,CAAA,CAAA,CAAA,CAAA,CAEJ,EAIG,IAAK,CAAA,KAAA,CAAM,QACpB,CACF","file":"error-catcher.js","sourcesContent":["import * as React from 'react';\n\ntype State = {\n hasError: boolean;\n componentStack?: string;\n error?: Error;\n};\n\nexport default class ErrorCatcher extends React.Component<\n { children: React.ReactNode },\n State\n> {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n componentStack: '',\n error: null,\n };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n };\n }\n\n override componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n const { componentStack } = errorInfo;\n this.setState({\n error,\n componentStack,\n });\n }\n\n override render() {\n if (this.state.hasError) {\n return (\n <div\n style={{\n padding: '5px',\n }}\n >\n <h5>Error caught in React Components</h5>\n {this.state.error?.name && (\n <h5>\n Error Name: <code>{this.state.error?.name}</code>\n </h5>\n )}\n {this.state.error?.message && (\n <h5>\n Message:\n {this.state.error?.message}\n </h5>\n )}\n {this.state.componentStack && (\n <>\n <h6>Component Stack:</h6>\n <pre>\n <code>{this.state.componentStack}</code>\n </pre>\n <br />\n </>\n )}\n {this.state.error?.stack && (\n <>\n <h6>Error Stack:</h6>\n <pre>\n <code>{this.state.error?.stack}</code>\n </pre>\n </>\n )}\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/error-catcher.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype State = {\n hasError: boolean;\n componentStack?: string;\n error?: Error;\n};\n\nexport default class ErrorCatcher extends React.Component<\n { children: React.ReactNode },\n State\n> {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n componentStack: '',\n error: null,\n };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n };\n }\n\n override componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n const { componentStack } = errorInfo;\n this.setState({\n error,\n componentStack,\n });\n }\n\n override render() {\n if (this.state.hasError) {\n return (\n <div\n style={{\n padding: '5px',\n }}\n >\n <h5>Error caught in React Components</h5>\n {this.state.error?.name && (\n <h5>\n Error Name: <code>{this.state.error?.name}</code>\n </h5>\n )}\n {this.state.error?.message && (\n <h5>\n Message:\n {this.state.error?.message}\n </h5>\n )}\n {this.state.componentStack && (\n <>\n <h6>Component Stack:</h6>\n <pre>\n <code>{this.state.componentStack}</code>\n </pre>\n <br />\n </>\n )}\n {this.state.error?.stack && (\n <>\n <h6>Error Stack:</h6>\n <pre>\n <code>{this.state.error?.stack}</code>\n </pre>\n </>\n )}\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AA4Cb;AApCV,IAAqB,eAArB,cAAgD,gBAG9C;AAAA,EAXF,OAWE;AAAA;AAAA;AAAA,EACA,YAAY,OAAO;AACjB,UAAM,KAAK;AACX,SAAK,QAAQ;AAAA,MACX,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,OAAO,yBAAyB,OAAc;AAE5C,WAAO;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAES,kBAAkB,OAAc,WAAkC;AACzE,UAAM,EAAE,eAAe,IAAI;AAC3B,SAAK,SAAS;AAAA,MACZ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAES,SAAS;AAChB,QAAI,KAAK,MAAM,UAAU;AACvB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,SAAS;AAAA,UACX;AAAA,UAEA;AAAA,wDAAC,QAAG,8CAAgC;AAAA,YACnC,KAAK,MAAM,OAAO,QACjB,6CAAC,QAAG;AAAA;AAAA,cACU,4CAAC,UAAM,eAAK,MAAM,OAAO,MAAK;AAAA,eAC5C;AAAA,YAED,KAAK,MAAM,OAAO,WACjB,6CAAC,QAAG;AAAA;AAAA,cAED,KAAK,MAAM,OAAO;AAAA,eACrB;AAAA,YAED,KAAK,MAAM,kBACV,4EACE;AAAA,0DAAC,QAAG,8BAAgB;AAAA,cACpB,4CAAC,SACC,sDAAC,UAAM,eAAK,MAAM,gBAAe,GACnC;AAAA,cACA,4CAAC,QAAG;AAAA,eACN;AAAA,YAED,KAAK,MAAM,OAAO,SACjB,4EACE;AAAA,0DAAC,QAAG,0BAAY;AAAA,cAChB,4CAAC,SACC,sDAAC,UAAM,eAAK,MAAM,OAAO,OAAM,GACjC;AAAA,eACF;AAAA;AAAA;AAAA,MAEJ;AAAA,IAEJ;AAEA,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
@@ -1,8 +1,68 @@
1
- import * as n from 'react';
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
- var d=Object.defineProperty;var a=(s,t)=>d(s,"name",{value:t,configurable:!0});var o=class extends n.Component{static{a(this,"ErrorCatcher");}constructor(t){super(t),this.state={hasError:!1,componentStack:"",error:null};}static getDerivedStateFromError(t){return {hasError:!0}}componentDidCatch(t,h){let{componentStack:i}=h;this.setState({error:t,componentStack:i});}render(){return this.state.hasError?jsxs("div",{style:{padding:"5px"},children:[jsx("h5",{children:"Error caught in React Components"}),this.state.error?.name&&jsxs("h5",{children:["Error Name: ",jsx("code",{children:this.state.error?.name})]}),this.state.error?.message&&jsxs("h5",{children:["Message:",this.state.error?.message]}),this.state.componentStack&&jsxs(Fragment,{children:[jsx("h6",{children:"Component Stack:"}),jsx("pre",{children:jsx("code",{children:this.state.componentStack})}),jsx("br",{})]}),this.state.error?.stack&&jsxs(Fragment,{children:[jsx("h6",{children:"Error Stack:"}),jsx("pre",{children:jsx("code",{children:this.state.error?.stack})})]})]}):this.props.children}};
5
-
6
- export { o as default };
7
- //# sourceMappingURL=error-catcher.mjs.map
4
+ // src/error-catcher.tsx
5
+ import * as React from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ var ErrorCatcher = class extends React.Component {
8
+ static {
9
+ __name(this, "ErrorCatcher");
10
+ }
11
+ constructor(props) {
12
+ super(props);
13
+ this.state = {
14
+ hasError: false,
15
+ componentStack: "",
16
+ error: null
17
+ };
18
+ }
19
+ static getDerivedStateFromError(error) {
20
+ return {
21
+ hasError: true
22
+ };
23
+ }
24
+ componentDidCatch(error, errorInfo) {
25
+ const { componentStack } = errorInfo;
26
+ this.setState({
27
+ error,
28
+ componentStack
29
+ });
30
+ }
31
+ render() {
32
+ if (this.state.hasError) {
33
+ return /* @__PURE__ */ jsxs(
34
+ "div",
35
+ {
36
+ style: {
37
+ padding: "5px"
38
+ },
39
+ children: [
40
+ /* @__PURE__ */ jsx("h5", { children: "Error caught in React Components" }),
41
+ this.state.error?.name && /* @__PURE__ */ jsxs("h5", { children: [
42
+ "Error Name: ",
43
+ /* @__PURE__ */ jsx("code", { children: this.state.error?.name })
44
+ ] }),
45
+ this.state.error?.message && /* @__PURE__ */ jsxs("h5", { children: [
46
+ "Message:",
47
+ this.state.error?.message
48
+ ] }),
49
+ this.state.componentStack && /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ /* @__PURE__ */ jsx("h6", { children: "Component Stack:" }),
51
+ /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: this.state.componentStack }) }),
52
+ /* @__PURE__ */ jsx("br", {})
53
+ ] }),
54
+ this.state.error?.stack && /* @__PURE__ */ jsxs(Fragment, { children: [
55
+ /* @__PURE__ */ jsx("h6", { children: "Error Stack:" }),
56
+ /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: this.state.error?.stack }) })
57
+ ] })
58
+ ]
59
+ }
60
+ );
61
+ }
62
+ return this.props.children;
63
+ }
64
+ };
65
+ export {
66
+ ErrorCatcher as default
67
+ };
8
68
  //# sourceMappingURL=error-catcher.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error-catcher.tsx"],"names":["ErrorCatcher","__name","props","error","errorInfo","componentStack","jsxs","jsx","Fragment"],"mappings":";;;AAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAQqBA,CAArB,CAAA,cAAgD,WAG9C,CAXF,OAWEC,CAAA,CAAA,IAAA,CAAA,cAAA,EAAA,CACA,WAAYC,CAAAA,CAAAA,CAAO,CACjB,KAAMA,CAAAA,CAAK,CACX,CAAA,IAAA,CAAK,MAAQ,CACX,QAAA,CAAU,CACV,CAAA,CAAA,cAAA,CAAgB,GAChB,KAAO,CAAA,IACT,EACF,CAEA,OAAO,yBAAyBC,CAAc,CAAA,CAE5C,OAAO,CACL,SAAU,CACZ,CAAA,CACF,CAES,iBAAA,CAAkBA,EAAcC,CAAkC,CAAA,CACzE,GAAM,CAAE,eAAAC,CAAe,CAAA,CAAID,EAC3B,IAAK,CAAA,QAAA,CAAS,CACZ,KAAAD,CAAAA,CAAAA,CACA,cAAAE,CAAAA,CACF,CAAC,EACH,CAES,MAAS,EAAA,CAChB,OAAI,IAAK,CAAA,KAAA,CAAM,QAEXC,CAAAA,IAAAA,CAAC,OACC,KAAO,CAAA,CACL,QAAS,KACX,CAAA,CAEA,UAAAC,GAAC,CAAA,IAAA,CAAA,CAAG,QAAgC,CAAA,kCAAA,CAAA,CAAA,CACnC,KAAK,KAAM,CAAA,KAAA,EAAO,IACjBD,EAAAA,IAAAA,CAAC,MAAG,QACUC,CAAAA,CAAAA,cAAAA,CAAAA,GAAAA,CAAC,MAAM,CAAA,CAAA,QAAA,CAAA,IAAA,CAAK,MAAM,KAAO,EAAA,IAAA,CAAK,GAC5C,CAED,CAAA,IAAA,CAAK,MAAM,KAAO,EAAA,OAAA,EACjBD,IAAC,CAAA,IAAA,CAAA,CAAG,qBAED,IAAK,CAAA,KAAA,CAAM,KAAO,EAAA,OAAA,CAAA,CACrB,EAED,IAAK,CAAA,KAAA,CAAM,cACVA,EAAAA,IAAAA,CAAAE,SAAA,CACE,QAAA,CAAA,CAAAD,IAAC,IAAG,CAAA,CAAA,QAAA,CAAA,kBAAA,CAAgB,EACpBA,GAAC,CAAA,KAAA,CAAA,CACC,QAAAA,CAAAA,GAAAA,CAAC,QAAM,QAAK,CAAA,IAAA,CAAA,KAAA,CAAM,cAAe,CAAA,CAAA,CACnC,EACAA,GAAC,CAAA,IAAA,CAAA,EAAG,CACN,CAAA,CAAA,CAAA,CAED,KAAK,KAAM,CAAA,KAAA,EAAO,OACjBD,IAAAE,CAAAA,QAAAA,CAAA,CACE,QAAAD,CAAAA,CAAAA,GAAAA,CAAC,IAAG,CAAA,CAAA,QAAA,CAAA,cAAA,CAAY,EAChBA,GAAC,CAAA,KAAA,CAAA,CACC,QAAAA,CAAAA,GAAAA,CAAC,QAAM,QAAK,CAAA,IAAA,CAAA,KAAA,CAAM,KAAO,EAAA,KAAA,CAAM,EACjC,CACF,CAAA,CAAA,CAAA,CAAA,CAEJ,EAIG,IAAK,CAAA,KAAA,CAAM,QACpB,CACF","file":"error-catcher.mjs","sourcesContent":["import * as React from 'react';\n\ntype State = {\n hasError: boolean;\n componentStack?: string;\n error?: Error;\n};\n\nexport default class ErrorCatcher extends React.Component<\n { children: React.ReactNode },\n State\n> {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n componentStack: '',\n error: null,\n };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n };\n }\n\n override componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n const { componentStack } = errorInfo;\n this.setState({\n error,\n componentStack,\n });\n }\n\n override render() {\n if (this.state.hasError) {\n return (\n <div\n style={{\n padding: '5px',\n }}\n >\n <h5>Error caught in React Components</h5>\n {this.state.error?.name && (\n <h5>\n Error Name: <code>{this.state.error?.name}</code>\n </h5>\n )}\n {this.state.error?.message && (\n <h5>\n Message:\n {this.state.error?.message}\n </h5>\n )}\n {this.state.componentStack && (\n <>\n <h6>Component Stack:</h6>\n <pre>\n <code>{this.state.componentStack}</code>\n </pre>\n <br />\n </>\n )}\n {this.state.error?.stack && (\n <>\n <h6>Error Stack:</h6>\n <pre>\n <code>{this.state.error?.stack}</code>\n </pre>\n </>\n )}\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/error-catcher.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype State = {\n hasError: boolean;\n componentStack?: string;\n error?: Error;\n};\n\nexport default class ErrorCatcher extends React.Component<\n { children: React.ReactNode },\n State\n> {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n componentStack: '',\n error: null,\n };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n };\n }\n\n override componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n const { componentStack } = errorInfo;\n this.setState({\n error,\n componentStack,\n });\n }\n\n override render() {\n if (this.state.hasError) {\n return (\n <div\n style={{\n padding: '5px',\n }}\n >\n <h5>Error caught in React Components</h5>\n {this.state.error?.name && (\n <h5>\n Error Name: <code>{this.state.error?.name}</code>\n </h5>\n )}\n {this.state.error?.message && (\n <h5>\n Message:\n {this.state.error?.message}\n </h5>\n )}\n {this.state.componentStack && (\n <>\n <h6>Component Stack:</h6>\n <pre>\n <code>{this.state.componentStack}</code>\n </pre>\n <br />\n </>\n )}\n {this.state.error?.stack && (\n <>\n <h6>Error Stack:</h6>\n <pre>\n <code>{this.state.error?.stack}</code>\n </pre>\n </>\n )}\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;;AAAA,YAAY,WAAW;AA4Cb,SAaE,UAbF,KAEE,YAFF;AApCV,IAAqB,eAArB,cAAgD,gBAG9C;AAAA,EAXF,OAWE;AAAA;AAAA;AAAA,EACA,YAAY,OAAO;AACjB,UAAM,KAAK;AACX,SAAK,QAAQ;AAAA,MACX,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,OAAO,yBAAyB,OAAc;AAE5C,WAAO;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAES,kBAAkB,OAAc,WAAkC;AACzE,UAAM,EAAE,eAAe,IAAI;AAC3B,SAAK,SAAS;AAAA,MACZ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAES,SAAS;AAChB,QAAI,KAAK,MAAM,UAAU;AACvB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,SAAS;AAAA,UACX;AAAA,UAEA;AAAA,gCAAC,QAAG,8CAAgC;AAAA,YACnC,KAAK,MAAM,OAAO,QACjB,qBAAC,QAAG;AAAA;AAAA,cACU,oBAAC,UAAM,eAAK,MAAM,OAAO,MAAK;AAAA,eAC5C;AAAA,YAED,KAAK,MAAM,OAAO,WACjB,qBAAC,QAAG;AAAA;AAAA,cAED,KAAK,MAAM,OAAO;AAAA,eACrB;AAAA,YAED,KAAK,MAAM,kBACV,iCACE;AAAA,kCAAC,QAAG,8BAAgB;AAAA,cACpB,oBAAC,SACC,8BAAC,UAAM,eAAK,MAAM,gBAAe,GACnC;AAAA,cACA,oBAAC,QAAG;AAAA,eACN;AAAA,YAED,KAAK,MAAM,OAAO,SACjB,iCACE;AAAA,kCAAC,QAAG,0BAAY;AAAA,cAChB,oBAAC,SACC,8BAAC,UAAM,eAAK,MAAM,OAAO,OAAM,GACjC;AAAA,eACF;AAAA;AAAA;AAAA,MAEJ;AAAA,IAEJ;AAEA,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
package/dist/index.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { RendererWebpackBase, Renderer, KsJsImport } from '@knapsack/renderer-webpack-base';
1
+ import { RendererWebpackBase, Renderer, KsJsImportMap } from '@knapsack/renderer-webpack-base';
2
2
  import { Renderable } from '@knapsack/app/renderers';
3
3
  import { RendererId } from '@knapsack/types';
4
- import { KnapsackRenderParams } from '@knapsack/app/types';
5
- export { D as DemoWrapperProps } from './types-D2eCZXsg.mjs';
4
+ export { D as DemoWrapperProps } from './types-CivTHEEo.mjs';
6
5
 
7
6
  declare class KnapsackReactRenderer extends RendererWebpackBase implements Renderable {
8
7
  /**
@@ -24,15 +23,15 @@ declare class KnapsackReactRenderer extends RendererWebpackBase implements Rende
24
23
  id?: RendererId;
25
24
  });
26
25
  init: Renderer['init'];
26
+ hydrate: Renderer['hydrate'];
27
27
  getMeta: Renderer['getMeta'];
28
28
  changeCase: Renderer['changeCase'];
29
29
  createWebpackConfig: RendererWebpackBase['createWebpackConfig'];
30
- getJsImports: RendererWebpackBase['getJsImports'];
31
- prepClientRenderResults({ usage, demoApp, imports: xImports, renderOptions: { pattern, template, demo }, }: {
30
+ prepClientRenderResults({ usage, demoApp, importMap, renderOptions: { demo, state, patternId, templateId }, }: {
32
31
  usage: string;
33
32
  demoApp: string;
34
- imports: KsJsImport[];
35
- renderOptions: KnapsackRenderParams;
33
+ importMap: KsJsImportMap;
34
+ renderOptions: Parameters<Renderer['render']>[0];
36
35
  }): ReturnType<Renderer['render']>;
37
36
  render: Renderer['render'];
38
37
  getUsageAndImports: RendererWebpackBase['getUsageAndImports'];