@molecule/app-query-vue 1.3.0 → 1.3.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 +5 -3
- package/dist/query-content.d.ts +1 -0
- package/dist/query-content.d.ts.map +1 -1
- package/dist/query-content.js +3 -1
- package/dist/query-content.js.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
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-
|
|
6
|
+
Generated: 2026-11-17T05:20:00.226Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-query-vue
|
|
@@ -595,7 +595,8 @@ interface QueryContentProps<T> {
|
|
|
595
595
|
/**
|
|
596
596
|
* One optional empty branch, exclusive with children. The pure predicate reads the
|
|
597
597
|
* loaded document (an array or an application-owned envelope); render selects the
|
|
598
|
-
* current view's message and recovery action.
|
|
598
|
+
* current view's message and recovery action. A previous key's empty document uses
|
|
599
|
+
* pending/error instead. Omit it to keep empty arrays as data.
|
|
599
600
|
*/
|
|
600
601
|
empty?: {
|
|
601
602
|
when: (data: NonNullable<T>) => boolean
|
|
@@ -603,7 +604,7 @@ interface QueryContentProps<T> {
|
|
|
603
604
|
}
|
|
604
605
|
|
|
605
606
|
/** State from useQuery, or any compatible query observer. */
|
|
606
|
-
query: Pick<QueryState<T>, 'data' | 'status' | 'error'>
|
|
607
|
+
query: Pick<QueryState<T>, 'data' | 'status' | 'error' | 'isPreviousData'>
|
|
607
608
|
/**
|
|
608
609
|
* Mounted only with a real document, including false, zero and an empty
|
|
609
610
|
* list. A render function (React's render-prop name) or the default slot,
|
|
@@ -824,6 +825,7 @@ swallow an early click. Cached data remains mounted during refresh, including
|
|
|
824
825
|
a failed refresh. Status fallbacks belong outside the list or record
|
|
825
826
|
container rendered by `children`, and so does a refresh line; the default
|
|
826
827
|
fallbacks render nothing.
|
|
828
|
+
A previous key's empty or missing document renders pending/error until the current key answers.
|
|
827
829
|
|
|
828
830
|
The loaded branch is the `children` render function, or the default slot
|
|
829
831
|
(which receives `{ data }`); `pending` and `missing` are node props or
|
package/dist/query-content.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface QueryContentSlots<T> {
|
|
|
25
25
|
* a failed refresh. Status fallbacks belong outside the list or record
|
|
26
26
|
* container rendered by `children`, and so does a refresh line; the default
|
|
27
27
|
* fallbacks render nothing.
|
|
28
|
+
* A previous key's empty or missing document renders pending/error until the current key answers.
|
|
28
29
|
*
|
|
29
30
|
* The loaded branch is the `children` render function, or the default slot
|
|
30
31
|
* (which receives `{ data }`); `pending` and `missing` are node props or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-content.d.ts","sourceRoot":"","sources":["../src/query-content.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;KAAE,KAAK,UAAU,CAAA;IAC7D,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,UAAU,CAAA;IAC1B,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,UAAU,CAAA;CAC3B;AAED
|
|
1
|
+
{"version":3,"file":"query-content.d.ts","sourceRoot":"","sources":["../src/query-content.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;KAAE,KAAK,UAAU,CAAA;IAC7D,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,UAAU,CAAA;IAC1B,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,UAAU,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,IACD,CAAC,SACd,iBAAiB,CAAC,CAAC,CAAC,OACtB;IAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;CAAE,KACnC,UAAU;;CAkBd,CAAA"}
|
package/dist/query-content.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* a failed refresh. Status fallbacks belong outside the list or record
|
|
6
6
|
* container rendered by `children`, and so does a refresh line; the default
|
|
7
7
|
* fallbacks render nothing.
|
|
8
|
+
* A previous key's empty or missing document renders pending/error until the current key answers.
|
|
8
9
|
*
|
|
9
10
|
* The loaded branch is the `children` render function, or the default slot
|
|
10
11
|
* (which receives `{ data }`); `pending` and `missing` are node props or
|
|
@@ -41,7 +42,8 @@
|
|
|
41
42
|
export const QueryContent = Object.assign(function QueryContent(props, ctx) {
|
|
42
43
|
const query = props.query;
|
|
43
44
|
const data = query.data;
|
|
44
|
-
if (data === undefined
|
|
45
|
+
if (data === undefined ||
|
|
46
|
+
(query.isPreviousData && (data === null || props.empty?.when(data)))) {
|
|
45
47
|
if (query.status === 'error' && props.error)
|
|
46
48
|
return props.error(query.error);
|
|
47
49
|
return props.pending ?? ctx.slots.pending?.() ?? null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-content.js","sourceRoot":"","sources":["../src/query-content.ts"],"names":[],"mappings":"AAqBA
|
|
1
|
+
{"version":3,"file":"query-content.js","sourceRoot":"","sources":["../src/query-content.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CACvC,SAAS,YAAY,CACnB,KAA2B,EAC3B,GAAoC;IAEpC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IACzB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;IACvB,IACE,IAAI,KAAK,SAAS;QAClB,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EACpE,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,IAAI,KAAK,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5E,OAAO,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,IAAI,CAAA;IACvD,CAAC;IACD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,IAAI,CAAA;IACxE,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA;IACtE,IAAI,KAAK,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC/C,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,CAAA;AAC9C,CAAC;AACD,4EAA4E;AAC5E,gCAAgC;AAChC,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CACzE,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -42,14 +42,15 @@ export interface QueryContentProps<T> {
|
|
|
42
42
|
/**
|
|
43
43
|
* One optional empty branch, exclusive with children. The pure predicate reads the
|
|
44
44
|
* loaded document (an array or an application-owned envelope); render selects the
|
|
45
|
-
* current view's message and recovery action.
|
|
45
|
+
* current view's message and recovery action. A previous key's empty document uses
|
|
46
|
+
* pending/error instead. Omit it to keep empty arrays as data.
|
|
46
47
|
*/
|
|
47
48
|
empty?: {
|
|
48
49
|
when: (data: NonNullable<T>) => boolean;
|
|
49
50
|
render: NonNullable<QueryContentProps<T>['children']>;
|
|
50
51
|
};
|
|
51
52
|
/** State from useQuery, or any compatible query observer. */
|
|
52
|
-
query: Pick<QueryState<T>, 'data' | 'status' | 'error'>;
|
|
53
|
+
query: Pick<QueryState<T>, 'data' | 'status' | 'error' | 'isPreviousData'>;
|
|
53
54
|
/**
|
|
54
55
|
* Mounted only with a real document, including false, zero and an empty
|
|
55
56
|
* list. A render function (React's render-prop name) or the default slot,
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CA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AM,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,CAAC,CAAA;IAC1E;;;;OAIG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,UAAU,CAAA;IAC9C,uFAAuF;IACvF,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,qFAAqF;IACrF,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,UAAU,CAAA;CACvC;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-query-vue",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Vue 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-vue",
|
|
6
6
|
"type": "module",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
53
53
|
"@molecule/app-i18n": "1.2.2",
|
|
54
54
|
"@molecule/app-icons": "1.0.4",
|
|
55
|
-
"@molecule/app-query": "1.3.
|
|
55
|
+
"@molecule/app-query": "1.3.2",
|
|
56
56
|
"@molecule/app-query-memory": "1.1.0",
|
|
57
57
|
"@molecule/app-query-tanstack": "1.1.0",
|
|
58
58
|
"@molecule/app-ui": "1.4.0",
|