Skip to content

Commit 59daefa

Browse files
committed
⬆️ update siyuan: add direction parameter
1 parent 7159755 commit 59daefa

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[中文版](./README_zh_CN.md)
55

6-
> Consistent with [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.3.4](https://github.com/siyuan-note/plugin-sample/tree/v0.3.4)
6+
> Consistent with [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.3.5](https://github.com/siyuan-note/plugin-sample/tree/v0.3.5)
77
88

99

README_zh_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[English](./README.md)
55

66

7-
> 本例同 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.3.4](https://github.com/siyuan-note/plugin-sample/tree/v0.3.4)
7+
> 本例同 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.3.5](https://github.com/siyuan-note/plugin-sample/tree/v0.3.5)
88
99
1. 使用 vite 打包
1010
2. 使用符号链接、而不是把项目放到插件目录下的模式进行开发

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "plugin-sample-vite-svelte",
3-
"version": "0.3.2",
3+
"version": "0.3.5",
44
"type": "module",
55
"description": "This is a sample plugin based on vite and svelte for Siyuan (https://b3log.org/siyuan)",
66
"repository": "",
77
"homepage": "",
8-
"author": "",
8+
"author": "frostime",
99
"license": "MIT",
1010
"scripts": {
1111
"make-link": "node --no-warnings ./scripts/make_dev_link.js",
@@ -23,7 +23,7 @@
2323
"minimist": "^1.2.8",
2424
"rollup-plugin-livereload": "^2.0.5",
2525
"sass": "^1.63.3",
26-
"siyuan": "0.9.7",
26+
"siyuan": "0.9.8",
2727
"svelte": "^4.2.0",
2828
"ts-node": "^10.9.1",
2929
"typescript": "^5.1.3",

plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "plugin-sample-vite-svelte",
33
"author": "frostime",
44
"url": "https://github.com/siyuan-note/plugin-sample-vite-svelte",
5-
"version": "0.3.4",
6-
"minAppVersion": "3.0.0",
5+
"version": "0.3.5",
6+
"minAppVersion": "3.0.12",
77
"backends": [
88
"windows",
99
"linux",

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ export default class PluginSample extends Plugin {
235235
type: "slider",
236236
title: "Slider text",
237237
description: "Slider description",
238+
direction: "column",
238239
slider: {
239240
min: 0,
240241
max: 100,

src/libs/setting-utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author : frostime
44
* @Date : 2023-12-17 18:28:19
55
* @FilePath : /src/libs/setting-utils.ts
6-
* @LastEditTime : 2024-04-30 15:50:07
6+
* @LastEditTime : 2024-04-30 16:09:54
77
* @Description :
88
*/
99

@@ -222,6 +222,7 @@ export class SettingUtils {
222222
this.plugin.setting.addItem({
223223
title: item.title,
224224
description: item?.description,
225+
direction: item?.direction,
225226
createActionElement: () => {
226227
this.updateElementFromValue(item.key);
227228
let element = this.getElement(item.key);
@@ -232,6 +233,7 @@ export class SettingUtils {
232233
this.plugin.setting.addItem({
233234
title: item.title,
234235
description: item?.description,
236+
direction: item?.direction,
235237
createActionElement: () => {
236238
let val = this.get(item.key);
237239
let element = item.createElement(val);
@@ -334,6 +336,7 @@ export class SettingUtils {
334336

335337
private updateValueFromElement(key: string) {
336338
let item = this.settings.get(key);
339+
if (item.type === 'button') return;
337340
let element = this.elements.get(key) as any;
338341
item.value = valueOf(element);
339342
// switch (item.type) {
@@ -360,6 +363,7 @@ export class SettingUtils {
360363

361364
private updateElementFromValue(key: string) {
362365
let item = this.settings.get(key);
366+
if (item.type === 'button') return;
363367
let element = this.elements.get(key) as any;
364368
setValue(element, item.value);
365369
// switch (item.type) {

0 commit comments

Comments
 (0)