@selvajs/ui 7.0.3-beta.1 → 7.0.3-beta.2

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.
@@ -6,7 +6,7 @@
6
6
  import type { SolveFn } from '@selvajs/solve/shared';
7
7
  import type { PresetLabels } from '../../types/presetLabels';
8
8
  import { createSolvingIndicator } from '../../compute/solving.svelte';
9
- import { createRequestResponseDriver } from '@selvajs/solve/client';
9
+ import { createComputeDriver } from '../../compute/computeDriver';
10
10
  import type {
11
11
  RetainedSolveResult,
12
12
  SolveEventSource,
@@ -14,7 +14,6 @@
14
14
  SolveSettlement
15
15
  } from '@selvajs/solve/client';
16
16
  import SolveMessages from './SolveMessages.svelte';
17
- import { meshPolicy } from '@selvajs/visualization/parse';
18
17
  import type { ThreeViewer } from '@selvajs/visualization/render';
19
18
  import { useSolveSession } from '../../compute/useSolveSession.svelte';
20
19
  import { useFooterItem } from '../../composables/useFooterItem.svelte';
@@ -171,13 +170,8 @@
171
170
  // The session owns the value/lifecycle state machine; the driver is its transport. The
172
171
  // session is passed as a getter because the two reference each other.
173
172
  // svelte-ignore state_referenced_locally
