@jscad/web 2.5.6 → 2.5.10

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +7 -7
  3. package/css/codemirror.css +10 -15
  4. package/css/demo.css +37 -35
  5. package/css/style.css +0 -124
  6. package/demo.html +3 -2
  7. package/dist/jscad-web.min.js +1367 -1371
  8. package/examples/CHANGELOG.md +16 -0
  9. package/examples/README.md +4 -4
  10. package/examples/core/extrusions/nutsAndBolts.js +94 -0
  11. package/examples/examples.json +1 -1
  12. package/examples/package.json +2 -1
  13. package/locales/de.json +0 -6
  14. package/locales/en.json +0 -6
  15. package/locales/fr.json +0 -6
  16. package/locales/hr.json +0 -6
  17. package/locales/ja.json +0 -6
  18. package/package.json +13 -12
  19. package/src/sideEffects/worker/index.js +9 -5
  20. package/src/ui/flow/design.js +13 -3
  21. package/src/ui/views/editor.js +116 -195
  22. package/src/ui/views/main.js +1 -1
  23. package/src/ui/views/options.js +0 -14
  24. package/src/ui/views/parameterControls.js +3 -3
  25. package/src/ui/views/status.js +21 -14
  26. package/src/ui/views/toolbar.js +3 -3
  27. package/css/big.css +0 -107
  28. package/css/editor.css +0 -428
  29. package/css/min.css +0 -107
  30. package/css/openjscad.css +0 -135
  31. package/imgs/closeButton.png +0 -0
  32. package/imgs/editHandle.png +0 -0
  33. package/imgs/editHandleIn.png +0 -0
  34. package/imgs/editHandleOut.png +0 -0
  35. package/imgs/menuHandle.png +0 -0
  36. package/imgs/menuHandleHD.png +0 -0
  37. package/imgs/menuHandleHU.png +0 -0
  38. package/imgs/menuHandleVL.png +0 -0
  39. package/imgs/menuHandleVLIn.png +0 -0
  40. package/imgs/menuHandleVLOut.png +0 -0
  41. package/imgs/menuHandleVR.png +0 -0
  42. package/imgs/misc.svg +0 -1038
  43. package/imgs/title.png +0 -0
  44. package/src/sideEffects/localFs/walkFileTree.js +0 -224
  45. package/src/ui/views/editor2.js +0 -130
