darabos commited on
Commit
da1f2d0
·
1 Parent(s): e2e447f

Name all exports to fix HMR.

Browse files
lynxkite-app/web/src/Directory.tsx CHANGED
@@ -58,7 +58,7 @@ function EntryCreator(props: {
58
 
59
  const fetcher = (url: string) => fetch(url).then((res) => res.json());
60
 
61
- export default function () {
62
  const path = usePath().replace(/^[/]$|^[/]dir$|^[/]dir[/]/, "");
63
  const encodedPath = encodeURIComponent(path || "");
64
  const list = useSWR(`/api/dir/list?path=${encodedPath}`, fetcher, {
 
58
 
59
  const fetcher = (url: string) => fetch(url).then((res) => res.json());
60
 
61
+ export default function Directory() {
62
  const path = usePath().replace(/^[/]$|^[/]dir$|^[/]dir[/]/, "");
63
  const encodedPath = encodeURIComponent(path || "");
64
  const list = useSWR(`/api/dir/list?path=${encodedPath}`, fetcher, {
lynxkite-app/web/src/Tooltip.tsx CHANGED
@@ -7,9 +7,9 @@ export default function Tooltip(props: any) {
7
  if (!props.doc) return null;
8
  return (
9
  <>
10
- <a data-tooltip-id={id} tabIndex={0}>
11
  {props.children}
12
- </a>
13
  <ReactTooltip id={id} className="tooltip prose" place="top-end">
14
  {props.doc.map?.(
15
  (section: any, i: number) =>
 
7
  if (!props.doc) return null;
8
  return (
9
  <>
10
+ <span data-tooltip-id={id} tabIndex={0}>
11
  {props.children}
12
+ </span>
13
  <ReactTooltip id={id} className="tooltip prose" place="top-end">
14
  {props.doc.map?.(
15
  (section: any, i: number) =>
lynxkite-app/web/src/workspace/NodeSearch.tsx CHANGED
@@ -10,7 +10,7 @@ export type OpsOp = {
10
  export type Catalog = { [op: string]: OpsOp };
11
  export type Catalogs = { [env: string]: Catalog };
12
 
13
- export default function (props: {
14
  boxes: Catalog;
15
  onCancel: any;
16
  onAdd: any;
 
10
  export type Catalog = { [op: string]: OpsOp };
11
  export type Catalogs = { [env: string]: Catalog };
12
 
13
+ export default function NodeSearch(props: {
14
  boxes: Catalog;
15
  onCancel: any;
16
  onAdd: any;
lynxkite-app/web/src/workspace/Workspace.tsx CHANGED
@@ -28,7 +28,7 @@ import Backspace from "~icons/tabler/backspace.jsx";
28
  import Restart from "~icons/tabler/rotate-clockwise.jsx";
29
  // @ts-ignore
30
  import Close from "~icons/tabler/x.jsx";
31
- import type { Workspace, WorkspaceNode } from "../apiTypes.ts";
32
  import favicon from "../assets/favicon.ico";
33
  import { usePath } from "../common.ts";
34
  // import NodeWithTableView from './NodeWithTableView';
@@ -44,7 +44,7 @@ import NodeWithParams from "./nodes/NodeWithParams";
44
  import NodeWithTableView from "./nodes/NodeWithTableView.tsx";
45
  import NodeWithVisualization from "./nodes/NodeWithVisualization.tsx";
46
 
47
- export default function (props: any) {
48
  return (
49
  <ReactFlowProvider>
50
  <LynxKiteFlow {...props} />
@@ -62,10 +62,10 @@ function LynxKiteFlow() {
62
  .split("/")
63
  .pop()!
64
  .replace(/[.]lynxkite[.]json$/, "");
65
- const [state, setState] = useState({ workspace: {} as Workspace });
66
  const [message, setMessage] = useState(null as string | null);
67
  useEffect(() => {
68
- const state = syncedStore({ workspace: {} as Workspace });
69
  setState(state);
70
  const doc = getYjsDoc(state);
71
  const proto = location.protocol === "https:" ? "wss:" : "ws:";
 
28
  import Restart from "~icons/tabler/rotate-clockwise.jsx";
29
  // @ts-ignore
30
  import Close from "~icons/tabler/x.jsx";
31
+ import type { WorkspaceNode, Workspace as WorkspaceType } from "../apiTypes.ts";
32
  import favicon from "../assets/favicon.ico";
33
  import { usePath } from "../common.ts";
34
  // import NodeWithTableView from './NodeWithTableView';
 
44
  import NodeWithTableView from "./nodes/NodeWithTableView.tsx";
45
  import NodeWithVisualization from "./nodes/NodeWithVisualization.tsx";
46
 
47
+ export default function Workspace(props: any) {
48
  return (
49
  <ReactFlowProvider>
50
  <LynxKiteFlow {...props} />
 
62
  .split("/")
63
  .pop()!
64
  .replace(/[.]lynxkite[.]json$/, "");
65
+ const [state, setState] = useState({ workspace: {} as WorkspaceType });
66
  const [message, setMessage] = useState(null as string | null);
67
  useEffect(() => {
68
+ const state = syncedStore({ workspace: {} as WorkspaceType });
69
  setState(state);
70
  const doc = getYjsDoc(state);
71
  const proto = location.protocol === "https:" ? "wss:" : "ws:";