@smartmemory/wiki-components 0.5.0 → 0.6.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 (62) hide show
  1. package/README.md +14 -2
  2. package/package.json +26 -4
  3. package/src/data-client.d.ts +27 -1
  4. package/src/data-client.jsx +3 -0
  5. package/src/graph/components/wiki/DocCard.jsx +46 -0
  6. package/src/graph/components/wiki/GraphBreadcrumb.jsx +23 -0
  7. package/src/graph/components/wiki/GraphCanvas.jsx +663 -0
  8. package/src/graph/components/wiki/GraphCanvas3D.jsx +1366 -0
  9. package/src/graph/components/wiki/GraphDocPane.jsx +56 -0
  10. package/src/graph/components/wiki/GraphLegend.jsx +119 -0
  11. package/src/graph/components/wiki/GraphLevelPicker.jsx +35 -0
  12. package/src/graph/components/wiki/graph/FilterChips.jsx +45 -0
  13. package/src/graph/components/wiki/graph/Omnibox.jsx +74 -0
  14. package/src/graph/components/wiki/graph/badges.js +46 -0
  15. package/src/graph/components/wiki/graph/bubbles3d.js +95 -0
  16. package/src/graph/components/wiki/graph/canvasBase.js +138 -0
  17. package/src/graph/components/wiki/graph/containment.js +49 -0
  18. package/src/graph/components/wiki/graph/overlay.js +134 -0
  19. package/src/graph/components/wiki/graph/pixiBase.js +210 -0
  20. package/src/graph/components/wiki/graph/threeBase.js +231 -0
  21. package/src/graph/hooks/useDebounced.js +11 -0
  22. package/src/graph/host.jsx +56 -0
  23. package/src/graph/index.d.ts +26 -0
  24. package/src/graph/index.js +4 -0
  25. package/src/graph/lib/areaFamilies.js +32 -0
  26. package/src/graph/lib/camFollow.js +30 -0
  27. package/src/graph/lib/canvasPort.js +93 -0
  28. package/src/graph/lib/cardVisibility.js +58 -0
  29. package/src/graph/lib/docCard.js +28 -0
  30. package/src/graph/lib/forceWorker.js +123 -0
  31. package/src/graph/lib/forceWorker3d.js +136 -0
  32. package/src/graph/lib/graph3d.js +330 -0
  33. package/src/graph/lib/graphArrows.js +108 -0
  34. package/src/graph/lib/graphExplore.js +546 -0
  35. package/src/graph/lib/graphFind.js +46 -0
  36. package/src/graph/lib/graphLasso.js +44 -0
  37. package/src/graph/lib/graphLevels.js +367 -0
  38. package/src/graph/lib/graphOrient.js +145 -0
  39. package/src/graph/lib/graphPath.js +86 -0
  40. package/src/graph/lib/graphPin.js +48 -0
  41. package/src/graph/lib/graphPress.js +27 -0
  42. package/src/graph/lib/graphShell.js +296 -0
  43. package/src/graph/lib/graphTheme.js +50 -0
  44. package/src/graph/lib/graphView.js +343 -0
  45. package/src/graph/lib/graphViews.js +103 -0
  46. package/src/graph/lib/groupBubbles.js +128 -0
  47. package/src/graph/lib/hubLines.js +51 -0
  48. package/src/graph/lib/idleTurn.js +31 -0
  49. package/src/graph/lib/labelDepth.js +59 -0
  50. package/src/graph/lib/layoutClient.js +69 -0
  51. package/src/graph/lib/layoutEngine.js +184 -0
  52. package/src/graph/lib/linkWeight.js +67 -0
  53. package/src/graph/lib/orphanPull.js +10 -0
  54. package/src/graph/lib/perf.js +14 -0
  55. package/src/graph/lib/reducedMotion.js +36 -0
  56. package/src/graph/lib/robustFit.js +62 -0
  57. package/src/graph/lib/wikiGraph.js +298 -0
  58. package/src/graph/pages/GraphPage.jsx +703 -0
  59. package/src/index.d.ts +6 -1
  60. package/src/index.js +2 -1
  61. package/src/lib.js +3 -0
  62. package/src/parts/Markdown.jsx +22 -0
package/src/index.d.ts CHANGED
@@ -20,7 +20,7 @@ export function FeatureHub(props: { featureId: string; workspace?: Workspace }):
20
20
  /** Search across `workspaces` (default: identity().workspaces), or only `workspace` when it is one of them. */
21
21
  export function Search(props: { query?: string; workspace?: Workspace | null; workspaces?: Workspace[] } & NavProps): ReactElement;
22
22
 
