@molecule/app-query-angular 1.2.0 → 1.2.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-11-14T22:00:50.867Z
6
+ Generated: 2026-11-15T13:01:51.146Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-query-angular
@@ -44,8 +44,8 @@ with a new options object.
44
44
 
45
45
  ```typescript
46
46
  import { Component, OnChanges, computed, input } from '@angular/core'
47
+ import { useTranslation } from '@molecule/app-angular'
47
48
  import { getClient, isHttpError } from '@molecule/app-http'
48
- import { t } from '@molecule/app-i18n'
49
49
  import { intentPrefetchProps, useQuery } from '@molecule/app-query-angular'
50
50
 
51
51
  interface PackageDocument {
@@ -115,8 +115,8 @@ export class PackageLink implements OnChanges {
115
115
  `,
116
116
  })
117
117
  export class PackagePage {
118
- // Expose the i18n function so every template binding re-reads it.
119
- protected readonly t = t
118
+ // The binding's t re-runs the template on a locale switch.
119
+ protected readonly t = useTranslation().t
120
120
  readonly name = input('')
121
121
 
122
122
  readonly query = useQuery<PackageDocument | null>(
@@ -141,8 +141,8 @@ restoring a session never swaps a key that already rendered rows.
141
141
 
142
142
  ```typescript
143
143
  import { Component, computed, input } from '@angular/core'
144
+ import { useTranslation } from '@molecule/app-angular'
144
145
  import { getClient, unwrapList } from '@molecule/app-http'
145
- import { t } from '@molecule/app-i18n'
146
146
  import { useQuery } from '@molecule/app-query-angular'
147
147
 
148
148
  interface Invoice {
@@ -175,8 +175,8 @@ interface Invoice {
175
175
  `,
176
176
  })
