@happyvertical/smrt-svelte 0.43.5 → 0.43.7

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.
package/README.md CHANGED
@@ -64,7 +64,9 @@ state.
64
64
 
65
65
  Use the web binding when a table should render one remote page instead of
66
66
  hydrating its whole collection. It exposes `rows`, `page`, `total`,
67
- `loading`, `refreshing`, `stale`, `error`, `retry`, and `lastUpdated`.
67
+ `loading`, `refreshing`, `stale`, `error`, `retry`, `lastUpdated`, and the
68
+ latest applied `result`. The result getter also follows query-scoped live
69
+ replacements, so consumers can keep envelope metadata in sync with the rows.
68
70
 
69
71
  ```svelte
70
72
  <script lang="ts">
@@ -348,7 +350,20 @@ clears it.
348
350
 
349
351
  **UI**: `Badge`, `Button`, `Card`, `Pagination`
350
352
 
351
- **Display**: `ConfidenceBadge`, `CurrencyDisplay`, `DateDisplay`, `Icon`, `StatusBadge`
353
+ **Display** (from `@happyvertical/smrt-ui`): `ConfidenceBadge`, `CurrencyDisplay`, `DateDisplay`, `Icon`, `StatusBadge`
354
+
355
+ `CurrencyDisplay` accepts Commerce-compatible string currency fields. It trims
356
+ and uppercases ISO 4217 codes before formatting, defaults to CAD, and renders an
357
+ accessible inline error for malformed or unsupported codes instead of throwing
358
+ and interrupting the surrounding collection render.
359
+ The historical `unit="cents"` option means ISO minor units, so currencies with
360
+ zero or three minor digits are scaled correctly. Minor-unit amounts must be
361
+ finite safe integers; fractional or unsafe numeric values render an accessible
362
+ inline error. `unit="dollars"` means major units.
363
+ ISO codes whose minor unit is `N.A.` require `unit="dollars"`; minor-unit mode
364
+ renders an accessible inline error for those codes, while major-unit mode uses
365
+ a stable two-digit display policy. CAD and USD retain their symbol display;
366
+ all other currencies render their ISO code for deterministic SSR hydration.
352
367
 
353
368
  **Feedback**: `ConfirmDialog`, `LoadingOverlay`, `Modal`, `ProgressBar`
354
369
 
@@ -64,6 +64,7 @@ describe('remoteQuery', () => {
64
64
  await mounted.view.execute(request);
65
65
  flushSync();
66
66
  expect(mounted.target.textContent).toContain('svelte-request:Ada');
67
+ expect(mounted.view.result?.rows).toEqual([{ id: 'Ada', name: 'Ada' }]);
67
68
  mounted.teardown();
68
69
  await collection.cleanup();
69
70
  });
@@ -8,6 +8,8 @@ export interface RemoteQueryBinding<TData extends object = object> {
8
8
  readonly stale: boolean;
9
9
  readonly error: unknown;
10
10
  readonly lastUpdated: number | undefined;
11
+ /** Latest applied result, including query-scoped live replacements. */
12
+ readonly result?: SmrtWebDataQueryResult | undefined;
11
13
  readonly request: SmrtWebDataQueryRequest | undefined;
12
14
  execute(request: SmrtWebDataQueryRequest, options?: SmrtWebQueryRunOptions): Promise<SmrtWebDataQueryResult>;
13
15
  refresh(options?: Omit<SmrtWebQueryRunOptions, 'mode' | 'force'>): Promise<SmrtWebDataQueryResult | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"remote-query.svelte.d.ts","sourceRoot":"","sources":["../../src/web/remote-query.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAE3B,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,kBAAkB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IAC/D,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAA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,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,OAAO,EAAE,uBAAuB,GAAG,SAAS,CAAC;IACtD,OAAO,CACL,OAAO,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACnC,OAAO,CACL,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,OAAO,CAAC,GACvD,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;IAC/C,KAAK,IAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;IACrD,aAAa,IAAI,4BAA4B,GAAG,SAAS,CAAC;IAC1D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,MAAM,EAC9C,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACpC,SAAS,EAAE,qBAAqB,EAChC,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,kBAAkB,CAAC,KAAK,CAAC,CA2D3B"}
@@ -41,6 +41,9 @@ export function remoteQuery(collection, transport, options) {
41
41
  get lastUpdated() {
42
42
  return snapshot.lastUpdated;
43
43
  },
44
+ get result() {
45
+ return snapshot.result;
46
+ },
44
47
  get request() {
45
48
  return activeRequest;
46
49
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-svelte",
3
- "version": "0.43.5",
3
+ "version": "0.43.7",
4
4
  "description": "Svelte 5 components for SMRT user management - auth, users, tenants, roles, permissions, groups",
5
5
  "type": "module",
6
6
  "smrtRawPrimitives": "strict",
@@ -123,10 +123,10 @@
123
123
  "@tanstack/db": "^0.6.14",
124
124
  "@tanstack/svelte-db": "^0.1.91",
125
125
  "esm-env": "^1.2.2",
126
- "@happyvertical/smrt-languages": "0.43.5",
127
- "@happyvertical/smrt-ui": "0.43.5",
128
- "@happyvertical/smrt-types": "0.43.5",
129
- "@happyvertical/smrt-web": "0.43.5"
126
+ "@happyvertical/smrt-ui": "0.43.7",
127
+ "@happyvertical/smrt-languages": "0.43.7",
128
+ "@happyvertical/smrt-web": "0.43.7",
129
+ "@happyvertical/smrt-types": "0.43.7"
130
130
  },
131
131
  "peerDependencies": {
132
132
  "@huggingface/transformers": ">=3.8.1",
@@ -166,8 +166,8 @@
166
166
  "typescript": "5.9.3",
167
167
  "vite": "8.1.4",
168
168
  "vitest": "4.1.10",
169
- "@happyvertical/smrt-core": "0.43.5",
170
- "@happyvertical/smrt-scanner": "0.43.5"
169
+ "@happyvertical/smrt-core": "0.43.7",
170
+ "@happyvertical/smrt-scanner": "0.43.7"
171
171
  },
172
172
  "scripts": {
173
173
  "build": "svelte-package -i src --tsconfig tsconfig.svelte.json",