sunrize 1.0.46 → 1.0.48
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/build/fields.pl
CHANGED
|
@@ -3,6 +3,8 @@ use v5.10.0;
|
|
|
3
3
|
use utf8;
|
|
4
4
|
use open qw/:std :utf8/;
|
|
5
5
|
|
|
6
|
+
use Cwd;
|
|
7
|
+
|
|
6
8
|
sub node {
|
|
7
9
|
$filename = shift;
|
|
8
10
|
chomp $filename;
|
|
@@ -15,16 +17,224 @@ sub node {
|
|
|
15
17
|
return if $componentName =~ /^Annotation$/;
|
|
16
18
|
return if $typeName =~ /^X3D/;
|
|
17
19
|
|
|
18
|
-
return unless $typeName =~ /^Transform$/;
|
|
19
|
-
say "$componentName $typeName";
|
|
20
|
+
#return unless $typeName =~ /^Transform$/;
|
|
21
|
+
#say "$componentName $typeName";
|
|
20
22
|
|
|
21
|
-
$file
|
|
23
|
+
$file = `cat $cwd/../x_ite/docs/_posts/components/$componentName/$typeName.md`;
|
|
24
|
+
$source = `cat $filename`;
|
|
22
25
|
|
|
23
26
|
@fields = $file =~ m|###\s*[SM]F\w+.*|go;
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
field ($_, $source) foreach @fields
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
sub field {
|
|
32
|
+
$field = shift;
|
|
33
|
+
$source = shift;
|
|
34
|
+
|
|
35
|
+
#say $field;
|
|
36
|
+
|
|
37
|
+
$field =~ /###\s*(\w+)\s*\[(.*?)\]\s*\*\*(\w+)\*\*\s*(.*?)(?:\s*<|$)/;
|
|
38
|
+
|
|
39
|
+
$type = $1;
|
|
40
|
+
$accessType = $2;
|
|
41
|
+
$name = $3;
|
|
42
|
+
$value = $4;
|
|
43
|
+
|
|
44
|
+
$source =~ /X3DFieldDefinition\s*\(X3DConstants\s*\.(\w+),\s*"$name",\s*new\s+Fields\s*\.(\w+)\s*\((.*?)\)\),/;
|
|
45
|
+
|
|
46
|
+
$codeAccessType = $1;
|
|
47
|
+
$codeType = $2;
|
|
48
|
+
$codeValue = $3;
|
|
49
|
+
|
|
50
|
+
$accessTypes = {
|
|
51
|
+
" " => "initializeOnly",
|
|
52
|
+
"in" => "inputOnly",
|
|
53
|
+
"out" => "outputOnly",
|
|
54
|
+
"in, out" => "inputOutput",
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
say "$typeName $name '$accessType' <-> '$codeAccessType'" unless $accessTypes -> {$accessType} eq $codeAccessType;
|
|
58
|
+
say "$typeName $name '$type' <-> '$codeType'" unless $type eq $codeType;
|
|
59
|
+
|
|
60
|
+
return if $accessType eq "in";
|
|
61
|
+
return if $accessType eq "out";
|
|
26
62
|
|
|
27
|
-
|
|
63
|
+
if ($type eq "SFBool")
|
|
64
|
+
{
|
|
65
|
+
return if $value eq "TRUE" && $codeValue eq "true";
|
|
66
|
+
return if $value eq "FALSE" && $codeValue eq "";
|
|
67
|
+
}
|
|
68
|
+
elsif ($type eq "SFColor")
|
|
69
|
+
{
|
|
70
|
+
return if $value eq "0 0 0" && $codeValue eq "";
|
|
71
|
+
return if $value eq "1 1 1" && $codeValue eq "1, 1, 1";
|
|
72
|
+
return if $value eq "0.8 0.8 0.8" && $codeValue eq "0.8, 0.8, 0.8";
|
|
73
|
+
}
|
|
74
|
+
elsif ($type eq "SFColorRGBA")
|
|
75
|
+
{
|
|
76
|
+
$value =~s /(\s)/,$1/sgo;
|
|
77
|
+
|
|
78
|
+
return if ($value eq "0, 0, 0, 0" && $codeValue eq "") != ($value eq $codeValue);
|
|
79
|
+
}
|
|
80
|
+
elsif ($type eq "SFDouble")
|
|
81
|
+
{
|
|
82
|
+
return if $value eq "0" && $codeValue eq "";
|
|
83
|
+
return if $value eq $codeValue;
|
|
84
|
+
}
|
|
85
|
+
elsif ($type eq "SFFloat")
|
|
86
|
+
{
|
|
87
|
+
return if $value eq "0" && $codeValue eq "";
|
|
88
|
+
return if $value eq $codeValue;
|
|
89
|
+
return if $value eq "π/2" && $codeValue eq "1.5708";
|
|
90
|
+
return if $value eq "π/4" && $codeValue eq "0.785398";
|
|
91
|
+
return if $value eq "π" && $codeValue eq "3.14159";
|
|
92
|
+
return if $value eq "-π" && $codeValue eq "-3.14159";
|
|
93
|
+
}
|
|
94
|
+
elsif ($type eq "SFImage")
|
|
95
|
+
{
|
|
96
|
+
$value =~s /(\s)/,$1/sgo;
|
|
97
|
+
|
|
98
|
+
return if $value eq "0, 0, 0" && $codeValue eq "";
|
|
99
|
+
}
|
|
100
|
+
elsif ($type eq "SFInt32")
|
|
101
|
+
{
|
|
102
|
+
return if $value eq "0" && $codeValue eq "";
|
|
103
|
+
return if $value eq $codeValue;
|
|
104
|
+
}
|
|
105
|
+
elsif ($type =~ /^(?:SFMatrix3d|SFMatrix3f)$/)
|
|
106
|
+
{
|
|
107
|
+
$value =~s /(\s)/,$1/sgo;
|
|
108
|
+
|
|
109
|
+
return if $value eq "1, 0, 0, 0, 1, 0, 0, 0, 1" && $codeValue eq "";
|
|
110
|
+
}
|
|
111
|
+
elsif ($type =~ /^(?:SFMatrix4d|SFMatrix4f)$/)
|
|
112
|
+
{
|
|
113
|
+
$value =~s /(\s)/,$1/sgo;
|
|
114
|
+
|
|
115
|
+
return if $value eq "1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1" && $codeValue eq "";
|
|
116
|
+
}
|
|
117
|
+
elsif ($type eq "SFNode")
|
|
118
|
+
{
|
|
119
|
+
return if $value eq "NULL" && $codeValue eq "";
|
|
120
|
+
}
|
|
121
|
+
elsif ($type eq "SFRotation")
|
|
122
|
+
{
|
|
123
|
+
return if $value eq "0 0 1 0" && $codeValue eq "";
|
|
124
|
+
}
|
|
125
|
+
elsif ($type eq "SFString")
|
|
126
|
+
{
|
|
127
|
+
return if $value eq "\"\"" && $codeValue eq "";
|
|
128
|
+
return if $value eq $codeValue;
|
|
129
|
+
}
|
|
130
|
+
elsif ($type eq "SFTime")
|
|
131
|
+
{
|
|
132
|
+
return if $value eq "0" && $codeValue eq "";
|
|
133
|
+
return if $value eq $codeValue;
|
|
134
|
+
}
|
|
135
|
+
elsif ($type =~ /^(?:SFVec2d|SFVec2f)$/)
|
|
136
|
+
{
|
|
137
|
+
$value =~s /(\s)/,$1/sgo;
|
|
138
|
+
|
|
139
|
+
return if $value eq "0, 0" && $codeValue eq "";
|
|
140
|
+
return if $value eq $codeValue;
|
|
141
|
+
}
|
|
142
|
+
elsif ($type =~ /^(?:SFVec3d|SFVec3f)$/)
|
|
143
|
+
{
|
|
144
|
+
$value =~s /(\s)/,$1/sgo;
|
|
145
|
+
|
|
146
|
+
return if $value eq "0, 0, 0" && $codeValue eq "";
|
|
147
|
+
return if $value eq $codeValue;
|
|
148
|
+
}
|
|
149
|
+
elsif ($type =~ /^(?:SFVec4d|SFVec4f)$/)
|
|
150
|
+
{
|
|
151
|
+
$value =~s /(\s)/,$1/sgo;
|
|
152
|
+
|
|
153
|
+
return if $value eq "0, 0, 0, 0" && $codeValue eq "";
|
|
154
|
+
return if $value eq $codeValue;
|
|
155
|
+
}
|
|
156
|
+
elsif ($type eq "MFBool")
|
|
157
|
+
{
|
|
158
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
159
|
+
}
|
|
160
|
+
elsif ($type eq "MFColor")
|
|
161
|
+
{
|
|
162
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
163
|
+
return if $value eq "0 0 0" && $codeValue eq "new Fields .SFColor ()";
|
|
164
|
+
}
|
|
165
|
+
elsif ($type eq "MFColorRGBA")
|
|
166
|
+
{
|
|
167
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
168
|
+
}
|
|
169
|
+
elsif ($type eq "MFDouble")
|
|
170
|
+
{
|
|
171
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
172
|
+
return if $value eq "[ 0, 0 ]" && $codeValue eq "0, 0";
|
|
173
|
+
}
|
|
174
|
+
elsif ($type eq "MFFloat")
|
|
175
|
+
{
|
|
176
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
177
|
+
return if $value eq "[ $codeValue ]";
|
|
178
|
+
}
|
|
179
|
+
elsif ($type eq "MFImage")
|
|
180
|
+
{
|
|
181
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
182
|
+
}
|
|
183
|
+
elsif ($type eq "MFInt32")
|
|
184
|
+
{
|
|
185
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
186
|
+
return if $value eq "[ $codeValue ]";
|
|
187
|
+
return if $value =~ /^[+-]?\d+$/ && $value eq $codeValue;
|
|
188
|
+
}
|
|
189
|
+
elsif ($type =~ /^(?:MFMatrix3d|MFMatrix3f)$/)
|
|
190
|
+
{
|
|
191
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
192
|
+
}
|
|
193
|
+
elsif ($type =~ /^(?:MFMatrix4d|MFMatrix4f)$/)
|
|
194
|
+
{
|
|
195
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
196
|
+
}
|
|
197
|
+
elsif ($type eq "MFNode")
|
|
198
|
+
{
|
|
199
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
200
|
+
}
|
|
201
|
+
elsif ($type eq "MFRotation")
|
|
202
|
+
{
|
|
203
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
204
|
+
return if $value eq "0 0 1 0" && $codeValue eq "new Rotation4 ()";
|
|
205
|
+
}
|
|
206
|
+
elsif ($type eq "MFString")
|
|
207
|
+
{
|
|
208
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
209
|
+
return if $value eq "[ $codeValue ]";
|
|
210
|
+
return if $value =~ /^"\w+"+$/ && $value eq $codeValue;
|
|
211
|
+
}
|
|
212
|
+
elsif ($type eq "MFTime")
|
|
213
|
+
{
|
|
214
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
215
|
+
}
|
|
216
|
+
elsif ($type =~ /^(?:MFVec2d|MFVec2f)$/)
|
|
217
|
+
{
|
|
218
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
219
|
+
return if $value eq "[ 1 1, 1 -1, -1 -1, -1 1, 1 1 ]" && $codeValue eq "new Vector2 (1, 1), new Vector2 (1, -1), new Vector2 (-1, -1), new Vector2 (-1, 1), new Vector2 (1, 1)";
|
|
220
|
+
return if $value eq "1 1" && $codeValue eq "new Vector2 (1, 1)";
|
|
221
|
+
}
|
|
222
|
+
elsif ($type =~ /^(?:MFVec3d|MFVec3f)$/)
|
|
223
|
+
{
|
|
224
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
225
|
+
return if $value eq "0 0 0" && $codeValue eq "new Vector3 (0, 0, 0)";
|
|
226
|
+
return if $value eq "[ 0 0 0, 0 1 0 ]" && $codeValue eq "new Vector3 (0, 0, 0), new Vector3 (0, 1, 0)";
|
|
227
|
+
}
|
|
228
|
+
elsif ($type =~ /^(?:MFVec4d|MFVec4f)$/)
|
|
229
|
+
{
|
|
230
|
+
return if $value eq "[ ]" && $codeValue eq "";
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
say "$typeName $name '$value' <-> '$codeValue'";
|
|
28
234
|
}
|
|
29
235
|
|
|
30
|
-
|
|
236
|
+
$cwd = getcwd . "";
|
|
237
|
+
|
|
238
|
+
node $_ foreach sort `find $cwd/../x_ite/src/x_ite/Components -type f -mindepth 2`;
|
|
239
|
+
|
|
240
|
+
say "test-done";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.48",
|
|
5
5
|
"description": "A Multi Platform X3D Editor",
|
|
6
6
|
"homepage": "https://create3000.github.io/sunrize/",
|
|
7
7
|
"author": "Holger Seelig",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"qtip2": "^3.0.3",
|
|
60
60
|
"spectrum-colorpicker2": "^2.0.10",
|
|
61
61
|
"string-similarity": "^4.0.4",
|
|
62
|
-
"x_ite": "^8.8.
|
|
62
|
+
"x_ite": "^8.8.7"
|
|
63
63
|
},
|
|
64
64
|
"main": "src/main.js",
|
|
65
65
|
"bin": {
|
|
@@ -121,13 +121,18 @@ module .exports = new class Library extends Dialog
|
|
|
121
121
|
|
|
122
122
|
const
|
|
123
123
|
HTMLSupport = X3D .require ("x_ite/Parser/HTMLSupport"),
|
|
124
|
-
input = this .input .val () .toUpperCase () .trim ()
|
|
125
|
-
|
|
124
|
+
input = this .input .val () .toUpperCase () .trim ();
|
|
125
|
+
|
|
126
|
+
try
|
|
127
|
+
{
|
|
128
|
+
const ConcreteNode = this .browser .getConcreteNode (HTMLSupport .getNodeTypeName (input))
|
|
126
129
|
|
|
127
|
-
if (ConcreteNode)
|
|
128
130
|
this .createNode (ConcreteNode .typeName, ConcreteNode .componentName)
|
|
129
|
-
|
|
131
|
+
}
|
|
132
|
+
catch
|
|
133
|
+
{
|
|
130
134
|
this .createNode (first .text (), component .attr ("name"))
|
|
135
|
+
}
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
update ()
|
|
@@ -472,7 +472,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
472
472
|
element = $(`#${id}`),
|
|
473
473
|
node = this .objects .get (nodeId)
|
|
474
474
|
|
|
475
|
-
element .find ("> .item
|
|
475
|
+
element .find ("> .item") .renameNodePopover (node)
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
openLibrary (id, executionContextId)
|
|
@@ -746,7 +746,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
746
746
|
element = $(`#${id}`),
|
|
747
747
|
protoNode = this .objects .get (protoNodeId)
|
|
748
748
|
|
|
749
|
-
element .find ("> .item
|
|
749
|
+
element .find ("> .item") .renameNodePopover (protoNode)
|
|
750
750
|
}
|
|
751
751
|
|
|
752
752
|
deletePrototype (id, executionContextId, protoNodeId, used, availableId)
|