@knapsack/renderer-react 4.70.0--canary.4821.e250df4.0 → 4.70.0--canary.4821.82d27e9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,71 +1,20 @@
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
- ));
1
+ 'use strict';
24
2
 
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");
3
+ var E = require('react');
4
+ var g = require('react-dom/client');
5
+ var client = require('@knapsack/renderer-webpack-base/client');
6
+ var jsxRuntime = require('react/jsx-runtime');
29
7
 
30
- // src/types.ts
31
- var rendererMetaScriptTagId = "ks-react-meta";
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
32
9
 
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 = `
10
+ var E__default = /*#__PURE__*/_interopDefault(E);
11
+ var g__default = /*#__PURE__*/_interopDefault(g);
12
+
13
+ var l=Object.defineProperty;var n=(r,e)=>l(r,"name",{value:e,configurable:!0});var h=(r,e)=>()=>(r&&(e=r(r=0)),e);var C=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var a,m=h(()=>{a="ks-react-meta";});var I=C(()=>{m();async function x(){try{let{getNeededImports:r,getExtraImports:e,rendererMeta:{disableReactStrictMode:d,demoWrapperProps:s},rendererMethods:{getDemoApp:c}}=client.getKsRendererClientUtils({rendererMetaScriptTagId:a}),[i,{DemoWrapper:R,ErrorCatcher:y}]=await Promise.all([r(),e()]),o=document.getElementById("render-root");if(!o)throw new Error("No root element found");let M=c(i),p=jsxRuntime.jsx(y,{children:jsxRuntime.jsx(R,{...s,children:jsxRuntime.jsx(M,{})})});g__default.default.createRoot(o).render(d?p:jsxRuntime.jsx(E__default.default.StrictMode,{children:p}));}catch(r){console.error(r);let e=document.createElement("div");e.innerHTML=`
63
14
  <h1>Error</h1>
