@lblod/ember-rdfa-editor-lblod-plugins 22.2.2 → 22.2.3-dev.806b2598cde7ac68553f1a3fc19a9e8985ec0807
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/tender-pants-tap.md +5 -0
- package/CHANGELOG.md +6 -0
- package/addon/components/mandatee-table-plugin/insert.gts +0 -10
- package/addon/components/snippet-plugin/snippets/snippet-preview.gts +96 -0
- package/app/styles/snippet-plugin.scss +27 -34
- package/declarations/addon/components/mandatee-table-plugin/insert.d.ts +0 -2
- package/declarations/addon/components/snippet-plugin/snippets/snippet-preview.d.ts +10 -5
- package/package.json +1 -1
- package/translations/en-US.yaml +6 -1
- package/translations/nl-BE.yaml +6 -1
- package/addon/components/snippet-plugin/snippets/snippet-preview.hbs +0 -18
- package/addon/components/snippet-plugin/snippets/snippet-preview.ts +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 22.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#469](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/469) [`52c22d6`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/52c22d6042a5c8e7bc88094625c3b1136d1dcdc9) Thanks [@elpoelma](https://github.com/elpoelma)! - Remove constraint on mandatee table insertion. Mandatee table can now be inserted everywhere in a document.
|
|
8
|
+
|
|
3
9
|
## 22.2.2
|
|
4
10
|
|
|
5
11
|
### 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>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import AuButton from '@appuniversum/ember-appuniversum/components/au-button';
|
|
2
|
+
import AuIcon from '@appuniversum/ember-appuniversum/components/au-icon';
|
|
3
|
+
import { NavDownIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-down';
|
|
4
|
+
import { NavUpIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-up';
|
|
5
|
+
import { on } from '@ember/modifier';
|
|
6
|
+
import { action } from '@ember/object';
|
|
7
|
+
import Component from '@glimmer/component';
|
|
8
|
+
import { tracked } from '@glimmer/tracking';
|
|
9
|
+
|
|
10
|
+
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
11
|
+
import {
|
|
12
|
+
Snippet,
|
|
13
|
+
SnippetPluginConfig,
|
|
14
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
15
|
+
import t from 'ember-intl/helpers/t';
|
|
16
|
+
|
|
17
|
+
interface Signature {
|
|
18
|
+
Args: {
|
|
19
|
+
config: SnippetPluginConfig;
|
|
20
|
+
snippet: Snippet;
|
|
21
|
+
onInsert: (content: string, title: string) => void;
|
|
22
|
+
};
|
|
23
|
+
Element: HTMLDivElement;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default class SnippetPreviewComponent extends Component<Signature> {
|
|
27
|
+
@tracked controller?: SayController;
|
|
28
|
+
@tracked isExpanded = false;
|
|
29
|
+
|
|
30
|
+
get snippet(): Snippet {
|
|
31
|
+
return this.args.snippet;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@action
|
|
35
|
+
onInsert() {
|
|
36
|
+
this.args.onInsert(
|
|
37
|
+
this.args.snippet.content?.toHTML() ?? '',
|
|
38
|
+
this.args.snippet.title ?? '',
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@action
|
|
43
|
+
togglePreview() {
|
|
44
|
+
this.isExpanded = !this.isExpanded;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<div
|
|
49
|
+
class='snippet-preview {{if this.isExpanded "snippet-preview--expanded"}}'
|
|
50
|
+
...attributes
|
|
51
|
+
>
|
|
52
|
+
<div class='snippet-preview__header'>
|
|
53
|
+
<div
|
|
54
|
+
role='button'
|
|
55
|
+
title={{t 'snippet-plugin.modal.preview-button.title'}}
|
|
56
|
+
{{on 'click' this.togglePreview}}
|
|
57
|
+
{{! template-lint-disable require-presentational-children}}
|
|
58
|
+
>
|
|
59
|
+
<AuButton @skin='link' class='snippet-preview__toggle'>
|
|
60
|
+
{{#if this.isExpanded}}
|
|
61
|
+
<AuIcon @icon={{NavUpIcon}} @size='large' />
|
|
62
|
+
{{else}}
|
|
63
|
+
<AuIcon @icon={{NavDownIcon}} @size='large' />
|
|
64
|
+
{{/if}}
|
|
65
|
+
</AuButton>
|
|
66
|
+
{{! template-lint-disable no-heading-inside-button}}
|
|
67
|
+
<h3 class='snippet-preview__title'>
|
|
68
|
+
{{@snippet.title}}
|
|
69
|
+
</h3>
|
|
70
|
+
</div>
|
|
71
|
+
<div
|
|
72
|
+
role='button'
|
|
73
|
+
title={{t 'snippet-plugin.modal.select-button.title'}}
|
|
74
|
+
{{on 'click' this.onInsert}}
|
|
75
|
+
{{! template-lint-disable require-presentational-children}}
|
|
76
|
+
>
|
|
77
|
+
<AuButton class='snippet-preview__insert-button' @skin='naked'>
|
|
78
|
+
{{t 'snippet-plugin.modal.select-button.label'}}
|
|
79
|
+
</AuButton>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
</div>
|
|
83
|
+
{{#if this.isExpanded}}
|
|
84
|
+
<div
|
|
85
|
+
class='say-editor say-content rdfa-annotations rdfa-annotations-highlight rdfa-annotations-hover snippet-preview__content'
|
|
86
|
+
>
|
|
87
|
+
{{#if @snippet.content}}
|
|
88
|
+
{{@snippet.content}}
|
|
89
|
+
{{else}}
|
|
90
|
+
<p class='au-u-italic'>{{t 'snippet-plugin.modal.no-content'}}</p>
|
|
91
|
+
{{/if}}
|
|
92
|
+
</div>
|
|
93
|
+
{{/if}}
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
}
|
|
@@ -34,51 +34,44 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.snippet-preview {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
background-color: var(--au-white);
|
|
40
|
+
border: 0.1rem solid var(--au-gray-200);
|
|
41
|
+
border-radius: var(--au-radius);
|
|
42
|
+
|
|
43
|
+
&--expanded {
|
|
44
|
+
> .snippet-preview__header {
|
|
45
|
+
border-bottom: 0.1rem solid var(--au-gray-200);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
48
|
+
&__header {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
align-items: center;
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
> :nth-child(1) {
|
|
54
|
+
flex-grow: 1;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
align-items: center;
|
|
58
|
+
padding: $au-unit-small;
|
|
59
|
+
cursor: pointer;
|
|
54
60
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
> :nth-child(2) {
|
|
62
|
+
border-left: 1px solid var(--au-gray-200);
|
|
63
|
+
padding: $au-unit-small;
|
|
64
|
+
cursor: pointer;
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
&__title {
|
|
63
69
|
color: var(--au-gray-700);
|
|
64
70
|
font-weight: var(--au-medium);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&--editor-overlay {
|
|
74
|
-
position: absolute !important;
|
|
75
|
-
top: 0;
|
|
76
|
-
width: 100%;
|
|
77
|
-
height: 100%;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&--editor-container {
|
|
81
|
-
position: relative;
|
|
73
|
+
&__content {
|
|
74
|
+
padding: $au-unit-small $au-unit $au-unit-small $au-unit;
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
77
|
|
|
@@ -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 {};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import { Snippet, SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
|
-
interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
interface Signature {
|
|
5
|
+
Args: {
|
|
6
|
+
config: SnippetPluginConfig;
|
|
7
|
+
snippet: Snippet;
|
|
8
|
+
onInsert: (content: string, title: string) => void;
|
|
9
|
+
};
|
|
10
|
+
Element: HTMLDivElement;
|
|
8
11
|
}
|
|
9
|
-
export default class SnippetPreviewComponent extends Component<
|
|
12
|
+
export default class SnippetPreviewComponent extends Component<Signature> {
|
|
10
13
|
controller?: SayController;
|
|
14
|
+
isExpanded: boolean;
|
|
11
15
|
get snippet(): Snippet;
|
|
12
16
|
onInsert(): void;
|
|
17
|
+
togglePreview(): void;
|
|
13
18
|
}
|
|
14
19
|
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.3-dev.806b2598cde7ac68553f1a3fc19a9e8985ec0807",
|
|
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
|
@@ -297,11 +297,16 @@ snippet-plugin:
|
|
|
297
297
|
active-lists: 'Active lists:'
|
|
298
298
|
modal:
|
|
299
299
|
title: Choose a snippet
|
|
300
|
-
|
|
300
|
+
preview-button:
|
|
301
|
+
title: Show snippet preview
|
|
302
|
+
select-button:
|
|
303
|
+
label: Select
|
|
304
|
+
title: Insert snippet
|
|
301
305
|
search:
|
|
302
306
|
title: Filter on
|
|
303
307
|
label: Snippet name
|
|
304
308
|
placeholder: Type something...
|
|
309
|
+
no-content: Snippet does not contain any content
|
|
305
310
|
snippet-list:
|
|
306
311
|
open-modal: Manage snippet lists
|
|
307
312
|
modal:
|
package/translations/nl-BE.yaml
CHANGED
|
@@ -296,11 +296,16 @@ snippet-plugin:
|
|
|
296
296
|
active-lists: 'Actieve lijsten:'
|
|
297
297
|
modal:
|
|
298
298
|
title: Kies een fragment
|
|
299
|
-
|
|
299
|
+
preview-button:
|
|
300
|
+
title: Preview van fragment tonen
|
|
301
|
+
select-button:
|
|
302
|
+
label: Selecteer
|
|
303
|
+
title: Fragment invoegen
|
|
300
304
|
search:
|
|
301
305
|
title: Filter op
|
|
302
306
|
label: Fragmentnaam
|
|
303
307
|
placeholder: Typ iets...
|
|
308
|
+
no-content: Fragment bevat geen inhoud
|
|
304
309
|
snippet-list:
|
|
305
310
|
open-modal: Fragmentlijsten beheren
|
|
306
311
|
modal:
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
-
<div
|
|
3
|
-
class='snippet-preview--container au-c-panel au-u-margin-right'
|
|
4
|
-
...attributes
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
class='snippet-preview--article au-u-padding au-u-padding-right-large rdfa-annotations rdfa-annotations-highlight rdfa-annotations-hover'
|
|
8
|
-
>
|
|
9
|
-
<h3 class='snippet-preview--title'>
|
|
10
|
-
{{@snippet.title}}
|
|
11
|
-
</h3>
|
|
12
|
-
</div>
|
|
13
|
-
<div class='snippet-preview--button au-u-padding-small'>
|
|
14
|
-
<AuButton @skin='naked' {{on 'click' this.onInsert}}>
|
|
15
|
-
{{t 'snippet-plugin.modal.select'}}
|
|
16
|
-
</AuButton>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { action } from '@ember/object';
|
|
2
|
-
import Component from '@glimmer/component';
|
|
3
|
-
import { tracked } from '@glimmer/tracking';
|
|
4
|
-
|
|
5
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
6
|
-
import {
|
|
7
|
-
Snippet,
|
|
8
|
-
SnippetPluginConfig,
|
|
9
|
-
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
10
|
-
|
|
11
|
-
interface Args {
|
|
12
|
-
config: SnippetPluginConfig;
|
|
13
|
-
snippet: Snippet;
|
|
14
|
-
onInsert: (content: string, title: string) => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default class SnippetPreviewComponent extends Component<Args> {
|
|
18
|
-
@tracked controller?: SayController;
|
|
19
|
-
|
|
20
|
-
get snippet(): Snippet {
|
|
21
|
-
return this.args.snippet;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@action
|
|
25
|
-
onInsert() {
|
|
26
|
-
this.args.onInsert(
|
|
27
|
-
this.args.snippet.content?.toHTML() ?? '',
|
|
28
|
-
this.args.snippet.title ?? '',
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
}
|