@nordcraft/runtime 1.0.58 → 1.0.60
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/components/createElement.js +1 -1
- package/dist/components/createElement.js.map +1 -1
- package/dist/components/createNode.js.map +1 -1
- package/dist/custom-element.main.esm.js +19 -19
- package/dist/custom-element.main.esm.js.map +3 -3
- package/dist/editor/input.d.ts +1 -0
- package/dist/editor/input.js +16 -0
- package/dist/editor/input.js.map +1 -0
- package/dist/editor/links.d.ts +6 -0
- package/dist/editor/links.js +15 -0
- package/dist/editor/links.js.map +1 -0
- package/dist/editor/overlay.d.ts +12 -0
- package/dist/editor/overlay.js +20 -0
- package/dist/editor/overlay.js.map +1 -0
- package/dist/editor/types.d.ts +254 -0
- package/dist/editor/types.js +42 -0
- package/dist/editor/types.js.map +1 -0
- package/dist/editor-preview.main.js +203 -291
- package/dist/editor-preview.main.js.map +1 -1
- package/dist/page.main.esm.js +2 -2
- package/dist/page.main.esm.js.map +3 -3
- package/dist/styles/CustomPropertyStyleSheet.test.js +12 -3
- package/dist/styles/CustomPropertyStyleSheet.test.js.map +1 -1
- package/package.json +4 -4
- package/src/components/createElement.ts +1 -1
- package/src/components/createNode.ts +0 -1
- package/src/editor/input.ts +17 -0
- package/src/editor/links.ts +16 -0
- package/src/editor/overlay.ts +21 -0
- package/src/editor/types.ts +271 -0
- package/src/editor-preview.main.ts +220 -498
- package/src/styles/CustomPropertyStyleSheet.test.ts +12 -3
- package/src/editor/types.d.ts +0 -36
|
@@ -50,7 +50,10 @@ describe('CustomPropertyStyleSheet', () => {
|
|
|
50
50
|
})('256px')
|
|
51
51
|
expect(instance.getStyleSheet().cssRules.length).toBe(1)
|
|
52
52
|
expect(instance.getStyleSheet().cssRules[0].cssText).toBe(
|
|
53
|
-
|
|
53
|
+
`\
|
|
54
|
+
@media (max-width: 600px) {
|
|
55
|
+
.my-class { --my-property: 256px; }
|
|
56
|
+
}`,
|
|
54
57
|
)
|
|
55
58
|
})
|
|
56
59
|
|
|
@@ -87,7 +90,10 @@ describe('CustomPropertyStyleSheet', () => {
|
|
|
87
90
|
setter('256px')
|
|
88
91
|
expect(instance.getStyleSheet().cssRules.length).toBe(1)
|
|
89
92
|
expect(instance.getStyleSheet().cssRules[0].cssText).toBe(
|
|
90
|
-
|
|
93
|
+
`\
|
|
94
|
+
@media (max-width: 600px) {
|
|
95
|
+
.my-class-with-media { --my-property-with-media: 256px; }
|
|
96
|
+
}`,
|
|
91
97
|
)
|
|
92
98
|
|
|
93
99
|
instance.unregisterProperty(
|
|
@@ -98,7 +104,10 @@ describe('CustomPropertyStyleSheet', () => {
|
|
|
98
104
|
},
|
|
99
105
|
)
|
|
100
106
|
expect(instance.getStyleSheet().cssRules[0].cssText).toBe(
|
|
101
|
-
|
|
107
|
+
`\
|
|
108
|
+
@media (max-width: 600px) {
|
|
109
|
+
.my-class-with-media { }
|
|
110
|
+
}`,
|
|
102
111
|
)
|
|
103
112
|
})
|
|
104
113
|
})
|
package/src/editor/types.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type DragState = {
|
|
2
|
-
/**
|
|
3
|
-
* Dragging elements within the initial container is a reorder operation while dragging elements outside the initial container is an insert operation.
|
|
4
|
-
* While they share some common properties, we need to differentiate between the two to handle them differently.
|
|
5
|
-
*/
|
|
6
|
-
mode: 'reorder' | 'insert'
|
|
7
|
-
elementType: 'element' | 'component' | 'text'
|
|
8
|
-
copy?: HTMLElement
|
|
9
|
-
element: HTMLElement
|
|
10
|
-
repeatedNodes: HTMLElement[]
|
|
11
|
-
offset: Point
|
|
12
|
-
lastCursorPosition: Point
|
|
13
|
-
initialContainer: HTMLElement
|
|
14
|
-
initialNextSibling: Element | null
|
|
15
|
-
initialRect: DOMRect
|
|
16
|
-
reorderPermutations: Array<{
|
|
17
|
-
nextSibling: Node | null
|
|
18
|
-
rect: DOMRect
|
|
19
|
-
}>
|
|
20
|
-
isTransitioning: boolean
|
|
21
|
-
selectedInsertAreaIndex?: number
|
|
22
|
-
insertAreas?: Array<InsertArea>
|
|
23
|
-
destroying: boolean
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type InsertArea = {
|
|
27
|
-
layout: 'block' | 'inline'
|
|
28
|
-
parent: Element
|
|
29
|
-
index: number
|
|
30
|
-
center: Point
|
|
31
|
-
size: number
|
|
32
|
-
direction: 1 | -1
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type Point = { x: number; y: number }
|
|
36
|
-
export type Line = { x1: number; y1: number; x2: number; y2: number }
|