orgnote-api 0.40.35 → 0.40.38

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/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { InlineEmbeddedWidget, MultilineEmbeddedWidget, OrgLineClass, SyncStoreDefinition, FileReaderStoreDefinition, CommandsStoreDefinition, CommandsGroupStoreDefinition, ModalStoreDefinition, SettingsStoreDefinition, SettingsUiStoreDefinition, MultipleUploadParams, UploadParams, CompletionStoreDefinition, PaneStoreDefinition, LayoutStoreDefinition, FileManagerStoreDefinition, UseScreenDetection, NotificationsStoreDefinition, BufferStoreDefinition, Repositories, LogStoreDefinition, UseSystemInfo, ContextMenuStoreDefinition, QueueStoreDefinition, FileGuardStoreDefinition, FileWatcherStoreDefinition, BuildOrgNoteUrl, AuthStoreDefinition, FileSearchStoreDefinition, FileMetaStoreDefinition } from './models/index.js';
1
+ import { InlineEmbeddedWidget, MultilineEmbeddedWidget, OrgLineClass, SyncStoreDefinition, FileReaderStoreDefinition, CommandsStoreDefinition, CommandsGroupStoreDefinition, ModalStoreDefinition, SettingsStoreDefinition, SettingsUiStoreDefinition, MultipleUploadParams, UploadParams, CompletionStoreDefinition, PaneStoreDefinition, LayoutStoreDefinition, FileManagerStoreDefinition, UseScreenDetection, UseKeyboardState, NotificationsStoreDefinition, BufferStoreDefinition, Repositories, LogStoreDefinition, UseSystemInfo, ContextMenuStoreDefinition, QueueStoreDefinition, FileGuardStoreDefinition, FileWatcherStoreDefinition, BuildOrgNoteUrl, AuthStoreDefinition, FileSearchStoreDefinition, FileMetaStoreDefinition, FontStoreDefinition } from './models/index.js';
2
2
  import { WebSocketClient } from './websocket/client.js';
3
3
  import { WidgetType } from './models/widget-type.js';
4
4
  import { NodeType } from 'org-mode-ast';
