@selvajs/ui 5.0.0-beta.3 → 5.0.0-beta.5

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.
@@ -4,7 +4,6 @@
4
4
  import {
5
5
  initThree,
6
6
  updateScene,
7
- removeEdges,
8
7
  LOOKS,
9
8
  type Look,
10
9
  type ThreeInitializerOptions,
@@ -119,6 +118,8 @@
119
118
  let measureTool: MeasureTool | null = null;
120
119
  let grid: Grid | null = null;
121
120
  let applyEdges: ((root: THREE.Object3D) => void) | null = null;
121
+ let clearEdges: ((root: THREE.Object3D) => void) | null = null;
122
+ let invalidate: (() => void) | null = null;
122
123
  let setLook: ((look: Look) => void) | null = null;
123
124
  let updateGridScale: (() => void) | null = null;
124
125
  let fitToView: (() => void) | null = null;
@@ -201,6 +202,8 @@
201
202
  grid = init.grid;
202
203
  grid?.setVisible(gridVisible);
203
204
  applyEdges = init.applyEdges;
205
+ clearEdges = init.clearEdges;
206
+ invalidate = init.invalidate;
204
207
  setLook = init.setLook;
205
208
  updateGridScale = init.updateGridScale;
206
209
  fitToView = init.fitToView;
@@ -236,6 +239,7 @@
236
239
  if (!grid) return;
237
240
  gridVisible = !gridVisible;
238
241
  grid.setVisible(gridVisible);
242
+ invalidate?.();
239
243
  }
240
244
 
241
245
  function setRenderStyle(look: Look) {
@@ -244,12 +248,13 @@
244
248
  setLook(look);
245
249
  }
246
250
 
247
- // Add/remove crease-edge overlays on the current scene content. addEdges is idempotent per mesh, so
248
- // a redundant apply is harmless; removeEdges is its refcounted inverse.
251
+ // Add/remove crease-edge overlays on the current scene content. applyEdges is idempotent per mesh
252
+ // (and attaches large meshes' overlays async, off the main thread); clearEdges is its inverse
253
+ // it also cancels in-flight attaches and stands down the screen-space fallback for capped meshes.
249
254
  function applyEdgeState() {
250
255
  if (!scene) return;
251
256
  if (edgesVisible) applyEdges?.(scene);
252
- else removeEdges(scene);
257
+ else clearEdges?.(scene);
253
258
  }
254
259
 
255
260
  function toggleEdges() {
@@ -268,6 +273,8 @@
268
273
  // Rescale the grid to the new content's extent so cells and fade match the part size.
269
274
  updateGridScale?.();
270
275
  sceneVersion++;
276
+ // New solve content — repaint now rather than on the render loop's safety interval.
277
+ invalidate?.();
271
278
  });
272
279
 