174
- const driver = createRequestResponseDriver(onSolve, () => session, {
173
+ const driver = createComputeDriver(onSolve, () => session, {
175
174
  solveDeadlineMs,
176
- // The driver's memo caches whole solve results, meshes included, and the viewer disposes
177
- // what it renders on the next scene update. `@selvajs/solve` keeps meshes opaque, so the
178
- // three.js clone/dispose rules come from the renderer that owns them. Without this, a memo
179
- // hit serves an already-disposed mesh.
180
- meshPolicy,
181
175
  // `isSolving` lives on the driver, which the session can't observe — republish so the
182
176
  // spinner and disabled states track it.
183
177
  onChange: () => session.notify(),
@@ -0,0 +1,9 @@
1
+ import { type RequestResponseDriverOptions, type SolveDriver, type SolveReporter } from '@selvajs/solve/client';
2
+ import type { SolveFn } from '@selvajs/solve/shared';
3
+ /**
4
+ * The request/response driver `ComputeApp` solves through. Its memo caches whole solve results,
5
+ * meshes included, and the viewer disposes what it renders on the next scene update.
6
+ * `@selvajs/solve` keeps meshes opaque, so the three.js clone/dispose rules come from the renderer
7
+ * that owns them: without `meshPolicy`, a memo hit serves an already-disposed mesh.
8
+ */
9
+ export declare function createComputeDriver(onSolve: SolveFn, getReporter: () => SolveReporter, options: Omit<RequestResponseDriverOptions<unknown>, 'meshPolicy'>): SolveDriver;
@@ -0,0 +1,11 @@
1
+ import { createRequestResponseDriver } from '@selvajs/solve/client';
2
+ import { meshPolicy } from '@selvajs/visualization/parse';
3
+ /**
4
+ * The request/response driver `ComputeApp` solves through. Its memo caches whole solve results,
5
+ * meshes included, and the viewer disposes what it renders on the next scene update.
6
+ * `@selvajs/solve` keeps meshes opaque, so the three.js clone/dispose rules come from the renderer
7
+ * that owns them: without `meshPolicy`, a memo hit serves an already-disposed mesh.
8
+ */
9
+ export function createComputeDriver(onSolve, getReporter, options) {
10
+ return createRequestResponseDriver(onSolve, getReporter, { ...options, meshPolicy });
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/ui",
3
- "version": "7.0.3-beta.1",
3
+ "version": "7.0.3-beta.2",
4
4
  "description": "Shared UI components and utilities for Selva applications",
5
5
  "license": "MIT",
6
6
  "author": "VektorNode",
@@ -62,10 +62,10 @@
62
62
  "svelte": "^5",
63
63
  "tailwind-variants": "^3.3.1",
64
64
  "three": "^0.187.0",
65
- "@selvajs/compute": "^5.0.1",
66
- "@selvajs/schemas": "^5.3.1-beta.0",
67
- "@selvajs/solve": "^2.1.0-beta.1",
68
- "@selvajs/visualization": "^1.7.1-beta.0"
65
+ "@selvajs/compute": "^5.1.0-beta.0",
66
+ "@selvajs/solve": "^2.1.0-beta.3",
67
+ "@selvajs/schemas": "^5.3.1-beta.1",
68
+ "@selvajs/visualization": "^1.7.1-beta.1"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "three": {
@@ -94,11 +94,11 @@
94
94
  "svelte": "5.57.3",
95
95
  "tailwind-variants": "^3.3.1",
96
96
  "vitest": "^5.0.5",
97
- "@selvajs/compute": "5.0.1",
97
+ "@selvajs/compute": "5.1.0-beta.0",
98
98
  "@selvajs/config": "0.0.4",
99
- "@selvajs/schemas": "5.3.1-beta.0",
100
- "@selvajs/visualization": "1.7.1-beta.0",
101
- "@selvajs/solve": "2.1.0-beta.1"
99
+ "@selvajs/schemas": "5.3.1-beta.1",
100
+ "@selvajs/solve": "2.1.0-beta.3",
101
+ "@selvajs/visualization": "1.7.1-beta.1"
102
102
  },
103
103
  "imports": {
104
104
  "#lib": "./src/lib/index.js",
@@ -6,7 +6,7 @@
6
6
  import type { SolveFn } from '@selvajs/solve/shared';
7
7
  import type { PresetLabels } from '../../types/presetLabels';
8
8
  import { createSolvingIndicator } from '../../compute/solving.svelte';
9
- import { createRequestResponseDriver } from '@selvajs/solve/client';
9
+ import { createComputeDriver } from '../../compute/computeDriver';
10
10
  import type {
11
11
  RetainedSolveResult,
12
12
  SolveEventSource,
@@ -14,7 +14,6 @@
14
14
  SolveSettlement
15
15
  } from '@selvajs/solve/client';
16
16
  import SolveMessages from './SolveMessages.svelte';
17
- import { meshPolicy } from '@selvajs/visualization/parse';
18
17
  import type { ThreeViewer } from '@selvajs/visualization/render';
19
18
  import { useSolveSession } from '../../compute/useSolveSession.svelte';
20
19
  import { useFooterItem } from '../../composables/useFooterItem.svelte';
@@ -171,13 +170,8 @@
171
170
  // The session owns the value/lifecycle state machine; the driver is its transport. The
172
171
  // session is passed as a getter because the two reference each other.
173
172
  // svelte-ignore state_referenced_locally
174
- const driver = createRequestResponseDriver(onSolve, () => session, {
173
+ const driver = createComputeDriver(onSolve, () => session, {
175
174
  solveDeadlineMs,
176
- // The driver's memo caches whole solve results, meshes included, and the viewer disposes
177
- // what it renders on the next scene update. `@selvajs/solve` keeps meshes opaque, so the
178
- // three.js clone/dispose rules come from the renderer that owns them. Without this, a memo
179
- // hit serves an already-disposed mesh.
180
- meshPolicy,
181
175
  // `isSolving` lives on the driver, which the session can't observe — republish so the
182
176
  // spinner and disabled states track it.
183
177
  onChange: () => session.notify(),
@@ -0,0 +1,22 @@
1
+ import {
2
+ createRequestResponseDriver,
3
+ type RequestResponseDriverOptions,
4
+ type SolveDriver,
5
+ type SolveReporter
6
+ } from '@selvajs/solve/client';
7
+ import type { SolveFn } from '@selvajs/solve/shared';
8
+ import { meshPolicy } from '@selvajs/visualization/parse';
9
+
10
+ /**
11
+ * The request/response driver `ComputeApp` solves through. Its memo caches whole solve results,
12
+ * meshes included, and the viewer disposes what it renders on the next scene update.
13
+ * `@selvajs/solve` keeps meshes opaque, so the three.js clone/dispose rules come from the renderer
14
+ * that owns them: without `meshPolicy`, a memo hit serves an already-disposed mesh.
15
+ */
16
+ export function createComputeDriver(
17
+ onSolve: SolveFn,
18
+ getReporter: () => SolveReporter,
19
+ options: Omit<RequestResponseDriverOptions<unknown>, 'meshPolicy'>
20
+ ): SolveDriver {
21
+ return createRequestResponseDriver(onSolve, getReporter, { ...options, meshPolicy });
22
+ }