siyuan 1.0.9 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## v1.1.0 2025-03
3
+ ## v1.1.2 2025-05
4
+
5
+ ## v1.1.1 2025-04-08
6
+
7
+ * [Add plugin function `globalCommand`](https://github.com/siyuan-note/siyuan/issues/14499)
8
+ * [Add plugin function `openAttributePanel`](https://github.com/siyuan-note/siyuan/issues/14276)
9
+
10
+ ## v1.1.0 2025-03-04
11
+
12
+ * [Support floating window `Open in New Tab`](https://github.com/siyuan-note/siyuan/issues/11801)
13
+ * [Add `data-id` attribute to the buttons](https://github.com/siyuan-note/siyuan/pull/14182)
14
+ * [Upgrade to Graphviz v3.11.0](https://github.com/siyuan-note/siyuan/issues/13852)
15
+ * [Add parameter `nodeElement` to `protyleSlash.callback`](https://github.com/siyuan-note/siyuan/issues/14036)
4
16
 
5
17
  ## v1.0.9 2025-02-11
6
18
 
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "README.md",
13
13
  "siyuan.d.ts"
14
14
  ],
15
- "version": "1.0.9",
15
+ "version": "1.1.1",
16
16
  "repository": {
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/siyuan-note/petal.git"
package/siyuan.d.ts CHANGED
@@ -276,6 +276,7 @@ export function openTab(options: {
276
276
  position?: "right" | "bottom";
277
277
  keepCursor?: boolean; // 是否跳转到新 tab 上
278
278
  removeCurrentTab?: boolean; // 在当前页签打开时需移除原有页签
279
+ openNewTab?: boolean // 使用新页签打开
279
280
  afterOpen?: () => void; // 打开后回调
280
281
  }): Promise<Tab>
281
282
 
@@ -308,7 +309,27 @@ export function openSetting(app: App): Dialog | undefined;
308
309
  export function getModelByDockType(type: TDock | string): Model | any;
309
310
 
310
311
  /**
311
- * @param timeout - ms. 0: manual close;-1: always show; 6000: default
312
+ * @param {IObject} [options.data] - 块属性值
313
+ * @param {HTMLElement} [options.nodeElement] - 块元素
314
+ * @param {"bookmark" | "name" | "alias" | "memo" | "av" | "custom"} [options.focusName="bookmark"] - av 为数据库页签,custom 为自定义页签,其余为内置输入框
315
+ * @param {IProtyle} [options.protyle] - 有数据库时需要传入 protyle
316
+ */
317
+ export function openAttributePanel(options: {
318
+ data?: IObject
319
+ nodeElement?: HTMLElement,
320
+ focusName: "bookmark" | "name" | "alias" | "memo" | "av" | "custom",
321
+ protyle?: IProtyle,
322
+ }): void;
323
+
324
+ /**
325
+ * 全局命令
326
+ * @param {string} command - 命令名称 https://github.com/siyuan-note/siyuan/blob/master/app/src/boot/globalEvent/command/global.ts#L71
327
+ * @param {App} app
328
+ */
329
+ export function globalCommand(command: string, app: App): void;
330
+
331
+ /**
332
+ * @param {number} [timeout=6000] - ms. 0: manual close;-1: always show;
312
333
  * @param {string} [type=info]
313
334
  */
314
335
  export function showMessage(text: string, timeout?: number, type?: "info" | "error", id?: string): void;
@@ -326,7 +347,7 @@ export abstract class Plugin {
326
347
  filter: string[],
327
348
  html: string,
328
349
  id: string,
329
- callback(protyle: Protyle): void,
350
+ callback(protyle: Protyle, nodeElement: HTMLElement): void,
330
351
  }[];
331
352
  protyleOptions: IProtyleOptions;
332
353
 
@@ -495,7 +516,11 @@ export class Menu {
495
516
 
496
517
  addItem(option: IMenu): HTMLElement;
497
518
 
498
- addSeparator(index?: number, ignore?: boolean): HTMLElement;
519
+ addSeparator(options?: {
520
+ index?: number,
521
+ id?: string,
522
+ ignore?: boolean
523
+ }): HTMLElement;
499
524
 
500
525
  open(options: IPosition): void;
501
526
 
package/types/index.d.ts CHANGED
@@ -420,7 +420,7 @@ export declare class subMenu {
420
420
 
421
421
  constructor();
422
422
 
423
- addSeparator(index?: number): void;
423
+ addSeparator(index?: number, id?: string): void;
424
424
 
425
425
  addItem(menu: IMenu): void;
426
426
  }
@@ -432,7 +432,9 @@ export declare class App {
432
432
 
433
433
  export declare class Menus {
434
434
  menu: Menu;
435
+
435
436
  constructor(app: App);
437
+
436
438
  private getDir;
437
439
  private unselect;
438
440
  }
@@ -174,9 +174,9 @@ export interface IProtyle {
174
174
  }
175
175
 
176
176
  declare class Viz {
177
- constructor(worker: { worker: Worker });
177
+ public static instance(): Promise<Viz>;
178
178
 
179
- renderSVGElement: (code: string) => Promise<any>;
179
+ renderSVGElement: (code: string) => SVGElement;
180
180
  }
181
181
 
182
182
  declare class Viewer {