geomui 0.5.51 → 0.5.55

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,43 +1,59 @@
1
- <script>import { ffix, radToDeg, paramListToVal } from "geometrix";
2
- import { downloadParams } from "./downloadParams";
3
- import { updateStore } from "./initStore";
4
- import { base } from "$app/paths";
5
- import { goto } from "$app/navigation";
6
- export let subD = {};
7
- export let origPartName = "";
8
- export let pLink;
9
- let subInsts = [];
10
- $: subInsts = Object.keys(subD);
11
- async function goToUrl(subInstName) {
12
- const subObj = subD[subInstName];
13
- updateStore(subObj.partName, paramListToVal(subObj.dparam), true);
14
- const rUrl = `${base}${pLink[subObj.partName]}`;
15
- goto(rUrl);
16
- }
17
- function dwnParams2(subInstName) {
18
- const iPartName = subD[subInstName].partName;
19
- const idparams = subD[subInstName].dparam;
20
- const aComment = `sub-design parameters of ${iPartName} from ${origPartName}`;
21
- downloadParams(iPartName, paramListToVal(idparams), aComment);
22
- }
23
- function printOrientation(vec) {
24
- let rStr = "[ ";
25
- rStr += `${ffix(radToDeg(vec[0]))}, `;
26
- rStr += `${ffix(radToDeg(vec[1]))}, `;
27
- rStr += `${ffix(radToDeg(vec[2]))} ]`;
28
- return rStr;
29
- }
30
- function printPosition(vec) {
31
- let rStr = "[ ";
32
- rStr += `${ffix(vec[0])}, `;
33
- rStr += `${ffix(vec[1])}, `;
34
- rStr += `${ffix(vec[2])} ]`;
35
- return rStr;
36
- }
37
- function printSet(changed) {
38
- const rStr = changed ? "Yes" : "";
39
- return rStr;
40
- }
1
+ <script lang="ts">
2
+ import type { tPosiOrien, tSubDesign, tAllLink } from 'geometrix';
3
+ import { ffix, radToDeg, paramListToVal } from 'geometrix';
4
+ //import { downloadParams, generateUrl } from './downloadParams';
5
+ import { downloadParams } from './downloadParams';
6
+ import { updateStore } from './initStore';
7
+ //import { onMount, createEventDispatcher } from 'svelte';
8
+ //import { browser } from '$app/environment';
9
+ //import { page } from '$app/stores';
10
+ import { base } from '$app/paths';
11
+ import { goto } from '$app/navigation';
12
+
13
+ export let subD: tSubDesign = {};
14
+ export let origPartName = '';
15
+ export let pLink: tAllLink;
16
+
17
+ let subInsts: string[] = [];
18
+ $: subInsts = Object.keys(subD);
19
+
20
+ async function goToUrl(subInstName: string) {
21
+ const subObj = subD[subInstName];
22
+ // modify the global store $storePV
23
+ updateStore(subObj.partName, paramListToVal(subObj.dparam), true);
24
+ //const rUrl = generateUrl(`${$page.url.origin}${base}/${subObj.link}`, paramListToVal(subObj.dparam), true);
25
+ //const rUrl = generateUrl(`${$page.url.origin}${base}/${subObj.link}`, {}, true);
26
+ const rUrl = `${base}${pLink[subObj.partName]}`;
27
+ //const rUrl = pLink[subObj.partName];
28
+ //console.log(`dbg505: ${rUrl}`);
29
+ //window.location.assign(rUrl);
30
+ //goto(rUrl, { invalidateAll: true });
31
+ goto(rUrl);
32
+ }
33
+ function dwnParams2(subInstName: string) {
34
+ const iPartName = subD[subInstName].partName;
35
+ const idparams = subD[subInstName].dparam;
36
+ const aComment = `sub-design parameters of ${iPartName} from ${origPartName}`;
37
+ downloadParams(iPartName, paramListToVal(idparams), aComment);
38
+ }
39
+ function printOrientation(vec: tPosiOrien): string {
40
+ let rStr = '[ ';
41
+ rStr += `${ffix(radToDeg(vec[0]))}, `;
42
+ rStr += `${ffix(radToDeg(vec[1]))}, `;
43
+ rStr += `${ffix(radToDeg(vec[2]))} ]`;
44
+ return rStr;
45
+ }
46
+ function printPosition(vec: tPosiOrien): string {
47
+ let rStr = '[ ';
48
+ rStr += `${ffix(vec[0])}, `;
49
+ rStr += `${ffix(vec[1])}, `;
50
+ rStr += `${ffix(vec[2])} ]`;
51
+ return rStr;
52
+ }
53
+ function printSet(changed: boolean): string {
54
+ const rStr = changed ? 'Yes' : '';
55
+ return rStr;
56
+ }
41
57
  </script>
