Big rework to include OPFS API for local edits. Big components rework in vanilla JS to optimize. Unfinished, DO NOT SHIP YET !

This commit is contained in:
2025-03-28 19:38:06 +01:00
parent f2d00097d6
commit 41c19b4bfb
40 changed files with 3604 additions and 2582 deletions

7
types/auth.d.ts vendored
View File

@@ -1,4 +1,5 @@
import type { ComputedRef, Ref } from 'vue'
import type { ComputedRef, Ref } from 'vue';
import type { SessionConfig } from 'h3'
import 'vue-router';
declare module 'vue-router'
@@ -13,8 +14,8 @@ declare module 'vue-router'
}
}
import 'nuxt';
declare module 'nuxt'
import '@nuxt/schema';
declare module '@nuxt/schema'
{
interface RuntimeConfig
{

2
types/canvas.d.ts vendored
View File

@@ -17,7 +17,7 @@ export interface CanvasNode {
height: number;
color?: CanvasColor;
label?: string;
text?: any;
text?: string;
};
export interface CanvasEdge {
id: string;

62
types/content.d.ts vendored
View File

@@ -1,62 +0,0 @@
import type { CanvasContent as Canvas } from "./canvas";
import type { MapContent as Map } from "./map";
export type FileType = keyof ContentMap;
export interface Overview {
path: string;
owner: number;
title: string;
timestamp: Date;
navigable: boolean;
private: boolean;
order: number;
visit: number;
}
export interface CanvasContent extends Overview {
type: 'canvas';
content?: Canvas;
}
export interface MapContent extends Overview {
type: 'map';
content?: string;
}
export interface MarkdownContent extends Overview {
type: 'markdown';
content?: string;
}
export interface FileContent extends Overview {
type: 'file';
content?: string;
}
export interface FolderContent extends Overview {
type: 'folder';
content?: null;
}
export interface ContentMap
{
markdown: MarkdownContent;
file: FileContent;
canvas: CanvasContent;
map: MapContent;
folder: FolderContent;
}
export type ExploreContent = ContentMap[FileType];
export type TreeItem = ExploreContent & {
children?: TreeItem[];
}
export interface ContentComposable {
content: Ref<ExploreContent[]>
tree: ComputedRef<TreeItem[]>
/**
* Fetch the overview of every content from the server.
*/
fetch: (force: boolean) => Promise<void>
/**
* Get the given content from the server.
*/
get: (path: string) => Promise<void>
}