@lblod/ember-rdfa-editor-lblod-plugins 19.3.1 → 20.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/.dockerignore +3 -0
- package/CHANGELOG.md +14 -0
- package/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.ts +8 -10
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +4 -20
- package/addon/components/decision-plugin/decision-plugin-card.gts +231 -0
- package/addon/components/decision-plugin/insert-article.gts +81 -0
- package/addon/components/hover-tooltip.gts +68 -0
- package/addon/components/prosemirror-editor.hbs +15 -0
- package/addon/components/prosemirror-editor.ts +98 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +16 -19
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.ts +23 -3
- package/addon/components/structure-plugin/_private/control-card.gts +192 -0
- package/addon/components/structure-plugin/_private/structure.gts +159 -0
- package/addon/plugins/besluit-topic-plugin/utils/helpers.ts +19 -10
- package/addon/plugins/decision-plugin/commands/insert-article-command.ts +82 -0
- package/addon/plugins/decision-plugin/commands/insert-article-container.ts +33 -35
- package/addon/plugins/decision-plugin/commands/insert-description.ts +31 -28
- package/addon/plugins/decision-plugin/commands/insert-motivation.ts +106 -106
- package/addon/plugins/decision-plugin/commands/insert-title.ts +30 -28
- package/addon/plugins/decision-plugin/utils/build-article-structure.ts +44 -0
- package/addon/plugins/roadsign-regulation-plugin/index.ts +1 -0
- package/addon/plugins/structure-plugin/move-structure.ts +120 -0
- package/addon/plugins/structure-plugin/node.ts +148 -0
- package/addon/plugins/structure-plugin/recalculate-structure-numbers.ts +28 -0
- package/addon/utils/find-insertion-pos-in-node.ts +21 -0
- package/addon/utils/nested-prosemirror.ts +111 -0
- package/app/styles/structure-plugin.scss +53 -0
- package/declarations/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.d.ts +2 -1
- package/declarations/addon/components/besluit-type-plugin/toolbar-dropdown.d.ts +1 -2
- package/declarations/addon/components/decision-plugin/decision-plugin-card.d.ts +20 -11
- package/declarations/addon/components/decision-plugin/insert-article.d.ts +23 -0
- package/declarations/addon/components/hover-tooltip.d.ts +26 -9
- package/declarations/addon/components/prosemirror-editor.d.ts +23 -0
- package/declarations/addon/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +6 -0
- package/declarations/addon/components/structure-plugin/_private/control-card.d.ts +22 -0
- package/declarations/addon/components/structure-plugin/_private/structure.d.ts +32 -0
- package/declarations/addon/plugins/besluit-topic-plugin/utils/helpers.d.ts +2 -2
- package/declarations/addon/plugins/decision-plugin/commands/insert-article-command.d.ts +8 -0
- package/declarations/addon/plugins/decision-plugin/commands/insert-article-container.d.ts +4 -2
- package/declarations/addon/plugins/decision-plugin/commands/insert-description.d.ts +3 -2
- package/declarations/addon/plugins/decision-plugin/commands/insert-motivation.d.ts +3 -2
- package/declarations/addon/plugins/decision-plugin/commands/insert-title.d.ts +3 -2
- package/declarations/addon/plugins/decision-plugin/utils/build-article-structure.d.ts +2 -0
- package/declarations/addon/plugins/roadsign-regulation-plugin/index.d.ts +1 -0
- package/declarations/addon/plugins/structure-plugin/move-structure.d.ts +2 -0
- package/declarations/addon/plugins/structure-plugin/node.d.ts +4 -0
- package/declarations/addon/plugins/structure-plugin/recalculate-structure-numbers.d.ts +3 -0
- package/declarations/addon/utils/find-insertion-pos-in-node.d.ts +3 -0
- package/declarations/addon/utils/nested-prosemirror.d.ts +23 -0
- package/package.json +10 -5
- package/pnpm-lock.yaml +73 -14
- package/translations/en-US.yaml +9 -0
- package/translations/nl-BE.yaml +10 -3
- package/types/ember-power-select/components/power-select.d.ts +3 -3
- package/addon/components/decision-plugin/decision-plugin-card.hbs +0 -55
- package/addon/components/decision-plugin/decision-plugin-card.ts +0 -71
- package/addon/components/hover-tooltip.hbs +0 -12
- package/addon/components/hover-tooltip.ts +0 -41
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { ComponentLike } from '@glint/template';
|
|
2
|
+
import { PNode, getRdfaAttrs, rdfaAttrSpec } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import Structure from '@lblod/ember-rdfa-editor-lblod-plugins/components/structure-plugin/_private/structure';
|
|
4
|
+
import { renderRdfaAware } from '@lblod/ember-rdfa-editor/core/schema';
|
|
5
|
+
import {
|
|
6
|
+
createEmberNodeSpec,
|
|
7
|
+
createEmberNodeView,
|
|
8
|
+
EmberNodeConfig,
|
|
9
|
+
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
10
|
+
const rdfaAware = true;
|
|
11
|
+
|
|
12
|
+
export const emberNodeConfig: () => EmberNodeConfig = () => {
|
|
13
|
+
return {
|
|
14
|
+
name: 'structure',
|
|
15
|
+
component: Structure as unknown as ComponentLike,
|
|
16
|
+
inline: false,
|
|
17
|
+
group: 'block structure',
|
|
18
|
+
content: 'block+',
|
|
19
|
+
draggable: false,
|
|
20
|
+
selectable: true,
|
|
21
|
+
isolating: true,
|
|
22
|
+
atom: false,
|
|
23
|
+
editable: rdfaAware,
|
|
24
|
+
|
|
25
|
+
attrs: {
|
|
26
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
27
|
+
|
|
28
|
+
hasTitle: {
|
|
29
|
+
default: true,
|
|
30
|
+
},
|
|
31
|
+
title: {
|
|
32
|
+
default: 'title',
|
|
33
|
+
},
|
|
34
|
+
number: {
|
|
35
|
+
default: 1,
|
|
36
|
+
},
|
|
37
|
+
structureName: {
|
|
38
|
+
default: 'Structure',
|
|
39
|
+
},
|
|
40
|
+
headerTag: {
|
|
41
|
+
default: 'h3',
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
sayRenderAs: { default: 'structure' },
|
|
45
|
+
},
|
|
46
|
+
serialize(node: PNode) {
|
|
47
|
+
const parser = new DOMParser();
|
|
48
|
+
const tag = node.attrs.headerTag;
|
|
49
|
+
const structureName = node.attrs.structureName;
|
|
50
|
+
const number = node.attrs.number;
|
|
51
|
+
|
|
52
|
+
let headerSpec;
|
|
53
|
+
if (node.attrs.hasTitle) {
|
|
54
|
+
const html = parser.parseFromString(node.attrs.title, 'text/html');
|
|
55
|
+
if (html.body.firstElementChild) {
|
|
56
|
+
headerSpec = [
|
|
57
|
+
tag,
|
|
58
|
+
{ 'data-say-structure-header': true },
|
|
59
|
+
[
|
|
60
|
+
'span',
|
|
61
|
+
{ 'data-say-structure-header-name': true },
|
|
62
|
+
`${structureName} `,
|
|
63
|
+
],
|
|
64
|
+
['span', { 'data-say-structure-header-number': true }, number],
|
|
65
|
+
[
|
|
66
|
+
'span',
|
|
67
|
+
{ 'data-say-structure-header-content': true },
|
|
68
|
+
html.body.firstElementChild,
|
|
69
|
+
],
|
|
70
|
+
];
|
|
71
|
+
} else {
|
|
72
|
+
headerSpec = [
|
|
73
|
+
tag,
|
|
74
|
+
[
|
|
75
|
+
'span',
|
|
76
|
+
{ 'data-say-structure-header-name': true },
|
|
77
|
+
`${structureName} `,
|
|
78
|
+
],
|
|
79
|
+
['span', { 'data-say-structure-header-number': true }, number],
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
headerSpec = [
|
|
84
|
+
tag,
|
|
85
|
+
[
|
|
86
|
+
'span',
|
|
87
|
+
{ 'data-say-structure-header-name': true },
|
|
88
|
+
`${structureName} `,
|
|
89
|
+
],
|
|
90
|
+
['span', { 'data-say-structure-header-number': true }, number],
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return renderRdfaAware({
|
|
95
|
+
renderable: node,
|
|
96
|
+
tag: 'div',
|
|
97
|
+
attrs: {
|
|
98
|
+
'data-say-render-as': 'structure',
|
|
99
|
+
'data-say-has-title': node.attrs.hasTitle,
|
|
100
|
+
'data-say-structure-name': node.attrs.structureName,
|
|
101
|
+
'data-say-header-tag': node.attrs.headerTag,
|
|
102
|
+
'data-say-number': node.attrs.number,
|
|
103
|
+
},
|
|
104
|
+
content: [
|
|
105
|
+
'div',
|
|
106
|
+
headerSpec,
|
|
107
|
+
['div', { 'data-say-structure-content': true }, 0],
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
parseDOM: [
|
|
112
|
+
{
|
|
113
|
+
tag: 'div',
|
|
114
|
+
getAttrs(node: string | HTMLElement) {
|
|
115
|
+
if (typeof node === 'string') {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
const attrs = getRdfaAttrs(node, { rdfaAware });
|
|
119
|
+
if (node.dataset.sayRenderAs === 'structure') {
|
|
120
|
+
const hasTitle =
|
|
121
|
+
node.dataset.sayHasTitle && node.dataset.sayHasTitle !== 'false';
|
|
122
|
+
// strict selector here to avoid false positives when structures are nested
|
|
123
|
+
// :scope refers to the element on which we call querySelector
|
|
124
|
+
const titleElement = node.querySelector(
|
|
125
|
+
':scope > div > div > [data-say-structure-header] > [data-say-structure-header-content]',
|
|
126
|
+
);
|
|
127
|
+
let title: string | undefined = undefined;
|
|
128
|
+
if (titleElement) {
|
|
129
|
+
title = titleElement.innerHTML;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
...attrs,
|
|
133
|
+
hasTitle,
|
|
134
|
+
structureName: node.dataset.sayStructureName,
|
|
135
|
+
headerTag: node.dataset.sayHeaderTag,
|
|
136
|
+
number: node.dataset.sayNumber,
|
|
137
|
+
title,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
},
|
|
142
|
+
contentElement: `div[data-say-structure-content]`,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export const structure = createEmberNodeSpec(emberNodeConfig());
|
|
148
|
+
export const structureView = createEmberNodeView(emberNodeConfig());
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EditorState } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import {
|
|
3
|
+
BESLUIT,
|
|
4
|
+
RDF,
|
|
5
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
6
|
+
import { hasOutgoingNamedNodeTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
7
|
+
import type { TransactionMonadResult } from '@lblod/ember-rdfa-editor/utils/transaction-utils';
|
|
8
|
+
|
|
9
|
+
export function recalculateNumbers(
|
|
10
|
+
state: EditorState,
|
|
11
|
+
): TransactionMonadResult<boolean> {
|
|
12
|
+
const tr = state.tr;
|
|
13
|
+
const doc = tr.doc;
|
|
14
|
+
let counter = 0;
|
|
15
|
+
doc.descendants((node, pos) => {
|
|
16
|
+
if (
|
|
17
|
+
node.type.name === 'structure' &&
|
|
18
|
+
hasOutgoingNamedNodeTriple(node.attrs, RDF('type'), BESLUIT('Artikel'))
|
|
19
|
+
) {
|
|
20
|
+
counter += 1;
|
|
21
|
+
if (counter !== Number(node.attrs.number)) {
|
|
22
|
+
tr.setNodeAttribute(pos, 'number', counter);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
});
|
|
27
|
+
return { transaction: tr, result: true, initialState: state };
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PNode, ResolvedPos } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
3
|
+
export function findInsertionPosInNode(
|
|
4
|
+
$searchPos: ResolvedPos,
|
|
5
|
+
$ancestorPos: ResolvedPos,
|
|
6
|
+
nodeToInsert: PNode,
|
|
7
|
+
): Option<number> {
|
|
8
|
+
const ancestor = $ancestorPos.nodeAfter;
|
|
9
|
+
|
|
10
|
+
const insertionIndex = $searchPos.indexAfter($ancestorPos.depth);
|
|
11
|
+
const insertionPos = $searchPos.posAtIndex(
|
|
12
|
+
insertionIndex,
|
|
13
|
+
$ancestorPos.depth,
|
|
14
|
+
);
|
|
15
|
+
if (
|
|
16
|
+
!ancestor?.canReplaceWith(insertionIndex, insertionIndex, nodeToInsert.type)
|
|
17
|
+
) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return insertionPos;
|
|
21
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditorState,
|
|
3
|
+
NodeSelection,
|
|
4
|
+
ProseParser,
|
|
5
|
+
SayController,
|
|
6
|
+
SayView,
|
|
7
|
+
Schema,
|
|
8
|
+
Transaction,
|
|
9
|
+
Selection,
|
|
10
|
+
} from '@lblod/ember-rdfa-editor';
|
|
11
|
+
import { htmlToDoc } from '@lblod/ember-rdfa-editor/utils/_private/html-utils';
|
|
12
|
+
export interface NestedProsemirrorArgs {
|
|
13
|
+
target: HTMLElement;
|
|
14
|
+
schema: Schema;
|
|
15
|
+
outerView: SayView;
|
|
16
|
+
getPos: () => number | undefined;
|
|
17
|
+
controller: SayController;
|
|
18
|
+
onFocus: (view: SayView) => void;
|
|
19
|
+
onUpdateContent: (newContent: string) => void;
|
|
20
|
+
initialContent: string;
|
|
21
|
+
}
|
|
22
|
+
export default class NestedProsemirror {
|
|
23
|
+
view: SayView;
|
|
24
|
+
outerView: SayView;
|
|
25
|
+
getPos: () => number | undefined;
|
|
26
|
+
controller: SayController;
|
|
27
|
+
onFocus: (view: SayView) => void;
|
|
28
|
+
onUpdateContent: (newContent: string) => void;
|
|
29
|
+
constructor({
|
|
30
|
+
target,
|
|
31
|
+
schema,
|
|
32
|
+
outerView,
|
|
33
|
+
getPos,
|
|
34
|
+
controller,
|
|
35
|
+
onFocus,
|
|
36
|
+
onUpdateContent,
|
|
37
|
+
initialContent,
|
|
38
|
+
}: NestedProsemirrorArgs) {
|
|
39
|
+
const state = EditorState.create({ schema });
|
|
40
|
+
const parser = ProseParser.fromSchema(schema);
|
|
41
|
+
this.outerView = outerView;
|
|
42
|
+
this.getPos = getPos;
|
|
43
|
+
this.controller = controller;
|
|
44
|
+
this.onFocus = onFocus;
|
|
45
|
+
this.onUpdateContent = onUpdateContent;
|
|
46
|
+
|
|
47
|
+
this.view = new SayView(
|
|
48
|
+
{ mount: target },
|
|
49
|
+
{
|
|
50
|
+
state,
|
|
51
|
+
domParser: parser,
|
|
52
|
+
dispatchTransaction: this.dispatch,
|
|
53
|
+
handleDOMEvents: {
|
|
54
|
+
mousedown: () => {
|
|
55
|
+
// Kludge to prevent issues due to the fact that the whole
|
|
56
|
+
// footnote is node-selected (and thus DOM-selected) when
|
|
57
|
+
// the parent editor is focused.
|
|
58
|
+
|
|
59
|
+
if (this.outerView.hasFocus()) this.view?.focus();
|
|
60
|
+
},
|
|
61
|
+
focus: () => {
|
|
62
|
+
const pos = this.getPos();
|
|
63
|
+
if (pos !== undefined) {
|
|
64
|
+
const outerSelectionTr = this.outerView.state.tr;
|
|
65
|
+
const outerSelection = new NodeSelection(
|
|
66
|
+
this.outerView.state.doc.resolve(pos),
|
|
67
|
+
);
|
|
68
|
+
outerSelectionTr.setSelection(outerSelection);
|
|
69
|
+
this.outerView.dispatch(outerSelectionTr);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (this.view) {
|
|
73
|
+
this.controller.setActiveView(this.view);
|
|
74
|
+
this.onFocus?.(this.view);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
if (initialContent) {
|
|
81
|
+
this.view.setHtmlContent(initialContent);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
dispatch = (tr: Transaction) => {
|
|
86
|
+
if (this.view) {
|
|
87
|
+
const newState = this.view.state.apply(tr);
|
|
88
|
+
this.view.updateState(newState);
|
|
89
|
+
if (!tr.getMeta('fromOutside')) {
|
|
90
|
+
this.onUpdateContent(this.view.htmlContent);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
setInnerHtmlContent(html: string) {
|
|
95
|
+
const state = this.view.state;
|
|
96
|
+
const tr = state.tr;
|
|
97
|
+
tr.setMeta('fromOutside', true);
|
|
98
|
+
|
|
99
|
+
const doc = htmlToDoc(html, {
|
|
100
|
+
schema: state.schema,
|
|
101
|
+
parser: this.view.domParser,
|
|
102
|
+
editorView: this.view,
|
|
103
|
+
});
|
|
104
|
+
tr.replaceWith(0, tr.doc.nodeSize - 2, doc);
|
|
105
|
+
tr.setSelection(Selection.atEnd(tr.doc));
|
|
106
|
+
this.dispatch(tr);
|
|
107
|
+
}
|
|
108
|
+
get htmlContent() {
|
|
109
|
+
return this.view.htmlContent;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.say-structure {
|
|
2
|
+
border: 0.1rem solid var(--au-gray-300);
|
|
3
|
+
border-radius: var(--au-radius);
|
|
4
|
+
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
white-space: normal;
|
|
8
|
+
}
|
|
9
|
+
.say-structure__header {
|
|
10
|
+
background-color: var(--au-gray-200);
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 5px;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
h4 {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
.say-structure__title {
|
|
18
|
+
flex-grow: 1;
|
|
19
|
+
}
|
|
20
|
+
[contenteditable] {
|
|
21
|
+
border: none;
|
|
22
|
+
font-size: var(--au-h4);
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
&:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
padding: 0;
|
|
28
|
+
white-space: break-spaces;
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
word-wrap: break-word;
|
|
31
|
+
}
|
|
32
|
+
padding: var(--au-small);
|
|
33
|
+
}
|
|
34
|
+
.say-structure__content {
|
|
35
|
+
[data-slot] {
|
|
36
|
+
white-space: break-spaces;
|
|
37
|
+
word-break: break-all;
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
}
|
|
40
|
+
padding: var(--au-small);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.say-structure__content.say-empty {
|
|
44
|
+
[data-ember-node-content] {
|
|
45
|
+
p::before {
|
|
46
|
+
color: var(--au-gray-400);
|
|
47
|
+
content: 'Fill in content...';
|
|
48
|
+
float: left;
|
|
49
|
+
height: 0;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
package/declarations/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.d.ts
CHANGED
|
@@ -18,10 +18,11 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
|
|
|
18
18
|
cardExpanded: boolean;
|
|
19
19
|
get controller(): SayController;
|
|
20
20
|
get doc(): import("prosemirror-model").Node;
|
|
21
|
+
get decisionRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
22
|
+
get showCard(): boolean;
|
|
21
23
|
topics: import("ember-resources/util/function").State<Promise<BesluitTopic[]>>;
|
|
22
24
|
findBesluitTopicsByUris(uris: string[], topics?: BesluitTopic[] | null): BesluitTopic[] | undefined;
|
|
23
25
|
updateBesluitTopic(): void;
|
|
24
|
-
get showCard(): boolean;
|
|
25
26
|
upsertBesluitTopic(selected: BesluitTopic[]): void;
|
|
26
27
|
toggleCard(): void;
|
|
27
28
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { ResolvedPNode } from '@lblod/ember-rdfa-editor/plugins/datastore';
|
|
4
3
|
import { BesluitType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin/utils/fetchBesluitTypes';
|
|
5
4
|
import { BesluitTypePluginOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-type-plugin';
|
|
6
5
|
type Args = {
|
|
@@ -28,7 +27,7 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
|
|
|
28
27
|
get controller(): SayController;
|
|
29
28
|
get doc(): import("prosemirror-model").Node;
|
|
30
29
|
types: import("ember-resources/util/function").State<Promise<BesluitType[]>>;
|
|
31
|
-
get currentBesluitRange():
|
|
30
|
+
get currentBesluitRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
32
31
|
get currentBesluitURI(): string | undefined;
|
|
33
32
|
get showCard(): boolean;
|
|
34
33
|
updateBesluitTypes(): void;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import type { SayController, Selection } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
5
|
+
interface DecisionCardOptions {
|
|
6
|
+
articleUriGenerator?: () => string;
|
|
7
|
+
}
|
|
8
|
+
interface Sig {
|
|
9
|
+
Args: {
|
|
10
|
+
controller: SayController;
|
|
11
|
+
options?: DecisionCardOptions;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default class DecisionPluginCard extends Component<Sig> {
|
|
12
15
|
intl: IntlService;
|
|
13
16
|
get controller(): SayController;
|
|
17
|
+
get selection(): Selection;
|
|
18
|
+
get decisionNodeLocation(): NodeWithPos | null;
|
|
14
19
|
focus(): void;
|
|
20
|
+
get canInsertTitle(): boolean | null;
|
|
21
|
+
insertTitle(): void;
|
|
22
|
+
get canInsertDescription(): boolean | null;
|
|
23
|
+
insertDescription(): void;
|
|
24
|
+
get canInsertMotivation(): boolean | null;
|
|
15
25
|
insertMotivation(): void;
|
|
16
|
-
get
|
|
26
|
+
get missingArticleBlock(): boolean | null;
|
|
17
27
|
insertArticleBlock(): void;
|
|
18
|
-
get missingArticleBlock(): boolean;
|
|
19
28
|
}
|
|
20
29
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
export interface InsertArticleOptions {
|
|
4
|
+
uriGenerator?: () => string;
|
|
5
|
+
}
|
|
6
|
+
interface Sig {
|
|
7
|
+
Args: {
|
|
8
|
+
controller: SayController;
|
|
9
|
+
options?: InsertArticleOptions;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default class InsertArticleComponent extends Component<Sig> {
|
|
13
|
+
get controller(): SayController;
|
|
14
|
+
get schema(): import("prosemirror-model").Schema<any, any>;
|
|
15
|
+
get decisionRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
16
|
+
get decisionLocation(): {
|
|
17
|
+
pos: number;
|
|
18
|
+
node: import("prosemirror-model").Node;
|
|
19
|
+
} | null;
|
|
20
|
+
get canInsert(): boolean;
|
|
21
|
+
doInsert(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import { FunctionBasedModifier } from 'ember-modifier';
|
|
2
3
|
import { Velcro } from 'ember-velcro';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { Signature as VelcroModifierSignature } from 'ember-velcro/modifiers/velcro';
|
|
5
|
+
import { ModifierLike } from '@glint/template';
|
|
6
|
+
export type Placement = VelcroModifierSignature['Args']['Named']['placement'];
|
|
7
|
+
interface HoverModifierSig {
|
|
8
|
+
Element: HTMLElement;
|
|
5
9
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
interface Sig {
|
|
11
|
+
Args: {
|
|
12
|
+
placement?: Placement;
|
|
13
|
+
};
|
|
14
|
+
Blocks: {
|
|
15
|
+
hover: [
|
|
16
|
+
hover: {
|
|
17
|
+
velcroHook: ModifierLike<Velcro['velcroHook']>;
|
|
18
|
+
handleHover: ModifierLike<FunctionBasedModifier<HoverModifierSig>>;
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
tooltip: [loop: ModifierLike<Velcro['velcroLoop']>];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default class HoverTooltip extends Component<Sig> {
|
|
25
|
+
hover: FunctionBasedModifier<{
|
|
26
|
+
Element: HTMLElement;
|
|
9
27
|
Args: {
|
|
10
|
-
Named:
|
|
11
|
-
Positional:
|
|
28
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
29
|
+
Positional: [];
|
|
12
30
|
};
|
|
13
|
-
Element: Element;
|
|
14
31
|
}>;
|
|
15
32
|
tooltipOpen: boolean;
|
|
16
|
-
get placement():
|
|
33
|
+
get placement(): Placement | undefined;
|
|
17
34
|
showTooltip: () => void;
|
|
18
35
|
hideTooltip: () => void;
|
|
19
36
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SayController, SayView, Schema, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
type Args = {
|
|
4
|
+
onInit?(view: SayView): void;
|
|
5
|
+
onUpdate?(content: string): void;
|
|
6
|
+
onFocus?(view: SayView): void;
|
|
7
|
+
getPos(): number;
|
|
8
|
+
schema: Schema;
|
|
9
|
+
content?: string;
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
controller: SayController;
|
|
12
|
+
outerView: SayView;
|
|
13
|
+
};
|
|
14
|
+
export default class ProseMirrorEditor extends Component<Args> {
|
|
15
|
+
view?: SayView;
|
|
16
|
+
initialContent: string;
|
|
17
|
+
constructor(owner: unknown, args: Args);
|
|
18
|
+
get outerView(): SayView;
|
|
19
|
+
handleInit(target: HTMLElement): void;
|
|
20
|
+
onContentUpdate(): void;
|
|
21
|
+
dispatch: (tr: Transaction) => void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -37,6 +37,12 @@ export default class RoadsignRegulationCard extends Component<Args> {
|
|
|
37
37
|
get isNotTypeSign(): boolean;
|
|
38
38
|
constructor(parent: unknown, args: Args);
|
|
39
39
|
get schema(): import("prosemirror-model").Schema<any, any>;
|
|
40
|
+
get controller(): SayController;
|
|
41
|
+
get decisionRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
42
|
+
get decisionLocation(): {
|
|
43
|
+
node: import("prosemirror-model").Node;
|
|
44
|
+
pos: number;
|
|
45
|
+
} | null;
|
|
40
46
|
selectTypeOrCategory(option: Option): void;
|
|
41
47
|
changeCode(value: Code): void;
|
|
42
48
|
changeCodeCombination(value: Code[]): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { NodeType, SayController, Schema } from '@lblod/ember-rdfa-editor';
|
|
4
|
+
import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
5
|
+
interface Sig {
|
|
6
|
+
Args: {
|
|
7
|
+
controller: SayController;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default class StructureControlCardComponent extends Component<Sig> {
|
|
11
|
+
get controller(): SayController;
|
|
12
|
+
get schema(): Schema;
|
|
13
|
+
get structureType(): NodeType | undefined;
|
|
14
|
+
get structure(): Option<NodeWithPos>;
|
|
15
|
+
get structureName(): string;
|
|
16
|
+
get canMoveUp(): boolean;
|
|
17
|
+
get canMoveDown(): boolean;
|
|
18
|
+
moveStructure(direction: 'down' | 'up'): void;
|
|
19
|
+
get canRemoveStructure(): boolean;
|
|
20
|
+
removeStructure(withContent: boolean): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { SayView, Schema } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import NestedProsemirror from '@lblod/ember-rdfa-editor-lblod-plugins/utils/nested-prosemirror';
|
|
4
|
+
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
5
|
+
interface Sig {
|
|
6
|
+
Args: EmberNodeArgs;
|
|
7
|
+
Blocks: {
|
|
8
|
+
default: [];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export default class Structure extends Component<Sig> {
|
|
12
|
+
titleSchema: Schema<"text" | "doc", "em" | "strong" | "redacted" | "underline" | "strikethrough" | "subscript" | "superscript" | "highlight" | "color">;
|
|
13
|
+
titleContent: any;
|
|
14
|
+
innerView?: SayView;
|
|
15
|
+
innerEditor: NestedProsemirror | null;
|
|
16
|
+
get showPlaceholder(): boolean;
|
|
17
|
+
get controller(): import("@lblod/ember-rdfa-editor").SayController;
|
|
18
|
+
get node(): import("prosemirror-model").Node;
|
|
19
|
+
get isEmpty(): boolean;
|
|
20
|
+
get tag(): string;
|
|
21
|
+
get titleAttr(): any;
|
|
22
|
+
get headerTag(): any;
|
|
23
|
+
get number(): any;
|
|
24
|
+
get structureName(): any;
|
|
25
|
+
get hasTitle(): any;
|
|
26
|
+
onAttrsUpdate(): void;
|
|
27
|
+
onTitleUpdate: (content: string) => void;
|
|
28
|
+
onInnerEditorFocus: (view: SayView) => void;
|
|
29
|
+
initializeNestedEditor(target: HTMLElement): void;
|
|
30
|
+
focusInner(): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getCurrentBesluitRange: (controller: SayController) =>
|
|
2
|
+
import { ElementPNode } from '@lblod/ember-rdfa-editor/plugins/datastore';
|
|
3
|
+
export declare const getCurrentBesluitRange: (controller: SayController) => ElementPNode | undefined;
|
|
4
4
|
export declare const getCurrentBesluitURI: (controller: SayController) => string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
2
|
+
import { Command, PNode } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
interface InsertArticleArgs {
|
|
4
|
+
node: PNode;
|
|
5
|
+
decisionLocation: NodeWithPos;
|
|
6
|
+
}
|
|
7
|
+
export default function insertArticle({ node, decisionLocation, }: InsertArticleArgs): Command;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Command } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import IntlService from 'ember-intl/services/intl';
|
|
3
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
3
4
|
interface InsertArticleContainerArgs {
|
|
4
5
|
intl: IntlService;
|
|
5
|
-
|
|
6
|
+
decisionLocation: NodeWithPos;
|
|
7
|
+
articleUriGenerator?: () => string;
|
|
6
8
|
}
|
|
7
|
-
export default function insertArticleContainer({
|
|
9
|
+
export default function insertArticleContainer({ decisionLocation, articleUriGenerator, }: InsertArticleContainerArgs): Command;
|
|
8
10
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EditorState, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
2
3
|
interface InsertDescriptionArgs {
|
|
3
4
|
placeholderText: string;
|
|
4
|
-
|
|
5
|
+
decisionLocation: NodeWithPos;
|
|
5
6
|
}
|
|
6
|
-
export default function insertDescription({ placeholderText,
|
|
7
|
+
export default function insertDescription({ placeholderText, decisionLocation, }: InsertDescriptionArgs): (state: EditorState, dispatch?: ((tr: Transaction) => void) | undefined) => boolean;
|
|
7
8
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Command } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import IntlService from 'ember-intl/services/intl';
|
|
3
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
3
4
|
interface InsertMotivationArgs {
|
|
4
5
|
intl: IntlService;
|
|
5
|
-
|
|
6
|
+
decisionLocation: NodeWithPos;
|
|
6
7
|
}
|
|
7
|
-
export default function insertMotivation({ intl,
|
|
8
|
+
export default function insertMotivation({ intl, decisionLocation, }: InsertMotivationArgs): Command;
|
|
8
9
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EditorState, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
2
3
|
interface InsertTitleArgs {
|
|
3
4
|
placeholderText: string;
|
|
4
|
-
|
|
5
|
+
decisionLocation: NodeWithPos;
|
|
5
6
|
}
|
|
6
|
-
export default function insertTitle({ placeholderText,
|
|
7
|
+
export default function insertTitle({ placeholderText, decisionLocation, }: InsertTitleArgs): (state: EditorState, dispatch?: ((tr: Transaction) => void) | undefined) => boolean;
|
|
7
8
|
export {};
|