@zephytiju/prism-quick-files 0.1.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.
Files changed (54) hide show
  1. package/README.md +192 -0
  2. package/dist/DropInModelCard.d.ts +9 -0
  3. package/dist/DropInModelCard.d.ts.map +1 -0
  4. package/dist/DropInModelCard.js +7 -0
  5. package/dist/FileList.d.ts +25 -0
  6. package/dist/FileList.d.ts.map +1 -0
  7. package/dist/FileList.js +23 -0
  8. package/dist/FileRow.d.ts +31 -0
  9. package/dist/FileRow.d.ts.map +1 -0
  10. package/dist/FileRow.js +54 -0
  11. package/dist/PanelHeader.d.ts +17 -0
  12. package/dist/PanelHeader.d.ts.map +1 -0
  13. package/dist/PanelHeader.js +11 -0
  14. package/dist/QuickFiles.d.ts +57 -0
  15. package/dist/QuickFiles.d.ts.map +1 -0
  16. package/dist/QuickFiles.js +75 -0
  17. package/dist/SearchBox.d.ts +13 -0
  18. package/dist/SearchBox.d.ts.map +1 -0
  19. package/dist/SearchBox.js +23 -0
  20. package/dist/SectionLabels.d.ts +9 -0
  21. package/dist/SectionLabels.d.ts.map +1 -0
  22. package/dist/SectionLabels.js +7 -0
  23. package/dist/clients.d.ts +22 -0
  24. package/dist/clients.d.ts.map +1 -0
  25. package/dist/clients.js +13 -0
  26. package/dist/dragState.d.ts +20 -0
  27. package/dist/dragState.d.ts.map +1 -0
  28. package/dist/dragState.js +56 -0
  29. package/dist/icons.d.ts +35 -0
  30. package/dist/icons.d.ts.map +1 -0
  31. package/dist/icons.js +58 -0
  32. package/dist/index.d.ts +11 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +5 -0
  35. package/dist/locales/en.json +20 -0
  36. package/dist/locales/index.d.ts +72 -0
  37. package/dist/locales/index.d.ts.map +1 -0
  38. package/dist/locales/index.js +27 -0
  39. package/dist/locales/zh-CN.json +20 -0
  40. package/dist/tokens.d.ts +19 -0
  41. package/dist/tokens.d.ts.map +1 -0
  42. package/dist/tokens.js +18 -0
  43. package/dist/types.d.ts +88 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +1 -0
  46. package/dist/useQuickFilesEntries.d.ts +16 -0
  47. package/dist/useQuickFilesEntries.d.ts.map +1 -0
  48. package/dist/useQuickFilesEntries.js +40 -0
  49. package/dist/visibleRows.d.ts +12 -0
  50. package/dist/visibleRows.d.ts.map +1 -0
  51. package/dist/visibleRows.js +57 -0
  52. package/locales/en.json +20 -0
  53. package/locales/zh-CN.json +20 -0
  54. package/package.json +65 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;KACtF,CAAC;CACH;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,gBAAgB,GAAG,iBAAiB,CAUtF"}
