orgnote-api 0.40.28 → 0.40.31
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/constants/i18n-keys.d.ts +6 -1
- package/constants/i18n-keys.js +3 -0
- package/models/active-editor-context.d.ts +8 -0
- package/models/active-editor-context.js +1 -0
- package/models/default-commands.d.ts +1 -0
- package/models/default-commands.js +1 -0
- package/models/editor-store.d.ts +5 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/models/repositories.d.ts +0 -15
- package/package.json +1 -1
package/constants/i18n-keys.d.ts
CHANGED
|
@@ -153,7 +153,9 @@ export declare enum i18n {
|
|
|
153
153
|
AUTH_INVALID_CALLBACK_PARAMS = "invalid authentication callback parameters",
|
|
154
154
|
AUTH_REMOVE_ACCOUNT_DESCRIPTION = "permanently delete your account",
|
|
155
155
|
AUTH_GROUP = "auth",
|
|
156
|
-
TABS_COUNT = "tabsCount"
|
|
156
|
+
TABS_COUNT = "tabsCount",
|
|
157
|
+
TOC_NO_ACTIVE_DOCUMENT = "no active document",
|
|
158
|
+
TOC_NO_HEADLINES_FOUND = "no headlines found"
|
|
157
159
|
}
|
|
158
160
|
export declare const I18N: {
|
|
159
161
|
REPORT_BUG: DefaultCommands.REPORT_BUG;
|
|
@@ -168,6 +170,7 @@ export declare const I18N: {
|
|
|
168
170
|
OPEN_BACKLINKS: DefaultCommands.OPEN_BACKLINKS;
|
|
169
171
|
OPEN_OUTLINE: DefaultCommands.OPEN_OUTLINE;
|
|
170
172
|
OPEN_LOCAL_GRAPH: DefaultCommands.OPEN_LOCAL_GRAPH;
|
|
173
|
+
TOGGLE_AST_DEBUGGER: DefaultCommands.TOGGLE_AST_DEBUGGER;
|
|
171
174
|
SEARCH: DefaultCommands.SEARCH;
|
|
172
175
|
TOGGLE_COMMANDS: DefaultCommands.TOGGLE_COMMANDS;
|
|
173
176
|
RESTORE_COMPLETION: DefaultCommands.RESTORE_COMPLETION;
|
|
@@ -386,5 +389,7 @@ export declare const I18N: {
|
|
|
386
389
|
AUTH_REMOVE_ACCOUNT_DESCRIPTION: i18n.AUTH_REMOVE_ACCOUNT_DESCRIPTION;
|
|
387
390
|
AUTH_GROUP: i18n.AUTH_GROUP;
|
|
388
391
|
TABS_COUNT: i18n.TABS_COUNT;
|
|
392
|
+
TOC_NO_ACTIVE_DOCUMENT: i18n.TOC_NO_ACTIVE_DOCUMENT;
|
|
393
|
+
TOC_NO_HEADLINES_FOUND: i18n.TOC_NO_HEADLINES_FOUND;
|
|
389
394
|
};
|
|
390
395
|
export type I18N = i18n | DefaultCommands;
|
package/constants/i18n-keys.js
CHANGED
|
@@ -162,6 +162,9 @@ export var i18n;
|
|
|
162
162
|
i18n["AUTH_GROUP"] = "auth";
|
|
163
163
|
// Tabs
|
|
164
164
|
i18n["TABS_COUNT"] = "tabsCount";
|
|
165
|
+
// TOC
|
|
166
|
+
i18n["TOC_NO_ACTIVE_DOCUMENT"] = "no active document";
|
|
167
|
+
i18n["TOC_NO_HEADLINES_FOUND"] = "no headlines found";
|
|
165
168
|
})(i18n || (i18n = {}));
|
|
166
169
|
export const I18N = {
|
|
167
170
|
...i18n,
|
|
@@ -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";
|
package/models/editor-store.d.ts
CHANGED
|
@@ -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/models/repositories.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExtensionSource } from './extension.js';
|
|
2
|
-
import { FileInfo } from './file-info.js';
|
|
3
2
|
import { FilePathInfo } from './file-path.js';
|
|
4
3
|
import { LayoutSnapshotRepository } from './layout-snapshot-repository.js';
|
|
5
4
|
import { LoggerRepository } from './log-repository.js';
|
|
@@ -15,19 +14,6 @@ export interface ExtensionSourceRepository {
|
|
|
15
14
|
deleteBySource(source: string): Promise<void>;
|
|
16
15
|
clear(): Promise<void>;
|
|
17
16
|
}
|
|
18
|
-
export interface FileInfoRepository {
|
|
19
|
-
upsert(file: FileInfo): Promise<void>;
|
|
20
|
-
bulkUpsert(file: FileInfo[]): Promise<void>;
|
|
21
|
-
update(filePath: string, file: Partial<FileInfo>): Promise<void>;
|
|
22
|
-
delete(filePath: string): Promise<void>;
|
|
23
|
-
markAsDelete(filePath: string, deletedAt?: Date): Promise<void>;
|
|
24
|
-
clear(): Promise<void>;
|
|
25
|
-
search(text: string): Promise<FileInfo[]>;
|
|
26
|
-
getByPath(path: string): Promise<FileInfo | undefined>;
|
|
27
|
-
getAll(): Promise<FileInfo[]>;
|
|
28
|
-
getFilesAfterUpdateTime(updatedTime?: Date): Promise<FileInfo[]>;
|
|
29
|
-
count(updatedTime?: Date): Promise<number>;
|
|
30
|
-
}
|
|
31
17
|
export interface NoteInfoRepository {
|
|
32
18
|
getNotesAfterUpdateTime(updatedTime?: string): Promise<NoteInfo[]>;
|
|
33
19
|
getDeletedNotes(): Promise<NoteInfo[]>;
|
|
@@ -82,7 +68,6 @@ export interface QueueRepository {
|
|
|
82
68
|
}
|
|
83
69
|
export interface Repositories {
|
|
84
70
|
logRepository: LoggerRepository;
|
|
85
|
-
fileInfoRepository: FileInfoRepository;
|
|
86
71
|
noteInfoRepository: NoteInfoRepository;
|
|
87
72
|
layoutSnapshotRepository: LayoutSnapshotRepository;
|
|
88
73
|
queueRepository: QueueRepository;
|