Skip to content

Commit de921b4

Browse files
committed
Merge branch 'master' into release
2 parents cae4532 + bbfbd93 commit de921b4

File tree

135 files changed

+6164
-7741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+6164
-7741
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"no-prototype-builtins": "off",
1717
"@typescript-eslint/no-empty-function": "off",
1818
"@typescript-eslint/no-inferrable-types": "off",
19-
"@typescript-eslint/no-explicit-any": "off",
19+
"@typescript-eslint/no-explicit-any": ["warn"],
2020
"@typescript-eslint/explicit-function-return-type": ["warn"]
2121
}
2222
}

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"printWidth": 180,
2+
"printWidth": 160,
33
"useTabs": true,
44
"semi": true,
55
"singleQuote": true,

CHANGELOG.md

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,70 @@
11
# Obsidian Meta Bind Changelog
22

3+
# 0.6.1
4+
5+
Bug Fixes
6+
7+
- fixed a bug with the settings migration causing the settings to be deleted
8+
9+
# 0.6.0
10+
11+
New Features
12+
13+
- `list` input field
14+
- `defaultValue` input field argument
15+
- lets you define a custom default value for an input field
16+
- works on any input field
17+
- `placeholder` input field argument
18+
- lets you define a placeholder value to be displayed in the input field, if no value is set
19+
- works on the following input fields `text`, `textArea`, `number` and `list`
20+
- specific folders can now be excluded in the setting, excluding means that the plugin will not show input or view fields in these folders
21+
- the `option` argument now allows for a name and a value, e.g. `option(value, displayName)`
22+
- numbers and booleans will now be recognized and treated as such
23+
- e.g. `option(5, 5 Stars)` will set the metadata to the number 5 instead of the string '5'
24+
- e.g. `offValue(0)` will set the metadata to the number 0 instead of the string '0'
25+
26+
Changes
27+
28+
- new parser for input fields, view fields and bind targets
29+
- input fields now display way better error messages
30+
- I tried not to introduce breaking changes, but some might have slipped through
31+
- this is also why the update took so long
32+
- new API to create input field using code (e.g. using dataviewJS or [JS Engine](https://github.com/mProjectsCode/obsidian-js-engine-plugin))
33+
- this is a breaking change
34+
- deprecated some input fields that had names in snake_case for camelCase names
35+
36+
Bug Fixes
37+
38+
- fixed a bug with the metadata cache when the frontmatter was invalid
39+
- fixed a bug with view fields that caused an error when referencing metadata from another file
40+
- fixed`toggle` with `offValue` sometimes showing the wrong toggle state
41+
42+
# 0.5.1
43+
44+
Minor Changes
45+
46+
- added a setting to disable JS View Fields
47+
348
# 0.5.0
449

550
New Features
6-
- Live Preview support
7-
- Obsidian Publish support (docs page coming soon)
8-
- Inline Select input field (more or less a dropdown select)
9-
- Progress Bar input field (a bigger full note width slider)
10-
- On and Off Value arguments for the Toggle input field (specify custom on and off values for the toggle)
11-
- new error handling system that supports warnings
51+
52+
- Live Preview support (thanks to koala on discord for helping me with this)
53+
- Obsidian Publish support (docs page coming soon, thanks to Sigrunixia on discord for letting me test on her publish account)
54+
- View Fields, a way to reactively display your metadata using mathjs
55+
- Inline Select input field (more or less a dropdown select)
56+
- Progress Bar input field (a bigger full note width slider)
57+
- On and Off Value arguments for the Toggle input field (specify custom on and off values for the toggle)
58+
- new error handling system that supports warnings
1259

1360
Minor Changes
14-
- added timed cache retention to the plugins on demand metadata cache
61+
62+
- added timed cache retention to the plugins on demand metadata cache
1563

1664
Bug Fixes
17-
- fixed a bug with the metadata cache needlessly updating the frontmatter
18-
- fixed some mistakes in the docs
65+
66+
- fixed a bug with the metadata cache needlessly updating the frontmatter
67+
- fixed some mistakes in the docs
1968

2069
# 0.4.X
2170

esbuild.dev.config.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ import builtins from 'builtin-modules';
44
import copy from 'esbuild-plugin-copy-watch';
55
import esbuildSvelte from 'esbuild-svelte';
66
import sveltePreprocess from 'svelte-preprocess';
7-
import conditionalBuild from 'esbuild-plugin-conditional-build';
87

98
const banner = `/*
109
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
1110
if you want to view the source, please visit the github repository of this plugin
1211
*/
1312
`;
1413

15-
const prod = process.argv[2] === 'production';
16-
1714
esbuild
1815
.build({
1916
banner: {
@@ -48,10 +45,10 @@ esbuild
4845
...builtins,
4946
],
5047
format: 'cjs',
51-
watch: !prod,
48+
watch: true,
5249
target: 'es2016',
5350
logLevel: 'info',
54-
sourcemap: prod ? false : 'inline',
51+
sourcemap: 'inline',
5552
treeShaking: true,
5653
outdir: 'exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin/',
5754
outbase: 'src',
@@ -70,7 +67,6 @@ esbuild
7067
compilerOptions: { css: true },
7168
preprocess: sveltePreprocess(),
7269
}),
73-
conditionalBuild([]),
7470
],
7571
})
7672
.catch(() => process.exit(1));

exampleVault/Input Fields/Date and Time.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
time: 14:12
3-
date2: 2023-06-07
3+
date2:
44
date1: 2023-06-08
55
---
66

@@ -14,6 +14,10 @@ INPUT[date(showcase):date1]
1414
INPUT[date_picker(showcase):date2]
1515
```
1616

17+
```meta-bind
18+
INPUT[datePicker(showcase):date2]
19+
```
20+
1721
### Time
1822
```meta-bind
1923
INPUT[time(showcase):time]
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
select: a
3+
select2: 2
34
---
45

5-
`INPUT[inlineSelect(option(a), option(b)):select]`
6+
```meta-bind
7+
INPUT[inlineSelect(option(a), option(b), showcase):select]
8+
```
9+
10+
```meta-bind
11+
INPUT[inlineSelect(option(1, a), option(2, b), showcase):select2]
12+
```
613

exampleVault/Input Fields/List.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
list:
3+
- apple
4+
- banana
5+
- berries
6+
---
7+
8+
9+
```meta-bind
10+
INPUT[list(showcase):list]
11+
```
12+

exampleVault/Input Fields/Number.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
number: 100
2+
number: 1234
33
---
44

55
```meta-bind

exampleVault/Input Fields/Progress Bar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
progress1: -7
2+
progress1: -9
33
---
44

55
```meta-bind
6-
INPUT[progressBar(minValue(-10), maxValue(3)):progress1]
6+
INPUT[progressBar(showcase, minValue(-10), maxValue(3)):progress1]
77
```
88

99

exampleVault/Input Fields/Select and Multi Select.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
---
2-
select: option 2
2+
select: 2
33
multiSelect:
44
- option 1
55
- option 3
6+
select2: 1
67
---
78

89
### Select
910
```meta-bind
1011
INPUT[select(
11-
option(option 1),
12-
option(option 2),
13-
option(option 3),
12+
option(1, option 1),
13+
option(2, option 2),
14+
option(3, option 3),
1415
showcase
1516
):select]
1617
```
1718

19+
```meta-bind
20+
INPUT[select(
21+
option(1, option 1),
22+
option(false, option 2),
23+
option(null, option 3),
24+
showcase
25+
):select2]
26+
```
27+
28+
1829
### Multi Select
1930
```meta-bind
2031
INPUT[multi_select(

0 commit comments

Comments
 (0)