package/CHANGELOG.md CHANGED
@@ -3,6 +3,49 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.5.10](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/web@2.5.9...@jscad/web@2.5.10) (2022-05-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **web:** corrected messages from parameter runtime errors (missing types, etc) ([cf7d5f1](https://github.com/jscad/OpenJSCAD.org/commit/cf7d5f12f2b99d67167eb79f1e2f085f8ff297bc))
12
+ * **web:** corrected status (error) message format and display ([abd02b1](https://github.com/jscad/OpenJSCAD.org/commit/abd02b14a64f88bbf63c36e7f9dc1cee76402f3f))
13
+ * **web:** enhanced design state management to handle error messages ([1c15139](https://github.com/jscad/OpenJSCAD.org/commit/1c15139e6733b4157c730399d18a158fb44e38a9))
14
+
15
+
16
+
17
+
18
+
19
+ ## [2.5.9](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/web@2.5.8...@jscad/web@2.5.9) (2022-04-24)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **web:** remove unused file handling and storage path options ([#1071](https://github.com/jscad/OpenJSCAD.org/issues/1071)) ([02c740c](https://github.com/jscad/OpenJSCAD.org/commit/02c740ce56c04ffb7b83a5e48009abb111c64001))
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.5.8](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/web@2.5.7...@jscad/web@2.5.8) (2022-04-03)
31
+
32
+ **Note:** Version bump only for package @jscad/web
33
+
34
+
35
+
36
+
37
+
38
+ ## [2.5.7](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/web@2.5.6...@jscad/web@2.5.7) (2022-04-03)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * **web:** editor styling and example loading fixes ([#1031](https://github.com/jscad/OpenJSCAD.org/issues/1031)) ([4f811a2](https://github.com/jscad/OpenJSCAD.org/commit/4f811a27c0cbb7caabf28fcef932cbaf19aaa6f4))
44
+
45
+
46
+
47
+
48
+
6
49
  ## [2.5.6](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/web@2.5.5...@jscad/web@2.5.6) (2022-03-13)
7
50
 
8
51
  **Note:** Version bump only for package @jscad/web
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @jscad/web: JSCAD Web UI
2
2
 
3
- This is the Web based UI for JSCAD, either to host yourself, or use directly at https://www.openjscad.xyz/.
3
+ This is the Web based UI for JSCAD, either to host yourself, or use directly at https://openjscad.xyz/.
4
4
 
5
5
  [![NPM version](https://badge.fury.io/js/%40jscad%2Fweb.svg)](https://www.npmjs.com/package/@jscad/web)
6
6
  [![NPM downloads](https://img.shields.io/npm/dw/@jscad/web)](https://www.npmjs.com/package/@jscad/web)
@@ -32,7 +32,7 @@ This is the Web based UI for JSCAD, either to host yourself, or use directly at
32
32
 
33
33
  ### Immediate Use (no installation)
34
34
 
35
- Go to *[www.openjscad.xyz](http://www.openjscad.xyz)*
35
+ Go to *[openjscad.xyz](https://openjscad.xyz)*
36
36
 
37
37
  > Note: Tested browsers include Chrome, Firefox, Opera, Safari, Edge
38
38
 
@@ -77,8 +77,8 @@ https://YOURSITE/#http://www.thingiverse.com/download:164128
77
77
 
78
78
  ## Documentation
79
79
 
80
- - [JSCAD User Guide](https://www.openjscad.xyz/guide.html)
81
- - [JSCAD API Reference](https://www.openjscad.xyz/docs)
80
+ - [JSCAD User Guide](https://openjscad.xyz/guide.html)
81
+ - [JSCAD API Reference](https://openjscad.xyz/docs/)
82
82
 
83
83
  ## Known Issues
84
84
 
@@ -95,11 +95,11 @@ We welcome and encourage anyone to pitch in but please take a moment to read the
95
95
 
96
96
  * If you want to submit a bug report please make sure to follow the [Reporting Issues](https://github.com/jscad/OpenJSCAD.org/wiki/Reporting-Issues) guide. Bug reports are accepted as [Issues](https://github.com/jscad/OpenJSCAD.org/issues/) via GitHub.
97
97
 
98
- * If you want to submit a change or a patch, please read the [Contributing Guide](../../CONTRIBUTING.md) . New contributions are accepted as [Pull Requests](https://github.com/jscad/OpenJSCAD.org/pulls/) via GithHub.
98
+ * If you want to submit a change or a patch, please read the [Contributing Guide](../../CONTRIBUTING.md). New contributions are accepted as [Pull Requests](https://github.com/jscad/OpenJSCAD.org/pulls/) via GitHub.
99
99
 
100
100
  * We only accept bug reports and pull requests on **GitHub**.
101
101
 
102
- * If you have a question about how to use JSCAD, then please start a conversation at the [JSCAD User Group](https://openjscad.xyz/forum.html). You might find the answer in the [JSCAD User Guide](https://www.openjscad.xyz/guide.html).
102
+ * If you have a question about how to use JSCAD, then please start a conversation at the [JSCAD User Group](https://openjscad.xyz/forum.html). You might find the answer in the [JSCAD User Guide](https://openjscad.xyz/guide.html).
103
103
 
104
104
  * If you have a change or new feature in mind, please start a conversation with the [Core Developers](https://openjscad.xyz/forum.html) and start contributing changes.
105
105
 
@@ -116,7 +116,7 @@ HUGE THANKS and SHOUTOUT to [nodeBB](https://nodebb.org/) for hosting our (aweso
116
116
 
117
117
  Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/openjscad#backer)]
118
118
 
119
- <a href="https://opencollective.com/openjscad#backers" target="_blank"><img src="https://opencollective.com/openjscad/backers.svg?width=890"></a>
119
+ <a href="https://opencollective.com/openjscad#backers" target="_blank"><img src="https://opencollective.com/openjscad/backers.svg?width=890" alt="Open Collective"></a>
120
120
 
121
121
  ## Sponsors
122
122
 
@@ -60,20 +60,13 @@
60
60
  .cm-fat-cursor div.CodeMirror-cursors {
61
61
  z-index: 1;
62
62
  }
63
- .cm-fat-cursor-mark {
64
- background-color: rgba(20, 255, 20, 0.5);
65
- -webkit-animation: blink 1.06s steps(1) infinite;
66
- -moz-animation: blink 1.06s steps(1) infinite;
67
- animation: blink 1.06s steps(1) infinite;
68
- }
69
- .cm-animate-fat-cursor {
70
- width: auto;
71
- border: 0;
72
- -webkit-animation: blink 1.06s steps(1) infinite;
73
- -moz-animation: blink 1.06s steps(1) infinite;
74
- animation: blink 1.06s steps(1) infinite;
75
- background-color: #7e7;
76
- }
63
+ .cm-fat-cursor .CodeMirror-line::selection,
64
+ .cm-fat-cursor .CodeMirror-line > span::selection,
65
+ .cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; }
66
+ .cm-fat-cursor .CodeMirror-line::-moz-selection,
67
+ .cm-fat-cursor .CodeMirror-line > span::-moz-selection,
68
+ .cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; }
69
+ .cm-fat-cursor { caret-color: transparent; }
77
70
  @-moz-keyframes blink {
78
71
  0% {}
79
72
  50% { background-color: transparent; }
@@ -171,6 +164,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
171
164
  height: 100%;
172
165
  outline: none; /* Prevent dragging from highlighting the element */
173
166
  position: relative;
167
+ z-index: 0;
174
168
  }
175
169
  .CodeMirror-sizer {
176
170
  position: relative;
@@ -184,6 +178,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
184
178
  position: absolute;
185
179
  z-index: 6;
186
180
  display: none;
181
+ outline: none;
187
182
  }
188
183
  .CodeMirror-vscrollbar {
189
184
  right: 0; top: 0;
@@ -346,4 +341,4 @@ div.CodeMirror-dragcursors {
346
341
  .cm-tab-wrap-hack:after { content: ''; }
347
342
 
348
343
  /* Help users use markselection to safely style text background */
349
- span.CodeMirror-selectedtext { background: none; }
344
+ span.CodeMirror-selectedtext { background: none; }
package/css/demo.css CHANGED
@@ -58,7 +58,8 @@ body {
58
58
  src: local('OpenSans'), local('OpenSans'), url(../fonts/Open_Sans/OpenSans-Bold.ttf) format('truetype');
59
59
  }
60
60
 
61
- #renderTarget{
61
+ #renderTarget {
62
+ cursor: move;
62
63
  width: 100%;
63
64
  height: 100%;
64
65
  position: absolute;
@@ -68,7 +69,7 @@ body {
68
69
  bottom: 0px;
69
70
  }
70
71
 
71
- #fileLoader{
72
+ #fileLoader {
72
73
  width: 0.1px;
73
74
  height: 0.1px;
74
75
  opacity: 0;
@@ -80,9 +81,9 @@ body {
80
81
  box-shadow: none;
81
82
  border: 1px solid #bfbcbc;
82
83
  border-color: black;
83
- border-radius: 0px;
84
+ border-radius: 1px;
84
85
  border-width: 1px;
85
- padding: 2px 0px 0px 2px;
86
+ padding: 0px 2px;
86
87
  margin: 0px 5px 0px 0px;
87
88
  background-color: white;
88
89
  outline: none;
@@ -95,12 +96,13 @@ body {
95
96
  }
96
97
 
97
98
  #controls {
99
+ box-sizing: border-box;
98
100
  color: var(--main-text-color);
99
101
  position: absolute;
100
102
  width: 100%;
103
+ padding: 0px 10px;
101
104
  user-select: none;
102
105
  top: 30px;
103
- left: 10px;
104
106
  z-index: 1;
105
107
  }
106
108
 
@@ -109,6 +111,7 @@ body {
109
111
  }
110
112
 
111
113
  section#params {
114
+ background-color: rgba(255, 255, 255, 0.6);
112
115
  position: absolute;
113
116
  bottom: 10px;
114
117
  left: 10px;
@@ -168,13 +171,6 @@ section#params {
168
171
  display: none;
169
172
  }
170
173
 
171
- /*#paramsTable .groupTitle:hover .icon-closed{
172
- display: none;
173
- }
174
- #paramsTable .groupTitle:hover .icon-open{
175
- display: block;
176
- }*/
177
-
178
174
  #paramsTable .controlsLine{
179
175
  padding-top: 10px;
180
176
  }
@@ -197,20 +193,19 @@ span#paramsControls {
197
193
  color: red;
198
194
  top: 60px;
199
195
  left: 0;
200
- width: 33%;
201
196
  padding: 20px;
202
197
  z-index: 1;
203
198
  }
204
199
 
200
+ #stacktrace ul{
201
+ padding: 0px 0px 0px 15px;
202
+ margin: 0px;
203
+ }
204
+
205
205
  #container{
206
206
  position: relative;
207
207
  height: 100%;
208
208
  width: 100%;
209
- /*position: absolute;
210
- top: 0px;
211
- bottom: 0px;
212
- left: 0px;
213
- right: 0px;*/
214
209
  }
215
210
 
216
211
  h3 {
@@ -218,8 +213,9 @@ h3 {
218
213
  }
219
214
 
220
215
  #header {
216
+ box-sizing: border-box;
221
217
  position: absolute;
222
- left: 10px;
218
+ padding: 0px 10px;
223
219
  color: var(--main-text-color);
224
220
  width: 100%;
225
221
  display: inline-flex;
@@ -253,7 +249,7 @@ h3 {
253
249
  section {
254
250
  padding: 20px;
255
251
  box-shadow: 5px 5px 7px 2px rgba(0, 0, 0, 0.17);
256
- overflow: scroll;
252
+ overflow: auto;
257
253
  color: var(--main-text-color);
258
254
  z-index: 10;
259
255
  border: 1px solid #aaa;
@@ -262,8 +258,8 @@ section {
262
258
  section.popup-menu {
263
259
  position: absolute;
264
260
  top: 40px;
265
- right: 15px;
266
- height: 80%;
261
+ right: 10px;
262
+ max-height: 80%;
267
263
  }
268
264
 
269
265
  section.popup-menu h2 {
@@ -287,17 +283,19 @@ section.popup-menu ul {
287
283
  }
288
284
 
289
285
  #options {
286
+ background-color: rgba(255, 255, 255, 0.6);
290
287
  padding-left: 18px;
291
288
  }
292
289
 
293
- #options fieldset{
290
+ #options fieldset {
294
291
  border: none;
295
292
  display: table;
293
+ padding-inline: 0px;
296
294
  }
297
- #options fieldset label{
295
+ #options fieldset label {
298
296
  display: table-row;
299
297
  }
300
- #options fieldset input{
298
+ #options fieldset input {
301
299
  display: table-row;
302
300
  align-self: flex-end;
303
301
  }
@@ -306,7 +304,9 @@ section.popup-menu ul {
306
304
  }
307
305
 
308
306
  #editor {
309
- padding: 1px;
307
+ bottom: 10px;
308
+ max-height: none;
309
+ padding: 0px;
310
310
  font-size: 0.9em;
311
311
  width: 50%;
312
312
  }
@@ -317,6 +317,7 @@ textarea {
317
317
  }
318
318
 
319
319
  #help {
320
+ background-color: rgba(255, 255, 255, 0.6);
320
321
  }
321
322
 
322
323
  #help a {
@@ -358,7 +359,8 @@ button {
358
359
  border-color: black;
359
360
  border-radius: 0px;
360
361
  border-width: 1px;
361
- margin: 0px 5px 0px 5px;
362
+ margin: 0px 5px;
363
+ padding: 2px 6px;
362
364
  background-color: white;
363
365
  letter-spacing: .5px;
364
366
  outline: none;
@@ -366,12 +368,12 @@ button {
366
368
  opacity: 0.6;
367
369
  }
368
370
 
369
- /*button:hover{
370
- background-color:rgb(0, 153, 255);
371
- }*/
371
+ button > svg {
372
+ vertical-align: middle;
373
+ }
372
374
 
373
375
  button:hover svg {
374
- stroke:rgb(0, 153, 255);
376
+ stroke: rgb(0, 153, 255);
375
377
  }
376
378
 
377
379
  #toolbar button:hover {
@@ -423,16 +425,16 @@ input[type="checkbox"]:hover{
423
425
  }
424
426
 
425
427
  input.error::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
426
- color: red;
427
- opacity: 1; /* Firefox */
428
+ color: red;
429
+ opacity: 1; /* Firefox */
428
430
  }
429
431
 
430
432
  #shortcuts .error input:-ms-input-placeholder { /* Internet Explorer 10-11 */
431
- color: red;
433
+ color: red;
432
434
  }
433
435
 
434
436
  #shortcuts .error input::-ms-input-placeholder { /* Microsoft Edge */
435
- color: red;
437
+ color: red;
436
438
  }
437
439
 
438
440
  .icon {
package/css/style.css CHANGED
@@ -36,35 +36,6 @@ a:visited {
36
36
  z-index: 20;
37
37
  }
38
38
 
39
- #editFrame {
40
- /* display: none; */
41
-
42
- margin: 0;
43
- position: absolute;
44
- top: 0;
45
- bottom: 0;
46
- /* left: 0; */
47
- right: 0;
48
-
49
- width: 40%;
50
- font-weight: normal;
51
- }
52
-
53
- #editHandle {
54
- left: -25px;
55
- top: 45%;
56
- position: absolute;
57
- z-index: 6;
58
- opacity: 0.9;
59
- }
60
-
61
- #editFrame {
62
- transition: width 0.4s;
63
- -o-transition: width 0.4s;
64
- -moz-transition: width 0.4s;
65
- -webkit-transition: width 0.4s;
66
- }
67
-
68
39
  .ace_gutter {
69
40
  border-left: 1px solid #ccc;
70
41
  background: transparent !important;
@@ -127,20 +98,6 @@ canvas {
127
98
  z-index: 100;
128
99
  }
129
100
 
130
- .okButton {
131
- border: 2px solid #808080;
132
- border-radius: 4px;
133
- padding: 0.5em;
134
- padding-left: 2em;
135
- padding-right: 2em;
136
- margin-top: 3em;
137
- background: #eee;
138
- }
139
-
140
- .okButton:hover {
141
- background: #ccc;
142
- }
143
-
144
101
  #footer {
145
102
  font-size: 0.7em;
146
103
  text-align: left;
@@ -197,13 +154,6 @@ canvas {
197
154
  left: 0;
198
155
  }
199
156
 
200
- #menuHandle {
201
- right: -25px;
202
- top: 45%;
203
- position: absolute;
204
- z-index: 6;
205
- }
206
-
207
157
  #menu nav {
208
158
  position: relative;
209
159
  top: 50px;
@@ -245,34 +195,6 @@ canvas {
245
195
  font-size: 0.6em;
246
196
  }
247
197
 
248
- .info .infoView {
249
- text-align: center;
250
- font-weight: bold;
251
- color: #444;
252
- background: rgba(0,0,0,0.1);
253
- }
254
-
255
- .info .infoOperation {
256
- font-weight: bold;
257
- color: #602080;
258
- }
259
-
260
- .info .infoKey {
261
- font-weight: bold;
262
- color: #808080;
263
- }
264
-
265
- #menuVersion {
266
- text-align: center;
267
- font-size: 0.6em;
268
- color: #666;
269
- }
270
-
271
- .menuSubInfo {
272
- font-size: 0.6em;
273
- color: #666;
274
- }
275
-
276
198
  #examples {
277
199
  /* width: 60em; */
278
200
  width: auto;
@@ -294,16 +216,6 @@ canvas {
294
216
  list-style-type: none;
295
217
  }
296
218
 
297
- #examplesHandle {
298
- bottom: 0px;
299
- left: 45%;
300
- position: relative;
301
- z-index: 10;
302
- }
303
-
304
- .examplesSeparator {
305
- }
306
-
307
219
  #options {
308
220
  width: auto;
309
221
  z-index: 12;
@@ -317,44 +229,8 @@ canvas {
317
229
  font-size: 0.8em;
318
230
  }
319
231
 
320
- .optionGroup {
321
- border: 1px solid #ccc;
322
- border-radius: 5px;
323
- padding: 0.5em;
324
- margin: 0.5em;
325
- background: white;
326
- }
327
-
328
- .optionGroup input, .optionGroup select {
329
- background: #fea;
330
- border: none;
331
- }
332
-
333
- .optionInfo {
334
- font-size: 0.8em;
335
- color: #888;
336
- }
337
-
338
232
  /* arrows */
339
233
 
340
- .shift-scene {
341
- position: absolute;
342
- left: 50%;
343
- top: 50%;
344
- border-radius: 50%;
345
- border: 5px dotted #999;
346
- width: 160px;
347
- height: 160px;
348
- margin-top: -80px;
349
- margin-left: -80px;
350
- background: transparent;
351
- cursor: move;
352
- opacity: 0.8;
353
- display: none;
354
- }
355
- .shift-scene.active {
356
- display: block;
357
- }
358
234
  .arrow {
359
235
  width: 0px;
360
236
  height: 0px;
package/demo.html CHANGED
@@ -2,11 +2,12 @@
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3
3
  <head>
4
4
  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="description" content="JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D CAD designs with JavaScript code."/>
5
7
 
6
- <title>JSCAD.xyz</title>
8
+ <title>JSCAD - JavaScript CAD</title>
7
9
 
8
10
  <link rel="stylesheet" type="text/css" href="./css/demo.css">
9
- <link rel="stylesheet" type="text/css" href="./css/editor.css">
10
11
  <link rel="shortcut icon" href="imgs/favicon.png" type="image/x-png">
11
12
  <style>
12
13
  body{