From bb0f5e44045b9c0b79ef0cb0e9992ebf0da041b1 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sat, 20 Mar 2021 09:40:30 +0100 Subject: [PATCH] plugin tab --- packages/web/package.json | 1 + packages/web/src/elements/Markdown.svelte | 8 ++ packages/web/src/plugins/PluginsList.svelte | 2 +- .../web/src/tabs/MarkdownEditorTab.svelte | 13 +-- packages/web/src/tabs/PluginTab.svelte | 106 ++++++++++++++++++ packages/web/src/tabs/index.js | 4 +- yarn.lock | 12 ++ 7 files changed, 132 insertions(+), 14 deletions(-) create mode 100644 packages/web/src/elements/Markdown.svelte create mode 100644 packages/web/src/tabs/PluginTab.svelte diff --git a/packages/web/package.json b/packages/web/package.json index 9d4a2d80..7e3fdc41 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -42,6 +42,7 @@ "@mdi/font": "^5.9.55", "file-selector": "^0.2.4", "sirv-cli": "^1.0.0", + "svelte-markdown": "^0.1.4", "svelte-select": "^3.17.0" } } diff --git a/packages/web/src/elements/Markdown.svelte b/packages/web/src/elements/Markdown.svelte new file mode 100644 index 00000000..31b5770b --- /dev/null +++ b/packages/web/src/elements/Markdown.svelte @@ -0,0 +1,8 @@ + + + diff --git a/packages/web/src/plugins/PluginsList.svelte b/packages/web/src/plugins/PluginsList.svelte index d7653b41..a957c4c3 100644 --- a/packages/web/src/plugins/PluginsList.svelte +++ b/packages/web/src/plugins/PluginsList.svelte @@ -20,7 +20,7 @@ {#each plugins as packageManifest (packageManifest.name)}
openPlugin(packageManifest)}> -
+
{packageManifest.name}
{packageManifest.version}
diff --git a/packages/web/src/tabs/MarkdownEditorTab.svelte b/packages/web/src/tabs/MarkdownEditorTab.svelte index 5c7c5ddb..c2cf8e80 100644 --- a/packages/web/src/tabs/MarkdownEditorTab.svelte +++ b/packages/web/src/tabs/MarkdownEditorTab.svelte @@ -30,27 +30,18 @@ + + + +{#if manifest} +
+
+ +
+
{packageName}
+
+ {extractPluginAuthor(manifest)} + | + {installedFound ? installedFound.version : manifest.version} +
+
+ {#if hasPermission('plugins/install') && !installedFound} + + {/if} + {#if hasPermission('plugins/install') && installedFound} + + {/if} + {#if hasPermission('plugins/install') && installedFound && onlineFound && compareVersions(onlineFound.version, installedFound.version) > 0} + + {/if} +
+
+
+ +
+{/if} + + diff --git a/packages/web/src/tabs/index.js b/packages/web/src/tabs/index.js index b0db5821..13ef12ae 100644 --- a/packages/web/src/tabs/index.js +++ b/packages/web/src/tabs/index.js @@ -5,7 +5,7 @@ import * as QueryTab from './QueryTab.svelte'; import * as ShellTab from './ShellTab.svelte'; import * as ArchiveFileTab from './ArchiveFileTab.svelte'; import * as FreeTableTab from './FreeTableTab.svelte'; -// import PluginTab from './PluginTab'; +import * as PluginTab from './PluginTab.svelte'; import * as ChartTab from './ChartTab.svelte'; import * as MarkdownEditorTab from './MarkdownEditorTab.svelte'; // import MarkdownViewTab from './MarkdownViewTab'; @@ -21,7 +21,7 @@ export default { ShellTab, ArchiveFileTab, FreeTableTab, - // PluginTab, + PluginTab, ChartTab, MarkdownEditorTab, // MarkdownViewTab, diff --git a/yarn.lock b/yarn.lock index 3454249a..716e5656 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4685,6 +4685,11 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +marked@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.1.tgz#5e7ed7009bfa5c95182e4eb696f85e948cefcee3" + integrity sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -6988,6 +6993,13 @@ svelte-check@^1.0.0: svelte-preprocess "^4.0.0" typescript "*" +svelte-markdown@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/svelte-markdown/-/svelte-markdown-0.1.4.tgz#03bec6dcd8ff1c09126e7c62c8a5a481905881d7" + integrity sha512-PXr3R/EJ5cPpk/DZoLXG5dOsRoXqHO541KcH340UQojU5MdnFvfgGSif00WjAApuV1RpdkjujhzJ1Gy54r+5pg== + dependencies: + marked "^2.0.0" + svelte-preprocess@^4.0.0: version "4.6.9" resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.6.9.tgz#073d923eb351b98b6c6a454ba5feee981cd9dbf5"