sunrize 2.0.15 → 2.0.17
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/package.json +5 -5
- package/src/Editors/ScriptEditor.js +91 -89
- package/src/Undo/Editor.js +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.17",
|
|
5
5
|
"description": "Sunrize — A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@vscode/codicons": "^0.0.45",
|
|
94
94
|
"capitalize": "^2.0.4",
|
|
95
95
|
"console": "^0.7.2",
|
|
96
|
-
"electron": "^
|
|
96
|
+
"electron": "^42.0.0",
|
|
97
97
|
"electron-prompt": "^1.7.0",
|
|
98
98
|
"electron-squirrel-startup": "^1.0.1",
|
|
99
99
|
"electron-tabs": "^1.0.4",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"jquery-ui-dist": "^1.13.3",
|
|
103
103
|
"jstree": "^3.3.17",
|
|
104
104
|
"material-icons": "^1.13.14",
|
|
105
|
-
"material-symbols": "^0.44.
|
|
105
|
+
"material-symbols": "^0.44.6",
|
|
106
106
|
"md5": "^2.3.0",
|
|
107
107
|
"mime-types": "^3.0.2",
|
|
108
108
|
"monaco-editor": "^0.55.1",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"spectrum-colorpicker2": "^2.0.10",
|
|
112
112
|
"string-similarity": "^4.0.4",
|
|
113
113
|
"tweakpane": "^4.0.5",
|
|
114
|
-
"update-electron-app": "^3.
|
|
115
|
-
"x_ite": "^
|
|
114
|
+
"update-electron-app": "^3.2.0",
|
|
115
|
+
"x_ite": "^15.0.1",
|
|
116
116
|
"x3d-traverse": "^1.0.22"
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -164,97 +164,97 @@ module .exports = class ScriptEditor extends Interface
|
|
|
164
164
|
|
|
165
165
|
const conf = {
|
|
166
166
|
comments: {
|
|
167
|
-
lineComment:
|
|
168
|
-
blockComment: [
|
|
167
|
+
lineComment: "//",
|
|
168
|
+
blockComment: ["/*", "*/"],
|
|
169
169
|
},
|
|
170
170
|
brackets: [
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
171
|
+
["{", "}"],
|
|
172
|
+
["[", "]"],
|
|
173
|
+
["(", ")"],
|
|
174
174
|
],
|
|
175
175
|
autoClosingPairs: [
|
|
176
|
-
{ open:
|
|
177
|
-
{ open:
|
|
178
|
-
{ open:
|
|
179
|
-
{ open: "'", close: "'", notIn: [
|
|
180
|
-
{ open: '"', close: '"', notIn: [
|
|
176
|
+
{ open: "[", close: "]" },
|
|
177
|
+
{ open: "{", close: "}" },
|
|
178
|
+
{ open: "(", close: ")" },
|
|
179
|
+
{ open: "'", close: "'", notIn: ["string", "comment"] },
|
|
180
|
+
{ open: '"', close: '"', notIn: ["string"] },
|
|
181
181
|
],
|
|
182
182
|
surroundingPairs: [
|
|
183
|
-
{ open:
|
|
184
|
-
{ open:
|
|
185
|
-
{ open:
|
|
183
|
+
{ open: "{", close: "}" },
|
|
184
|
+
{ open: "[", close: "]" },
|
|
185
|
+
{ open: "(", close: ")" },
|
|
186
186
|
{ open: '"', close: '"' },
|
|
187
|
-
{ open: "'", close: "'" }
|
|
187
|
+
{ open: "'", close: "'" },
|
|
188
188
|
]
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
const keywords = [
|
|
192
|
-
|
|
192
|
+
"break", "case", "const", "continue", "discard", "do", "else", "flat", "for", "highp", "if", "in", "inout", "invariant", "lowp", "mediump", "out", "precision", "return", "smooth", "struct", "switch", "uniform", "while",
|
|
193
193
|
];
|
|
194
194
|
|
|
195
195
|
const types = [
|
|
196
|
-
|
|
196
|
+
"bool", "bvec2", "bvec3", "bvec4", "float", "int", "ivec2", "ivec3", "ivec4", "mat2", "mat2x2", "mat2x3", "mat2x4", "mat3", "mat3x2", "mat3x3", "mat3x4", "mat4", "mat4x2", "mat4x3", "mat4x4", "sampler2D", "sampler3D", "samplerCube", "uint", "uvec2", "uvec3", "uvec4", "vec2", "vec3", "vec4", "void",
|
|
197
197
|
];
|
|
198
198
|
|
|
199
199
|
const functions = [
|
|
200
|
-
|
|
200
|
+
"abs", "acos", "acosh", "all", "any", "asin", "asinh", "atan", "atanh", "ceil", "clamp", "cos", "cosh", "cross ", "degrees", "determinant", "dFdx", "dFdy", "distance", "dot", "equal", "exp", "exp2", "faceforward", "floatBitsToInt", "floatBitsToUint", "floor", "fract", "fwidth", "greaterThan", "greaterThanEqual", "intBitsToFloat", "inverse", "inversesqrt", "isinf", "isnan", "length", "lessThan ", "lessThanEqual", "log", "log2", "main", "matrixCompMult", "max", "min", "mix", "mod", "modf", "normalize", "not", "notEqual", "outerProduct", "packUnorm2x16", "pow", "radians", "reflect", "refract", "round", "roundEven", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "texelFetch", "texelFetchOffset", "texture", "textureGrad", "textureGradOffset", "textureLod", "textureLodOffset", "textureProj", "textureProjGrad", "textureProjLod", "textureProjLodOffset", "textureSize", "transpose", "trunc", "uintBitsToFloat",
|
|
201
201
|
];
|
|
202
202
|
|
|
203
203
|
const constants = [
|
|
204
|
-
|
|
204
|
+
"false", "true",
|
|
205
205
|
];
|
|
206
206
|
|
|
207
207
|
const builtins = [
|
|
208
|
-
|
|
208
|
+
"gl_ClipDistance", "gl_CullDistance", "gl_FragCoord", "gl_FragDepth", "gl_FrontFacing", "gl_GlobalInvocationID", "gl_HelperInvocation", "gl_InstanceID", "gl_InvocationID", "gl_Layer", "gl_LocalInvocationID", "gl_LocalInvocationIndex", "gl_NumSamples", "gl_NumWorkGroups", "gl_PatchVerticesIn", "gl_PointCoord", "gl_PointSize", "gl_Position", "gl_PrimitiveID", "gl_PrimitiveIDIn", "gl_SampleID", "gl_SampleMask", "gl_SampleMaskIn", "gl_SamplePosition", "gl_TessCoord", "gl_TessLevelInner", "gl_TessLevelOuter", "gl_VertexID", "gl_ViewportIndex", "gl_WorkGroupID", "gl_WorkGroupSize",
|
|
209
209
|
];
|
|
210
210
|
|
|
211
211
|
const language = {
|
|
212
|
-
tokenPostfix:
|
|
212
|
+
tokenPostfix: ".glsl",
|
|
213
213
|
// Set defaultToken to invalid to see what you do not tokenize yet
|
|
214
|
-
defaultToken:
|
|
214
|
+
defaultToken: "invalid",
|
|
215
215
|
keywords,
|
|
216
216
|
types,
|
|
217
217
|
functions,
|
|
218
218
|
constants,
|
|
219
219
|
builtins,
|
|
220
220
|
operators: [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
221
|
+
"=",
|
|
222
|
+
">",
|
|
223
|
+
"<",
|
|
224
|
+
"!",
|
|
225
|
+
"~",
|
|
226
|
+
"?",
|
|
227
|
+
":",
|
|
228
|
+
"==",
|
|
229
|
+
"<=",
|
|
230
|
+
">=",
|
|
231
|
+
"!=",
|
|
232
|
+
"&&",
|
|
233
|
+
"||",
|
|
234
|
+
"++",
|
|
235
|
+
"--",
|
|
236
|
+
"+",
|
|
237
|
+
"-",
|
|
238
|
+
"*",
|
|
239
|
+
"/",
|
|
240
|
+
"&",
|
|
241
|
+
"|",
|
|
242
|
+
"^",
|
|
243
|
+
"%",
|
|
244
|
+
"<<",
|
|
245
|
+
">>",
|
|
246
|
+
">>>",
|
|
247
|
+
"+=",
|
|
248
|
+
"-=",
|
|
249
|
+
"*=",
|
|
250
|
+
"/=",
|
|
251
|
+
"&=",
|
|
252
|
+
"|=",
|
|
253
|
+
"^=",
|
|
254
|
+
"%=",
|
|
255
|
+
"<<=",
|
|
256
|
+
">>=",
|
|
257
|
+
">>>=",
|
|
258
258
|
],
|
|
259
259
|
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
260
260
|
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
@@ -265,73 +265,73 @@ module .exports = class ScriptEditor extends Interface
|
|
|
265
265
|
tokenizer: {
|
|
266
266
|
root: [
|
|
267
267
|
// data:mime-type,
|
|
268
|
-
[/data:x-shader\/x-(?:vertex|fragment),/,
|
|
268
|
+
[/data:x-shader\/x-(?:vertex|fragment),/, "string"],
|
|
269
269
|
|
|
270
270
|
// x3d_SpecialVariable
|
|
271
|
-
[/x3d_\w+/,
|
|
271
|
+
[/x3d_\w+/, "keyword"],
|
|
272
272
|
|
|
273
273
|
// identifiers and keywords
|
|
274
274
|
|
|
275
275
|
[/[a-zA-Z_]\w*/,
|
|
276
276
|
{
|
|
277
277
|
cases: {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
278
|
+
"@keywords": { token: "keyword.$0" },
|
|
279
|
+
"@types": { token: "type.identifier" },
|
|
280
|
+
"@functions": { token: "attribute.name" },
|
|
281
|
+
"@constants": { token: "constant" },
|
|
282
|
+
"@builtins": { token: "regexp" },
|
|
283
|
+
"@default": "identifier",
|
|
284
284
|
}
|
|
285
285
|
}],
|
|
286
286
|
|
|
287
287
|
// Version
|
|
288
|
-
[/#version\s+\d+\s+es/,
|
|
288
|
+
[/#version\s+\d+\s+es/, "keyword.directive"],
|
|
289
289
|
|
|
290
290
|
// Preprocessor directive (#define)
|
|
291
|
-
[/^\s*#\s*\w+/,
|
|
291
|
+
[/^\s*#\s*\w+/, "keyword.directive"],
|
|
292
292
|
|
|
293
293
|
// whitespace
|
|
294
|
-
{ include:
|
|
294
|
+
{ include: "@whitespace" },
|
|
295
295
|
|
|
296
296
|
// delimiters and operators
|
|
297
|
-
[/[{}()\[\]]/,
|
|
297
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
298
298
|
[/@symbols/,
|
|
299
299
|
{
|
|
300
300
|
cases: {
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
"@operators": "operator",
|
|
302
|
+
"@default": "",
|
|
303
303
|
}
|
|
304
304
|
}],
|
|
305
305
|
|
|
306
306
|
// numbers
|
|
307
|
-
[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,
|
|
308
|
-
[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,
|
|
309
|
-
[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,
|
|
310
|
-
[/0[0-7']*[0-7](@integersuffix)/,
|
|
311
|
-
[/0[bB][0-1']*[0-1](@integersuffix)/,
|
|
312
|
-
[/\d[\d']*\d(@integersuffix)/,
|
|
313
|
-
[/\d(@integersuffix)/,
|
|
307
|
+
[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
|
|
308
|
+
[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
|
|
309
|
+
[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, "number.hex"],
|
|
310
|
+
[/0[0-7']*[0-7](@integersuffix)/, "number.octal"],
|
|
311
|
+
[/0[bB][0-1']*[0-1](@integersuffix)/, "number.binary"],
|
|
312
|
+
[/\d[\d']*\d(@integersuffix)/, "number"],
|
|
313
|
+
[/\d(@integersuffix)/, "number"],
|
|
314
314
|
|
|
315
315
|
// delimiter: after number because of .\d floats
|
|
316
|
-
[/[;,.]/,
|
|
316
|
+
[/[;,.]/, "delimiter"],
|
|
317
317
|
],
|
|
318
318
|
|
|
319
319
|
comment: [
|
|
320
|
-
[/[^\/*]+/,
|
|
321
|
-
[/\/\*/,
|
|
322
|
-
[
|
|
323
|
-
[/[\/*]/,
|
|
320
|
+
[/[^\/*]+/, "comment"],
|
|
321
|
+
[/\/\*/, "comment", "@push"],
|
|
322
|
+
["\\*/", "comment", "@pop"],
|
|
323
|
+
[/[\/*]/, "comment"],
|
|
324
324
|
],
|
|
325
325
|
|
|
326
326
|
whitespace: [
|
|
327
|
-
[/[ \t\r\n]+/,
|
|
328
|
-
[/\/\*/,
|
|
329
|
-
[/\/\/.*$/,
|
|
330
|
-
]
|
|
327
|
+
[/[ \t\r\n]+/, "white"],
|
|
328
|
+
[/\/\*/, "comment", "@comment"],
|
|
329
|
+
[/\/\/.*$/, "comment"],
|
|
330
|
+
],
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
monaco .languages .register ({ id: "glsl" });
|
|
334
|
+
monaco .languages .register ({ id: "glsl", mimetypes: ["x-shader/x-vertex", "x-shader/x-fragment"] });
|
|
335
335
|
monaco .languages .setMonarchTokensProvider ("glsl", language);
|
|
336
336
|
monaco .languages .setLanguageConfiguration ("glsl", conf);
|
|
337
337
|
}
|
|
@@ -870,6 +870,8 @@ function set_field (value, time)
|
|
|
870
870
|
print (time, value);
|
|
871
871
|
}
|
|
872
872
|
"
|
|
873
|
+
|
|
874
|
+
directOutput TRUE
|
|
873
875
|
}
|
|
874
876
|
`);
|
|
875
877
|
|
package/src/Undo/Editor.js
CHANGED
|
@@ -534,7 +534,8 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
534
534
|
</x3d-canvas>
|
|
535
535
|
<p>Made with <a href="https://create3000.github.io/sunrize/" target="_blank">Sunrize X3D Editor</a>. If local files are not loaded <a href="https://create3000.github.io/x_ite/setup-a-localhost-server">consider setup a localhost server</a> or use <a href="https://create3000.github.io/x_ite/dom-integration">DOM integration methods</a>.</p>
|
|
536
536
|
</body>
|
|
537
|
-
</html
|
|
537
|
+
</html>
|
|
538
|
+
`
|
|
538
539
|
}
|
|
539
540
|
|
|
540
541
|
static absoluteURL = new RegExp ("^(?:[a-z]+:|//)", "i");
|