42
58
 
43
59
  <section>
@@ -50,7 +66,7 @@ function printSet(changed) {
50
66
  <li>
51
67
  <input type="checkbox" id="cb_{subInst}" class="toggle" checked={false} />
52
68
  <label for="cb_{subInst}" class="label">
53
- <div class="arrow" />
69
+ <div class="arrow"></div>
54
70
  {subInst}
55
71
  </label>
56
72
  <button on:click={() => goToUrl(subInst)}
@@ -1,21 +1,23 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { tAllLink } from 'geometrix';
3
- declare const __propDef: {
4
- props: {
5
- subD?: any;
6
- origPartName?: string;
7
- pLink: tAllLink;
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
8
12
  };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- exports?: {} | undefined;
14
- bindings?: string | undefined;
15
- };
16
- export type SubDesignProps = typeof __propDef.props;
17
- export type SubDesignEvents = typeof __propDef.events;
18
- export type SubDesignSlots = typeof __propDef.slots;
19
- export default class SubDesign extends SvelteComponent<SubDesignProps, SubDesignEvents, SubDesignSlots> {
13
+ z_$$bindings?: Bindings;
20
14
  }
21
- export {};
15
+ declare const SubDesign: $$__sveltets_2_IsomorphicComponent<{
16
+ subD?: any;
17
+ origPartName?: string;
18
+ pLink: tAllLink;
19
+ }, {
20
+ [evt: string]: CustomEvent<any>;
21
+ }, {}, {}, string>;
22
+ type SubDesign = InstanceType<typeof SubDesign>;
23
+ export default SubDesign;
@@ -1,66 +1,74 @@
1
- <script>import { onDestroy } from "svelte";
2
- export let tMax = 10;
3
- export let tStep = 0.1;
4
- export let tUpdate = 500;
5
- export let simTime = 0;
6
- let intervalID = null;
7
- let speed = 0;
8
- let inc;
9
- const speedMax = 4;
10
- function clearInterval2() {
11
- if (intervalID !== null) {
12
- clearInterval(intervalID);
13
- intervalID = null;
14
- }
15
- }
16
- function simRoutine() {
17
- if (inc < 0 && simTime <= 0) {
18
- simTime = tMax;
19
- } else if (inc > 0 && simTime >= tMax) {
20
- simTime = 0;
21
- } else {
22
- simTime += inc;
23
- }
24
- }
25
- function setInterval2() {
26
- const delay = tUpdate / 2 ** (Math.abs(speed) - 1);
27
- inc = speed < 0 ? -tStep : tStep;
28
- intervalID = setInterval(simRoutine, delay);
29
- }
30
- function simZero() {
31
- clearInterval2();
32
- simTime = 0;
33
- speed = 0;
34
- }
35
- function simDecrem() {
36
- clearInterval2();
37
- speed = 0;
38
- inc = -tStep;
39
- simRoutine();
40
- }
41
- function simIncrem() {
42
- clearInterval2();
43
- speed = 0;
44
- inc = tStep;
45
- simRoutine();
46
- }
47
- function simPlayBackward() {
48
- clearInterval2();
49
- speed = Math.max(speed - 1, -speedMax);
50
- setInterval2();
51
- }
52
- function simPlayForward() {
53
- clearInterval2();
54
- speed = Math.min(speed + 1, speedMax);
55
- setInterval2();
56
- }
57
- function simPause() {
58
- clearInterval2();
59
- speed = 0;
60
- }
61
- onDestroy(() => {
62
- clearInterval2();
63
- });
1
+ <script lang="ts">
2
+ import { onDestroy } from 'svelte';
3
+
4
+ export let tMax = 10;
5
+ export let tStep = 0.1;
6
+ export let tUpdate = 500; // ms
7
+ export let simTime = 0;
8
+
9
+ let intervalID: ReturnType<typeof setTimeout> | null = null;
10
+ let speed = 0;
11
+ let inc: number;
12
+ const speedMax = 4;
13
+ function clearInterval2() {
14
+ if (intervalID !== null) {
15
+ clearInterval(intervalID);
16
+ intervalID = null;
17
+ }
18
+ }
19
+ function simRoutine() {
20
+ if (inc < 0 && simTime <= 0) {
21
+ simTime = tMax;
22
+ } else if (inc > 0 && simTime >= tMax) {
23
+ simTime = 0;
24
+ } else {
25
+ simTime += inc;
26
+ }
27
+ }
28
+ function setInterval2() {
29
+ const delay = tUpdate / 2 ** (Math.abs(speed) - 1);
30
+ inc = speed < 0 ? -tStep : tStep;
31
+ intervalID = setInterval(simRoutine, delay);
32
+ //console.log(`dbg909: ${delay} ======`);
33
+ }
34
+ function simZero() {
35
+ clearInterval2();
36
+ simTime = 0;
37
+ speed = 0;
38
+ }
39
+ function simDecrem() {
40
+ clearInterval2();
41
+ speed = 0;
42
+ inc = -tStep;
43
+ simRoutine();
44
+ //console.log(`dbg059: ${simTime}`);
45
+ }
46
+ function simIncrem() {
47
+ clearInterval2();
48
+ speed = 0;
49
+ inc = tStep;
50
+ simRoutine();
51
+ //console.log(`dbg069: ${simTime}`);
52
+ }
53
+ function simPlayBackward() {
54
+ clearInterval2();
55
+ speed = Math.max(speed - 1, -speedMax);
56
+ setInterval2();
57
+ //console.log(`dbg954: ${speed} ======`);
58
+ }
59
+ function simPlayForward() {
60
+ clearInterval2();
61
+ speed = Math.min(speed + 1, speedMax);
62
+ setInterval2();
63
+ //console.log(`dbg961: ${speed} ======`);
64
+ }
65
+ function simPause() {
66
+ clearInterval2();
67
+ speed = 0;
68
+ }
69
+ onDestroy(() => {
70
+ clearInterval2();
71
+ });
64
72
  </script>
65
73
 
66
74
  <nav>
@@ -1,21 +1,23 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- tMax?: number;
5
- tStep?: number;
6
- tUpdate?: number;
7
- simTime?: number;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
8
11
  };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- exports?: {} | undefined;