64
- <p>${e.message}</p>
65
- `;
66
- document.body.appendChild(errorElement);
67
- }
68
- }
69
- __name(init, "init");
70
- init();
15
+ <p>${r.message}</p>
16
+ `,document.body.appendChild(e);}}n(x,"init");x();});var init = I();
17
+
18
+ module.exports = init;
19
+ //# sourceMappingURL=init.js.map
71
20
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../src/types.ts","../../src/client/init.tsx"],"names":["rendererMetaScriptTagId","init_types","__esmMin","require_init","__commonJSMin","init","getNeededImports","getExtraImports","disableReactStrictMode","demoWrapperProps","getDemoApp","getKsRendererClientUtils","neededImports","DemoWrapper","ErrorCatcher","root","DemoApp","app","jsx","ReactDOM","React","e","errorElement","__name"],"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,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA,IAuBaA,CAvBbC,CAAAA,CAAAA,CAAAC,CAAA,CAAA,IAAA,CAuBaF,CAA0B,CAAA,gBAAA,CAAA,CAAA,CCvBvC,IAAAG,CAAAA,CAAAC,EAAA,IAIAH,CAAAA,CAAAA,EAAAA,CAQA,eAAeI,CAAAA,EAAO,CACpB,GAAI,CACF,GAAM,CACJ,gBAAAC,CAAAA,CAAAA,CACA,eAAAC,CAAAA,CAAAA,CACA,YAAc,CAAA,CAAE,sBAAAC,CAAAA,CAAAA,CAAwB,gBAAAC,CAAAA,CAAiB,CACzD,CAAA,eAAA,CAAiB,CAAE,UAAA,CAAAC,CAAW,CAChC,EAAIC,+BAKF,CAAA,CACA,uBAAAX,CAAAA,CACF,CAAC,CAAA,CACK,CAACY,CAAAA,CAAe,CAAE,WAAAC,CAAAA,CAAAA,CAAa,YAAAC,CAAAA,CAAa,CAAC,CAAA,CAAI,MAAM,OAAA,CAAQ,IAAI,CACvER,CAAAA,EACAC,CAAAA,CAAAA,EACF,CAAC,CACKQ,CAAAA,CAAAA,CAAO,QAAS,CAAA,cAAA,CAAe,aAAa,CAAA,CAClD,GAAI,CAACA,CACH,CAAA,MAAM,IAAI,KAAM,CAAA,uBAAuB,CAGzC,CAAA,IAAMC,CAAUN,CAAAA,CAAAA,CADOE,CACkB,CAAA,CACnCK,EACJC,cAACJ,CAAAA,CAAAA,CAAA,CACC,QAAA,CAAAI,cAACL,CAAAA,CAAAA,CAAA,CAAa,GAAGJ,EACf,QAAAS,CAAAA,cAAAA,CAACF,CAAA,CAAA,EAAQ,CACX,CAAA,CAAA,CACF,CAGFG,CAAAA,kBAAAA,CAAS,WAAWJ,CAAI,CAAA,CAAE,MACxBP,CAAAA,CAAAA,CAAyBS,CAAMC,CAAAA,cAAAA,CAACE,kBAAM,CAAA,UAAA,CAAN,CAAkB,QAAAH,CAAAA,CAAAA,CAAI,CACxD,EACF,CAASI,MAAAA,CAAAA,CAAG,CACV,OAAA,CAAQ,MAAMA,CAAC,CAAA,CAEf,IAAMC,CAAAA,CAAe,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA,CACjDA,EAAa,SAAY,CAAA,CAAA;AAAA;AAAA,OAAA,EAEpBD,EAAE,OAAO,CAAA;AAAA,EAEd,CAAA,CAAA,QAAA,CAAS,IAAK,CAAA,WAAA,CAAYC,CAAY,EACxC,CACF,CA9CeC,CAAAA,CAAAlB,CAAA,CAAA,MAAA,CAAA,CAgDfA,CAAK,GAAA,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';\n\nexport type Component = ComponentType<Record<string, unknown>>;\n\nexport type DemoWrapperProps = {\n children: React.ReactNode;\n demo: Demo;\n patternId: string;\n templateId: string;\n};\n\nexport type ExtraJsImportNames = 'DemoWrapper' | 'ErrorCatcher';\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","/// <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 ExtraJsImportNames,\n} from '../types';\n\nasync function init() {\n try {\n const {\n getNeededImports,\n getExtraImports,\n rendererMeta: { disableReactStrictMode, demoWrapperProps },\n rendererMethods: { getDemoApp },\n } = getKsRendererClientUtils<\n Component,\n KsReactMeta,\n RendererMethods,\n ExtraJsImportNames\n >({\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"]}
@@ -1,74 +1,13 @@
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
- };
1
+ import E from 'react';
2
+ import g from 'react-dom/client';
3
+ import { getKsRendererClientUtils } from '@knapsack/renderer-webpack-base/client';
4
+ import { jsx } from 'react/jsx-runtime';
10
5
 
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
- });
25
-
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 = `
6
+ var l=Object.defineProperty;var n=(r,e)=>l(r,"name",{value:e,configurable:!0});var h=(r,e)=>()=>(r&&(e=r(r=0)),e);var C=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var a,m=h(()=>{a="ks-react-meta";});var I=C(()=>{m();async function x(){try{let{getNeededImports:r,getExtraImports:e,rendererMeta:{disableReactStrictMode:d,demoWrapperProps:s},rendererMethods:{getDemoApp:c}}=getKsRendererClientUtils({rendererMetaScriptTagId:a}),[i,{DemoWrapper:R,ErrorCatcher:y}]=await Promise.all([r(),e()]),o=document.getElementById("render-root");if(!o)throw new Error("No root element found");let M=c(i),p=jsx(y,{children:jsx(R,{...s,children:jsx(M,{})})});g.createRoot(o).render(d?p:jsx(E.StrictMode,{children:p}));}catch(r){console.error(r);let e=document.createElement("div");e.innerHTML=`
63
7
  <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();
