diff --git a/bun.lockb b/bun.lockb index 3db123e..acf14b7 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/EditableMarkdown.vue b/components/EditableMarkdown.vue index f59c684..49519f9 100644 --- a/components/EditableMarkdown.vue +++ b/components/EditableMarkdown.vue @@ -44,7 +44,7 @@ import LiveBlockquote from "~/components/prose/ProseBlockquote.vue"; import { hash } from 'ohash' import { watch, computed } from 'vue' import type { Root, Node } from 'hast'; -import { diffLines as diff } from 'diff'; +/* import { diffLines as diff } from 'diff'; */ const model = defineModel(); @@ -61,7 +61,7 @@ async function update(value: string | undefined, old: string | undefined) { { if(node.value) { - const differences = diff(old, value, { + /* const differences = diff(old, value, { newlineIsToken: true, }); @@ -108,11 +108,10 @@ async function update(value: string | undefined, old: string | undefined) { newNodes = parser(value.substring(newStart ?? 0, (newEnd ?? 0) + lengthDiff)); const root = node.value; - //root.position?.end.offset node.value = parser(value); - } - console.log(node.value); + } */ + node.value = parser(value); } else { diff --git a/components/MarkdownRenderer.vue b/components/MarkdownRenderer.vue index 4300216..2f6fb15 100644 --- a/components/MarkdownRenderer.vue +++ b/components/MarkdownRenderer.vue @@ -111,10 +111,6 @@ function renderNode(node: RootContent, tags: Record): VNode | undef { return h(tags[node.tagName] ?? node.tagName, { ...node.properties, class: node.properties.className }, {default: () => node.children.map(e => renderNode(e, tags)).filter(e => !!e)}); } - else if(node.type === 'raw') - { - console.warn("???"); - } return undefined; } diff --git a/components/explorer/NavigationLink.vue b/components/explorer/NavigationLink.vue index 0fb7331..333ab8b 100644 --- a/components/explorer/NavigationLink.vue +++ b/components/explorer/NavigationLink.vue @@ -11,25 +11,7 @@ const hasChildren = computed(() => { return props.link && props.link.children && props.link.children.length > 0 || false; }); -if(hasChildren.value) -{ - props.link.children?.sort((a, b) => { - if(a.order && b.order) - return a.order - b.order; - if(a.path === props.link.path) - return -1; - if(b.path === props.link.path) - return 1; - return 0; - }); -} - -const collapsed = ref(!useRoute().path.startsWith('/explorer' + props.link.path)); - -function hideLeftPanel(_: Event) -{ - document?.querySelector('.published-container')?.classList.remove('is-left-column-open'); -} +const collapsed = ref(!unifySlug(useRoute().params.slug).startsWith(props.link.path));