remove dock.svelte
This commit is contained in:
parent
ead99605fd
commit
44e0010f6a
3 changed files with 16 additions and 34 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "plugin-sample-vite-svelte",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.6",
|
||||
"type": "module",
|
||||
"description": "",
|
||||
"repository": "",
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<script lang="ts">
|
||||
import { adaptHotkey } from "siyuan";
|
||||
export let text: string;
|
||||
</script>
|
||||
|
||||
<div class="fn__flex-1 fn__flex-column">
|
||||
<div class="block__icons">
|
||||
<div class="block__logo">
|
||||
<svg><use xlink:href="#iconEmoji" /></svg>
|
||||
Custom Dock
|
||||
</div>
|
||||
<span class="fn__flex-1 fn__space" />
|
||||
<span
|
||||
data-type="min"
|
||||
class="block__icon b3-tooltips b3-tooltips__sw"
|
||||
aria-label="Min ${adaptHotkey('⌘W')}"
|
||||
><svg><use xlink:href="#iconMin" /></svg></span
|
||||
>
|
||||
</div>
|
||||
<div class="fn__flex-1 plugin-sample__custom-dock">
|
||||
{text}
|
||||
</div>
|
||||
</div>
|
25
src/index.ts
25
src/index.ts
|
@ -1,8 +1,7 @@
|
|||
import { Plugin, showMessage, confirm, Dialog, Menu, isMobile, openTab } from "siyuan";
|
||||
import { Plugin, showMessage, confirm, Dialog, Menu, isMobile, openTab, adaptHotkey } from "siyuan";
|
||||
import "./index.scss";
|
||||
|
||||
import HelloExample from "./hello.svelte";
|
||||
import DockExample from "./dock.svelte";
|
||||
import SettingPannel from "./libs/setting-panel.svelte";
|
||||
|
||||
const STORAGE_NAME = "menu-config";
|
||||
|
@ -48,7 +47,7 @@ export default class SamplePlugin extends Plugin {
|
|||
this.addDock({
|
||||
config: {
|
||||
position: "LeftBottom",
|
||||
size: { width: 200, height: 0 },
|
||||
size: {width: 200, height: 0},
|
||||
icon: "iconEmoji",
|
||||
title: "Custom Dock",
|
||||
},
|
||||
|
@ -57,16 +56,22 @@ export default class SamplePlugin extends Plugin {
|
|||
},
|
||||
type: DOCK_TYPE,
|
||||
init() {
|
||||
this.component = new DockExample({
|
||||
target: this.element,
|
||||
props: {
|
||||
text: this.data.text,
|
||||
}
|
||||
});
|
||||
this.element.innerHTML = `<div class="fn__flex-1 fn__flex-column">
|
||||
<div class="block__icons">
|
||||
<div class="block__logo">
|
||||
<svg><use xlink:href="#iconEmoji"></use></svg>
|
||||
Custom Dock
|
||||
</div>
|
||||
<span class="fn__flex-1 fn__space"></span>
|
||||
<span data-type="min" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="Min ${adaptHotkey("⌘W")}"><svg><use xlink:href="#iconMin"></use></svg></span>
|
||||
</div>
|
||||
<div class="fn__flex-1 plugin-sample__custom-dock">
|
||||
${this.data.text}
|
||||
</div>
|
||||
</div>`;
|
||||
},
|
||||
destroy() {
|
||||
console.log("destroy dock:", DOCK_TYPE);
|
||||
this.component.$destroy();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue