@lblod/ember-rdfa-editor-lblod-plugins 24.2.2 → 24.2.3-dev.6e601efc94b5c9b191a79469fe6b82de187a03f0
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/.changeset/neat-queens-study.md +5 -0
- package/CHANGELOG.md +6 -0
- package/addon/components/variable-plugin/address/nodeview.hbs +4 -18
- package/addon/components/variable-plugin/address/nodeview.ts +12 -23
- package/addon/components/variable-plugin/autofilled/insert.gts +3 -2
- package/addon/components/variable-plugin/codelist/insert.ts +1 -1
- package/addon/components/variable-plugin/date/nodeview.hbs +4 -12
- package/addon/components/variable-plugin/date/nodeview.ts +5 -23
- package/addon/components/variable-plugin/location/insert.ts +4 -2
- package/addon/components/variable-plugin/number/nodeview.hbs +4 -19
- package/addon/components/variable-plugin/number/nodeview.ts +12 -10
- package/addon/components/variable-plugin/person/nodeview.hbs +4 -18
- package/addon/components/variable-plugin/person/nodeview.ts +12 -19
- package/addon/components/variable-plugin/text/insert.ts +1 -1
- package/addon/components/variable-plugin/variable/nodeview.hbs +2 -8
- package/addon/components/variable-plugin/variable/nodeview.ts +16 -7
- package/addon/plugins/structure-plugin/node.ts +1 -1
- package/addon/plugins/variable-plugin/variables/autofilled.ts +2 -2
- package/addon/plugins/variable-plugin/variables/location.ts +2 -3
- package/addon/utils/namespace.ts +4 -1
- package/app/styles/variable-plugin.scss +21 -26
- package/declarations/addon/components/variable-plugin/address/nodeview.d.ts +2 -8
- package/declarations/addon/components/variable-plugin/date/nodeview.d.ts +2 -6
- package/declarations/addon/components/variable-plugin/number/nodeview.d.ts +2 -4
- package/declarations/addon/components/variable-plugin/person/nodeview.d.ts +2 -7
- package/declarations/addon/components/variable-plugin/variable/nodeview.d.ts +2 -2
- package/package.json +3 -3
- package/pnpm-lock.yaml +18 -11
- package/translations/en-US.yaml +5 -5
- package/translations/nl-BE.yaml +5 -5
- package/addon/components/variable-plugin/autofilled/nodeview.gts +0 -100
- package/addon/components/variable-plugin/location/nodeview.hbs +0 -24
- package/addon/components/variable-plugin/location/nodeview.ts +0 -46
- package/declarations/addon/components/variable-plugin/autofilled/nodeview.d.ts +0 -22
- package/declarations/addon/components/variable-plugin/location/nodeview.d.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 24.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#491](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/491) [`2191d5a`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/2191d5a18669ab15bb64e09ec8e7273020dbca79) Thanks [@piemonkey](https://github.com/piemonkey)! - Do not add `" ."` at the end of 'only article' for single articles
|
|
8
|
+
|
|
3
9
|
## 24.2.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<AuPill
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{{on 'click' @selectNode}}
|
|
7
|
-
>
|
|
8
|
-
{{#if this.address}}
|
|
9
|
-
{{this.address.formatted}}
|
|
10
|
-
{{else}}
|
|
11
|
-
<span class='mark-highlight-manual'>
|
|
12
|
-
{{this.translations.placeholder}}
|
|
13
|
-
</span>
|
|
14
|
-
{{/if}}
|
|
15
|
-
{{#if this.label}}
|
|
16
|
-
<span class='label'>
|
|
17
|
-
({{this.label}})
|
|
18
|
-
</span>
|
|
19
|
-
{{/if}}
|
|
2
|
+
<AuPill class='say-pill atomic' {{on 'click' @selectNode}}>
|
|
3
|
+
<span class='{{unless this.filled "unfilled-variable"}}'>
|
|
4
|
+
{{this.content}}
|
|
5
|
+
</span>
|
|
20
6
|
</AuPill>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { service } from '@ember/service';
|
|
3
|
-
import IntlService from 'ember-intl/services/intl';
|
|
4
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
5
2
|
|
|
6
3
|
import { PNode, SayController } from '@lblod/ember-rdfa-editor';
|
|
7
4
|
import { Address } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/address-helpers';
|
|
@@ -15,26 +12,6 @@ type Args = {
|
|
|
15
12
|
};
|
|
16
13
|
|
|
17
14
|
export default class AddressNodeviewComponent extends Component<Args> {
|
|
18
|
-
PencilIcon = PencilIcon;
|
|
19
|
-
|
|
20
|
-
@service declare intl: IntlService;
|
|
21
|
-
|
|
22
|
-
get controller() {
|
|
23
|
-
return this.args.controller;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get documentLanguage() {
|
|
27
|
-
return this.controller.documentLanguage;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get translations() {
|
|
31
|
-
return {
|
|
32
|
-
placeholder: this.intl.t('editor-plugins.address.nodeview.placeholder', {
|
|
33
|
-
locale: this.documentLanguage,
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
15
|
get node() {
|
|
39
16
|
return this.args.node;
|
|
40
17
|
}
|
|
@@ -47,4 +24,16 @@ export default class AddressNodeviewComponent extends Component<Args> {
|
|
|
47
24
|
if (this.address) return '';
|
|
48
25
|
return getOutgoingTriple(this.node.attrs, EXT('label'))?.object.value;
|
|
49
26
|
}
|
|
27
|
+
|
|
28
|
+
get filled() {
|
|
29
|
+
return !!this.address;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get content() {
|
|
33
|
+
if (this.filled) {
|
|
34
|
+
return this.address;
|
|
35
|
+
} else {
|
|
36
|
+
return this.label;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
50
39
|
}
|
|
@@ -68,7 +68,8 @@ export default class AutoFilledVariableInsertComponent extends Component<Args> {
|
|
|
68
68
|
locale: this.documentLanguage,
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
const label =
|
|
71
|
+
const label =
|
|
72
|
+
this.label != '' ? this.label : this.autofillKey || placeholder;
|
|
72
73
|
const node = this.schema.nodes.autofilled_variable.create(
|
|
73
74
|
{
|
|
74
75
|
subject: mappingSubject,
|
|
@@ -101,7 +102,7 @@ export default class AutoFilledVariableInsertComponent extends Component<Args> {
|
|
|
101
102
|
},
|
|
102
103
|
|
|
103
104
|
this.schema.node('placeholder', {
|
|
104
|
-
placeholderText:
|
|
105
|
+
placeholderText: label,
|
|
105
106
|
}),
|
|
106
107
|
);
|
|
107
108
|
this.label = '';
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<AuPill
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{{on 'click' @selectNode}}
|
|
7
|
-
>
|
|
8
|
-
{{this.humanReadableDate}}
|
|
9
|
-
{{#if this.label}}
|
|
10
|
-
<span class='label'>
|
|
11
|
-
({{this.label}})
|
|
12
|
-
</span>
|
|
13
|
-
{{/if}}
|
|
2
|
+
<AuPill class='say-pill atomic' {{on 'click' @selectNode}}>
|
|
3
|
+
<span class='{{unless this.filled "unfilled-variable"}}'>
|
|
4
|
+
{{this.humanReadableDate}}
|
|
5
|
+
</span>
|
|
14
6
|
</AuPill>
|
|
@@ -5,15 +5,12 @@ import {
|
|
|
5
5
|
SayController,
|
|
6
6
|
SayView,
|
|
7
7
|
} from '@lblod/ember-rdfa-editor';
|
|
8
|
-
import IntlService from 'ember-intl/services/intl';
|
|
9
|
-
import { service } from '@ember/service';
|
|
10
8
|
import {
|
|
11
9
|
formatDate,
|
|
12
10
|
validateDateFormat,
|
|
13
11
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/date-helpers';
|
|
14
12
|
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
15
13
|
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
16
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
17
14
|
|
|
18
15
|
type Args = {
|
|
19
16
|
getPos: () => number | undefined;
|
|
@@ -26,16 +23,10 @@ type Args = {
|
|
|
26
23
|
};
|
|
27
24
|
|
|
28
25
|
export default class DateNodeviewComponent extends Component<Args> {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
get controller() {
|
|
34
|
-
return this.args.controller;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get documentLanguage() {
|
|
38
|
-
return this.controller.documentLanguage;
|
|
26
|
+
get filled() {
|
|
27
|
+
const value = getOutgoingTriple(this.args.node.attrs, EXT('content'))
|
|
28
|
+
?.object.value;
|
|
29
|
+
return !!value;
|
|
39
30
|
}
|
|
40
31
|
|
|
41
32
|
get humanReadableDate() {
|
|
@@ -49,20 +40,11 @@ export default class DateNodeviewComponent extends Component<Args> {
|
|
|
49
40
|
return 'Ongeldig formaat';
|
|
50
41
|
}
|
|
51
42
|
} else {
|
|
52
|
-
return
|
|
53
|
-
? this.intl.t('date-plugin.insert.date', {
|
|
54
|
-
locale: this.documentLanguage,
|
|
55
|
-
})
|
|
56
|
-
: this.intl.t('date-plugin.insert.datetime', {
|
|
57
|
-
locale: this.documentLanguage,
|
|
58
|
-
});
|
|
43
|
+
return this.label;
|
|
59
44
|
}
|
|
60
45
|
}
|
|
61
46
|
|
|
62
47
|
get label() {
|
|
63
|
-
const value = getOutgoingTriple(this.args.node.attrs, EXT('content'))
|
|
64
|
-
?.object.value;
|
|
65
|
-
if (value) return '';
|
|
66
48
|
return getOutgoingTriple(this.args.node.attrs, EXT('label'))?.object.value;
|
|
67
49
|
}
|
|
68
50
|
}
|
|
@@ -51,15 +51,17 @@ export default class LocationInsertComponent extends Component<Args> {
|
|
|
51
51
|
locale: this.documentLanguage,
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
const label = this.label ?? placeholder;
|
|
55
|
+
|
|
54
56
|
const node = this.schema.nodes.location.create(
|
|
55
57
|
{
|
|
56
58
|
mappingResource,
|
|
57
59
|
variableInstance,
|
|
58
|
-
label:
|
|
60
|
+
label: label,
|
|
59
61
|
source: this.endpoint,
|
|
60
62
|
},
|
|
61
63
|
this.schema.node('placeholder', {
|
|
62
|
-
placeholderText:
|
|
64
|
+
placeholderText: label,
|
|
63
65
|
}),
|
|
64
66
|
);
|
|
65
67
|
|
|
@@ -4,25 +4,10 @@
|
|
|
4
4
|
@offsetOptions={{hash mainAxis=3}}
|
|
5
5
|
as |velcro|
|
|
6
6
|
>
|
|
7
|
-
<AuPill
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
{{velcro.hook}}
|
|
12
|
-
{{on 'click' @selectNode}}
|
|
13
|
-
>
|
|
14
|
-
{{#if this.formattedNumber}}
|
|
15
|
-
{{this.formattedNumber}}
|
|
16
|
-
{{else}}
|
|
17
|
-
<span class='mark-highlight-manual'>
|
|
18
|
-
{{this.translations.placeholder}}
|
|
19
|
-
</span>
|
|
20
|
-
{{/if}}
|
|
21
|
-
{{#if this.label}}
|
|
22
|
-
<span class='label'>
|
|
23
|
-
({{this.label}})
|
|
24
|
-
</span>
|
|
25
|
-
{{/if}}
|
|
7
|
+
<AuPill class='say-pill atomic' {{velcro.hook}} {{on 'click' @selectNode}}>
|
|
8
|
+
<span class='{{unless this.filled "unfilled-variable"}}'>
|
|
9
|
+
{{this.content}}
|
|
10
|
+
</span>
|
|
26
11
|
</AuPill>
|
|
27
12
|
{{#if this.selected}}
|
|
28
13
|
<div class='say-tooltip say-number-tooltip' {{velcro.loop}}>
|
|
@@ -17,7 +17,6 @@ import { isNumber } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
|
17
17
|
import { numberToWords } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/number-to-words';
|
|
18
18
|
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
19
19
|
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
20
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
21
20
|
|
|
22
21
|
type Args = {
|
|
23
22
|
getPos: () => number | undefined;
|
|
@@ -31,7 +30,6 @@ type Args = {
|
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
export default class NumberNodeviewComponent extends Component<Args> {
|
|
34
|
-
PencilIcon = PencilIcon;
|
|
35
33
|
Velcro = Velcro;
|
|
36
34
|
|
|
37
35
|
@localCopy('number', '') declare inputNumber: string;
|
|
@@ -52,14 +50,6 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
52
50
|
return this.controller.documentLanguage;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
get translations() {
|
|
56
|
-
return {
|
|
57
|
-
placeholder: this.intl.t('variable.number.placeholder', {
|
|
58
|
-
locale: this.documentLanguage,
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
53
|
get node() {
|
|
64
54
|
return this.args.node;
|
|
65
55
|
}
|
|
@@ -80,6 +70,18 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
72
|
|
|
73
|
+
get filled() {
|
|
74
|
+
return !!this.formattedNumber;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get content() {
|
|
78
|
+
if (this.filled) {
|
|
79
|
+
return this.formattedNumber;
|
|
80
|
+
} else {
|
|
81
|
+
return this.label;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
83
85
|
get selected() {
|
|
84
86
|
return this.args.selected;
|
|
85
87
|
}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<AuPill
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{{on 'click' @selectNode}}
|
|
7
|
-
>
|
|
8
|
-
{{#if this.mandatee}}
|
|
9
|
-
{{this.mandatee.fullName}}
|
|
10
|
-
{{else}}
|
|
11
|
-
<span class='mark-highlight-manual'>
|
|
12
|
-
{{this.translations.placeholder}}
|
|
13
|
-
</span>
|
|
14
|
-
{{/if}}
|
|
15
|
-
{{#if this.label}}
|
|
16
|
-
<span class='label'>
|
|
17
|
-
({{this.label}})
|
|
18
|
-
</span>
|
|
19
|
-
{{/if}}
|
|
2
|
+
<AuPill class='say-pill atomic' {{on 'click' @selectNode}}>
|
|
3
|
+
<span class='{{unless this.filled "unfilled-variable"}}'>
|
|
4
|
+
{{this.content}}
|
|
5
|
+
</span>
|
|
20
6
|
</AuPill>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { service } from '@ember/service';
|
|
3
|
-
import IntlService from 'ember-intl/services/intl';
|
|
4
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
5
2
|
|
|
6
3
|
import { PNode, SayController } from '@lblod/ember-rdfa-editor';
|
|
7
4
|
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
@@ -15,26 +12,10 @@ type Args = {
|
|
|
15
12
|
};
|
|
16
13
|
|
|
17
14
|
export default class PersonNodeviewComponent extends Component<Args> {
|
|
18
|
-
PencilIcon = PencilIcon;
|
|
19
|
-
|
|
20
|
-
@service declare intl: IntlService;
|
|
21
|
-
|
|
22
15
|
get controller() {
|
|
23
16
|
return this.args.controller;
|
|
24
17
|
}
|
|
25
18
|
|
|
26
|
-
get documentLanguage() {
|
|
27
|
-
return this.controller.documentLanguage;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get translations() {
|
|
31
|
-
return {
|
|
32
|
-
placeholder: this.intl.t('variable-plugin.person.nodeview-placeholder', {
|
|
33
|
-
locale: this.documentLanguage,
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
19
|
get node() {
|
|
39
20
|
return this.args.node;
|
|
40
21
|
}
|
|
@@ -47,4 +28,16 @@ export default class PersonNodeviewComponent extends Component<Args> {
|
|
|
47
28
|
if (this.mandatee) return '';
|
|
48
29
|
return getOutgoingTriple(this.node.attrs, EXT('label'))?.object.value;
|
|
49
30
|
}
|
|
31
|
+
|
|
32
|
+
get filled() {
|
|
33
|
+
return !!this.mandatee;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get content() {
|
|
37
|
+
if (this.filled) {
|
|
38
|
+
return this.mandatee?.fullName;
|
|
39
|
+
} else {
|
|
40
|
+
return this.label;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
50
43
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{{! @glint-nocheck: not typesafe yet }}
|
|
2
2
|
<AuPill
|
|
3
|
-
|
|
4
|
-
@iconAlignment='right'
|
|
5
|
-
class='variable'
|
|
3
|
+
class='say-pill'
|
|
6
4
|
{{on 'click' this.onClick}}
|
|
5
|
+
{{on 'focusout' this.resetVariable}}
|
|
7
6
|
>
|
|
8
7
|
<EmberNode::EmbeddedEditor
|
|
9
8
|
@controller={{@controller}}
|
|
@@ -17,9 +16,4 @@
|
|
|
17
16
|
@decorations={{@decorations}}
|
|
18
17
|
@contentDecorations={{@contentDecorations}}
|
|
19
18
|
/>
|
|
20
|
-
{{#if this.label}}
|
|
21
|
-
<span class='label'>
|
|
22
|
-
({{this.label}})
|
|
23
|
-
</span>
|
|
24
|
-
{{/if}}
|
|
25
19
|
</AuPill>
|
|
@@ -3,15 +3,12 @@ import { NodeSelection, ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import { editableNodePlugin } from '@lblod/ember-rdfa-editor/plugins/editable-node';
|
|
4
4
|
import { tracked } from '@glimmer/tracking';
|
|
5
5
|
import { action } from '@ember/object';
|
|
6
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
7
6
|
|
|
8
7
|
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
9
8
|
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
10
9
|
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
11
10
|
|
|
12
11
|
export default class VariableNodeViewComponent extends Component<EmberNodeArgs> {
|
|
13
|
-
PencilIcon = PencilIcon;
|
|
14
|
-
|
|
15
12
|
@tracked innerView?: SayView;
|
|
16
13
|
|
|
17
14
|
get plugins(): ProsePlugin[] {
|
|
@@ -39,11 +36,23 @@ export default class VariableNodeViewComponent extends Component<EmberNodeArgs>
|
|
|
39
36
|
initEditor(view: SayView) {
|
|
40
37
|
this.innerView = view;
|
|
41
38
|
}
|
|
42
|
-
|
|
39
|
+
@action
|
|
40
|
+
resetVariable() {
|
|
41
|
+
if (this.innerView && this.innerView.state.doc.childCount === 0) {
|
|
42
|
+
const tr = this.innerView.state.tr;
|
|
43
|
+
const placeholderNode = this.innerView.state.schema.node('placeholder', {
|
|
44
|
+
placeholderText: this.label,
|
|
45
|
+
});
|
|
46
|
+
tr.insert(0, placeholderNode);
|
|
47
|
+
this.innerView?.dispatch(tr);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
43
50
|
get label() {
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
const labelTriple = getOutgoingTriple(this.args.node.attrs, EXT('label'));
|
|
52
|
+
if (labelTriple) {
|
|
53
|
+
return labelTriple.object.value;
|
|
54
|
+
} else {
|
|
55
|
+
return this.args.node.attrs.label;
|
|
46
56
|
}
|
|
47
|
-
return getOutgoingTriple(this.args.node.attrs, EXT('label'))?.object.value;
|
|
48
57
|
}
|
|
49
58
|
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
parseVariableInstance,
|
|
23
23
|
parseVariableType,
|
|
24
24
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/variable-attribute-parsers';
|
|
25
|
-
import
|
|
25
|
+
import NodeViewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/variable/nodeview';
|
|
26
26
|
import type { ComponentLike } from '@glint/template';
|
|
27
27
|
import { hasOutgoingNamedNodeTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
28
28
|
import { renderRdfaAware } from '@lblod/ember-rdfa-editor/core/schema';
|
|
@@ -139,7 +139,7 @@ const toDOM = (node: PNode): DOMOutputSpec => {
|
|
|
139
139
|
|
|
140
140
|
const emberNodeConfig: EmberNodeConfig = {
|
|
141
141
|
name: 'autofilled-variable',
|
|
142
|
-
component:
|
|
142
|
+
component: NodeViewComponent as unknown as ComponentLike,
|
|
143
143
|
inline: true,
|
|
144
144
|
group: 'inline variable',
|
|
145
145
|
content: 'inline*',
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
typeSpan,
|
|
21
21
|
} from '../utils/dom-constructors';
|
|
22
22
|
import { contentSpan } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/dom-output-spec-helpers';
|
|
23
|
-
import
|
|
23
|
+
import NodeViewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/variable/nodeview';
|
|
24
24
|
import type { ComponentLike } from '@glint/template';
|
|
25
25
|
|
|
26
26
|
const CONTENT_SELECTOR = `span[property~='${EXT('content').prefixed}'],
|
|
@@ -35,7 +35,6 @@ const parseDOM = [
|
|
|
35
35
|
node.querySelector(CONTENT_SELECTOR) &&
|
|
36
36
|
parseVariableType(node) === 'location'
|
|
37
37
|
) {
|
|
38
|
-
console.log('Parse location: ', node);
|
|
39
38
|
const mappingResource = node.getAttribute('resource');
|
|
40
39
|
if (!mappingResource) {
|
|
41
40
|
return false;
|
|
@@ -74,7 +73,7 @@ const toDOM = (node: PNode): DOMOutputSpec => {
|
|
|
74
73
|
|
|
75
74
|
const emberNodeConfig: EmberNodeConfig = {
|
|
76
75
|
name: 'location',
|
|
77
|
-
component:
|
|
76
|
+
component: NodeViewComponent as unknown as ComponentLike,
|
|
78
77
|
inline: true,
|
|
79
78
|
group: 'inline variable',
|
|
80
79
|
content: 'inline*',
|
package/addon/utils/namespace.ts
CHANGED
|
@@ -68,7 +68,10 @@ export function hasOutgoingNamedNodeTriple(
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
export function getOutgoingTriple(
|
|
71
|
+
export function getOutgoingTriple(
|
|
72
|
+
rdfaAttrs: Attrs,
|
|
73
|
+
predicate: Resource,
|
|
74
|
+
): Option<OutgoingTriple> {
|
|
72
75
|
return (isRdfaAttrs(rdfaAttrs) &&
|
|
73
76
|
rdfaAttrs.rdfaNodeType === 'resource' &&
|
|
74
77
|
rdfaAttrs.properties.find((prop) =>
|
|
@@ -49,39 +49,34 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.ember-node.say-active:has(> .say-pill) {
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
.ember-node {
|
|
53
57
|
white-space: normal !important;
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
word-wrap: break-word;
|
|
60
|
-
outline: 0px;
|
|
61
|
-
padding: 2px;
|
|
62
|
-
}
|
|
63
|
-
.label {
|
|
64
|
-
font-size: var(--au-tiny);
|
|
65
|
-
color: var(--au-blue-700);
|
|
66
|
-
user-select: none;
|
|
67
|
-
margin: 0.3rem;
|
|
68
|
-
}
|
|
69
|
-
.au-c-icon {
|
|
70
|
-
margin: 0;
|
|
58
|
+
.say-pill [contenteditable].mark-highlight-manual {
|
|
59
|
+
color: var(--au-orange-700);
|
|
60
|
+
&.ProseMirror-selectednode {
|
|
61
|
+
background-color: var(--au-blue-300);
|
|
62
|
+
outline: none;
|
|
71
63
|
}
|
|
72
64
|
}
|
|
65
|
+
.unfilled-variable {
|
|
66
|
+
color: var(--au-orange-700);
|
|
67
|
+
background-color: var(--au-orange-300);
|
|
68
|
+
font-style: italic;
|
|
69
|
+
line-height: 1.2rem;
|
|
70
|
+
padding: 0.3rem;
|
|
71
|
+
}
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
.ember-node.ProseMirror-selectednode {
|
|
76
|
-
> .
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
::selection {
|
|
83
|
-
background-color: var(--au-blue-300);
|
|
84
|
-
}
|
|
75
|
+
> .say-pill.atomic {
|
|
76
|
+
background-color: var(--au-blue-200);
|
|
77
|
+
}
|
|
78
|
+
.unfilled-variable {
|
|
79
|
+
background-color: var(--au-blue-200);
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
82
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import IntlService from 'ember-intl/services/intl';
|
|
3
2
|
import { PNode, SayController } from '@lblod/ember-rdfa-editor';
|
|
4
3
|
import { Address } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/address-helpers';
|
|
5
4
|
type Args = {
|
|
@@ -8,15 +7,10 @@ type Args = {
|
|
|
8
7
|
controller: SayController;
|
|
9
8
|
};
|
|
10
9
|
export default class AddressNodeviewComponent extends Component<Args> {
|
|
11
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
12
|
-
intl: IntlService;
|
|
13
|
-
get controller(): SayController;
|
|
14
|
-
get documentLanguage(): string;
|
|
15
|
-
get translations(): {
|
|
16
|
-
placeholder: string;
|
|
17
|
-
};
|
|
18
10
|
get node(): PNode;
|
|
19
11
|
get address(): Address | null;
|
|
20
12
|
get label(): string | undefined;
|
|
13
|
+
get filled(): boolean;
|
|
14
|
+
get content(): string | Address | null | undefined;
|
|
21
15
|
}
|
|
22
16
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { DecorationSource, PNode, SayController, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import IntlService from 'ember-intl/services/intl';
|
|
4
3
|
type Args = {
|
|
5
4
|
getPos: () => number | undefined;
|
|
6
5
|
node: PNode;
|
|
@@ -11,11 +10,8 @@ type Args = {
|
|
|
11
10
|
contentDecorations?: DecorationSource;
|
|
12
11
|
};
|
|
13
12
|
export default class DateNodeviewComponent extends Component<Args> {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
get controller(): SayController;
|
|
17
|
-
get documentLanguage(): string;
|
|
18
|
-
get humanReadableDate(): string;
|
|
13
|
+
get filled(): boolean;
|
|
14
|
+
get humanReadableDate(): string | undefined;
|
|
19
15
|
get label(): string | undefined;
|
|
20
16
|
}
|
|
21
17
|
export {};
|
|
@@ -13,7 +13,6 @@ type Args = {
|
|
|
13
13
|
selectNode: () => void;
|
|
14
14
|
};
|
|
15
15
|
export default class NumberNodeviewComponent extends Component<Args> {
|
|
16
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
17
16
|
Velcro: typeof Velcro;
|
|
18
17
|
inputNumber: string;
|
|
19
18
|
writtenNumber: boolean;
|
|
@@ -22,12 +21,11 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
22
21
|
focus(element: HTMLInputElement): void;
|
|
23
22
|
get controller(): SayController;
|
|
24
23
|
get documentLanguage(): string;
|
|
25
|
-
get translations(): {
|
|
26
|
-
placeholder: string;
|
|
27
|
-
};
|
|
28
24
|
get node(): PNode;
|
|
29
25
|
get number(): string | null | undefined;
|
|
30
26
|
get formattedNumber(): string | null | undefined;
|
|
27
|
+
get filled(): boolean;
|
|
28
|
+
get content(): string | null | undefined;
|
|
31
29
|
get selected(): boolean;
|
|
32
30
|
get minValue(): number;
|
|
33
31
|
get maxValue(): number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import IntlService from 'ember-intl/services/intl';
|
|
3
2
|
import { PNode, SayController } from '@lblod/ember-rdfa-editor';
|
|
4
3
|
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
5
4
|
type Args = {
|
|
@@ -8,15 +7,11 @@ type Args = {
|
|
|
8
7
|
controller: SayController;
|
|
9
8
|
};
|
|
10
9
|
export default class PersonNodeviewComponent extends Component<Args> {
|
|
11
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
12
|
-
intl: IntlService;
|
|
13
10
|
get controller(): SayController;
|
|
14
|
-
get documentLanguage(): string;
|
|
15
|
-
get translations(): {
|
|
16
|
-
placeholder: string;
|
|
17
|
-
};
|
|
18
11
|
get node(): PNode;
|
|
19
12
|
get mandatee(): Mandatee | null;
|
|
20
13
|
get label(): string | undefined;
|
|
14
|
+
get filled(): boolean;
|
|
15
|
+
get content(): string | undefined;
|
|
21
16
|
}
|
|
22
17
|
export {};
|
|
@@ -2,10 +2,10 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
4
4
|
export default class VariableNodeViewComponent extends Component<EmberNodeArgs> {
|
|
5
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
6
5
|
innerView?: SayView;
|
|
7
6
|
get plugins(): ProsePlugin[];
|
|
8
7
|
onClick(): void;
|
|
9
8
|
initEditor(view: SayView): void;
|
|
10
|
-
|
|
9
|
+
resetVariable(): void;
|
|
10
|
+
get label(): any;
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "24.2.
|
|
3
|
+
"version": "24.2.3-dev.6e601efc94b5c9b191a79469fe6b82de187a03f0",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@glint/template": "^1.4.0",
|
|
105
105
|
"@graphy/content.ttl.write": "^4.3.7",
|
|
106
106
|
"@graphy/memory.dataset.fast": "4.3.3",
|
|
107
|
-
"@lblod/ember-rdfa-editor": "10.
|
|
107
|
+
"@lblod/ember-rdfa-editor": "10.7.0-dev.717fce1dbf9eea1967b49abe9744aeb2b3b4d100",
|
|
108
108
|
"@rdfjs/types": "^1.1.0",
|
|
109
109
|
"@release-it/keep-a-changelog": "^4.0.0",
|
|
110
110
|
"@tsconfig/ember": "^3.0.8",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"@appuniversum/ember-appuniversum": "^3.4.1",
|
|
192
192
|
"@ember/string": "3.x",
|
|
193
193
|
"@glint/template": "^1.4.0",
|
|
194
|
-
"@lblod/ember-rdfa-editor": "
|
|
194
|
+
"@lblod/ember-rdfa-editor": "10.7.0-dev.717fce1dbf9eea1967b49abe9744aeb2b3b4d100",
|
|
195
195
|
"ember-concurrency": "^3.1.0",
|
|
196
196
|
"ember-element-helper": "^0.8.6",
|
|
197
197
|
"ember-intl": "^7.0.0",
|
package/pnpm-lock.yaml
CHANGED
|
@@ -166,8 +166,8 @@ importers:
|
|
|
166
166
|
specifier: 4.3.3
|
|
167
167
|
version: 4.3.3
|
|
168
168
|
'@lblod/ember-rdfa-editor':
|
|
169
|
-
specifier: 10.
|
|
170
|
-
version: 10.
|
|
169
|
+
specifier: 10.7.0-dev.717fce1dbf9eea1967b49abe9744aeb2b3b4d100
|
|
170
|
+
version: 10.7.0-dev.717fce1dbf9eea1967b49abe9744aeb2b3b4d100(2ef3gpurqxbttnmniw6grhzpuy)
|
|
171
171
|
'@rdfjs/types':
|
|
172
172
|
specifier: ^1.1.0
|
|
173
173
|
version: 1.1.0
|
|
@@ -1592,8 +1592,8 @@ packages:
|
|
|
1592
1592
|
'@jridgewell/trace-mapping@0.3.25':
|
|
1593
1593
|
resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
|
|
1594
1594
|
|
|
1595
|
-
'@lblod/ember-rdfa-editor@10.
|
|
1596
|
-
resolution: {integrity: sha512-
|
|
1595
|
+
'@lblod/ember-rdfa-editor@10.7.0-dev.717fce1dbf9eea1967b49abe9744aeb2b3b4d100':
|
|
1596
|
+
resolution: {integrity: sha512-gEOXlIeJ35XrcmpSpsDTrsDcFlQ3C6sBLqXWfEvrWA3MXI63skuvid1ape/LPW7cmAkzI74soA0wJLSd7k9bsw==}
|
|
1597
1597
|
engines: {node: 16.* || 18.* || >= 20}
|
|
1598
1598
|
peerDependencies:
|
|
1599
1599
|
'@appuniversum/ember-appuniversum': ^3.4.2
|
|
@@ -1604,7 +1604,7 @@ packages:
|
|
|
1604
1604
|
ember-intl: ^6.4.0 || ^7.0.2
|
|
1605
1605
|
ember-modifier: ^4.1.0
|
|
1606
1606
|
ember-power-select: ^7.1.0
|
|
1607
|
-
ember-source:
|
|
1607
|
+
ember-source: ~4.12.0
|
|
1608
1608
|
ember-template-imports: ^4.1.1
|
|
1609
1609
|
ember-truth-helpers: ^4.0.3
|
|
1610
1610
|
peerDependenciesMeta:
|
|
@@ -7270,8 +7270,8 @@ packages:
|
|
|
7270
7270
|
property-expr@2.0.6:
|
|
7271
7271
|
resolution: {integrity: sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==}
|
|
7272
7272
|
|
|
7273
|
-
prosemirror-commands@1.6.
|
|
7274
|
-
resolution: {integrity: sha512-
|
|
7273
|
+
prosemirror-commands@1.6.2:
|
|
7274
|
+
resolution: {integrity: sha512-0nDHH++qcf/BuPLYvmqZTUUsPJUCPBUXt0J1ErTcDIS369CTp773itzLGIgIXG4LJXOlwYCr44+Mh4ii6MP1QA==}
|
|
7275
7275
|
|
|
7276
7276
|
prosemirror-dev-tools@4.1.0:
|
|
7277
7277
|
resolution: {integrity: sha512-TqMyXLiY8EUoq4f4LV+8dQVuRejwGfeOJdJWjrHNXR9ttKy3MVYBCqmiu3CDULgjv8gtLsqoZY6+ab6BZRmr1g==}
|
|
@@ -7304,6 +7304,9 @@ packages:
|
|
|
7304
7304
|
prosemirror-state@1.4.3:
|
|
7305
7305
|
resolution: {integrity: sha512-goFKORVbvPuAQaXhpbemJFRKJ2aixr+AZMGiquiqKxaucC6hlpHNZHWgz5R7dS4roHiwq9vDctE//CZ++o0W1Q==}
|
|
7306
7306
|
|
|
7307
|
+
prosemirror-transform@1.10.2:
|
|
7308
|
+
resolution: {integrity: sha512-2iUq0wv2iRoJO/zj5mv8uDUriOHWzXRnOTVgCzSXnktS/2iQRa3UUQwVlkBlYZFtygw6Nh1+X4mGqoYBINn5KQ==}
|
|
7309
|
+
|
|
7307
7310
|
prosemirror-transform@1.9.0:
|
|
7308
7311
|
resolution: {integrity: sha512-5UXkr1LIRx3jmpXXNKDhv8OyAOeLTGuXNwdVfg8x27uASna/wQkr9p6fD3eupGOi4PLJfbezxTyi/7fSJypXHg==}
|
|
7309
7312
|
|
|
@@ -10729,7 +10732,7 @@ snapshots:
|
|
|
10729
10732
|
'@jridgewell/resolve-uri': 3.1.2
|
|
10730
10733
|
'@jridgewell/sourcemap-codec': 1.4.15
|
|
10731
10734
|
|
|
10732
|
-
'@lblod/ember-rdfa-editor@10.
|
|
10735
|
+
'@lblod/ember-rdfa-editor@10.7.0-dev.717fce1dbf9eea1967b49abe9744aeb2b3b4d100(2ef3gpurqxbttnmniw6grhzpuy)':
|
|
10733
10736
|
dependencies:
|
|
10734
10737
|
'@appuniversum/ember-appuniversum': 3.4.2(yenc6o4wruytt4u2jbwlbsqcl4)
|
|
10735
10738
|
'@babel/core': 7.24.7
|
|
@@ -10772,7 +10775,7 @@ snapshots:
|
|
|
10772
10775
|
linkifyjs: 4.1.3
|
|
10773
10776
|
mdn-polyfills: 5.20.0
|
|
10774
10777
|
process: 0.11.10
|
|
10775
|
-
prosemirror-commands: 1.6.
|
|
10778
|
+
prosemirror-commands: 1.6.2
|
|
10776
10779
|
prosemirror-dropcursor: 1.8.1
|
|
10777
10780
|
prosemirror-history: 1.4.1
|
|
10778
10781
|
prosemirror-inputrules: 1.4.0
|
|
@@ -18256,11 +18259,11 @@ snapshots:
|
|
|
18256
18259
|
|
|
18257
18260
|
property-expr@2.0.6: {}
|
|
18258
18261
|
|
|
18259
|
-
prosemirror-commands@1.6.
|
|
18262
|
+
prosemirror-commands@1.6.2:
|
|
18260
18263
|
dependencies:
|
|
18261
18264
|
prosemirror-model: 1.21.3
|
|
18262
18265
|
prosemirror-state: 1.4.3
|
|
18263
|
-
prosemirror-transform: 1.
|
|
18266
|
+
prosemirror-transform: 1.10.2
|
|
18264
18267
|
|
|
18265
18268
|
prosemirror-dev-tools@4.1.0(@babel/core@7.24.7)(@babel/template@7.24.7)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
|
|
18266
18269
|
dependencies:
|
|
@@ -18333,6 +18336,10 @@ snapshots:
|
|
|
18333
18336
|
prosemirror-transform: 1.9.0
|
|
18334
18337
|
prosemirror-view: 1.33.8
|
|
18335
18338
|
|
|
18339
|
+
prosemirror-transform@1.10.2:
|
|
18340
|
+
dependencies:
|
|
18341
|
+
prosemirror-model: 1.21.3
|
|
18342
|
+
|
|
18336
18343
|
prosemirror-transform@1.9.0:
|
|
18337
18344
|
dependencies:
|
|
18338
18345
|
prosemirror-model: 1.21.3
|
package/translations/en-US.yaml
CHANGED
|
@@ -201,8 +201,8 @@ date-plugin:
|
|
|
201
201
|
long-month-content: January, February, ..., December
|
|
202
202
|
long-year: Long year
|
|
203
203
|
insert:
|
|
204
|
-
date: '
|
|
205
|
-
datetime: '
|
|
204
|
+
date: 'Date'
|
|
205
|
+
datetime: 'Date and time'
|
|
206
206
|
card:
|
|
207
207
|
title: 'Date'
|
|
208
208
|
insert-date: 'Insert date'
|
|
@@ -232,7 +232,7 @@ document-title-plugin:
|
|
|
232
232
|
|
|
233
233
|
variable:
|
|
234
234
|
number:
|
|
235
|
-
placeholder:
|
|
235
|
+
placeholder: Number
|
|
236
236
|
label: number
|
|
237
237
|
type-number: Type a number...
|
|
238
238
|
error-not-integer: Only integers are allowed
|
|
@@ -272,7 +272,7 @@ variable-plugin:
|
|
|
272
272
|
to: to
|
|
273
273
|
person:
|
|
274
274
|
card-title: Insert person
|
|
275
|
-
nodeview-placeholder:
|
|
275
|
+
nodeview-placeholder: Person
|
|
276
276
|
autofill:
|
|
277
277
|
autofillKey: Autofill Key
|
|
278
278
|
convertToString: Replace variable node with plain text on text insertion
|
|
@@ -430,7 +430,7 @@ editor-plugins:
|
|
|
430
430
|
projection-error: 'Unable to convert location coordinates: {coords}'
|
|
431
431
|
contact: In case of persisting issues, contact <a href="mailto:{email}">{email}</a>.
|
|
432
432
|
nodeview:
|
|
433
|
-
placeholder:
|
|
433
|
+
placeholder: Address
|
|
434
434
|
|
|
435
435
|
confidentiality-plugin:
|
|
436
436
|
redact: Redact
|
package/translations/nl-BE.yaml
CHANGED
|
@@ -201,8 +201,8 @@ date-plugin:
|
|
|
201
201
|
long-month-content: Januari, Februari, ..., December
|
|
202
202
|
long-year: Jaar
|
|
203
203
|
insert:
|
|
204
|
-
date: 'Datum
|
|
205
|
-
datetime: 'Datum en tijd
|
|
204
|
+
date: 'Datum'
|
|
205
|
+
datetime: 'Datum en tijd'
|
|
206
206
|
card:
|
|
207
207
|
title: 'Datum'
|
|
208
208
|
insert-date: 'Datum invoegen'
|
|
@@ -236,7 +236,7 @@ table-of-contents-plugin:
|
|
|
236
236
|
|
|
237
237
|
variable:
|
|
238
238
|
number:
|
|
239
|
-
placeholder:
|
|
239
|
+
placeholder: Getal
|
|
240
240
|
label: nummer
|
|
241
241
|
type-number: typ een nummer...
|
|
242
242
|
error-not-integer: Enkel gehele getallen zijn toegelaten
|
|
@@ -276,7 +276,7 @@ variable-plugin:
|
|
|
276
276
|
to: tot
|
|
277
277
|
person:
|
|
278
278
|
card-title: Persoon invoegen
|
|
279
|
-
nodeview-placeholder:
|
|
279
|
+
nodeview-placeholder: Persoon
|
|
280
280
|
autofill:
|
|
281
281
|
autofillKey: Sleutelwaarde
|
|
282
282
|
convertToString: Vervang variabele door platte tekst bij invoegen
|
|
@@ -429,7 +429,7 @@ editor-plugins:
|
|
|
429
429
|
projection-error: 'Kan locatiecoördinaten niet converteren: {coords}'
|
|
430
430
|
contact: Bij blijvende problemen, contacteer <a href="mailto:{email}">{email}</a>.
|
|
431
431
|
nodeview:
|
|
432
|
-
placeholder:
|
|
432
|
+
placeholder: Adres
|
|
433
433
|
|
|
434
434
|
confidentiality-plugin:
|
|
435
435
|
redact: Redigeren
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import {
|
|
3
|
-
NodeSelection,
|
|
4
|
-
PNode,
|
|
5
|
-
ProsePlugin,
|
|
6
|
-
SayController,
|
|
7
|
-
SayView,
|
|
8
|
-
} from '@lblod/ember-rdfa-editor';
|
|
9
|
-
import { editableNodePlugin } from '@lblod/ember-rdfa-editor/plugins/editable-node';
|
|
10
|
-
import { tracked } from '@glimmer/tracking';
|
|
11
|
-
import { action } from '@ember/object';
|
|
12
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
EmberNodeArgs,
|
|
16
|
-
SayNodeViewConstructor,
|
|
17
|
-
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
18
|
-
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
19
|
-
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
20
|
-
import AuPill from '@appuniversum/ember-appuniversum/components/au-pill';
|
|
21
|
-
import { on } from '@ember/modifier';
|
|
22
|
-
import EmbeddedEditor from '@lblod/ember-rdfa-editor/components/ember-node/embedded-editor';
|
|
23
|
-
|
|
24
|
-
type Args = EmberNodeArgs & {
|
|
25
|
-
getPos: () => number | undefined;
|
|
26
|
-
node: PNode;
|
|
27
|
-
updateAttribute: (attr: string, value: unknown) => void;
|
|
28
|
-
controller: SayController;
|
|
29
|
-
view: SayView;
|
|
30
|
-
selected: boolean;
|
|
31
|
-
selectNode: () => void;
|
|
32
|
-
nodeViews: Record<string, SayNodeViewConstructor>;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default class AutoFilledVariableNodeViewComponent extends Component<Args> {
|
|
36
|
-
PencilIcon = PencilIcon;
|
|
37
|
-
|
|
38
|
-
@tracked innerView?: SayView;
|
|
39
|
-
|
|
40
|
-
get plugins(): ProsePlugin[] {
|
|
41
|
-
return [editableNodePlugin(this.args.getPos)];
|
|
42
|
-
}
|
|
43
|
-
@action
|
|
44
|
-
onClick() {
|
|
45
|
-
if (this.innerView) {
|
|
46
|
-
if (this.innerView.state.doc.firstChild?.type.name === 'placeholder') {
|
|
47
|
-
this.innerView.focus();
|
|
48
|
-
// Use request animation frame to only change the selection when the focus has been established
|
|
49
|
-
window.requestAnimationFrame(() => {
|
|
50
|
-
if (this.innerView) {
|
|
51
|
-
const tr = this.innerView.state.tr;
|
|
52
|
-
tr.setSelection(NodeSelection.create(this.innerView?.state.doc, 0));
|
|
53
|
-
this.innerView?.dispatch(tr);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
} else {
|
|
57
|
-
this.innerView.focus();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
@action
|
|
62
|
-
initEditor(view: SayView) {
|
|
63
|
-
this.innerView = view;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
get label() {
|
|
67
|
-
if (this.innerView?.state.doc.firstChild?.type.name !== 'placeholder') {
|
|
68
|
-
return '';
|
|
69
|
-
}
|
|
70
|
-
return getOutgoingTriple(this.args.node.attrs, EXT('label'))?.object.value;
|
|
71
|
-
}
|
|
72
|
-
<template>
|
|
73
|
-
<AuPill
|
|
74
|
-
@icon={{this.PencilIcon}}
|
|
75
|
-
@iconAlignment='right'
|
|
76
|
-
class='variable'
|
|
77
|
-
{{on 'click' this.onClick}}
|
|
78
|
-
>
|
|
79
|
-
<EmbeddedEditor
|
|
80
|
-
@controller={{@controller}}
|
|
81
|
-
@view={{@view}}
|
|
82
|
-
@getPos={{@getPos}}
|
|
83
|
-
@node={{@node}}
|
|
84
|
-
@selected={{@selected}}
|
|
85
|
-
@initEditor={{this.initEditor}}
|
|
86
|
-
@nodeViews={{@nodeViews}}
|
|
87
|
-
@plugins={{this.plugins}}
|
|
88
|
-
@updateAttribute={{@updateAttribute}}
|
|
89
|
-
@selectNode={{@selectNode}}
|
|
90
|
-
@placeholder=''
|
|
91
|
-
@contentDecorations={{@contentDecorations}}
|
|
92
|
-
/>
|
|
93
|
-
{{#if this.label}}
|
|
94
|
-
<span class='label'>
|
|
95
|
-
({{this.label}})
|
|
96
|
-
</span>
|
|
97
|
-
{{/if}}
|
|
98
|
-
</AuPill>
|
|
99
|
-
</template>
|
|
100
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<AuPill
|
|
3
|
-
@icon={{this.PencilIcon}}
|
|
4
|
-
@iconAlignment='right'
|
|
5
|
-
class='variable'
|
|
6
|
-
{{on 'click' this.onClick}}
|
|
7
|
-
>
|
|
8
|
-
<EmberNode::EmbeddedEditor
|
|
9
|
-
@controller={{@controller}}
|
|
10
|
-
@node={{@node}}
|
|
11
|
-
@view={{@view}}
|
|
12
|
-
@getPos={{@getPos}}
|
|
13
|
-
@selected={{@selected}}
|
|
14
|
-
@initEditor={{this.initEditor}}
|
|
15
|
-
@plugins={{this.plugins}}
|
|
16
|
-
@decorations={{@decorations}}
|
|
17
|
-
@contentDecorations={{@contentDecorations}}
|
|
18
|
-
/>
|
|
19
|
-
{{#if this.label}}
|
|
20
|
-
<span class='label'>
|
|
21
|
-
({{this.label}})
|
|
22
|
-
</span>
|
|
23
|
-
{{/if}}
|
|
24
|
-
</AuPill>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { NodeSelection, ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { editableNodePlugin } from '@lblod/ember-rdfa-editor/plugins/editable-node';
|
|
4
|
-
import { tracked } from '@glimmer/tracking';
|
|
5
|
-
import { action } from '@ember/object';
|
|
6
|
-
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
7
|
-
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
8
|
-
|
|
9
|
-
export default class LocationNodeViewComponent extends Component<EmberNodeArgs> {
|
|
10
|
-
PencilIcon = PencilIcon;
|
|
11
|
-
|
|
12
|
-
@tracked innerView?: SayView;
|
|
13
|
-
|
|
14
|
-
get plugins(): ProsePlugin[] {
|
|
15
|
-
return [editableNodePlugin(this.args.getPos)];
|
|
16
|
-
}
|
|
17
|
-
@action
|
|
18
|
-
onClick() {
|
|
19
|
-
if (this.innerView) {
|
|
20
|
-
if (this.innerView.state.doc.firstChild?.type.name === 'placeholder') {
|
|
21
|
-
this.innerView.focus();
|
|
22
|
-
// Use request animation frame to only change the selection when the focus has been established
|
|
23
|
-
window.requestAnimationFrame(() => {
|
|
24
|
-
if (this.innerView) {
|
|
25
|
-
const tr = this.innerView.state.tr;
|
|
26
|
-
tr.setSelection(NodeSelection.create(this.innerView?.state.doc, 0));
|
|
27
|
-
this.innerView?.dispatch(tr);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
} else {
|
|
31
|
-
this.innerView.focus();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
@action
|
|
36
|
-
initEditor(view: SayView) {
|
|
37
|
-
this.innerView = view;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
get label() {
|
|
41
|
-
if (this.innerView?.state.doc.firstChild?.type.name !== 'placeholder') {
|
|
42
|
-
return '';
|
|
43
|
-
}
|
|
44
|
-
return this.args.node.attrs.label as string;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { PNode, ProsePlugin, SayController, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { EmberNodeArgs, SayNodeViewConstructor } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
4
|
-
type Args = EmberNodeArgs & {
|
|
5
|
-
getPos: () => number | undefined;
|
|
6
|
-
node: PNode;
|
|
7
|
-
updateAttribute: (attr: string, value: unknown) => void;
|
|
8
|
-
controller: SayController;
|
|
9
|
-
view: SayView;
|
|
10
|
-
selected: boolean;
|
|
11
|
-
selectNode: () => void;
|
|
12
|
-
nodeViews: Record<string, SayNodeViewConstructor>;
|
|
13
|
-
};
|
|
14
|
-
export default class AutoFilledVariableNodeViewComponent extends Component<Args> {
|
|
15
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
16
|
-
innerView?: SayView;
|
|
17
|
-
get plugins(): ProsePlugin[];
|
|
18
|
-
onClick(): void;
|
|
19
|
-
initEditor(view: SayView): void;
|
|
20
|
-
get label(): string | undefined;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
4
|
-
export default class LocationNodeViewComponent extends Component<EmberNodeArgs> {
|
|
5
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
6
|
-
innerView?: SayView;
|
|
7
|
-
get plugins(): ProsePlugin[];
|
|
8
|
-
onClick(): void;
|
|
9
|
-
initEditor(view: SayView): void;
|
|
10
|
-
get label(): string;
|
|
11
|
-
}
|