orgnote-api 0.40.28 → 0.40.29

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.
@@ -168,6 +168,7 @@ export declare const I18N: {
168
168
  OPEN_BACKLINKS: DefaultCommands.OPEN_BACKLINKS;
169
169
  OPEN_OUTLINE: DefaultCommands.OPEN_OUTLINE;
170
170
  OPEN_LOCAL_GRAPH: DefaultCommands.OPEN_LOCAL_GRAPH;
171
+ TOGGLE_AST_DEBUGGER: DefaultCommands.TOGGLE_AST_DEBUGGER;
171
172
  SEARCH: DefaultCommands.SEARCH;
172
173
  TOGGLE_COMMANDS: DefaultCommands.TOGGLE_COMMANDS;
173
174
  RESTORE_COMPLETION: DefaultCommands.RESTORE_COMPLETION;
@@ -0,0 +1,8 @@
1
+ import type { OrgNode } from 'org-mode-ast';
2
+ import type { EditorView } from '@codemirror/view';
3
+ export interface ActiveEditorContext {
4
+ orgNode: OrgNode | null;
5
+ cursorPosition: number;
6
+ editorViewGetter: () => EditorView | undefined;
7
+ filePath?: string;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -11,6 +11,7 @@ export declare enum DefaultCommands {
11
11
  OPEN_BACKLINKS = "open backlinks",
12
12
  OPEN_OUTLINE = "open outline",
13
13
  OPEN_LOCAL_GRAPH = "open local graph",
14
+ TOGGLE_AST_DEBUGGER = "toggle ast debugger",
14
15
  SEARCH = "search",
15
16
  TOGGLE_COMMANDS = "toggle commands",
16
17
  RESTORE_COMPLETION = "restore last completion",
@@ -19,6 +19,7 @@ export var DefaultCommands;
19
19
  DefaultCommands["OPEN_BACKLINKS"] = "open backlinks";
20
20
  DefaultCommands["OPEN_OUTLINE"] = "open outline";
21
21
  DefaultCommands["OPEN_LOCAL_GRAPH"] = "open local graph";
22
+ DefaultCommands["TOGGLE_AST_DEBUGGER"] = "toggle ast debugger";
22
23
  // Completion commands
23
24
  DefaultCommands["SEARCH"] = "search";
24
25
  DefaultCommands["TOGGLE_COMMANDS"] = "toggle commands";
@@ -3,14 +3,19 @@ import type { InlineEmbeddedWidgets, MultilineEmbeddedWidgets, OrgLineClasses }
3
3
  import type { EditorExtension } from './editor.js';
4
4
  import type { WidgetMeta } from '../api.js';
5
5
  import type { StoreDefinition } from './store.js';
6
+ import type { ActiveEditorContext } from './active-editor-context.js';
6
7
  export interface EditorStore {
7
8
  inlineWidgets: ComputedRef<InlineEmbeddedWidgets>;
8
9
  multilineWidgets: ComputedRef<MultilineEmbeddedWidgets>;
9
10
  lineClasses: ComputedRef<OrgLineClasses>;
10
11
  extensions: ShallowRef<EditorExtension[]>;
12
+ activeContext: ShallowRef<ActiveEditorContext | null>;
11
13
  addWidgets: (...widgets: WidgetMeta[]) => void;
12
14
  removeWidget: (widgetId: string) => void;
13
15
  addExtensions: (...extensions: EditorExtension[]) => void;
14
16
  removeExtensions: (...extensions: EditorExtension[]) => void;
17
+ setActiveContext: (ctx: ActiveEditorContext) => void;
18
+ updateActiveContext: (ctx: Partial<ActiveEditorContext>) => void;
19
+ clearActiveContext: () => void;
15
20
  }
16
21
  export type EditorStoreDefinition = StoreDefinition<EditorStore>;
package/models/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './widget.js';
7
7
  export * from './modal.js';
8
8
  export * from './widget-type.js';
9
9
  export * from './editor.js';
10
+ export * from './active-editor-context.js';
10
11
  export * from './default-commands.js';
11
12
  export * from './encryption.js';
12
13
  export * from './file-system.js';
package/models/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./widget.js";
7
7
  export * from "./modal.js";
8
8
  export * from "./widget-type.js";
9
9
  export * from "./editor.js";
10
+ export * from "./active-editor-context.js";
10
11
  export * from "./default-commands.js";
11
12
  export * from "./encryption.js";
12
13
  export * from "./file-system.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.40.28",
3
+ "version": "0.40.29",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.js",