@burdenoff/microfe-cosmicintersection 2026.1012.1 → 2026.1030.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/dist/cosmicintersection/lib/useSelectedRecord.d.ts +20 -0
- package/dist/cosmicintersection/lib/useSelectedRecord.d.ts.map +1 -0
- package/dist/cosmicintersection/lib/useSelectedRecord.js +19 -0
- package/dist/cosmicintersection/lib/useSelectedRecord.js.map +1 -0
- package/dist/cosmicintersection/pages/access/AccessPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/access/AccessPage.js +239 -226
- package/dist/cosmicintersection/pages/access/AccessPage.js.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +196 -195
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +188 -175
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js +202 -201
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
- package/dist/utils/pageContext.d.ts +33 -7
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +75 -33
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps the record a list page has focused (a release, an analysis, an access
|
|
3
|
+
* grant, a dataset's schema field) in the URL search parameters instead of
|
|
4
|
+
* component state.
|
|
5
|
+
*
|
|
6
|
+
* The URL is what the AI assistant's page context reads
|
|
7
|
+
* (`src/utils/pageContext.ts`): `?id=<id>` on the releases, analyses and access
|
|
8
|
+
* pages, and `?field=<id>` on a dataset page, become `entityType` + `entityId`,
|
|
9
|
+
* so "publish this release", "revoke this grant" or "describe this column"
|
|
10
|
+
* resolve without a follow-up question. It also makes the focused record
|
|
11
|
+
* linkable and survives a reload.
|
|
12
|
+
*
|
|
13
|
+
* The update replaces the current history entry: focusing records one after
|
|
14
|
+
* another must not fill the back stack.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useSelectedRecord(param?: string): {
|
|
17
|
+
selectedId: string | null;
|
|
18
|
+
select: (id: string | null) => void;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=useSelectedRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectedRecord.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/lib/useSelectedRecord.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAO,GAAG;IAC/C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrC,CAwBA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
import { useSearchParams as t } from "react-router";
|
|
3
|
+
//#region src/cosmicintersection/lib/useSelectedRecord.ts
|
|
4
|
+
function n(n = "id") {
|
|
5
|
+
let [r, i] = t();
|
|
6
|
+
return {
|
|
7
|
+
selectedId: r.get(n)?.trim() || null,
|
|
8
|
+
select: e((e) => {
|
|
9
|
+
i((t) => {
|
|
10
|
+
let r = new URLSearchParams(t);
|
|
11
|
+
return e ? r.set(n, e) : r.delete(n), r;
|
|
12
|
+
}, { replace: !0 });
|
|
13
|
+
}, [n, i])
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as useSelectedRecord };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=useSelectedRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectedRecord.js","names":[],"sources":["../../../src/cosmicintersection/lib/useSelectedRecord.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useSearchParams } from 'react-router';\n\n/**\n * Keeps the record a list page has focused (a release, an analysis, an access\n * grant, a dataset's schema field) in the URL search parameters instead of\n * component state.\n *\n * The URL is what the AI assistant's page context reads\n * (`src/utils/pageContext.ts`): `?id=<id>` on the releases, analyses and access\n * pages, and `?field=<id>` on a dataset page, become `entityType` + `entityId`,\n * so \"publish this release\", \"revoke this grant\" or \"describe this column\"\n * resolve without a follow-up question. It also makes the focused record\n * linkable and survives a reload.\n *\n * The update replaces the current history entry: focusing records one after\n * another must not fill the back stack.\n */\nexport function useSelectedRecord(param = 'id'): {\n selectedId: string | null;\n select: (id: string | null) => void;\n} {\n const [searchParams, setSearchParams] = useSearchParams();\n const raw = searchParams.get(param)?.trim();\n const selectedId = raw ? raw : null;\n\n const select = useCallback(\n (id: string | null) => {\n setSearchParams(\n (previous) => {\n const next = new URLSearchParams(previous);\n if (id) {\n next.set(param, id);\n } else {\n next.delete(param);\n }\n return next;\n },\n { replace: true }\n );\n },\n [param, setSearchParams]\n );\n\n return { selectedId, select };\n}\n"],"mappings":";;;AAkBA,SAAgB,EAAkB,IAAQ,MAGxC;CACA,IAAM,CAAC,GAAc,KAAmB,EAAgB;CAsBxD,OAAO;EAAE,YArBG,EAAa,IAAI,CAAK,GAAG,KAAK,KACX;EAoBV,QAlBN,GACZ,MAAsB;GACrB,GACG,MAAa;IACZ,IAAM,IAAO,IAAI,gBAAgB,CAAQ;IAMzC,OALI,IACF,EAAK,IAAI,GAAO,CAAE,IAElB,EAAK,OAAO,CAAK,GAEZ;GACT,GACA,EAAE,SAAS,GAAK,CAClB;EACF,GACA,CAAC,GAAO,CAAe,CAGJ;CAAO;AAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPage.d.ts","sourceRoot":"","sources":["../../../../src/cosmicintersection/pages/access/AccessPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccessPage.d.ts","sourceRoot":"","sources":["../../../../src/cosmicintersection/pages/access/AccessPage.tsx"],"names":[],"mappings":"AAqFA,MAAM,CAAC,OAAO,UAAU,UAAU,gCAygBjC"}
|