@abi-software/scaffoldvuer 1.11.0-demo.2 → 1.11.0

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.
@@ -1,5 +1,15 @@
1
1
  import { Label, THREE } from 'zincjs';
2
2
 
3
+ // This will be the config for nerves selection and highlight
4
+ export const NERVE_CONFIG = {
5
+ SELECTED_COLOUR: '#00ff00',
6
+ HIGHLIGHTED_COLOUR: '#ff0000',
7
+ DEFAULT_RADIUS: 1,
8
+ DEFAULT_RADIAL_SEGMENTS: 8,
9
+ ZOOM_RADIUS: 5,
10
+ ZOOM_RADIAL_SEGMENTS: 12,
11
+ }
12
+
3
13
  export const createListFromPrimitives = (primitives, list) => {
4
14
  if (primitives) {
5
15
  let id = "";
@@ -409,3 +419,20 @@ export const annotationFeaturesToPrimitives = (scene, features) => {
409
419
  }
410
420
  }
411
421
 
422
+ export const objectsToZincObjects = function(objects) {
423
+ const zincObjects = [];
424
+ for (let i = 0; i < objects.length; i++) {
425
+ let zincObject = objects[i].userData;
426
+ if (zincObject) {
427
+ if (zincObject.isGlyph || zincObject.isGlyphset) {
428
+ let glyphset = zincObject;
429
+ if (zincObject.isGlyph)
430
+ glyphset = zincObject.getGlyphset();
431
+ zincObjects.push(glyphset);
432
+ } else {
433
+ zincObjects.push(zincObject);
434
+ }
435
+ }
436
+ }
437
+ return zincObjects;
438
+ }
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from 'vite'
2
+ import rootConfig from './vite.config.js'
3
+ import { nodePolyfills } from 'vite-plugin-node-polyfills'
4
+ import vue from '@vitejs/plugin-vue'
5
+
6
+ // defineWorkspace provides a nice type hinting DX
7
+ export default defineConfig((configEnv) => {
8
+ const config = rootConfig(configEnv);
9
+ config.css.extract = false
10
+ config.plugins.push(
11
+ nodePolyfills({
12
+ // To add only specific polyfills, add them here. If no option is passed, adds all polyfills
13
+ include: ['path']
14
+ })
15
+ );
16
+ // config.plugins.push(
17
+ // cssInjectedByJsPlugin()
18
+ // );
19
+ config.plugins[0] = vue({
20
+ template: {
21
+ compilerOptions: {
22
+ isCustomElement: (tag) => tag.includes('scaffoldvuer-wc')
23
+ }
24
+ }
25
+ }),
26
+ config.build = {
27
+ lib: {
28
+ entry: './src/ScaffoldVuer-wc.js',
29
+ name: 'scaffoldvuer-wc',
30
+ // the proper extensions will be added
31
+ fileName: 'scaffoldvuer-wc'
32
+ },
33
+ }
34
+
35
+ return config;
36
+ })