geomui 0.5.61 → 1.0.1

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.
@@ -10,8 +10,9 @@
10
10
  import { sParams } from './stateParams.svelte';
11
11
  import { downloadParams, generateUrl } from './downloadParams';
12
12
  import { browser } from '$app/environment';
13
- import { page } from '$app/stores';
13
+ import { page } from '$app/state';
14
14
  import { base } from '$app/paths';
15
+ import { afterNavigate } from '$app/navigation';
15
16
 
16
17
  // props
17
18
  interface Props {
@@ -40,6 +41,10 @@
40
41
  let htableVis: tHTableVis = $state(makeHTableVis(makeHTable(pDef.params)));
41
42
 
42
43
  // initialization
44
+ afterNavigate(() => {
45
+ paramSvg = checkPict(pDef.params[0].name);
46
+ htableVis = makeHTableVis(makeHTable(pDef.params));
47
+ });
43
48
  // tolerant applyParamVal
44
49
  function tolerantApply(iPartName: string, ipVal: tParamVal): [string, boolean] {
45
50
  let rMsg = '';
@@ -86,9 +91,37 @@
86
91
  const rApplyWarn = applyWarn1 || applyWarn2;
87
92
  return [rMsg, rApplyWarn];
88
93
  }
89
- function initParams2() {
94
+ async function fetchAndLoad(fUrl: string) {
95
+ try {
96
+ const res = await fetch(fUrl);
97
+ if (!res.ok) {
98
+ throw `err627: error while fetching ${fUrl}`;
99
+ }
100
+ const txt = await res.text();
101
+ const [paramJson] = parseParamFile(txt);
102
+ [loadMsg, applyWarn] = tolerantApply(paramJson.partName, paramJson.pVal);
103
+ inputComment = paramJson.comment;
104
+ } catch (emsg) {
105
+ let errMsg = 'err223: error by fetching px file\n';
106
+ errMsg += emsg as string;
107
+ loadMsg = errMsg;
108
+ applyWarn = true;
109
+ }
110
+ }
111
+ async function initParams2() {
90
112
  if (browser) {
91
- const searchParams = new URLSearchParams($page.url.search);
113
+ const searchParams = new URLSearchParams(page.url.search);
114
+ const cPxUrl = 'pxUrl';
115
+ if (searchParams.has(cPxUrl)) {
116
+ const fUrl = searchParams.get(cPxUrl);
117
+ searchParams.delete(cPxUrl);
118
+ if (fUrl) {
119
+ await fetchAndLoad(fUrl);
120
+ } else {
121
+ loadMsg = 'err123: error by parsing URL-search-params\n';
122
+ applyWarn = true;
123
+ }
124
+ }
92
125
  const pVal2: tParamVal = {};
93
126
  for (const [kk, vv] of searchParams) {
94
127
  //console.log(`dbg638: ${kk} ${vv}`);
@@ -187,7 +220,7 @@
187
220
  }
188
221
  // Save as URL
189
222
  function generateUrl2(): string {
190
- const url1 = generateUrl($page.url.href, sParams[pDef.partName], false);
223
+ const url1 = generateUrl(page.url.href, sParams[pDef.partName], false);
191
224
  return url1.toString();
192
225
  }
193
226
  function openModalUrl() {
@@ -218,7 +251,7 @@
218
251
  interface tHTableSection {
219
252
  sectionName: string;
220
253
  sectionID: string;
221
- sectionVisible: boolean;
254
+ sectionVisCollapse: boolean;
222
255
  params: tParam[];
223
256
  }
224
257
  function makeHTable(iParams: tParam[]): tHTableSection[] {
@@ -226,7 +259,7 @@
226
259
  const sectionMain: tHTableSection = {
227
260
  sectionName: 'main',
228
261
  sectionID: 'g0main',
229
- sectionVisible: false,
262
+ sectionVisCollapse: false,
230
263
  params: []
231
264
  };
232
265
  let section = sectionMain;
@@ -238,7 +271,7 @@
238
271
  const sectionNew: tHTableSection = {
239
272
  sectionName: param.name,
240
273
  sectionID: `g${sectionID}${param.name}`,
241
- sectionVisible: true,
274
+ sectionVisCollapse: true,
242
275
  params: []
243
276
  };
244
277
  section = sectionNew;
@@ -252,7 +285,7 @@
252
285
  function makeHTableVis(iHTable: tHTableSection[]): tHTableVis {
253
286
  const rVis: tHTableVis = {};
254
287
  for (const section of iHTable) {
255
- rVis[section.sectionID] = section.sectionVisible;
288
+ rVis[section.sectionID] = section.sectionVisCollapse;
256
289
  }
257
290
  return rVis;
258
291
  }
@@ -21,6 +21,7 @@
21
21
  import Drawing from './Drawing.svelte';
22
22
  import SubDesign from './SubDesign.svelte';
23
23
  import { sParams } from './stateParams.svelte';
24
+ import { afterNavigate } from '$app/navigation';
24
25
 
25
26
  // properties
26
27
  interface Props {
@@ -74,7 +75,10 @@
74
75
 
75
76
  // state
76
77
  let simTime: number = $state(0);
77
- let selFace: string = $state(checkFace(Object.keys(fgeom(0, sParams[pDef.partName]).fig), ''));
78
+ let selFace: string = $state(c_ParametrixAll);
79
+ afterNavigate(() => {
80
+ selFace = checkFace(Object.keys(fgeom(0, sParams[pDef.partName]).fig), '');
81
+ });
78
82
  // internal state that should not need state
79
83
  let exportFace: string = $state('zip'); // TODO5 keep state otherwise svelte complains
80
84
 
@@ -4,7 +4,7 @@
4
4
  //import { downloadParams, generateUrl } from './downloadParams';
5
5
  import { downloadParams } from './downloadParams';
6
6
  import { updateStore } from './initStore';
7
- //import { page } from '$app/stores';
7
+ //import { page } from '$app/state';
8
8
  import { base } from '$app/paths';
9
9
  import { goto } from '$app/navigation';
10
10
 
@@ -24,8 +24,8 @@
24
24
  const subObj = subD[subInstName];
25
25
  // modify the global store sParams
26
26
  updateStore(subObj.partName, paramListToVal(subObj.dparam), true);
27
- //const rUrl = generateUrl(`${$page.url.origin}${base}/${subObj.link}`, paramListToVal(subObj.dparam), true);
28
- //const rUrl = generateUrl(`${$page.url.origin}${base}/${subObj.link}`, {}, true);
27
+ //const rUrl = generateUrl(`${page.url.origin}${base}/${subObj.link}`, paramListToVal(subObj.dparam), true);
28
+ //const rUrl = generateUrl(`${page.url.origin}${base}/${subObj.link}`, {}, true);
29
29
  const rUrl = `${base}${pLink[subObj.partName]}`;
30
30
  //const rUrl = pLink[subObj.partName];
31
31
  //console.log(`dbg505: ${rUrl}`);
@@ -107,6 +107,7 @@ nav > button {
107
107
  border-width: 0.1rem;
108
108
  border-radius: 0.2rem;
109
109
  border-color: darkBlue;
110
+ padding: 0;
110
111
  margin: 0;
111
112
  background-color: lightBlue;
112
113
  }
@@ -39,6 +39,7 @@ nav > button {
39
39
  border-width: 0.1rem;
40
40
  border-radius: 0.2rem;
41
41
  border-color: darkGreen;
42
+ padding: 0;
42
43
  margin: 0.1rem;
43
44
  background-color: lightGreen;
44
45
  }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import OneDesign from './OneDesign.svelte';
2
- export { OneDesign };
2
+ import { initStore } from './initStore';
3
+ export { OneDesign, initStore };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Reexport your entry components here
2
2
  import OneDesign from './OneDesign.svelte';
3
- //import { initStore } from './initStore';
4
- //export { OneDesign, initStore };
5
- export { OneDesign };
3
+ import { initStore } from './initStore';
4
+ export { OneDesign, initStore };
5
+ //export { OneDesign };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geomui",
3
- "version": "0.5.61",
3
+ "version": "1.0.1",
4
4
  "description": "The svelte-library of the webapp-UI of Parametrix",
5
5
  "private": false,
6
6
  "repository": {
@@ -52,7 +52,7 @@
52
52
  "scripts": {
53
53
  "cp_pgdsvg": "fse copy ../../node_modules/designix/dist/pgdsvg static/pgdsvg",
54
54
  "dev": "vite dev",
55
- "build": "vite build && npm run package",
55
+ "build": "svelte-kit sync && vite build && npm run package",
56
56
  "preview": "vite preview",
57
57
  "package": "svelte-kit sync && svelte-package && publint",
58
58
  "prepublishOnly": "npm run package",
@@ -66,21 +66,21 @@
66
66
  "clean": "rimraf .svelte-kit build node_modules dist static/pgdsvg"
67
67
  },
68
68
  "peerDependencies": {
69
- "@sveltejs/kit": "^2.7.0",
70
- "svelte": "^5.1.0"
69
+ "@sveltejs/kit": "^2.16.0",
70
+ "svelte": "^5.19.0"
71
71
  },
72
72
  "dependencies": {
73
- "geometrix": "^0.5.57"
73
+ "geometrix": "^1.0.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@atao60/fse-cli": "^0.1.9",
77
77
  "@sveltejs/adapter-auto": "^4.0.0",
78
78
  "@sveltejs/adapter-static": "^3.0.8",
79
- "@sveltejs/kit": "^2.16.0",
80
- "@sveltejs/package": "^2.3.7",
79
+ "@sveltejs/kit": "^2.16.1",
80
+ "@sveltejs/package": "^2.3.9",
81
81
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
82
82
  "@types/eslint": "^9.6.1",
83
- "designix": "^0.5.58",
83
+ "designix": "^1.0.0",
84
84
  "eslint": "^9.18.0",
85
85
  "eslint-config-prettier": "^10.0.1",
86
86
  "eslint-plugin-svelte": "^2.46.1",
@@ -91,11 +91,11 @@
91
91
  "publint": "^0.3.2",
92
92
  "rimraf": "^6.0.1",
93
93
  "sass": "^1.83.4",
94
- "svelte": "^5.19.0",
94
+ "svelte": "^5.19.2",
95
95
  "svelte-check": "^4.1.4",
96
96
  "typescript": "^5.7.3",
97
- "typescript-eslint": "^8.20.0",
98
- "vite": "^6.0.7",
99
- "vitest": "^3.0.2"
97
+ "typescript-eslint": "^8.21.0",
98
+ "vite": "^6.0.11",
99
+ "vitest": "^3.0.3"
100
100
  }
101
101
  }