Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
mProjectsCode committed Sep 24, 2023
2 parents cae4532 + bbfbd93 commit de921b4
Show file tree
Hide file tree
Showing 135 changed files with 6,164 additions and 7,741 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"no-prototype-builtins": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-explicit-any": ["warn"],
"@typescript-eslint/explicit-function-return-type": ["warn"]
}
}
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 180,
"printWidth": 160,
"useTabs": true,
"semi": true,
"singleQuote": true,
Expand Down
67 changes: 58 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,70 @@
# Obsidian Meta Bind Changelog

# 0.6.1

Bug Fixes

- fixed a bug with the settings migration causing the settings to be deleted

# 0.6.0

New Features

- `list` input field
- `defaultValue` input field argument
- lets you define a custom default value for an input field
- works on any input field
- `placeholder` input field argument
- lets you define a placeholder value to be displayed in the input field, if no value is set
- works on the following input fields `text`, `textArea`, `number` and `list`
- specific folders can now be excluded in the setting, excluding means that the plugin will not show input or view fields in these folders
- the `option` argument now allows for a name and a value, e.g. `option(value, displayName)`
- numbers and booleans will now be recognized and treated as such
- e.g. `option(5, 5 Stars)` will set the metadata to the number 5 instead of the string '5'
- e.g. `offValue(0)` will set the metadata to the number 0 instead of the string '0'

Changes

- new parser for input fields, view fields and bind targets
- input fields now display way better error messages
- I tried not to introduce breaking changes, but some might have slipped through
- this is also why the update took so long
- new API to create input field using code (e.g. using dataviewJS or [JS Engine](https://github.com/mProjectsCode/obsidian-js-engine-plugin))
- this is a breaking change
- deprecated some input fields that had names in snake_case for camelCase names

Bug Fixes

- fixed a bug with the metadata cache when the frontmatter was invalid
- fixed a bug with view fields that caused an error when referencing metadata from another file
- fixed`toggle` with `offValue` sometimes showing the wrong toggle state

# 0.5.1

Minor Changes

- added a setting to disable JS View Fields

# 0.5.0

New Features
- Live Preview support
- Obsidian Publish support (docs page coming soon)
- Inline Select input field (more or less a dropdown select)
- Progress Bar input field (a bigger full note width slider)
- On and Off Value arguments for the Toggle input field (specify custom on and off values for the toggle)
- new error handling system that supports warnings

- Live Preview support (thanks to koala on discord for helping me with this)
- Obsidian Publish support (docs page coming soon, thanks to Sigrunixia on discord for letting me test on her publish account)
- View Fields, a way to reactively display your metadata using mathjs
- Inline Select input field (more or less a dropdown select)
- Progress Bar input field (a bigger full note width slider)
- On and Off Value arguments for the Toggle input field (specify custom on and off values for the toggle)
- new error handling system that supports warnings

Minor Changes
- added timed cache retention to the plugins on demand metadata cache

- added timed cache retention to the plugins on demand metadata cache

Bug Fixes
- fixed a bug with the metadata cache needlessly updating the frontmatter
- fixed some mistakes in the docs

- fixed a bug with the metadata cache needlessly updating the frontmatter
- fixed some mistakes in the docs

# 0.4.X

Expand Down
8 changes: 2 additions & 6 deletions esbuild.dev.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ import builtins from 'builtin-modules';
import copy from 'esbuild-plugin-copy-watch';
import esbuildSvelte from 'esbuild-svelte';
import sveltePreprocess from 'svelte-preprocess';
import conditionalBuild from 'esbuild-plugin-conditional-build';

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

const prod = process.argv[2] === 'production';

esbuild
.build({
banner: {
Expand Down Expand Up @@ -48,10 +45,10 @@ esbuild
...builtins,
],
format: 'cjs',
watch: !prod,
watch: true,
target: 'es2016',
logLevel: 'info',
sourcemap: prod ? false : 'inline',
sourcemap: 'inline',
treeShaking: true,
outdir: 'exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin/',
outbase: 'src',
Expand All @@ -70,7 +67,6 @@ esbuild
compilerOptions: { css: true },
preprocess: sveltePreprocess(),
}),
conditionalBuild([]),
],
})
.catch(() => process.exit(1));
6 changes: 5 additions & 1 deletion exampleVault/Input Fields/Date and Time.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
time: 14:12
date2: 2023-06-07
date2:
date1: 2023-06-08
---

