@lvce-editor/virtual-dom-worker 1.20.0 → 1.22.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/index.d.ts CHANGED
@@ -7,6 +7,10 @@ export const text: (data: string) => VirtualDomNode
7
7
 
8
8
  export const mergeClassNames: (...classNames: readonly string[]) => string
9
9
 
10
+ export const px: (value: number) => string
11
+
12
+ export const position: (x: number, y: number) => string
13
+
10
14
  export interface Patch {}
11
15
 
12
16
  export const diff: (
@@ -20,3 +24,7 @@ export interface DomEventListener {
20
24
  readonly preventDefault?: boolean
21
25
  readonly passive?: boolean
22
26
  }
27
+
28
+ export interface VirtualDomElements {
29
+ readonly [key: number]: number
30
+ }
package/dist/index.js CHANGED
@@ -339,4 +339,11 @@ const diff = (oldNodes, newNodes) => {
339
339
  return patches;
340
340
  };
341
341
 
342
- export { VirtualDomElements, diff, mergeClassNames, text };
342
+ const px = value => {
343
+ return `${value}px`;
344
+ };
345
+ const position = (x, y) => {
346
+ return `${x}px ${y}px`;
347
+ };
348
+
349
+ export { VirtualDomElements, diff, mergeClassNames, position, px, text };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/virtual-dom-worker",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -3,3 +3,4 @@ export * from '../MergeClassNames/MergeClassNames.ts'
3
3
  export * from '../Text/Text.ts'
4
4
  export { diff } from '../VirtualDomDiff/VirtualDomDiff.ts'
5
5
  export * as VirtualDomElements from '../VirtualDomElements/VirtualDomElements.ts'
6
+ export * from '../Px/Px.ts'
@@ -0,0 +1,7 @@
1
+ export const px = (value: number): string => {
2
+ return `${value}px`
3
+ }
4
+
5
+ export const position = (x: number, y: number): string => {
6
+ return `${x}px ${y}px`
7
+ }