8
+ <p>${r.message}</p>
9
+ `,document.body.appendChild(e);}}n(x,"init");x();});var init = I();
10
+
11
+ export { init as default };
12
+ //# sourceMappingURL=init.mjs.map
74
13
  //# sourceMappingURL=init.mjs.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../src/types.ts","../../src/client/init.tsx"],"names":["rendererMetaScriptTagId","init_types","__esmMin","require_init","__commonJSMin","init","getNeededImports","getExtraImports","disableReactStrictMode","demoWrapperProps","getDemoApp","getKsRendererClientUtils","neededImports","DemoWrapper","ErrorCatcher","root","DemoApp","app","jsx","ReactDOM","React","e","errorElement","__name"],"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,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA,IAuBaA,CAvBbC,CAAAA,CAAAA,CAAAC,CAAA,CAAA,IAAA,CAuBaF,CAA0B,CAAA,gBAAA,CAAA,CAAA,CCvBvC,IAAAG,CAAAA,CAAAC,EAAA,IAIAH,CAAAA,CAAAA,EAAAA,CAQA,eAAeI,CAAAA,EAAO,CACpB,GAAI,CACF,GAAM,CACJ,gBAAAC,CAAAA,CAAAA,CACA,eAAAC,CAAAA,CAAAA,CACA,YAAc,CAAA,CAAE,sBAAAC,CAAAA,CAAAA,CAAwB,gBAAAC,CAAAA,CAAiB,CACzD,CAAA,eAAA,CAAiB,CAAE,UAAA,CAAAC,CAAW,CAChC,EAAIC,wBAKF,CAAA,CACA,uBAAAX,CAAAA,CACF,CAAC,CAAA,CACK,CAACY,CAAAA,CAAe,CAAE,WAAAC,CAAAA,CAAAA,CAAa,YAAAC,CAAAA,CAAa,CAAC,CAAA,CAAI,MAAM,OAAA,CAAQ,IAAI,CACvER,CAAAA,EACAC,CAAAA,CAAAA,EACF,CAAC,CACKQ,CAAAA,CAAAA,CAAO,QAAS,CAAA,cAAA,CAAe,aAAa,CAAA,CAClD,GAAI,CAACA,CACH,CAAA,MAAM,IAAI,KAAM,CAAA,uBAAuB,CAGzC,CAAA,IAAMC,CAAUN,CAAAA,CAAAA,CADOE,CACkB,CAAA,CACnCK,EACJC,GAACJ,CAAAA,CAAAA,CAAA,CACC,QAAA,CAAAI,GAACL,CAAAA,CAAAA,CAAA,CAAa,GAAGJ,EACf,QAAAS,CAAAA,GAAAA,CAACF,CAAA,CAAA,EAAQ,CACX,CAAA,CAAA,CACF,CAGFG,CAAAA,CAAAA,CAAS,WAAWJ,CAAI,CAAA,CAAE,MACxBP,CAAAA,CAAAA,CAAyBS,CAAMC,CAAAA,GAAAA,CAACE,CAAM,CAAA,UAAA,CAAN,CAAkB,QAAAH,CAAAA,CAAAA,CAAI,CACxD,EACF,CAASI,MAAAA,CAAAA,CAAG,CACV,OAAA,CAAQ,MAAMA,CAAC,CAAA,CAEf,IAAMC,CAAAA,CAAe,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA,CACjDA,EAAa,SAAY,CAAA,CAAA;AAAA;AAAA,OAAA,EAEpBD,EAAE,OAAO,CAAA;AAAA,EAEd,CAAA,CAAA,QAAA,CAAS,IAAK,CAAA,WAAA,CAAYC,CAAY,EACxC,CACF,CA9CeC,CAAAA,CAAAlB,CAAA,CAAA,MAAA,CAAA,CAgDfA,CAAK,GAAA,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';\n\nexport type Component = ComponentType<Record<string, unknown>>;\n\nexport type DemoWrapperProps = {\n children: React.ReactNode;\n demo: Demo;\n patternId: string;\n templateId: string;\n};\n\nexport type ExtraJsImportNames = 'DemoWrapper' | 'ErrorCatcher';\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","/// <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 ExtraJsImportNames,\n} from '../types';\n\nasync function init() {\n try {\n const {\n getNeededImports,\n getExtraImports,\n rendererMeta: { disableReactStrictMode, demoWrapperProps },\n rendererMethods: { getDemoApp },\n } = getKsRendererClientUtils<\n Component,\n KsReactMeta,\n RendererMethods,\n ExtraJsImportNames\n >({\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"]}
@@ -1,29 +1,9 @@
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);
1
+ 'use strict';
19
2
 
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;
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
29
9
  //# sourceMappingURL=demo-wrapper.js.map
@@ -1 +1 @@
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
+ {"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,11 +1,7 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
1
+ import { jsx } from 'react/jsx-runtime';
3
2
 
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
- };
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
11
7
  //# sourceMappingURL=demo-wrapper.mjs.map
@@ -1 +1 @@
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
+ {"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,96 +1,30 @@
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);
1
+ 'use strict';
29
2
 
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
- };
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
96
30
  //# sourceMappingURL=error-catcher.js.map
@@ -1 +1 @@
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
+ {"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,68 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
1
+ import * as n from 'react';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
 
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
- };
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
68
8
  //# sourceMappingURL=error-catcher.mjs.map
@@ -1 +1 @@
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":[]}
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"]}
package/dist/index.d.mts CHANGED
@@ -4,13 +4,12 @@ import { RendererId } from '@knapsack/types';
4
4
  export { D as DemoWrapperProps } from './types-CivTHEEo.mjs';
5
5
 
6
6
  declare class KnapsackReactRenderer extends RendererWebpackBase implements Renderable {
7
+ #private;
7
8
  /**
8
9
  * `react.js` & `react-dom.js` root relative paths
9
10
  */
10
11
  assets: string[];
11
12
  babelConfig: Record<string, unknown>;
12
- private demoWrapperPath;
13
- private disableReactStrictMode?;
14
13
  constructor({ webpackConfig, demoWrapperPath, id, disableReactStrictMode, }?: {
15
14
  webpackConfig?: ConstructorParameters<typeof RendererWebpackBase>[0]['webpackConfig'];
16
15
  demoWrapperPath?: string;
@@ -22,6 +21,7 @@ declare class KnapsackReactRenderer extends RendererWebpackBase implements Rende
22
21
  /** Don't set if calling from `knapsack.config.js`, only use if creating a new Renderer based on the React Renderer */
23
22
  id?: RendererId;
24
23
  });
24
+ setConfig: Renderer['setConfig'];
25
25
  init: Renderer['init'];
26
26
  hydrate: Renderer['hydrate'];
27
27
  getMeta: Renderer['getMeta'];
package/dist/index.d.ts CHANGED
@@ -4,13 +4,12 @@ import { RendererId } from '@knapsack/types';
4
4
  export { D as DemoWrapperProps } from './types-CivTHEEo.js';
5
5
 
6
6
  declare class KnapsackReactRenderer extends RendererWebpackBase implements Renderable {
7
+ #private;
7
8
  /**
8
9
  * `react.js` & `react-dom.js` root relative paths
9
10
  */
10
11
  assets: string[];
11
12
  babelConfig: Record<string, unknown>;
12
- private demoWrapperPath;
13
- private disableReactStrictMode?;
14
13
  constructor({ webpackConfig, demoWrapperPath, id, disableReactStrictMode, }?: {
15
14
  webpackConfig?: ConstructorParameters<typeof RendererWebpackBase>[0]['webpackConfig'];
16
15
  demoWrapperPath?: string;
@@ -22,6 +21,7 @@ declare class KnapsackReactRenderer extends RendererWebpackBase implements Rende
22
21
  /** Don't set if calling from `knapsack.config.js`, only use if creating a new Renderer based on the React Renderer */
23
22
  id?: RendererId;
24
23
  });
24
+ setConfig: Renderer['setConfig'];
25
25
  init: Renderer['init'];
26
26
  hydrate: Renderer['hydrate'];
27
27
  getMeta: Renderer['getMeta'];