@jscad/web 2.4.4 → 2.5.3

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/locales/ja.json CHANGED
@@ -12,13 +12,13 @@
12
12
 
13
13
  "Generation":"Geometry Generation",
14
14
  "enable geometry caching":"experimental geometry caching",
15
- "timeout for generation":"timeout for solids generation",
15
+ "timeout for generation":"図形の生成タイムアウト",
16
16
 
17
17
  "Storage": "ストレージ",
18
18
  "settings storage path":"ストレージ パス",
19
19
 
20
20
  "File Handling":"ファイル処理",
21
- "enable conversion to scripts":"Convert external formats to JSCAD scripts",
21
+ "enable conversion to scripts":"外部形式をスクリプトに変換",
22
22
 
23
23
  "Shortcuts":"キーボード ショートカット",
24
24
 
@@ -27,7 +27,7 @@
27
27
  "When":"場合",
28
28
  "type and hit enter":"type and hit enter",
29
29
 
30
- "not settable":"(not settable)",
30
+ "not settable":"(変更不可)",
31
31
  "see":"see",
32
32
 
33
33
  "grid":"グリッド",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jscad/web",
3
- "version": "2.4.4",
3
+ "version": "2.5.3",
4
4
  "description": "Web Application for JSCAD",
5
5
  "repository": "https://github.com/jscad/OpenJSCAD.org",
6
6
  "main": "src/index.js",
@@ -34,13 +34,12 @@
34
34
  ],
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@jscad/array-utils": "2.1.0",
38
- "@jscad/core": "2.4.0",
37
+ "@jscad/array-utils": "2.1.1",
38
+ "@jscad/core": "2.5.3",
39
39
  "@jscad/examples": "2.3.1",
40
- "@jscad/io": "2.1.0",
41
- "@jscad/modeling": "2.6.0",
42
- "@jscad/regl-renderer": "2.5.0",
43
- "@jscad/vtree": "2.0.10",
40
+ "@jscad/io": "2.2.3",
41
+ "@jscad/modeling": "2.7.1",
42
+ "@jscad/regl-renderer": "2.5.3",
44
43
  "@most/create": "2.0.1",
45
44
  "brace": "0.11.1",
46
45
  "codemirror": "5.57.0",
@@ -67,5 +66,5 @@
67
66
  "url": "https://opencollective.com/openjscad",
68
67
  "logo": "https://opencollective.com/openjscad/logo.txt"
69
68
  },
70
- "gitHead": "3d1d02f2863c65fd95406c7098c09297b3be1c10"
69
+ "gitHead": "95f05c5f11a53bff469a305d69b99f674dc7d6d3"
71
70
  }
@@ -4,10 +4,11 @@ const { createParamControls } = require('./parameterControls')
4
4
 
