@jscad/web 2.6.11 → 2.6.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jscad/web",
3
- "version": "2.6.11",
3
+ "version": "2.6.13",
4
4
  "description": "Web Application for JSCAD",
5
5
  "homepage": "https://openjscad.xyz/",
6
6
  "repository": "https://github.com/jscad/OpenJSCAD.org",
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "build": "browserify src/index.js -o dist/jscad-web.min.js -g uglifyify --standalone jscadWeb",
11
11
  "dev": "budo demo.js --port=8081 --css ./css/demo.css --live -- -b",
12
- "postinstall": "node postInstall.js && node -e \"console.log('\\u001b[35m\\u001b[1mLove JSCAD? You can now donate to our open collective:\\u001b[22m\\u001b[39m\\n > \\u001b[34mhttps://opencollective.com/openjscad/donate\\u001b[0m')\"",
12
+ "postinstall": "node postInstall.js",
13
13
  "test": "ava 'src/**/*.test.js' --verbose --timeout 2m",
14
14
  "version": "npm run build && git add dist"
15
15
  },
@@ -36,11 +36,11 @@
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
38
  "@jscad/array-utils": "2.1.4",
39
- "@jscad/core": "2.6.13",
39
+ "@jscad/core": "2.6.15",
40
40
  "@jscad/examples": "2.4.2",
41
- "@jscad/io": "2.4.12",
42
- "@jscad/modeling": "2.12.6",
43
- "@jscad/regl-renderer": "2.6.13",
41
+ "@jscad/io": "2.4.14",
42
+ "@jscad/modeling": "2.13.0",
43
+ "@jscad/regl-renderer": "2.6.15",
44
44
  "@most/create": "2.0.1",
45
45
  "brace": "0.11.1",
46
46
  "codemirror": "5.65.2",
@@ -67,5 +67,5 @@
67
67
  "url": "https://opencollective.com/openjscad",
68
68
  "logo": "https://opencollective.com/openjscad/logo.txt"
69
69
  },
70
- "gitHead": "11a9a2d9235d804360116f776076c9f3237a3eb0"
70
+ "gitHead": "602bb2a3a2c2c7c21315e2801804dd1ec0cbd3f8"
71
71
  }
package/postInstall.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // this copies the examples folder from the @jscad/examples repository locally
2
2
  const path = require('path')
3
- const examplesSrc = path.resolve('./node_modules/@jscad/examples')
3
+ const examplesSrc = path.resolve('../examples')
4
4
  const copydir = require('copy-dir')
5
5
  const fs = require('fs')
6
6
  const DocBlock = require('docblock')
package/remote.pl CHANGED
@@ -19,7 +19,7 @@ my $q = new CGI;
19
19
  my $maxSize = 10_000_000; # [bytes], max size of file
20
20
  my $maxTime = 60; # [s], max download time
21
21
 
22
- cacheLocal($q->param('url'));
22
+ cacheLocal(scalar $q->param('url'));
23
23
 
24
24
  opendir(D,$dir);
25
25
  foreach(readdir(D)) {
package/src/index.js CHANGED
@@ -110,8 +110,13 @@ const makeJscad = async (targetElement, options) => {
110
110
  // increase the count of jscad instances in this page
111
111
  instances += 1
112
112
 
113
- setTimeout(() => { document.getElementById('toggleAxes').click() }, 100)
114
- setTimeout(() => { document.getElementById('toggleAxes').click() }, 200)
113
+ // See ui/flow/viewer.js for the initial states
114
+ //setTimeout(() => { document.getElementById('toggleAxes').click() }, 100)
115
+ //setTimeout(() => { document.getElementById('toggleGrid').click() }, 200)
116
+ //setTimeout(() => { document.getElementById('toggleAutoZoom').click() }, 200)
117
+
118
+ // click on an example for the initial view
119
+ setTimeout(() => { document.getElementById('example1-1').click() }, 200)
115
120
 
116
121
  // we return a function to allow setting/modifying params
117
122
  const mainParams = callbackToObservable()
@@ -272,7 +272,7 @@ test.cb('zooms (from mousewheel event) direct element', (t) => {
272
272
  })
273
273
  })
274
274
 
275
- test.cb('zooms (from pinch)', (t) => {
275
+ test.skip('zooms (from pinch)', (t) => {
276
276
  const zooms = pointerGestures(t.context.baseStreams).zooms
277
277
 
278
278
  const div = t.context.div
@@ -296,7 +296,7 @@ test.cb('zooms (from pinch)', (t) => {
296
296
  })
297
297
  })
298
298
 
299
- test.cb('zooms (from pinch) direct element', (t) => {
299
+ test.skip('zooms (from pinch) direct element', (t) => {
300
300
  const div = t.context.div
301
301
  const zooms = pointerGestures(div).zooms
302
302
 
@@ -9,10 +9,10 @@ const reducers = {
9
9
  background: [1, 1, 1, 1],
10
10
  meshColor: [0, 0.6, 1, 1],
11
11
  autoRotate: false,
12
- autoZoom: false
12
+ autoZoom: true
13
13
  },
14
14
  grid: {
15
- show: false,
15
+ show: true,
16
16
  color: [1, 1, 1, 0.1]
17
17
  },
18
18
  axes: {
@@ -6,17 +6,21 @@ const examplesData = require('../../../examples/examples.json')
6
6
  const examples = (state, i18n) => {
7
7
  const baseUrl = new URL(window.location.href)
8
8
  const origin = (baseUrl.origin === 'null') ? 'file://' : baseUrl.origin
9
- let newPath = origin + path.dirname(baseUrl.pathname)
10
- newPath = newPath.endsWith('/') ? newPath : newPath + path.sep
9
+ let newPath = origin + baseUrl.pathname
10
+ newPath = newPath.endsWith(path.sep) ? newPath : newPath + path.sep
11
11
 
12
12
  const examplesMenus = []
13
+ let groupId = 0
13
14
  for (const groupName in examplesData) {
15
+ groupId++
14
16
  if (!Object.prototype.hasOwnProperty.call(examplesData, groupName)) continue
15
- const examplesElements = examplesData[groupName].map((example) =>
16
- html`<li>
17
- <a class="example" title="${example.description}" data-path="${newPath}${example.filePath}" href="#"> ${example.title} </a>
17
+
18
+ const examplesElements = examplesData[groupName].map((example, i) => {
19
+ const id = `example${groupId}-${i}`
20
+ return html`<li>
21
+ <a class="example" id="${id}" title="${example.description}" data-path="${newPath}${example.filePath}" href="#"> ${example.title} </a>
18
22
  </li>`
19
- )
23
+ })
20
24
  examplesMenus.push(html`<li>${groupName}<ul class="examples-list">${examplesElements}</ul></li>`)
21
25
  }
22
26
  return html`<ul class="examples-group">${examplesMenus}</ul>`