@lblod/ember-rdfa-editor-lblod-plugins 22.2.1 → 22.2.2-dev.2311682f4b02518af23dda3885b2e2aeedc5c9e8
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/cold-schools-heal.md +5 -0
- package/CHANGELOG.md +8 -0
- package/addon/components/mandatee-table-plugin/insert.gts +0 -10
- package/addon/plugins/variable-plugin/variables/person.ts +15 -3
- package/declarations/addon/components/mandatee-table-plugin/insert.d.ts +0 -2
- package/package.json +1 -1
- package/translations/en-US.yaml +1 -1
- package/translations/nl-BE.yaml +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 22.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#465](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/465) [`83b95db`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/83b95db9991f6b5ef090cd77765d8c09eac90db7) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Correctly export empty person nodes
|
|
8
|
+
|
|
9
|
+
- [#465](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/465) [`be233e8`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/be233e8bc70aee1db00644ad6f956157da8d3a20) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Correctly export empty person node
|
|
10
|
+
|
|
3
11
|
## 22.2.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -3,8 +3,6 @@ import { AddIcon } from '@appuniversum/ember-appuniversum/components/icons/add';
|
|
|
3
3
|
import { on } from '@ember/modifier';
|
|
4
4
|
import Component from '@glimmer/component';
|
|
5
5
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
6
|
-
import { not } from 'ember-truth-helpers';
|
|
7
|
-
import { getCurrentBesluitRange } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin/utils/helpers';
|
|
8
6
|
import { action } from '@ember/object';
|
|
9
7
|
import { unwrap } from '@lblod/ember-rdfa-editor/utils/_private/option';
|
|
10
8
|
import t from 'ember-intl/helpers/t';
|
|
@@ -17,9 +15,6 @@ export default class InsertMandateeTableComponent extends Component<Sig> {
|
|
|
17
15
|
get controller() {
|
|
18
16
|
return this.args.controller;
|
|
19
17
|
}
|
|
20
|
-
get decisionRange() {
|
|
21
|
-
return getCurrentBesluitRange(this.controller);
|
|
22
|
-
}
|
|
23
18
|
|
|
24
19
|
@action
|
|
25
20
|
insert() {
|
|
@@ -33,10 +28,6 @@ export default class InsertMandateeTableComponent extends Component<Sig> {
|
|
|
33
28
|
});
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
get canInsert() {
|
|
37
|
-
return Boolean(this.decisionRange);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
31
|
<template>
|
|
41
32
|
<li class='au-c-list__item'>
|
|
42
33
|
<AuButton
|
|
@@ -44,7 +35,6 @@ export default class InsertMandateeTableComponent extends Component<Sig> {
|
|
|
44
35
|
@icon={{AddIcon}}
|
|
45
36
|
@iconAlignment='left'
|
|
46
37
|
@skin='link'
|
|
47
|
-
@disabled={{not this.canInsert}}
|
|
48
38
|
>
|
|
49
39
|
{{t 'mandatee-table-plugin.insert.title'}}
|
|
50
40
|
</AuButton>
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
10
10
|
import {
|
|
11
11
|
DOMOutputSpec,
|
|
12
|
+
EditorState,
|
|
12
13
|
getRdfaAttrs,
|
|
13
14
|
PNode,
|
|
14
15
|
rdfaAttrSpec,
|
|
@@ -19,6 +20,11 @@ import type { ComponentLike } from '@glint/template';
|
|
|
19
20
|
import { hasOutgoingNamedNodeTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
20
21
|
import { renderRdfaAware } from '@lblod/ember-rdfa-editor/core/schema';
|
|
21
22
|
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
23
|
+
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
24
|
+
|
|
25
|
+
const TRANSLATION_FALLBACKS = {
|
|
26
|
+
nodeview_placeholder: 'persoon',
|
|
27
|
+
};
|
|
22
28
|
|
|
23
29
|
const rdfaAware = true;
|
|
24
30
|
const parseDOM = [
|
|
@@ -50,7 +56,8 @@ const parseDOM = [
|
|
|
50
56
|
},
|
|
51
57
|
];
|
|
52
58
|
|
|
53
|
-
const
|
|
59
|
+
const serialize = (node: PNode, state: EditorState): DOMOutputSpec => {
|
|
60
|
+
const t = getTranslationFunction(state);
|
|
54
61
|
const mandatee = node.attrs.mandatee as Mandatee;
|
|
55
62
|
return renderRdfaAware({
|
|
56
63
|
renderable: node,
|
|
@@ -59,7 +66,12 @@ const toDOM = (node: PNode): DOMOutputSpec => {
|
|
|
59
66
|
...node.attrs,
|
|
60
67
|
'data-mandatee': JSON.stringify(mandatee),
|
|
61
68
|
},
|
|
62
|
-
content: mandatee
|
|
69
|
+
content: mandatee
|
|
70
|
+
? `${mandatee.fullName}`
|
|
71
|
+
: t(
|
|
72
|
+
'variable-plugin.person.nodeview-placeholder',
|
|
73
|
+
TRANSLATION_FALLBACKS.nodeview_placeholder,
|
|
74
|
+
),
|
|
63
75
|
});
|
|
64
76
|
};
|
|
65
77
|
|
|
@@ -85,7 +97,7 @@ const emberNodeConfig: EmberNodeConfig = {
|
|
|
85
97
|
default: null,
|
|
86
98
|
},
|
|
87
99
|
},
|
|
88
|
-
|
|
100
|
+
serialize,
|
|
89
101
|
parseDOM,
|
|
90
102
|
};
|
|
91
103
|
|
|
@@ -8,8 +8,6 @@ interface Sig {
|
|
|
8
8
|
}
|
|
9
9
|
export default class InsertMandateeTableComponent extends Component<Sig> {
|
|
10
10
|
get controller(): SayController;
|
|
11
|
-
get decisionRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
12
11
|
insert(): void;
|
|
13
|
-
get canInsert(): boolean;
|
|
14
12
|
}
|
|
15
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.2-dev.2311682f4b02518af23dda3885b2e2aeedc5c9e8",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
package/translations/en-US.yaml
CHANGED