@@ -0,0 +1,13 @@
1
+ import { createFileEntryClient } from "@zephytiju/lattice-common-interfaces";
2
+ /** Builds the interface clients bound to the host Lattice transport. */
3
+ export function createQuickFilesClients(transport) {
4
+ const files = createFileEntryClient(transport);
5
+ return {
6
+ files: {
7
+ list: async (request) => {
8
+ const result = await files.list(request ?? {});
9
+ return result;
10
+ },
11
+ },
12
+ };
13
+ }
@@ -0,0 +1,20 @@
1
+ import type { QuickFileDragState, QuickFileEntry } from "./types.js";
2
+ /** Component-scoped Prism channel carrying the bounded drag/insert state (D6). */
3
+ export declare const DRAG_STATE_CHANNEL = "quick-files.drag-state";
4
+ /**
5
+ * Builds the bounded drag/insert state for an entry (D6 reference case): file
6
+ * metadata only — NEVER a component reference. Mime falls back to the kind's
7
+ * default, the snapshot reference to the entry id.
8
+ */
9
+ export declare function buildQuickFileDragState(entry: QuickFileEntry): QuickFileDragState;
10
+ /**
11
+ * Drag-state publication wiring for the panel: returns the setter-only
12
+ * publisher for {@link DRAG_STATE_CHANNEL} and installs the panel-side half
13
+ * of "ESC or dragging outside any target cancels" — ESC clears any in-flight
14
+ * drag/insert session.
15
+ *
16
+ * Setter-only publication means the panel never re-renders from channel
17
+ * state — it is a pure publisher (receivers own the interpretation).
18
+ */
19
+ export declare function useQuickFileDragStatePublish(): (next: QuickFileDragState | null) => void;
20
+ //# sourceMappingURL=dragState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragState.d.ts","sourceRoot":"","sources":["../src/dragState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAErE,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAgB3D;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,kBAAkB,CAUjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,8CAgB3C"}
@@ -0,0 +1,56 @@
1
+ import { useEffect } from "react";
2
+ import { usePrismStateSetter } from "@zephytiju/prism-react";
3
+ /** Component-scoped Prism channel carrying the bounded drag/insert state (D6). */
4
+ export const DRAG_STATE_CHANNEL = "quick-files.drag-state";
5
+ /**
6
+ * Default kind → bounded mime mapping for the drag state (hosts override per
7
+ * entry through the route's superset projection).
8
+ */
9
+ const DEFAULT_MIME_BY_KIND = {
10
+ "world-view": "application/x-geovision-view",
11
+ dossier: "application/x-dossier",
12
+ "evidence-pack": "application/x-evidence-pack",
13
+ board: "application/x-fluxboard",
14
+ folder: "inode/directory",
15
+ };
16
+ const GENERIC_MIME = "application/octet-stream";
17
+ /**
18
+ * Builds the bounded drag/insert state for an entry (D6 reference case): file
19
+ * metadata only — NEVER a component reference. Mime falls back to the kind's
20
+ * default, the snapshot reference to the entry id.
21
+ */
22
+ export function buildQuickFileDragState(entry) {
23
+ const mime = entry.mime ?? DEFAULT_MIME_BY_KIND[entry.kind] ?? GENERIC_MIME;
24
+ return {
25
+ entryId: entry.id,
26
+ kind: entry.kind,
27
+ name: entry.name,
28
+ mime,
29
+ snapshotRef: entry.snapshotRef ?? entry.id,
30
+ sourcePanel: "quick-files",
31
+ };
32
+ }
33
+ /**
34
+ * Drag-state publication wiring for the panel: returns the setter-only
35
+ * publisher for {@link DRAG_STATE_CHANNEL} and installs the panel-side half
36
+ * of "ESC or dragging outside any target cancels" — ESC clears any in-flight
37
+ * drag/insert session.
38
+ *
39
+ * Setter-only publication means the panel never re-renders from channel
40
+ * state — it is a pure publisher (receivers own the interpretation).
41
+ */
42
+ export function useQuickFileDragStatePublish() {
43
+ const publishDragState = usePrismStateSetter(DRAG_STATE_CHANNEL);
44
+ useEffect(() => {
45
+ const onKeyDown = (event) => {
46
+ if (event.key === "Escape") {
47
+ publishDragState(null);
48
+ }
49
+ };
50
+ window.addEventListener("keydown", onKeyDown);
51
+ return () => {
52
+ window.removeEventListener("keydown", onKeyDown);
53
+ };
54
+ }, [publishDragState]);
55
+ return publishDragState;
56
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * File-kind icons of the Quick File Insert panel — faithful vector copies of
3
+ * the authoritative v9 HTML prototype's `.fic` glyph set (world view globe,
4
+ * dossier/evidence document, board, folder). Icons inherit their color from
5
+ * `currentColor`, so each kind's hue resolves to a SEMANTIC theme token
6
+ * supplied by the host's MantineProvider (never a hardcoded color).
7
+ */
8
+ import type React from "react";
9
+ import type { QuickFileGlyph } from "./types.js";
10
+ /** World view — globe with meridians (prototype `.ic-world`). */
11
+ export declare function WorldIcon(): React.ReactElement;
12
+ /** Dossier doc / evidence pack — outlined document page (prototype `.ic-doc`). */
13
+ export declare function DocIcon(): React.ReactElement;
14
+ /** Workflow board — connected kanban squares (prototype's WF row glyph). */
15
+ export declare function BoardWorkflowIcon(): React.ReactElement;
16
+ /** Audit board — append-only chain squares (prototype's AC row glyph). */
17
+ export declare function BoardAuditIcon(): React.ReactElement;
18
+ /** Folder — pinned common-assets folder (prototype `.ic-folder`). */
19
+ export declare function FolderIcon(): React.ReactElement;
20
+ /** Search magnifier of the panel's search box (prototype ⌕ glyph). */
21
+ export declare function SearchGlyph(): React.ReactElement;
22
+ /** Renders the glyph for a kind (boards honor the entry's glyph override). */
23
+ export declare function FileKindIcon({ glyph, }: {
24
+ readonly glyph: QuickFileGlyph;
25
+ }): React.ReactElement;
26
+ /** Default kind → glyph resolution (boards default to the workflow glyph). */
27
+ export declare const DEFAULT_KIND_GLYPHS: Readonly<Record<string, QuickFileGlyph>>;
28
+ /**
29
+ * Default kind → semantic color token mapping, mirroring the v9 prototype's
30
+ * icon hues onto theme tokens: purple world views → `signal`, mint docs →
31
+ * `ok`, amber boards → `warn`, blue folders → `accent`. Hosts override
32
+ * through the `kindTokens` configuration key.
33
+ */
34
+ export declare const DEFAULT_KIND_TOKENS: Readonly<Record<string, string>>;
35
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,iEAAiE;AACjE,wBAAgB,SAAS,IAAI,KAAK,CAAC,YAAY,CAkB9C;AAED,kFAAkF;AAClF,wBAAgB,OAAO,IAAI,KAAK,CAAC,YAAY,CAc5C;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,IAAI,KAAK,CAAC,YAAY,CAoBtD;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,IAAI,KAAK,CAAC,YAAY,CAoBnD;AAED,qEAAqE;AACrE,wBAAgB,UAAU,IAAI,KAAK,CAAC,YAAY,CAmB/C;AAED,sEAAsE;AACtE,wBAAgB,WAAW,IAAI,KAAK,CAAC,YAAY,CAOhD;AAUD,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,EAC3B,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,GAAG,KAAK,CAAC,YAAY,CAGrB;AAED,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAMxE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMhE,CAAC"}
package/dist/icons.js ADDED
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /** World view — globe with meridians (prototype `.ic-world`). */
3
+ export function WorldIcon() {
4
+ return (_jsxs("svg", { width: "26", height: "26", viewBox: "0 0 30 30", fill: "none", "aria-hidden": "true", style: { flexShrink: 0 }, children: [_jsx("circle", { cx: "15", cy: "15", r: "12", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M3 15h24M15 3c4 4 4 20 0 24M15 3c-4 4-4 20 0 24", stroke: "currentColor", strokeWidth: "1.6" })] }));
5
+ }
6
+ /** Dossier doc / evidence pack — outlined document page (prototype `.ic-doc`). */
7
+ export function DocIcon() {
8
+ return (_jsxs("svg", { width: "24", height: "27", viewBox: "0 0 28 32", fill: "none", "aria-hidden": "true", style: { flexShrink: 0 }, children: [_jsx("path", { d: "M4 2h13l7 7v21H4z", stroke: "currentColor", strokeWidth: "2", strokeLinejoin: "round" }), _jsx("path", { d: "M17 2v7h7M8 14h10M8 19h10M8 24h6", stroke: "currentColor", strokeWidth: "1.6" })] }));
9
+ }
10
+ /** Workflow board — connected kanban squares (prototype's WF row glyph). */
11
+ export function BoardWorkflowIcon() {
12
+ return (_jsxs("svg", { width: "26", height: "26", viewBox: "0 0 30 30", fill: "none", "aria-hidden": "true", style: { flexShrink: 0 }, children: [_jsx("rect", { x: "2", y: "2", width: "9", height: "9", rx: "1.5", stroke: "currentColor", strokeWidth: "2" }), _jsx("rect", { x: "19", y: "11", width: "9", height: "9", rx: "1.5", stroke: "currentColor", strokeWidth: "2" }), _jsx("rect", { x: "2", y: "19", width: "9", height: "9", rx: "1.5", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M11 6.5h5.5A2.5 2.5 0 0 1 19 9v2M19 20.5h-5.5A2.5 2.5 0 0 1 11 18v-5", stroke: "currentColor", strokeWidth: "2" })] }));
13
+ }
14
+ /** Audit board — append-only chain squares (prototype's AC row glyph). */
15
+ export function BoardAuditIcon() {
16
+ return (_jsxs("svg", { width: "26", height: "26", viewBox: "0 0 30 30", fill: "none", "aria-hidden": "true", style: { flexShrink: 0 }, children: [_jsx("rect", { x: "2", y: "2", width: "9", height: "9", rx: "1.5", stroke: "currentColor", strokeWidth: "2" }), _jsx("rect", { x: "19", y: "2", width: "9", height: "9", rx: "1.5", stroke: "currentColor", strokeWidth: "2" }), _jsx("rect", { x: "10", y: "19", width: "9", height: "9", rx: "1.5", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M11 11v3a2 2 0 0 0 2 2h3M15 7h4M7 11v8", stroke: "currentColor", strokeWidth: "2" })] }));
17
+ }
18
+ /** Folder — pinned common-assets folder (prototype `.ic-folder`). */
19
+ export function FolderIcon() {
20
+ return (_jsxs("svg", { width: "26", height: "26", viewBox: "0 0 30 30", fill: "none", "aria-hidden": "true", style: { flexShrink: 0 }, children: [_jsx("path", { d: "M2 5h9l3 3h14v18H2z", stroke: "currentColor", strokeWidth: "2", strokeLinejoin: "round" }), _jsx("path", { d: "M2 12h26", stroke: "currentColor", strokeWidth: "2" })] }));
21
+ }
22
+ /** Search magnifier of the panel's search box (prototype ⌕ glyph). */
23
+ export function SearchGlyph() {
24
+ return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [_jsx("circle", { cx: "8.5", cy: "8.5", r: "5.6", stroke: "currentColor", strokeWidth: "1.6" }), _jsx("path", { d: "M12.6 12.6l4.4 4.4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" })] }));
25
+ }
26
+ const GLYPHS = {
27
+ world: WorldIcon,
28
+ doc: DocIcon,
29
+ "board-workflow": BoardWorkflowIcon,
30
+ "board-audit": BoardAuditIcon,
31
+ folder: FolderIcon,
32
+ };
33
+ /** Renders the glyph for a kind (boards honor the entry's glyph override). */
34
+ export function FileKindIcon({ glyph, }) {
35
+ const Component = GLYPHS[glyph] ?? DocIcon;
36
+ return _jsx(Component, {});
37
+ }
38
+ /** Default kind → glyph resolution (boards default to the workflow glyph). */
39
+ export const DEFAULT_KIND_GLYPHS = {
40
+ "world-view": "world",
41
+ dossier: "doc",
42
+ "evidence-pack": "doc",
43
+ board: "board-workflow",
44
+ folder: "folder",
45
+ };
46
+ /**
47
+ * Default kind → semantic color token mapping, mirroring the v9 prototype's
48
+ * icon hues onto theme tokens: purple world views → `signal`, mint docs →
49
+ * `ok`, amber boards → `warn`, blue folders → `accent`. Hosts override
50
+ * through the `kindTokens` configuration key.
51
+ */
52
+ export const DEFAULT_KIND_TOKENS = {
53
+ "world-view": "signal",
54
+ dossier: "ok",
55
+ "evidence-pack": "ok",
56
+ board: "warn",
57
+ folder: "accent",
58
+ };
@@ -0,0 +1,11 @@
1
+ export { QuickFiles } from "./QuickFiles.js";
2
+ export type { QuickFilesProps } from "./QuickFiles.js";
3
+ export { createQuickFilesClients } from "./clients.js";
4
+ export type { QuickFilesClients } from "./clients.js";
5
+ export { FileRow } from "./FileRow.js";
6
+ export type { FileRowProps } from "./FileRow.js";
7
+ export { BoardAuditIcon, BoardWorkflowIcon, DEFAULT_KIND_GLYPHS, DEFAULT_KIND_TOKENS, DocIcon, FileKindIcon, FolderIcon, SearchGlyph, WorldIcon, } from "./icons.js";
8
+ export { en, zhCN, locales, stringsForLocale, formatMessage } from "./locales/index.js";
9
+ export type { QuickFilesLocale, QuickFilesStrings } from "./locales/index.js";
10
+ export type { QuickFileDragState, QuickFileEntry, QuickFileEntryListResult, QuickFileGlyph, QuickFileKind, QuickFileListRequest, QuickFilesStatus, } from "./types.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { QuickFiles } from "./QuickFiles.js";
2
+ export { createQuickFilesClients } from "./clients.js";
3
+ export { FileRow } from "./FileRow.js";
4
+ export { BoardAuditIcon, BoardWorkflowIcon, DEFAULT_KIND_GLYPHS, DEFAULT_KIND_TOKENS, DocIcon, FileKindIcon, FolderIcon, SearchGlyph, WorldIcon, } from "./icons.js";
5
+ export { en, zhCN, locales, stringsForLocale, formatMessage } from "./locales/index.js";
@@ -0,0 +1,20 @@
1
+ {
2
+ "quick-files": {
3
+ "panelTitle": "QUICK FILE INSERT",
4
+ "panelSubtitle": "WORLD VIEWS, DOSSIERS, BOARDS, EVIDENCE",
5
+ "trailingMetaCount": "{count} FILES",
6
+ "searchPlaceholder": "Search recent files and world views",
7
+ "searchLabel": "Search files",
8
+ "sectionHint": "FILES ARE THE SHORTCUT",
9
+ "sectionRecent": "RECENT / COMMON FILES",
10
+ "infoCardTitle": "DROP-IN FILE MODEL",
11
+ "infoCardBody": "World views are versioned spatial metadata files. Insert one here to reload its saved selection, time, layers, camera, and scenario inside the dossier. Component types remain in each block's + menu.",
12
+ "insertLabel": "Insert {name}",
13
+ "dragLabel": "Drag {name} to insert",
14
+ "emptyTitle": "No files yet",
15
+ "emptyHint": "Files from VAULT appear here once opened or pinned.",
16
+ "noMatches": "No files match the search.",
17
+ "errorTitle": "File listing failed",
18
+ "retry": "Retry"
19
+ }
20
+ }
@@ -0,0 +1,72 @@
1
+ import enBundle from "./en.json";
2
+ /**
3
+ * Locales the quick-files micro-UI bundles. Every component-fixed UI string
4
+ * is resolved from these bundles (statically imported, resolveJsonModule); the
5
+ * component never hardcodes copy. Configuration-provided strings (title,
6
+ * subtitle, trailing meta, …) stay composition-authored — Prism has no
7
+ * composed title node, so the panel's title header renders from component
8
+ * configuration keys with locale defaults.
9
+ */
10
+ export type QuickFilesLocale = "en" | "zh-CN";
11
+ /**
12
+ * The per-locale string table — the keys of the en bundle. Declared widened
13
+ * (string values) so the zh-CN bundle is checked for exact key parity at
14
+ * compile time while keeping literal JSON types out of the public surface.
15
+ */
16
+ export type QuickFilesStrings = {
17
+ readonly [K in keyof typeof enBundle["quick-files"]]: string;
18
+ };
19
+ /** Parsed en locale bundle (namespaced under the component id "quick-files"). */
20
+ export declare const en: {
21
+ "quick-files": {
22
+ panelTitle: string;
23
+ panelSubtitle: string;
24
+ trailingMetaCount: string;
25
+ searchPlaceholder: string;
26
+ searchLabel: string;
27
+ sectionHint: string;
28
+ sectionRecent: string;
29
+ infoCardTitle: string;
30
+ infoCardBody: string;
31
+ insertLabel: string;
32
+ dragLabel: string;
33
+ emptyTitle: string;
34
+ emptyHint: string;
35
+ noMatches: string;
36
+ errorTitle: string;
37
+ retry: string;
38
+ };
39
+ };
40
+ /** Parsed zh-CN locale bundle (namespaced under the component id "quick-files"). */
41
+ export declare const zhCN: {
42
+ "quick-files": {
43
+ panelTitle: string;
44
+ panelSubtitle: string;
45
+ trailingMetaCount: string;
46
+ searchPlaceholder: string;
47
+ searchLabel: string;
48
+ sectionHint: string;
49
+ sectionRecent: string;
50
+ infoCardTitle: string;
51
+ infoCardBody: string;
52
+ insertLabel: string;
53
+ dragLabel: string;
54
+ emptyTitle: string;
55
+ emptyHint: string;
56
+ noMatches: string;
57
+ errorTitle: string;
58
+ retry: string;
59
+ };
60
+ };
61
+ /** All bundled locale bundles keyed by locale id — for downstream deep-merge. */
62
+ export declare const locales: Record<QuickFilesLocale, {
63
+ readonly "quick-files": QuickFilesStrings;
64
+ }>;
65
+ /** Resolves the string table for a locale. */
66
+ export declare function stringsForLocale(locale: QuickFilesLocale): QuickFilesStrings;
67
+ /**
68
+ * Simple `{placeholder}` interpolation (e.g. `"{count} FILES"` + count).
69
+ * Placeholder-for-value substitution only — no ICU, no regexes.
70
+ */
71
+ export declare function formatMessage(template: string, values: Readonly<Record<string, string | number>>): string;
72
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,CAAC,IAAI,MAAM,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,MAAM;CAC7D,CAAC;AAOF,iFAAiF;AACjF,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;CAAW,CAAC;AAE3B,oFAAoF;AACpF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAE/B,iFAAiF;AACjF,eAAO,MAAM,OAAO;4BAZ8C,iBAAiB;EAYrD,CAAC;AAE/B,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,CAE5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAChD,MAAM,CAMR"}
@@ -0,0 +1,27 @@
1
+ import enBundle from "./en.json";
2
+ import zhCNBundle from "./zh-CN.json";
3
+ const bundles = {
4
+ en: enBundle,
5
+ "zh-CN": zhCNBundle,
6
+ };
7
+ /** Parsed en locale bundle (namespaced under the component id "quick-files"). */
8
+ export const en = enBundle;
9
+ /** Parsed zh-CN locale bundle (namespaced under the component id "quick-files"). */
10
+ export const zhCN = zhCNBundle;
11
+ /** All bundled locale bundles keyed by locale id — for downstream deep-merge. */
12
+ export const locales = bundles;
13
+ /** Resolves the string table for a locale. */
14
+ export function stringsForLocale(locale) {
15
+ return bundles[locale]["quick-files"];
16
+ }
17
+ /**
18
+ * Simple `{placeholder}` interpolation (e.g. `"{count} FILES"` + count).
19
+ * Placeholder-for-value substitution only — no ICU, no regexes.
20
+ */
21
+ export function formatMessage(template, values) {
22
+ let result = template;
23
+ for (const [key, value] of Object.entries(values)) {
24
+ result = result.replaceAll(`{${key}}`, String(value));
25
+ }
26
+ return result;
27
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "quick-files": {
3
+ "panelTitle": "快速插入文件",
4
+ "panelSubtitle": "世界视图 · 卷宗 · 看板 · 证据",
5
+ "trailingMetaCount": "{count} 个文件",
6
+ "searchPlaceholder": "搜索最近的文件与世界视图",
7
+ "searchLabel": "搜索文件",
8
+ "sectionHint": "文件即捷径",
9
+ "sectionRecent": "最近 / 常用文件",
10
+ "infoCardTitle": "置入文件模型",
11
+ "infoCardBody": "世界视图是带版本的空间元数据文件。在此插入即可在卷宗内恢复其保存的选择、时间、图层、相机与情景。组件类型仍保留在每个区块的 + 菜单中。",
12
+ "insertLabel": "插入 {name}",
13
+ "dragLabel": "拖动 {name} 以插入",
14
+ "emptyTitle": "暂无文件",
15
+ "emptyHint": "来自 VAULT 的文件在打开或固定后会显示在此。",
16
+ "noMatches": "没有符合搜索条件的文件。",
17
+ "errorTitle": "文件列表加载失败",
18
+ "retry": "重试"
19
+ }
20
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Shared semantic token constants of the quick-files micro-UI.
3
+ *
4
+ * No palette is hardcoded anywhere in the component: every constant below
5
+ * resolves to a SEMANTIC theme token (text / muted / card / card-dark /
6
+ * input / border / line / accent …) supplied by the host's MantineProvider.
7
+ * The sub-components import these instead of redeclaring them, keeping the
8
+ * component's entire token surface in one auditable place.
9
+ */
10
+ export declare const MONO = "var(--mantine-font-family-monospace)";
11
+ export declare const TEXT = "var(--mantine-color-text-filled)";
12
+ export declare const MUTED = "var(--mantine-color-muted-filled)";
13
+ export declare const INPUT_BG = "var(--mantine-color-card-dark-filled)";
14
+ export declare const CARD_BG = "var(--mantine-color-card-filled)";
15
+ export declare const CARD_DARK_BG = "var(--mantine-color-card-dark-filled)";
16
+ export declare const BORDER = "var(--mantine-color-border-filled)";
17
+ export declare const LINE = "var(--mantine-color-line-filled)";
18
+ export declare const ACCENT = "var(--mantine-color-accent-filled)";
19
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,yCAAyC,CAAC;AAC3D,eAAO,MAAM,IAAI,qCAAqC,CAAC;AACvD,eAAO,MAAM,KAAK,sCAAsC,CAAC;AACzD,eAAO,MAAM,QAAQ,0CAA0C,CAAC;AAChE,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,YAAY,0CAA0C,CAAC;AACpE,eAAO,MAAM,MAAM,uCAAuC,CAAC;AAC3D,eAAO,MAAM,IAAI,qCAAqC,CAAC;AACvD,eAAO,MAAM,MAAM,uCAAuC,CAAC"}
package/dist/tokens.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Shared semantic token constants of the quick-files micro-UI.
3
+ *
4
+ * No palette is hardcoded anywhere in the component: every constant below
5
+ * resolves to a SEMANTIC theme token (text / muted / card / card-dark /
6
+ * input / border / line / accent …) supplied by the host's MantineProvider.
7
+ * The sub-components import these instead of redeclaring them, keeping the
8
+ * component's entire token surface in one auditable place.
9
+ */
10
+ export const MONO = "var(--mantine-font-family-monospace)";
11
+ export const TEXT = "var(--mantine-color-text-filled)";
12
+ export const MUTED = "var(--mantine-color-muted-filled)";
13
+ export const INPUT_BG = "var(--mantine-color-card-dark-filled)";
14
+ export const CARD_BG = "var(--mantine-color-card-filled)";
15
+ export const CARD_DARK_BG = "var(--mantine-color-card-dark-filled)";
16
+ export const BORDER = "var(--mantine-color-border-filled)";
17
+ export const LINE = "var(--mantine-color-line-filled)";
18
+ export const ACCENT = "var(--mantine-color-accent-filled)";
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Bounded types of the quick-files micro-UI (component id "quick-files") —
3
+ * the Dossier Quick File Insert side-panel axiom component.
4
+ *
5
+ * Every value that crosses a Prism channel or a Lattice route here is an
6
+ * identifier or a bounded projection (design record D4/D6/D8): wiring carries
7
+ * identifiers and bounded values, never domain object graphs — each receiver
8
+ * (editor viewport, evidence pack, another panel) fetches its own domain data
9
+ * and interprets the published drag state in its own way.
10
+ */
11
+ import type { FileEntryListRequest, FileEntrySummary } from "@zephytiju/lattice-common-interfaces";
12
+ /**
13
+ * File kinds the panel categorizes (matching the panel's title subtitle:
14
+ * WORLD VIEWS, DOSSIERS, BOARDS, EVIDENCE — plus pinned folders). The value
15
+ * is the IFileEntry `kind` string; unknown kinds still render (generic file
16
+ * row) and fall back to the generic inline-link interpretation downstream.
17
+ */
18
+ export type QuickFileKind = "world-view" | "dossier" | "board" | "evidence-pack" | "folder";
19
+ /**
20
+ * Icon glyph rendered for a row — the prototype's `.fic` set. Boards carry
21
+ * two glyphs (workflow kanban, append-only audit chain); entries pick via the
22
+ * optional `glyph` field, other kinds resolve by `kind`.
23
+ */
24
+ export type QuickFileGlyph = "world" | "doc" | "board-workflow" | "board-audit" | "folder";
25
+ /**
26
+ * Bounded file row projection of an IFileEntry list entry. Extends the
27
+ * generated bundle's `FileEntrySummary` shape (id/name/kind/sizeBytes) with
28
+ * the bounded fields the panel renders and the drag state needs (mime,
29
+ * snapshotRef, mono meta line, pinning, recency) — richer hosts return the
30
+ * structural superset on the same route.
31
+ */
32
+ export interface QuickFileEntry extends FileEntrySummary {
33
+ /** Bounded mime type carried by the drag state (defaults by kind). */
34
+ readonly mime?: string;
35
+ /** Bounded snapshot reference for drop-in restore (defaults to the entry id). */
36
+ readonly snapshotRef?: string;
37
+ /** Mono meta line rendered verbatim (e.g. "GEOVISION FILE • SPATIAL METADATA"). */
38
+ readonly meta?: string;
39
+ /** Pinned rows sort first within the recent/common section. */
40
+ readonly pinned?: boolean;
41
+ /** Icon glyph override (boards pick workflow vs audit chain). */
42
+ readonly glyph?: QuickFileGlyph;
43
+ /** ISO instant of the last open, driving the recency-window filter. */
44
+ readonly lastOpenedAt?: string;
45
+ }
46
+ /** Result projection of the `interfaces/IFileEntry/list` query for the panel. */
47
+ export interface QuickFileEntryListResult {
48
+ readonly entries: readonly QuickFileEntry[];
49
+ readonly nextCursor?: string;
50
+ }
51
+ /**
52
+ * THE bounded drag/insert state (D6 reference case): everything a receiver
53
+ * needs to materialize the file its own way, and nothing more — file metadata
54
+ * only, NEVER a component reference. A world-view receiver restores the
55
+ * IGeoView snapshot via snapshotRef; an evidence table renders the pack; a
56
+ * dossier appends a paragraph with an inline link (D10); anything unknown
57
+ * falls back to a generic inline file link.
58
+ */
59
+ export interface QuickFileDragState {
60
+ /** The IFileEntry id of the dragged/inserted file. */
61
+ readonly entryId: string;
62
+ /** The file's kind (world-view, evidence-pack, dossier, board, folder, …). */
63
+ readonly kind: string;
64
+ /** The file's display name. */
65
+ readonly name: string;
66
+ /** The file's bounded mime type. */
67
+ readonly mime: string;
68
+ /** Bounded reference addressing the file's saved snapshot for drop-in restore. */
69
+ readonly snapshotRef: string;
70
+ /** The publishing panel's component id — always "quick-files". */
71
+ readonly sourcePanel: "quick-files";
72
+ }
73
+ /**
74
+ * Lifecycle of the most recent IFileEntry list fetch — local state only; the
75
+ * panel publishes nothing about its own loading (the single publication is
76
+ * the bounded drag/insert state).
77
+ */
78
+ export type QuickFilesStatus = {
79
+ readonly phase: "busy";
80
+ } | {
81
+ readonly phase: "error";
82
+ readonly message: string;
83
+ } | {
84
+ readonly phase: "ready";
85
+ };
86
+ /** The interface-declared list request kept for client typing (scope/cursor). */
87
+ export type QuickFileListRequest = FileEntryListRequest;
88
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAEnG;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,eAAe,GAAG,QAAQ,CAAC;AAE5F;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,KAAK,GAAG,gBAAgB,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE3F;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,iFAAiF;AACjF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhC,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { QuickFilesClients } from "./clients.js";
2
+ import type { QuickFileEntry, QuickFilesStatus } from "./types.js";
3
+ /**
4
+ * Owns the panel's IFileEntry list lifecycle: the mount-time list query
5
+ * through the generated Lattice client, a monotonic sequence guard so a
6
+ * superseded response never lands, and the busy/error/ready status driving
7
+ * the rows region. `reload` re-runs the query (the error state's Retry
8
+ * action); lifecycle state stays local — the panel publishes nothing about
9
+ * its own loading.
10
+ */
11
+ export declare function useQuickFilesEntries(clients: QuickFilesClients): {
12
+ readonly entries: readonly QuickFileEntry[] | null;
13
+ readonly status: QuickFilesStatus;
14
+ readonly reload: () => Promise<void>;
15
+ };
16
+ //# sourceMappingURL=useQuickFilesEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQuickFilesEntries.d.ts","sourceRoot":"","sources":["../src/useQuickFilesEntries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG;IAChE,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC,CAiCA"}
@@ -0,0 +1,40 @@
1
+ import { useCallback, useEffect, useRef, useState } from "react";
2
+ /**
3
+ * Owns the panel's IFileEntry list lifecycle: the mount-time list query
4
+ * through the generated Lattice client, a monotonic sequence guard so a
5
+ * superseded response never lands, and the busy/error/ready status driving
6
+ * the rows region. `reload` re-runs the query (the error state's Retry
7
+ * action); lifecycle state stays local — the panel publishes nothing about
8
+ * its own loading.
9
+ */
10
+ export function useQuickFilesEntries(clients) {
11
+ const [entries, setEntries] = useState(null);
12
+ const [status, setStatus] = useState({ phase: "busy" });
13
+ const fetchSeqRef = useRef(0);
14
+ const loadFiles = useCallback(async () => {
15
+ const seq = fetchSeqRef.current + 1;
16
+ fetchSeqRef.current = seq;
17
+ setStatus({ phase: "busy" });
18
+ try {
19
+ const result = await clients.files.list();
20
+ if (fetchSeqRef.current !== seq) {
21
+ return; // a newer fetch superseded this one
22
+ }
23
+ setEntries(result.entries);
24
+ setStatus({ phase: "ready" });
25
+ }
26
+ catch (error) {
27
+ if (fetchSeqRef.current !== seq) {
28
+ return;
29
+ }
30
+ setStatus({
31
+ phase: "error",
32
+ message: error instanceof Error ? error.message : "Lattice file listing failed",
33
+ });
34
+ }
35
+ }, [clients]);
36
+ useEffect(() => {
37
+ void loadFiles();
38
+ }, [loadFiles]);
39
+ return { entries, status, reload: loadFiles };
40
+ }
@@ -0,0 +1,12 @@
1
+ import type { QuickFileEntry } from "./types.js";
2
+ /** Mono size formatter for the row meta fallback (B / KB / MB). */
3
+ export declare function formatBytes(sizeBytes: number): string;
4
+ /**
5
+ * Applies the panel's row visibility and ordering rules to the fetched
6
+ * entries: search-text match (name + meta + kind), the categoryFilters
7
+ * configuration key, and the recencyWindowMs configuration key (entries
8
+ * without a timestamp are kept) — then pinned-first, most-recently-opened,
9
+ * name ordering.
10
+ */
11
+ export declare function selectVisibleRows(entries: readonly QuickFileEntry[], search: string, categoryFilters: readonly string[] | undefined, recencyWindowMs: number | undefined): readonly QuickFileEntry[];
12
+ //# sourceMappingURL=visibleRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visibleRows.d.ts","sourceRoot":"","sources":["../src/visibleRows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWrD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC9C,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,SAAS,cAAc,EAAE,CAoC3B"}