orgnote-api 0.0.19 → 0.0.21

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/README.org CHANGED
@@ -33,7 +33,7 @@ You can find all available methods here. They are currently undocumented.
33
33
  - [[https://github.com/artawower/orgnote][OrgNote entrypoint]]
34
34
  - [[https://org-note.com/][Official website]]
35
35
  - [[https://github.com/Artawower/orgnote-client][Org Note client]]
36
- - [[./EXTENSIONS.org][List of extensions]]
36
+ - [[https://github.com/Artawower/orgnote-extensions][Repository with collection of extensions]]
37
37
  - [[https://github.com/Artawower/org-mode-ast][Typescript abstract syntax tree for org mode.]]
38
38
 
39
39
  * Extension structure
@@ -84,8 +84,8 @@ with =ExtensionManifest=
84
84
  * Extensions example
85
85
  /Themes/
86
86
  - [[https://github.com/Artawower/orgnote-atom-one-dark][Atom One Dark theme (pure js)]]
87
- /UI/ (WIP)
88
- - Colorful Headlines (typescript + API package)
87
+ /UI/
88
+ - [[https://github.com/Artawower/orgnote-colorful-headlines][Colorful Headlines (typescript + API package)]]
89
89
 
90
90
  * Contribute guide
91
91
  Any contribution is very much appreciated! Please read the [[./CONTRIBUTE.org][style guide]] before contributing to avoid misunderstandings!
package/api.ts CHANGED
@@ -1,5 +1,22 @@
1
- import { Command , CSSVariable, ThemeVariable, Note } from './models';
1
+ import {
2
+ Command,
3
+ CSSVariable,
4
+ ThemeVariable,
5
+ Note,
6
+ InlineEmbeddedWidget,
7
+ MultilineEmbeddedWidget,
8
+ OrgLineClass,
9
+ } from './models';
2
10
  import type { NavigationFailure } from 'vue-router';
11
+ import { WidgetType } from './models/widget-type';
12
+ import type { Component } from 'vue';
13
+ import { EmbeddedWidget } from './models';
14
+ import { WidgetBuilder } from './models';
15
+
16
+ export type WidgetMeta =
17
+ | ({ type: WidgetType.Inline } & InlineEmbeddedWidget)
18
+ | ({ type: WidgetType.Multiline } & MultilineEmbeddedWidget)
19
+ | ({ type: WidgetType.LineClass } & OrgLineClass);
3
20
 
4
21
  export interface OrgNoteApi {
5
22
  [key: string]: unknown;
@@ -30,12 +47,13 @@ export interface OrgNoteApi {
30
47
  currentNote: {
31
48
  get: () => Note;
32
49
  };
33
- // hooks: {
34
- // add: () => void;
35
- // };
36
50
  editor: {
37
51
  widgets: {
38
- add: () => void;
52
+ add: (...widgetMeta: WidgetMeta[]) => void;
53
+ createWidgetBuilder: (
54
+ cmp: Component,
55
+ props?: { [key: string]: unknown }
56
+ ) => WidgetBuilder;
39
57
  };
40
58
  };
41
59
  commands: {
@@ -50,21 +68,21 @@ export interface OrgNoteConfig {
50
68
  editor: {
51
69
  showSpecialSymbols: boolean;
52
70
  showPropertyDrawer: boolean;
53
- },
71
+ };
54
72
  common: {
55
73
  developerMode: boolean;
56
74
  maximumLogsCount: number;
57
- },
75
+ };
58
76
  completion: {
59
77
  showGroup: boolean;
60
78
  defaultCompletionLimit: number;
61
- },
79
+ };
62
80
  ui: {
63
81
  theme: 'light' | 'dark';
64
82
  darkThemeName?: string;
65
83
  lightThemeName?: string;
66
- },
84
+ };
67
85
  extensions: {
68
86
  sources: string[];
69
- }
87
+ };
70
88
  }
package/index.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './api';
2
2
  export * from './models';
3
+ import type * as ast from 'org-mode-ast';
4
+ export { ast };
@@ -11,7 +11,7 @@ export interface ExtensionManifest {
11
11
  description?: string;
12
12
  keywords?: string[];
13
13
  // Repository url
14
- sourceType: 'git' | 'file';
14
+ sourceType: 'git' | 'file' | 'builtin';
15
15
  /* Default value is README.org */
16
16
  readmeFilePath?: string;
17
17
  /* WIP */
package/models/index.ts CHANGED
@@ -5,3 +5,4 @@ export * from './extension';
5
5
  export * from './theme-variables';
6
6
  export * from './widget';
7
7
  export * from './modal';
8
+ export * from './widget-type';
@@ -0,0 +1,5 @@
1
+ export enum WidgetType {
2
+ Multiline = 'multiline',
3
+ Inline = 'inline',
4
+ LineClass = 'line-class',
5
+ }
package/models/widget.ts CHANGED
@@ -54,3 +54,6 @@ export type EmbeddedWidgetBuilder = (
54
54
  wrap: HTMLElement,
55
55
  dynamicProps?: { [key: string]: unknown }
56
56
  ) => EmbeddedWidget;
57
+
58
+ export type OrgLineClass = { class: string | ((orgNode: OrgNode) => string) };
59
+ export type OrgLineClasses = { [key in NodeType]?: OrgLineClass };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orgnote-api",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Official API for creating extensions for OrgNote app",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -22,13 +22,7 @@
22
22
  ".": "./index.ts",
23
23
  "./remote-api": "./remote-api/index.ts"
24
24
  },
25
- "keywords": [
26
- "orgnote",
27
- "org-mode",
28
- "org-roam",
29
- "api",
30
- "extensions"
31
- ],
25
+ "keywords": ["orgnote", "org-mode", "org-roam", "api", "extensions"],
32
26
  "author": "darkawower <app.orgnote@gmail.com> (https://org-note.com)",
33
27
  "license": "GPL-3.0-or-later",
34
28
  "bugs": {
@@ -39,6 +33,7 @@
39
33
  "axios": "1.6.7",
40
34
  "codemirror": "6.0.1",
41
35
  "org-mode-ast": "0.11.2",
36
+ "vue": "^3.4.15",
42
37
  "vue-router": "4.2.5"
43
38
  },
44
39
  "devDependencies": {