diff --git a/README.md b/README.md index 877242d..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,13 +0,0 @@ - -# SiYuan plugin sample with vite and solidjs - -[中文版](./README_zh_CN.md) - -> 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) - - - -1. Using vite for packaging -2. Use symbolic linking instead of putting the project into the plugins directory program development -3. Built-in support for the solidjs framework -4. Provides a github action template to automatically generate package.zip and upload to new release diff --git a/README_zh_CN.md b/README_zh_CN.md index 919150b..e69de29 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -1,11 +0,0 @@ -# 使用 vite + solidjs 的思源笔记插件示例 - -[English](./README.md) - - -> 本例同 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.3.5](https://github.com/siyuan-note/plugin-sample/tree/v0.3.5) - -1. 使用 vite 打包 -2. 使用符号链接、而不是把项目放到插件目录下的模式进行开发 -3. 内置对 solidjs 框架的支持 -4. 提供一个github action 模板,能自动生成package.zip并上传到新版本中 diff --git a/src/components/item.tsx b/src/components/item.tsx index 2620e87..71810c7 100644 --- a/src/components/item.tsx +++ b/src/components/item.tsx @@ -148,42 +148,44 @@ const Item: Component = (props) => { ] }) menu.addSeparator(); - const groups = shownGroups().filter((g) => g.id !== props.group && g.type !== 'dynamic').map((g) => { - return { - label: g.name, - click: () => { - model.transferItem(props.group, g.id, item()); - }, - }; - }); - menu.addItem({ - label: "移动到其他分组", - icon: "iconFolder", - type: 'submenu', - submenu: groups - }); - menu.addItem({ - label: '移动', - icon: 'iconMove', - type: 'submenu', - submenu: [ - { - label: "置顶", - icon: "iconTop", - click: () => { - model.reorderItem(props.group, item(), 'top'); - } - }, - { - label: "置底", - icon: "iconTop", - iconClass: "rotate-180", + if (!inDynamicGroup()) { + const groups = shownGroups().filter((g) => g.id !== props.group && g.type !== 'dynamic').map((g) => { + return { + label: g.name, click: () => { - model.reorderItem(props.group, item(), 'bottom'); + model.transferItem(props.group, g.id, item()); + }, + }; + }); + menu.addItem({ + label: "移动到其他分组", + icon: "iconFolder", + type: 'submenu', + submenu: groups + }); + menu.addItem({ + label: '移动', + icon: 'iconMove', + type: 'submenu', + submenu: [ + { + label: "置顶", + icon: "iconTop", + click: () => { + model.reorderItem(props.group, item(), 'top'); + } + }, + { + label: "置底", + icon: "iconTop", + iconClass: "rotate-180", + click: () => { + model.reorderItem(props.group, item(), 'bottom'); + } } - } - ] - }); + ] + }); + } menu.addItem({ label: "删除书签", icon: "iconTrashcan", @@ -233,15 +235,15 @@ const Item: Component = (props) => { const BindDragEvent = { draggable: true, - onDragStart: onDragStart , - onDragEnd: onDragEnd , + onDragStart: onDragStart, + onDragEnd: onDragEnd, } return (
  • { case 'attr': return { desc: "请输入要查找的属性", - direction: "column", + direction: "row", input: "textinput" } @@ -123,6 +123,8 @@ const NewGroup = (props: IPrpos) => { changed={(v) => { props.setRule({ input: v }); }} + // nofnSize={true} + flex1={ruleType() === 'attr' ? true : false} /> diff --git a/src/index.ts b/src/index.ts index 67fce71..2cef3ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ * @Author : frostime * @Date : 2024-06-12 19:48:53 * @FilePath : /src/index.ts - * @LastEditTime : 2024-07-07 18:05:52 + * @LastEditTime : 2024-07-07 18:22:17 * @Description : */ import { @@ -62,7 +62,7 @@ export default class PluginBookmarkPlus extends Plugin { `); this.addDock({ - type: '::dock::' + 'Bookmark', + type: '::dock', config: { position: 'RightBottom', size: { @@ -70,7 +70,7 @@ export default class PluginBookmarkPlus extends Plugin { height: 200, }, icon: 'iconBookmark', - title: 'F-Bookmark' + title: 'Bookmark+' }, data: { plugin: this, @@ -87,7 +87,7 @@ export default class PluginBookmarkPlus extends Plugin { langText: 'F-misc 书签', hotkey: bookmarkKeymap.default, callback: () => { - const ele = document.querySelector('span[data-type="sy-f-misc::dock::Bookmark"]') as HTMLElement; + const ele = document.querySelector(`span[data-type="${this.name}::dock"]`) as HTMLElement; ele?.click(); } }); diff --git a/src/libs/components/item-input.tsx b/src/libs/components/item-input.tsx index 82d51b8..56b0d73 100644 --- a/src/libs/components/item-input.tsx +++ b/src/libs/components/item-input.tsx @@ -3,6 +3,7 @@ import { createSignal } from "solid-js"; interface IProps extends ISettingItemCore { changed: (v?: any) => void; nofnSize?: boolean; + flex1?: boolean; } export default function InputItem(props: IProps) { @@ -36,7 +37,7 @@ export default function InputItem(props: IProps) { return ( = (props) => { }}>{props.title}
    - {props?.children} +
    + {props?.children} +
    ) : ( diff --git a/src/style/card-view.scss b/src/style/card-view.scss index a10bc8f..b80b6d4 100644 --- a/src/style/card-view.scss +++ b/src/style/card-view.scss @@ -32,7 +32,7 @@ & .custom-bookmark-item { margin: 5px 8px; & span.b3-list-item__toggle { - padding-left: 12px !important; + padding-left: 5px !important; } } } diff --git a/tsconfig.json b/tsconfig.json index 086e0e8..62962c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "useDefineForClassFields": true, "module": "ESNext", "lib": [ - "ES2020", + "ES2023", "DOM", "DOM.Iterable" ],