177
177
  export class InvoiceList {
178
- // Expose the i18n function so every template binding re-reads it.
179
- protected readonly t = t
178
+ // The binding's t re-runs the template on a locale switch.
179
+ protected readonly t = useTranslation().t
180
180
  // The viewer whose invoices these are (also in the key).
181
181
  readonly viewer = input('anonymous')
182
182
  // The page to show.
@@ -208,8 +208,8 @@ explicit `fetch()` retries into the mounted page.
208
208
 
209
209
  ```typescript
210
210
  import { Component, input } from '@angular/core'
211
+ import { useTranslation } from '@molecule/app-angular'
211
212
  import { getClient } from '@molecule/app-http'
212
- import { t } from '@molecule/app-i18n'
213
213
  import { getQueryClient } from '@molecule/app-query'
214
214
 
215
215
  // The key names what the document actually depends on — here the signed-in
@@ -243,8 +243,8 @@ async function setFollowing(principal: string, authorId: string, follow: boolean
243
243
  host: { type: 'button', '(click)': 'retry()' },
244
244
  })
245
245
  export class FeedRetry {
246
- // Expose the i18n function so every template binding re-reads it.
247
- protected readonly t = t
246
+ // The binding's t re-runs the template on a locale switch.
247
+ protected readonly t = useTranslation().t
248
248
  readonly principal = input.required<string>()
249
249
 
250
250
  retry(): void {
@@ -270,8 +270,8 @@ the saved record and is the `commit` of `OptimisticToggleButton` (from
270
270
 
271
271
  ```typescript
272
272
  import { Component, computed, input } from '@angular/core'
273
+ import { useTranslation } from '@molecule/app-angular'
273
274
  import { getClient, unwrapList, unwrapSingle } from '@molecule/app-http'
274
- import { t } from '@molecule/app-i18n'
275
275
  import { OptimisticToggleButton } from '@molecule/app-ui-angular'
276
276
  import { createQueryResource, QueryContent, useQuery } from '@molecule/app-query-angular'
277
277
 
@@ -309,7 +309,8 @@ export const invoices = createQueryResource<Invoice>({
309
309
  export class InvoiceFlagControl {
310
310
  readonly invoice = input.required<Invoice>()
311
311
  readonly viewer = input.required<string>()
312
- protected readonly t = t
312
+ // The binding's t re-runs the template on a locale switch.
313
+ protected readonly t = useTranslation().t
313
314
 
314
315
  readonly save = async (flagged: boolean): Promise<boolean> =>
315
316
  (await invoices.toggle(this.viewer(), this.invoice().id, 'flag', flagged)).flagged
@@ -350,8 +351,8 @@ export class InvoiceFlagControl {
350
351
  imports: [QueryContent, InvoiceFlagControl],
351
352
  })
352
353
  export class InvoicePage {
353
- // Expose the i18n function so every template binding re-reads it.
354
- protected readonly t = t
354
+ // The binding's t re-runs the template on a locale switch.
355
+ protected readonly t = useTranslation().t
355
356
  readonly id = input('')
356
357
  readonly viewer = input('')
357
358
 
package/dist/index.d.ts CHANGED
@@ -30,8 +30,8 @@
30
30
  * @example
31
31
  * ```typescript
32
32
  * import { Component, OnChanges, computed, input } from '@angular/core'
33
+ * import { useTranslation } from '@molecule/app-angular'
33
34
  * import { getClient, isHttpError } from '@molecule/app-http'
34
- * import { t } from '@molecule/app-i18n'
35
35
  * import { intentPrefetchProps, useQuery } from '@molecule/app-query-angular'
36
36
  *
37
37
  * interface PackageDocument {
@@ -96,8 +96,8 @@
96
96
  * `,
97
97
  * })
98
98
  * export class PackagePage {
99
- * // Expose the i18n function so every template binding re-reads it.
100
- * protected readonly t = t
99
+ * // The binding's t re-runs the template on a locale switch.
100
+ * protected readonly t = useTranslation().t
101
101
  * readonly name = input('')
102
102
  *
103
103
  * readonly query = useQuery<PackageDocument | null>(
@@ -123,8 +123,8 @@
123
123
  *
124
124
  * ```typescript
125
125
  * import { Component, computed, input } from '@angular/core'
126
+ * import { useTranslation } from '@molecule/app-angular'
126
127
  * import { getClient, unwrapList } from '@molecule/app-http'
127
- * import { t } from '@molecule/app-i18n'
128
128
  * import { useQuery } from '@molecule/app-query-angular'
129
129
  *
130
130
  * interface Invoice {
@@ -153,8 +153,8 @@
153
153
  * `,
154
154
  * })
155
155
  * export class InvoiceList {
156
- * // Expose the i18n function so every template binding re-reads it.
157
- * protected readonly t = t
156
+ * // The binding's t re-runs the template on a locale switch.
157
+ * protected readonly t = useTranslation().t
158
158
  * // The viewer whose invoices these are (also in the key).
159
159
  * readonly viewer = input('anonymous')
160
160
  * // The page to show.
@@ -187,8 +187,8 @@
187
187
  *
188
188
  * ```typescript
189
189
  * import { Component, input } from '@angular/core'
190
+ * import { useTranslation } from '@molecule/app-angular'
190
191
  * import { getClient } from '@molecule/app-http'
191
- * import { t } from '@molecule/app-i18n'
192
192
  * import { getQueryClient } from '@molecule/app-query'
193
193
  *
194
194
  * // The key names what the document actually depends on — here the signed-in
@@ -222,8 +222,8 @@
222
222
  * host: { type: 'button', '(click)': 'retry()' },
223
223
  * })
224
224
  * export class FeedRetry {
225
- * // Expose the i18n function so every template binding re-reads it.
226
- * protected readonly t = t
225
+ * // The binding's t re-runs the template on a locale switch.
226
+ * protected readonly t = useTranslation().t
227
227
  * readonly principal = input.required<string>()
228
228
  *
229
229
  * retry(): void {
@@ -250,8 +250,8 @@
250
250
  *
251
251
  * ```typescript
252
252
  * import { Component, computed, input } from '@angular/core'
253
+ * import { useTranslation } from '@molecule/app-angular'
253
254
  * import { getClient, unwrapList, unwrapSingle } from '@molecule/app-http'
254
- * import { t } from '@molecule/app-i18n'
255
255
  * import { OptimisticToggleButton } from '@molecule/app-ui-angular'
256
256
  * import { createQueryResource, QueryContent, useQuery } from '@molecule/app-query-angular'
257
257
  *
@@ -287,7 +287,8 @@
287
287
  * export class InvoiceFlagControl {
288
288
  * readonly invoice = input.required<Invoice>()
289
289
  * readonly viewer = input.required<string>()
290
- * protected readonly t = t
290
+ * // The binding's t re-runs the template on a locale switch.
291
+ * protected readonly t = useTranslation().t
291
292
  *
292
293
  * readonly save = async (flagged: boolean): Promise<boolean> =>
293
294
  * (await invoices.toggle(this.viewer(), this.invoice().id, 'flag', flagged)).flagged
@@ -324,8 +325,8 @@
324
325
  * imports: [QueryContent, InvoiceFlagControl],
325
326
  * })
326
327
  * export class InvoicePage {
327
- * // Expose the i18n function so every template binding re-reads it.
328
- * protected readonly t = t
328
+ * // The binding's t re-runs the template on a locale switch.
329
+ * protected readonly t = useTranslation().t
329
330
  * readonly id = input('')
330
331
  * readonly viewer = input('')
331
332
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0cG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -30,8 +30,8 @@
30
30
  * @example
31
31
  * ```typescript
32
32
  * import { Component, OnChanges, computed, input } from '@angular/core'
33
+ * import { useTranslation } from '@molecule/app-angular'
33
34
  * import { getClient, isHttpError } from '@molecule/app-http'
34
- * import { t } from '@molecule/app-i18n'
35
35
  * import { intentPrefetchProps, useQuery } from '@molecule/app-query-angular'
36
36
  *
37
37
  * interface PackageDocument {
@@ -96,8 +96,8 @@
96
96
  * `,
97
97
  * })
98
98
  * export class PackagePage {
99
- * // Expose the i18n function so every template binding re-reads it.
100
- * protected readonly t = t
99
+ * // The binding's t re-runs the template on a locale switch.
100
+ * protected readonly t = useTranslation().t
101
101
  * readonly name = input('')
102
102
  *
103
103
  * readonly query = useQuery<PackageDocument | null>(
@@ -123,8 +123,8 @@
123
123
  *
124
124
  * ```typescript
125
125
  * import { Component, computed, input } from '@angular/core'
126
+ * import { useTranslation } from '@molecule/app-angular'
126
127
  * import { getClient, unwrapList } from '@molecule/app-http'
127
- * import { t } from '@molecule/app-i18n'
128
128
  * import { useQuery } from '@molecule/app-query-angular'
129
129
  *
130
130
  * interface Invoice {
@@ -153,8 +153,8 @@
153
153
  * `,
154
154
  * })
155
155
  * export class InvoiceList {
156
- * // Expose the i18n function so every template binding re-reads it.
157
- * protected readonly t = t
156
+ * // The binding's t re-runs the template on a locale switch.
157
+ * protected readonly t = useTranslation().t
158
158
  * // The viewer whose invoices these are (also in the key).
159
159
  * readonly viewer = input('anonymous')
160
160
  * // The page to show.
@@ -187,8 +187,8 @@
187
187
  *
188
188
  * ```typescript
189
189
  * import { Component, input } from '@angular/core'
190
+ * import { useTranslation } from '@molecule/app-angular'
190
191
  * import { getClient } from '@molecule/app-http'
191
- * import { t } from '@molecule/app-i18n'
192
192
  * import { getQueryClient } from '@molecule/app-query'
193
193
  *
194
194
  * // The key names what the document actually depends on — here the signed-in
@@ -222,8 +222,8 @@
222
222
  * host: { type: 'button', '(click)': 'retry()' },
223
223
  * })
224
224
  * export class FeedRetry {
225
- * // Expose the i18n function so every template binding re-reads it.
226
- * protected readonly t = t
225
+ * // The binding's t re-runs the template on a locale switch.
226
+ * protected readonly t = useTranslation().t
227
227
  * readonly principal = input.required<string>()
228
228
  *
229
229
  * retry(): void {
@@ -250,8 +250,8 @@
250
250
  *
251
251
  * ```typescript
252
252
  * import { Component, computed, input } from '@angular/core'
253
+ * import { useTranslation } from '@molecule/app-angular'
253
254
  * import { getClient, unwrapList, unwrapSingle } from '@molecule/app-http'
254
- * import { t } from '@molecule/app-i18n'
255
255
  * import { OptimisticToggleButton } from '@molecule/app-ui-angular'
256
256
  * import { createQueryResource, QueryContent, useQuery } from '@molecule/app-query-angular'
257
257
  *
@@ -287,7 +287,8 @@
287
287
  * export class InvoiceFlagControl {
288
288
  * readonly invoice = input.required<Invoice>()
289
289
  * readonly viewer = input.required<string>()
290
- * protected readonly t = t
290
+ * // The binding's t re-runs the template on a locale switch.
291
+ * protected readonly t = useTranslation().t
291
292
  *
292
293
  * readonly save = async (flagged: boolean): Promise<boolean> =>
293
294
  * (await invoices.toggle(this.viewer(), this.invoice().id, 'flag', flagged)).flagged
@@ -324,8 +325,8 @@
324
325
  * imports: [QueryContent, InvoiceFlagControl],
325
326
  * })
326
327
  * export class InvoicePage {
327
- * // Expose the i18n function so every template binding re-reads it.
328
- * protected readonly t = t
328
+ * // The binding's t re-runs the template on a locale switch.
329
+ * protected readonly t = useTranslation().t
329
330
  * readonly id = input('')
330
331
  * readonly viewer = input('')
331
332
  *
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0cG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-query-angular",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Angular hooks for @molecule/app-query — read a cached document synchronously, observe it, and prefetch on intent",
5
5
  "homepage": "https://www.molecule.dev/packages/app-query-angular",
6
6
  "type": "module",
@@ -56,15 +56,15 @@
56
56
  "@angular/compiler-cli": "22.2.3",
57
57
  "@angular/core": "22.2.3",
58
58
  "@angular/platform-browser": "22.2.3",
59
- "@molecule/app-angular": "3.6.0",
59
+ "@molecule/app-angular": "3.7.1",
60
60
  "@molecule/app-framework-conformance": "0.0.0",
61
- "@molecule/app-i18n": "1.2.1",
61
+ "@molecule/app-i18n": "1.2.2",
62
62
  "@molecule/app-icons": "1.0.4",
63
63
  "@molecule/app-query": "1.2.0",
64
64
  "@molecule/app-query-memory": "1.0.5",
65
65
  "@molecule/app-query-tanstack": "1.0.5",
66
- "@molecule/app-ui": "1.3.11",
67
- "@molecule/app-ui-angular": "1.1.2",
66
+ "@molecule/app-ui": "1.4.0",
67
+ "@molecule/app-ui-angular": "1.2.0",
68
68
  "@types/node": "26.6.5",
69
69
  "jsdom": "30.1.3",
70
70
  "rxjs": "7.8.2",