@lblod/ember-rdfa-editor-lblod-plugins 22.1.0 → 22.2.0
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/CHANGELOG.md +8 -0
- package/addon/components/mandatee-table-plugin/node.gts +6 -2
- package/addon/components/variable-plugin/codelist/edit.ts +11 -11
- package/addon/components/variable-plugin/person/edit.ts +6 -6
- package/addon/plugins/mandatee-table-plugin/node.ts +20 -7
- package/app/styles/mandatee-table-plugin.scss +1 -1
- package/declarations/addon/components/variable-plugin/codelist/edit.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/person/edit.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 22.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#461](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/461) [`c3d659f`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/c3d659f0ddfb62c9241a8a34aea53a45375687f2) Thanks [@elpoelma](https://github.com/elpoelma)! - Improve serialization of `mandatee_table` node
|
|
8
|
+
|
|
9
|
+
- [#463](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/463) [`8c18bc2`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/8c18bc2106dd2a48231e5465bf0df9bf2e507d13) Thanks [@elpoelma](https://github.com/elpoelma)! - Fix issue with unresponsive edit/insert button when person variable is selected
|
|
10
|
+
|
|
3
11
|
## 22.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -36,9 +36,13 @@ export default class MandateeTableNode extends Component<Sig> {
|
|
|
36
36
|
<template>
|
|
37
37
|
<div class='say-mandatee-table-node'>
|
|
38
38
|
<div
|
|
39
|
-
class='say-mandatee-table-header au-u-flex au-u-flex--row au-u-flex--vertical-center'
|
|
39
|
+
class='say-mandatee-table-header au-u-flex au-u-flex--row au-u-flex--vertical-center au-u-flex--spaced-tiny'
|
|
40
40
|
>
|
|
41
|
-
<AuIcon
|
|
41
|
+
<AuIcon
|
|
42
|
+
@icon={{UserIcon}}
|
|
43
|
+
@size='large'
|
|
44
|
+
class='au-u-margin-left-tiny au-u-margin-right-tiny'
|
|
45
|
+
/>
|
|
42
46
|
<div>
|
|
43
47
|
<strong>{{this.title}}</strong>
|
|
44
48
|
<p>
|
|
@@ -33,7 +33,7 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
33
33
|
return this.args.controller;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
selectedCodelist
|
|
36
|
+
get selectedCodelist() {
|
|
37
37
|
const { selection } = this.controller.mainEditorState;
|
|
38
38
|
if (
|
|
39
39
|
selection instanceof NodeSelection &&
|
|
@@ -46,11 +46,11 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
46
46
|
return codelist;
|
|
47
47
|
}
|
|
48
48
|
return;
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
|
|
51
51
|
get source() {
|
|
52
|
-
if (this.selectedCodelist
|
|
53
|
-
const { node } = this.selectedCodelist
|
|
52
|
+
if (this.selectedCodelist) {
|
|
53
|
+
const { node } = this.selectedCodelist;
|
|
54
54
|
const source = getOutgoingTriple(node.attrs, DCT('source'))?.object
|
|
55
55
|
.value as Option<string>;
|
|
56
56
|
if (source) {
|
|
@@ -61,8 +61,8 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
get codelistUri() {
|
|
64
|
-
if (this.selectedCodelist
|
|
65
|
-
const { node } = this.selectedCodelist
|
|
64
|
+
if (this.selectedCodelist) {
|
|
65
|
+
const { node } = this.selectedCodelist;
|
|
66
66
|
const codelistUri = getOutgoingTriple(node.attrs, EXT('codelist'))?.object
|
|
67
67
|
.value as Option<string>;
|
|
68
68
|
if (codelistUri) {
|
|
@@ -73,11 +73,11 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
get showCard() {
|
|
76
|
-
return !!this.selectedCodelist
|
|
76
|
+
return !!this.selectedCodelist;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
get label() {
|
|
80
|
-
return this.selectedCodelist
|
|
80
|
+
return this.selectedCodelist?.node.attrs.label as string | undefined;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
codelistOptions = trackedFunction(this, async () => {
|
|
@@ -89,7 +89,7 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
get multiSelect() {
|
|
92
|
-
const localStyle = this.selectedCodelist
|
|
92
|
+
const localStyle = this.selectedCodelist?.node.attrs
|
|
93
93
|
.selectionStyle as string;
|
|
94
94
|
if (localStyle) {
|
|
95
95
|
return localStyle === 'multi';
|
|
@@ -99,11 +99,11 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
99
99
|
|
|
100
100
|
@action
|
|
101
101
|
insert() {
|
|
102
|
-
if (!this.selectedCodelist
|
|
102
|
+
if (!this.selectedCodelist || !this.selectedCodelistOption) {
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
updateCodelistVariable(
|
|
106
|
-
this.selectedCodelist
|
|
106
|
+
this.selectedCodelist,
|
|
107
107
|
this.selectedCodelistOption,
|
|
108
108
|
this.controller,
|
|
109
109
|
);
|
|
@@ -2,7 +2,6 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
3
|
import { SayController, PNode } from '@lblod/ember-rdfa-editor';
|
|
4
4
|
import { NodeSelection } from '@lblod/ember-rdfa-editor';
|
|
5
|
-
import { trackedFunction } from 'ember-resources/util/function';
|
|
6
5
|
import { tracked } from '@glimmer/tracking';
|
|
7
6
|
import { LmbPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/lmb-plugin';
|
|
8
7
|
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
@@ -24,7 +23,7 @@ export default class PersonEditComponent extends Component<Args> {
|
|
|
24
23
|
return this.args.controller;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
selectedPersonNode
|
|
26
|
+
get selectedPersonNode() {
|
|
28
27
|
const { selection } = this.controller.mainEditorState;
|
|
29
28
|
if (
|
|
30
29
|
selection instanceof NodeSelection &&
|
|
@@ -37,19 +36,20 @@ export default class PersonEditComponent extends Component<Args> {
|
|
|
37
36
|
return personNode;
|
|
38
37
|
}
|
|
39
38
|
return;
|
|
40
|
-
}
|
|
39
|
+
}
|
|
41
40
|
|
|
42
41
|
get showCard() {
|
|
43
|
-
return !!this.selectedPersonNode
|
|
42
|
+
return !!this.selectedPersonNode;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
get isEditing() {
|
|
47
|
-
const personNode = this.selectedPersonNode
|
|
46
|
+
const personNode = this.selectedPersonNode;
|
|
48
47
|
return !!personNode?.node.attrs.mandatee;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
@action
|
|
52
51
|
openModal() {
|
|
52
|
+
console.log('Open modal!!!');
|
|
53
53
|
this.controller.focus();
|
|
54
54
|
this.showModal = true;
|
|
55
55
|
}
|
|
@@ -60,7 +60,7 @@ export default class PersonEditComponent extends Component<Args> {
|
|
|
60
60
|
}
|
|
61
61
|
@action
|
|
62
62
|
onInsert(mandatee: Mandatee) {
|
|
63
|
-
const personNode = this.selectedPersonNode
|
|
63
|
+
const personNode = this.selectedPersonNode as PersonNode;
|
|
64
64
|
this.controller.withTransaction((tr) => {
|
|
65
65
|
tr.setNodeAttribute(personNode.pos, 'mandatee', mandatee);
|
|
66
66
|
return tr.setNodeAttribute(
|
|
@@ -30,25 +30,38 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
|
|
|
30
30
|
return [
|
|
31
31
|
'div',
|
|
32
32
|
{
|
|
33
|
-
'data-mandatee-table': true,
|
|
34
|
-
'data-tag': tag,
|
|
35
|
-
'data-title': title,
|
|
33
|
+
'data-say-mandatee-table': true,
|
|
34
|
+
'data-say-mandatee-table-tag': tag,
|
|
35
|
+
'data-say-mandatee-table-title': title,
|
|
36
|
+
class: 'say-mandatee-table-node',
|
|
36
37
|
},
|
|
37
|
-
|
|
38
|
+
['p', { class: 'say-mandatee-table-header' }, ['strong', {}, title]],
|
|
39
|
+
[
|
|
40
|
+
'div',
|
|
41
|
+
{
|
|
42
|
+
class: 'say-mandatee-table-content',
|
|
43
|
+
'data-say-mandatee-table-content': true,
|
|
44
|
+
},
|
|
45
|
+
0,
|
|
46
|
+
],
|
|
38
47
|
];
|
|
39
48
|
},
|
|
40
49
|
parseDOM: [
|
|
41
50
|
{
|
|
42
51
|
tag: 'div',
|
|
43
52
|
getAttrs(element: HTMLElement) {
|
|
44
|
-
if (
|
|
53
|
+
if (
|
|
54
|
+
element.dataset.sayMandateeTable &&
|
|
55
|
+
element.dataset.sayMandateeTableTag
|
|
56
|
+
) {
|
|
45
57
|
return {
|
|
46
|
-
tag: element.dataset.
|
|
47
|
-
title: element.dataset.
|
|
58
|
+
tag: element.dataset.sayMandateeTableTag,
|
|
59
|
+
title: element.dataset.sayMandateeTableTitle,
|
|
48
60
|
};
|
|
49
61
|
}
|
|
50
62
|
return false;
|
|
51
63
|
},
|
|
64
|
+
contentElement: `div[data-say-mandatee-table-content]`,
|
|
52
65
|
},
|
|
53
66
|
],
|
|
54
67
|
};
|
|
@@ -11,10 +11,10 @@ type Args = {
|
|
|
11
11
|
export default class CodelistEditComponent extends Component<Args> {
|
|
12
12
|
selectedCodelistOption?: CodeListOption | CodeListOption[];
|
|
13
13
|
get controller(): SayController;
|
|
14
|
-
selectedCodelist:
|
|
14
|
+
get selectedCodelist(): {
|
|
15
15
|
node: import("prosemirror-model").Node;
|
|
16
16
|
pos: number;
|
|
17
|
-
} | undefined
|
|
17
|
+
} | undefined;
|
|
18
18
|
get source(): string;
|
|
19
19
|
get codelistUri(): string | undefined;
|
|
20
20
|
get showCard(): boolean;
|
|
@@ -13,7 +13,7 @@ type PersonNode = {
|
|
|
13
13
|
export default class PersonEditComponent extends Component<Args> {
|
|
14
14
|
showModal: boolean;
|
|
15
15
|
get controller(): SayController;
|
|
16
|
-
selectedPersonNode:
|
|
16
|
+
get selectedPersonNode(): PersonNode | undefined;
|
|
17
17
|
get showCard(): boolean;
|
|
18
18
|
get isEditing(): boolean;
|
|
19
19
|
openModal(): void;
|