vsn 0.1.120 → 0.1.122
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/demo/demo.html +0 -33
- package/demo/examples/component-slots.html +5 -1
- package/demo/named-stack.html +34 -0
- package/demo/silly-animations.html +39 -0
- package/demo/vsn.js +2 -2
- package/dist/AST/{ArithmeticAssignmentNode.d.ts → AssignmentNode.d.ts} +2 -2
- package/dist/AST/{ArithmeticAssignmentNode.js → AssignmentNode.js} +21 -18
- package/dist/AST/AssignmentNode.js.map +1 -0
- package/dist/AST/ElementStyleNode.js +9 -7
- package/dist/AST/ElementStyleNode.js.map +1 -1
- package/dist/AST/ModifierNode.js +3 -1
- package/dist/AST/ModifierNode.js.map +1 -1
- package/dist/AST/NamedStackNode.d.ts +28 -0
- package/dist/AST/NamedStackNode.js +137 -0
- package/dist/AST/NamedStackNode.js.map +1 -0
- package/dist/AST/Node.d.ts +3 -1
- package/dist/AST/Node.js +9 -0
- package/dist/AST/Node.js.map +1 -1
- package/dist/AST/WithNode.d.ts +1 -0
- package/dist/AST/WithNode.js +51 -10
- package/dist/AST/WithNode.js.map +1 -1
- package/dist/AST.d.ts +57 -56
- package/dist/AST.js +85 -62
- package/dist/AST.js.map +1 -1
- package/dist/Scope.d.ts +2 -0
- package/dist/Scope.js +14 -2
- package/dist/Scope.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/AST/{ArithmeticAssignmentNode.ts → AssignmentNode.ts} +7 -3
- package/src/AST/ElementStyleNode.ts +1 -0
- package/src/AST/ModifierNode.ts +3 -1
- package/src/AST/NamedStackNode.ts +80 -0
- package/src/AST/Node.ts +11 -1
- package/src/AST/WithNode.ts +27 -4
- package/src/AST.ts +27 -7
- package/src/Scope.ts +12 -2
- package/src/version.ts +1 -1
- package/dist/AST/ArithmeticAssignmentNode.js.map +0 -1
package/demo/demo.html
CHANGED
|
@@ -82,39 +82,6 @@
|
|
|
82
82
|
</head>
|
|
83
83
|
<body>
|
|
84
84
|
|
|
85
|
-
<template vsn-component:test-component>
|
|
86
|
-
<script vsn-script type="text/vsn">
|
|
87
|
-
class test-component {
|
|
88
|
-
class .test-class {
|
|
89
|
-
func construct() {
|
|
90
|
-
log('hmm?');
|
|
91
|
-
$color = "#ff00ff";
|
|
92
|
-
}
|
|
93
|
-
class button {
|
|
94
|
-
func construct() {
|
|
95
|
-
$color = "#ff00ff";
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
on click() {
|
|
99
|
-
log(@class);
|
|
100
|
-
@class -= 'test-class';
|
|
101
|
-
@class ~ 'huh';
|
|
102
|
-
log(@class);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
</script>
|
|
108
|
-
<div class="test-class">
|
|
109
|
-
<h1>Test Component</h1>
|
|
110
|
-
<p>
|
|
111
|
-
<button>Click Me</button>
|
|
112
|
-
</p>
|
|
113
|
-
</div>
|
|
114
|
-
</template>
|
|
115
|
-
|
|
116
|
-
<test-component></test-component>
|
|
117
|
-
|
|
118
85
|
<template vsn-template id="vsn-template">
|
|
119
86
|
<span>Hello, world!</span>
|
|
120
87
|
</template>
|
|
@@ -15,17 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
<test-component>
|
|
17
17
|
<button slot="cta" type="button">Component Two <strong vsn-bind="data.count"></strong></button>
|
|
18
|
-
<h1 slot="display">Hihi <span vsn-if="options.testing">
|
|
18
|
+
<h1 slot="display">Hihi <span vsn-if="options.testing">comp 2</span></h1>
|
|
19
19
|
</test-component>
|
|
20
20
|
</div>
|
|
21
21
|
<script type="text/javascript" src="../vsn.js"></script>
|
|
22
22
|
|
|
23
23
|
<template vsn-component:test-component>
|
|
24
|
+
|
|
24
25
|
<div vsn-scope:data="{'count': -1}">
|
|
25
26
|
<slot name="cta" vsn-on:click="data.count += 1; log(data.count);"></slot>
|
|
26
27
|
<slot name="display" vsn-if="data.count > 5"></slot>
|
|
27
28
|
<button vsn-on:click="options.testing = !options.testing; log(options.testing);" type="button">Toggle</button>
|
|
28
29
|
</div>
|
|
30
|
+
<script type="text/vsn" vsn-script>
|
|
31
|
+
log(this);
|
|
32
|
+
</script>
|
|
29
33
|
</template>
|
|
30
34
|
</body>
|
|
31
35
|
</html>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>VSN Named Stack Demo</title>
|
|
6
|
+
</head>
|
|
7
|
+
<style>
|
|
8
|
+
h1 {
|
|
9
|
+
transition: all 0.5s;
|
|
10
|
+
}
|
|
11
|
+
</style>
|
|
12
|
+
<script type="text/vsn" vsn-script|defer>
|
|
13
|
+
class h1 {
|
|
14
|
+
on click() {
|
|
15
|
+
stack clicky {
|
|
16
|
+
@text = 'big';
|
|
17
|
+
$font-size = '120%';
|
|
18
|
+
$color = 'black';
|
|
19
|
+
wait(1);
|
|
20
|
+
@text = 'small';
|
|
21
|
+
$font-size = '100%';
|
|
22
|
+
$color = 'red';
|
|
23
|
+
wait(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
<body>
|
|
29
|
+
|
|
30
|
+
<h1 id="clicky">Click Me</h1>
|
|
31
|
+
|
|
32
|
+
<script type="text/javascript" src="vsn.js"></script>
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>VSN Post Replace Test</title>
|
|
6
|
+
<style>
|
|
7
|
+
.test {
|
|
8
|
+
transition: all 1s;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<ul>
|
|
14
|
+
<li class="test test-1" id="test-1">Test 1</li>
|
|
15
|
+
<li class="test test-2">Test 2</li>
|
|
16
|
+
<li class="test test-1">Test 3</li>
|
|
17
|
+
</ul>
|
|
18
|
+
<script type="text/javascript" src="vsn.js"></script>
|
|
19
|
+
<script type="text/vsn" vsn-script|defer>
|
|
20
|
+
with ?(.test) {
|
|
21
|
+
$opacity = 0;
|
|
22
|
+
wait(1);
|
|
23
|
+
$opacity = 1;
|
|
24
|
+
wait(1);
|
|
25
|
+
$opacity = 0.5;
|
|
26
|
+
}
|
|
27
|
+
wait(1);
|
|
28
|
+
with|sequential ?(.test) {
|
|
29
|
+
$opacity = 0;
|
|
30
|
+
wait(0.25);
|
|
31
|
+
$opacity = 1;
|
|
32
|
+
}
|
|
33
|
+
a = {'b':1};
|
|
34
|
+
with a {
|
|
35
|
+
log(b);
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|