@burdenoff/microfe-cosmicintersection 2026.1101.1 → 2026.1101.3
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/api/tagsApi.d.ts +100 -0
- package/dist/cosmicintersection/api/tagsApi.d.ts.map +1 -0
- package/dist/cosmicintersection/api/tagsApi.js +110 -0
- package/dist/cosmicintersection/api/tagsApi.js.map +1 -0
- package/dist/cosmicintersection/components/EntityTagsField.d.ts +5 -5
- package/dist/cosmicintersection/components/EntityTagsField.js.map +1 -1
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts +17 -0
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +1 -0
- package/dist/cosmicintersection/components/ScienceCanvas.js +791 -0
- package/dist/cosmicintersection/components/ScienceCanvas.js.map +1 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts +27 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts.map +1 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.js +141 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.js.map +1 -0
- package/dist/cosmicintersection/components/index.d.ts +3 -0
- package/dist/cosmicintersection/components/index.d.ts.map +1 -1
- package/dist/cosmicintersection/components/index.js +8 -5
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts +49 -0
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts.map +1 -0
- package/dist/cosmicintersection/hooks/useEntityTagSync.js +86 -0
- package/dist/cosmicintersection/hooks/useEntityTagSync.js.map +1 -0
- package/dist/cosmicintersection/lib/visualization.d.ts +189 -0
- package/dist/cosmicintersection/lib/visualization.d.ts.map +1 -0
- package/dist/cosmicintersection/lib/visualization.js +298 -0
- package/dist/cosmicintersection/lib/visualization.js.map +1 -0
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts +80 -0
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +1 -0
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +11 -11
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js +75 -74
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +115 -106
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js +103 -101
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js +141 -139
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +213 -211
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js +110 -107
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js.map +1 -1
- package/dist/stories/ScienceCanvas.stories.d.ts +21 -0
- package/dist/stories/ScienceCanvas.stories.d.ts.map +1 -0
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts +12 -0
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client/react';
|
|
2
|
+
/** Entity types the CosmicIntersection subgraph registers with wspace-tags-svc. */
|
|
3
|
+
export type CosTagEntityType = 'COSMICINTERSECTION_DATASET' | 'COSMICINTERSECTION_SOURCE' | 'COSMICINTERSECTION_NOTEBOOK' | 'COSMICINTERSECTION_COLLECTION' | 'COSMICINTERSECTION_PIPELINE' | 'COSMICINTERSECTION_RELEASE';
|
|
4
|
+
/** An assignable workspace tag (`CosAvailableTag`). */
|
|
5
|
+
export interface CosWorkspaceTag {
|
|
6
|
+
id: string;
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
color?: string | null;
|
|
10
|
+
}
|
|
11
|
+
/** Upper bound on the workspace tags the picker loads for suggestions. */
|
|
12
|
+
export declare const WORKSPACE_TAG_LIMIT = 200;
|
|
13
|
+
export declare const AVAILABLE_COS_TAGS: import('graphql').DocumentNode;
|
|
14
|
+
export declare const CREATE_COS_TAG: import('graphql').DocumentNode;
|
|
15
|
+
export declare const REPLACE_COS_ENTITY_TAGS: import('graphql').DocumentNode;
|
|
16
|
+
export declare const SEARCH_COS_TAGS: import('graphql').DocumentNode;
|
|
17
|
+
export declare const COS_ENTITY_TAGS: import('graphql').DocumentNode;
|
|
18
|
+
export interface AvailableCosTagsData {
|
|
19
|
+
availableCosTags: CosWorkspaceTag[];
|
|
20
|
+
}
|
|
21
|
+
export interface CreateCosTagData {
|
|
22
|
+
createCosTag: CosWorkspaceTag;
|
|
23
|
+
}
|
|
24
|
+
export interface SearchCosTagsData {
|
|
25
|
+
searchCosTags: CosWorkspaceTag[];
|
|
26
|
+
}
|
|
27
|
+
export interface CosEntityTagsData {
|
|
28
|
+
cosEntityTags: Array<CosEntityTagAssignment & {
|
|
29
|
+
id: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export interface ReplaceCosEntityTagsData {
|
|
33
|
+
replaceCosEntityTags: Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
tagId: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Workspace tags for the picker's suggestions. `cache-and-network` so a tag
|
|
40
|
+
* created from another form shows up the next time a picker mounts, while the
|
|
41
|
+
* cached list renders instantly. A failure (tags-svc down, no permission) is
|
|
42
|
+
* reported through `error` and the picker falls back to free-text entry.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useWorkspaceTags(skip?: boolean): useQuery.Result<AvailableCosTagsData, {
|
|
45
|
+
limit: number;
|
|
46
|
+
}, "empty" | "complete" | "streaming", {
|
|
47
|
+
limit: number;
|
|
48
|
+
}, undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Longest label the picker input accepts; a cheap guard against oversized new
|
|
51
|
+
* values. It is enforced on the input only: labels loaded from an entity keep
|
|
52
|
+
* their full text, since the earlier free-text field accepted any length.
|
|
53
|
+
*/
|
|
54
|
+
export declare const MAX_TAG_LABEL_LENGTH = 64;
|
|
55
|
+
/** Display form of a label: trimmed, inner whitespace collapsed. */
|
|
56
|
+
export declare function cleanTagLabel(label: string): string;
|
|
57
|
+
/** Case- and whitespace-insensitive identity for a tag label. */
|
|
58
|
+
export declare function normalizeTagLabel(label: string): string;
|
|
59
|
+
/** Unique, cleaned labels in first-seen order (duplicates by {@link normalizeTagLabel} collapse). */
|
|
60
|
+
export declare function uniqueTagLabels(labels: readonly string[]): string[];
|
|
61
|
+
export interface EntityTagLabelDiff {
|
|
62
|
+
/** Labels the user added since the entity was loaded. */
|
|
63
|
+
added: string[];
|
|
64
|
+
/** Labels the user removed since the entity was loaded. */
|
|
65
|
+
removed: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* What changed between the labels an entity was loaded with and the labels the
|
|
69
|
+
* form now holds. Only these labels touch the entity's workspace assignments,
|
|
70
|
+
* so a tag assigned from another surface (the shell `/tags` route, the API)
|
|
71
|
+
* survives every save that does not explicitly remove it.
|
|
72
|
+
*/
|
|
73
|
+
export declare function diffEntityTagLabels(previous: readonly string[], next: readonly string[]): EntityTagLabelDiff;
|
|
74
|
+
/** First workspace tag whose label matches `label` (case/whitespace-insensitive). */
|
|
75
|
+
export declare function findTagByLabel(workspaceTags: readonly CosWorkspaceTag[], label: string): CosWorkspaceTag | undefined;
|
|
76
|
+
/** A current assignment as read back from `cosEntityTags`. */
|
|
77
|
+
export interface CosEntityTagAssignment {
|
|
78
|
+
tagId: string;
|
|
79
|
+
tagInfo?: {
|
|
80
|
+
label?: string | null;
|
|
81
|
+
} | null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Labels the form holds that the entity has no assignment for yet. An
|
|
85
|
+
* assignment's label comes from its `tagInfo`, or from the workspace taxonomy
|
|
86
|
+
* when the projection is missing.
|
|
87
|
+
*/
|
|
88
|
+
export declare function labelsMissingFromAssignments(labels: readonly string[], current: readonly CosEntityTagAssignment[], workspaceTags: readonly CosWorkspaceTag[]): string[];
|
|
89
|
+
/**
|
|
90
|
+
* The full tag-id set to write after a save: the entity's current assignments,
|
|
91
|
+
* minus the ids whose label the user removed, plus the resolved ids of the
|
|
92
|
+
* labels the user added. Order is stable and ids are unique.
|
|
93
|
+
*/
|
|
94
|
+
export declare function nextEntityTagIds(current: readonly CosEntityTagAssignment[], removedLabels: readonly string[], removedTagIds: readonly string[], addedTagIds: readonly string[]): string[];
|
|
95
|
+
/**
|
|
96
|
+
* Picker suggestions: workspace tags not already selected whose label contains
|
|
97
|
+
* the typed text, alphabetically, capped at `limit`.
|
|
98
|
+
*/
|
|
99
|
+
export declare function suggestWorkspaceTags(workspaceTags: readonly CosWorkspaceTag[], selected: readonly string[], query: string, limit?: number): CosWorkspaceTag[];
|
|
100
|
+
//# sourceMappingURL=tagsApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tagsApi.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/api/tagsApi.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,mFAAmF;AACnF,MAAM,MA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E,EAC3B,KAAK,EAAE,MAAM,EACb,KAAK,SAAI,GACR,eAAe,EAAE,CAanB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { gql as e } from "@apollo/client";
|
|
2
|
+
import { useQuery as t } from "@apollo/client/react";
|
|
3
|
+
var n = e`
|
|
4
|
+
query AvailableCosTags($limit: Int) {
|
|
5
|
+
availableCosTags(limit: $limit) {
|
|
6
|
+
id
|
|
7
|
+
key
|
|
8
|
+
label
|
|
9
|
+
color
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`, r = e`
|
|
13
|
+
mutation CreateCosTag($input: CreateCosTagInput!) {
|
|
14
|
+
createCosTag(input: $input) {
|
|
15
|
+
id
|
|
16
|
+
key
|
|
17
|
+
label
|
|
18
|
+
color
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`, i = e`
|
|
22
|
+
mutation ReplaceCosEntityTags($input: ReplaceCosEntityTagsInput!) {
|
|
23
|
+
replaceCosEntityTags(input: $input) {
|
|
24
|
+
id
|
|
25
|
+
tagId
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`, a = e`
|
|
29
|
+
query SearchCosTags($query: String!, $limit: Int) {
|
|
30
|
+
searchCosTags(query: $query, limit: $limit) {
|
|
31
|
+
id
|
|
32
|
+
key
|
|
33
|
+
label
|
|
34
|
+
color
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`, o = e`
|
|
38
|
+
query CosEntityTags($input: GetCosEntityTagsInput!) {
|
|
39
|
+
cosEntityTags(input: $input) {
|
|
40
|
+
id
|
|
41
|
+
tagId
|
|
42
|
+
tagInfo {
|
|
43
|
+
id
|
|
44
|
+
label
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
function s(e = !1) {
|
|
50
|
+
return t(n, {
|
|
51
|
+
variables: { limit: 200 },
|
|
52
|
+
fetchPolicy: "cache-and-network",
|
|
53
|
+
errorPolicy: "all",
|
|
54
|
+
skip: e
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function c(e) {
|
|
58
|
+
return e.trim().replace(/\s+/g, " ");
|
|
59
|
+
}
|
|
60
|
+
function l(e) {
|
|
61
|
+
return c(e).toLowerCase();
|
|
62
|
+
}
|
|
63
|
+
function u(e) {
|
|
64
|
+
let t = /* @__PURE__ */ new Set(), n = [];
|
|
65
|
+
for (let r of e) {
|
|
66
|
+
let e = l(r);
|
|
67
|
+
!e || t.has(e) || (t.add(e), n.push(c(r)));
|
|
68
|
+
}
|
|
69
|
+
return n;
|
|
70
|
+
}
|
|
71
|
+
function d(e, t) {
|
|
72
|
+
let n = u(e), r = u(t), i = new Set(n.map(l)), a = new Set(r.map(l));
|
|
73
|
+
return {
|
|
74
|
+
added: r.filter((e) => !i.has(l(e))),
|
|
75
|
+
removed: n.filter((e) => !a.has(l(e)))
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function f(e, t) {
|
|
79
|
+
let n = l(t);
|
|
80
|
+
if (n) return e.find((e) => l(e.label) === n);
|
|
81
|
+
}
|
|
82
|
+
function p(e, t, n) {
|
|
83
|
+
let r = /* @__PURE__ */ new Set();
|
|
84
|
+
for (let e of t) {
|
|
85
|
+
let t = e.tagInfo?.label ?? n.find((t) => t.id === e.tagId)?.label;
|
|
86
|
+
t && r.add(l(t));
|
|
87
|
+
}
|
|
88
|
+
return u(e).filter((e) => !r.has(l(e)));
|
|
89
|
+
}
|
|
90
|
+
function m(e, t, n, r) {
|
|
91
|
+
let i = new Set(t.map(l)), a = new Set(n), o = [], s = (e) => {
|
|
92
|
+
e && !o.includes(e) && o.push(e);
|
|
93
|
+
};
|
|
94
|
+
for (let t of e) {
|
|
95
|
+
let e = t.tagInfo?.label;
|
|
96
|
+
e && i.has(l(e)) || a.has(t.tagId) || s(t.tagId);
|
|
97
|
+
}
|
|
98
|
+
return r.forEach(s), o;
|
|
99
|
+
}
|
|
100
|
+
function h(e, t, n, r = 8) {
|
|
101
|
+
let i = new Set(t.map(l)), a = l(n), o = /* @__PURE__ */ new Set();
|
|
102
|
+
return e.filter((e) => {
|
|
103
|
+
let t = l(e.label);
|
|
104
|
+
return !t || i.has(t) || o.has(t) ? !1 : (o.add(t), a === "" || t.includes(a));
|
|
105
|
+
}).sort((e, t) => e.label.localeCompare(t.label)).slice(0, r);
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { n as AVAILABLE_COS_TAGS, o as COS_ENTITY_TAGS, r as CREATE_COS_TAG, i as REPLACE_COS_ENTITY_TAGS, a as SEARCH_COS_TAGS, c as cleanTagLabel, d as diffEntityTagLabels, f as findTagByLabel, p as labelsMissingFromAssignments, m as nextEntityTagIds, l as normalizeTagLabel, h as suggestWorkspaceTags, u as uniqueTagLabels, s as useWorkspaceTags };
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=tagsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tagsApi.js","names":[],"sources":["../../../src/cosmicintersection/api/tagsApi.ts"],"sourcesContent":["/**\n * tagsApi — workspace tag operations for CosmicIntersection entities.\n *\n * Every document here targets the `Cos`-prefixed tag surface that\n * wspace-cosmicintersection-svc publishes from the shared\n * `@burdenoff/be-sdk/tags` builder (`availableCosTags`, `searchCosTags`,\n * `createCosTag`, `cosEntityTags`, `replaceCosEntityTags`). The service\n * forwards each call to wspace-tags-svc, so tags live in the workspace\n * taxonomy and are shared with every other product surface.\n *\n * The entity's inline `tags: [String!]` array is still written by the entity's\n * own create/update mutation (labels of the selected tags) so list filters and\n * search keep working; `useEntityTagSync` applies the labels the user added or\n * removed to the structured assignments ({@link diffEntityTagLabels}).\n */\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\n\n/** Entity types the CosmicIntersection subgraph registers with wspace-tags-svc. */\nexport type CosTagEntityType =\n | 'COSMICINTERSECTION_DATASET'\n | 'COSMICINTERSECTION_SOURCE'\n | 'COSMICINTERSECTION_NOTEBOOK'\n | 'COSMICINTERSECTION_COLLECTION'\n | 'COSMICINTERSECTION_PIPELINE'\n | 'COSMICINTERSECTION_RELEASE';\n\n/** An assignable workspace tag (`CosAvailableTag`). */\nexport interface CosWorkspaceTag {\n id: string;\n key: string;\n label: string;\n color?: string | null;\n}\n\n/** Upper bound on the workspace tags the picker loads for suggestions. */\nexport const WORKSPACE_TAG_LIMIT = 200;\n\nexport const AVAILABLE_COS_TAGS = gql`\n query AvailableCosTags($limit: Int) {\n availableCosTags(limit: $limit) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const CREATE_COS_TAG = gql`\n mutation CreateCosTag($input: CreateCosTagInput!) {\n createCosTag(input: $input) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const REPLACE_COS_ENTITY_TAGS = gql`\n mutation ReplaceCosEntityTags($input: ReplaceCosEntityTagsInput!) {\n replaceCosEntityTags(input: $input) {\n id\n tagId\n }\n }\n`;\n\nexport const SEARCH_COS_TAGS = gql`\n query SearchCosTags($query: String!, $limit: Int) {\n searchCosTags(query: $query, limit: $limit) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const COS_ENTITY_TAGS = gql`\n query CosEntityTags($input: GetCosEntityTagsInput!) {\n cosEntityTags(input: $input) {\n id\n tagId\n tagInfo {\n id\n label\n }\n }\n }\n`;\n\nexport interface AvailableCosTagsData {\n availableCosTags: CosWorkspaceTag[];\n}\n\nexport interface CreateCosTagData {\n createCosTag: CosWorkspaceTag;\n}\n\nexport interface SearchCosTagsData {\n searchCosTags: CosWorkspaceTag[];\n}\n\nexport interface CosEntityTagsData {\n cosEntityTags: Array<CosEntityTagAssignment & { id: string }>;\n}\n\nexport interface ReplaceCosEntityTagsData {\n replaceCosEntityTags: Array<{ id: string; tagId: string }>;\n}\n\n/**\n * Workspace tags for the picker's suggestions. `cache-and-network` so a tag\n * created from another form shows up the next time a picker mounts, while the\n * cached list renders instantly. A failure (tags-svc down, no permission) is\n * reported through `error` and the picker falls back to free-text entry.\n */\nexport function useWorkspaceTags(skip = false) {\n return useQuery<AvailableCosTagsData, { limit: number }>(AVAILABLE_COS_TAGS, {\n variables: { limit: WORKSPACE_TAG_LIMIT },\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n skip,\n });\n}\n\n/**\n * Longest label the picker input accepts; a cheap guard against oversized new\n * values. It is enforced on the input only: labels loaded from an entity keep\n * their full text, since the earlier free-text field accepted any length.\n */\nexport const MAX_TAG_LABEL_LENGTH = 64;\n\n/** Display form of a label: trimmed, inner whitespace collapsed. */\nexport function cleanTagLabel(label: string): string {\n return label.trim().replace(/\\s+/g, ' ');\n}\n\n/** Case- and whitespace-insensitive identity for a tag label. */\nexport function normalizeTagLabel(label: string): string {\n return cleanTagLabel(label).toLowerCase();\n}\n\n/** Unique, cleaned labels in first-seen order (duplicates by {@link normalizeTagLabel} collapse). */\nexport function uniqueTagLabels(labels: readonly string[]): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const label of labels) {\n const key = normalizeTagLabel(label);\n if (!key || seen.has(key)) continue;\n seen.add(key);\n out.push(cleanTagLabel(label));\n }\n return out;\n}\n\nexport interface EntityTagLabelDiff {\n /** Labels the user added since the entity was loaded. */\n added: string[];\n /** Labels the user removed since the entity was loaded. */\n removed: string[];\n}\n\n/**\n * What changed between the labels an entity was loaded with and the labels the\n * form now holds. Only these labels touch the entity's workspace assignments,\n * so a tag assigned from another surface (the shell `/tags` route, the API)\n * survives every save that does not explicitly remove it.\n */\nexport function diffEntityTagLabels(\n previous: readonly string[],\n next: readonly string[]\n): EntityTagLabelDiff {\n const before = uniqueTagLabels(previous);\n const after = uniqueTagLabels(next);\n const beforeKeys = new Set(before.map(normalizeTagLabel));\n const afterKeys = new Set(after.map(normalizeTagLabel));\n return {\n added: after.filter((label) => !beforeKeys.has(normalizeTagLabel(label))),\n removed: before.filter((label) => !afterKeys.has(normalizeTagLabel(label))),\n };\n}\n\n/** First workspace tag whose label matches `label` (case/whitespace-insensitive). */\nexport function findTagByLabel(\n workspaceTags: readonly CosWorkspaceTag[],\n label: string\n): CosWorkspaceTag | undefined {\n const key = normalizeTagLabel(label);\n if (!key) return undefined;\n return workspaceTags.find((tag) => normalizeTagLabel(tag.label) === key);\n}\n\n/** A current assignment as read back from `cosEntityTags`. */\nexport interface CosEntityTagAssignment {\n tagId: string;\n tagInfo?: { label?: string | null } | null;\n}\n\n/**\n * Labels the form holds that the entity has no assignment for yet. An\n * assignment's label comes from its `tagInfo`, or from the workspace taxonomy\n * when the projection is missing.\n */\nexport function labelsMissingFromAssignments(\n labels: readonly string[],\n current: readonly CosEntityTagAssignment[],\n workspaceTags: readonly CosWorkspaceTag[]\n): string[] {\n const assigned = new Set<string>();\n for (const assignment of current) {\n const label =\n assignment.tagInfo?.label ?? workspaceTags.find((tag) => tag.id === assignment.tagId)?.label;\n if (label) assigned.add(normalizeTagLabel(label));\n }\n return uniqueTagLabels(labels).filter((label) => !assigned.has(normalizeTagLabel(label)));\n}\n\n/**\n * The full tag-id set to write after a save: the entity's current assignments,\n * minus the ids whose label the user removed, plus the resolved ids of the\n * labels the user added. Order is stable and ids are unique.\n */\nexport function nextEntityTagIds(\n current: readonly CosEntityTagAssignment[],\n removedLabels: readonly string[],\n removedTagIds: readonly string[],\n addedTagIds: readonly string[]\n): string[] {\n const removedKeys = new Set(removedLabels.map(normalizeTagLabel));\n const removedIds = new Set(removedTagIds);\n const ids: string[] = [];\n const push = (id: string) => {\n if (id && !ids.includes(id)) ids.push(id);\n };\n for (const assignment of current) {\n const label = assignment.tagInfo?.label;\n const removedByLabel = label ? removedKeys.has(normalizeTagLabel(label)) : false;\n if (removedByLabel || removedIds.has(assignment.tagId)) continue;\n push(assignment.tagId);\n }\n addedTagIds.forEach(push);\n return ids;\n}\n\n/**\n * Picker suggestions: workspace tags not already selected whose label contains\n * the typed text, alphabetically, capped at `limit`.\n */\nexport function suggestWorkspaceTags(\n workspaceTags: readonly CosWorkspaceTag[],\n selected: readonly string[],\n query: string,\n limit = 8\n): CosWorkspaceTag[] {\n const taken = new Set(selected.map(normalizeTagLabel));\n const needle = normalizeTagLabel(query);\n const seen = new Set<string>();\n return workspaceTags\n .filter((tag) => {\n const key = normalizeTagLabel(tag.label);\n if (!key || taken.has(key) || seen.has(key)) return false;\n seen.add(key);\n return needle === '' || key.includes(needle);\n })\n .sort((a, b) => a.label.localeCompare(b.label))\n .slice(0, limit);\n}\n"],"mappings":";;AAsCA,IAAa,IAAqB,CAAG;;;;;;;;;GAWxB,IAAiB,CAAG;;;;;;;;;GAWpB,IAA0B,CAAG;;;;;;;GAS7B,IAAkB,CAAG;;;;;;;;;GAWrB,IAAkB,CAAG;;;;;;;;;;;;AAuClC,SAAgB,EAAiB,IAAO,IAAO;CAC7C,OAAO,EAAkD,GAAoB;EAC3E,WAAW,EAAE,OAAA,IAA2B;EACxC,aAAa;EACb,aAAa;EACb;CACF,CAAC;AACH;AAUA,SAAgB,EAAc,GAAuB;CACnD,OAAO,EAAM,KAAK,CAAC,CAAC,QAAQ,QAAQ,GAAG;AACzC;AAGA,SAAgB,EAAkB,GAAuB;CACvD,OAAO,EAAc,CAAK,CAAC,CAAC,YAAY;AAC1C;AAGA,SAAgB,EAAgB,GAAqC;CACnE,IAAM,oBAAO,IAAI,IAAY,GACvB,IAAgB,CAAC;CACvB,KAAK,IAAM,KAAS,GAAQ;EAC1B,IAAM,IAAM,EAAkB,CAAK;EAC/B,CAAC,KAAO,EAAK,IAAI,CAAG,MACxB,EAAK,IAAI,CAAG,GACZ,EAAI,KAAK,EAAc,CAAK,CAAC;CAC/B;CACA,OAAO;AACT;AAeA,SAAgB,EACd,GACA,GACoB;CACpB,IAAM,IAAS,EAAgB,CAAQ,GACjC,IAAQ,EAAgB,CAAI,GAC5B,IAAa,IAAI,IAAI,EAAO,IAAI,CAAiB,CAAC,GAClD,IAAY,IAAI,IAAI,EAAM,IAAI,CAAiB,CAAC;CACtD,OAAO;EACL,OAAO,EAAM,QAAQ,MAAU,CAAC,EAAW,IAAI,EA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AAM,EAAkB,EAAI,KAAK;EAGvC,OAFI,CAAC,KAAO,EAAM,IAAI,CAAG,KAAK,EAAK,IAAI,CAAG,IAAU,MACpD,EAAK,IAAI,CAAG,GACL,MAAW,MAAM,EAAI,SAAS,CAAM;CAC7C,CAAC,CAAC,CACD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,CAAC,CAC9C,MAAM,GAAG,CAAK;AACnB"}
|
|
@@ -9,11 +9,11 @@ export interface EntityTagsFieldProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Controlled
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* Controlled free-text chips input for plain string arrays (grant scopes,
|
|
13
|
+
* release authors). Entity *tags* use `WorkspaceTagsPicker` instead, which
|
|
14
|
+
* suggests from and writes to the workspace taxonomy; this field never talks to
|
|
15
|
+
* a tag service. The parent form owns the array and passes it straight into the
|
|
16
|
+
* entity's create/update input.
|
|
17
17
|
*/
|
|
18
18
|
export declare function EntityTagsField({ value, onChange, label, placeholder, disabled, className, }: EntityTagsFieldProps): import('react').JSX.Element;
|
|
19
19
|
export default EntityTagsField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTagsField.js","names":[],"sources":["../../../src/cosmicintersection/components/EntityTagsField.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Plus, Tag as TagIcon, X } from 'lucide-react';\nimport { Badge, Button, Input } from '@burdenoff/fe-libs/ui';\n\nexport interface EntityTagsFieldProps {\n /** Current tags (the `tags: [String!]` inline array on the Cos entity). */\n value: string[];\n /** Called with the next tag array whenever a chip is added or removed. */\n onChange: (tags: string[]) => void;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Controlled
|
|
1
|
+
{"version":3,"file":"EntityTagsField.js","names":[],"sources":["../../../src/cosmicintersection/components/EntityTagsField.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Plus, Tag as TagIcon, X } from 'lucide-react';\nimport { Badge, Button, Input } from '@burdenoff/fe-libs/ui';\n\nexport interface EntityTagsFieldProps {\n /** Current tags (the `tags: [String!]` inline array on the Cos entity). */\n value: string[];\n /** Called with the next tag array whenever a chip is added or removed. */\n onChange: (tags: string[]) => void;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Controlled free-text chips input for plain string arrays (grant scopes,\n * release authors). Entity *tags* use `WorkspaceTagsPicker` instead, which\n * suggests from and writes to the workspace taxonomy; this field never talks to\n * a tag service. The parent form owns the array and passes it straight into the\n * entity's create/update input.\n */\nexport function EntityTagsField({\n value,\n onChange,\n label = 'Tags',\n placeholder = 'Add a tag and press Enter',\n disabled = false,\n className,\n}: EntityTagsFieldProps) {\n const [draft, setDraft] = useState('');\n\n const addTag = () => {\n const trimmed = draft.trim();\n if (!trimmed) {\n return;\n }\n // De-duplicate case-insensitively while preserving the user's casing.\n const exists = value.some((tag) => tag.toLowerCase() === trimmed.toLowerCase());\n if (!exists) {\n onChange([...value, trimmed]);\n }\n setDraft('');\n };\n\n const removeTag = (tag: string) => {\n onChange(value.filter((existing) => existing !== tag));\n };\n\n return (\n <div className={`space-y-2 ${className ?? ''}`}>\n <div className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <TagIcon className=\"size-4 text-text-secondary\" aria-hidden=\"true\" />\n <span>{label}</span>\n </div>\n\n <div className=\"flex flex-wrap gap-2\" role=\"list\" aria-label={label}>\n {value.length === 0 ? (\n <span className=\"text-sm text-text-secondary\">No tags yet.</span>\n ) : (\n value.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"gap-1.5\" role=\"listitem\">\n <span className=\"min-w-0 truncate\">{tag}</span>\n <button\n type=\"button\"\n onClick={() => removeTag(tag)}\n disabled={disabled}\n aria-label={`Remove ${tag}`}\n className=\"rounded-full text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus disabled:opacity-50\"\n >\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n </Badge>\n ))\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n <Input\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n aria-label={`${label} input`}\n disabled={disabled}\n className=\"w-full max-w-xs\"\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n addTag();\n }\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={addTag}\n disabled={disabled || !draft.trim()}\n >\n <Plus className=\"size-4\" />\n Add\n </Button>\n </div>\n </div>\n );\n}\n\nexport default EntityTagsField;\n"],"mappings":";;;;;AAsBA,SAAgB,EAAgB,EAC9B,UACA,aACA,WAAQ,QACR,iBAAc,6BACd,cAAW,IACX,gBACuB;CACvB,IAAM,CAAC,GAAO,KAAY,EAAS,EAAE,GAE/B,UAAe;EACnB,IAAM,IAAU,EAAM,KAAK;EACtB,MAIU,EAAM,MAAM,MAAQ,EAAI,YAAY,MAAM,EAAQ,YAAY,CACxE,KACH,EAAS,CAAC,GAAG,GAAO,CAAO,CAAC,GAE9B,EAAS,EAAE;CACb,GAEM,KAAa,MAAgB;EACjC,EAAS,EAAM,QAAQ,MAAa,MAAa,CAAG,CAAC;CACvD;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW,aAAa,KAAa;YAA1C;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KAAS,WAAU;KAA6B,eAAY;IAAQ,CAAA,GACpE,kBAAC,QAAD,EAAA,UAAO,EAAY,CAAA,CAChB;;GAEL,kBAAC,OAAD;IAAK,WAAU;IAAuB,MAAK;IAAO,cAAY;cAC3D,EAAM,WAAW,IAChB,kBAAC,QAAD;KAAM,WAAU;eAA8B;IAAkB,CAAA,IAEhE,EAAM,KAAK,MACT,kBAAC,GAAD;KAAiB,SAAQ;KAAY,WAAU;KAAU,MAAK;eAA9D,CACE,kBAAC,QAAD;MAAM,WAAU;gBAAoB;KAAU,CAAA,GAC9C,kBAAC,UAAD;MACE,MAAK;MACL,eAAe,EAAU,CAAG;MAClB;MACV,cAAY,UAAU;MACtB,WAAU;gBAEV,kBAAC,GAAD;OAAG,WAAU;OAAS,eAAY;MAAQ,CAAA;KACpC,CAAA,CACH;OAXK,CAWL,CACR;GAEA,CAAA;GAEL,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KACE,OAAO;KACP,WAAW,MAAU,EAAS,EAAM,OAAO,KAAK;KACnC;KACb,cAAY,GAAG,EAAM;KACX;KACV,WAAU;KACV,YAAY,MAAU;MACpB,AAAI,EAAM,QAAQ,YAChB,EAAM,eAAe,GACrB,EAAO;KAEX;IACD,CAAA,GACD,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,SAAS;KACT,UAAU,KAAY,CAAC,EAAM,KAAK;eALpC,CAOE,kBAAC,GAAD,EAAM,WAAU,SAAU,CAAA,GAAC,KAErB;MACL;;EACF;;AAET"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PlotView, Scene3DView, SkyMapView } from '../lib/visualization';
|
|
2
|
+
export declare function SkyMapCanvas({ view }: {
|
|
3
|
+
view: SkyMapView;
|
|
4
|
+
}): import('react').JSX.Element;
|
|
5
|
+
export declare function PlotCanvas({ view }: {
|
|
6
|
+
view: PlotView;
|
|
7
|
+
}): import('react').JSX.Element;
|
|
8
|
+
export declare function SceneCanvas({ view }: {
|
|
9
|
+
view: Scene3DView;
|
|
10
|
+
}): import('react').JSX.Element;
|
|
11
|
+
export interface ScienceCanvasProps {
|
|
12
|
+
results: Record<string, unknown>;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function ScienceCanvas({ results, className }: ScienceCanvasProps): import('react').JSX.Element;
|
|
16
|
+
export default ScienceCanvas;
|
|
17
|
+
//# sourceMappingURL=ScienceCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScienceCanvas.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/components/ScienceCanvas.tsx"],"names":[],"mappings":"AA2CA,OAAO,EAmBL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAgL9B,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,+BAiM1D;AAeD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,+BA6RtD;AASD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,+BAiQ1D;AA8BD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmBD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAyCvE;AAED,eAAe,aAAa,CAAC"}
|