Skip to content

Commit 7f812cb

Browse files
committed
publish support and new error system
1 parent e1e946a commit 7f812cb

28 files changed

+401
-120
lines changed

esbuild.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ esbuild
5959
compilerOptions: { css: true },
6060
preprocess: sveltePreprocess(),
6161
}),
62-
conditionalBuild([])
62+
conditionalBuild([]),
6363
],
6464
})
6565
.catch(() => process.exit(1));

esbuild.dev.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ esbuild
7070
compilerOptions: { css: true },
7171
preprocess: sveltePreprocess(),
7272
}),
73-
conditionalBuild([])
73+
conditionalBuild([]),
7474
],
7575
})
7676
.catch(() => process.exit(1));

esbuild.publish.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ esbuild
5757
esbuildSvelte({
5858
compilerOptions: { css: true },
5959
preprocess: sveltePreprocess(),
60-
})
60+
}),
6161
],
6262
})
6363
.catch(() => process.exit(1));

exampleVault/Input Fields/Slider.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
slider1: 37
3-
slider2: 2
2+
slider1: 31
3+
slider2: 6
44
slider3: 580
55
---
66

exampleVault/View Fields/JS View Field.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
number1: 22
3+
number2: 1
34
---
45
`INPUT[number:number1]`
56
`INPUT[number:number2]`

exampleVault/View Fields/View Field.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
number1: 11
33
number2: 20
4-
unit: m
4+
unit: km
55
---
66

77
`INPUT[number:number1]`

exampleVault/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
slider1: 4
33
nested:
4-
object: d
4+
object: test
55
suggest: test
66
toggle1: false
77
Domestic_tasks:
@@ -73,7 +73,7 @@ Lorem ipsum dolor sit amet, `INPUT[date():other note#date]` consectetur adipisci
7373
- `INPUT[select(option(option a),option(option b),option(option c),option(option d)):select]`
7474

7575

76-
Lorem ipsum dolor sit amet, `INPUT[text():meta bind/nonExistantFile#title]` consectetur adipiscing elit. Pellentesque sit amet porttitor arcu. Quisque scelerisque dolor augue, et posuere nulla bibendum nec. `INPUT[slider(nonExistantArgument)]` Curabitur sed rhoncus nisl. Maecenas nisi justo, viverra vel tempus vel, hendrerit at metus. `INPUT[select(option(option a),option(option b),option(option c),option(option d)):select]` asdasd asdasdasd
76+
Lorem ipsum dolor sit amet, `INPUT[text():meta bind/nonExistantFile#title]` consectetur adipiscing elit. Pellentesque sit amet porttitor arcu. Quisque scelerisque dolor augue, et posuere nulla bibendum nec. `INPUT[slider(nonExistantArgument)]` Curabitur sed rhoncus nisl. Maecenas nisi justo, viverra vel tempus vel, hendrerit at metus. `INPUT[select(option(option a),option(option b),option(option c),option(option d)):select]` asdasd asdasdasd
7777

7878
Code block error
7979
```meta-bind

exampleVault/other note.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
tags: test
33
title: test
4-
select: option a
5-
date: 2023-05-19
4+
select: option b
5+
date: Tuesday, January 10th 2023
66
time: 19:20
7-
select: option d
87
multi-select:
9-
- option b
8+
- option a
109
- option c
1110
---
1211

src/inputFieldArguments/InputFieldArgumentContainer.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AbstractInputFieldArgument } from './AbstractInputFieldArgument';
22
import { InputFieldArgumentType } from '../parsers/InputFieldDeclarationParser';
3-
import { ErrorLevel, MetaBindParsingError } from '../utils/errors/MetaBindErrors';
3+
import { ErrorLevel, MetaBindInternalError, MetaBindParsingError } from '../utils/errors/MetaBindErrors';
44

55
export class InputFieldArgumentContainer {
66
arguments: AbstractInputFieldArgument[] = [];
@@ -64,4 +64,12 @@ export class InputFieldArgumentContainer {
6464

6565
return this;
6666
}
67+
68+
getAll(name: InputFieldArgumentType): AbstractInputFieldArgument[] {
69+
return this.arguments.filter(x => x.identifier === name);
70+
}
71+
72+
get(name: InputFieldArgumentType): AbstractInputFieldArgument | undefined {
73+
return this.getAll(name).at(0);
74+
}
6775
}

src/inputFields/DatePicker/DatePickerInputField.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { moment } from 'obsidian';
44
import { DateParser } from '../../parsers/DateParser';
55
import { DatePickerModal } from './DatePickerModal';
66
import { Moment } from 'moment';
7-
import { ErrorLevel, MetaBindArgumentError, MetaBindInternalError } from '../../utils/errors/MetaBindErrors';
7+
import { ErrorLevel, MetaBindInternalError } from '../../utils/errors/MetaBindErrors';
88
import { InputFieldMDRC } from '../../renderChildren/InputFieldMDRC';
9-
import MetaBindPlugin from '../../main';
109

1110
export class DatePickerInputField extends AbstractInputField {
1211
container: HTMLDivElement | undefined;

0 commit comments

Comments
 (0)