diff --git a/Cargo.lock b/Cargo.lock
index e40078e..2918d91 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3459,6 +3459,7 @@ dependencies = [
"futures",
"getrandom 0.2.10",
"gloo-timers",
+ "lazy_static",
"log",
"num_enum",
"once_cell",
@@ -3814,6 +3815,15 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "num_threads"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "objc"
version = "0.2.7"
@@ -5928,7 +5938,10 @@ checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa 1.0.6",
+ "js-sys",
+ "libc",
"num-conv",
+ "num_threads",
"powerfmt",
"serde",
"time-core",
diff --git a/ng-app/src/apps/ListView.svelte b/ng-app/src/apps/ListView.svelte
index 1e0948c..e91c46d 100644
--- a/ng-app/src/apps/ListView.svelte
+++ b/ng-app/src/apps/ListView.svelte
@@ -22,6 +22,11 @@
ListView
+ {#if Array.isArray(commits.history.commits)}
+ {#each commits.history.commits as c}
+
{c[0]} {JSON.stringify(c[1])}
+ {/each}
+ {/if}
HEADS: {#each commits.heads as head} {head} , {/each}
diff --git a/ng-app/src/lib/FullLayout.svelte b/ng-app/src/lib/FullLayout.svelte
index e6ba55c..73c3dc7 100644
--- a/ng-app/src/lib/FullLayout.svelte
+++ b/ng-app/src/lib/FullLayout.svelte
@@ -22,7 +22,7 @@
import { link, location, push } from "svelte-spa-router";
import MobileBottomBarItem from "./MobileBottomBarItem.svelte";
import MobileBottomBar from "./MobileBottomBar.svelte";
- import NavIcon from "./components/NavIcon.svelte";
+ import Pane from "./Pane.svelte";
// @ts-ignore
import Logo from "./components/Logo.svelte";
import MenuItem from "./components/MenuItem.svelte";
@@ -30,7 +30,7 @@
import BranchIcon from "./components/BranchIcon.svelte";
// @ts-ignore
import { t } from "svelte-i18n";
- import { onMount, tick } from "svelte";
+ import { onMount, onDestroy, tick } from "svelte";
import { cur_tab, cur_viewer, cur_editor, toggle_graph_discrete, cur_tab_update,
available_editors, available_viewers, set_editor, set_viewer, set_view_or_edit, toggle_live_edit,
has_editor_chat, all_files_count, all_comments_count, nav_bar, save, hideMenu, show_modal_menu } from "../tab";
@@ -215,6 +215,7 @@
let top;
let shareMenu;
let toolsMenu;
+ let unsub;
async function scrollToTop() {
await tick();
if (top) top.scrollIntoView();
@@ -229,6 +230,24 @@
}
onMount(async () => {
await scrollToTop();
+
+ unsub = show_modal_menu.subscribe((new_val) => {
+ if (!new_val) {
+ cur_tab_update(ct => {
+ ct.show_menu = false;
+ if (panes_available === 0) {
+ ct.right_pane = "";
+ ct.folders_pane = false;
+ ct.toc_pane = false;
+ }
+ return ct;
+ });
+ }
+ });
+ });
+
+ onDestroy(() => {
+ if (unsub) unsub();
});
active_session.subscribe((as) => { if(!as) {
@@ -291,37 +310,37 @@
hideMenu();
}
- const find = (share:string) => {
+ const find = () => {
// TODO
hideMenu();
}
- const bookmark = (share:string) => {
+ const bookmark = () => {
// TODO
hideMenu();
}
- const annotate = (share:string) => {
+ const annotate = () => {
// TODO
hideMenu();
}
- const openArchive = (share:string) => {
+ const openArchive = () => {
// TODO
hideMenu();
}
const closeModal = () => {
$show_modal_menu = false;
- cur_tab_update(ct => {
- ct.show_menu = false;
- if (panes_available === 0) {
- ct.right_pane = "";
- ct.folders_pane = false;
- ct.toc_pane = false;
- }
- return ct;
- });
+ // cur_tab_update(ct => {
+ // ct.show_menu = false;
+ // if (panes_available === 0) {
+ // ct.right_pane = "";
+ // ct.folders_pane = false;
+ // ct.toc_pane = false;
+ // }
+ // return ct;
+ // });
}
const closePaneInModal = () => {
@@ -657,17 +676,19 @@
{$t(`doc.menu.items.${$cur_tab.right_pane}.label`)}
+
{:else if $cur_tab.folders_pane}
{$t("doc.menu.items.folders.label")}
+
{:else if $cur_tab.toc_pane}
{$t("doc.menu.items.toc.label")}
-
+
{/if}
@@ -867,7 +888,7 @@
{/if}
diff --git a/ng-app/src/lib/Pane.svelte b/ng-app/src/lib/Pane.svelte
new file mode 100644
index 0000000..d76bb10
--- /dev/null
+++ b/ng-app/src/lib/Pane.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ {#if pane_name}
+ {#await load_pane(pane_name) then pane}
+
+
+
+ {/await}
+ {/if}
+
+
\ No newline at end of file
diff --git a/ng-app/src/lib/Test.svelte b/ng-app/src/lib/Test.svelte
index 36f9a10..465d321 100644
--- a/ng-app/src/lib/Test.svelte
+++ b/ng-app/src/lib/Test.svelte
@@ -14,7 +14,7 @@
createGitgraph,
templateExtend,
TemplateName,
- } from "../history/gitgraph-js/gitgraph";
+ } from "./panes/history/gitgraph-js/gitgraph";
import ng from "../api";
import {
branch_subscribe,
@@ -136,7 +136,7 @@
subject: "niko2",
branch: "C",
author: "",
- parents: ["A"],
+ parents: ["B"],
x: 2,
y: 3,
},
diff --git a/ng-app/src/lib/components/BranchIcon.svelte b/ng-app/src/lib/components/BranchIcon.svelte
index 3a8efa8..3dec9fe 100644
--- a/ng-app/src/lib/components/BranchIcon.svelte
+++ b/ng-app/src/lib/components/BranchIcon.svelte
@@ -1,6 +1,6 @@