14
- bindings?: string | undefined;
15
- };
16
- export type TimeControlProps = typeof __propDef.props;
17
- export type TimeControlEvents = typeof __propDef.events;
18
- export type TimeControlSlots = typeof __propDef.slots;
19
- export default class TimeControl extends SvelteComponent<TimeControlProps, TimeControlEvents, TimeControlSlots> {
12
+ z_$$bindings?: Bindings;
20
13
  }
21
- export {};
14
+ declare const TimeControl: $$__sveltets_2_IsomorphicComponent<{
15
+ tMax?: number;
16
+ tStep?: number;
17
+ tUpdate?: number;
18
+ simTime?: number;
19
+ }, {
20
+ [evt: string]: CustomEvent<any>;
21
+ }, {}, {}, string>;
22
+ type TimeControl = InstanceType<typeof TimeControl>;
23
+ export default TimeControl;
@@ -1,20 +1,37 @@
1
- <script>import { createEventDispatcher } from "svelte";
2
- const dispatch = createEventDispatcher();
3
- function theClick(actionName) {
4
- dispatch("myevent", {
5
- action: actionName
6
- });
7
- }
1
+ <script lang="ts">
2
+ import { createEventDispatcher } from 'svelte';
3
+
4
+ const dispatch = createEventDispatcher();
5
+
6
+ function theClick(actionName: string) {
7
+ dispatch('myevent', {
8
+ action: actionName
9
+ });
10
+ }
8
11
  </script>
9
12
 
10
13
  <nav>
11
- <button on:click={() => theClick('zoomInit')}><div class="zero" /></button>
12
- <button on:click={() => theClick('zoomIn')}><div class="zoomin" /></button>
13
- <button on:click={() => theClick('zoomOut')}><div class="zoomout" /></button>
14
- <button on:click={() => theClick('moveLeft')}><div class="arrowleft" /></button>
15
- <button on:click={() => theClick('moveRight')}><div class="arrowright" /></button>
16
- <button on:click={() => theClick('moveUp')}><div class="arrowup" /></button>
17
- <button on:click={() => theClick('moveDown')}><div class="arrowdown" /></button>
14
+ <button aria-labelledby="zoomInit" on:click={() => theClick('zoomInit')}
15
+ ><div class="zero"></div></button
16
+ >
17
+ <button aria-labelledby="zoomIn" on:click={() => theClick('zoomIn')}
18
+ ><div class="zoomin"></div></button
19
+ >
20
+ <button aria-labelledby="zoomOut" on:click={() => theClick('zoomOut')}
21
+ ><div class="zoomout"></div></button
22
+ >
23
+ <button aria-labelledby="moveLeft" on:click={() => theClick('moveLeft')}
24
+ ><div class="arrowleft"></div></button
25
+ >
26
+ <button aria-labelledby="moveRight" on:click={() => theClick('moveRight')}
27
+ ><div class="arrowright"></div></button
28
+ >
29
+ <button aria-labelledby="moveUp" on:click={() => theClick('moveUp')}
30
+ ><div class="arrowup"></div></button
31
+ >
32
+ <button aria-labelledby="moveDown" on:click={() => theClick('moveDown')}
33
+ ><div class="arrowdown"></div></button
34
+ >
18
35
  </nav>
19
36
 
