@lblod/ember-rdfa-editor-lblod-plugins 2.1.2 → 3.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/.woodpecker/.release.yml +1 -1
- package/.woodpecker/.test-scenarios.yml +17 -0
- package/.woodpecker/.test.yml +5 -5
- package/CHANGELOG.md +23 -1
- package/README.md +1 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +1 -3
- package/addon/components/article-structure-plugin/article-structure-card.ts +14 -8
- package/addon/components/article-structure-plugin/structure-card.hbs +6 -4
- package/addon/components/article-structure-plugin/structure-card.ts +19 -15
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +8 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -2
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +12 -10
- package/addon/components/citation-plugin/citation-card.ts +27 -25
- package/addon/components/citation-plugin/citation-insert.ts +34 -27
- package/addon/components/import-snippet-plugin/card.ts +9 -6
- package/addon/components/rdfa-date-plugin/card.ts +14 -18
- package/addon/components/rdfa-date-plugin/insert.hbs +0 -9
- package/addon/components/rdfa-date-plugin/insert.ts +12 -20
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +3 -3
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.ts +5 -4
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +1 -1
- package/addon/components/standard-template-plugin/card.ts +2 -2
- package/addon/components/standard-template-plugin/template-provider.ts +6 -5
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +1 -1
- package/addon/components/table-of-contents-plugin/toolbar-button.ts +15 -9
- package/addon/components/variable-plugin/insert-variable-card.ts +19 -14
- package/addon/components/variable-plugin/template-variable-card.hbs +1 -1
- package/addon/components/variable-plugin/template-variable-card.ts +10 -7
- package/addon/components/variable-plugin/variable.hbs +8 -3
- package/addon/models/instruction.ts +1 -1
- package/addon/models/measure.ts +1 -1
- package/addon/models/sign.ts +1 -1
- package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +1 -1
- package/addon/plugins/article-structure-plugin/index.ts +2 -32
- package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +16 -7
- package/addon/plugins/article-structure-plugin/structures/article.ts +7 -3
- package/addon/plugins/article-structure-plugin/structures/chapter.ts +1 -1
- package/addon/plugins/article-structure-plugin/structures/section.ts +1 -1
- package/addon/plugins/article-structure-plugin/structures/structure-header.ts +7 -2
- package/addon/plugins/article-structure-plugin/structures/subsection.ts +1 -1
- package/addon/plugins/article-structure-plugin/structures/title.ts +1 -1
- package/addon/plugins/besluit-plugin/utils/get-title-for-decision.ts +3 -6
- package/addon/plugins/citation-plugin/index.ts +1 -49
- package/addon/plugins/rdfa-date-plugin/index.ts +5 -28
- package/addon/plugins/rdfa-date-plugin/nodes/date.ts +1 -6
- package/addon/plugins/standard-template-plugin/index.ts +0 -6
- package/addon/plugins/standard-template-plugin/utils/nodes.ts +1 -1
- package/addon/plugins/table-of-contents-plugin/index.ts +0 -7
- package/addon/services/roadsign-registry.ts +1 -1
- package/app/styles/article-structure-plugin.scss +7 -0
- package/app/styles/besluit-plugin.scss +4 -0
- package/components/article-structure-plugin/article-structure-card.d.ts +4 -5
- package/components/article-structure-plugin/structure-card.d.ts +4 -6
- package/components/besluit-plugin/besluit-plugin-card.d.ts +3 -3
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +3 -3
- package/components/citation-plugin/citation-card.d.ts +4 -6
- package/components/citation-plugin/citation-insert.d.ts +5 -7
- package/components/import-snippet-plugin/card.d.ts +3 -3
- package/components/rdfa-date-plugin/card.d.ts +5 -10
- package/components/rdfa-date-plugin/insert.d.ts +6 -12
- package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +3 -3
- package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +2 -2
- package/components/standard-template-plugin/card.d.ts +3 -3
- package/components/standard-template-plugin/template-provider.d.ts +3 -3
- package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +1 -1
- package/components/table-of-contents-plugin/toolbar-button.d.ts +3 -3
- package/components/variable-plugin/insert-variable-card.d.ts +7 -8
- package/components/variable-plugin/template-variable-card.d.ts +3 -3
- package/package.json +26 -29
- package/plugins/article-structure-plugin/index.d.ts +2 -3
- package/plugins/besluit-plugin/utils/get-title-for-decision.d.ts +3 -3
- package/plugins/citation-plugin/index.d.ts +2 -12
- package/plugins/rdfa-date-plugin/index.d.ts +5 -5
- package/plugins/rdfa-date-plugin/nodes/date.d.ts +1 -6
- package/plugins/standard-template-plugin/index.d.ts +0 -2
- package/plugins/table-of-contents-plugin/index.d.ts +0 -2
- package/plugins/table-of-contents-plugin/nodes/table-of-contents.d.ts +1 -1
- package/plugins/variable-plugin/nodes.d.ts +1 -1
- package/translations/en-US.yaml +63 -61
- package/translations/nl-BE.yaml +65 -59
- package/addon/components/variable-plugin/variable.ts +0 -262
- package/addon/plugins/besluit-plugin/index.ts +0 -6
- package/addon/plugins/besluit-type-plugin/index.ts +0 -6
- package/addon/plugins/import-snippet-plugin.ts +0 -6
- package/addon/plugins/rdfa-date-plugin/nodes/index.ts +0 -1
- package/addon/plugins/roadsign-regulation-plugin/index.ts +0 -6
- package/addon/plugins/variable-plugin/index.ts +0 -16
- package/components/variable-plugin/variable.d.ts +0 -43
- package/plugins/besluit-plugin/index.d.ts +0 -2
- package/plugins/besluit-type-plugin/index.d.ts +0 -2
- package/plugins/import-snippet-plugin.d.ts +0 -2
- package/plugins/rdfa-date-plugin/nodes/index.d.ts +0 -1
- package/plugins/roadsign-regulation-plugin/index.d.ts +0 -2
- package/plugins/variable-plugin/index.d.ts +0 -3
package/translations/nl-BE.yaml
CHANGED
|
@@ -1,11 +1,61 @@
|
|
|
1
|
+
article-structure-plugin:
|
|
2
|
+
insert:
|
|
3
|
+
paragraph: Paragraaf invoegen
|
|
4
|
+
article: Artikel invoegen
|
|
5
|
+
title: Titel invoegen
|
|
6
|
+
chapter: Hoofdstuk invoegen
|
|
7
|
+
section: Afdeling invoegen
|
|
8
|
+
subsection: Onderafdeling invoegen
|
|
9
|
+
move-up:
|
|
10
|
+
paragraph: Paragraaf naar boven verplaatsen
|
|
11
|
+
article: Artikel naar boven verplaatsen
|
|
12
|
+
title: Titel naar boven verplaatsen
|
|
13
|
+
chapter: Hoofdstuk naar boven verplaatsen
|
|
14
|
+
section: Afdeling naar boven verplaatsen
|
|
15
|
+
subsection: Onderafdeling naar boven verplaatsen
|
|
16
|
+
move-down:
|
|
17
|
+
paragraph: Paragraaf naar beneden verplaatsen
|
|
18
|
+
article: Artikel naar beneden verplaatsen
|
|
19
|
+
title: Titel naar beneden verplaatsen
|
|
20
|
+
chapter: Hoofdstuk naar beneden verplaatsen
|
|
21
|
+
section: Afdeling naar beneden verplaatsen
|
|
22
|
+
subsection: Onderafdeling naar beneden verplaatsen
|
|
23
|
+
title:
|
|
24
|
+
structure-card: Structuur card
|
|
25
|
+
remove:
|
|
26
|
+
article: Artikel verwijderen
|
|
27
|
+
paragraph: Paragraaf verwijderen
|
|
28
|
+
subsection: Onderafdeling verwijderen
|
|
29
|
+
section: Afdeling verwijderen
|
|
30
|
+
chapter: Hoofdstuk verwijderen
|
|
31
|
+
title: Titel verwijderen
|
|
32
|
+
content: Inhoud verwijderen
|
|
33
|
+
placeholder:
|
|
34
|
+
generic:
|
|
35
|
+
heading: Voeg titel in
|
|
36
|
+
body: Voeg inhoud in
|
|
37
|
+
chapter:
|
|
38
|
+
heading: Voeg hoofdstuk in
|
|
39
|
+
body: Voeg inhoud hoofdstuk in
|
|
40
|
+
section:
|
|
41
|
+
heading: Voeg afdeling in
|
|
42
|
+
body: Voeg inhoud afdeling in
|
|
43
|
+
subsection:
|
|
44
|
+
heading: Voeg onderafdeling in
|
|
45
|
+
body: Voeg inhoud onderafdeling in
|
|
46
|
+
article:
|
|
47
|
+
heading: Voeg artikel in
|
|
48
|
+
body: Voeg inhoud artikel in
|
|
49
|
+
paragraph:
|
|
50
|
+
body: Voeg inhoud paragraaf in
|
|
51
|
+
|
|
52
|
+
|
|
1
53
|
citaten-plugin:
|
|
2
54
|
card:
|
|
3
55
|
title: Voeg citeeropschrift toe
|
|
4
56
|
suggestions: Suggesties
|
|
5
|
-
|
|
6
57
|
insert:
|
|
7
58
|
title: Citeeropschrift invoegen
|
|
8
|
-
|
|
9
59
|
search:
|
|
10
60
|
term: Zoekterm
|
|
11
61
|
advanced: Uitgebreid zoeken
|
|
@@ -23,28 +73,24 @@ citaten-plugin:
|
|
|
23
73
|
article-placeholder: Artikel nummer
|
|
24
74
|
back: Terug naar zoekresultaten
|
|
25
75
|
results: Resultaten
|
|
26
|
-
|
|
27
76
|
pagination:
|
|
28
77
|
next: Volgende pagina
|
|
29
78
|
previous: Vorige pagina
|
|
30
79
|
of: van
|
|
31
|
-
|
|
32
80
|
references:
|
|
33
81
|
insert: Citeeropschrift invoegen
|
|
34
82
|
details: Details
|
|
35
83
|
refer-whole: Verwijs naar volledig document
|
|
36
84
|
refer-article: Verwijs naar artikel
|
|
37
85
|
lookup-codex: Bekijk in Vlaams Codex
|
|
38
|
-
|
|
39
86
|
alert:
|
|
40
87
|
loading: Laden…
|
|
41
88
|
no-results: Geen resultaten gevonden
|
|
42
89
|
error-title: Probleem bij het laden
|
|
43
90
|
error-intro: "Er heeft zich een fout voorgedaan bij het zoeken in de Vlaamse Codex:"
|
|
44
91
|
error-outro: Moest dit probleem aanhouden, neem contact op met
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
toggle: Toon Inhoudstafel
|
|
92
|
+
|
|
93
|
+
|
|
48
94
|
besluit-type-plugin:
|
|
49
95
|
dt: "Besluittype"
|
|
50
96
|
insert-dt: "Selecteer een besluittype"
|
|
@@ -56,12 +102,16 @@ besluit-type-plugin:
|
|
|
56
102
|
error-title: "Fout"
|
|
57
103
|
error-first-body: "Er was een probleem bij het ophalen van de besluittypes. Probeer later opnieuw. Bij blijvende problemen, contacteer"
|
|
58
104
|
error-rest-body: ". Voor meer specifieke details, controleer de console in de browser."
|
|
105
|
+
|
|
106
|
+
|
|
59
107
|
besluit-plugin:
|
|
60
108
|
missing-title-warning: Dit besluit heeft geen titel
|
|
61
109
|
insert:
|
|
62
110
|
decision-title: Voeg besluittitel in
|
|
63
111
|
placeholder:
|
|
64
112
|
decision-title: Geef titel besluit op
|
|
113
|
+
|
|
114
|
+
|
|
65
115
|
date-plugin:
|
|
66
116
|
help:
|
|
67
117
|
title: "Datumformaat help"
|
|
@@ -109,57 +159,13 @@ date-plugin:
|
|
|
109
159
|
fractions: "Fracties van seconden, zoals S en T, zijn niet ondersteund."
|
|
110
160
|
unknown: "Ongeldig formaat"
|
|
111
161
|
|
|
162
|
+
|
|
163
|
+
table-of-contents-plugin:
|
|
164
|
+
title: Inhoudstafel
|
|
165
|
+
toggle: Toon Inhoudstafel
|
|
166
|
+
|
|
167
|
+
|
|
112
168
|
variable-plugin:
|
|
113
169
|
insert-variable: Voeg variabele in
|
|
114
170
|
button: Voeg in
|
|
115
|
-
enter-variable-value: Selecteer waarde
|
|
116
|
-
article-structure-plugin:
|
|
117
|
-
insert:
|
|
118
|
-
paragraph: Paragraaf invoegen
|
|
119
|
-
article: Artikel invoegen
|
|
120
|
-
title: Titel invoegen
|
|
121
|
-
chapter: Hoofdstuk invoegen
|
|
122
|
-
section: Afdeling invoegen
|
|
123
|
-
subsection: Onderafdeling invoegen
|
|
124
|
-
move-up:
|
|
125
|
-
paragraph: Paragraaf naar boven verplaatsen
|
|
126
|
-
article: Artikel naar boven verplaatsen
|
|
127
|
-
title: Titel naar boven verplaatsen
|
|
128
|
-
chapter: Hoofdstuk naar boven verplaatsen
|
|
129
|
-
section: Afdeling naar boven verplaatsen
|
|
130
|
-
subsection: Onderafdeling naar boven verplaatsen
|
|
131
|
-
move-down:
|
|
132
|
-
paragraph: Paragraaf naar beneden verplaatsen
|
|
133
|
-
article: Artikel naar beneden verplaatsen
|
|
134
|
-
title: Titel naar beneden verplaatsen
|
|
135
|
-
chapter: Hoofdstuk naar beneden verplaatsen
|
|
136
|
-
section: Afdeling naar beneden verplaatsen
|
|
137
|
-
subsection: Onderafdeling naar beneden verplaatsen
|
|
138
|
-
title:
|
|
139
|
-
structure-card: Structuur card
|
|
140
|
-
remove:
|
|
141
|
-
article: Artikel verwijderen
|
|
142
|
-
paragraph: Paragraaf verwijderen
|
|
143
|
-
subsection: Onderafdeling verwijderen
|
|
144
|
-
section: Afdeling verwijderen
|
|
145
|
-
chapter: Hoofdstuk verwijderen
|
|
146
|
-
title: Titel verwijderen
|
|
147
|
-
content: Inhoud verwijderen
|
|
148
|
-
placeholder:
|
|
149
|
-
generic:
|
|
150
|
-
heading: Voeg titel in
|
|
151
|
-
body: Voeg inhoud in
|
|
152
|
-
chapter:
|
|
153
|
-
heading: Voeg hoofdstuk in
|
|
154
|
-
body: Voeg inhoud hoofdstuk in
|
|
155
|
-
section:
|
|
156
|
-
heading: Voeg afdeling in
|
|
157
|
-
body: Voeg inhoud afdeling in
|
|
158
|
-
subsection:
|
|
159
|
-
heading: Voeg onderafdeling in
|
|
160
|
-
body: Voeg inhoud onderafdeling in
|
|
161
|
-
article:
|
|
162
|
-
heading: Voeg artikel in
|
|
163
|
-
body: Voeg inhoud artikel in
|
|
164
|
-
paragraph:
|
|
165
|
-
body: Voeg inhoud paragraaf in
|
|
171
|
+
enter-variable-value: Selecteer waarde
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Based on the footnotes example from https://github.com/ProseMirror/website
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2015-2017 by Marijn Haverbeke <marijnh@gmail.com> and others
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in
|
|
14
|
-
* all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
* THE SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { action } from '@ember/object';
|
|
26
|
-
import { inject as service } from '@ember/service';
|
|
27
|
-
import { htmlSafe } from '@ember/template';
|
|
28
|
-
import Component from '@glimmer/component';
|
|
29
|
-
import {
|
|
30
|
-
chainCommands,
|
|
31
|
-
createParagraphNear,
|
|
32
|
-
DOMSerializer,
|
|
33
|
-
EditorState,
|
|
34
|
-
keymap,
|
|
35
|
-
liftEmptyBlock,
|
|
36
|
-
newlineInCode,
|
|
37
|
-
NodeSelection,
|
|
38
|
-
RdfaEditorView,
|
|
39
|
-
redo,
|
|
40
|
-
Schema,
|
|
41
|
-
Selection,
|
|
42
|
-
splitBlock,
|
|
43
|
-
StepMap,
|
|
44
|
-
Transaction,
|
|
45
|
-
undo,
|
|
46
|
-
} from '@lblod/ember-rdfa-editor';
|
|
47
|
-
import { date } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/rdfa-date-plugin/nodes';
|
|
48
|
-
import {
|
|
49
|
-
isSome,
|
|
50
|
-
unwrap,
|
|
51
|
-
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
52
|
-
import { insertHardBreak } from '@lblod/ember-rdfa-editor/commands/insert-hard-break';
|
|
53
|
-
import { toggleMarkAddFirst } from '@lblod/ember-rdfa-editor/commands/toggle-mark-add-first';
|
|
54
|
-
import {
|
|
55
|
-
link,
|
|
56
|
-
em,
|
|
57
|
-
strong,
|
|
58
|
-
underline,
|
|
59
|
-
strikethrough,
|
|
60
|
-
} from '@lblod/ember-rdfa-editor/marks';
|
|
61
|
-
import {
|
|
62
|
-
block_rdfa,
|
|
63
|
-
hard_break,
|
|
64
|
-
placeholder,
|
|
65
|
-
text,
|
|
66
|
-
paragraph,
|
|
67
|
-
repaired_block,
|
|
68
|
-
} from '@lblod/ember-rdfa-editor/nodes';
|
|
69
|
-
import {
|
|
70
|
-
inline_rdfa,
|
|
71
|
-
invisible_rdfa,
|
|
72
|
-
} from '@lblod/ember-rdfa-editor/nodes/inline-rdfa';
|
|
73
|
-
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
74
|
-
import IntlService from 'ember-intl/services/intl';
|
|
75
|
-
|
|
76
|
-
export default class Variable extends Component<EmberNodeArgs> {
|
|
77
|
-
@service declare intl: IntlService;
|
|
78
|
-
innerView: RdfaEditorView | null = null;
|
|
79
|
-
|
|
80
|
-
contentWrapper: Element | null = null;
|
|
81
|
-
|
|
82
|
-
get outerView() {
|
|
83
|
-
return this.args.view;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
get node() {
|
|
87
|
-
return this.args.node;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
get pos() {
|
|
91
|
-
return this.args.getPos();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
get htmlContent() {
|
|
95
|
-
const fragment = DOMSerializer.fromSchema(this.schema).serializeFragment(
|
|
96
|
-
this.node.content,
|
|
97
|
-
{
|
|
98
|
-
document,
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
const div = document.createElement('div');
|
|
102
|
-
div.appendChild(fragment);
|
|
103
|
-
return htmlSafe(div.innerHTML);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
get schema() {
|
|
107
|
-
return new Schema({
|
|
108
|
-
nodes: {
|
|
109
|
-
doc: {
|
|
110
|
-
content: 'block+',
|
|
111
|
-
},
|
|
112
|
-
paragraph,
|
|
113
|
-
date: date({
|
|
114
|
-
placeholder: {
|
|
115
|
-
insertDate: this.intl.t('date-plugin.insert.date'),
|
|
116
|
-
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
|
|
117
|
-
},
|
|
118
|
-
}),
|
|
119
|
-
repaired_block,
|
|
120
|
-
placeholder,
|
|
121
|
-
|
|
122
|
-
text,
|
|
123
|
-
|
|
124
|
-
hard_break,
|
|
125
|
-
block_rdfa,
|
|
126
|
-
invisible_rdfa,
|
|
127
|
-
},
|
|
128
|
-
marks: {
|
|
129
|
-
inline_rdfa,
|
|
130
|
-
link,
|
|
131
|
-
em,
|
|
132
|
-
strong,
|
|
133
|
-
underline,
|
|
134
|
-
strikethrough,
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@action
|
|
140
|
-
onFocus() {
|
|
141
|
-
const outerSelectionTr = this.outerView.state.tr;
|
|
142
|
-
const outerSelection = new NodeSelection(
|
|
143
|
-
this.outerView.state.doc.resolve(this.pos)
|
|
144
|
-
);
|
|
145
|
-
outerSelectionTr.setSelection(outerSelection);
|
|
146
|
-
this.outerView.dispatch(outerSelectionTr);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
@action
|
|
150
|
-
onClick() {
|
|
151
|
-
if (this.innerView && !this.innerView.hasFocus()) {
|
|
152
|
-
this.innerView.focus();
|
|
153
|
-
const tr = this.innerView.state.tr;
|
|
154
|
-
const selection = Selection.atEnd(tr.doc);
|
|
155
|
-
tr.setSelection(selection);
|
|
156
|
-
this.innerView.dispatch(tr);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
@action
|
|
161
|
-
didInsertContentWrapper(target: Element) {
|
|
162
|
-
this.contentWrapper = target;
|
|
163
|
-
this.innerView = new RdfaEditorView(this.contentWrapper, {
|
|
164
|
-
state: EditorState.create({
|
|
165
|
-
doc: this.node,
|
|
166
|
-
plugins: [
|
|
167
|
-
keymap({
|
|
168
|
-
'Mod-z': () =>
|
|
169
|
-
undo(this.outerView.state, this.outerView.dispatch.bind(this)),
|
|
170
|
-
'Mod-Z': () =>
|
|
171
|
-
undo(this.outerView.state, this.outerView.dispatch.bind(this)),
|
|
172
|
-
'Mod-y': () =>
|
|
173
|
-
redo(this.outerView.state, this.outerView.dispatch.bind(this)),
|
|
174
|
-
'Mod-Y': () =>
|
|
175
|
-
redo(this.outerView.state, this.outerView.dispatch.bind(this)),
|
|
176
|
-
'Mod-b': toggleMarkAddFirst(this.schema.marks.strong),
|
|
177
|
-
'Mod-B': toggleMarkAddFirst(this.schema.marks.strong),
|
|
178
|
-
'Mod-i': toggleMarkAddFirst(this.schema.marks.em),
|
|
179
|
-
'Mod-I': toggleMarkAddFirst(this.schema.marks.em),
|
|
180
|
-
'Mod-u': toggleMarkAddFirst(this.schema.marks.underline),
|
|
181
|
-
'Mod-U': toggleMarkAddFirst(this.schema.marks.underline),
|
|
182
|
-
Enter: chainCommands(
|
|
183
|
-
newlineInCode,
|
|
184
|
-
createParagraphNear,
|
|
185
|
-
liftEmptyBlock,
|
|
186
|
-
splitBlock,
|
|
187
|
-
insertHardBreak
|
|
188
|
-
),
|
|
189
|
-
}),
|
|
190
|
-
],
|
|
191
|
-
schema: this.schema,
|
|
192
|
-
}),
|
|
193
|
-
dispatchTransaction: this.dispatchInner,
|
|
194
|
-
handleDOMEvents: {
|
|
195
|
-
mousedown: () => {
|
|
196
|
-
// Kludge to prevent issues due to the fact that the whole
|
|
197
|
-
// footnote is node-selected (and thus DOM-selected) when
|
|
198
|
-
// the parent editor is focused.
|
|
199
|
-
|
|
200
|
-
if (this.outerView.hasFocus()) this.innerView?.focus();
|
|
201
|
-
},
|
|
202
|
-
focus: () => {
|
|
203
|
-
const outerSelectionTr = this.outerView.state.tr;
|
|
204
|
-
const outerSelection = new NodeSelection(
|
|
205
|
-
this.outerView.state.doc.resolve(this.pos)
|
|
206
|
-
);
|
|
207
|
-
outerSelectionTr.setSelection(outerSelection);
|
|
208
|
-
this.outerView.dispatch(outerSelectionTr);
|
|
209
|
-
if (this.innerView) {
|
|
210
|
-
this.args.controller.setEmbeddedView(this.innerView);
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
@action
|
|
218
|
-
onNodeUpdate() {
|
|
219
|
-
if (this.innerView) {
|
|
220
|
-
const state = this.innerView.state;
|
|
221
|
-
const start = this.node.content.findDiffStart(state.doc.content);
|
|
222
|
-
const end = this.node.content.findDiffEnd(state.doc.content);
|
|
223
|
-
if (isSome(start) && isSome(end)) {
|
|
224
|
-
let { a: endA, b: endB } = end;
|
|
225
|
-
const overlap = start - Math.min(endA, endB);
|
|
226
|
-
if (overlap > 0) {
|
|
227
|
-
endA += overlap;
|
|
228
|
-
endB += overlap;
|
|
229
|
-
}
|
|
230
|
-
this.innerView.dispatch(
|
|
231
|
-
state.tr
|
|
232
|
-
.replace(start, endB, this.node.slice(start, endA))
|
|
233
|
-
.setMeta('fromOutside', true)
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
dispatchInner = (tr: Transaction) => {
|
|
240
|
-
if (this.innerView) {
|
|
241
|
-
const { state, transactions } = this.innerView.state.applyTransaction(tr);
|
|
242
|
-
this.innerView.updateState(state);
|
|
243
|
-
|
|
244
|
-
if (!tr.getMeta('fromOutside')) {
|
|
245
|
-
const outerTr = this.outerView.state.tr,
|
|
246
|
-
offsetMap = StepMap.offset(this.pos + 1);
|
|
247
|
-
for (let i = 0; i < transactions.length; i++) {
|
|
248
|
-
const steps = transactions[i].steps;
|
|
249
|
-
for (let j = 0; j < steps.length; j++)
|
|
250
|
-
outerTr.step(unwrap(steps[j].map(offsetMap)));
|
|
251
|
-
}
|
|
252
|
-
if (outerTr.docChanged) this.outerView.dispatch(outerTr);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
willDestroy(): void {
|
|
258
|
-
super.willDestroy();
|
|
259
|
-
this.innerView?.destroy();
|
|
260
|
-
this.innerView = null;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as date, DateOptions } from './date';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
|
|
3
|
-
export function insertVariableWidget(options?: unknown): WidgetSpec {
|
|
4
|
-
return {
|
|
5
|
-
componentName: 'variable-plugin/insert-variable-card',
|
|
6
|
-
desiredLocation: 'sidebar',
|
|
7
|
-
widgetArgs: {
|
|
8
|
-
options,
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const templateVariableWidget: WidgetSpec = {
|
|
14
|
-
componentName: 'variable-plugin/template-variable-card',
|
|
15
|
-
desiredLocation: 'sidebar',
|
|
16
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Based on the footnotes example from https://github.com/ProseMirror/website
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2015-2017 by Marijn Haverbeke <marijnh@gmail.com> and others
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in
|
|
14
|
-
* all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
* THE SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
import Component from '@glimmer/component';
|
|
25
|
-
import { RdfaEditorView, Schema, Transaction } from '@lblod/ember-rdfa-editor';
|
|
26
|
-
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
27
|
-
import IntlService from 'ember-intl/services/intl';
|
|
28
|
-
export default class Variable extends Component<EmberNodeArgs> {
|
|
29
|
-
intl: IntlService;
|
|
30
|
-
innerView: RdfaEditorView | null;
|
|
31
|
-
contentWrapper: Element | null;
|
|
32
|
-
get outerView(): import("prosemirror-view").EditorView;
|
|
33
|
-
get node(): import("prosemirror-model").Node;
|
|
34
|
-
get pos(): number;
|
|
35
|
-
get htmlContent(): import("@ember/template/-private/handlebars").SafeString;
|
|
36
|
-
get schema(): Schema<"text" | "hard_break" | "date" | "invisible_rdfa" | "paragraph" | "placeholder" | "doc" | "block_rdfa" | "repaired_block", "em" | "strong" | "link" | "underline" | "inline_rdfa" | "strikethrough">;
|
|
37
|
-
onFocus(): void;
|
|
38
|
-
onClick(): void;
|
|
39
|
-
didInsertContentWrapper(target: Element): void;
|
|
40
|
-
onNodeUpdate(): void;
|
|
41
|
-
dispatchInner: (tr: Transaction) => void;
|
|
42
|
-
willDestroy(): void;
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as date, DateOptions } from './date';
|