@jscad/web 2.5.3 → 2.5.4
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/CHANGELOG.md +11 -0
- package/data/themes.js +40 -40
- package/dist/jscad-web.min.js +46 -46
- package/examples/core/colors/basicColors.js +0 -1
- package/examples/core/colors/colorCube.js +10 -12
- package/examples/core/curves/bezier/extrudeAlongPath.js +20 -22
- package/examples/core/curves/bezier/simpleExtrude.js +4 -6
- package/examples/core/extrusions/basicExtrusions.js +3 -3
- package/examples/core/hulls/hull2D.js +3 -5
- package/examples/core/hulls/hull3D.js +3 -5
- package/examples/core/measurements/measureAggregateBounds.js +5 -7
- package/examples/core/measurements/measureAreaAndVolume.js +6 -8
- package/examples/core/measurements/measureBounds.js +5 -7
- package/examples/core/other/orientation.js +2 -3
- package/examples/core/primitives/dodecahedron.js +1 -3
- package/examples/core/primitives/polyhedron.js +12 -14
- package/examples/core/primitives/primitives2D.js +1 -3
- package/examples/core/primitives/primitives3D.js +2 -4
- package/examples/core/primitives/roundedCuboid.js +7 -9
- package/examples/core/primitives/sphere.js +10 -12
- package/examples/core/primitives/torus.js +20 -22
- package/examples/core/text/text.js +5 -8
- package/examples/core/transforms/align.js +5 -7
- package/examples/core/transforms/center.js +6 -8
- package/examples/import/AMFImport/index.js +1 -3
- package/examples/import/STLImport/index.js +4 -6
- package/examples/import/SVGImport/index.js +0 -1
- package/examples/module-design/mountPlate.js +5 -9
- package/examples/module-design/subFolder/sphereShape.js +1 -3
- package/examples/parameters/allParamTypes.js +19 -21
- package/examples/parameters/balloons.js +15 -26
- package/examples/parameters/gear.js +9 -11
- package/package.json +7 -7
- package/postInstall.js +3 -3
- package/src/index.js +0 -1
- package/src/most-gestures/drags.js +15 -0
- package/src/most-gestures/zooms.js +20 -1
- package/src/sideEffects/dat/index.js +0 -6
- package/src/sideEffects/dom/index.js +0 -2
- package/src/sideEffects/fileDialog/index.js +0 -2
- package/src/sideEffects/i18n/index.js +0 -1
- package/src/sideEffects/localFs/index.js +1 -4
- package/src/sideEffects/localFs/walkFileTree.js +1 -7
- package/src/sideEffects/localStorage/index.js +0 -1
- package/src/sideEffects/state/index.js +0 -11
- package/src/ui/flow/design.js +5 -26
- package/src/ui/flow/dom.js +0 -1
- package/src/ui/flow/flowOut.js +0 -24
- package/src/ui/flow/languages.js +0 -1
- package/src/ui/flow/shortcuts.js +0 -1
- package/src/ui/flow/themes.js +1 -1
- package/src/ui/flow/tools.js +0 -6
- package/src/ui/views/editor.js +0 -6
- package/src/ui/views/parameterControls.js +0 -1
- package/src/ui/views/status.js +4 -2
- package/src/utils/keys.js +0 -1
package/src/ui/flow/flowOut.js
CHANGED
|
@@ -2,24 +2,6 @@ const makeReactions = (inputs) => {
|
|
|
2
2
|
const { sinks, outputs$ } = inputs
|
|
3
3
|
const { store, fs, http, https, i18n, dom, solidWorker, state, dat } = sinks
|
|
4
4
|
|
|
5
|
-
/* outputs$
|
|
6
|
-
.filter(x => 'sink' in x && x.sink === 'dom')
|
|
7
|
-
.forEach(x => console.log(' out to dom', x))
|
|
8
|
-
outputs$
|
|
9
|
-
.filter(x => 'sink' in x && x.sink === 'state')
|
|
10
|
-
.forEach(x => console.log(' out to state', x))
|
|
11
|
-
|
|
12
|
-
outputs$
|
|
13
|
-
.filter(x => 'sink' in x && x.sink === 'i18n')
|
|
14
|
-
.forEach(x => console.log(' out to i18n', x))
|
|
15
|
-
|
|
16
|
-
outputs$
|
|
17
|
-
.filter(x => 'sink' in x && x.sink === 'store')
|
|
18
|
-
.forEach(x => console.log(' out to store', x))
|
|
19
|
-
outputs$
|
|
20
|
-
.filter(x => 'sink' in x && x.sink === 'fs')
|
|
21
|
-
.forEach(x => console.log(' out to fs', x)) */
|
|
22
|
-
|
|
23
5
|
// output to dom
|
|
24
6
|
dom(require('./dom')(inputs))
|
|
25
7
|
// output to i18n
|
|
@@ -40,12 +22,6 @@ const makeReactions = (inputs) => {
|
|
|
40
22
|
state(outputs$.filter((x) => 'sink' in x && x.sink === 'state'))
|
|
41
23
|
|
|
42
24
|
dat(outputs$.filter((x) => 'sink' in x && x.sink === 'dat'))
|
|
43
|
-
|
|
44
|
-
// titlebar & store side effects
|
|
45
|
-
// FIXME/ not compatible with multiple instances !!
|
|
46
|
-
/* titleBar.sink(
|
|
47
|
-
state.map(state => state.appTitle).skipRepeats()
|
|
48
|
-
) */
|
|
49
25
|
}
|
|
50
26
|
|
|
51
27
|
module.exports = makeReactions
|
package/src/ui/flow/languages.js
CHANGED
package/src/ui/flow/shortcuts.js
CHANGED
|
@@ -155,7 +155,6 @@ const actions = ({ sources }) => {
|
|
|
155
155
|
const triggerFromShortcut$ = keyCombos$
|
|
156
156
|
.thru(withLatestFrom(reducers.triggerShortcut, sources.state))
|
|
157
157
|
.filter((x) => x !== undefined)
|
|
158
|
-
// .tap(x => console.log('triggerFromShortcut', x))
|
|
159
158
|
|
|
160
159
|
// this means we wait until the data here has been initialized before saving
|
|
161
160
|
const requestLoadSettings$ = initialize$
|
package/src/ui/flow/themes.js
CHANGED
|
@@ -14,7 +14,7 @@ const reducers = {
|
|
|
14
14
|
},
|
|
15
15
|
setTheme: (state, active) => {
|
|
16
16
|
const available = require('../../../data/themes')
|
|
17
|
-
const themeData = available[active] ? available[active] : available
|
|
17
|
+
const themeData = available[active] ? available[active] : available.light
|
|
18
18
|
const viewer = state.viewer ? merge({}, state.viewer, themeData.viewer) : themeData.viewer
|
|
19
19
|
const themes = Object.assign({}, state.themes, { available, active, themeSettings: themeData })
|
|
20
20
|
return { viewer, themes }
|
package/src/ui/flow/tools.js
CHANGED
|
@@ -8,12 +8,6 @@ const actions = ({ sources }) => {
|
|
|
8
8
|
sources.dom.select('#toggleEditor').events('click').map((event) => 'editor'),
|
|
9
9
|
sources.dom.select('#toggleHelp').events('click').map((event) => 'help'),
|
|
10
10
|
sources.dom.select('.example').events('mouseup').map((event) => undefined)
|
|
11
|
-
/* sources.state // we changed designs
|
|
12
|
-
.filter(state => state.design)
|
|
13
|
-
.map(state => state.design.mainPath)
|
|
14
|
-
.skipRepeatsWith((mainPath, previousMainPath) => mainPath !== previousMainPath)
|
|
15
|
-
// .map(_ => undefined)
|
|
16
|
-
.tap(x => console.log('changed design')) */
|
|
17
11
|
])
|
|
18
12
|
.thru(withLatestFrom((state, tool) => {
|
|
19
13
|
const activeTool = state.activeTool === tool ? undefined : tool
|
package/src/ui/views/editor.js
CHANGED
|
@@ -26,10 +26,8 @@ const openscadOpenJscadParser = require('@jscad/openscad-openjscad-translator')
|
|
|
26
26
|
const setUpEditor = (element, gProcessor) => {
|
|
27
27
|
const langTools = ace.acequire('ace/ext/language_tools')
|
|
28
28
|
|
|
29
|
-
console.log('langTools', langTools)
|
|
30
29
|
const flowCompleter = {
|
|
31
30
|
getCompletions: (editor, session, pos, prefix, callback) => {
|
|
32
|
-
console.log('getCompletions')
|
|
33
31
|
// your code
|
|
34
32
|
}
|
|
35
33
|
}
|
|
@@ -93,7 +91,6 @@ const setUpEditor = (element, gProcessor) => {
|
|
|
93
91
|
document.body.addEventListener('keydown', (evt) => {
|
|
94
92
|
if (evt.key === 'F5') {
|
|
95
93
|
evt.preventDefault()
|
|
96
|
-
// console.log('no accidental reloading!')
|
|
97
94
|
runExec(gEditor)
|
|
98
95
|
}
|
|
99
96
|
})
|
|
@@ -184,12 +181,9 @@ const editorWrapper = (state, editorCallbackToStream) => {
|
|
|
184
181
|
// editor.resize(true)
|
|
185
182
|
// editor.renderer.updateFull()
|
|
186
183
|
/* ace.config.loadModule('ace/snippets/javascript', function (ba) {
|
|
187
|
-
console.log('boo', ba)
|
|
188
184
|
})
|
|
189
185
|
ace.config.loadModule('ace/ext/language_tools', function () {
|
|
190
|
-
console.log('gna')
|
|
191
186
|
const bla = require('brace/snippets/javascript')
|
|
192
|
-
console.log('foo', bla)
|
|
193
187
|
editor.insertSnippet(bli);
|
|
194
188
|
}) */
|
|
195
189
|
editor.setOptions({
|
|
@@ -245,7 +245,6 @@ const createRadioControl = (definition, prevValue) => {
|
|
|
245
245
|
* @returns {[*]}
|
|
246
246
|
*/
|
|
247
247
|
const createInputControl = (definition, prevValue) => {
|
|
248
|
-
// console.log('parameterControls.createInputControl')
|
|
249
248
|
const controlList = [
|
|
250
249
|
{ type: 'text', control: 'text', required: ['type', 'name'], initial: '' },
|
|
251
250
|
{ type: 'int', control: 'number', required: ['type', 'name'], initial: 0 },
|
package/src/ui/views/status.js
CHANGED
|
@@ -7,7 +7,8 @@ const status = (state, paramsCallbacktoStream) => {
|
|
|
7
7
|
const errorLine = status.error !== undefined && status.error.lineno ? `Line: ${status.error.lineno}` : ''
|
|
8
8
|
const errorStack = status.error !== undefined && status.error.stack ? `Stack: ${status.error.stack}` : ''
|
|
9
9
|
|
|
10
|
-
const statusMessage = status.error !== undefined
|
|
10
|
+
const statusMessage = status.error !== undefined
|
|
11
|
+
? html`<span>
|
|
11
12
|
<div>
|
|
12
13
|
ERROR:
|
|
13
14
|
</div>
|
|
@@ -20,7 +21,8 @@ const status = (state, paramsCallbacktoStream) => {
|
|
|
20
21
|
<div>
|
|
21
22
|
${errorStack}
|
|
22
23
|
</div>
|
|
23
|
-
</span>`
|
|
24
|
+
</span>`
|
|
25
|
+
: ''
|
|
24
26
|
|
|
25
27
|
// ? `Error: ${status.error.message} line: ${status.error.lineno}, filename:${status.error.filename} stack: ${status.error.stack}` : ''
|
|
26
28
|
// ${statusMessage}
|