@kubb/react-fabric 0.1.1 → 0.1.3
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/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +156 -35
- package/dist/index.d.ts +156 -35
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/ReactTemplate.tsx +3 -3
- package/src/createApp.ts +3 -3
- package/src/utils/processFiles.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/react-fabric",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "React integration for Kubb, providing JSX runtime support and React component generation capabilities for code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"react-reconciler": "0.32.0",
|
|
86
86
|
"signal-exit": "^4.1.0",
|
|
87
87
|
"ws": "^8.18.3",
|
|
88
|
-
"@kubb/fabric-core": "0.1.
|
|
88
|
+
"@kubb/fabric-core": "0.1.3"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@types/react": "^19.2.2",
|
package/src/ReactTemplate.tsx
CHANGED
|
@@ -120,7 +120,7 @@ export class ReactTemplate {
|
|
|
120
120
|
return
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
this.#context.clear()
|
|
123
|
+
this.#context.fileManager.clear()
|
|
124
124
|
|
|
125
125
|
processFiles(this.#rootNode, this.#context)
|
|
126
126
|
|
|
@@ -154,7 +154,7 @@ export class ReactTemplate {
|
|
|
154
154
|
|
|
155
155
|
async #getOutput(node: DOMElement, context: AppContext): Promise<string> {
|
|
156
156
|
const text = squashTextNodes(node)
|
|
157
|
-
const files = context.files
|
|
157
|
+
const files = context.fileManager.files
|
|
158
158
|
|
|
159
159
|
return files.length
|
|
160
160
|
? [...files]
|
|
@@ -185,7 +185,7 @@ export class ReactTemplate {
|
|
|
185
185
|
KubbRenderer.updateContainerSync(element, this.#container, null, null)
|
|
186
186
|
KubbRenderer.flushSyncWork()
|
|
187
187
|
|
|
188
|
-
this.#context.clear()
|
|
188
|
+
this.#context.fileManager.clear()
|
|
189
189
|
|
|
190
190
|
return this.#getOutput(this.#rootNode, this.#context)
|
|
191
191
|
}
|
package/src/createApp.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { defineApp } from '@kubb/fabric-core'
|
|
|
2
2
|
import { type ElementType, createElement } from 'react'
|
|
3
3
|
import { type ReactAppContext, ReactTemplate } from './ReactTemplate.tsx'
|
|
4
4
|
|
|
5
|
-
export const createApp = defineApp<ElementType, ReactAppContext>((
|
|
5
|
+
export const createApp = defineApp<ElementType, ReactAppContext>((App, context) => {
|
|
6
6
|
const template = new ReactTemplate(context)
|
|
7
7
|
|
|
8
8
|
return {
|
|
9
9
|
render() {
|
|
10
|
-
template.render(createElement(
|
|
10
|
+
template.render(createElement(App))
|
|
11
11
|
},
|
|
12
12
|
async renderToString() {
|
|
13
|
-
return template.renderToString(createElement(
|
|
13
|
+
return template.renderToString(createElement(App))
|
|
14
14
|
},
|
|
15
15
|
waitUntilExit() {
|
|
16
16
|
return template.waitUntilExit()
|