273
280
  if (!viewerInitialized && meshes.length > 0) {
@@ -1 +1 @@
1
- export declare function getDefaultValue(paramType: string): unknown;
1
+ export { getDefaultValue } from '@selvajs/schemas';
@@ -1,13 +1,4 @@
1
- export function getDefaultValue(paramType) {
2
- switch (paramType) {
3
- case 'number':
4
- case 'integer':
5
- return 0;
6
- case 'boolean':
7
- return false;
8
- case 'text':
9
- return '';
10
- default:
11
- return null;
12
- }
13
- }
1
+ // Moved to @selvajs/schemas so server-side callers can share it without pulling
2
+ // in the UI package. Re-exported here to keep existing `@selvajs/ui` importers
3
+ // working.
4
+ export { getDefaultValue } from '@selvajs/schemas';
package/package.json CHANGED
@@ -1,8 +1,18 @@
1
1
  {
2
2
  "name": "@selvajs/ui",
3
- "version": "5.0.0-beta.3",
3
+ "version": "5.0.0-beta.5",
4
4
  "description": "Shared UI components and utilities for Selva applications",
5
5
  "license": "MIT",
6
+ "author": "VektorNode",
7
+ "homepage": "https://github.com/VektorNode/selva#readme",
8
+ "bugs": "https://github.com/VektorNode/selva/issues",
9
+ "keywords": [
10
+ "svelte",
11
+ "sveltekit",
12
+ "components",
13
+ "ui",
14
+ "selva"
15
+ ],
6
16
  "publishConfig": {
7
17
  "access": "public"
8
18
  },
@@ -50,8 +60,8 @@
50
60
  "svelte": "^5",
51
61
  "tailwind-variants": "^3.2.2",
52
62
  "three": "^0.184.0",
53
- "@selvajs/compute": "^3.1.0-beta.12",
54
- "@selvajs/schemas": "^4.7.0-beta.0"
63
+ "@selvajs/schemas": "^4.7.0-beta.1",
64
+ "@selvajs/compute": "^3.1.0-beta.13"
55
65
  },
56
66
  "peerDependenciesMeta": {
57
67
  "three": {
@@ -81,7 +91,7 @@
81
91
  "tailwind-variants": "^3.2.2",
82
92
  "vitest": "^3.2.7",
83
93
  "@selvajs/config": "0.0.2",
84
- "@selvajs/schemas": "4.7.0-beta.0"
94
+ "@selvajs/schemas": "4.7.0-beta.1"
85
95
  },
86
96
  "scripts": {
87
97
  "predev": "node ../../scripts/sync-shared-assets.js",
@@ -4,7 +4,6 @@
4
4
  import {
5
5
  initThree,
6
6
  updateScene,
7
- removeEdges,
8
7
  LOOKS,
9
8
  type Look,
10
9
  type ThreeInitializerOptions,
@@ -119,6 +118,8 @@
119
118
  let measureTool: MeasureTool | null = null;
120
119
  let grid: Grid | null = null;
121
120
  let applyEdges: ((root: THREE.Object3D) => void) | null = null;
121
+ let clearEdges: ((root: THREE.Object3D) => void) | null = null;
122
+ let invalidate: (() => void) | null = null;
122
123
  let setLook: ((look: Look) => void) | null = null;
123
124
  let updateGridScale: (() => void) | null = null;
124
125
  let fitToView: (() => void) | null = null;
@@ -201,6 +202,8 @@
201
202
  grid = init.grid;
202
203
  grid?.setVisible(gridVisible);
203
204
  applyEdges = init.applyEdges;
205
+ clearEdges = init.clearEdges;
206
+ invalidate = init.invalidate;
204
207
  setLook = init.setLook;
205
208
  updateGridScale = init.updateGridScale;
206
209
  fitToView = init.fitToView;
@@ -236,6 +239,7 @@
236
239
  if (!grid) return;
237
240
  gridVisible = !gridVisible;
238
241
  grid.setVisible(gridVisible);
242
+ invalidate?.();
239
243
  }
240
244
 
241
245
  function setRenderStyle(look: Look) {
@@ -244,12 +248,13 @@
244
248
  setLook(look);
245
249
  }
246
250
 
247
- // Add/remove crease-edge overlays on the current scene content. addEdges is idempotent per mesh, so
248
- // a redundant apply is harmless; removeEdges is its refcounted inverse.
251
+ // Add/remove crease-edge overlays on the current scene content. applyEdges is idempotent per mesh
252
+ // (and attaches large meshes' overlays async, off the main thread); clearEdges is its inverse
253
+ // it also cancels in-flight attaches and stands down the screen-space fallback for capped meshes.
249
254
  function applyEdgeState() {
250
255
  if (!scene) return;
251
256
  if (edgesVisible) applyEdges?.(scene);
252
- else removeEdges(scene);
257
+ else clearEdges?.(scene);
253
258
  }
254
259
 
255
260
  function toggleEdges() {
@@ -268,6 +273,8 @@
268
273
  // Rescale the grid to the new content's extent so cells and fade match the part size.
269
274
  updateGridScale?.();
270
275
  sceneVersion++;
276
+ // New solve content — repaint now rather than on the render loop's safety interval.
277
+ invalidate?.();
271
278
  });
272
279
 
273
280
  if (!viewerInitialized && meshes.length > 0) {
@@ -1,13 +1,4 @@
1
- export function getDefaultValue(paramType: string): unknown {
2
- switch (paramType) {
3
- case 'number':
4
- case 'integer':
5
- return 0;
6
- case 'boolean':
7
- return false;
8
- case 'text':
9
- return '';
10
- default:
11
- return null;
12
- }
13
- }
1
+ // Moved to @selvajs/schemas so server-side callers can share it without pulling
2
+ // in the UI package. Re-exported here to keep existing `@selvajs/ui` importers
3
+ // working.
4
+ export { getDefaultValue } from '@selvajs/schemas';