@kubb/react-fabric 0.3.1 → 0.4.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/dist/{Fabric-D1uNzkRd.d.cts → Fabric-DECM64S6.d.cts} +1 -1
- package/dist/{Fabric-OfeFgFB2.d.ts → Fabric-DGhsnD3H.d.ts} +1 -4
- package/dist/{chunk-CUT6urMc.cjs → chunk-DWy1uDak.cjs} +9 -0
- package/dist/chunk-OzOGZVnI.js +38 -0
- package/dist/{devtools-BajE-eCd.cjs → devtools-Bu3zlaPp.cjs} +2 -2
- package/dist/{devtools-BajE-eCd.cjs.map → devtools-Bu3zlaPp.cjs.map} +1 -1
- package/dist/{devtools-wdFpV122.js → devtools-D6dZodXp.js} +1 -1
- package/dist/{devtools-wdFpV122.js.map → devtools-D6dZodXp.js.map} +1 -1
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +1 -1
- package/dist/globals.d.cts +2 -2
- package/dist/globals.d.ts +2 -2
- package/dist/index.cjs +80 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +27 -16
- package/dist/index.js +71 -57
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime-CB2e_LA2.js +1352 -0
- package/dist/jsx-dev-runtime-CB2e_LA2.js.map +1 -0
- package/dist/jsx-dev-runtime-CB3pf-1W.cjs +1363 -0
- package/dist/jsx-dev-runtime-CB3pf-1W.cjs.map +1 -0
- package/dist/jsx-dev-runtime.cjs +9 -5
- package/dist/jsx-dev-runtime.cjs.map +1 -0
- package/dist/jsx-dev-runtime.d.cts +3 -3
- package/dist/jsx-dev-runtime.d.ts +3 -3
- package/dist/jsx-dev-runtime.js +9 -2
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/{jsx-namespace-kapEWb5o.d.cts → jsx-namespace-C5bbnidQ.d.cts} +2 -2
- package/dist/{jsx-namespace-BEUVmgyn.d.ts → jsx-namespace-eskZDKHk.d.ts} +2 -2
- package/dist/jsx-runtime-5qOQhPPb.js +252 -0
- package/dist/jsx-runtime-5qOQhPPb.js.map +1 -0
- package/dist/jsx-runtime-cOHyKGzA.cjs +263 -0
- package/dist/jsx-runtime-cOHyKGzA.cjs.map +1 -0
- package/dist/jsx-runtime.cjs +6 -8
- package/dist/jsx-runtime.d.cts +3 -3
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/jsx-runtime.js +6 -1
- package/dist/parsers.d.cts +1 -1
- package/dist/parsers.d.ts +1 -1
- package/dist/plugins.cjs +3 -2
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.js +3 -2
- package/dist/reactPlugin-BWBCDdIm.js +15598 -0
- package/dist/reactPlugin-BWBCDdIm.js.map +1 -0
- package/dist/{reactPlugin-DVGn6gSn.d.ts → reactPlugin-DAOLEVg9.d.ts} +2 -2
- package/dist/reactPlugin-DCT6yE8D.cjs +15640 -0
- package/dist/reactPlugin-DCT6yE8D.cjs.map +1 -0
- package/dist/{reactPlugin-heqDYGKi.d.cts → reactPlugin-DkhxnXP_.d.cts} +2 -2
- package/dist/{types-zrCju594.d.cts → types-C2T-S5lY.d.cts} +2 -2
- package/dist/{types-34ycUiHt.d.ts → types-rKVyNQC0.d.ts} +2 -2
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +5 -5
- package/src/index.ts +12 -2
- package/dist/jsx-runtime-BhbaU98p.cjs +0 -2
- package/dist/jsx-runtime-Dm0btT2y.js +0 -4
- package/dist/reactPlugin-B7zzvM5n.js +0 -625
- package/dist/reactPlugin-B7zzvM5n.js.map +0 -1
- package/dist/reactPlugin-B9OmXm5F.cjs +0 -669
- package/dist/reactPlugin-B9OmXm5F.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactPlugin-B9OmXm5F.cjs","names":["Component","onExit","node: TextNode","NoEventPriority","DefaultEventPriority","exports","text","collected: Array<KubbFile.File>","process","ConcurrentRoot"],"sources":["../src/components/Root.tsx","../src/dom.ts","../src/Renderer.ts","../src/utils/squashExportNodes.ts","../src/utils/squashImportNodes.ts","../src/utils/squashTextNodes.ts","../src/utils/squashSourceNodes.ts","../src/utils/processFiles.ts","../src/Runtime.tsx","../src/plugins/reactPlugin.ts"],"sourcesContent":["import { Component, createContext } from 'react'\n\nimport type { KubbNode } from '../types.ts'\n\ntype ErrorBoundaryProps = {\n onError: (error: Error) => void\n children?: KubbNode\n}\n\nclass ErrorBoundary extends Component<{\n onError: ErrorBoundaryProps['onError']\n children?: KubbNode\n}> {\n state = { hasError: false }\n\n static displayName = 'KubbErrorBoundary'\n static getDerivedStateFromError(_error: Error) {\n return { hasError: true }\n }\n\n componentDidCatch(error: Error) {\n if (error) {\n this.props.onError(error)\n }\n }\n\n render() {\n if (this.state.hasError) {\n return null\n }\n return this.props.children\n }\n}\n\nexport type RootContextProps = {\n /**\n * Exit (unmount) the whole Ink app.\n */\n readonly exit: (error?: Error) => void\n}\n\nexport const RootContext = createContext<RootContextProps>({\n exit: () => {},\n})\n\ntype RootProps = {\n /**\n * Exit (unmount) hook\n */\n readonly onExit: (error?: Error) => void\n /**\n * Error hook\n */\n readonly onError: (error: Error) => void\n readonly children?: KubbNode\n}\n\nexport function Root({ onError, onExit, children }: RootProps) {\n try {\n return (\n <ErrorBoundary\n onError={(error) => {\n onError(error)\n }}\n >\n <RootContext.Provider value={{ exit: onExit }}>{children}</RootContext.Provider>\n </ErrorBoundary>\n )\n } catch (_e) {\n return null\n }\n}\n\nRoot.Context = RootContext\nRoot.displayName = 'KubbRoot'\n","import type { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, TextNode } from './types.ts'\n\nexport const createNode = (nodeName: string): DOMElement => {\n const node: DOMElement = {\n nodeName: nodeName as DOMElement['nodeName'],\n attributes: new Map(),\n childNodes: [],\n parentNode: undefined,\n }\n\n return node\n}\n\nexport const appendChildNode = (node: DOMNode, childNode: DOMElement | DOMNode): void => {\n if (childNode.parentNode) {\n removeChildNode(childNode.parentNode, childNode)\n }\n\n if (node.nodeName !== '#text') {\n childNode.parentNode = node\n node.childNodes.push(childNode)\n }\n}\n\nexport const insertBeforeNode = (node: DOMElement, newChildNode: DOMNode, beforeChildNode: DOMNode): void => {\n if (newChildNode.parentNode) {\n removeChildNode(newChildNode.parentNode, newChildNode)\n }\n\n newChildNode.parentNode = node\n\n const index = node.childNodes.indexOf(beforeChildNode)\n if (index >= 0) {\n node.childNodes.splice(index, 0, newChildNode)\n\n return\n }\n\n node.childNodes.push(newChildNode)\n}\n\nexport const removeChildNode = (node: DOMElement, removeNode: DOMNode): void => {\n removeNode.parentNode = undefined\n\n const index = node.childNodes.indexOf(removeNode)\n if (index >= 0) {\n node.childNodes.splice(index, 1)\n }\n}\n\nexport const setAttribute = (node: DOMElement, key: string, value: DOMNodeAttribute): void => {\n node.attributes.set(key, value)\n}\n\nexport const createTextNode = (text: string): TextNode => {\n const node: TextNode = {\n nodeName: '#text',\n nodeValue: text,\n parentNode: undefined,\n }\n\n setTextNodeValue(node, text)\n\n return node\n}\n\nexport const setTextNodeValue = (node: TextNode, text: string): void => {\n if (typeof text !== 'string') {\n text = String(text)\n }\n\n node.nodeValue = text\n}\n\nexport const nodeNames = new Set<ElementNames>(['kubb-export', 'kubb-file', 'kubb-source', 'kubb-import', 'kubb-text', 'kubb-root', 'kubb-app', 'br'])\n","import { createContext } from 'react'\nimport Reconciler, { type ReactContext } from 'react-reconciler'\nimport { DefaultEventPriority, NoEventPriority } from 'react-reconciler/constants.js'\nimport { appendChildNode, createNode, createTextNode, insertBeforeNode, removeChildNode, setAttribute, setTextNodeValue } from './dom.ts'\nimport type { KubbNode } from './types'\nimport type { DOMElement, DOMNodeAttribute, ElementNames, TextNode } from './types.ts'\n\ndeclare module 'react-reconciler' {\n // @ts-expect-error custom override\n interface Reconciler {\n updateContainerSync(element: KubbNode, container: unknown, parentComponent: any, callback?: null | (() => void)): void\n flushSyncWork(): void\n createContainer(\n containerInfo: unknown,\n tag: Reconciler.RootTag,\n hydrationCallbacks: null | Reconciler.SuspenseHydrationCallbacks<any>,\n isStrictMode: boolean,\n concurrentUpdatesByDefaultOverride: null | boolean,\n identifierPrefix: string,\n onUncaughtError: (error: Error) => void,\n onCaughtError: (error: Error) => void,\n onRecoverableError: (error: Error) => void,\n transitionCallbacks: null | Reconciler.TransitionTracingCallbacks,\n ): Reconciler.OpaqueRoot\n }\n}\n\ntype Props = Record<string, unknown>\n\ntype HostContext = {\n type: ElementNames\n isFile: boolean\n isSource: boolean\n}\n\nlet currentUpdatePriority = NoEventPriority\n\n/**\n * @link https://www.npmjs.com/package/react-devtools-inline\n * @link https://github.com/nitin42/Making-a-custom-React-renderer/blob/master/part-one.md\n * @link https://github.com/facebook/react/tree/main/packages/react-reconciler#practical-examples\n * @link https://github.com/vadimdemedes/ink\n * @link https://github.com/pixijs/pixi-react/tree/main/packages\n * @link https://github.com/diegomura/react-pdf/blob/master/packages/reconciler/src/reconciler-31.ts\n */\nexport const Renderer = Reconciler({\n getRootHostContext: () => ({\n type: 'kubb-root',\n isFile: false,\n isSource: false,\n }),\n prepareForCommit: () => {\n return null\n },\n preparePortalMount: () => null,\n clearContainer: () => false,\n resetAfterCommit(rootNode: DOMElement) {\n if (typeof rootNode.onRender === 'function') {\n rootNode.onRender()\n }\n },\n getChildHostContext(parentHostContext: HostContext, type: ElementNames) {\n const isInsideText = type === 'kubb-text'\n const isFile = type === 'kubb-file' || parentHostContext.isFile\n const isSource = type === 'kubb-source' || parentHostContext.isSource\n\n return { isInsideText, isFile, isSource, type }\n },\n shouldSetTextContent: () => false,\n createInstance(originalType: ElementNames, newProps: Props, _root: DOMElement) {\n const node = createNode(originalType)\n\n for (const [key, value] of Object.entries(newProps)) {\n if (key === 'children') {\n continue\n }\n\n setAttribute(node, key, value as DOMNodeAttribute)\n }\n\n return node\n },\n createTextInstance(text: string, _root: DOMElement, hostContext: HostContext) {\n if (hostContext.isFile && !hostContext.isSource) {\n throw new Error(`[react] '${text}' should be part of <File.Source> component when using the <File/> component`)\n }\n\n return createTextNode(text)\n },\n resetTextContent() {},\n hideTextInstance(node: TextNode) {\n setTextNodeValue(node, '')\n },\n unhideTextInstance(node: TextNode, text: string) {\n setTextNodeValue(node, text)\n },\n getPublicInstance: (instance) => instance,\n appendInitialChild: appendChildNode,\n appendChild: appendChildNode,\n insertBefore: insertBeforeNode,\n finalizeInitialChildren(_node, _type, _props, _rootNode) {\n return false\n },\n supportsMutation: true,\n isPrimaryRenderer: true,\n supportsPersistence: false,\n supportsHydration: false,\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n beforeActiveInstanceBlur() {},\n afterActiveInstanceBlur() {},\n detachDeletedInstance() {},\n getInstanceFromNode: () => null,\n prepareScopeUpdate() {},\n getInstanceFromScope: () => null,\n appendChildToContainer: appendChildNode,\n insertInContainerBefore: insertBeforeNode,\n removeChildFromContainer(node: DOMElement, removeNode: TextNode) {\n removeChildNode(node, removeNode)\n },\n commitMount() {},\n commitUpdate(node: DOMElement, _payload, _type, _oldProps: Props, newProps: Props) {\n const { props } = newProps\n\n if (props) {\n for (const [key, value] of Object.entries(props)) {\n setAttribute(node, key, value as DOMNodeAttribute)\n }\n }\n },\n commitTextUpdate(node: TextNode, _oldText, newText) {\n setTextNodeValue(node, newText)\n },\n removeChild(node: DOMElement, removeNode: TextNode) {\n removeChildNode(node, removeNode)\n },\n setCurrentUpdatePriority: (newPriority: number) => {\n currentUpdatePriority = newPriority\n },\n getCurrentUpdatePriority: () => currentUpdatePriority,\n resolveUpdatePriority() {\n if (currentUpdatePriority !== NoEventPriority) {\n return currentUpdatePriority\n }\n\n return DefaultEventPriority\n },\n maySuspendCommit() {\n return false\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NotPendingTransition: undefined,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HostTransitionContext: createContext(null) as unknown as ReactContext<unknown>,\n resetFormInstance() {},\n requestPostPaintCallback() {},\n shouldAttemptEagerTransition() {\n return false\n },\n trackSchedulerEvent() {},\n resolveEventType() {\n return null\n },\n resolveEventTimeStamp() {\n return -1.1\n },\n preloadInstance() {\n return true\n },\n startSuspendingCommit() {},\n suspendInstance() {},\n waitForCommitToBeReady() {\n return null\n },\n})\n\nexport type { FiberRoot } from 'react-reconciler'\n","import type { KubbFile } from '@kubb/fabric-core/types'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement } from '../types.ts'\n\nexport function squashExportNodes(node: DOMElement): Set<KubbFile.ResolvedExport> {\n const exports = new Set<KubbFile.ResolvedExport>()\n\n const walk = (current: DOMElement): void => {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && nodeNames.has(child.nodeName)) {\n walk(child)\n }\n\n if (child.nodeName === 'kubb-export') {\n exports.add({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n isTypeOnly: child.attributes.get('isTypeOnly') ?? false,\n asAlias: child.attributes.get('asAlias') ?? false,\n } as KubbFile.Export)\n }\n }\n }\n\n walk(node)\n return exports\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement } from '../types.ts'\n\nexport function squashImportNodes(node: DOMElement): Set<KubbFile.Import> {\n const imports = new Set<KubbFile.Import>()\n\n const walk = (current: DOMElement): void => {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && nodeNames.has(child.nodeName)) {\n walk(child)\n }\n\n if (child.nodeName === 'kubb-import') {\n imports.add({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n root: child.attributes.get('root'),\n isTypeOnly: child.attributes.get('isTypeOnly') ?? false,\n isNameSpace: child.attributes.get('isNameSpace') ?? false,\n } as KubbFile.Import)\n }\n }\n }\n\n walk(node)\n return imports\n}\n","import { createExport, createImport, print } from '@kubb/fabric-core/parsers/typescript'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement, KubbFile } from '../types.ts'\n\nexport function squashTextNodes(node: DOMElement): string {\n let text = ''\n\n const walk = (current: DOMElement): string => {\n let content = ''\n\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n let nodeText = ''\n\n const getPrintText = (text: string): string => {\n switch (child.nodeName) {\n case 'kubb-import': {\n return print(\n createImport({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n root: child.attributes.get('root'),\n isTypeOnly: child.attributes.get('isTypeOnly'),\n isNameSpace: child.attributes.get('isNameSpace'),\n } as KubbFile.Import),\n )\n }\n case 'kubb-export': {\n if (child.attributes.has('path')) {\n return print(\n createExport({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n isTypeOnly: child.attributes.get('isTypeOnly'),\n asAlias: child.attributes.get('asAlias'),\n } as KubbFile.Export),\n )\n }\n return ''\n }\n case 'kubb-source':\n return text\n default:\n return text\n }\n }\n\n if (child.nodeName === '#text') {\n nodeText = child.nodeValue\n } else {\n if (child.nodeName === 'kubb-text' || child.nodeName === 'kubb-file' || child.nodeName === 'kubb-source') {\n nodeText = walk(child)\n }\n\n nodeText = getPrintText(nodeText)\n\n if (child.nodeName === 'br') {\n nodeText = '\\n'\n }\n\n if (!nodeNames.has(child.nodeName)) {\n const attributes = child.attributes\n let attrString = ''\n const hasAttributes = attributes.size > 0\n\n for (const [key, value] of attributes) {\n attrString += typeof value === 'string' ? ` ${key}=\"${value}\"` : ` ${key}={${String(value)}}`\n }\n\n if (hasAttributes) {\n nodeText = `<${child.nodeName}${attrString}>${walk(child)}</${child.nodeName}>`\n } else {\n nodeText = `<${child.nodeName}>${walk(child)}</${child.nodeName}>`\n }\n }\n }\n\n content += nodeText\n }\n\n return content\n }\n\n text = walk(node)\n\n return text\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement, ElementNames } from '../types.ts'\nimport { squashTextNodes } from './squashTextNodes.ts'\n\nexport function squashSourceNodes(node: DOMElement, ignores: Array<ElementNames>): Set<KubbFile.Source> {\n const ignoreSet = new Set(ignores)\n const sources = new Set<KubbFile.Source>()\n\n const walk = (current: DOMElement): void => {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && ignoreSet.has(child.nodeName)) {\n continue\n }\n\n if (child.nodeName === 'kubb-source') {\n const value = squashTextNodes(child)\n\n sources.add({\n name: child.attributes.get('name'),\n isTypeOnly: child.attributes.get('isTypeOnly') ?? false,\n isExportable: child.attributes.get('isExportable') ?? false,\n isIndexable: child.attributes.get('isIndexable') ?? false,\n // trim whitespace/newlines\n value: value.trim().replace(/^\\s+|\\s+$/g, ''),\n } as KubbFile.Source)\n continue\n }\n\n if (child.nodeName !== '#text' && nodeNames.has(child.nodeName)) {\n walk(child)\n }\n }\n }\n\n walk(node)\n return sources\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement } from '../types.ts'\nimport { squashExportNodes } from './squashExportNodes.ts'\nimport { squashImportNodes } from './squashImportNodes.ts'\nimport { squashSourceNodes } from './squashSourceNodes.ts'\n\nexport async function processFiles(node: DOMElement): Promise<Array<KubbFile.File>> {\n const collected: Array<KubbFile.File> = []\n\n async function walk(current: DOMElement) {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && child.nodeName !== 'kubb-file' && nodeNames.has(child.nodeName)) {\n await walk(child)\n }\n\n if (child.nodeName === 'kubb-file') {\n if (child.attributes.has('baseName') && child.attributes.has('path')) {\n const sources = squashSourceNodes(child, ['kubb-export', 'kubb-import'])\n\n collected.push({\n baseName: child.attributes.get('baseName'),\n path: child.attributes.get('path'),\n meta: child.attributes.get('meta') || {},\n footer: child.attributes.get('footer'),\n banner: child.attributes.get('banner'),\n sources: [...sources],\n exports: [...squashExportNodes(child)],\n imports: [...squashImportNodes(child)],\n } as KubbFile.File)\n }\n }\n }\n }\n\n await walk(node)\n\n return collected\n}\n","import process from 'node:process'\nimport type { FileManager } from '@kubb/fabric-core'\nimport type { ReactNode } from 'react'\nimport { ConcurrentRoot } from 'react-reconciler/constants.js'\nimport { onExit } from 'signal-exit'\nimport { Root } from './components/Root.tsx'\nimport { createNode } from './dom.ts'\nimport type { FiberRoot } from './Renderer.ts'\nimport { Renderer } from './Renderer.ts'\nimport type { DOMElement } from './types.ts'\nimport { processFiles } from './utils/processFiles.ts'\nimport { squashTextNodes } from './utils/squashTextNodes.ts'\n\ntype Options = {\n fileManager: FileManager\n stdout?: NodeJS.WriteStream\n stdin?: NodeJS.ReadStream\n stderr?: NodeJS.WriteStream\n /**\n * Set this to true to always see the result of the render in the console(line per render)\n */\n debug?: boolean\n}\n\nexport class Runtime {\n readonly #options: Options\n #isUnmounted: boolean\n\n exitPromise?: Promise<void>\n readonly #container: FiberRoot\n readonly #rootNode: DOMElement\n\n constructor(options: Options) {\n this.#options = options\n this.#rootNode = createNode('kubb-root')\n this.#rootNode.onRender = this.onRender\n this.#rootNode.onImmediateRender = this.onRender\n this.#isUnmounted = false\n this.unmount.bind(this)\n\n // Intercept noisy React errors\n const originalError = console.error\n console.error = (data: string | Error) => {\n const message = typeof data === 'string' ? data : data?.message\n if (\n message?.match(/Encountered two children with the same key/gi) ||\n message?.match(/React will try to recreat/gi) ||\n message?.match(/Each child in a list should have a unique/gi) ||\n message?.match(/The above error occurred in the <KubbErrorBoundary/gi) ||\n message?.match(/A React Element from an older version of React was render/gi)\n ) {\n return\n }\n originalError(data)\n }\n\n const logRecoverableError = typeof reportError === 'function' ? reportError : console.error\n\n const rootTag = ConcurrentRoot\n this.#container = Renderer.createContainer(\n this.#rootNode,\n rootTag,\n null,\n false,\n false,\n 'id',\n logRecoverableError,\n logRecoverableError,\n logRecoverableError,\n null,\n )\n\n // Unmount when process exits\n this.unsubscribeExit = onExit(\n (code) => {\n this.unmount(code)\n },\n { alwaysLast: false },\n ).bind(this)\n\n Renderer.injectIntoDevTools({\n bundleType: 1,\n version: '19.1.0',\n rendererPackageName: 'kubb',\n })\n }\n\n get fileManager() {\n return this.#options.fileManager\n }\n\n #renderPromise: Promise<void> = Promise.resolve()\n resolveExitPromise: () => void = () => {}\n rejectExitPromise: (reason?: Error) => void = () => {}\n unsubscribeExit: () => void = () => {}\n\n onRender: () => Promise<void> = () => {\n const previous = this.#renderPromise\n\n const task = previous\n .catch(() => {})\n .then(async () => {\n if (this.#isUnmounted) {\n return\n }\n\n const files = await processFiles(this.#rootNode)\n\n await this.fileManager.add(...files)\n\n if (!this.#options?.debug && !this.#options?.stdout) {\n return\n }\n\n const output = await this.#getOutput(this.#rootNode)\n\n if (this.#options?.debug) {\n console.log('Rendering:\\n')\n console.log(output)\n }\n\n if (this.#options?.stdout && process.env.NODE_ENV !== 'test') {\n this.#options.stdout.clearLine(0)\n this.#options.stdout.cursorTo(0)\n this.#options.stdout.write(output)\n }\n })\n\n this.#renderPromise = task.catch((error) => {\n this.onError(error as Error)\n throw error\n })\n\n return this.#renderPromise\n }\n\n onError(error: Error): void {\n if (process.env.NODE_ENV === 'test') {\n console.warn(error)\n }\n\n throw error\n }\n\n onExit(error?: Error): void {\n this.unmount(error)\n }\n\n async #getOutput(node: DOMElement): Promise<string> {\n const text = squashTextNodes(node)\n const files = this.fileManager.files\n\n if (!files.length) {\n return text\n }\n\n const values = new Set<string>()\n for (const file of files) {\n for (const source of file.sources) {\n if (source?.value) {\n values.add(source.value)\n }\n }\n }\n\n return [...values].join('\\n\\n')\n }\n\n async render(node: ReactNode): Promise<void> {\n const element = (\n <Root onExit={this.onExit.bind(this)} onError={this.onError.bind(this)}>\n {node}\n </Root>\n )\n\n Renderer.updateContainerSync(element, this.#container, null, null)\n Renderer.flushSyncWork()\n await this.#renderPromise\n }\n\n async renderToString(node: ReactNode): Promise<string> {\n const element = (\n <Root onExit={this.onExit.bind(this)} onError={this.onError.bind(this)}>\n {node}\n </Root>\n )\n\n Renderer.updateContainerSync(element, this.#container, null, null)\n Renderer.flushSyncWork()\n\n await this.#renderPromise\n this.fileManager.clear()\n\n return this.#getOutput(this.#rootNode)\n }\n\n unmount(error?: Error | number | null): void {\n if (this.#isUnmounted) {\n return\n }\n\n if (this.#options?.debug) {\n console.log('Unmount', error)\n }\n\n this.onRender()\n this.unsubscribeExit()\n\n this.#isUnmounted = true\n\n Renderer.updateContainerSync(null, this.#container, null, null)\n\n if (error instanceof Error) {\n this.rejectExitPromise(error)\n return\n }\n\n this.resolveExitPromise()\n }\n\n async waitUntilExit(): Promise<void> {\n if (!this.exitPromise) {\n this.exitPromise = new Promise((resolve, reject) => {\n this.resolveExitPromise = resolve\n this.rejectExitPromise = reject\n })\n }\n\n return this.exitPromise\n }\n}\n","import { createPlugin } from '@kubb/fabric-core/plugins'\nimport { createElement, type ElementType } from 'react'\nimport { Runtime } from '../Runtime.tsx'\n\nexport type Options = {\n stdout?: NodeJS.WriteStream\n stdin?: NodeJS.ReadStream\n stderr?: NodeJS.WriteStream\n /**\n * Set this to true to always see the result of the render in the console(line per render)\n */\n debug?: boolean\n}\n\ntype ExtendOptions = {\n render(App: ElementType): Promise<void>\n renderToString(App: ElementType): Promise<string>\n waitUntilExit(): Promise<void>\n}\n\ndeclare global {\n namespace Kubb {\n interface Fabric {\n render(App: ElementType): Promise<void>\n renderToString(App: ElementType): Promise<string>\n waitUntilExit(): Promise<void>\n }\n }\n}\n\nexport const reactPlugin = createPlugin<Options, ExtendOptions>({\n name: 'react',\n install() {},\n inject(ctx, options = {}) {\n const runtime = new Runtime({ fileManager: ctx.fileManager, ...options })\n\n return {\n async render(App) {\n await runtime.render(createElement(App))\n await ctx.emit('start')\n },\n async renderToString(App) {\n await ctx.emit('start')\n return runtime.renderToString(createElement(App))\n },\n async waitUntilExit() {\n await runtime.waitUntilExit()\n\n await ctx.emit('end')\n },\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAM,gBAAN,cAA4BA,gBAGzB;;;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