Could this be working!?
parent
82faee9baa
commit
df41796245
|
@ -18,21 +18,6 @@ export {
|
||||||
encode as b64encode,
|
encode as b64encode,
|
||||||
} from "https://deno.land/std@0.158.0/encoding/base64.ts";
|
} from "https://deno.land/std@0.158.0/encoding/base64.ts";
|
||||||
|
|
||||||
export {
|
|
||||||
defaultHighlightStyle,
|
|
||||||
defineLanguageFacet,
|
|
||||||
foldNodeProp,
|
|
||||||
HighlightStyle,
|
|
||||||
indentNodeProp,
|
|
||||||
Language,
|
|
||||||
languageDataProp,
|
|
||||||
LanguageDescription,
|
|
||||||
LanguageSupport,
|
|
||||||
ParseContext,
|
|
||||||
syntaxHighlighting,
|
|
||||||
syntaxTree,
|
|
||||||
} from "@codemirror/language";
|
|
||||||
export { markdown } from "https://esm.sh/@codemirror/lang-markdown@6.0.1?external=@codemirror/state";
|
|
||||||
export {
|
export {
|
||||||
history,
|
history,
|
||||||
historyKeymap,
|
historyKeymap,
|
||||||
|
@ -49,7 +34,7 @@ export {
|
||||||
Tag,
|
Tag,
|
||||||
tagHighlighter,
|
tagHighlighter,
|
||||||
tags,
|
tags,
|
||||||
} from "https://esm.sh/@lezer/highlight";
|
} from "https://esm.sh/@lezer/highlight@1.1.1";
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
BlockContext,
|
BlockContext,
|
||||||
|
@ -57,7 +42,7 @@ export type {
|
||||||
LeafBlockParser,
|
LeafBlockParser,
|
||||||
MarkdownConfig,
|
MarkdownConfig,
|
||||||
MarkdownExtension,
|
MarkdownExtension,
|
||||||
} from "https://esm.sh/@lezer/markdown";
|
} from "https://esm.sh/@lezer/markdown@1.0.2";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Emoji,
|
Emoji,
|
||||||
|
@ -69,11 +54,11 @@ export {
|
||||||
Superscript,
|
Superscript,
|
||||||
Table,
|
Table,
|
||||||
TaskList,
|
TaskList,
|
||||||
} from "https://esm.sh/@lezer/markdown";
|
} from "https://esm.sh/@lezer/markdown@1.0.2";
|
||||||
|
|
||||||
export type { SyntaxNode, Tree } from "https://esm.sh/@lezer/common";
|
export type { SyntaxNode, Tree } from "https://esm.sh/@lezer/common@1.0.1";
|
||||||
|
|
||||||
export { searchKeymap } from "https://esm.sh/@codemirror/search?external=@codemirror/state";
|
export { searchKeymap } from "https://esm.sh/@codemirror/search@6.2.1?external=@codemirror/state";
|
||||||
export {
|
export {
|
||||||
Decoration,
|
Decoration,
|
||||||
drawSelection,
|
drawSelection,
|
||||||
|
@ -100,3 +85,17 @@ export {
|
||||||
Transaction,
|
Transaction,
|
||||||
} from "@codemirror/state";
|
} from "@codemirror/state";
|
||||||
export type { ChangeSpec, StateCommand } from "@codemirror/state";
|
export type { ChangeSpec, StateCommand } from "@codemirror/state";
|
||||||
|
export {
|
||||||
|
defineLanguageFacet,
|
||||||
|
foldNodeProp,
|
||||||
|
HighlightStyle,
|
||||||
|
indentNodeProp,
|
||||||
|
// bla
|
||||||
|
Language,
|
||||||
|
languageDataProp,
|
||||||
|
LanguageDescription,
|
||||||
|
LanguageSupport,
|
||||||
|
ParseContext,
|
||||||
|
syntaxHighlighting,
|
||||||
|
syntaxTree,
|
||||||
|
} from "https://esm.sh/@codemirror/language@6.2.1?external=@codemirror/state";
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"@codemirror/state": "https://esm.sh/@codemirror/state",
|
"@codemirror/state": "https://esm.sh/@codemirror/state@6.1.2",
|
||||||
"@codemirror/language": "https://esm.sh/@codemirror/language",
|
|
||||||
"@lezer/lr": "https://esm.sh/@lezer/lr@1.2.3",
|
"@lezer/lr": "https://esm.sh/@lezer/lr@1.2.3",
|
||||||
"yaml": "https://deno.land/std@0.158.0/encoding/yaml.ts",
|
"yaml": "https://deno.land/std@0.158.0/encoding/yaml.ts",
|
||||||
"$sb/": "./packages/",
|
"$sb/": "./packages/",
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 70c34bb6d77b2dd05255f0e4a813bb62239d62d1
|
|
@ -1,60 +1,67 @@
|
||||||
import { autocompletion, completionKeymap, CompletionResult } from "../../dep_web.ts";
|
import ReactDOM from "https://esm.sh/react-dom@17";
|
||||||
import { closeBrackets, closeBracketsKeymap } from "../../dep_web.ts";
|
import React, { useEffect, useReducer } from "https://esm.sh/react@17";
|
||||||
import { indentWithTab, standardKeymap } from "../../dep_web.ts";
|
|
||||||
import { history, historyKeymap } from "../../dep_web.ts";
|
|
||||||
import { syntaxHighlighting } from "../../dep_web.ts";
|
|
||||||
import { searchKeymap } from "../../dep_web.ts";
|
|
||||||
import { EditorSelection, EditorState } from "../../dep_web.ts";
|
|
||||||
import {
|
import {
|
||||||
|
autocompletion,
|
||||||
|
closeBrackets,
|
||||||
|
closeBracketsKeymap,
|
||||||
|
completionKeymap,
|
||||||
|
CompletionResult,
|
||||||
drawSelection,
|
drawSelection,
|
||||||
dropCursor,
|
dropCursor,
|
||||||
|
EditorSelection,
|
||||||
|
EditorState,
|
||||||
EditorView,
|
EditorView,
|
||||||
highlightSpecialChars,
|
highlightSpecialChars,
|
||||||
|
history,
|
||||||
|
historyKeymap,
|
||||||
|
indentWithTab,
|
||||||
KeyBinding,
|
KeyBinding,
|
||||||
keymap,
|
keymap,
|
||||||
runScopeHandlers,
|
runScopeHandlers,
|
||||||
|
searchKeymap,
|
||||||
|
standardKeymap,
|
||||||
|
syntaxHighlighting,
|
||||||
|
syntaxTree,
|
||||||
ViewPlugin,
|
ViewPlugin,
|
||||||
ViewUpdate,
|
ViewUpdate,
|
||||||
} from "../../dep_web.ts";
|
} from "../../dep_common.ts";
|
||||||
import React, { useEffect, useReducer } from "https://esm.sh/react@17";
|
import { SilverBulletHooks } from "../common/manifest.ts";
|
||||||
import ReactDOM from "https://esm.sh/react-dom@17";
|
import { markdown } from "../common/markdown/index.ts";
|
||||||
|
import { loadMarkdownExtensions, MDExt } from "../common/markdown_ext.ts";
|
||||||
|
import buildMarkdown from "../common/parser.ts";
|
||||||
|
import { Space } from "../common/spaces/space.ts";
|
||||||
|
import { markdownSyscalls } from "../common/syscalls/markdown.ts";
|
||||||
|
import { FilterOption, PageMeta } from "../common/types.ts";
|
||||||
|
import { safeRun, throttle } from "../common/util.ts";
|
||||||
import { createSandbox as createIFrameSandbox } from "../plugos/environments/webworker_sandbox.ts";
|
import { createSandbox as createIFrameSandbox } from "../plugos/environments/webworker_sandbox.ts";
|
||||||
|
import { EventHook } from "../plugos/hooks/event.ts";
|
||||||
|
import { eventSyscalls } from "../plugos/syscalls/event.ts";
|
||||||
|
import sandboxSyscalls from "../plugos/syscalls/sandbox.ts";
|
||||||
|
import { System } from "../plugos/system.ts";
|
||||||
import { AppEvent, ClickEvent } from "./app_event.ts";
|
import { AppEvent, ClickEvent } from "./app_event.ts";
|
||||||
import { CommandPalette } from "./components/command_palette.tsx";
|
import { CommandPalette } from "./components/command_palette.tsx";
|
||||||
|
import { FilterList } from "./components/filter.tsx";
|
||||||
import { PageNavigator } from "./components/page_navigator.tsx";
|
import { PageNavigator } from "./components/page_navigator.tsx";
|
||||||
import { TopBar } from "./components/top_bar.tsx";
|
|
||||||
import { lineWrapper } from "./line_wrapper.ts";
|
|
||||||
import { markdown } from "../common/markdown/index.ts";
|
|
||||||
import { PathPageNavigator } from "./navigator.ts";
|
|
||||||
import buildMarkdown from "../common/parser.ts";
|
|
||||||
import reducer from "./reducer.ts";
|
|
||||||
import { smartQuoteKeymap } from "./smart_quotes.ts";
|
|
||||||
import { Space } from "../common/spaces/space.ts";
|
|
||||||
import customMarkdownStyle from "./style.ts";
|
|
||||||
import { editorSyscalls } from "./syscalls/editor.ts";
|
|
||||||
import { indexerSyscalls } from "./syscalls/index.ts";
|
|
||||||
import { spaceSyscalls } from "./syscalls/space.ts";
|
|
||||||
import { Action, AppViewState, initialViewState } from "./types.ts";
|
|
||||||
import { SilverBulletHooks } from "../common/manifest.ts";
|
|
||||||
import { safeRun, throttle } from "../common/util.ts";
|
|
||||||
import { System } from "../plugos/system.ts";
|
|
||||||
import { EventHook } from "../plugos/hooks/event.ts";
|
|
||||||
import { systemSyscalls } from "./syscalls/system.ts";
|
|
||||||
import { Panel } from "./components/panel.tsx";
|
import { Panel } from "./components/panel.tsx";
|
||||||
|
import { TopBar } from "./components/top_bar.tsx";
|
||||||
|
import { attachmentExtension, pasteLinkExtension } from "./editor_paste.ts";
|
||||||
import { CommandHook } from "./hooks/command.ts";
|
import { CommandHook } from "./hooks/command.ts";
|
||||||
import { SlashCommandHook } from "./hooks/slash_command.ts";
|
import { SlashCommandHook } from "./hooks/slash_command.ts";
|
||||||
import { attachmentExtension, pasteLinkExtension } from "./editor_paste.ts";
|
|
||||||
import { markdownSyscalls } from "../common/syscalls/markdown.ts";
|
|
||||||
import { clientStoreSyscalls } from "./syscalls/clientStore.ts";
|
|
||||||
import { loadMarkdownExtensions, MDExt } from "../common/markdown_ext.ts";
|
|
||||||
import { FilterList } from "./components/filter.tsx";
|
|
||||||
import { FilterOption, PageMeta } from "../common/types.ts";
|
|
||||||
import { syntaxTree } from "../../dep_web.ts";
|
|
||||||
import sandboxSyscalls from "../plugos/syscalls/sandbox.ts";
|
|
||||||
import { eventSyscalls } from "../plugos/syscalls/event.ts";
|
|
||||||
import { storeSyscalls } from "./syscalls/store.ts";
|
|
||||||
import { inlineImagesPlugin } from "./inline_image.ts";
|
import { inlineImagesPlugin } from "./inline_image.ts";
|
||||||
|
import { lineWrapper } from "./line_wrapper.ts";
|
||||||
|
import { PathPageNavigator } from "./navigator.ts";
|
||||||
|
import reducer from "./reducer.ts";
|
||||||
|
import { smartQuoteKeymap } from "./smart_quotes.ts";
|
||||||
|
import customMarkdownStyle from "./style.ts";
|
||||||
|
import { clientStoreSyscalls } from "./syscalls/clientStore.ts";
|
||||||
|
import { editorSyscalls } from "./syscalls/editor.ts";
|
||||||
import { fulltextSyscalls } from "./syscalls/fulltext.ts";
|
import { fulltextSyscalls } from "./syscalls/fulltext.ts";
|
||||||
|
import { indexerSyscalls } from "./syscalls/index.ts";
|
||||||
|
import { spaceSyscalls } from "./syscalls/space.ts";
|
||||||
|
import { storeSyscalls } from "./syscalls/store.ts";
|
||||||
|
import { systemSyscalls } from "./syscalls/system.ts";
|
||||||
|
import { Action, AppViewState, initialViewState } from "./types.ts";
|
||||||
|
|
||||||
class PageState {
|
class PageState {
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -69,28 +76,28 @@ const saveInterval = 1000;
|
||||||
// properly, no idea why
|
// properly, no idea why
|
||||||
|
|
||||||
// TODO: Remove at some point
|
// TODO: Remove at some point
|
||||||
EditorState.prototype.languageDataAt = function (
|
// EditorState.prototype.languageDataAt = function (
|
||||||
name: string,
|
// name: string,
|
||||||
pos: number,
|
// pos: number,
|
||||||
side = -1,
|
// side = -1,
|
||||||
) {
|
// ) {
|
||||||
let values = [];
|
// let values = [];
|
||||||
// console.log("Getting language data");
|
// // console.log("Getting language data");
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
for (let provider of this.facet(EditorState.languageData)) {
|
// for (let provider of this.facet(EditorState.languageData)) {
|
||||||
let providerResult = provider(this, pos, side);
|
// let providerResult = provider(this, pos, side);
|
||||||
if (!providerResult) {
|
// if (!providerResult) {
|
||||||
// console.log("Empty provider result");
|
// // console.log("Empty provider result");
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
for (let result of providerResult) {
|
// for (let result of providerResult) {
|
||||||
if (Object.prototype.hasOwnProperty.call(result, name)) {
|
// if (Object.prototype.hasOwnProperty.call(result, name)) {
|
||||||
values.push(result[name]);
|
// values.push(result[name]);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return values;
|
// return values;
|
||||||
};
|
// };
|
||||||
|
|
||||||
export class Editor {
|
export class Editor {
|
||||||
readonly commandHook: CommandHook;
|
readonly commandHook: CommandHook;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { syntaxTree } from "../../dep_web.ts";
|
import { syntaxTree } from "../../dep_common.ts";
|
||||||
import {
|
import {
|
||||||
Decoration,
|
Decoration,
|
||||||
DecorationSet,
|
DecorationSet,
|
||||||
EditorView,
|
EditorView,
|
||||||
ViewPlugin,
|
ViewPlugin,
|
||||||
ViewUpdate,
|
ViewUpdate,
|
||||||
} from "../../dep_web.ts";
|
} from "../../dep_common.ts";
|
||||||
|
|
||||||
import { Range } from "../../dep_web.ts";
|
import { Range } from "../../dep_web.ts";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { KeyBinding } from "../../dep_web.ts";
|
import { KeyBinding } from "../../dep_web.ts";
|
||||||
import { syntaxTree } from "../../dep_web.ts";
|
import { syntaxTree } from "../../dep_common.ts";
|
||||||
|
|
||||||
const straightQuoteContexts = ["CommentBlock", "FencedCode", "InlineCode"];
|
const straightQuoteContexts = ["CommentBlock", "FencedCode", "InlineCode"];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { HighlightStyle } from "../../dep_web.ts";
|
import { HighlightStyle } from "../../dep_common.ts";
|
||||||
import { tagHighlighter, tags as t } from "../../dep_web.ts";
|
import { tagHighlighter, tags as t } from "../../dep_web.ts";
|
||||||
import * as ct from "../common/customtags.ts";
|
import * as ct from "../common/customtags.ts";
|
||||||
import { MDExt } from "../common/markdown_ext.ts";
|
import { MDExt } from "../common/markdown_ext.ts";
|
||||||
|
|
Loading…
Reference in New Issue