Skip to content

Commit 12e5370

Browse files
committed
update deps; clean up code
1 parent 7440d58 commit 12e5370

19 files changed

+360
-298
lines changed

CHANGELOG.md

Lines changed: 180 additions & 180 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ You are more than welcome to open an issue on [GitHub](https://github.com/mProje
4848

4949
I want to thank the following people:
5050

51-
- blacksmithgu for the Dataview type definitions
52-
- Daniel (dbarenholz) for his contributions to the plugin and the docs
53-
- koala (kometenstaub) for help with CodeMirror
54-
- sailKite for help with CSS
55-
- Sigrunixia for enabling me to work on the Obsidian Publish version of the plugin
56-
- Zachatoo and SilentVoid13 for the Templater type definitions
51+
- blacksmithgu for the Dataview type definitions
52+
- Daniel (dbarenholz) for his contributions to the plugin and the docs
53+
- koala (kometenstaub) for help with CodeMirror
54+
- sailKite for help with CSS
55+
- Sigrunixia for enabling me to work on the Obsidian Publish version of the plugin
56+
- Zachatoo and SilentVoid13 for the Templater type definitions
5757

58-
- All the contributors to the plugin and the docs
59-
- All the authors of the libraries used in the plugin
60-
- Everyone who has given feedback and suggestions
58+
- All the contributors to the plugin and the docs
59+
- All the authors of the libraries used in the plugin
60+
- Everyone who has given feedback and suggestions
6161

6262
## Contributions
6363

@@ -70,10 +70,10 @@ Contributions are always welcome. If you have an idea, feel free to open a featu
7070
The plugin uses [Bun](https://bun.sh/) instead of Node.js/NPM to manage dependencies.
7171
To install the dependencies, run `bun install` and `bun run pack:i` in the root directory of the project.
7272

73-
- `bun run dev` will build the plugin in dev mode and watch for changes. The plugin builds directly into the example vault inside of this repo.
74-
- `bun run build` will build the plugin in production mode. The plugin builds into the root of this repo.
75-
- `bun run test` will run the tests.
76-
- `bun run check` will check for formatting, linting, type errors and run the tests.
77-
- `bun run check:fix` will fix formatting and linting errors, check for type errors and run the tests.
73+
- `bun run dev` will build the plugin in dev mode and watch for changes. The plugin builds directly into the example vault inside of this repo.
74+
- `bun run build` will build the plugin in production mode. The plugin builds into the root of this repo.
75+
- `bun run test` will run the tests.
76+
- `bun run check` will check for formatting, linting, type errors and run the tests.
77+
- `bun run check:fix` will fix formatting and linting errors, check for type errors and run the tests.
7878

7979
`bun run check` should run successfully before creating a pull request.

bun.lockb

-19.9 KB
Binary file not shown.

exampleVault/Examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
slider1: 3
2+
slider1: 5
33
suggest: test
44
toggle1: false
55
Domestic_tasks:
@@ -13,7 +13,7 @@ inlineSelect: 1
1313
nested:
1414
object: test
1515
number1: 2
16-
number2: 4
16+
number2: 18
1717
time:
1818
---
1919

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,35 @@
3232
"@elysiajs/cors": "^1.1.1",
3333
"@happy-dom/global-registrator": "^14.12.3",
3434
"@tsconfig/svelte": "^5.0.4",
35-
"@types/bun": "^1.1.13",
35+
"@types/bun": "^1.1.14",
3636
"builtin-modules": "^4.0.0",
37-
"elysia": "^1.1.24",
37+
"elysia": "^1.1.25",
3838
"esbuild": "^0.24.0",
3939
"esbuild-plugin-copy-watch": "^2.3.1",
4040
"esbuild-svelte": "^0.8.2",
41-
"eslint": "^9.14.0",
41+
"eslint": "^9.15.0",
4242
"eslint-plugin-import": "^2.31.0",
4343
"eslint-plugin-isaacscript": "^4.0.0",
4444
"eslint-plugin-no-relative-import-paths": "^1.5.5",
4545
"eslint-plugin-only-warn": "^1.1.0",
4646
"eslint-plugin-svelte": "^2.46.0",
47-
"prettier": "^3.3.3",
48-
"prettier-plugin-svelte": "^3.2.7",
47+
"prettier": "^3.4.0",
48+
"prettier-plugin-svelte": "^3.3.2",
4949
"string-argv": "^0.3.2",
50-
"svelte-check": "^4.0.5",
50+
"svelte-check": "^4.1.0",
5151
"svelte-preprocess": "^6.0.3",
5252
"tslib": "^2.8.1",
53-
"typescript": "^5.6.3",
54-
"typescript-eslint": "^8.13.0",
55-
"yaml": "^2.6.0"
53+
"typescript": "^5.7.2",
54+
"typescript-eslint": "^8.16.0",
55+
"yaml": "^2.6.1"
5656
},
5757
"dependencies": {
5858
"@codemirror/legacy-modes": "^6.4.2",
5959
"@lemons_dev/parsinom": "^0.0.12",
6060
"itertools-ts": "^1.27.1",
61-
"mathjs": "^13.2.0",
61+
"mathjs": "^14.0.0",
6262
"moment": "^2.30.1",
63-
"svelte": "^5.1.9",
63+
"svelte": "^5.2.8",
6464
"zod": "^3.23.8",
6565
"zod-validation-error": "^3.4.0"
6666
},

packages/core/src/api/API.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
import { SyntaxHighlightingAPI } from 'packages/core/src/api/SyntaxHighlightingAPI';
2-
import {
3-
V_BindTargetDeclaration,
4-
V_BindTargetScope,
5-
V_ButtonOptions,
6-
V_EmbedOptions,
7-
V_FieldType,
8-
V_FilePath,
9-
V_InlineButtonOptions,
10-
V_InputFieldOptions,
11-
V_JsViewFieldOptions,
12-
V_RenderChildType,
13-
V_TableFieldOptions,
14-
V_ViewFieldOptions,
15-
} from 'packages/core/src/api/Validators';
162
import type {
173
ButtonGroupOptions,
184
ButtonOptions,
@@ -30,6 +16,20 @@ import {
3016
NotePosition,
3117
RenderChildType,
3218
} from 'packages/core/src/config/APIConfigs';
19+
import {
20+
V_BindTargetDeclaration,
21+
V_BindTargetScope,
22+
V_ButtonOptions,
23+
V_EmbedOptions,
24+
V_FieldType,
25+
V_FilePath,
26+
V_InlineButtonOptions,
27+
V_InputFieldOptions,
28+
V_JsViewFieldOptions,
29+
V_RenderChildType,
30+
V_TableFieldOptions,
31+
V_ViewFieldOptions,
32+
} from 'packages/core/src/config/validators/Validators';
3333
import { ButtonActionRunner } from 'packages/core/src/fields/button/ButtonActionRunner';
3434
import { ButtonGroupMountable } from 'packages/core/src/fields/button/ButtonGroupMountable';
3535
import { ButtonManager } from 'packages/core/src/fields/button/ButtonManager';

packages/core/src/config/ButtonConfig.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import type { LinePosition } from 'packages/core/src/config/APIConfigs';
22

33
export enum ButtonStyleType {
4+
/**
5+
* Default grey button
6+
*/
47
DEFAULT = 'default',
8+
/**
9+
* Primary button in the accent color
10+
*/
511
PRIMARY = 'primary',
12+
/**
13+
* Red button for destructive actions
14+
*/
615
DESTRUCTIVE = 'destructive',
16+
/**
17+
* Plain button with no background
18+
*/
719
PLAIN = 'plain',
820
}
921

@@ -123,14 +135,52 @@ export type ButtonAction =
123135
| InlineJSButtonAction;
124136

125137
export interface ButtonConfig {
138+
/**
139+
* The text displayed on the button
140+
*/
126141
label: string;
142+
/**
143+
* Optional icon to display in front of the label
144+
*/
127145
icon?: string;
146+
/**
147+
* The style of the button
148+
*/
128149
style: ButtonStyleType;
150+
/**
151+
* Optional CSS class to add to the button
152+
*/
129153
class?: string;
154+
/**
155+
* Optional CSS styles to add to the button
156+
*/
157+
cssStyle?: string;
158+
/**
159+
* Optional background image to add to the button,
160+
* needed since you can't load images from the vault via pure CSS
161+
*/
162+
backgroundImage?: string;
163+
/**
164+
* Optional tooltip to display when hovering over the button
165+
*/
130166
tooltip?: string;
167+
/**
168+
* Optional ID for use in inline buttons
169+
*/
131170
id?: string;
171+
/**
172+
* Whether the button is hidden
173+
*/
132174
hidden?: boolean;
175+
/**
176+
* A single action to run when the button is clicked
177+
* Mutually exclusive with `actions`
178+
*/
133179
action?: ButtonAction;
180+
/**
181+
* Multiple actions to run when the button is clicked
182+
* Mutually exclusive with `action`
183+
*/
134184
actions?: ButtonAction[];
135185
}
136186

@@ -140,6 +190,9 @@ export interface ButtonContext {
140190
isInline: boolean;
141191
}
142192

193+
/**
194+
* Provides information about the button click event.
195+
*/
143196
export interface ButtonClickContext {
144197
type: ButtonClickType;
145198
shiftKey: boolean;
@@ -148,10 +201,19 @@ export interface ButtonClickContext {
148201
}
149202

150203
export enum ButtonClickType {
204+
/**
205+
* The user used the left mouse button to click the button
206+
*/
151207
LEFT = 'left',
208+
/**
209+
* The user used the middle mouse button (also known as scroll wheel click) to click the button
210+
*/
152211
MIDDLE = 'middle',
153212
}
154213

214+
/**
215+
* Maps action types to their respective action interfaces.
216+
*/
155217
export interface ButtonActionMap {
156218
[ButtonActionType.COMMAND]: CommandButtonAction;
157219
[ButtonActionType.JS]: JSButtonAction;

0 commit comments

Comments
 (0)