@lblod/ember-rdfa-editor-lblod-plugins 4.0.1 → 5.0.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 +30 -2
- package/README.md +25 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +52 -18
- package/addon/components/article-structure-plugin/structure-card.ts +23 -2
- package/addon/components/citation-plugin/citation-card.ts +1 -0
- package/addon/components/citation-plugin/citation-insert.ts +6 -0
- package/addon/components/hover-tooltip.hbs +8 -0
- package/addon/components/hover-tooltip.ts +36 -0
- package/addon/components/rdfa-date-plugin/card.hbs +1 -1
- package/addon/plugins/article-structure-plugin/index.ts +12 -6
- package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +1 -0
- package/addon/plugins/article-structure-plugin/structures/article.ts +1 -0
- package/addon/plugins/article-structure-plugin/structures/chapter.ts +1 -0
- package/addon/plugins/article-structure-plugin/structures/section.ts +1 -0
- package/addon/plugins/article-structure-plugin/structures/subsection.ts +2 -0
- package/addon/plugins/article-structure-plugin/structures/title.ts +1 -0
- package/addon/plugins/besluit-plugin/commands/insert-title.ts +2 -2
- package/addon/plugins/rdfa-date-plugin/index.ts +1 -3
- package/addon/plugins/standard-template-plugin/index.ts +2 -2
- package/addon/plugins/standard-template-plugin/utils/nodes.ts +6 -6
- package/app/components/hover-tooltip.js +1 -0
- package/components/article-structure-plugin/structure-card.d.ts +3 -1
- package/components/hover-tooltip.d.ts +18 -0
- package/package.json +1 -1
- package/plugins/article-structure-plugin/index.d.ts +6 -6
- package/plugins/rdfa-date-plugin/index.d.ts +1 -1
- package/plugins/standard-template-plugin/index.d.ts +1 -1
- package/plugins/standard-template-plugin/utils/nodes.d.ts +1 -1
- package/translations/en-US.yaml +14 -2
- package/translations/nl-BE.yaml +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [5.0.0] - 2023-04-07
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- add a hover-tooltip utility component
|
|
14
|
+
- docs: add tooltips to the remove structure buttons
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Change date labels based on designer feedback
|
|
18
|
+
- split out structure removal card into two buttons
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- BREAKING: Solve duplicate node title
|
|
22
|
+
- properly initialize ember-intl
|
|
23
|
+
|
|
24
|
+
## [4.0.2] - 2023-04-04
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- Prevent decision nodes regenerating when (de)serializing
|
|
28
|
+
- Ensure editor is focused after inserting a citation
|
|
29
|
+
- fix(citation): make plugin trigger correctly when `doc` is passed as an allowed nodeType
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
- docs: add examples on how to enable the citation plugin for the entire document
|
|
33
|
+
|
|
10
34
|
## [4.0.1] - 2023-03-27
|
|
11
35
|
|
|
12
36
|
### Dependencies
|
|
@@ -29,6 +53,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
53
|
### Removed:
|
|
30
54
|
- Removal of prosemirror-plugin dependency of `CitationPlugin::CitationInsert` component.
|
|
31
55
|
|
|
56
|
+
### Dependencies
|
|
57
|
+
- bump `ember-rdfa-editor` to v3.4.0
|
|
58
|
+
|
|
32
59
|
## [3.1.0] - 2023-03-02
|
|
33
60
|
|
|
34
61
|
### Fixed
|
|
@@ -40,7 +67,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
40
67
|
|
|
41
68
|
### Dependencies
|
|
42
69
|
- bump `ember-rdfa-editor` to v3.3.0
|
|
43
|
-
- bump `ember-rdfa-editor` to v3.4.0
|
|
44
70
|
|
|
45
71
|
## [3.0.0] - 2023-02-27
|
|
46
72
|
|
|
@@ -379,7 +405,9 @@ add onclick handler to pencil icon in variable plugin
|
|
|
379
405
|
|
|
380
406
|
# Changelog
|
|
381
407
|
|
|
382
|
-
[unreleased]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/
|
|
408
|
+
[unreleased]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v5.0.0...HEAD
|
|
409
|
+
[5.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v4.0.2...v5.0.0
|
|
410
|
+
[4.0.2]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v4.0.1...v4.0.2
|
|
383
411
|
[4.0.1]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v4.0.0...v4.0.1
|
|
384
412
|
[4.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v3.1.0...v4.0.0
|
|
385
413
|
[3.1.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v3.0.0...v3.1.0
|
package/README.md
CHANGED
|
@@ -101,6 +101,31 @@ Configuration:
|
|
|
101
101
|
- activeInRanges: it's a function that gets the state of the actual instance of the editor and returns an array of ranges for the plugin to be active in, for example `[[0,50], [70,100]]`
|
|
102
102
|
- regex: you can provide your custom regex to detect citations, if not the default one will be used
|
|
103
103
|
|
|
104
|
+
|
|
105
|
+
A common usecase is to have the plugin active in the entire document. Here's how to do that using each configuration type:
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
import { citationPlugin } from "@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin";
|
|
109
|
+
|
|
110
|
+
const configA = {
|
|
111
|
+
type: "nodes",
|
|
112
|
+
activeInNodeTypes(schema) {
|
|
113
|
+
// the root node of the document should always have the doc type
|
|
114
|
+
return new Set([schema.nodes.doc]);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const configB = {
|
|
119
|
+
type: "ranges",
|
|
120
|
+
activeInRanges(state) {
|
|
121
|
+
// a node's nodeSize follows the Prosemirror definition
|
|
122
|
+
// a non-leaf node's size is the sum of its children's sizes + 2
|
|
123
|
+
// so to get the last valid position "inside" a node, you need to subtract two from its nodeSize
|
|
124
|
+
// ref: https://prosemirror.net/docs/ref/#model.Node.nodeSize
|
|
125
|
+
return [[0, state.doc.nodeSize - 2]];
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
```
|
|
104
129
|
### Using the plugin
|
|
105
130
|
If used with the example configuration provided this plugin can be triggered by typing one of the following in the correct RDFa context (the [besluit:motivering](http://data.vlaanderen.be/ns/besluit#motivering) of a [besluit:Besluit](https://data.vlaanderen.be/ns/besluit#Besluit)).
|
|
106
131
|
|
|
@@ -26,24 +26,58 @@
|
|
|
26
26
|
</AuButton>
|
|
27
27
|
</Item>
|
|
28
28
|
<Item>
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
<AuButtonGroup>
|
|
30
|
+
<HoverTooltip>
|
|
31
|
+
<:hover as |hover|>
|
|
32
|
+
<AuButton
|
|
33
|
+
@icon="bin"
|
|
34
|
+
@iconAlignment="left"
|
|
35
|
+
@skin="link"
|
|
36
|
+
@alert={{true}}
|
|
37
|
+
@disabled={{this.currentStructureType.noUnwrap}}
|
|
38
|
+
aria-describedby="remove-tooltip"
|
|
39
|
+
{{hover.velcroHook}}
|
|
40
|
+
{{hover.handleHover}}
|
|
41
|
+
{{on 'click' (fn this.removeStructure false)}}>
|
|
42
|
+
{{this.remove}}
|
|
43
|
+
</AuButton>
|
|
44
|
+
</:hover>
|
|
45
|
+
<:tooltip as |tooltip|>
|
|
46
|
+
<AuPill
|
|
47
|
+
id="remove-tooltip"
|
|
48
|
+
role="tooltip"
|
|
49
|
+
{{tooltip}}
|
|
50
|
+
>
|
|
51
|
+
{{t 'article-structure-plugin.remove.help-text'}}
|
|
52
|
+
</AuPill>
|
|
53
|
+
</:tooltip>
|
|
54
|
+
</HoverTooltip>
|
|
55
|
+
<HoverTooltip>
|
|
56
|
+
<:hover as |hover|>
|
|
57
|
+
<AuButton
|
|
58
|
+
@icon="bin"
|
|
59
|
+
@iconAlignment="left"
|
|
60
|
+
@skin="link"
|
|
61
|
+
aria-describedby="remove-content-tooltip"
|
|
62
|
+
@alert={{true}}
|
|
63
|
+
{{hover.velcroHook}}
|
|
64
|
+
{{hover.handleHover}}
|
|
65
|
+
{{on 'click' (fn this.removeStructure true)}}>
|
|
66
|
+
{{this.removeWithContent}}
|
|
67
|
+
</AuButton>
|
|
68
|
+
</:hover>
|
|
69
|
+
<:tooltip as |tooltip|>
|
|
70
|
+
<AuPill
|
|
71
|
+
id="remove-content-tooltip"
|
|
72
|
+
role="tooltip"
|
|
73
|
+
{{tooltip}}
|
|
74
|
+
>
|
|
75
|
+
{{t 'article-structure-plugin.remove-with-content.help-text'}}
|
|
76
|
+
</AuPill>
|
|
77
|
+
</:tooltip>
|
|
78
|
+
</HoverTooltip>
|
|
79
|
+
|
|
80
|
+
</AuButtonGroup>
|
|
47
81
|
</Item>
|
|
48
82
|
</AuList>
|
|
49
83
|
</c.content>
|
|
@@ -35,9 +35,9 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@action
|
|
38
|
-
removeStructure() {
|
|
38
|
+
removeStructure(withContent: boolean) {
|
|
39
39
|
if (this.structure && this.currentStructureType) {
|
|
40
|
-
if (
|
|
40
|
+
if (withContent || this.currentStructureType.noUnwrap) {
|
|
41
41
|
this.controller.doCommand(
|
|
42
42
|
removeStructure(this.structure, this.structureTypes),
|
|
43
43
|
{ view: this.controller.mainEditorView }
|
|
@@ -88,6 +88,27 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
get remove() {
|
|
92
|
+
const translation = this.currentStructureType?.translations?.remove;
|
|
93
|
+
if (translation) {
|
|
94
|
+
return this.intl.t(translation);
|
|
95
|
+
} else {
|
|
96
|
+
return this.intl.t('article-structure-plugin.remove.default');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get removeWithContent() {
|
|
101
|
+
const translation =
|
|
102
|
+
this.currentStructureType?.translations?.removeWithContent;
|
|
103
|
+
if (translation) {
|
|
104
|
+
return this.intl.t(translation);
|
|
105
|
+
} else {
|
|
106
|
+
return this.intl.t(
|
|
107
|
+
'article-structure-plugin.remove-with-content.default'
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
91
112
|
get isOutsideStructure() {
|
|
92
113
|
return !this.structure;
|
|
93
114
|
}
|
|
@@ -76,6 +76,12 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
|
|
|
76
76
|
this.controller.schema,
|
|
77
77
|
this.controller.mainEditorState
|
|
78
78
|
);
|
|
79
|
+
// if the doc node is included, the button should always be active
|
|
80
|
+
// the findParentNodeOfType util we import does NOT consider the doc node
|
|
81
|
+
// in its search.
|
|
82
|
+
if (nodeTypes.has(this.controller.schema.nodes.doc)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
79
85
|
return !findParentNodeOfType([...nodeTypes])(selection);
|
|
80
86
|
}
|
|
81
87
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { modifier } from 'ember-modifier';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
|
|
5
|
+
interface Args {
|
|
6
|
+
placement?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default class HoverTooltip extends Component<Args> {
|
|
10
|
+
hover = modifier((element) => {
|
|
11
|
+
element.addEventListener('mouseenter', this.showTooltip);
|
|
12
|
+
element.addEventListener('mouseleave', this.hideTooltip);
|
|
13
|
+
element.addEventListener('focus', this.showTooltip);
|
|
14
|
+
element.addEventListener('blur', this.hideTooltip);
|
|
15
|
+
return () => {
|
|
16
|
+
element.removeEventListener('mouseenter', this.showTooltip);
|
|
17
|
+
element.removeEventListener('mouseleave', this.hideTooltip);
|
|
18
|
+
element.removeEventListener('focus', this.showTooltip);
|
|
19
|
+
element.removeEventListener('blur', this.hideTooltip);
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
@tracked tooltipOpen = false;
|
|
24
|
+
|
|
25
|
+
get placement() {
|
|
26
|
+
return this.args.placement ?? 'top';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
showTooltip = () => {
|
|
30
|
+
this.tooltipOpen = true;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
hideTooltip = () => {
|
|
34
|
+
this.tooltipOpen = false;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
{{#each this.formats as |format|}}
|
|
48
48
|
<AuFormRow>
|
|
49
49
|
<AuControlRadio
|
|
50
|
-
@label={{format.label}}
|
|
50
|
+
@label={{if format.label format.label (if this.onlyDate format.dateFormat format.dateTimeFormat)}}
|
|
51
51
|
@identifier={{format.key}}
|
|
52
52
|
@name="dateFormat"
|
|
53
53
|
@value={{format.key}}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
EditorState,
|
|
3
|
+
Fragment,
|
|
4
|
+
PNode,
|
|
5
|
+
Schema,
|
|
6
|
+
Transaction,
|
|
7
|
+
} from '@lblod/ember-rdfa-editor';
|
|
2
8
|
import IntlService from 'ember-intl/services/intl';
|
|
3
|
-
import { Transaction } from '@lblod/ember-rdfa-editor';
|
|
4
9
|
|
|
5
10
|
export type SpecName = string;
|
|
6
11
|
|
|
@@ -8,11 +13,12 @@ export type StructureSpec = {
|
|
|
8
13
|
name: SpecName;
|
|
9
14
|
translations: {
|
|
10
15
|
insert: string;
|
|
11
|
-
move
|
|
12
|
-
up
|
|
13
|
-
down
|
|
16
|
+
move?: {
|
|
17
|
+
up?: string;
|
|
18
|
+
down?: string;
|
|
14
19
|
};
|
|
15
|
-
remove
|
|
20
|
+
remove?: string;
|
|
21
|
+
removeWithContent?: string;
|
|
16
22
|
};
|
|
17
23
|
constructor: (args: {
|
|
18
24
|
schema: Schema;
|
|
@@ -21,6 +21,7 @@ export const articleParagraphSpec: StructureSpec = {
|
|
|
21
21
|
down: 'article-structure-plugin.move-down.paragraph',
|
|
22
22
|
},
|
|
23
23
|
remove: 'article-structure-plugin.remove.paragraph',
|
|
24
|
+
removeWithContent: 'article-structure-plugin.remove-with-content.paragraph',
|
|
24
25
|
},
|
|
25
26
|
continuous: false,
|
|
26
27
|
noUnwrap: true,
|
|
@@ -27,6 +27,7 @@ export const articleSpec: StructureSpec = {
|
|
|
27
27
|
down: 'article-structure-plugin.move-down.article',
|
|
28
28
|
},
|
|
29
29
|
remove: 'article-structure-plugin.remove.article',
|
|
30
|
+
removeWithContent: 'article-structure-plugin.remove-with-content.article',
|
|
30
31
|
},
|
|
31
32
|
continuous: true,
|
|
32
33
|
constructor: ({ schema, number, content, intl }) => {
|
|
@@ -22,6 +22,7 @@ export const chapterSpec: StructureSpec = {
|
|
|
22
22
|
down: 'article-structure-plugin.move-down.chapter',
|
|
23
23
|
},
|
|
24
24
|
remove: 'article-structure-plugin.remove.chapter',
|
|
25
|
+
removeWithContent: 'article-structure-plugin.remove-with-content.chapter',
|
|
25
26
|
},
|
|
26
27
|
constructor: ({ schema, number, content, intl }) => {
|
|
27
28
|
const numberConverted = romanize(number ?? 1);
|
|
@@ -22,6 +22,7 @@ export const sectionSpec: StructureSpec = {
|
|
|
22
22
|
down: 'article-structure-plugin.move-down.section',
|
|
23
23
|
},
|
|
24
24
|
remove: 'article-structure-plugin.remove.section',
|
|
25
|
+
removeWithContent: 'article-structure-plugin.remove-with-content.section',
|
|
25
26
|
},
|
|
26
27
|
constructor: ({ schema, number, content, intl }) => {
|
|
27
28
|
const numberConverted = romanize(number || 1);
|
|
@@ -23,6 +23,8 @@ export const subsectionSpec: StructureSpec = {
|
|
|
23
23
|
down: 'article-structure-plugin.move-down.subsection',
|
|
24
24
|
},
|
|
25
25
|
remove: 'article-structure-plugin.remove.subsection',
|
|
26
|
+
removeWithContent:
|
|
27
|
+
'article-structure-plugin.remove-with-content.subsection',
|
|
26
28
|
},
|
|
27
29
|
constructor: ({ schema, number, intl, content }) => {
|
|
28
30
|
const numberConverted = romanize(number ?? 1);
|
|
@@ -22,6 +22,7 @@ export const titleSpec: StructureSpec = {
|
|
|
22
22
|
down: 'article-structure-plugin.move-down.title',
|
|
23
23
|
},
|
|
24
24
|
remove: 'article-structure-plugin.remove.title',
|
|
25
|
+
removeWithContent: 'article-structure-plugin.remove-with-content.title',
|
|
25
26
|
},
|
|
26
27
|
constructor: ({ schema, number, content, intl }) => {
|
|
27
28
|
const numberConverted = romanize(number ?? 1);
|
|
@@ -10,7 +10,7 @@ export default function insertTitle(intl: IntlService): Command {
|
|
|
10
10
|
if (!besluit) {
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
|
-
if (!besluit.node.canReplaceWith(0, 0, schema.nodes.
|
|
13
|
+
if (!besluit.node.canReplaceWith(0, 0, schema.nodes.besluit_title)) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ export default function insertTitle(intl: IntlService): Command {
|
|
|
19
19
|
tr.insert(
|
|
20
20
|
besluit.pos + 1,
|
|
21
21
|
schema.node(
|
|
22
|
-
'
|
|
22
|
+
'besluit_title',
|
|
23
23
|
{ __rdfaId: uuid() },
|
|
24
24
|
schema.node(
|
|
25
25
|
'paragraph',
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export const defaultDateFormats: DateFormat[] = [
|
|
2
2
|
{
|
|
3
|
-
label: 'Short Date',
|
|
4
3
|
key: 'short',
|
|
5
4
|
dateFormat: 'dd/MM/yy',
|
|
6
5
|
dateTimeFormat: 'dd/MM/yy HH:mm',
|
|
7
6
|
},
|
|
8
7
|
{
|
|
9
|
-
label: 'Long Date',
|
|
10
8
|
key: 'long',
|
|
11
9
|
dateFormat: 'EEEE dd MMMM yyyy',
|
|
12
10
|
dateTimeFormat: 'PPPPp',
|
|
@@ -14,7 +12,7 @@ export const defaultDateFormats: DateFormat[] = [
|
|
|
14
12
|
];
|
|
15
13
|
|
|
16
14
|
export type DateFormat = {
|
|
17
|
-
label
|
|
15
|
+
label?: string;
|
|
18
16
|
key: string;
|
|
19
17
|
dateFormat: string;
|
|
20
18
|
dateTimeFormat: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
besluit,
|
|
3
|
-
|
|
3
|
+
besluit_title,
|
|
4
4
|
description,
|
|
5
5
|
motivering,
|
|
6
6
|
article_container,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
export const besluitNodes = {
|
|
15
15
|
besluit,
|
|
16
|
-
|
|
16
|
+
besluit_title,
|
|
17
17
|
description,
|
|
18
18
|
motivering,
|
|
19
19
|
article_container,
|
|
@@ -16,7 +16,7 @@ import { StructureSpec } from '../../article-structure-plugin';
|
|
|
16
16
|
import { v4 as uuid } from 'uuid';
|
|
17
17
|
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const besluit_title: NodeSpec = {
|
|
20
20
|
content: 'paragraph+',
|
|
21
21
|
inline: false,
|
|
22
22
|
defining: true,
|
|
@@ -127,14 +127,12 @@ export const article_container: NodeSpec = {
|
|
|
127
127
|
{
|
|
128
128
|
tag: 'div',
|
|
129
129
|
getAttrs(element: HTMLElement) {
|
|
130
|
-
if (
|
|
131
|
-
hasRDFaAttribute(element, 'property', PROV('value')) &&
|
|
132
|
-
hasRDFaAttribute(element, 'typeof', BESLUIT('Besluit'))
|
|
133
|
-
) {
|
|
130
|
+
if (hasRDFaAttribute(element, 'property', PROV('value'))) {
|
|
134
131
|
return getRdfaAttrs(element);
|
|
135
132
|
}
|
|
136
133
|
return false;
|
|
137
134
|
},
|
|
135
|
+
context: 'besluit/',
|
|
138
136
|
},
|
|
139
137
|
],
|
|
140
138
|
};
|
|
@@ -279,6 +277,7 @@ export const besluit_article_header: NodeSpec = {
|
|
|
279
277
|
};
|
|
280
278
|
|
|
281
279
|
export const besluit_article_content: NodeSpec = {
|
|
280
|
+
group: 'block',
|
|
282
281
|
content: 'block+',
|
|
283
282
|
inline: false,
|
|
284
283
|
attrs: {
|
|
@@ -302,13 +301,14 @@ export const besluit_article_content: NodeSpec = {
|
|
|
302
301
|
}
|
|
303
302
|
return false;
|
|
304
303
|
},
|
|
304
|
+
context: 'besluit_article//',
|
|
305
305
|
},
|
|
306
306
|
],
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
export const besluit: NodeSpec = {
|
|
310
310
|
group: 'block',
|
|
311
|
-
content: 'block*
|
|
311
|
+
content: 'block*besluit_title?block*description?block*motivering?block*',
|
|
312
312
|
inline: false,
|
|
313
313
|
defining: true,
|
|
314
314
|
isolating: true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/hover-tooltip';
|
|
@@ -11,7 +11,7 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
|
|
|
11
11
|
removeStructureContent: boolean;
|
|
12
12
|
get controller(): SayController;
|
|
13
13
|
moveStructure(direction: 'up' | 'down'): void;
|
|
14
|
-
removeStructure(): void;
|
|
14
|
+
removeStructure(withContent: boolean): void;
|
|
15
15
|
setRemoveStructureContent(value: boolean): void;
|
|
16
16
|
get structureTypes(): ArticleStructurePluginOptions;
|
|
17
17
|
get structureNodeSpecs(): import("prosemirror-model").NodeType[];
|
|
@@ -22,6 +22,8 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
|
|
|
22
22
|
node: import("prosemirror-model").Node;
|
|
23
23
|
} | undefined;
|
|
24
24
|
get currentStructureType(): import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin").StructureSpec | undefined;
|
|
25
|
+
get remove(): string;
|
|
26
|
+
get removeWithContent(): string;
|
|
25
27
|
get isOutsideStructure(): boolean;
|
|
26
28
|
get canMoveDown(): boolean;
|
|
27
29
|
get canMoveUp(): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
interface Args {
|
|
3
|
+
placement?: string;
|
|
4
|
+
}
|
|
5
|
+
export default class HoverTooltip extends Component<Args> {
|
|
6
|
+
hover: import("ember-modifier").FunctionBasedModifier<{
|
|
7
|
+
Args: {
|
|
8
|
+
Named: Record<string, unknown>;
|
|
9
|
+
Positional: unknown[];
|
|
10
|
+
};
|
|
11
|
+
Element: Element;
|
|
12
|
+
}>;
|
|
13
|
+
tooltipOpen: boolean;
|
|
14
|
+
get placement(): string;
|
|
15
|
+
showTooltip: () => void;
|
|
16
|
+
hideTooltip: () => void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Fragment, PNode, Schema,
|
|
1
|
+
import { EditorState, Fragment, PNode, Schema, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import IntlService from 'ember-intl/services/intl';
|
|
3
|
-
import { Transaction } from '@lblod/ember-rdfa-editor';
|
|
4
3
|
export type SpecName = string;
|
|
5
4
|
export type StructureSpec = {
|
|
6
5
|
name: SpecName;
|
|
7
6
|
translations: {
|
|
8
7
|
insert: string;
|
|
9
|
-
move
|
|
10
|
-
up
|
|
11
|
-
down
|
|
8
|
+
move?: {
|
|
9
|
+
up?: string;
|
|
10
|
+
down?: string;
|
|
12
11
|
};
|
|
13
|
-
remove
|
|
12
|
+
remove?: string;
|
|
13
|
+
removeWithContent?: string;
|
|
14
14
|
};
|
|
15
15
|
constructor: (args: {
|
|
16
16
|
schema: Schema;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const besluitNodes: {
|
|
2
2
|
besluit: import("prosemirror-model").NodeSpec;
|
|
3
|
-
|
|
3
|
+
besluit_title: import("prosemirror-model").NodeSpec;
|
|
4
4
|
description: import("prosemirror-model").NodeSpec;
|
|
5
5
|
motivering: import("prosemirror-model").NodeSpec;
|
|
6
6
|
article_container: import("prosemirror-model").NodeSpec;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeSpec } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import { StructureSpec } from '../../article-structure-plugin';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const besluit_title: NodeSpec;
|
|
4
4
|
export declare const description: NodeSpec;
|
|
5
5
|
export declare const motivering: NodeSpec;
|
|
6
6
|
export declare const article_container: NodeSpec;
|
package/translations/en-US.yaml
CHANGED
|
@@ -7,6 +7,7 @@ article-structure-plugin:
|
|
|
7
7
|
section: Insert section
|
|
8
8
|
subsection: Insert subsection
|
|
9
9
|
move-up:
|
|
10
|
+
default: Move structure up
|
|
10
11
|
paragraph: Move paragraph up
|
|
11
12
|
article: Move article up
|
|
12
13
|
title: Move title up
|
|
@@ -14,6 +15,7 @@ article-structure-plugin:
|
|
|
14
15
|
section: Move section up
|
|
15
16
|
subsection: Move subsection up
|
|
16
17
|
move-down:
|
|
18
|
+
default: Move structure down
|
|
17
19
|
paragraph: Move paragraph down
|
|
18
20
|
article: Move article down
|
|
19
21
|
title: Move title down
|
|
@@ -23,13 +25,23 @@ article-structure-plugin:
|
|
|
23
25
|
title:
|
|
24
26
|
structure-card: Structure Card
|
|
25
27
|
remove:
|
|
28
|
+
default: Remove structure
|
|
26
29
|
article: Remove Article
|
|
27
30
|
paragraph: Remove Paragraph
|
|
28
31
|
subsection: Remove subsection
|
|
29
32
|
section: Remove section
|
|
30
33
|
chapter: Remove chapter
|
|
31
34
|
title: Remove title
|
|
32
|
-
|
|
35
|
+
help-text: Remove the heading, but keep the content
|
|
36
|
+
remove-with-content:
|
|
37
|
+
default: Remove structure with content
|
|
38
|
+
article: Remove Article with content
|
|
39
|
+
paragraph: Remove Paragraph with content
|
|
40
|
+
subsection: Remove subsection with content
|
|
41
|
+
section: Remove section with content
|
|
42
|
+
chapter: Remove chapter with content
|
|
43
|
+
title: Remove title with content
|
|
44
|
+
help-text: Remove the heading, and also remove all content up to the next heading of the same level
|
|
33
45
|
placeholder:
|
|
34
46
|
generic:
|
|
35
47
|
heading: Insert title
|
|
@@ -166,4 +178,4 @@ variable-plugin:
|
|
|
166
178
|
|
|
167
179
|
table-of-contents-plugin:
|
|
168
180
|
title: Table of Contents
|
|
169
|
-
toggle: Show Table of Contents
|
|
181
|
+
toggle: Show Table of Contents
|
package/translations/nl-BE.yaml
CHANGED
|
@@ -23,13 +23,22 @@ article-structure-plugin:
|
|
|
23
23
|
title:
|
|
24
24
|
structure-card: Structuur card
|
|
25
25
|
remove:
|
|
26
|
+
default: Structuur verwijderen
|
|
26
27
|
article: Artikel verwijderen
|
|
27
28
|
paragraph: Paragraaf verwijderen
|
|
28
29
|
subsection: Onderafdeling verwijderen
|
|
29
30
|
section: Afdeling verwijderen
|
|
30
31
|
chapter: Hoofdstuk verwijderen
|
|
31
32
|
title: Titel verwijderen
|
|
32
|
-
|
|
33
|
+
help-text: Verwijder de hoofding, maar behoud de inhoud
|
|
34
|
+
remove-with-content:
|
|
35
|
+
default: Structuur verwijderen met inhoud
|
|
36
|
+
article: Artikel en inhoud verwijderen
|
|
37
|
+
subsection: Onderafdeling en inhoud verwijderen
|
|
38
|
+
section: Afdeling en inhoud verwijderen
|
|
39
|
+
chapter: Hoofdstuk en inhoud verwijderen
|
|
40
|
+
title: Titel en inhoud verwijderen
|
|
41
|
+
help-text: Verwijder de hoofding, en alle inhoud tot aan de volgende hoofding van hetzelfde niveau
|
|
33
42
|
placeholder:
|
|
34
43
|
generic:
|
|
35
44
|
heading: Voeg titel in
|
|
@@ -168,4 +177,4 @@ table-of-contents-plugin:
|
|
|
168
177
|
variable-plugin:
|
|
169
178
|
insert-variable: Voeg variabele in
|
|
170
179
|
button: Voeg in
|
|
171
|
-
enter-variable-value: Selecteer waarde
|
|
180
|
+
enter-variable-value: Selecteer waarde
|