5
5
  const designParameters = (state, paramsCallbacktoStream, i18n) => {
6
6
  const { parameterValues, parameterDefinitions, parameterDefaults } = state.design
7
- const { controls } = createParamControls(
8
- Object.assign({}, parameterDefaults, parameterValues), parameterDefinitions, paramsCallbacktoStream.callback
9
- )
10
- return html`
7
+ try {
8
+ const { controls } = createParamControls(
9
+ Object.assign({}, parameterDefaults, parameterValues), parameterDefinitions, paramsCallbacktoStream.callback
10
+ )
11
+ return html`
11
12
  <section id='params' style='visibility:${state.design.parameterDefinitions.length === 0 ? 'hidden' : 'visible'};color:${state.themes.themeSettings.secondaryTextColor}'>
12
13
  <span id='paramsTable'>
13
14
  <table>
@@ -22,6 +23,10 @@ const designParameters = (state, paramsCallbacktoStream, i18n) => {
22
23
  </span>
23
24
  </section>
24
25
  `
26
+ } catch (e) {
27
+ e.stack = undefined // remove unhelpful stacktrace
28
+ state.status.error = e
29
+ }
25
30
  }
26
31
 
27
32
  module.exports = designParameters
@@ -33,9 +33,6 @@ const options = (state, i18n) => {
33
33
 
34
34
  <fieldset>
35
35
  <legend> <h3> ${i18n`Generation`}</h3> </legend>
36
- <label>${i18n`enable geometry caching`} ${i18n`see`} <a href='https://github.com/jscad/jscad-desktop#geometry-caching' target="_blank">docs</a>
37
- <input id='toggleVtreeMode' type='checkbox' checked=${state.design.vtreeMode}/>
38
- </label>
39
36
  <label>${i18n`timeout for generation`}
40
37
  <input id='solidsTimeout' type='number' min=0 max=200000 value=${state.design.solidsTimeOut} />
41
38
  </label>
@@ -232,11 +232,9 @@ const setup = (element) => {
232
232
  entities: []
233
233
  }
234
234
  if (type === 'webgl') {
235
- if (!gl.getExtension('OES_element_index_uint')) {
236
- error = 'Your browser uses an old version of WebGL without OES_element_index_uint. Please upgrade your browser to use this application'
235
+ if (gl.getExtension('OES_element_index_uint')) {
236
+ viewerOptions.glOptions.optionalExtensions = ['oes_element_index_uint']
237
237
  }
238
-
239
- viewerOptions.glOptions.optionalExtensions = ['oes_element_index_uint']
240
238
  }
241
239
  return { viewerOptions, camera, error }
242
240
  }
package/src/ui/umd.js DELETED
@@ -1,168 +0,0 @@
1
- /**
2
- * @prettier
3
- */
4
- // == OpenJSCAD.org, Copyright (c) 2017, Licensed under MIT License
5
- const AlertUserOfUncaughtExceptions = require('./errorDispatcher')
6
-
7
- const version = require('../../package.json').version
8
- const Processor = require('../jscad/processor-bare')
9
-
10
- let gProcessor = null
11
-
12
- /**
13
- * Initialize a jscad viewer. You can prevent the processor from creating
14
- * a new `canvas` element by passing a canvas element on `glOptions`.
15
- *
16
- * If the viewer element has a `design-url` attribute, that url will be loaded
17
- * with a `XMLHttpRequest`. Otherwise load the design using `setJsCad`.
18
- *
19
- * @param {Object} viewer - A DOM element to use as the base element.
20
- * @param {JscadViewerOptions} options - options passed to the viewer processor
21
- */
22
- const init = (viewer, options) => {
23
- const versionText = 'UMD OpenJSCAD.org Version ' + version
24
- console.log('umd init', versionText, options)
25
-
26
- // Show all exceptions to the user: // WARNING !! this is not practical at dev time
27
- AlertUserOfUncaughtExceptions()
28
-
29
- const design = viewer.getAttribute('design-url')
30
-
31
- gProcessor = new Processor(viewer, options)
32
-
33
- // load the given design
34
- if (design) {
35
- const xhr = new XMLHttpRequest()
36
- xhr.open('GET', design, true)
37
- gProcessor.setStatus('Loading ' + design)
38
-
39
- xhr.onload = function () {
40
- const source = this.responseText
41
-
42
- if (design.match(/\.jscad$/i) || design.match(/\.js$/i)) {
43
- gProcessor.setStatus('Processing ' + design)
44
- gProcessor.setJsCad(source, design)
45
- }
46
- }
47
- xhr.send()
48
- }
49
-
50
- return {
51
- /**
52
- * Start the processor on generating an output file. Once
53
- * the file has been created, the `
54
- * @param {FormatInfo} format
55
- */
56
- generateOutputFile: function (format) {
57
- return gProcessor.generateOutputFile(format)
58
- },
59
-
60
- clearOutputFile: function () {
61
- return gProcessor.clearOutputFile()
62
- },
63
-
64
- resetCamera () {
65
- return gProcessor.viewer.resetCamera()
66
- },
67
-
68
- abort () {
69
- return gProcessor.abort()
70
- },
71
-
72
- setJsCad (source, design) {
73
- gProcessor.setJsCad(source, design)
74
- },
75
-
76
- rebuildSolids () {
77
- gProcessor.rebuildSolids()
78
- }
79
- }
80
- }
81
-
82
- module.exports = init
83
-
84
- /**
85
- * @typedef {Object} XYZCoord
86
- * @property {number} x
87
- * @property {number} y
88
- * @property {number} z
89
- */
90
-
91
- /**
92
- * @typedef {Object} MinMax
93
- * @property {number} min
94
- * @property {number} max
95
- */
96
-
97
- /**
98
- * Camera settings
99
- * @typedef {Object} CameraSettings
100
- * @property {number} fov - field of view.
101
- * @property {XYZCoord} angle - view angle about XYZ axis.
102
- * @property {XYZCoord} position - initial position at XYZ.
103
- * @property {MinMax} clip - rendering outside this range is clipped.
104
- */
105
-
106
- /**
107
- * @typedef {Object} RgbaColor
108
- * @property {number} r - red (values 0.0 - 1.0).
109
- * @property {number} g - green (values 0.0 - 1.0).
110
- * @property {number} b - blue (values 0.0 - 1.0).
111
- * @property {number} a - alpha (values 0.0 - 1.0).
112
- */
113
-
114
- /**
115
- * Grid settings
116
- * @typedef {Object} GridSettings
117
- * @property {number} i - number of units between grid lines.
118
- * @property {RgbaColor} color - color.
119
- */
120
-
121
- /**
122
- * @typedef {Object} PlateSettings
123
- * @property {boolean} draw draw or not (default: true).
124
- * @property {number} size plate size (X and Y) (default: 200).
125
- * @property {GridSettings} m minor grid settings.
126
- * @property {GridSettings} M major grid settings.
127
- */
128
-
129
- /**
130
- *
131
- * @typedef {Object} PosNegColor
132
- * @property {RgbaColor} neg color in negative direction.
133
- * @property {RgbaColor} pos color in positive direction.
134
- */
135
-
136
- /**
137
- * @typedef {Object} AxisSettings
138
- * @property {boolean} draw - draw or not (default: false).
139
- * @property {PosNegColor} x
140
- * @property {PosNegColor} y
141
- * @property {PosNegColor} z
142
- */
143
-
144
- /**
145
- * @typedef {Object} LightGLOptions
146
- * @property {Object} canvas - Uses the HTML canvas given in 'options' or creates a new one if necessary.
147
- * @property {number} width - width applied to the canvas created when `options.canvas` is not set. (default: 800).
148
- * @property {number} height - height applied to the canvas created when `options.canvas` is not set. (default: 600).
149
- * @property {number} alpha - The alpha channel is disabled by default because it usually causes unintended transparencies in the canvas.
150
- *
151
- */
152
-
153
- /**
154
- * @typedef {Object} JscadViewerOptions
155
- * @property {PlateSettings} plate - The grid show in the viewer.
156
- * @property {CameraSettings} camera
157
- * @property {AxisSettings} axis
158
- * @property {LightGLOptions} glOptions - Options sent to `GL.create()`.
159
- * @property {Object} processor - options used by the viewer processor.
160
- */
161
-
162
- /**
163
- * @typedef {Object} ProcessorOptions
164
- * @property {Element} viewerContext - The main element that jscad uses. If no canvas element is set, jscad creates one.
165
- * @property {Element} viewerdiv - Jscad moves the canvas tag here, or creates one and places it here.
166
- * @property {Element} parameterstable - A Table element reference. The design parameters will be added here.
167
- * @property {Element} viewerCanvas - A Canvas element reference that will be used to draw the GL canvas.
168
- */