generated from siyuan-note/plugin-sample-vite-svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
430 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher, onMount } from "svelte"; | ||
import SettingPanel from "@/libs/setting-panel.svelte"; | ||
import { setting } from "@/settings"; | ||
import { i18n } from "@/utils"; | ||
const I18N = i18n.defaultSetting; | ||
export let group: string = ""; | ||
export let display: boolean = true; | ||
export let settingValue = {}; | ||
export let descriptioin = I18N.descriptioin; | ||
const SettingItemsValue = { | ||
protyleScroll: setting.protyleScroll, | ||
protyleBreadcrumb: setting.protyleBreadcrumb, | ||
protyleReadonly: setting.protyleReadonly, | ||
dynamicLoadingEnabled: setting.dynamicLoadingEnabled, | ||
dynamicLoadingCapacity: setting.dynamicLoadingCapacity, | ||
dynamicLoadingShift: setting.dynamicLoadingShift, | ||
}; | ||
let DefaultSettingItems: ISettingItem[] = []; | ||
onMount(() => { | ||
for (let key in settingValue) { | ||
if (key in SettingItemsValue) { | ||
SettingItemsValue[key] = settingValue[key]; | ||
} | ||
} | ||
DefaultSettingItems = [ | ||
{ | ||
type: 'checkbox', | ||
title: I18N.scrollMode.title, | ||
text: I18N.scrollMode.text, | ||
key: 'protyleScroll', | ||
value: SettingItemsValue.protyleScroll | ||
}, | ||
{ | ||
type: 'checkbox', | ||
title: I18N.displayBreadcrumb.title, | ||
text: I18N.displayBreadcrumb.text, | ||
key: 'protyleBreadcrumb', | ||
value: SettingItemsValue.protyleBreadcrumb | ||
}, | ||
{ | ||
type: 'checkbox', | ||
title: I18N.protyleReadonly.title, | ||
text: I18N.protyleReadonly.text, | ||
key: 'protyleReadonly', | ||
value: SettingItemsValue.protyleReadonly | ||
}, | ||
{ | ||
type: 'checkbox', | ||
title: I18N.dynamicLoading.title, | ||
text: I18N.dynamicLoading.text, | ||
key: 'dynamicLoadingEnabled', | ||
value: SettingItemsValue.dynamicLoadingEnabled | ||
}, | ||
{ | ||
type: 'number', | ||
title: I18N.dynamicLoadingCapacity.title, | ||
text: I18N.dynamicLoadingCapacity.text, | ||
key: 'dynamicLoadingCapacity', | ||
value: SettingItemsValue.dynamicLoadingCapacity | ||
}, | ||
{ | ||
type: 'number', | ||
title: I18N.dynamicLoadingShift.title, | ||
text: I18N.dynamicLoadingShift.text, | ||
key: 'dynamicLoadingShift', | ||
value: SettingItemsValue.dynamicLoadingShift | ||
}, | ||
]; | ||
}); | ||
const dispatch = createEventDispatcher(); | ||
function onChanged( {detail}) { | ||
dispatch("changed", detail); | ||
} | ||
</script> | ||
|
||
<SettingPanel | ||
{group} | ||
settingItems={DefaultSettingItems} | ||
{display} | ||
on:changed={onChanged} | ||
> | ||
<div slot="top" class="fn__flex b3-label"> | ||
💡 {descriptioin} | ||
</div> | ||
</SettingPanel> | ||
|
||
|
||
<style lang="scss"> | ||
div[slot="top"] { | ||
color: var(--b3-theme-primary); | ||
font-weight: bold; | ||
font-size: 1.2em; | ||
} | ||
</style> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!-- | ||
Copyright (c) 2023 by Yp Z (frostime). All Rights Reserved. | ||
Author : Yp Z | ||
Date : 2023-11-19 17:53:31 | ||
FilePath : /src/components/config/global-setting.svelte | ||
LastEditTime : 2023-11-19 19:35:52 | ||
Description : | ||
--> | ||
<!-- | ||
Copyright (c) 2023 by Yp Z (frostime). All Rights Reserved. | ||
Author : Yp Z | ||
Date : 2023-11-19 17:53:31 | ||
FilePath : /src/components/config/global-setting.svelte | ||
LastEditTime : 2023-11-19 19:10:51 | ||
Description : | ||
--> | ||
<script lang="ts"> | ||
import DefaultSetting from "./default-setting.svelte"; | ||
import { setting } from "@/settings"; | ||
let groups: string[] = ["🌈 Default"]; | ||
let focusGroup = groups[0]; | ||
/********** Events **********/ | ||
interface ChangeEvent { | ||
group: string; | ||
key: string; | ||
value: any; | ||
} | ||
const onChanged = ({ detail }: CustomEvent<ChangeEvent>) => { | ||
if (detail.group === groups[0]) { | ||
setting.set(detail.key, detail.value); | ||
} | ||
}; | ||
</script> | ||
|
||
<div class="fn__flex-1 fn__flex config__panel"> | ||
<ul class="b3-tab-bar b3-list b3-list--background"> | ||
{#each groups as group} | ||
<li | ||
data-name="editor" | ||
class:b3-list-item--focus={group === focusGroup} | ||
class="b3-list-item" | ||
on:click={() => { | ||
focusGroup = group; | ||
}} | ||
on:keydown={() => {}} | ||
> | ||
<span class="b3-list-item__text">{group}</span> | ||
</li> | ||
{/each} | ||
</ul> | ||
<div class="config__tab-wrap"> | ||
<DefaultSetting | ||
group={groups[0]} | ||
display={focusGroup === groups[0]} | ||
on:changed={onChanged} | ||
/> | ||
</div> | ||
</div> | ||
|
||
<style lang="scss"> | ||
.config__panel { | ||
height: 100%; | ||
} | ||
.config__panel > ul > li { | ||
padding-left: 1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
> 征集新的图标中, 有比较好的图标设计欢迎来发 issue. | ||
> | ||
> We are currently collecting new icons. If you have excellent icon designs, please feel free to submit an issue. | ||
## 文档流插件 v0.4.0 | ||
|
||
## 文档流插件 v0.3.1 | ||
|
||
优化了 Eventbus, 允许外部调用的时候传入配置,详情见 README | ||
|
||
## Document Flow Plugin v0.3.1 | ||
|
||
Optimized Eventbus to allow passing configurations during external event-bus calls. | ||
|
||
Please refer to the README for more details. | ||
- Fix bug: [#35](https://github.com/frostime/sy-docs-flow/issues/35) | ||
- 增加设置功能, 允许用户配置文档流的默认选项 | ||
- 允许用户完整配置单个文档流内所有选项 | ||
- 更换了图标 | ||
|
Oops, something went wrong.