20
37
  <style>/*
@@ -1,18 +1,20 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- myevent: CustomEvent<any>;
6
- } & {
7
- [evt: string]: CustomEvent<any>;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
8
11
  };
9
- slots: {};
10
- exports?: {} | undefined;
11
- bindings?: string | undefined;
12
- };
13
- export type ZoomControlProps = typeof __propDef.props;
14
- export type ZoomControlEvents = typeof __propDef.events;
15
- export type ZoomControlSlots = typeof __propDef.slots;
16
- export default class ZoomControl extends SvelteComponent<ZoomControlProps, ZoomControlEvents, ZoomControlSlots> {
12
+ z_$$bindings?: Bindings;
17
13
  }
18
- export {};
14
+ declare const ZoomControl: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ myevent: CustomEvent<any>;
16
+ } & {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {}, {}, string>;
19
+ type ZoomControl = InstanceType<typeof ZoomControl>;
20
+ export default ZoomControl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geomui",
3
- "version": "0.5.51",
3
+ "version": "0.5.55",
4
4
  "description": "The svelte-library of the webapp-UI of Parametrix",
5
5
  "private": false,
6
6
  "repository": {
@@ -50,7 +50,7 @@
50
50
  ]
51
51
  },
52
52
  "scripts": {
53
- "cp_pgdsvg": "shx cp -r ../../node_modules/designix/dist/pgdsvg static/",
53
+ "cp_pgdsvg": "fse copy ../../node_modules/designix/dist/pgdsvg static/pgdsvg",
54
54
  "dev": "vite dev",
55
55
  "build": "vite build && npm run package",
56
56
  "preview": "vite preview",
@@ -63,38 +63,39 @@
63
63
  "lint": "prettier --check . && eslint .",
64
64
  "ci": "run-s cp_pgdsvg build lint check test:unit:once",
65
65
  "format": "prettier --write .",
66
- "clean": "shx rm -fr .svelte-kit build node_modules dist static/pgdsvg"
66
+ "clean": "rimraf .svelte-kit build node_modules dist static/pgdsvg"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@sveltejs/kit": "^2.0.3",
70
- "svelte": "^4.0.0"
70
+ "svelte": "^4.0.1||^5.0.0"
71
71
  },
72
72
  "dependencies": {
73
- "geometrix": "^0.5.48"
73
+ "geometrix": "^0.5.50"
74
74
  },
75
75
  "devDependencies": {
76
- "@sveltejs/adapter-auto": "^3.2.4",
77
- "@sveltejs/adapter-static": "^3.0.4",
78
- "@sveltejs/kit": "^2.5.27",
79
- "@sveltejs/package": "^2.3.5",
80
- "@sveltejs/vite-plugin-svelte": "^3.1.2",
76
+ "@atao60/fse-cli": "^0.1.9",
77
+ "@sveltejs/adapter-auto": "^3.3.0",
78
+ "@sveltejs/adapter-static": "^3.0.5",
79
+ "@sveltejs/kit": "^2.7.2",
80
+ "@sveltejs/package": "^2.3.6",
81
+ "@sveltejs/vite-plugin-svelte": "^4.0.0",
81
82
  "@types/eslint": "^9.6.1",
82
- "designix": "^0.5.49",
83
- "eslint": "^9.10.0",
83
+ "designix": "^0.5.51",
84
+ "eslint": "^9.13.0",
84
85
  "eslint-config-prettier": "^9.1.0",
85
- "eslint-plugin-svelte": "^2.44.0",
86
- "globals": "^15.9.0",
87
- "npm-run-all": "^4.1.5",
86
+ "eslint-plugin-svelte": "^2.46.0",
87
+ "globals": "^15.11.0",
88
+ "npm-run-all2": "^7.0.0",
88
89
  "prettier": "^3.3.3",
89
- "prettier-plugin-svelte": "^3.2.6",
90
- "publint": "^0.2.10",
91
- "sass": "^1.78.0",
92
- "shx": "^0.3.4",
93
- "svelte": "^4.2.19",
94
- "svelte-check": "^4.0.2",
95
- "typescript": "^5.6.2",
96
- "typescript-eslint": "^8.5.0",
97
- "vite": "^5.4.5",
98
- "vitest": "^2.1.1"
90
+ "prettier-plugin-svelte": "^3.2.7",
91
+ "publint": "^0.2.11",
92
+ "rimraf": "^6.0.1",
93
+ "sass": "^1.80.3",
94
+ "svelte": "^5.0.5",
95
+ "svelte-check": "^4.0.5",
96
+ "typescript": "^5.6.3",
97
+ "typescript-eslint": "^8.11.0",
98
+ "vite": "^5.4.9",
99
+ "vitest": "^2.1.3"
99
100
  }
100
101
  }