@lvce-editor/virtual-dom-worker 1.2.0 → 1.3.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.
@@ -0,0 +1,6 @@
1
+ export interface VirtualDomNode {
2
+ readonly type: number
3
+ readonly [key: string]: any
4
+ }
5
+
6
+ export const text: (data: string) => VirtualDomNode
package/dist/index.js CHANGED
@@ -116,6 +116,16 @@ var Video = 61;
116
116
  var TextArea = 62;
117
117
  var Select = 63;
118
118
  var Option = 64;
119
+
120
+ // src/parts/Text/Text.ts
121
+ var text = (data) => {
122
+ return {
123
+ type: Text,
124
+ text: data,
125
+ childCount: 0
126
+ };
127
+ };
119
128
  export {
120
- VirtualDomElements_exports as VirtualDomElements
129
+ VirtualDomElements_exports as VirtualDomElements,
130
+ text
121
131
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/virtual-dom-worker",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -1 +1,2 @@
1
1
  export * as VirtualDomElements from '../VirtualDomElements/VirtualDomElements.ts'
2
+ export * from '../Text/Text.ts'
@@ -0,0 +1,10 @@
1
+ import type { VirtualDomNode } from '../VirtualDomNode/VirtualDomNode.ts'
2
+ import * as VirtualDomElements from '../VirtualDomElements/VirtualDomElements.ts'
3
+
4
+ export const text = (data: string): VirtualDomNode => {
5
+ return {
6
+ type: VirtualDomElements.Text,
7
+ text: data,
8
+ childCount: 0,
9
+ }
10
+ }
@@ -0,0 +1,4 @@
1
+ export interface VirtualDomNode {
2
+ readonly type: number
3
+ readonly [key: string]: any
4
+ }