Expand All @@ -14,6 +14,10 @@ INPUT[date(showcase):date1]
INPUT[date_picker(showcase):date2]
```

```meta-bind
INPUT[datePicker(showcase):date2]
```

### Time
```meta-bind
INPUT[time(showcase):time]
Expand Down
9 changes: 8 additions & 1 deletion exampleVault/Input Fields/Inline Select.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
select: a
select2: 2
---

`INPUT[inlineSelect(option(a), option(b)):select]`
```meta-bind
INPUT[inlineSelect(option(a), option(b), showcase):select]
```

```meta-bind
INPUT[inlineSelect(option(1, a), option(2, b), showcase):select2]
```

12 changes: 12 additions & 0 deletions exampleVault/Input Fields/List.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
list:
- apple
- banana
- berries
---


```meta-bind
INPUT[list(showcase):list]
```

2 changes: 1 addition & 1 deletion exampleVault/Input Fields/Number.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
number: 100
number: 1234
---

```meta-bind
Expand Down
4 changes: 2 additions & 2 deletions exampleVault/Input Fields/Progress Bar.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
progress1: -7
progress1: -9
---

```meta-bind
INPUT[progressBar(minValue(-10), maxValue(3)):progress1]
INPUT[progressBar(showcase, minValue(-10), maxValue(3)):progress1]
```


Expand Down
19 changes: 15 additions & 4 deletions exampleVault/Input Fields/Select and Multi Select.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
---
select: option 2
select: 2
multiSelect:
- option 1
- option 3
select2: 1
---

### Select
```meta-bind
INPUT[select(
option(option 1),
option(option 2),
option(option 3),
option(1, option 1),
option(2, option 2),
option(3, option 3),
showcase
):select]
```

```meta-bind
INPUT[select(
option(1, option 1),
option(false, option 2),
option(null, option 3),
showcase
):select2]
```


### Multi Select
```meta-bind
INPUT[multi_select(
Expand Down
6 changes: 3 additions & 3 deletions exampleVault/Input Fields/Slider.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
slider1: 31
slider2: 6
slider3: 580
slider1: 23
slider2: 13
slider3: 319
---

### Simple Slider
Expand Down
2 changes: 1 addition & 1 deletion exampleVault/Input Fields/Suggester.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
fileSuggest: "[[Other/Example Notes/Example Note with Image.md|Example Note with Image]]"
fileSuggest: "[[Other/Example Notes/Example Note with Callouts.md|Example Note with Callouts]]"
suggest: option 2
---

Expand Down
57 changes: 0 additions & 57 deletions exampleVault/Meta Bind JS.md

This file was deleted.

9 changes: 0 additions & 9 deletions exampleVault/Other/templater test.md

This file was deleted.

11 changes: 11 additions & 0 deletions exampleVault/Test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
frequency: "[[high]]"
toggle: false
needs: Meta Bind JS
date: Saturday, July 8th 2023
text: asdasddas
Bible Reading: false
---

`INPUT[toggle:Bible Reading]`
`INPUT[toggle:["Bible Reading"]]`
24 changes: 24 additions & 0 deletions exampleVault/View Fields/Advanced Example/Note 1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
added:
- "1"
- "2"
removed:
- "1"
---
# Added

```meta-bind
INPUT[list:added]
```

# Removed

```meta-bind
INPUT[list:removed]
```

# Total

```meta-bind-js
asdasd
```
25 changes: 25 additions & 0 deletions exampleVault/View Fields/Advanced Example/Note 2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
added:
- "3"
- "4"
removed:
- "2"
- "3"
---
# Added

```meta-bind
INPUT[list:added]
```

# Removed

```meta-bind
INPUT[list:removed]
```

# Total

```meta-bind-js
asdasd
```
Loading

0 comments on commit de921b4

Please sign in to comment.