23
- export const DATA_CLIENT_CALLS: { method: keyof DataClient; endpoint: string; query?: string; page?: Record<string, number> }[];
23
+ export const DATA_CLIENT_CALLS: { method: keyof DataClient; endpoint: string; query?: string; page?: Record<string, number | boolean> }[];
24
24
 
25
25
  /** Every recorded decision of `workspace` (default: the first of identity().workspaces), 50 a page with a pager. */
26
26
  export function Decisions(props: { workspace?: Workspace | null } & NavProps): ReactElement;
@@ -55,3 +55,8 @@ export function wikiPath(target: NavTarget): string;
55
55
  export function wsName(workspace: Workspace): string;
56
56
  /** The path of an area's docs page in the wiki's /ui/ app. */
57
57
  export function areaUrl(area: string): string;
58
+ /** The shared text-field class string. */
59
+ export const INPUT: string;
60
+ /** react-markdown `components` and `remarkPlugins` for note text (http(s) links only, no images, headings one level down). */
61
+ export const MD: Record<string, (props: any) => ReactNode>;
62
+ export const MD_PLUGINS: unknown[];
package/src/index.js CHANGED
@@ -8,7 +8,7 @@ export { default as AreaDocs } from "./AreaDocs";
8
8
  export { default as Ledger } from "./Ledger";
9
9
  export { usePagedCall } from "./paged";
10
10
  export { WikiDataProvider, useDataClient, useClientCall, DATA_CLIENT_CALLS } from "./data-client";
11
- export { wikiPath, wsName, wsUrl, noteUrl, areaUrl, toDate, fmtDate, ago, fmtDuration, summaryOf } from "./lib";
11
+ export { wikiPath, wsName, wsUrl, noteUrl, areaUrl, toDate, fmtDate, ago, fmtDuration, summaryOf, INPUT } from "./lib";
12
12
  export { default as useNow } from "./useNow";
13
13
  // The parts the screens are built from; the /ui/ app's other pages use them too (ui/src/components/wiki/* re-export them).
14
14
  export { default as ErrorBox } from "./parts/ErrorBox";
@@ -29,3 +29,4 @@ export { default as Pager } from "./parts/Pager";
29
29
  export { default as LedgerTimeline } from "./parts/LedgerTimeline";
30
30
  export { default as FreshnessBadge } from "./parts/FreshnessBadge";
31
31
  export { default as OverdueBadge } from "./parts/OverdueBadge";
32
+ export { MD, MD_PLUGINS } from "./parts/Markdown";
package/src/lib.js CHANGED
@@ -41,3 +41,6 @@ export function wikiPath(target) {
41
41
  }
42
42
  throw new Error(`wikiPath: unknown target kind ${target.kind}`);
43
43
  }
44
+
45
+ // The shared text-field style (moved from ui/src/lib/wiki.js, COMPOSE-WIKI-GRAPH-1a).
46
+ export const INPUT = "h-8 rounded-md border border-neutral-200 bg-white px-2 text-[13px] outline-none focus:border-blue-600 focus:ring-2 focus:ring-blue-600/15";
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import remarkGfm from "remark-gfm";
3
+
4
+ // COMPOSE-WIKI-GRAPH-1a: moved unchanged from ui/src/pages/NotePage.jsx (the graph's doc pane renders note text with the same components).
5
+ // A link inside a note opens only when it is an absolute http(s) URL, in a new tab with no referrer; a relative link
6
+ // names a file in the source, which is not a reader URL, so it reads as text. No raw HTML and no images are rendered
7
+ // (the CSP allows images from this origin only, and a note's image would be a broken or remote one).
8
+ export const MD = {
9
+ a: ({ href, children }) => /^https?:\/\//i.test(href || "")
10
+ ? <a href={href} target="_blank" rel="noopener noreferrer">{children}</a>
11
+ : <span className="text-ink">{children}</span>,
12
+ img: ({ alt }) => (alt ? <span className="text-neutral-500">[image: {alt}]</span> : null),
13
+ // the page's one h1 is the note's title, so the note's own headings sit one level under it
14
+ h1: ({ children }) => <h2>{children}</h2>,
15
+ h2: ({ children }) => <h3>{children}</h3>,
16
+ h3: ({ children }) => <h4>{children}</h4>,
17
+ h4: ({ children }) => <h5>{children}</h5>,
18
+ h5: ({ children }) => <h6>{children}</h6>,
19
+ };
20
+
21
+ // GitHub-flavoured Markdown (pipe tables, ~~strike~~, task lists, bare-URL autolinks); every site that renders note text passes this.
22
+ export const MD_PLUGINS = [remarkGfm];