diff --git a/ng-app/src/apps/ListView.svelte b/ng-app/src/apps/ContainerView.svelte
similarity index 100%
rename from ng-app/src/apps/ListView.svelte
rename to ng-app/src/apps/ContainerView.svelte
diff --git a/ng-app/src/classes.ts b/ng-app/src/classes.ts
index 115b96e..526cb6a 100644
--- a/ng-app/src/classes.ts
+++ b/ng-app/src/classes.ts
@@ -98,6 +98,46 @@ export const official_classes = {
"ng:compat": ["code:*","file:iana:text:javascript","file:iana:text:css","file:iana:text:html","file:iana:text:markdown", "file:iana:application:xml",
"file:iana:application:yaml", "file:iana:text:xml", "file:iana:application:xhtml+xml"],
},
+ "code:js": {
+ "ng:crdt": "YText",
+ "ng:n": "JavaScript", // edited with CodeMirror, displayed with highlight.js
+ "ng:a": "A JavaScript Source Code file",
+ "ng:o": "n:g:z:pre",
+ "ng:w": "n:g:z:code_editor",
+ "ng:compat": ["file:iana:text:javascript"],
+ },
+ "code:ts": {
+ "ng:crdt": "YText",
+ "ng:n": "TypeScript", // edited with CodeMirror, displayed with highlight.js
+ "ng:a": "A TypeScript Source Code file",
+ "ng:o": "n:g:z:pre",
+ "ng:w": "n:g:z:code_editor",
+ "ng:compat": ["file:iana:text:typescript"],
+ },
+ "code:rust": {
+ "ng:crdt": "YText",
+ "ng:n": "Rust", // edited with CodeMirror, displayed with highlight.js
+ "ng:a": "A Rust Source Code file",
+ "ng:o": "n:g:z:pre",
+ "ng:w": "n:g:z:code_editor",
+ "ng:compat": [],
+ },
+ "code:svelte": {
+ "ng:crdt": "YText",
+ "ng:n": "Svelte", // edited with CodeMirror, displayed with highlight.js
+ "ng:a": "A Svelte Source Code file",
+ "ng:o": "n:g:z:pre",
+ "ng:w": "n:g:z:code_editor",
+ "ng:compat": [],
+ },
+ "code:react": {
+ "ng:crdt": "YText",
+ "ng:n": "React", // edited with CodeMirror, displayed with highlight.js
+ "ng:a": "A React Source Code file",
+ "ng:o": "n:g:z:pre",
+ "ng:w": "n:g:z:code_editor",
+ "ng:compat": [],
+ },
"app": {
"ng:n": "Official App",
"ng:a": "App provided by NextGraph platform",
@@ -191,7 +231,7 @@ export const official_classes = {
},
"contract": {
"ng:crdt": "YText",
- "ng:n": "Contract", // edited with CodeMirror, displayed with highlight.js
+ "ng:n": "Smart Contract", // edited with CodeMirror, displayed with highlight.js
"ng:a": "Smart Contract with Rust or JS code",
"ng:compat": ["code:rust", "file:iana:application:wasm", "code:javascript", "code:typescript", "file:iana:text:javascript", "file:iana:application:node"],
},
@@ -254,16 +294,16 @@ export const official_classes = {
},
"data:array": {
"ng:crdt": "YArray",
- "ng:n": "JSON Array",
- "ng:a": "JSON Array CRDT",
+ "ng:n": "Array",
+ "ng:a": "Yjs Array CRDT",
"ng:o": "n:g:z:json_viewer", // default viewer
"ng:w": "n:g:z:json_editor", // default editor
"ng:compat": ["file:iana:application:json", "code:json"],
},
"data:map": {
"ng:crdt": "YMap",
- "ng:n": "JSON Map",
- "ng:a": "JSON Map CRDT",
+ "ng:n": "Object",
+ "ng:a": "Yjs Map CRDT",
"ng:o": "n:g:z:json_viewer", // default viewer
"ng:w": "n:g:z:json_editor", // default editor
"ng:compat": ["file:iana:application:json", "code:json"],
@@ -285,7 +325,7 @@ export const official_classes = {
"ng:crdt": "Graph",
"ng:n": "Collection",
"ng:a": "An ordered list of items",
- "ng:o": "n:g:z:list",
+ "ng:o": "n:g:z:container",
"ng:x": {
"as": true,
"rdf": true,
@@ -296,7 +336,7 @@ export const official_classes = {
"ng:crdt": "Graph",
"ng:n": "Container",
"ng:a": "An unordered set of items",
- "ng:o": "n:g:z:list",
+ "ng:o": "n:g:z:container",
"ng:x": {
"rdf": true,
"rdfs": true,
@@ -386,7 +426,8 @@ export const official_classes = {
"ng:crdt": "YArray",
"ng:n": "Composition",
"ng:a": "Compose several blocks into a single document",
- "ng:o": "n:g:z:compose",
+ "ng:o": "n:g:z:compose:viewer",
+ "ng:w": "n:g:z:compose:editor",
},
"doc:diagram:mermaid" : {
"ng:crdt": "YText",
@@ -534,7 +575,7 @@ export const official_classes = {
},
"doc:odf": { //!!! becareful: AGPL
"ng:crdt": "Graph",
- "ng:n": "OpenDocumentFormat (ODF)",
+ "ng:n": "ODF",
"ng:a": "upload and display an ODF file",
"ng:compat": ["file:iana:application:vnd.oasis.opendocument*"] // https://webodf.org/ https://github.com/webodf/WebODF https://viewerjs.org/
},
@@ -553,7 +594,7 @@ export const official_classes = {
},
"doc:music:abc": { //https://github.com/paulrosen/abcjs
"ng:crdt": "YText",
- "ng:n": "Music ABC",
+ "ng:n": "Musical Notation",
"ng:a": "sheet music notation",
"ng:compat": []
},
@@ -571,7 +612,7 @@ export const official_classes = {
},
"doc:chemistry": { //GPL!! https://github.com/aeris-data/ChemDoodle/tree/master/ChemDoodleWeb-8.0.0 or https://github.com/aseevia/smiles-3d-vue
"ng:crdt": "YText",
- "ng:n": "Chemical",
+ "ng:n": "Molecules (SMILES)",
"ng:a": "simplified molecular-input line-entry system (SMILES)",
"ng:compat": ["file:iana:chemical:x-daylight-smiles"] // https://en.wikipedia.org/wiki/SYBYL_line_notation and http://fileformats.archiveteam.org/wiki/Chemical_data
},
@@ -733,6 +774,11 @@ export const official_classes = {
"ng:n": "ChatRoom",
"ng:a": "A room for group chat",
},
+ "social:live": {
+ "ng:crdt": "Graph",
+ "ng:n": "Live",
+ "ng:a": "A live session of video or audio, with optional chat",
+ },
"prod:task": {
"ng:crdt": "Graph",
"ng:n": "Task",
@@ -821,6 +867,12 @@ export const official_classes = {
"ng:a": "CADmium",
"ng:compat": []
},
+ "prod:spreadsheet": {
+ "ng:crdt": "Automerge",
+ "ng:n": "Spreadsheet",
+ "ng:a": "Spreadsheet",
+ "ng:compat": []
+ },
"prod:slides": { //https://github.com/hakimel/reveal.js
//https://pandoc.org/MANUAL.html#slide-shows
"ng:crdt": "Graph",
diff --git a/ng-app/src/lib/Document.svelte b/ng-app/src/lib/Document.svelte
index a733168..464cbcb 100644
--- a/ng-app/src/lib/Document.svelte
+++ b/ng-app/src/lib/Document.svelte
@@ -25,7 +25,7 @@
import { Button, Progressbar, Spinner, Alert } from "flowbite-svelte";
import { inview } from 'svelte-inview';
import { cur_tab, nav_bar, can_have_header, header_icon, header_title, header_description, cur_branch, set_header_in_view, edit_header_button, cur_app, load_official_app } from "../tab";
- import NavIcon from "./components/NavIcon.svelte";
+ import NavIcon from "./icons/NavIcon.svelte";
export let nuri = "";
diff --git a/ng-app/src/lib/FullLayout.svelte b/ng-app/src/lib/FullLayout.svelte
index 1459e5e..3e47ec3 100644
--- a/ng-app/src/lib/FullLayout.svelte
+++ b/ng-app/src/lib/FullLayout.svelte
@@ -17,27 +17,31 @@
SidebarWrapper,
Modal,
Toggle,
+ Radio,
} from "flowbite-svelte";
import { link, location, push } from "svelte-spa-router";
import MobileBottomBarItem from "./MobileBottomBarItem.svelte";
import MobileBottomBar from "./MobileBottomBar.svelte";
import Pane from "./Pane.svelte";
+ import DataClassIcon from "./icons/DataClassIcon.svelte";
+ import MarkdownIcon from "./icons/MarkdownIcon.svelte";
+ import TxtIcon from "./icons/TxtIcon.svelte";
// @ts-ignore
import Logo from "./components/Logo.svelte";
import MenuItem from "./components/MenuItem.svelte";
import PaneHeader from "./components/PaneHeader.svelte";
- import BranchIcon from "./components/BranchIcon.svelte";
+ import BranchIcon from "./icons/BranchIcon.svelte";
import Message from "./components/Message.svelte";
// @ts-ignore
import { t } from "svelte-i18n";
import { onMount, onDestroy, tick } from "svelte";
- import { cur_tab, cur_viewer, cur_editor, toggle_graph_discrete, cur_tab_update,
+ import { cur_tab, cur_viewer, cur_editor, toggle_graph_discrete, cur_tab_update, get_class,
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";
+ has_editor_chat, all_files_count, all_comments_count, nav_bar, save, hideMenu, show_modal_menu, show_modal_create, openModalCreate } from "../tab";
import {
- active_session, redirect_after_login, toasts
+ active_session, redirect_after_login, toasts, check_has_camera
} from "../store";
- import ZeraIcon from "./ZeraIcon.svelte";
+ import ZeraIcon from "./icons/ZeraIcon.svelte";
import {
Home,
@@ -86,9 +90,14 @@
XMark,
ArrowLeft,
ArchiveBox,
- CheckCircle,
- XCircle,
- ExclamationCircle,
+ Square3Stack3d,
+ UserGroup,
+ Briefcase,
+ DocumentArrowUp,
+ Language,
+ Camera,
+ VideoCamera,
+ Microphone,
} from "svelte-heros-v2";
import NavBar from "./components/NavBar.svelte";
@@ -212,6 +221,137 @@
}
}
+ let createMenu = {
+ social: undefined,
+ pro: undefined,
+ media: undefined,
+ chart: undefined,
+ viz: undefined,
+ diagram: undefined,
+ doc: undefined,
+ data: undefined,
+ code: undefined,
+ apps: undefined,
+ };
+ async function scrollToCreateMenu(menu) {
+ await tick();
+ if (createMenu[menu]) createMenu[menu].scrollIntoView();
+ }
+
+ let createMenuOpened = {
+ social: false,
+ pro: false,
+ media: false,
+ chart: false,
+ viz: false,
+ diagram: false,
+ doc: false,
+ data: false,
+ code: false,
+ apps: false
+ }
+
+ const create_social_items = [
+ "social:contact",
+ "social:chatroom",
+ "social:event",
+ "social:channel",
+ "social:scheduler",
+ "social:calendar",
+ "social:live"
+ ];
+
+ const create_pro_items = [
+ "prod:project",
+ "prod:task",
+ "prod:issue",
+ "prod:form",
+ "prod:slides",
+ "prod:spreadsheet",
+ "contract",
+ "prod:question",
+ "prod:poll",
+ "prod:cad",
+ ];
+
+ const create_media_items = [
+ "media:image",
+ "media:reel",
+ "media:video",
+ "media:album",
+ "media:audio",
+ "media:song",
+ "media:overlay",
+ ];
+
+ const create_chart_items = [
+ "doc:chart:frappecharts",
+ "doc:chart:financial",
+ "doc:chart:apexcharts",
+ "doc:chart:billboard",
+ "doc:chart:echarts",
+ "doc:chart:chartjs",
+ ];
+
+ const create_viz_items = [
+ "doc:viz:cytoscape",
+ "doc:viz:vega",
+ "doc:viz:vizzu",
+ "doc:viz:plotly",
+ "doc:viz:avail",
+ ];
+
+ const create_diagram_items = [
+ "doc:diagram:mermaid",
+ "doc:diagram:drawio",
+ "doc:diagram:graphviz",
+ "doc:diagram:excalidraw",
+ "doc:diagram:gantt",
+ "doc:diagram:flowchart",
+ "doc:diagram:sequence",
+ "doc:diagram:markmap",
+ "doc:diagram:mymind",
+ "doc:diagram:jsmind",
+ ];
+
+ const create_doc_items = [
+ "doc:pdf",
+ "doc:odf",
+ "file",
+ "doc:music:abc",
+ "doc:music:guitar",
+ "doc:maths",
+ "doc:chemistry",
+ "doc:ancientscript",
+ "doc:braille",
+ ];
+
+ const create_data_items = [
+ "data:graph",
+ "data:container",
+ "data:collection",
+ "data:table",
+ "data:geomap",
+ "data:board",
+ "data:grid",
+ "data:json",
+ "data:array",
+ "data:map",
+ "data:xml",
+ ];
+
+ const create_code_items = [
+ "code:rust",
+ "code:js",
+ "code:ts",
+ "code:svelte",
+ "code:react",
+ ];
+
+ const create_apps_items = [
+ "app:n:xxx.xx.xx",
+ ];
+
let top;
let shareMenu;
let toolsMenu;
@@ -251,7 +391,7 @@
});
active_session.subscribe((as) => { if(!as) {
- console.log($location);
+ //console.log($location);
if ($location!="/user") {
$redirect_after_login = $location;
}
@@ -346,6 +486,10 @@
// });
}
+ const closeModalCreate = () => {
+ $show_modal_create = false;
+ }
+
const closePaneInModal = () => {
cur_tab_update(ct => {
ct.show_menu = true;
@@ -373,6 +517,7 @@
{n:"embed",i:CodeBracketSquare},
{n:"schema",i:ArrowsPointingOut},
{n:"signature",i:ShieldCheck},
+ {n:"translations",i:Language},
{n:"services",i:Cube},
{n:"print",i:Printer},
{n:"console",i:CommandLine},
@@ -392,12 +537,48 @@
"mc":Sparkles,
};
- const customEv = new CustomEvent('loaded', {});
+ let destination = "store";
+
+ $: destination = $cur_tab.branch.id === "" ? "mc" : destination == "mc" ? "store" : destination;
+
+ let config = { tabindex:"-1",
+ class:"w-7 h-7 text-gray-700 focus:outline-none dark:text-white"
+ };
+
+ const new_document = (class_name) => {
+
+ closeModalCreate();
+ }
+
+ const new_group = () => {
+
+ closeModalCreate();
+ }
+
+ const new_app = () => {
+
+ closeModalCreate();
+ }
- async function addLoaded(node) {
- await tick()
- node.dispatchEvent(customEv)
- }
+ const scan_qr = () => {
+
+ closeModalCreate();
+ }
+
+ const take_picture = () => {
+
+ closeModalCreate();
+ }
+
+ const record_reel = () => {
+
+ closeModalCreate();
+ }
+
+ const record_voice = () => {
+
+ closeModalCreate();
+ }
let asideClass = "w-48";
let spanClass = "flex-1 ml-3 whitespace-nowrap";
@@ -406,8 +587,7 @@
-
-