@lblod/ember-rdfa-editor-lblod-plugins 26.3.1 → 26.4.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 +16 -0
- package/addon/components/citation-plugin/citation-card.hbs +2 -3
- package/addon/components/citation-plugin/citations/legal-document-detail.hbs +3 -1
- package/addon/components/location-plugin/edit.gts +1 -1
- package/addon/components/location-plugin/insert.gts +1 -1
- package/addon/components/location-plugin/map.gts +2 -2
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.hbs +3 -2
- package/addon/components/snippet-plugin/nodes/snippet.gts +4 -4
- package/addon/components/snippet-plugin/search-modal.ts +3 -3
- package/addon/components/snippet-plugin/snippet-insert-placeholder.gts +2 -2
- package/addon/components/snippet-plugin/snippet-insert-rdfa.gts +7 -7
- package/addon/components/snippet-plugin/snippet-insert.gts +2 -2
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.hbs +1 -1
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.ts +7 -7
- package/addon/components/snippet-plugin/snippet-list/snippet-list-view.hbs +2 -2
- package/addon/components/snippet-plugin/snippet-list/snippet-list-view.ts +12 -12
- package/addon/components/snippet-plugin/snippet-list-select.gts +9 -9
- package/addon/components/table-of-contents-plugin/ember-nodes/outline.hbs +1 -1
- package/addon/components/variable-plugin/date/date-time-picker.ts +0 -1
- package/addon/plugins/snippet-plugin/commands/update-snippet-placeholder.ts +1 -2
- package/addon/plugins/snippet-plugin/index.ts +5 -6
- package/addon/plugins/snippet-plugin/nodes/snippet-placeholder.ts +5 -5
- package/addon/plugins/snippet-plugin/nodes/snippet.ts +6 -3
- package/addon/plugins/snippet-plugin/utils/fetch-data.ts +16 -17
- package/addon/plugins/snippet-plugin/utils/rdfa-predicate.ts +12 -13
- package/addon/utils/sparql-helpers.ts +10 -0
- package/addon/utils/translation.ts +2 -6
- package/declarations/addon/components/article-structure-plugin/article-structure-card.d.ts +1 -1
- package/declarations/addon/components/article-structure-plugin/structure-card.d.ts +3 -3
- package/declarations/addon/components/besluit-topic-plugin/besluit-topic-select.d.ts +1 -1
- package/declarations/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.d.ts +3 -3
- package/declarations/addon/components/besluit-type-plugin/besluit-type-select.d.ts +1 -1
- package/declarations/addon/components/besluit-type-plugin/toolbar-dropdown.d.ts +4 -4
- package/declarations/addon/components/citation-plugin/citation-card.d.ts +2 -2
- package/declarations/addon/components/citation-plugin/citation-insert.d.ts +1 -1
- package/declarations/addon/components/citation-plugin/citations/article-preview.d.ts +1 -1
- package/declarations/addon/components/citation-plugin/citations/legal-document-detail.d.ts +7 -7
- package/declarations/addon/components/citation-plugin/citations/legal-document-preview.d.ts +4 -4
- package/declarations/addon/components/citation-plugin/citations/search-modal.d.ts +2 -2
- package/declarations/addon/components/common/search/alert-load-error.d.ts +0 -2
- package/declarations/addon/components/common/search/alert-no-items.d.ts +0 -2
- package/declarations/addon/components/common/sort/sortable-table-header.d.ts +3 -3
- package/declarations/addon/components/confidentiality-plugin/redact.d.ts +0 -2
- package/declarations/addon/components/document-title-plugin/insert-title-card.d.ts +1 -1
- package/declarations/addon/components/generic-rdfa-variable/insert-menu.d.ts +1 -1
- package/declarations/addon/components/lmb-plugin/insert.d.ts +1 -1
- package/declarations/addon/components/loading-alert.d.ts +1 -1
- package/declarations/addon/components/location-plugin/edit.d.ts +1 -1
- package/declarations/addon/components/lpdc-plugin/lpdc-insert.d.ts +1 -1
- package/declarations/addon/components/lpdc-plugin/lpdc-modal.d.ts +2 -2
- package/declarations/addon/components/pagination/pagination-view.d.ts +0 -2
- package/declarations/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +1 -1
- package/declarations/addon/components/roadsign-regulation-plugin/roadsigns-pagination.d.ts +2 -2
- package/declarations/addon/components/roadsign-regulation-plugin/roadsigns-table.d.ts +2 -2
- package/declarations/addon/components/snippet-plugin/search-modal.d.ts +1 -1
- package/declarations/addon/components/snippet-plugin/snippet-list/snippet-list-modal.d.ts +3 -3
- package/declarations/addon/components/snippet-plugin/snippet-list/snippet-list-view.d.ts +3 -3
- package/declarations/addon/components/snippet-plugin/snippet-list-select-rdfa.d.ts +0 -2
- package/declarations/addon/components/snippet-plugin/snippet-list-select.d.ts +2 -2
- package/declarations/addon/components/standard-template-plugin/card.d.ts +1 -1
- package/declarations/addon/components/template-comments-plugin/edit-card.d.ts +3 -3
- package/declarations/addon/components/template-comments-plugin/insert.d.ts +1 -1
- package/declarations/addon/components/template-comments-plugin/template-comment.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/address/edit.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/address/insert.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/date/date-time-picker.d.ts +0 -1
- package/declarations/addon/components/variable-plugin/date/edit.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/date/insert.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/utils/label-input.d.ts +0 -2
- package/declarations/addon/components/worship-plugin/insert.d.ts +1 -1
- package/declarations/addon/helpers/capitalize.d.ts +1 -1
- package/declarations/addon/helpers/in-array.d.ts +1 -7
- package/declarations/addon/helpers/limit-text.d.ts +1 -1
- package/declarations/addon/models/sign.d.ts +1 -1
- package/declarations/addon/plugins/article-structure-plugin/commands/move-selected-structure.d.ts +1 -1
- package/declarations/addon/plugins/article-structure-plugin/utils/structure.d.ts +1 -1
- package/declarations/addon/plugins/citation-plugin/utils/types.d.ts +3 -3
- package/declarations/addon/plugins/decision-plugin/commands/insert-description.d.ts +1 -1
- package/declarations/addon/plugins/decision-plugin/commands/insert-title.d.ts +1 -1
- package/declarations/addon/plugins/lpdc-plugin/api.d.ts +2 -2
- package/declarations/addon/plugins/snippet-plugin/commands/update-snippet-placeholder.d.ts +1 -1
- package/declarations/addon/plugins/snippet-plugin/index.d.ts +4 -4
- package/declarations/addon/plugins/snippet-plugin/nodes/snippet.d.ts +1 -1
- package/declarations/addon/plugins/snippet-plugin/utils/fetch-data.d.ts +1 -1
- package/declarations/addon/plugins/snippet-plugin/utils/rdfa-predicate.d.ts +7 -4
- package/declarations/addon/services/import-rdfa-snippet.d.ts +0 -2
- package/declarations/addon/services/roadsign-registry.d.ts +5 -5
- package/declarations/addon/utils/sparql-helpers.d.ts +1 -0
- package/declarations/addon/utils/translation.d.ts +1 -1
- package/index.js +22 -0
- package/package.json +31 -48
- package/pnpm-lock.yaml +1703 -1589
- package/translations/appuniversum/en-us.yaml +0 -1
- package/translations/appuniversum/nl-be.yaml +0 -1
- package/types/dummy/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 26.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#528](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/528) [`0a70aed`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/0a70aedf1d656d7bf85b0c528317f6bbcac62f37) Thanks [@piemonkey](https://github.com/piemonkey)! - Add support for Ember 5.4+
|
|
8
|
+
|
|
9
|
+
- [#528](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/528) [`b7f426f`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/b7f426f3bd174320ee2a4963d1f103d6ab60459f) Thanks [@piemonkey](https://github.com/piemonkey)! - Update test-app to use ember-source 5.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#525](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/525) [`f7eb06c`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/f7eb06c3e134f2b044c6ee73f3652cefc2e7d286) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Convert snippet plugin to use uri instead of id
|
|
14
|
+
|
|
15
|
+
- [#528](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/528) [`7373171`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/73731715f3ebf2dc949ca361e80e935a85534a9b) Thanks [@piemonkey](https://github.com/piemonkey)! - Add support for ember-concurrency 4 and ember-power-select 8
|
|
16
|
+
|
|
17
|
+
- [#530](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/530) [`3bf983c`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/3bf983cc910dfe96a88a669f6da2861bf5891bc2) Thanks [@elpoelma](https://github.com/elpoelma)! - Move to builtin ember.js types
|
|
18
|
+
|
|
3
19
|
## 26.3.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -78,10 +78,9 @@
|
|
|
78
78
|
</c.content>
|
|
79
79
|
<c.footer class='au-u-background-gray-100 au-u-padding-none'>
|
|
80
80
|
{{#if this.legalDocumentsResource.isRunning}}
|
|
81
|
-
<AuLoader
|
|
82
|
-
<span class='au-u-hidden-visually'>{{t
|
|
81
|
+
<AuLoader @hideMessage={{true}}>{{t
|
|
83
82
|
'citaten-plugin.alert.loading'
|
|
84
|
-
}}</
|
|
83
|
+
}}</AuLoader>
|
|
85
84
|
{{else}}
|
|
86
85
|
{{#if this.error}}
|
|
87
86
|
<Common::Search::AlertLoadError
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
<div>
|
|
62
62
|
{{#if this.articleResource.isRunning}}
|
|
63
63
|
<div class='au-o-box'>
|
|
64
|
-
<AuLoader @
|
|
64
|
+
<AuLoader @hideMessage={{true}}>{{t
|
|
65
|
+
'common.search.loading'
|
|
66
|
+
}}</AuLoader>
|
|
65
67
|
<span class='au-u-hidden-visually'>{{t
|
|
66
68
|
'citaten-plugin.alert.loading'
|
|
67
69
|
}}</span>
|
|
@@ -6,7 +6,6 @@ import { trackedReset } from 'tracked-toolbox';
|
|
|
6
6
|
import { trackedTask } from 'reactiveweb/ember-concurrency';
|
|
7
7
|
import { service } from '@ember/service';
|
|
8
8
|
import { on } from '@ember/modifier';
|
|
9
|
-
import type { SafeString } from '@ember/template/-private/handlebars';
|
|
10
9
|
import not from 'ember-truth-helpers/helpers/not';
|
|
11
10
|
import eq from 'ember-truth-helpers/helpers/eq';
|
|
12
11
|
import IntlService from 'ember-intl/services/intl';
|
|
@@ -35,6 +34,7 @@ import {
|
|
|
35
34
|
import { type Point } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/utils/geo-helpers';
|
|
36
35
|
import { type NodeContentsUtils } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/node-contents';
|
|
37
36
|
import { type LocationType } from './map';
|
|
37
|
+
import { type SafeString } from '@ember/template';
|
|
38
38
|
|
|
39
39
|
interface Message {
|
|
40
40
|
skin: AuAlertSignature['Args']['skin'];
|
|
@@ -245,12 +245,12 @@ export default class LocationPluginInsertComponent extends Component<Signature>
|
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
if (toInsert) {
|
|
248
|
+
this.modalOpen = false;
|
|
248
249
|
replaceSelectionWithLocation(
|
|
249
250
|
this.controller,
|
|
250
251
|
toInsert,
|
|
251
252
|
this.args.config.subjectTypesToLinkTo,
|
|
252
253
|
);
|
|
253
|
-
this.modalOpen = false;
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -283,7 +283,7 @@ export default class LocationPluginMapComponent extends Component<Signature> {
|
|
|
283
283
|
{{#each this.vertices as |vertex index|}}
|
|
284
284
|
<layers.marker
|
|
285
285
|
@location={{vertex}}
|
|
286
|
-
@onClick={{
|
|
286
|
+
@onClick={{fn this.onVertexClick index}}
|
|
287
287
|
as |marker|
|
|
288
288
|
>
|
|
289
289
|
{{#if (eq index 0)}}
|
|
@@ -300,7 +300,7 @@ export default class LocationPluginMapComponent extends Component<Signature> {
|
|
|
300
300
|
{{/if}}
|
|
301
301
|
{{#if (areaLocations @locationType @existingArea)}}
|
|
302
302
|
<layers.polygon
|
|
303
|
-
@locations={{
|
|
303
|
+
@locations={{areaLocations @locationType @existingArea}}
|
|
304
304
|
/>
|
|
305
305
|
{{/if}}
|
|
306
306
|
</MapWrapper>
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
{{#if @isLoading}}
|
|
22
22
|
<tr>
|
|
23
23
|
<td colspan='100%' class='is-loading-data'>
|
|
24
|
-
<AuLoader
|
|
25
|
-
|
|
24
|
+
<AuLoader>
|
|
25
|
+
{{t 'editor-plugins.utils.loading'}}
|
|
26
|
+
</AuLoader>
|
|
26
27
|
</td>
|
|
27
28
|
</tr>
|
|
28
29
|
{{else}}
|
|
@@ -32,7 +32,7 @@ import { recalculateNumbers } from '@lblod/ember-rdfa-editor-lblod-plugins/plugi
|
|
|
32
32
|
import { createSnippetPlaceholder } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/nodes/snippet-placeholder';
|
|
33
33
|
import { hasDecendant } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/has-descendant';
|
|
34
34
|
import SnippetPlaceholder from '@lblod/ember-rdfa-editor-lblod-plugins/components/snippet-plugin/nodes/placeholder';
|
|
35
|
-
import {
|
|
35
|
+
import { getSnippetListUrisFromNode } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
36
36
|
|
|
37
37
|
interface ButtonSig {
|
|
38
38
|
Args: {
|
|
@@ -129,7 +129,7 @@ export default class SnippetNode extends Component<Signature> {
|
|
|
129
129
|
const node = createSnippetPlaceholder({
|
|
130
130
|
listProperties: {
|
|
131
131
|
placeholderId: this.node.attrs.placeholderId,
|
|
132
|
-
|
|
132
|
+
listUris: getSnippetListUrisFromNode(this.node),
|
|
133
133
|
names: this.node.attrs.snippetListNames,
|
|
134
134
|
importedResources: this.node.attrs.importedResources,
|
|
135
135
|
},
|
|
@@ -200,7 +200,7 @@ export default class SnippetNode extends Component<Signature> {
|
|
|
200
200
|
title,
|
|
201
201
|
listProperties: {
|
|
202
202
|
placeholderId: this.node.attrs.placeholderId,
|
|
203
|
-
|
|
203
|
+
listUris: getSnippetListUrisFromNode(this.node),
|
|
204
204
|
names: this.node.attrs.snippetListNames,
|
|
205
205
|
importedResources: this.node.attrs.importedResources,
|
|
206
206
|
},
|
|
@@ -259,7 +259,7 @@ export default class SnippetNode extends Component<Signature> {
|
|
|
259
259
|
@closeModal={{this.closeModal}}
|
|
260
260
|
@config={{this.node.attrs.config}}
|
|
261
261
|
@onInsert={{this.onInsert}}
|
|
262
|
-
@
|
|
262
|
+
@snippetListUris={{getSnippetListUrisFromNode this.node}}
|
|
263
263
|
@snippetListNames={{this.node.attrs.snippetListNames}}
|
|
264
264
|
/>
|
|
265
265
|
</template>
|
|
@@ -11,7 +11,7 @@ import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plug
|
|
|
11
11
|
|
|
12
12
|
interface Args {
|
|
13
13
|
config: SnippetPluginConfig;
|
|
14
|
-
|
|
14
|
+
snippetListUris: string[] | undefined;
|
|
15
15
|
snippetListNames: string[] | undefined;
|
|
16
16
|
closeModal: () => void;
|
|
17
17
|
open: boolean;
|
|
@@ -69,7 +69,7 @@ export default class SnippetPluginSearchModalComponent extends Component<Args> {
|
|
|
69
69
|
abortSignal: abortController.signal,
|
|
70
70
|
filter: {
|
|
71
71
|
name: this.inputSearchText ?? undefined,
|
|
72
|
-
|
|
72
|
+
snippetListUris: this.args.snippetListUris ?? undefined,
|
|
73
73
|
},
|
|
74
74
|
pagination: {
|
|
75
75
|
pageNumber: this.pageNumber,
|
|
@@ -92,7 +92,7 @@ export default class SnippetPluginSearchModalComponent extends Component<Args> {
|
|
|
92
92
|
this.inputSearchText,
|
|
93
93
|
this.pageNumber,
|
|
94
94
|
this.pageSize,
|
|
95
|
-
this.args.
|
|
95
|
+
this.args.snippetListUris,
|
|
96
96
|
]);
|
|
97
97
|
|
|
98
98
|
@action
|
|
@@ -64,7 +64,7 @@ export default class SnippetPluginSnippetInsertPlaceholder extends Component<Sig
|
|
|
64
64
|
@icon={{AddIcon}}
|
|
65
65
|
@iconAlignment='left'
|
|
66
66
|
@skin='link'
|
|
67
|
-
@disabled={{
|
|
67
|
+
@disabled={{not this.placeholderNode}}
|
|
68
68
|
{{on 'click' this.openModal}}
|
|
69
69
|
>
|
|
70
70
|
{{t 'snippet-plugin.insert.placeholder'}}
|
|
@@ -72,7 +72,7 @@ export default class SnippetPluginSnippetInsertPlaceholder extends Component<Sig
|
|
|
72
72
|
</li>
|
|
73
73
|
<SnippetListModal
|
|
74
74
|
@config={{@config}}
|
|
75
|
-
@
|
|
75
|
+
@snippetListUris={{empty}}
|
|
76
76
|
@allowMultipleSnippets={{false}}
|
|
77
77
|
@onSaveSnippetLists={{this.insertPlaceholder}}
|
|
78
78
|
@open={{this.isModalOpen}}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type SnippetPluginConfig,
|
|
8
8
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
9
9
|
import { findParentNodeClosestToPos } from '@curvenote/prosemirror-utils';
|
|
10
|
-
import {
|
|
10
|
+
import { getSnippetListUrisFromNode } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
11
11
|
import { ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
12
12
|
import SnippetInsert from './snippet-insert';
|
|
13
13
|
|
|
@@ -22,11 +22,11 @@ interface Sig {
|
|
|
22
22
|
export default class SnippetInsertRdfaComponent extends Component<Sig> {
|
|
23
23
|
get listProperties(): SnippetListProperties | undefined {
|
|
24
24
|
const activeNode = this.args.node.value;
|
|
25
|
-
const
|
|
25
|
+
const listUris = getSnippetListUrisFromNode(activeNode);
|
|
26
26
|
|
|
27
|
-
if (
|
|
27
|
+
if (listUris.length > 0) {
|
|
28
28
|
return {
|
|
29
|
-
|
|
29
|
+
listUris,
|
|
30
30
|
placeholderId: activeNode.attrs.placeholderId,
|
|
31
31
|
names: activeNode.attrs.snippetListNames,
|
|
32
32
|
importedResources: activeNode.attrs.importedResources,
|
|
@@ -44,11 +44,11 @@ export default class SnippetInsertRdfaComponent extends Component<Sig> {
|
|
|
44
44
|
isResourceNode(node),
|
|
45
45
|
);
|
|
46
46
|
while (parentNode) {
|
|
47
|
-
const
|
|
47
|
+
const listUris = getSnippetListUrisFromNode(parentNode.node);
|
|
48
48
|
|
|
49
|
-
if (
|
|
49
|
+
if (listUris.length > 0) {
|
|
50
50
|
return {
|
|
51
|
-
|
|
51
|
+
listUris,
|
|
52
52
|
placeholderId: parentNode.node.attrs.placeholderId,
|
|
53
53
|
names: parentNode.node.attrs.snippetListNames,
|
|
54
54
|
importedResources: parentNode.node.attrs.importedResources,
|
|
@@ -31,7 +31,7 @@ export default class SnippetInsertComponent extends Component<Sig> {
|
|
|
31
31
|
return this.args.controller;
|
|
32
32
|
}
|
|
33
33
|
get disabled() {
|
|
34
|
-
return (this.args.listProperties?.
|
|
34
|
+
return (this.args.listProperties?.listUris.length ?? 0) === 0;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@action
|
|
@@ -88,7 +88,7 @@ export default class SnippetInsertComponent extends Component<Sig> {
|
|
|
88
88
|
@closeModal={{this.closeModal}}
|
|
89
89
|
@config={{@config}}
|
|
90
90
|
@onInsert={{this.onInsert}}
|
|
91
|
-
@
|
|
91
|
+
@snippetListUris={{@listProperties.listUris}}
|
|
92
92
|
@snippetListNames={{@listProperties.names}}
|
|
93
93
|
/>
|
|
94
94
|
</template>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
{{else}}
|
|
20
20
|
<SnippetPlugin::SnippetList::SnippetListView
|
|
21
21
|
@snippetLists={{this.snippetListResource.value}}
|
|
22
|
-
@
|
|
22
|
+
@snippetListUris={{this.snippetListUris}}
|
|
23
23
|
@listNameFilter={{this.nameFilterText}}
|
|
24
24
|
@sort={{this.sort}}
|
|
25
25
|
@onChange={{this.onChange}}
|
|
@@ -23,7 +23,7 @@ interface Signature {
|
|
|
23
23
|
lists: SnippetList[],
|
|
24
24
|
allowMultipleSnippets: boolean,
|
|
25
25
|
) => void;
|
|
26
|
-
|
|
26
|
+
snippetListUris: string[] | undefined;
|
|
27
27
|
closeModal: () => void;
|
|
28
28
|
open: boolean;
|
|
29
29
|
allowMultipleSnippets?: boolean;
|
|
@@ -40,8 +40,8 @@ export default class SnippetListModalComponent extends Component<Signature> {
|
|
|
40
40
|
// Display
|
|
41
41
|
@tracked error: unknown;
|
|
42
42
|
|
|
43
|
-
@trackedReset('args.
|
|
44
|
-
|
|
43
|
+
@trackedReset('args.snippetListUris')
|
|
44
|
+
snippetListUris: string[] = [...(this.args.snippetListUris ?? [])];
|
|
45
45
|
|
|
46
46
|
@localCopy('args.allowMultipleSnippets') allowMultipleSnippets = false;
|
|
47
47
|
|
|
@@ -63,7 +63,7 @@ export default class SnippetListModalComponent extends Component<Signature> {
|
|
|
63
63
|
@action
|
|
64
64
|
saveAndClose() {
|
|
65
65
|
const snippetLists = this.snippetListResource.value?.filter((snippetList) =>
|
|
66
|
-
this.
|
|
66
|
+
this.snippetListUris.includes(snippetList.uri),
|
|
67
67
|
);
|
|
68
68
|
this.args.onSaveSnippetLists(
|
|
69
69
|
snippetLists || [],
|
|
@@ -71,7 +71,7 @@ export default class SnippetListModalComponent extends Component<Signature> {
|
|
|
71
71
|
);
|
|
72
72
|
this.args.closeModal();
|
|
73
73
|
// Clear selection for next time
|
|
74
|
-
this.
|
|
74
|
+
this.snippetListUris = [];
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
snippetListSearch = restartableTask(async () => {
|
|
@@ -105,7 +105,7 @@ export default class SnippetListModalComponent extends Component<Signature> {
|
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
@action
|
|
108
|
-
onChange(
|
|
109
|
-
this.
|
|
108
|
+
onChange(snippetListUris: string[]) {
|
|
109
|
+
this.snippetListUris = snippetListUris;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
<td class='snippet-list-table-select-column'>
|
|
53
53
|
<AuCheckbox
|
|
54
54
|
id={{row.label}}
|
|
55
|
-
@onChange={{fn this.onChange row.
|
|
56
|
-
@checked={{in-array @
|
|
55
|
+
@onChange={{fn this.onChange row.uri}}
|
|
56
|
+
@checked={{in-array @snippetListUris row.uri}}
|
|
57
57
|
/>
|
|
58
58
|
</td>
|
|
59
59
|
<td>{{row.label}}</td>
|
|
@@ -4,26 +4,26 @@ import { SnippetList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snip
|
|
|
4
4
|
|
|
5
5
|
interface Args {
|
|
6
6
|
snippetLists: SnippetList[];
|
|
7
|
-
|
|
7
|
+
snippetListUris: string[];
|
|
8
8
|
listNameFilter: string | null;
|
|
9
9
|
isLoading: boolean;
|
|
10
|
-
onChange: (
|
|
10
|
+
onChange: (snippetListUris: string[]) => void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export default class SnippetListViewComponent extends Component<Args> {
|
|
14
14
|
@action
|
|
15
|
-
onChange(
|
|
15
|
+
onChange(snippetUri: string, isSelected: boolean) {
|
|
16
16
|
if (isSelected) {
|
|
17
|
-
const
|
|
17
|
+
const newSnippetListUris = [...this.args.snippetListUris, snippetUri];
|
|
18
18
|
|
|
19
|
-
return this.args.onChange(
|
|
19
|
+
return this.args.onChange(newSnippetListUris);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const
|
|
23
|
-
(
|
|
22
|
+
const newSnippetListUris = this.args.snippetListUris.filter(
|
|
23
|
+
(uri) => uri !== snippetUri,
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
-
return this.args.onChange(
|
|
26
|
+
return this.args.onChange(newSnippetListUris);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@action
|
|
@@ -40,15 +40,15 @@ export default class SnippetListViewComponent extends Component<Args> {
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const snippetListUri = snippetList.uri;
|
|
44
44
|
|
|
45
|
-
if (!
|
|
45
|
+
if (!snippetListUri) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const isSelected = this.args.
|
|
49
|
+
const isSelected = this.args.snippetListUris.includes(snippetListUri);
|
|
50
50
|
|
|
51
|
-
this.onChange(
|
|
51
|
+
this.onChange(snippetListUri, !isSelected);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
get snippetLists() {
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
type SnippetList,
|
|
17
17
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
18
18
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
getAssignedSnippetListsUrisFromProperties,
|
|
20
|
+
getSnippetListUrisProperties,
|
|
21
21
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
22
22
|
import { updateSnippetPlaceholder } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/commands';
|
|
23
23
|
|
|
@@ -49,13 +49,13 @@ export default class SnippetListSelect extends Component<Signature> {
|
|
|
49
49
|
return isResourceNode(this.args.node.value);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
get
|
|
53
|
-
return
|
|
52
|
+
get snippetListUrisProperties(): OutgoingTriple[] {
|
|
53
|
+
return getSnippetListUrisProperties(this.args.node.value);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
get
|
|
57
|
-
return
|
|
58
|
-
this.
|
|
56
|
+
get snippetListUris(): string[] {
|
|
57
|
+
return getAssignedSnippetListsUrisFromProperties(
|
|
58
|
+
this.snippetListUrisProperties,
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -73,7 +73,7 @@ export default class SnippetListSelect extends Component<Signature> {
|
|
|
73
73
|
this.args.controller?.doCommand(
|
|
74
74
|
updateSnippetPlaceholder({
|
|
75
75
|
resource: this.currentResource,
|
|
76
|
-
oldSnippetProperties: this.
|
|
76
|
+
oldSnippetProperties: this.snippetListUrisProperties ?? [],
|
|
77
77
|
newSnippetLists: lists,
|
|
78
78
|
oldImportedResources: this.imported,
|
|
79
79
|
node: this.args.node,
|
|
@@ -99,7 +99,7 @@ export default class SnippetListSelect extends Component<Signature> {
|
|
|
99
99
|
|
|
100
100
|
<SnippetListModal
|
|
101
101
|
@config={{@config}}
|
|
102
|
-
@
|
|
102
|
+
@snippetListUris={{this.snippetListUris}}
|
|
103
103
|
@onSaveSnippetLists={{this.onSaveSnippetLists}}
|
|
104
104
|
@allowMultipleSnippets={{this.allowMultipleSnippets}}
|
|
105
105
|
@open={{this.showModal}}
|
|
@@ -34,7 +34,6 @@ export default class DateTimePickerComponent extends Component<Args> {
|
|
|
34
34
|
monthSelectLabel: this.intl.t('au-date-picker.month-select-label'),
|
|
35
35
|
yearSelectLabel: this.intl.t('au-date-picker.year-select-label'),
|
|
36
36
|
closeLabel: this.intl.t('au-date-picker.close-label'),
|
|
37
|
-
keyboardInstruction: this.intl.t('au-date-picker.keyboard-instruction'),
|
|
38
37
|
calendarHeading: this.intl.t('au-date-picker.calendar-heading'),
|
|
39
38
|
dayNames: getLocalizedDays(this.intl),
|
|
40
39
|
monthNames: getLocalizedMonths(this.intl),
|
|
@@ -2,7 +2,6 @@ import { Command } from '@lblod/ember-rdfa-editor';
|
|
|
2
2
|
import { addProperty, removeProperty } from '@lblod/ember-rdfa-editor/commands';
|
|
3
3
|
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
4
4
|
import { SNIPPET_LIST_RDFA_PREDICATE } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
5
|
-
import { getSnippetUriFromId } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
6
5
|
import { type OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
7
6
|
import { type ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
8
7
|
import {
|
|
@@ -50,7 +49,7 @@ export const updateSnippetPlaceholder = ({
|
|
|
50
49
|
resource,
|
|
51
50
|
property: {
|
|
52
51
|
predicate: SNIPPET_LIST_RDFA_PREDICATE.prefixed,
|
|
53
|
-
object: sayDataFactory.namedNode(
|
|
52
|
+
object: sayDataFactory.namedNode(list.uri),
|
|
54
53
|
},
|
|
55
54
|
transaction,
|
|
56
55
|
})(newState, (newTransaction) => {
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
7
7
|
import { dateValue } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
8
8
|
import { SafeString } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
9
|
-
import { getSnippetIdFromUri } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
10
9
|
|
|
11
10
|
export const DEFAULT_CONTENT_STRING = 'block+';
|
|
12
11
|
|
|
@@ -38,26 +37,26 @@ export type ImportedResourceMap = Record<string, Option<string>>;
|
|
|
38
37
|
|
|
39
38
|
export type SnippetListProperties = {
|
|
40
39
|
placeholderId: string;
|
|
41
|
-
|
|
40
|
+
listUris: string[];
|
|
42
41
|
names: string[];
|
|
43
42
|
importedResources: ImportedResourceMap;
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
export type SnippetListArgs = {
|
|
47
|
-
|
|
46
|
+
uri: string;
|
|
48
47
|
label: string;
|
|
49
48
|
createdOn: string;
|
|
50
49
|
importedResources: string[];
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
export class SnippetList {
|
|
54
|
-
|
|
53
|
+
uri: string;
|
|
55
54
|
label: string;
|
|
56
55
|
createdOn: string | null;
|
|
57
56
|
importedResources: string[];
|
|
58
57
|
|
|
59
|
-
constructor({
|
|
60
|
-
this.
|
|
58
|
+
constructor({ uri, label, createdOn, importedResources }: SnippetListArgs) {
|
|
59
|
+
this.uri = uri;
|
|
61
60
|
this.label = label;
|
|
62
61
|
this.createdOn = dateValue(createdOn);
|
|
63
62
|
this.importedResources = importedResources;
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
type SnippetList,
|
|
26
26
|
type SnippetPluginConfig,
|
|
27
27
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
28
|
-
import {
|
|
28
|
+
import { tripleForSnippetListUri } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
29
29
|
import { OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
30
30
|
|
|
31
31
|
export function importedResourcesFromSnippetLists(
|
|
@@ -58,7 +58,7 @@ export function createSnippetPlaceholder({
|
|
|
58
58
|
...args
|
|
59
59
|
}: CreateSnippetPlaceholderArgs) {
|
|
60
60
|
let additionalProperties: OutgoingTriple[];
|
|
61
|
-
let listProps: Omit<SnippetListProperties, '
|
|
61
|
+
let listProps: Omit<SnippetListProperties, 'listUris'>;
|
|
62
62
|
if ('lists' in args) {
|
|
63
63
|
listProps = {
|
|
64
64
|
// This is a completely new placeholder, so new id
|
|
@@ -67,13 +67,13 @@ export function createSnippetPlaceholder({
|
|
|
67
67
|
importedResources: importedResourcesFromSnippetLists(args.lists),
|
|
68
68
|
};
|
|
69
69
|
additionalProperties = args.lists.map((list) =>
|
|
70
|
-
|
|
70
|
+
tripleForSnippetListUri(list.uri),
|
|
71
71
|
);
|
|
72
72
|
} else {
|
|
73
73
|
// Replacing the last snippet, so keep the id
|
|
74
74
|
listProps = args.listProperties;
|
|
75
|
-
additionalProperties = args.listProperties.
|
|
76
|
-
|
|
75
|
+
additionalProperties = args.listProperties.listUris.map(
|
|
76
|
+
tripleForSnippetListUri,
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
const mappingResource = `http://example.net/lblod-snippet-placeholder/${uuidv4()}`;
|
|
@@ -35,7 +35,10 @@ import {
|
|
|
35
35
|
SnippetListProperties,
|
|
36
36
|
type SnippetPluginConfig,
|
|
37
37
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
38
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
tripleForSnippetListUri,
|
|
40
|
+
tripleForSnippetListId,
|
|
41
|
+
} from '../utils/rdfa-predicate';
|
|
39
42
|
|
|
40
43
|
function outgoingFromBacklink(
|
|
41
44
|
backlink: IncomingTriple,
|
|
@@ -86,7 +89,7 @@ export function createSnippet({
|
|
|
86
89
|
title,
|
|
87
90
|
allowMultipleSnippets,
|
|
88
91
|
listProperties: {
|
|
89
|
-
|
|
92
|
+
listUris,
|
|
90
93
|
names: snippetListNames,
|
|
91
94
|
importedResources,
|
|
92
95
|
placeholderId,
|
|
@@ -110,7 +113,7 @@ export function createSnippet({
|
|
|
110
113
|
});
|
|
111
114
|
const properties = [
|
|
112
115
|
...defaultProperties,
|
|
113
|
-
...
|
|
116
|
+
...listUris.map(tripleForSnippetListUri),
|
|
114
117
|
];
|
|
115
118
|
const node = schema.node(
|
|
116
119
|
'snippet',
|