@json-canvas-viewer/react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +92 -0
- package/dist/Viewer.d.ts +43 -0
- package/dist/index.d.ts +2 -0
- package/dist/react.js +4 -0
- package/dist/react.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Hesprs (Hēsperus)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<img src="../../assets/logo.svg" alt="JSON Canvas Viewer logo" width="280px">
|
|
3
|
+
<br />
|
|
4
|
+
JSON Canvas Viewer React
|
|
5
|
+
<br />
|
|
6
|
+
</h1>
|
|
7
|
+
|
|
8
|
+
<h4 align="center">JSON Canvas Viewer as a React component</h4>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://github.com/hesprs/json-canvas-viewer/wiki">
|
|
12
|
+
<strong>Documentation</strong>
|
|
13
|
+
</a> •
|
|
14
|
+
<a href="https://www.npmjs.com/package/json-canvas-viewer">
|
|
15
|
+
<strong>Vanilla</strong>
|
|
16
|
+
</a> •
|
|
17
|
+
<a href="https://www.npmjs.com/package/vite-plugin-json-canvas">
|
|
18
|
+
<strong>Vite Plugin</strong>
|
|
19
|
+
</a> •
|
|
20
|
+
<strong>React Component</strong> •
|
|
21
|
+
<a href="https://www.npmjs.com/package/@json-canvas-viewer/vue">
|
|
22
|
+
<strong>Vue Component</strong>
|
|
23
|
+
</a> •
|
|
24
|
+
<a href="https://www.npmjs.com/package/@json-canvas-viewer/preact">
|
|
25
|
+
<strong>Preact Component</strong>
|
|
26
|
+
</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
## ✏️ Description
|
|
30
|
+
|
|
31
|
+
This is the React component of JSON Canvas Viewer, it wraps around the vanilla viewer class to provide a seamless integration with React. This package additionally re-exports everything from the core package, so you do not need to install the core package separately.
|
|
32
|
+
|
|
33
|
+
Install this package if you want to use JSON Canvas Viewer in a **React** project. If you are not using it, please head to the corresponding package in the navigation bar above.
|
|
34
|
+
|
|
35
|
+
## 📦 Installation
|
|
36
|
+
|
|
37
|
+
Install with your favorite package manager:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm add @json-canvas-viewer/react
|
|
41
|
+
|
|
42
|
+
# or
|
|
43
|
+
pnpm add @json-canvas-viewer/react
|
|
44
|
+
|
|
45
|
+
# or
|
|
46
|
+
yarn add @json-canvas-viewer/react
|
|
47
|
+
|
|
48
|
+
# or
|
|
49
|
+
bun add @json-canvas-viewer/react
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Now you have two options: **build-time** canvas parsing or **client-side** canvas parsing.
|
|
53
|
+
|
|
54
|
+
### Build-time Canvas Parsing
|
|
55
|
+
|
|
56
|
+
This is the recommended way to parse canvas data, it will result in significantly smaller bundle size and faster load times.
|
|
57
|
+
|
|
58
|
+
Firstly, you need a bundler. JSON Canvas Viewer currently supports [Vite](https://vitejs.dev/) only. Please install [Vite Plugin](https://www.npmjs.com/package/vite-plugin-json-canvas) and setup it.
|
|
59
|
+
|
|
60
|
+
After bundler setup, you can directly import a canvas file and use it in viewer instantiation:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { JSONCanvasViewerComponent } from '@json-canvas-viewer/react';
|
|
64
|
+
import canvas from 'path/to/your.canvas';
|
|
65
|
+
|
|
66
|
+
export function App() {
|
|
67
|
+
return <JSONCanvasViewerComponent canvas={canvas} />;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Client-side Canvas Parsing
|
|
72
|
+
|
|
73
|
+
This method doesn't require any bundler setup. You just need to import the parser and fetch the canvas file:
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { JSONCanvasViewerComponent, fetchCanvas, parser } from '@json-canvas-viewer/react';
|
|
77
|
+
|
|
78
|
+
export async function App() {
|
|
79
|
+
return (
|
|
80
|
+
<JSONCanvasViewerComponent
|
|
81
|
+
canvas={await fetchCanvas('path/to/your.canvas')}
|
|
82
|
+
options={{ parser }}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Refer to the [documentation](https://github.com/hesprs/json-canvas-viewer/wiki/) for more details.
|
|
89
|
+
|
|
90
|
+
## 📝 Copyright & License
|
|
91
|
+
|
|
92
|
+
Copyright ©️ 2025-2026 Hesprs (Hēsperus) | [MIT License](https://mit-license.org/)
|
package/dist/Viewer.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Options, JSONCanvasViewerInterface, GeneralModuleCtor, Hook, JSONCanvasTextNode, JSONCanvasLinkNode, JSONCanvasFileNode, JSONCanvas } from 'json-canvas-viewer';
|
|
2
|
+
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
3
|
+
type ModuleInputCtor = Array<GeneralModuleCtor>;
|
|
4
|
+
interface TextSlotProps {
|
|
5
|
+
content: string;
|
|
6
|
+
node: JSONCanvasTextNode;
|
|
7
|
+
onActive: Hook;
|
|
8
|
+
onLoseActive: Hook;
|
|
9
|
+
}
|
|
10
|
+
interface LinkSlotProps {
|
|
11
|
+
content: string;
|
|
12
|
+
node: JSONCanvasLinkNode;
|
|
13
|
+
onActive: Hook;
|
|
14
|
+
onLoseActive: Hook;
|
|
15
|
+
}
|
|
16
|
+
interface FileSlotProps {
|
|
17
|
+
content: string;
|
|
18
|
+
node: JSONCanvasFileNode;
|
|
19
|
+
onActive: Hook;
|
|
20
|
+
onLoseActive: Hook;
|
|
21
|
+
}
|
|
22
|
+
type ViewerHandle<T extends ModuleInputCtor> = {
|
|
23
|
+
viewer: JSONCanvasViewerInterface<T> | null;
|
|
24
|
+
};
|
|
25
|
+
type ViewerProps<T extends ModuleInputCtor> = {
|
|
26
|
+
modules?: T;
|
|
27
|
+
canvas?: JSONCanvas;
|
|
28
|
+
attachmentDir?: string;
|
|
29
|
+
attachments?: Record<string, string>;
|
|
30
|
+
theme?: 'dark' | 'light';
|
|
31
|
+
options?: Omit<Options<T>, 'container' | 'theme' | 'canvas' | 'attachmentDir' | 'nodeComponents' | 'attachments'>;
|
|
32
|
+
text?: (props: TextSlotProps) => ReactNode;
|
|
33
|
+
markdown?: (props: FileSlotProps) => ReactNode;
|
|
34
|
+
image?: (props: FileSlotProps) => ReactNode;
|
|
35
|
+
video?: (props: FileSlotProps) => ReactNode;
|
|
36
|
+
audio?: (props: FileSlotProps) => ReactNode;
|
|
37
|
+
link?: (props: LinkSlotProps) => ReactNode;
|
|
38
|
+
prerenderHtml?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
style?: CSSProperties;
|
|
41
|
+
};
|
|
42
|
+
declare const _default: React.ForwardRefExoticComponent<ViewerProps<ModuleInputCtor> & React.RefAttributes<ViewerHandle<ModuleInputCtor>>>;
|
|
43
|
+
export default _default;
|
package/dist/index.d.ts
ADDED
package/dist/react.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{JSONCanvasViewer as e}from"json-canvas-viewer";export*from"json-canvas-viewer";import t,{forwardRef as r,useRef as n,useState as o,useImperativeHandle as i,useMemo as s,useLayoutEffect as a,useEffect as c}from"react";var l,u={exports:{}},f={};var p,d,y={};function g(){return p||(p=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===R?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case g:return"Fragment";case h:return"Profiler";case m:return"StrictMode";case b:return"Suspense";case S:return"SuspenseList";case w:return"Activity"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case d:return"Portal";case _:return t.displayName||"Context";case v:return(t._context.displayName||"Context")+".Consumer";case O:var r=t.render;return(t=t.displayName)||(t=""!==(t=r.displayName||r.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case T:return null!==(r=t.displayName||null)?r:e(t.type)||"Memo";case E:r=t._payload,t=t._init;try{return e(t(r))}catch(n){}}return null}function r(e){return""+e}function n(e){try{r(e);var t=!1}catch(i){t=!0}if(t){var n=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),r(e)}}function o(t){if(t===g)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===E)return"<...>";try{var r=e(t);return r?"<"+r+">":"<...>"}catch(n){return"<...>"}}function i(){return Error("react-stack-top-frame")}function s(){var t=e(this.type);return M[t]||(M[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(t=this.props.ref)?t:null}function a(t,r,o,i,a,l){var f,d=r.children;if(void 0!==d)if(i)if(N(d)){for(i=0;i<d.length;i++)c(d[i]);Object.freeze&&Object.freeze(d)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(d);if(D.call(r,"key")){d=e(t);var y=Object.keys(r).filter(function(e){return"key"!==e});i=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",L[d+i]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',i,d,y,d),L[d+i]=!0)}if(d=null,void 0!==o&&(n(o),d=""+o),function(e){if(D.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(r)&&(n(r.key),d=""+r.key),"key"in r)for(var g in o={},r)"key"!==g&&(o[g]=r[g]);else o=r;return d&&function(e,t){function r(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,r,n,o,i){var a=r.ref;return e={$$typeof:p,type:e,key:t,props:r,_owner:n},null!==(void 0!==a?a:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:s}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,d,o,null===(f=k.A)?null:f.getOwner(),a,l)}function c(e){l(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===E&&("fulfilled"===e._payload.status?l(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function l(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var u,f=t,p=/* @__PURE__ */Symbol.for("react.transitional.element"),d=/* @__PURE__ */Symbol.for("react.portal"),g=/* @__PURE__ */Symbol.for("react.fragment"),m=/* @__PURE__ */Symbol.for("react.strict_mode"),h=/* @__PURE__ */Symbol.for("react.profiler"),v=/* @__PURE__ */Symbol.for("react.consumer"),_=/* @__PURE__ */Symbol.for("react.context"),O=/* @__PURE__ */Symbol.for("react.forward_ref"),b=/* @__PURE__ */Symbol.for("react.suspense"),S=/* @__PURE__ */Symbol.for("react.suspense_list"),T=/* @__PURE__ */Symbol.for("react.memo"),E=/* @__PURE__ */Symbol.for("react.lazy"),w=/* @__PURE__ */Symbol.for("react.activity"),R=/* @__PURE__ */Symbol.for("react.client.reference"),k=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,N=Array.isArray,j=console.createTask?console.createTask:function(){return null},M={},A=(f={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(f,i)(),x=j(o(i)),L={};y.Fragment=g,y.jsx=function(e,t,r){var n=1e4>k.recentlyCreatedOwnerStacks++;return a(e,t,r,!1,n?Error("react-stack-top-frame"):A,n?j(o(e)):x)},y.jsxs=function(e,t,r){var n=1e4>k.recentlyCreatedOwnerStacks++;return a(e,t,r,!0,n?Error("react-stack-top-frame"):A,n?j(o(e)):x)}}()),y}var m,h=(d||(d=1,"production"===process.env.NODE_ENV?u.exports=function(){if(l)return f;l=1;var e=/* @__PURE__ */Symbol.for("react.transitional.element"),t=/* @__PURE__ */Symbol.for("react.fragment");function r(t,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var i in n={},r)"key"!==i&&(n[i]=r[i]);else n=r;return r=n.ref,{$$typeof:e,type:t,key:o,ref:void 0!==r?r:null,props:n}}return f.Fragment=t,f.jsx=r,f.jsxs=r,f}():u.exports=g()),u.exports),v={exports:{}},_={};function O(){if(m)return _;m=1;var e=t;function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(r(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=/* @__PURE__ */Symbol.for("react.portal");var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return _.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,_.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(r(299));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:i,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,n)},_.flushSync=function(e){var t=s.T,r=o.p;try{if(s.T=null,o.p=2,e)return e()}finally{s.T=t,o.p=r,o.d.f()}},_.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,o.d.C(e,t))},_.prefetchDNS=function(e){"string"==typeof e&&o.d.D(e)},_.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var r=t.as,n=a(r,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===r?o.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:s}):"script"===r&&o.d.X(e,{crossOrigin:n,integrity:i,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},_.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var r=a(t.as,t.crossOrigin);o.d.M(e,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&o.d.M(e)},_.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var r=t.as,n=a(r,t.crossOrigin);o.d.L(e,r,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},_.preloadModule=function(e,t){if("string"==typeof e)if(t){var r=a(t.as,t.crossOrigin);o.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else o.d.m(e)},_.requestFormReset=function(e){o.d.r(e)},_.unstable_batchedUpdates=function(e,t){return e(t)},_.useFormState=function(e,t,r){return s.H.useFormState(e,t,r)},_.useFormStatus=function(){return s.H.useHostTransitionStatus()},_.version="19.2.4",_}var b,S,T={};function E(){return b||(b=1,"production"!==process.env.NODE_ENV&&function(){function e(){}function r(e){return""+e}function n(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}function o(e){return null===e?"`null`":void 0===e?"`undefined`":""===e?"an empty string":'something with type "'+typeof e+'"'}function i(e){return null===e?"`null`":void 0===e?"`undefined`":""===e?"an empty string":"string"==typeof e?JSON.stringify(e):"number"==typeof e?"`"+e+"`":'something with type "'+typeof e+'"'}function s(){var e=u.H;return null===e&&console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."),e}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=t,c={d:{f:e,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},l=/* @__PURE__ */Symbol.for("react.portal"),u=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;"function"==typeof Map&&null!=Map.prototype&&"function"==typeof Map.prototype.forEach&&"function"==typeof Set&&null!=Set.prototype&&"function"==typeof Set.prototype.clear&&"function"==typeof Set.prototype.forEach||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),T.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,T.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error("Target container is not a DOM element.");return function(e,t,n){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;try{r(o);var i=!1}catch(s){i=!0}return i&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.","function"==typeof Symbol&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object"),r(o)),{$$typeof:l,key:null==o?null:""+o,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},T.flushSync=function(e){var t=u.T,r=c.p;try{if(u.T=null,c.p=2,e)return e()}finally{u.T=t,c.p=r,c.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},T.preconnect=function(e,t){"string"==typeof e&&e?null!=t&&"object"!=typeof t?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",i(t)):null!=t&&"string"!=typeof t.crossOrigin&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",o(t.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(e)),"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,c.d.C(e,t))},T.prefetchDNS=function(e){if("string"==typeof e&&e){if(1<arguments.length){var t=arguments[1];"object"==typeof t&&t.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(t)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(t))}}else console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(e));"string"==typeof e&&c.d.D(e)},T.preinit=function(e,t){if("string"==typeof e&&e?null==t||"object"!=typeof t?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",i(t)):"style"!==t.as&&"script"!==t.as&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',i(t.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(e)),"string"==typeof e&&t&&"string"==typeof t.as){var r=t.as,s=n(r,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,l="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===r?c.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:s,integrity:a,fetchPriority:l}):"script"===r&&c.d.X(e,{crossOrigin:s,integrity:a,fetchPriority:l,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},T.preinitModule=function(e,t){var r="";if("string"==typeof e&&e||(r+=" The `href` argument encountered was "+o(e)+"."),void 0!==t&&"object"!=typeof t?r+=" The `options` argument encountered was "+o(t)+".":t&&"as"in t&&"script"!==t.as&&(r+=" The `as` option encountered was "+i(t.as)+"."),r)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",r);else if("script"===(r=t&&"string"==typeof t.as?t.as:"script"));else r=i(r),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',r,e);"string"==typeof e&&("object"==typeof t&&null!==t?null!=t.as&&"script"!==t.as||(r=n(t.as,t.crossOrigin),c.d.M(e,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})):null==t&&c.d.M(e))},T.preload=function(e,t){var r="";if("string"==typeof e&&e||(r+=" The `href` argument encountered was "+o(e)+"."),null==t||"object"!=typeof t?r+=" The `options` argument encountered was "+o(t)+".":"string"==typeof t.as&&t.as||(r+=" The `as` option encountered was "+o(t.as)+"."),r&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',r),"string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var i=n(r=t.as,t.crossOrigin);c.d.L(e,r,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},T.preloadModule=function(e,t){var r="";"string"==typeof e&&e||(r+=" The `href` argument encountered was "+o(e)+"."),void 0!==t&&"object"!=typeof t?r+=" The `options` argument encountered was "+o(t)+".":t&&"as"in t&&"string"!=typeof t.as&&(r+=" The `as` option encountered was "+o(t.as)+"."),r&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',r),"string"==typeof e&&(t?(r=n(t.as,t.crossOrigin),c.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0})):c.d.m(e))},T.requestFormReset=function(e){c.d.r(e)},T.unstable_batchedUpdates=function(e,t){return e(t)},T.useFormState=function(e,t,r){return s().useFormState(e,t,r)},T.useFormStatus=function(){return s().useHostTransitionStatus()},T.version="19.2.4","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),T}var w=(S||(S=1,"production"===process.env.NODE_ENV?(function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if("production"!==process.env.NODE_ENV)throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),v.exports=O()):v.exports=E()),v.exports);function R(e){const t=n(e);return t.current=e,t}const k=r(function(t,r){const l=n(null),u=n(null),f=R(t.text),p=R(t.markdown),d=R(t.image),y=R(t.video),g=R(t.audio),m=R(t.link),v=n(/* @__PURE__ */new Map),[,_]=o(0);i(r,()=>({viewer:u.current}),[]);const O=s(()=>{function e(e){return(t,r,n,o,i,s)=>{const a=e();a&&(!function(e,t,r){v.current.set(e,{id:e,container:t,element:r}),w.flushSync(()=>_(e=>e+1))}(n.id,t,a({content:r,node:n,onActive:i,onLoseActive:s})),o.subscribe(()=>{var e;e=n.id,v.current.delete(e)}))}}const r={};return t.text&&(r.text=e(()=>f.current)),t.markdown&&(r.markdown=e(()=>p.current)),t.image&&(r.image=e(()=>d.current)),t.video&&(r.video=e(()=>y.current)),t.audio&&(r.audio=e(()=>g.current)),t.link&&(r.link=e(()=>m.current)),r},[t.text,t.markdown,t.image,t.video,t.audio,t.link]);a(()=>{if(l.current)return u.current=new e({...t.options??{},container:l.current,theme:t.theme,canvas:t.canvas,attachmentDir:t.attachmentDir,attachments:t.attachments,nodeComponents:O},t.modules),()=>{u.current?.dispose(),u.current=null,v.current.clear()}},[]),c(()=>{u.current?.changeTheme(t.theme)},[t.theme]),c(()=>{u.current?.load({canvas:t.canvas,attachmentDir:t.attachmentDir,attachments:t.attachments})},[t.canvas,t.attachmentDir,t.attachments]);const b=Array.from(v.current.values()).map(e=>w.createPortal(e.element,e.container,e.id));/* @__PURE__ */
|
|
2
|
+
return h.jsxs(h.Fragment,{children:[
|
|
3
|
+
/* @__PURE__ */h.jsx("section",{ref:e=>{l.current=e},className:t.className,style:{maxHeight:"100vh",maxWidth:"100vw",...t.style},dangerouslySetInnerHTML:t.prerenderHtml?{__html:t.prerenderHtml}:void 0,suppressHydrationWarning:!!t.prerenderHtml}),b]})});export{k as JSONCanvasViewerComponent};
|
|
4
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.production.js","../../../node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.development.js","../../../node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/index.js","../src/Viewer.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.2.4\";\n","/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n try {\n testStringCoercion(key);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n JSCompiler_inline_result &&\n (console.error(\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n key[Symbol.toStringTag]) ||\n key.constructor.name ||\n \"Object\"\n ),\n testStringCoercion(key));\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n }\n function getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n }\n function getValueDescriptorExpectingObjectForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function getValueDescriptorExpectingEnumForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : \"string\" === typeof thing\n ? JSON.stringify(thing)\n : \"number\" === typeof thing\n ? \"`\" + thing + \"`\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(\n \"Invalid form element. requestFormReset must be passed a form that was rendered by React.\"\n );\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n (\"function\" === typeof Map &&\n null != Map.prototype &&\n \"function\" === typeof Map.prototype.forEach &&\n \"function\" === typeof Set &&\n null != Set.prototype &&\n \"function\" === typeof Set.prototype.clear &&\n \"function\" === typeof Set.prototype.forEach) ||\n console.error(\n \"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"\n );\n exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\n exports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(\"Target container is not a DOM element.\");\n return createPortal$1(children, container, null, key);\n };\n exports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn))\n return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f() &&\n console.error(\n \"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.\"\n );\n }\n };\n exports.preconnect = function (href, options) {\n \"string\" === typeof href && href\n ? null != options && \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : null != options &&\n \"string\" !== typeof options.crossOrigin &&\n console.error(\n \"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.\",\n getValueDescriptorExpectingObjectForWarning(options.crossOrigin)\n )\n : console.error(\n \"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n };\n exports.prefetchDNS = function (href) {\n if (\"string\" !== typeof href || !href)\n console.error(\n \"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n else if (1 < arguments.length) {\n var options = arguments[1];\n \"object\" === typeof options && options.hasOwnProperty(\"crossOrigin\")\n ? console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n );\n }\n \"string\" === typeof href && Internals.d.D(href);\n };\n exports.preinit = function (href, options) {\n \"string\" === typeof href && href\n ? null == options || \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : \"style\" !== options.as &&\n \"script\" !== options.as &&\n console.error(\n 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".',\n getValueDescriptorExpectingEnumForWarning(options.as)\n )\n : console.error(\n \"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n if (\n \"string\" === typeof href &&\n options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence\n ? options.precedence\n : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n };\n exports.preinitModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"script\" !== options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingEnumForWarning(options.as) +\n \".\");\n if (encountered)\n console.error(\n \"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s\",\n encountered\n );\n else\n switch (\n ((encountered =\n options && \"string\" === typeof options.as ? options.as : \"script\"),\n encountered)\n ) {\n case \"script\":\n break;\n default:\n (encountered =\n getValueDescriptorExpectingEnumForWarning(encountered)),\n console.error(\n 'ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',\n encountered,\n href\n );\n }\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as)\n (encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.M(href, {\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0,\n nonce:\n \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n } else null == options && Internals.d.M(href);\n };\n exports.preload = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n null == options || \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : (\"string\" === typeof options.as && options.as) ||\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel=\"preload\" as=\"...\" />` tag.%s',\n encountered\n );\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n encountered = options.as;\n var crossOrigin = getCrossOriginStringAs(\n encountered,\n options.crossOrigin\n );\n Internals.d.L(href, encountered, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet\n ? options.imageSrcSet\n : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes\n ? options.imageSizes\n : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n };\n exports.preloadModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"string\" !== typeof options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel=\"modulepreload\" as=\"...\" />` tag.%s',\n encountered\n );\n \"string\" === typeof href &&\n (options\n ? ((encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0\n }))\n : Internals.d.m(href));\n };\n exports.requestFormReset = function (form) {\n Internals.d.r(form);\n };\n exports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n };\n exports.useFormState = function (action, initialState, permalink) {\n return resolveDispatcher().useFormState(action, initialState, permalink);\n };\n exports.useFormStatus = function () {\n return resolveDispatcher().useHostTransitionStatus();\n };\n exports.version = \"19.2.4\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","import {\n\tJSONCanvasViewer,\n\ttype Options,\n\ttype JSONCanvasViewerInterface,\n\ttype GeneralModuleCtor,\n\ttype Hook,\n\ttype JSONCanvasTextNode,\n\ttype JSONCanvasLinkNode,\n\ttype JSONCanvasFileNode,\n\ttype JSONCanvas,\n} from 'json-canvas-viewer';\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\ttype CSSProperties,\n\ttype ReactNode,\n} from 'react';\nimport { createPortal, flushSync } from 'react-dom';\n\ntype ModuleInputCtor = Array<GeneralModuleCtor>;\n\ninterface TextSlotProps {\n\tcontent: string;\n\tnode: JSONCanvasTextNode;\n\tonActive: Hook;\n\tonLoseActive: Hook;\n}\ninterface LinkSlotProps {\n\tcontent: string;\n\tnode: JSONCanvasLinkNode;\n\tonActive: Hook;\n\tonLoseActive: Hook;\n}\ninterface FileSlotProps {\n\tcontent: string;\n\tnode: JSONCanvasFileNode;\n\tonActive: Hook;\n\tonLoseActive: Hook;\n}\n\ntype ViewerHandle<T extends ModuleInputCtor> = {\n\tviewer: JSONCanvasViewerInterface<T> | null;\n};\n\ntype ViewerProps<T extends ModuleInputCtor> = {\n\tmodules?: T;\n\tcanvas?: JSONCanvas;\n\tattachmentDir?: string;\n\tattachments?: Record<string, string>;\n\ttheme?: 'dark' | 'light';\n\toptions?: Omit<\n\t\tOptions<T>,\n\t\t'container' | 'theme' | 'canvas' | 'attachmentDir' | 'nodeComponents' | 'attachments'\n\t>;\n\ttext?: (props: TextSlotProps) => ReactNode;\n\tmarkdown?: (props: FileSlotProps) => ReactNode;\n\timage?: (props: FileSlotProps) => ReactNode;\n\tvideo?: (props: FileSlotProps) => ReactNode;\n\taudio?: (props: FileSlotProps) => ReactNode;\n\tlink?: (props: LinkSlotProps) => ReactNode;\n\tprerenderHtml?: string;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n};\n\ntype PortalEntry = {\n\tid: string;\n\tcontainer: HTMLDivElement;\n\telement: ReactNode;\n};\n\nfunction useLatest<T>(value: T) {\n\tconst ref = useRef(value);\n\tref.current = value;\n\treturn ref;\n}\n\nexport default forwardRef(function ViewerInner<T extends ModuleInputCtor>(\n\tprops: ViewerProps<T>,\n\tref: React.ForwardedRef<ViewerHandle<T>>,\n) {\n\tconst containerRef = useRef<HTMLElement | null>(null);\n\tconst viewerRef = useRef<JSONCanvasViewerInterface<T> | null>(null);\n\tconst textRef = useLatest(props.text);\n\tconst markdownRef = useLatest(props.markdown);\n\tconst imageRef = useLatest(props.image);\n\tconst videoRef = useLatest(props.video);\n\tconst audioRef = useLatest(props.audio);\n\tconst linkRef = useLatest(props.link);\n\tconst portalsByIdRef = useRef(new Map<string, PortalEntry>());\n\tconst [, forceRender] = useState(0);\n\n\tfunction upsertPortal(id: string, container: HTMLDivElement, element: ReactNode) {\n\t\tportalsByIdRef.current.set(id, { id, container, element });\n\t\tflushSync(() => forceRender((x) => x + 1));\n\t}\n\tfunction removePortalById(id: string) {\n\t\tportalsByIdRef.current.delete(id);\n\t}\n\n\tuseImperativeHandle(ref, () => ({ viewer: viewerRef.current }), []);\n\n\tconst nodeComponents = useMemo<Options['nodeComponents']>(() => {\n\t\tfunction createNodeFunc<N extends TextSlotProps | FileSlotProps | LinkSlotProps>(\n\t\t\tgetRenderFn: () => ((props: N) => ReactNode) | undefined,\n\t\t) {\n\t\t\treturn (\n\t\t\t\tcontainer: HTMLDivElement,\n\t\t\t\tcontent: string,\n\t\t\t\tnode: N['node'],\n\t\t\t\tonBeforeUnmount: Hook,\n\t\t\t\tonActive: Hook,\n\t\t\t\tonLoseActive: Hook,\n\t\t\t) => {\n\t\t\t\tconst renderFn = getRenderFn();\n\t\t\t\tif (!renderFn) return;\n\t\t\t\tupsertPortal(\n\t\t\t\t\tnode.id,\n\t\t\t\t\tcontainer,\n\t\t\t\t\trenderFn({\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tonActive,\n\t\t\t\t\t\tonLoseActive,\n\t\t\t\t\t} as N),\n\t\t\t\t);\n\t\t\t\tonBeforeUnmount.subscribe(() => {\n\t\t\t\t\tremovePortalById(node.id);\n\t\t\t\t});\n\t\t\t};\n\t\t}\n\n\t\tconst out: Options['nodeComponents'] = {};\n\t\tif (props.text) out.text = createNodeFunc<TextSlotProps>(() => textRef.current);\n\t\tif (props.markdown) out.markdown = createNodeFunc<FileSlotProps>(() => markdownRef.current);\n\t\tif (props.image) out.image = createNodeFunc<FileSlotProps>(() => imageRef.current);\n\t\tif (props.video) out.video = createNodeFunc<FileSlotProps>(() => videoRef.current);\n\t\tif (props.audio) out.audio = createNodeFunc<FileSlotProps>(() => audioRef.current);\n\t\tif (props.link) out.link = createNodeFunc<LinkSlotProps>(() => linkRef.current);\n\t\treturn out;\n\t\t// oxlint-disable-next-line eslint-plugin-react-hooks/exhaustive-deps\n\t}, [props.text, props.markdown, props.image, props.video, props.audio, props.link]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!containerRef.current) return;\n\n\t\tviewerRef.current = new JSONCanvasViewer(\n\t\t\t{\n\t\t\t\t...(props.options ?? ({} as ViewerProps<T>['options'])),\n\t\t\t\tcontainer: containerRef.current as unknown as HTMLDivElement,\n\t\t\t\ttheme: props.theme,\n\t\t\t\tcanvas: props.canvas,\n\t\t\t\tattachmentDir: props.attachmentDir,\n\t\t\t\tattachments: props.attachments,\n\t\t\t\tnodeComponents,\n\t\t\t} as Options<T>,\n\t\t\tprops.modules,\n\t\t);\n\n\t\treturn () => {\n\t\t\tviewerRef.current?.dispose();\n\t\t\tviewerRef.current = null;\n\t\t\t// oxlint-disable-next-line eslint-plugin-react-hooks/exhaustive-deps\n\t\t\tportalsByIdRef.current.clear();\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tviewerRef.current?.changeTheme(props.theme);\n\t}, [props.theme]);\n\n\tuseEffect(() => {\n\t\tviewerRef.current?.load({\n\t\t\tcanvas: props.canvas,\n\t\t\tattachmentDir: props.attachmentDir,\n\t\t\tattachments: props.attachments,\n\t\t});\n\t}, [props.canvas, props.attachmentDir, props.attachments]);\n\n\tconst portals = Array.from(portalsByIdRef.current.values()).map((p) =>\n\t\tcreatePortal(p.element, p.container, p.id),\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<section\n\t\t\t\tref={(el) => {\n\t\t\t\t\tcontainerRef.current = el;\n\t\t\t\t}}\n\t\t\t\tclassName={props.className}\n\t\t\t\tstyle={{\n\t\t\t\t\tmaxHeight: '100vh',\n\t\t\t\t\tmaxWidth: '100vw',\n\t\t\t\t\t...props.style,\n\t\t\t\t}}\n\t\t\t\tdangerouslySetInnerHTML={\n\t\t\t\t\tprops.prerenderHtml ? { __html: props.prerenderHtml } : undefined\n\t\t\t\t}\n\t\t\t\tsuppressHydrationWarning={!!props.prerenderHtml}\n\t\t\t/>\n\t\t\t{portals}\n\t\t</>\n\t);\n});\n"],"names":["process","env","NODE_ENV","getComponentNameFromType","type","$$typeof","REACT_CLIENT_REFERENCE","displayName","name","REACT_FRAGMENT_TYPE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","tag","console","error","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","Symbol","toStringTag","constructor","call","getTaskName","UnknownOwner","Error","elementRefGetterWithDeprecationWarning","componentName","this","didWarnAboutElementRef","props","ref","jsxDEVImpl","config","maybeKey","isStaticChildren","debugStack","debugTask","dispatcher","children","isArrayImpl","length","validateChildKeys","Object","freeze","hasOwnProperty","keys","filter","k","join","didWarnAboutKeySpread","getter","getOwnPropertyDescriptor","get","isReactWarning","key","hasValidKey","propName","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","defineKeyPropWarningGetter","owner","refProp","REACT_ELEMENT_TYPE","_owner","enumerable","_store","writable","ReactElement","ReactSharedInternals","A","getOwner","node","isValidElement","validated","status","object","React","require$$0","for","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","unknownOwnerDebugStack","react_stack_bottom_frame","callStackForError","bind","unknownOwnerDebugTask","reactJsxRuntime_development","Fragment","jsx","trackActualOwner","recentlyCreatedOwnerStacks","jsxs","jsxRuntimeModule","exports","jsxProd","reactJsxRuntime_production","require$$1","formatProdErrorMessage","code","url","arguments","encodeURIComponent","i","noop","Internals","d","f","r","D","C","L","m","X","S","M","p","findDOMNode","getCrossOriginStringAs","as","input","reactDom_production","__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","createPortal","container","nodeType","containerInfo","implementation","createPortal$1","flushSync","fn","previousTransition","T","previousUpdatePriority","preconnect","href","options","crossOrigin","prefetchDNS","preinit","integrity","fetchPriority","precedence","nonce","preinitModule","preload","referrerPolicy","imageSrcSet","imageSizes","media","preloadModule","requestFormReset","form","unstable_batchedUpdates","a","useFormState","action","initialState","permalink","H","useFormStatus","useHostTransitionStatus","version","getValueDescriptorExpectingObjectForWarning","thing","getValueDescriptorExpectingEnumForWarning","JSON","stringify","resolveDispatcher","__REACT_DEVTOOLS_GLOBAL_HOOK__","registerInternalModuleStart","Map","forEach","Set","clear","reactDom_development","encountered","registerInternalModuleStop","checkDCE","err","reactDomModule","useLatest","useRef","current","Viewer","forwardRef","containerRef","viewerRef","textRef","text","markdownRef","markdown","imageRef","image","videoRef","video","audioRef","audio","linkRef","link","portalsByIdRef","forceRender","useState","useImperativeHandle","viewer","nodeComponents","useMemo","createNodeFunc","getRenderFn","content","onBeforeUnmount","onActive","onLoseActive","renderFn","id","element","set","upsertPortal","subscribe","delete","out","useLayoutEffect","JSONCanvasViewer","theme","canvas","attachmentDir","attachments","modules","dispose","useEffect","changeTheme","load","portals","from","values","map","el","className","style","maxHeight","maxWidth","dangerouslySetInnerHTML","prerenderHtml","__html","suppressHydrationWarning"],"mappings":"mSAWA,eAAiBA,QAAQC,IAAIC,UAAA,WAEzB,SAASC,EAAyBC,GAChC,GAAI,MAAQA,EAAM,O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AUJ,SAAS6C,UACnBzC,EAAUJ,QAAU,KAEpBiB,EAAejB,QAAQT,UAGtB,IAEHuD,EAAU,KACT1C,EAAUJ,SAAS+C,YAAY7M,EAAMsM,QACnC,CAACtM,EAAMsM,QAEVM,EAAU,KACT1C,EAAUJ,SAASgD,KAAK,CACvBP,OAAQvM,EAAMuM,OACdC,cAAexM,EAAMwM,cACrBC,YAAazM,EAAMyM,eAElB,CAACzM,EAAMuM,OAAQvM,EAAMwM,cAAexM,EAAMyM,cAE7C,MAAMM,EAAUzJ,MAAM0J,KAAKjC,EAAejB,QAAQmD,UAAUC,IAAKvH,GAChEO,EAAAA,aAAaP,EAAEmG,QAASnG,EAAEQ,UAAWR,EAAEkG;AAGxC,OACC1H,EAAAA,KAAAJ,WAAA,CACCtD,SAAA;eAAAuD,EAAAA,IAAC,UAAA,CACA/D,IAAMkN,IACLlD,EAAaH,QAAUqD,GAExBC,UAAWpN,EAAMoN,UACjBC,MAAO,CACNC,UAAW,QACXC,SAAU,WACPvN,EAAMqN,OAEVG,wBACCxN,EAAMyN,cAAgB,CAAEC,OAAQ1N,EAAMyN,oBAAkB,EAEzDE,2BAA4B3N,EAAMyN,gBAElCV,IAGJ","x_google_ignoreList":[0,1,2,3,4,5]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@json-canvas-viewer/react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "An extensible web-based viewer for JSON Canvas in the form of a React component, easy to embed into websites.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"frontend",
|
|
7
|
+
"html-canvas",
|
|
8
|
+
"json-canvas",
|
|
9
|
+
"obsidian-md",
|
|
10
|
+
"react",
|
|
11
|
+
"react-component",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/hesprs/json-canvas-viewer",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/hesprs/json-canvas-viewer/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "Hēsperus",
|
|
21
|
+
"email": "hesprs@outlook.com"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/hesprs/json-canvas-viewer.git"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"./dist"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"main": "./dist/index.js",
|
|
33
|
+
"module": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"json-canvas-viewer": "4.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/react": "^19.2.14",
|
|
49
|
+
"@types/react-dom": "^19.2.3",
|
|
50
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
51
|
+
"@repo/shared": "0.0.1",
|
|
52
|
+
"vite-plugin-json-canvas": "1.0.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^19.2.4",
|
|
56
|
+
"react-dom": "^19.2.4"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"lint": "oxlint --type-aware --fix && oxfmt",
|
|
60
|
+
"build": "vite build",
|
|
61
|
+
"check": "tsc && oxfmt --check && oxlint --type-aware",
|
|
62
|
+
"dev": "vite"
|
|
63
|
+
}
|
|
64
|
+
}
|