@loomcycle/explorer 0.1.0 → 0.2.0
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/components/ColorSchemeEditor.d.ts +13 -0
- package/dist/components/CrossReferences.d.ts +8 -0
- package/dist/components/DocumentChunkTree.d.ts +5 -1
- package/dist/components/Mermaid.d.ts +4 -0
- package/dist/components/PathTree.d.ts +3 -1
- package/dist/index.cjs +5 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +945 -613
- package/dist/index.js.map +1 -1
- package/dist/lib/colorScheme.d.ts +26 -0
- package/dist/lib/dataLayer.d.ts +12 -1
- package/dist/styles.css +257 -0
- package/dist/types.d.ts +13 -0
- package/package.json +12 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
export type ColorScheme = Record<string, string>;
|
|
3
|
+
export interface DocSummary {
|
|
4
|
+
document_id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
root_chunk_id?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
color_enabled: boolean;
|
|
10
|
+
color_scheme?: ColorScheme;
|
|
11
|
+
}
|
|
12
|
+
export interface DocumentMeta {
|
|
13
|
+
document_id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
root_chunk_id?: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
status?: string;
|
|
18
|
+
color_enabled: boolean;
|
|
19
|
+
color_scheme?: ColorScheme;
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_SCHEME: ColorScheme;
|
|
22
|
+
export declare function effectiveScheme(scheme: ColorScheme | undefined): ColorScheme;
|
|
23
|
+
export declare function docColor(type: string | undefined, status: string | undefined, scheme: ColorScheme): string | undefined;
|
|
24
|
+
export declare function chunkColor(status: string | undefined, scheme: ColorScheme): string | undefined;
|
|
25
|
+
export declare function hexToTint(hex: string): string | undefined;
|
|
26
|
+
export declare function tintStyle(color: string | undefined): CSSProperties | undefined;
|
package/dist/lib/dataLayer.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { LoomcycleClient } from "@loomcycle/client";
|
|
3
|
-
import type { BrowseScope, ChunkDetail, ChunkRow, DocScope, PathEntry, PathScope } from "../types";
|
|
3
|
+
import type { BrowseScope, ChunkDetail, ChunkRow, DocEdge, DocScope, PathEntry, PathScope } from "../types";
|
|
4
|
+
import type { DocSummary, DocumentMeta } from "./colorScheme";
|
|
4
5
|
export interface ChunkPatch {
|
|
5
6
|
body?: string;
|
|
6
7
|
fields?: unknown;
|
|
@@ -23,10 +24,20 @@ export interface ExplorerDataLayer {
|
|
|
23
24
|
path?: string;
|
|
24
25
|
}>;
|
|
25
26
|
documentDelete(id: string, scope: DocScope, browse?: BrowseScope): Promise<unknown>;
|
|
27
|
+
documentGet(id: string, scope: DocScope, browse?: BrowseScope): Promise<DocumentMeta>;
|
|
28
|
+
documentsSummary(opts: {
|
|
29
|
+
documentIds?: string[];
|
|
30
|
+
underPath?: string;
|
|
31
|
+
}, scope: DocScope, browse?: BrowseScope): Promise<{
|
|
32
|
+
documents: DocSummary[];
|
|
33
|
+
}>;
|
|
26
34
|
documentQueryChunks(documentId: string, scope: DocScope, browse?: BrowseScope): Promise<{
|
|
27
35
|
chunks: ChunkRow[];
|
|
28
36
|
}>;
|
|
29
37
|
documentGetChunk(id: string, scope: DocScope, browse?: BrowseScope): Promise<ChunkDetail>;
|
|
38
|
+
documentGetEdges(documentId: string, scope: DocScope, browse?: BrowseScope): Promise<{
|
|
39
|
+
edges: DocEdge[];
|
|
40
|
+
}>;
|
|
30
41
|
documentUpdateChunk(id: string, revision: number, patch: ChunkPatch, scope: DocScope, browse?: BrowseScope): Promise<ChunkDetail>;
|
|
31
42
|
documentExportMd(documentId: string, scope: DocScope, includeMetadata: boolean, browse?: BrowseScope): Promise<{
|
|
32
43
|
markdown: string;
|
package/dist/styles.css
CHANGED
|
@@ -240,6 +240,31 @@
|
|
|
240
240
|
font-size: var(--lc-text-sm);
|
|
241
241
|
margin-bottom: 16px;
|
|
242
242
|
}
|
|
243
|
+
/* RFC BN P1: a sticky top action bar (title + Save/Cancel) so a long chunk body
|
|
244
|
+
never needs scrolling to reach save. The modal itself is the scroll container
|
|
245
|
+
(max-height:80vh; overflow:auto), so a .sticky-top header pins to its top. */
|
|
246
|
+
.loomcycle-explorer .modal-header {
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
justify-content: space-between;
|
|
250
|
+
gap: 12px;
|
|
251
|
+
margin-bottom: 12px;
|
|
252
|
+
}
|
|
253
|
+
.loomcycle-explorer .modal-header.sticky-top {
|
|
254
|
+
position: sticky;
|
|
255
|
+
top: 0;
|
|
256
|
+
background: var(--bg);
|
|
257
|
+
padding-bottom: 10px;
|
|
258
|
+
border-bottom: 1px solid var(--border);
|
|
259
|
+
z-index: 1;
|
|
260
|
+
}
|
|
261
|
+
.loomcycle-explorer .modal-header h3 {
|
|
262
|
+
margin: 0;
|
|
263
|
+
}
|
|
264
|
+
.loomcycle-explorer .modal-buttons-top {
|
|
265
|
+
margin: 0;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
}
|
|
243
268
|
.loomcycle-explorer .modal-textarea {
|
|
244
269
|
width: 100%;
|
|
245
270
|
font-family: inherit;
|
|
@@ -750,6 +775,50 @@
|
|
|
750
775
|
.loomcycle-explorer .md a {
|
|
751
776
|
color: var(--accent);
|
|
752
777
|
}
|
|
778
|
+
/* RFC BN — GFM tables + Mermaid diagrams in the chunk Markdown view. */
|
|
779
|
+
.loomcycle-explorer .md table {
|
|
780
|
+
border-collapse: collapse;
|
|
781
|
+
margin: 0.75em 0;
|
|
782
|
+
max-width: 100%;
|
|
783
|
+
display: block;
|
|
784
|
+
overflow-x: auto;
|
|
785
|
+
font-size: 0.92em;
|
|
786
|
+
}
|
|
787
|
+
.loomcycle-explorer .md th,
|
|
788
|
+
.loomcycle-explorer .md td {
|
|
789
|
+
border: 1px solid var(--border);
|
|
790
|
+
padding: 5px 10px;
|
|
791
|
+
text-align: left;
|
|
792
|
+
vertical-align: top;
|
|
793
|
+
}
|
|
794
|
+
.loomcycle-explorer .md th {
|
|
795
|
+
background: var(--bg-soft);
|
|
796
|
+
font-weight: 600;
|
|
797
|
+
}
|
|
798
|
+
.loomcycle-explorer .md tbody tr:nth-child(even) {
|
|
799
|
+
background: rgba(127, 127, 127, 0.06);
|
|
800
|
+
}
|
|
801
|
+
.loomcycle-explorer .md-mermaid {
|
|
802
|
+
margin: 0.75em 0;
|
|
803
|
+
padding: 10px 12px;
|
|
804
|
+
background: var(--bg-soft);
|
|
805
|
+
border: 1px solid var(--border);
|
|
806
|
+
border-radius: 4px;
|
|
807
|
+
overflow-x: auto;
|
|
808
|
+
text-align: center;
|
|
809
|
+
}
|
|
810
|
+
.loomcycle-explorer .md-mermaid svg {
|
|
811
|
+
max-width: 100%;
|
|
812
|
+
height: auto;
|
|
813
|
+
}
|
|
814
|
+
.loomcycle-explorer .md-mermaid-loading {
|
|
815
|
+
color: var(--fg-soft);
|
|
816
|
+
font-size: 0.9em;
|
|
817
|
+
text-align: left;
|
|
818
|
+
}
|
|
819
|
+
.loomcycle-explorer .md-mermaid-error {
|
|
820
|
+
border-left: 3px solid var(--danger);
|
|
821
|
+
}
|
|
753
822
|
|
|
754
823
|
/* ============================================================
|
|
755
824
|
Document Assistant slot (host-provided content; the package only
|
|
@@ -765,3 +834,191 @@
|
|
|
765
834
|
border-top: 1px solid var(--border);
|
|
766
835
|
background: var(--bg-soft);
|
|
767
836
|
}
|
|
837
|
+
|
|
838
|
+
/* ============================================================
|
|
839
|
+
RFC BN — per-document color-scheme editor
|
|
840
|
+
============================================================ */
|
|
841
|
+
.loomcycle-explorer .scheme-editor {
|
|
842
|
+
max-width: 520px;
|
|
843
|
+
}
|
|
844
|
+
.loomcycle-explorer .scheme-editor-head {
|
|
845
|
+
display: flex;
|
|
846
|
+
align-items: center;
|
|
847
|
+
justify-content: space-between;
|
|
848
|
+
gap: 12px;
|
|
849
|
+
position: sticky;
|
|
850
|
+
top: 0;
|
|
851
|
+
background: var(--bg);
|
|
852
|
+
padding-bottom: 10px;
|
|
853
|
+
border-bottom: 1px solid var(--border);
|
|
854
|
+
margin-bottom: 12px;
|
|
855
|
+
}
|
|
856
|
+
.loomcycle-explorer .scheme-editor-head h3 {
|
|
857
|
+
margin: 0;
|
|
858
|
+
}
|
|
859
|
+
.loomcycle-explorer .scheme-editor-actions {
|
|
860
|
+
display: flex;
|
|
861
|
+
gap: 8px;
|
|
862
|
+
}
|
|
863
|
+
.loomcycle-explorer .scheme-editor-actions button {
|
|
864
|
+
padding: 8px 16px;
|
|
865
|
+
border: 1px solid var(--border);
|
|
866
|
+
background: var(--bg-soft);
|
|
867
|
+
color: var(--fg);
|
|
868
|
+
border-radius: 4px;
|
|
869
|
+
cursor: pointer;
|
|
870
|
+
}
|
|
871
|
+
.loomcycle-explorer .scheme-editor-actions button.primary {
|
|
872
|
+
background: var(--running);
|
|
873
|
+
color: white;
|
|
874
|
+
border-color: var(--running);
|
|
875
|
+
}
|
|
876
|
+
.loomcycle-explorer .scheme-toggle {
|
|
877
|
+
display: flex;
|
|
878
|
+
align-items: center;
|
|
879
|
+
gap: 8px;
|
|
880
|
+
margin-bottom: 8px;
|
|
881
|
+
font-size: var(--lc-text-sm);
|
|
882
|
+
}
|
|
883
|
+
.loomcycle-explorer .scheme-group {
|
|
884
|
+
margin-top: 14px;
|
|
885
|
+
}
|
|
886
|
+
.loomcycle-explorer .scheme-group h4 {
|
|
887
|
+
margin: 0 0 6px 0;
|
|
888
|
+
font-size: var(--lc-text-sm);
|
|
889
|
+
color: var(--fg-soft);
|
|
890
|
+
text-transform: uppercase;
|
|
891
|
+
letter-spacing: 0.04em;
|
|
892
|
+
}
|
|
893
|
+
.loomcycle-explorer .scheme-row {
|
|
894
|
+
display: flex;
|
|
895
|
+
align-items: center;
|
|
896
|
+
gap: 10px;
|
|
897
|
+
padding: 3px 0;
|
|
898
|
+
}
|
|
899
|
+
.loomcycle-explorer .scheme-row input[type="color"] {
|
|
900
|
+
width: 28px;
|
|
901
|
+
height: 22px;
|
|
902
|
+
padding: 0;
|
|
903
|
+
border: 1px solid var(--border);
|
|
904
|
+
border-radius: 4px;
|
|
905
|
+
background: none;
|
|
906
|
+
cursor: pointer;
|
|
907
|
+
}
|
|
908
|
+
.loomcycle-explorer .scheme-key {
|
|
909
|
+
flex: 1;
|
|
910
|
+
font-size: var(--lc-text-sm);
|
|
911
|
+
}
|
|
912
|
+
.loomcycle-explorer .scheme-hex {
|
|
913
|
+
color: var(--fg-soft);
|
|
914
|
+
font-size: var(--lc-text-xs);
|
|
915
|
+
}
|
|
916
|
+
.loomcycle-explorer .scheme-editor-foot {
|
|
917
|
+
display: flex;
|
|
918
|
+
align-items: center;
|
|
919
|
+
gap: 10px;
|
|
920
|
+
margin-top: 16px;
|
|
921
|
+
padding-top: 12px;
|
|
922
|
+
border-top: 1px solid var(--border);
|
|
923
|
+
}
|
|
924
|
+
.loomcycle-explorer .scheme-editor-foot button {
|
|
925
|
+
padding: 6px 12px;
|
|
926
|
+
border: 1px solid var(--border);
|
|
927
|
+
background: var(--bg-soft);
|
|
928
|
+
color: var(--fg);
|
|
929
|
+
border-radius: 4px;
|
|
930
|
+
cursor: pointer;
|
|
931
|
+
}
|
|
932
|
+
.loomcycle-explorer .scheme-status {
|
|
933
|
+
color: var(--fg-soft);
|
|
934
|
+
font-size: var(--lc-text-xs);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
/* ============================================================
|
|
938
|
+
RFC BN P4 — cross-reference links + relationship graph
|
|
939
|
+
============================================================ */
|
|
940
|
+
.loomcycle-explorer .chunk-link-badge {
|
|
941
|
+
font-size: 0.85em;
|
|
942
|
+
line-height: 1;
|
|
943
|
+
opacity: 0.85;
|
|
944
|
+
}
|
|
945
|
+
.loomcycle-explorer .doc-refs {
|
|
946
|
+
margin-top: 14px;
|
|
947
|
+
padding-top: 12px;
|
|
948
|
+
border-top: 1px solid var(--border);
|
|
949
|
+
}
|
|
950
|
+
.loomcycle-explorer .doc-refs h4 {
|
|
951
|
+
margin: 0 0 6px 0;
|
|
952
|
+
font-size: var(--lc-text-sm);
|
|
953
|
+
color: var(--fg-soft);
|
|
954
|
+
text-transform: uppercase;
|
|
955
|
+
letter-spacing: 0.04em;
|
|
956
|
+
}
|
|
957
|
+
.loomcycle-explorer .doc-refs-empty {
|
|
958
|
+
color: var(--fg-soft);
|
|
959
|
+
font-size: var(--lc-text-sm);
|
|
960
|
+
margin: 0;
|
|
961
|
+
}
|
|
962
|
+
.loomcycle-explorer .doc-refs-list {
|
|
963
|
+
list-style: none;
|
|
964
|
+
margin: 0;
|
|
965
|
+
padding: 0;
|
|
966
|
+
display: flex;
|
|
967
|
+
flex-direction: column;
|
|
968
|
+
gap: 4px;
|
|
969
|
+
}
|
|
970
|
+
.loomcycle-explorer .doc-ref {
|
|
971
|
+
display: flex;
|
|
972
|
+
align-items: center;
|
|
973
|
+
gap: 8px;
|
|
974
|
+
font-size: var(--lc-text-sm);
|
|
975
|
+
}
|
|
976
|
+
.loomcycle-explorer .doc-ref-kind {
|
|
977
|
+
font-family: var(--mono);
|
|
978
|
+
font-size: var(--lc-text-xs);
|
|
979
|
+
color: var(--fg-soft);
|
|
980
|
+
background: var(--bg-soft);
|
|
981
|
+
border: 1px solid var(--border);
|
|
982
|
+
border-radius: 3px;
|
|
983
|
+
padding: 1px 5px;
|
|
984
|
+
}
|
|
985
|
+
.loomcycle-explorer .doc-ref-arrow {
|
|
986
|
+
color: var(--fg-muted);
|
|
987
|
+
}
|
|
988
|
+
.loomcycle-explorer .doc-ref-target {
|
|
989
|
+
background: none;
|
|
990
|
+
border: none;
|
|
991
|
+
color: var(--accent);
|
|
992
|
+
cursor: pointer;
|
|
993
|
+
padding: 0;
|
|
994
|
+
font: inherit;
|
|
995
|
+
text-align: left;
|
|
996
|
+
}
|
|
997
|
+
.loomcycle-explorer .doc-ref-target:hover {
|
|
998
|
+
text-decoration: underline;
|
|
999
|
+
}
|
|
1000
|
+
.loomcycle-explorer .doc-ref-target.external {
|
|
1001
|
+
color: var(--fg-soft);
|
|
1002
|
+
cursor: default;
|
|
1003
|
+
}
|
|
1004
|
+
.loomcycle-explorer .doc-graph {
|
|
1005
|
+
margin-top: 12px;
|
|
1006
|
+
}
|
|
1007
|
+
.loomcycle-explorer .doc-graph-toggle,
|
|
1008
|
+
.loomcycle-explorer .doc-graph-more {
|
|
1009
|
+
background: none;
|
|
1010
|
+
border: none;
|
|
1011
|
+
color: var(--fg-soft);
|
|
1012
|
+
cursor: pointer;
|
|
1013
|
+
padding: 2px 0;
|
|
1014
|
+
font: inherit;
|
|
1015
|
+
font-size: var(--lc-text-sm);
|
|
1016
|
+
}
|
|
1017
|
+
.loomcycle-explorer .doc-graph-toggle:hover,
|
|
1018
|
+
.loomcycle-explorer .doc-graph-more:hover {
|
|
1019
|
+
color: var(--accent);
|
|
1020
|
+
}
|
|
1021
|
+
.loomcycle-explorer .doc-graph-more {
|
|
1022
|
+
margin-top: 6px;
|
|
1023
|
+
font-size: var(--lc-text-xs);
|
|
1024
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -24,6 +24,19 @@ export interface ChunkDetail extends ChunkRow {
|
|
|
24
24
|
body: string;
|
|
25
25
|
fields?: unknown;
|
|
26
26
|
}
|
|
27
|
+
export interface DocEdge {
|
|
28
|
+
from_id: string;
|
|
29
|
+
to_id: string;
|
|
30
|
+
kind: string;
|
|
31
|
+
from_title?: string;
|
|
32
|
+
from_type?: string;
|
|
33
|
+
from_status?: string;
|
|
34
|
+
from_document_id?: string;
|
|
35
|
+
to_title?: string;
|
|
36
|
+
to_type?: string;
|
|
37
|
+
to_status?: string;
|
|
38
|
+
to_document_id?: string;
|
|
39
|
+
}
|
|
27
40
|
export interface Principal {
|
|
28
41
|
subject: string;
|
|
29
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcycle/explorer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Embeddable React Path VFS + chunked-graph Document browser for the loomcycle agentic runtime (RFC AL / AK) — a themeable, standalone package: a dirent tree with folder/document CRUD and a chunk-tree Document viewer/editor.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,17 +49,28 @@
|
|
|
49
49
|
"test": "vitest run --passWithNoTests",
|
|
50
50
|
"test:watch": "vitest"
|
|
51
51
|
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"react-markdown": "^9.1.0",
|
|
54
|
+
"remark-gfm": "^4.0.1"
|
|
55
|
+
},
|
|
52
56
|
"peerDependencies": {
|
|
53
57
|
"@loomcycle/client": "^1.12.1",
|
|
58
|
+
"mermaid": "^11.0.0",
|
|
54
59
|
"react": "^18.0.0 || ^19.0.0",
|
|
55
60
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
56
61
|
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"mermaid": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
57
67
|
"devDependencies": {
|
|
58
68
|
"@loomcycle/client": "^1.12.1",
|
|
59
69
|
"@types/node": "^22.0.0",
|
|
60
70
|
"@types/react": "^19.0.0",
|
|
61
71
|
"@types/react-dom": "^19.0.0",
|
|
62
72
|
"@vitejs/plugin-react": "^5.0.0",
|
|
73
|
+
"mermaid": "^11.0.0",
|
|
63
74
|
"react": "^19.0.0",
|
|
64
75
|
"react-dom": "^19.0.0",
|
|
65
76
|
"typescript": "^5.6.0",
|