@@ -14,7 +14,7 @@ import { GetCssVar, GetCssTheme, GetNumericCssVar, GetCssProperty, GetCssNumeric
14
14
  import { ThemeStoreDefinition } from './models/theme-store.js';
15
15
  import { UseBackgroundSettings } from './models/ui-store.js';
16
16
  import { SidebarStoreDefinition } from './models/sidebar-store.js';
17
- import { RightPanelStoreDefinition } from './models/right-panel-store.js';
17
+ import { RightSidebarStoreDefinition } from './models/right-sidebar-store.js';
18
18
  import { Logger } from './models/logger.js';
19
19
  import type { QVueGlobals } from 'quasar';
20
20
  import { PinnedCommandsStoreDefinition } from './models/pinned-commands-store.js';
@@ -102,15 +102,17 @@ export interface OrgNoteApi {
102
102
  buildOrgNoteUrl: BuildOrgNoteUrl;
103
103
  };
104
104
  ui: {
105
+ useFonts: FontStoreDefinition;
105
106
  useSplashScreen: UseSplashScreen;
106
107
  useBackgroundSettings: UseBackgroundSettings;
107
108
  useSidebar: SidebarStoreDefinition;
108
- useRightPanel: RightPanelStoreDefinition;
109
+ useRightSidebar: RightSidebarStoreDefinition;
109
110
  usePinnedCommands: PinnedCommandsStoreDefinition;
110
111
  useModal: ModalStoreDefinition;
111
112
  useSettingsUi: SettingsUiStoreDefinition;
112
113
  useConfirmationModal: UseConfirmationModal;
113
114
  useScreenDetection: UseScreenDetection;
115
+ useKeyboardState: UseKeyboardState;
114
116
  useContextMenu: ContextMenuStoreDefinition;
115
117
  useTheme: ThemeStoreDefinition;
116
118
  };
@@ -134,6 +134,7 @@ export declare enum i18n {
134
134
  SELECT_COMMAND = "select command",
135
135
  CONFIRM_CLEAR_LOGS = "confirm clear logs",
136
136
  SYSTEM_INFO = "system info",
137
+ FONTS = "fonts",
137
138
  FILE_DELETED_EXTERNALLY = "file was deleted externally",
138
139
  IMAGE_LOAD_FAILED = "failed to load image",
139
140
  IMAGE_NOT_FOUND = "image not found",
@@ -165,10 +166,14 @@ export declare const I18N: {
165
166
  SHOW_LOGS: DefaultCommands.SHOW_LOGS;
166
167
  CLEAR_LOGS: DefaultCommands.CLEAR_LOGS;
167
168
  TOGGLE_SIDEBAR: DefaultCommands.TOGGLE_SIDEBAR;
169
+ CLOSE_SIDEBAR: DefaultCommands.CLOSE_SIDEBAR;
170
+ OPEN_SIDEBAR: DefaultCommands.OPEN_SIDEBAR;
168
171
  TOGGLE_FILE_MANAGER: DefaultCommands.TOGGLE_FILE_MANAGER;
169
172
  CREATE_NOTE: DefaultCommands.CREATE_NOTE;
170
173
  PROJECT_INFO: DefaultCommands.PROJECT_INFO;
171
- TOGGLE_RIGHT_PANEL: DefaultCommands.TOGGLE_RIGHT_PANEL;
174
+ TOGGLE_RIGHT_SIDEBAR: DefaultCommands.TOGGLE_RIGHT_SIDEBAR;
175
+ OPEN_RIGHT_SIDEBAR: DefaultCommands.OPEN_RIGHT_SIDEBAR;
176
+ CLOSE_RIGHT_SIDEBAR: DefaultCommands.CLOSE_RIGHT_SIDEBAR;
172
177
  OPEN_BACKLINKS: DefaultCommands.OPEN_BACKLINKS;
173
178
  OPEN_OUTLINE: DefaultCommands.OPEN_OUTLINE;
174
179
  OPEN_LOCAL_GRAPH: DefaultCommands.OPEN_LOCAL_GRAPH;
@@ -395,6 +400,7 @@ export declare const I18N: {
395
400
  SELECT_COMMAND: i18n.SELECT_COMMAND;
396
401
  CONFIRM_CLEAR_LOGS: i18n.CONFIRM_CLEAR_LOGS;
397
402
  SYSTEM_INFO: i18n.SYSTEM_INFO;
403
+ FONTS: i18n.FONTS;
398
404
  FILE_DELETED_EXTERNALLY: i18n.FILE_DELETED_EXTERNALLY;
399
405
  IMAGE_LOAD_FAILED: i18n.IMAGE_LOAD_FAILED;
400
406
  IMAGE_NOT_FOUND: i18n.IMAGE_NOT_FOUND;
@@ -137,6 +137,7 @@ export var i18n;
137
137
  i18n["SELECT_COMMAND"] = "select command";
138
138
  i18n["CONFIRM_CLEAR_LOGS"] = "confirm clear logs";
139
139
  i18n["SYSTEM_INFO"] = "system info";
140
+ i18n["FONTS"] = "fonts";
140
141
  // Buffer
141
142
  i18n["FILE_DELETED_EXTERNALLY"] = "file was deleted externally";
142
143
  // Images
@@ -6,4 +6,5 @@ export interface ActiveEditorContext {
6
6
  selection: string;
7
7
  editorViewGetter: () => EditorView | undefined;
8
8
  filePath?: string;
9
+ focused: boolean;
9
10
  }
@@ -4,10 +4,14 @@ export declare enum DefaultCommands {
4
4
  SHOW_LOGS = "show logs",
5
5
  CLEAR_LOGS = "clear logs",
6
6
  TOGGLE_SIDEBAR = "toggle sidebar",
7
+ CLOSE_SIDEBAR = "close sidebar",
8
+ OPEN_SIDEBAR = "open sidebar",
7
9
  TOGGLE_FILE_MANAGER = "toggle file manager",
8
10
  CREATE_NOTE = "create note",
9
11
  PROJECT_INFO = "project info",
10
- TOGGLE_RIGHT_PANEL = "toggle right panel",
12
+ TOGGLE_RIGHT_SIDEBAR = "toggle right sidebar",
13
+ OPEN_RIGHT_SIDEBAR = "open right sidebar",
14
+ CLOSE_RIGHT_SIDEBAR = "close right sidebar",
11
15
  OPEN_BACKLINKS = "open backlinks",
12
16
  OPEN_OUTLINE = "open outline",
13
17
  OPEN_LOCAL_GRAPH = "open local graph",
@@ -11,11 +11,15 @@ export var DefaultCommands;
11
11
  DefaultCommands["SHOW_LOGS"] = "show logs";
12
12
  DefaultCommands["CLEAR_LOGS"] = "clear logs";
13
13
  DefaultCommands["TOGGLE_SIDEBAR"] = "toggle sidebar";
14
+ DefaultCommands["CLOSE_SIDEBAR"] = "close sidebar";
15
+ DefaultCommands["OPEN_SIDEBAR"] = "open sidebar";
14
16
  DefaultCommands["TOGGLE_FILE_MANAGER"] = "toggle file manager";
15
17
  DefaultCommands["CREATE_NOTE"] = "create note";
16
18
  DefaultCommands["PROJECT_INFO"] = "project info";
17
19
  // Right panel
18
- DefaultCommands["TOGGLE_RIGHT_PANEL"] = "toggle right panel";
20
+ DefaultCommands["TOGGLE_RIGHT_SIDEBAR"] = "toggle right sidebar";
21
+ DefaultCommands["OPEN_RIGHT_SIDEBAR"] = "open right sidebar";
22
+ DefaultCommands["CLOSE_RIGHT_SIDEBAR"] = "close right sidebar";
19
23
  DefaultCommands["OPEN_BACKLINKS"] = "open backlinks";
20
24
  DefaultCommands["OPEN_OUTLINE"] = "open outline";
21
25
  DefaultCommands["OPEN_LOCAL_GRAPH"] = "open local graph";
@@ -16,7 +16,7 @@ export interface EditorStore {
16
16
  removeExtensions: (...extensions: EditorExtension[]) => void;
17
17
  selection: ComputedRef<string>;
18
18
  hasSelection: ComputedRef<boolean>;
19
- setActiveContext: (ctx: ActiveEditorContext) => void;
19
+ setActiveContext: (ctx: Partial<ActiveEditorContext>) => void;
20
20
  updateActiveContext: (ctx: Partial<ActiveEditorContext>) => void;
21
21
  clearActiveContext: () => void;
22
22
  }
@@ -0,0 +1,29 @@
1
+ import type { Ref } from 'vue';
2
+ import type { StoreDefinition } from './store.js';
3
+ export type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
4
+ export type FontStyle = 'normal' | 'italic' | 'oblique';
5
+ export type FontCategory = 'main' | 'editor' | 'headline' | 'code';
6
+ export interface FontDefinition {
7
+ id: string;
8
+ name: string;
9
+ family: string;
10
+ src?: string;
11
+ filePath?: string;
12
+ weight?: string | number;
13
+ style?: FontStyle;
14
+ display?: FontDisplay;
15
+ }
16
+ export interface FontCategoryConfig {
17
+ main: string;
18
+ editor: string;
19
+ headline: string;
20
+ code: string;
21
+ }
22
+ export interface FontStore {
23
+ availableFonts: Ref<FontDefinition[]>;
24
+ activeFonts: Ref<FontCategoryConfig>;
25
+ registerFont: (font: FontDefinition) => void;
26
+ unregisterFont: (fontId: string) => void;
27
+ sync: () => Promise<void>;
28
+ }
29
+ export type FontStoreDefinition = StoreDefinition<FontStore>;
package/models/index.d.ts CHANGED
@@ -40,6 +40,7 @@ export * from './file-guard-store.js';
40
40
  export * from './splash-screen.js';
41
41
  export * from './screen-detection.js';
42
42
  export * from './system-info.js';
43
+ export * from './keyboard-state.js';
43
44
  export * from './sync-store.js';
44
45
  export * from './files-store.js';
45
46
  export * from './file-opener-store.js';
@@ -55,7 +56,7 @@ export * from './encryption-store.js';
55
56
  export * from './ui-store.js';
56
57
  export * from './sidebar-store.js';
57
58
  export * from './panel.js';
58
- export * from './right-panel-store.js';
59
+ export * from './right-sidebar-store.js';
59
60
  export * from './pinned-commands-store.js';
60
61
  export * from './modal-store.js';
61
62
  export * from './settings-ui-store.js';
@@ -76,6 +77,7 @@ export * from './cron-store.js';
76
77
  export * from './git-store.js';
77
78
  export * from './extension-registry-store.js';
78
79
  export * from './theme-store.js';
80
+ export * from './font-store.js';
79
81
  export * from './file-search-store.js';
80
82
  export * from './file-meta-store.js';
81
83
  export * from './style-variant.js';
package/models/index.js CHANGED
@@ -41,6 +41,7 @@ export * from "./file-guard-store.js";
41
41
  export * from "./splash-screen.js";
42
42
  export * from "./screen-detection.js";
43
43
  export * from "./system-info.js";
44
+ export * from "./keyboard-state.js";
44
45
  // Stores
45
46
  export * from "./sync-store.js";
46
47
  export * from "./files-store.js";
@@ -57,7 +58,7 @@ export * from "./encryption-store.js";
57
58
  export * from "./ui-store.js";
58
59
  export * from "./sidebar-store.js";
59
60
  export * from "./panel.js";
60
- export * from "./right-panel-store.js";
61
+ export * from "./right-sidebar-store.js";
61
62
  export * from "./pinned-commands-store.js";
62
63
  export * from "./modal-store.js";
63
64
  export * from "./settings-ui-store.js";
@@ -78,6 +79,7 @@ export * from "./cron-store.js";
78
79
  export * from "./git-store.js";
79
80
  export * from "./extension-registry-store.js";
80
81
  export * from "./theme-store.js";
82
+ export * from "./font-store.js";
81
83
  export * from "./file-search-store.js";
82
84
  export * from "./file-meta-store.js";
83
85
  // UI
@@ -0,0 +1,6 @@
1
+ import type { Ref } from 'vue';
2
+ export interface KeyboardState {
3
+ keyboardOpened: Readonly<Ref<boolean>>;
4
+ keyboardHeight: Readonly<Ref<number>>;
5
+ }
6
+ export type UseKeyboardState = () => KeyboardState;
@@ -0,0 +1 @@
1
+ export {};
@@ -33,6 +33,12 @@ export declare const ORG_NOTE_CONFIG_SCHEMA: import("valibot").SchemaWithPipe<re
33
33
  readonly persistantPanes: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
34
34
  readonly persistantPanesSaveDelay: import("valibot").NumberSchema<undefined>;
35
35
  readonly dropZoneEdgeRatio: import("valibot").NumberSchema<undefined>;
36
+ readonly fonts: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
37
+ readonly main: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
38
+ readonly editor: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
39
+ readonly headline: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
40
+ readonly code: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
41
+ }, undefined>, undefined>;
36
42
  }, undefined>;
37
43
  readonly fileReaders: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
38
44
  readonly preferredReaders: import("valibot").OptionalSchema<import("valibot").ObjectWithRestSchema<{}, import("valibot").StringSchema<undefined>, undefined>, undefined>;
@@ -34,6 +34,12 @@ export const ORG_NOTE_CONFIG_SCHEMA = pipe(objectWithRest({
34
34
  persistantPanes: optional(boolean()),
35
35
  persistantPanesSaveDelay: number(),
36
36
  dropZoneEdgeRatio: number(),
37
+ fonts: optional(object({
38
+ main: optional(string()),
39
+ editor: optional(string()),
40
+ headline: optional(string()),
41
+ code: optional(string()),
42
+ })),
37
43
  }),
38
44
  fileReaders: optional(object({
39
45
  preferredReaders: optional(objectWithRest({}, string())),
package/models/panel.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Ref, ShallowRef } from 'vue';
2
2
  import type { VueComponent } from './vue-component.js';
3
3
  import type { ComponentConfig } from './sidebar-store.js';
4
- export interface Panel {
4
+ export interface Sidebar {
5
5
  opened: Ref<boolean>;
6
6
  component: ShallowRef<VueComponent | undefined>;
7
7
  componentConfig: ShallowRef<ComponentConfig<VueComponent> | undefined>;
@@ -0,0 +1,8 @@
1
+ import type { Ref } from 'vue';
2
+ import type { StoreDefinition } from './store.js';
3
+ import type { Sidebar } from './panel.js';
4
+ export interface RightSidebarStore extends Sidebar {
5
+ width: Ref<number>;
6
+ setWidth: (width: number) => void;
7
+ }
8
+ export type RightSidebarStoreDefinition = StoreDefinition<RightSidebarStore>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,11 @@
1
1
  import type { ExtractPropTypes } from 'vue';
2
2
  import type { StoreDefinition } from './store.js';
3
3
  import type { VueComponent } from './vue-component.js';
4
- import type { Panel } from './panel.js';
4
+ import type { Sidebar } from './panel.js';
5
5
  export type ComponentConfig<T extends VueComponent> = {
6
6
  componentProps?: ExtractPropTypes<T>;
7
7
  };
8
- export interface SidebarStore extends Panel {
8
+ export interface SidebarStore extends Sidebar {
9
9
  toggle: (cmp?: VueComponent) => void;
10
10
  }
11
11
  export type SidebarStoreDefinition = StoreDefinition<SidebarStore>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.40.35",
3
+ "version": "0.40.38",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -1,8 +0,0 @@
1
- import type { Ref } from 'vue';
2
- import type { StoreDefinition } from './store.js';
3
- import type { Panel } from './panel.js';
4
- export interface RightPanelStore extends Panel {
5
- width: Ref<number>;
6
- setWidth: (width: number) => void;
7
- }
8
- export type RightPanelStoreDefinition = StoreDefinition<RightPanelStore>;
File without changes