@lblod/ember-rdfa-editor-lblod-plugins 6.0.0 → 7.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 +8 -1
- package/CHANGELOG.md +18 -1
- package/Dockerfile +10 -0
- package/README.md +18 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +1 -1
- package/addon/components/citation-plugin/citation-card.hbs +1 -0
- package/addon/components/citation-plugin/citation-card.ts +14 -6
- package/addon/components/citation-plugin/citation-insert.hbs +1 -0
- package/addon/components/citation-plugin/citation-insert.ts +2 -2
- package/addon/components/citation-plugin/citations/decision-detail.ts +8 -6
- package/addon/components/citation-plugin/citations/search-modal.hbs +1 -0
- package/addon/components/citation-plugin/citations/search-modal.ts +12 -6
- package/addon/components/rdfa-date-plugin/date-time-picker.ts +5 -5
- package/addon/components/rdfa-date-plugin/insert.ts +1 -0
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +1 -0
- package/addon/plugins/citation-plugin/index.ts +4 -0
- package/addon/plugins/citation-plugin/utils/vlaamse-codex.ts +93 -59
- package/addon/plugins/rdfa-date-plugin/nodes/date.ts +8 -9
- package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +25 -0
- package/addon/plugins/table-of-contents-plugin/utils/index.ts +101 -0
- package/addon/plugins/variable-plugin/nodes.ts +1 -0
- package/app/styles/variable-plugin.scss +5 -1
- package/components/citation-plugin/citation-card.d.ts +6 -0
- package/components/citation-plugin/citation-insert.d.ts +3 -3
- package/components/citation-plugin/citations/decision-detail.d.ts +3 -0
- package/components/citation-plugin/citations/search-modal.d.ts +6 -0
- package/components/rdfa-date-plugin/date-time-picker.d.ts +5 -5
- package/package.json +3 -3
- package/plugins/citation-plugin/index.d.ts +3 -0
- package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +18 -2
- package/plugins/table-of-contents-plugin/utils/index.d.ts +16 -0
package/.woodpecker/.release.yml
CHANGED
|
@@ -8,8 +8,15 @@ pipeline:
|
|
|
8
8
|
settings:
|
|
9
9
|
token:
|
|
10
10
|
from_secret: npm_access_token
|
|
11
|
+
push-tagged-build:
|
|
12
|
+
image: plugins/docker
|
|
13
|
+
settings:
|
|
14
|
+
repo: lblod/ember-rdfa-editor-lblod-plugins
|
|
15
|
+
tags: "${CI_COMMIT_TAG##v}"
|
|
16
|
+
purge: true
|
|
17
|
+
secrets: [ docker_username, docker_password ]
|
|
11
18
|
# Pipeline level conditions aren't supported yet:
|
|
12
19
|
# https://github.com/woodpecker-ci/woodpecker/issues/283
|
|
13
20
|
when:
|
|
14
21
|
event: tag
|
|
15
|
-
tag: v*
|
|
22
|
+
tag: v*
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [7.0.0] - 2023-05-17
|
|
11
|
+
### Added
|
|
12
|
+
- add docker build for easy demo environments
|
|
13
|
+
### Change
|
|
14
|
+
- BREAKING: Endpoint config for `CitationPlugin`
|
|
15
|
+
### Fixed
|
|
16
|
+
- Remove structure doesn't always work - disable the "Remove <structure>" button correctly
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Fix initialization of default date properties
|
|
20
|
+
## [6.1.0] - 2023-05-11
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- make static TOC look the same in dynamic content
|
|
10
24
|
## [6.0.0] - 2023-05-05
|
|
11
25
|
### Changed
|
|
12
26
|
- Use plugin configuration instead of ember environment in all the plugins
|
|
@@ -14,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
14
28
|
|
|
15
29
|
### Added
|
|
16
30
|
- validation plugin
|
|
31
|
+
- Enable Firefox cursor fix for variables
|
|
17
32
|
|
|
18
33
|
### Deprecated
|
|
19
34
|
- the decision-plugin card component is now deprecated in favor of the host app's choice of insert button
|
|
@@ -423,7 +438,9 @@ add onclick handler to pencil icon in variable plugin
|
|
|
423
438
|
|
|
424
439
|
# Changelog
|
|
425
440
|
|
|
426
|
-
[unreleased]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/
|
|
441
|
+
[unreleased]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v7.0.0...HEAD
|
|
442
|
+
[7.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v6.1.0...v7.0.0
|
|
443
|
+
[6.1.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v6.0.0...v6.1.0
|
|
427
444
|
[6.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v5.0.1...v6.0.0
|
|
428
445
|
[5.0.1]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v5.0.0...v5.0.1
|
|
429
446
|
[5.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v4.0.2...v5.0.0
|
package/Dockerfile
ADDED
package/README.md
CHANGED
|
@@ -85,8 +85,26 @@ This plugin provides a card that needs to be added to the sidebar of the editor
|
|
|
85
85
|
<CitationPlugin::CitationCard
|
|
86
86
|
@controller={{this.controller}}
|
|
87
87
|
@plugin={{this.citationPlugin}}
|
|
88
|
+
@config={{this.config.citation}}
|
|
88
89
|
/>
|
|
89
90
|
```
|
|
91
|
+
|
|
92
|
+
You need to specify the endpoint for the plugin in the config object
|
|
93
|
+
```js
|
|
94
|
+
{
|
|
95
|
+
endpoint: 'https://codex.opendata.api.vlaanderen.be:8888/sparql'
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Same goes for the `CitationInsert` component
|
|
100
|
+
```hbs
|
|
101
|
+
<CitationPlugin::CitationInsert
|
|
102
|
+
@controller={{this.controller}}
|
|
103
|
+
@config={{this.config.citation}}
|
|
104
|
+
/>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
|
|
90
108
|
Being this.citationPlugin a tracked reference to the plugin created with the function exported from the package and the wished configuration
|
|
91
109
|
```js
|
|
92
110
|
import { citationPlugin } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
|
|
@@ -29,6 +29,9 @@ import {
|
|
|
29
29
|
interface Args {
|
|
30
30
|
controller: SayController;
|
|
31
31
|
plugin: CitationPlugin;
|
|
32
|
+
config: {
|
|
33
|
+
endpoint: string;
|
|
34
|
+
};
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
export default class CitationCardComponent extends Component<Args> {
|
|
@@ -70,6 +73,10 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
70
73
|
return this.args.plugin;
|
|
71
74
|
}
|
|
72
75
|
|
|
76
|
+
get config() {
|
|
77
|
+
return this.args.config;
|
|
78
|
+
}
|
|
79
|
+
|
|
73
80
|
get decorations() {
|
|
74
81
|
return this.plugin.getState(this.controller.mainEditorState)?.highlights;
|
|
75
82
|
}
|
|
@@ -121,12 +128,13 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
121
128
|
const filter = {
|
|
122
129
|
type: unwrapOr('', this.selectedLegislationTypeUri),
|
|
123
130
|
};
|
|
124
|
-
const results = await fetchDecisions(
|
|
125
|
-
words,
|
|
126
|
-
filter,
|
|
127
|
-
this.pageNumber,
|
|
128
|
-
this.pageSize
|
|
129
|
-
|
|
131
|
+
const results = await fetchDecisions({
|
|
132
|
+
words: words,
|
|
133
|
+
filter: filter,
|
|
134
|
+
pageNumber: this.pageNumber,
|
|
135
|
+
pageSize: this.pageSize,
|
|
136
|
+
config: this.args.config,
|
|
137
|
+
});
|
|
130
138
|
this.totalCount = results.totalCount;
|
|
131
139
|
return results.decisions;
|
|
132
140
|
} catch (e) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Decision,
|
|
13
13
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/vlaamse-codex';
|
|
14
14
|
import { citedText } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/cited-text';
|
|
15
|
-
import {
|
|
15
|
+
import { CitationPluginEmberComponentConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
|
|
16
16
|
import {
|
|
17
17
|
LEGISLATION_TYPE_CONCEPTS,
|
|
18
18
|
LEGISLATION_TYPES,
|
|
@@ -22,7 +22,7 @@ import { findParentNodeOfType } from '@curvenote/prosemirror-utils';
|
|
|
22
22
|
|
|
23
23
|
interface Args {
|
|
24
24
|
controller: SayController;
|
|
25
|
-
config:
|
|
25
|
+
config: CitationPluginEmberComponentConfig;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export default class EditorPluginsCitationInsertComponent extends Component<Args> {
|
|
@@ -11,6 +11,7 @@ import { task as trackedTask } from 'ember-resources/util/ember-concurrency';
|
|
|
11
11
|
interface Args {
|
|
12
12
|
decision: Decision;
|
|
13
13
|
close: () => void;
|
|
14
|
+
config: { endpoint: string };
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export default class EditorPluginsCitationsDecisionDetailComponent extends Component<Args> {
|
|
@@ -32,12 +33,13 @@ export default class EditorPluginsCitationsDecisionDetailComponent extends Compo
|
|
|
32
33
|
this.error = null;
|
|
33
34
|
const abortController = new AbortController();
|
|
34
35
|
try {
|
|
35
|
-
const results = await fetchArticles(
|
|
36
|
-
this.args.decision.uri,
|
|
37
|
-
this.pageNumber,
|
|
38
|
-
this.pageSize,
|
|
39
|
-
this.articleFilterAfterTimeout
|
|
40
|
-
|
|
36
|
+
const results = await fetchArticles({
|
|
37
|
+
legalExpression: this.args.decision.uri,
|
|
38
|
+
pageNumber: this.pageNumber,
|
|
39
|
+
pageSize: this.pageSize,
|
|
40
|
+
articleFilter: this.articleFilterAfterTimeout,
|
|
41
|
+
config: this.args.config,
|
|
42
|
+
});
|
|
41
43
|
this.totalCount = results.totalCount;
|
|
42
44
|
return results.articles;
|
|
43
45
|
} catch (e) {
|
|
@@ -40,6 +40,7 @@ interface Args {
|
|
|
40
40
|
insertDecisionCitation: (decision: Decision) => void;
|
|
41
41
|
insertArticleCitation: (decision: Decision, article: Article) => void;
|
|
42
42
|
closeModal: (legislationTypeUri?: string, text?: string) => void;
|
|
43
|
+
config: { endpoint: string };
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export default class EditorPluginsCitationsSearchModalComponent extends Component<Args> {
|
|
@@ -99,6 +100,10 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
99
100
|
return this.args.text;
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
get config() {
|
|
104
|
+
return this.args.config;
|
|
105
|
+
}
|
|
106
|
+
|
|
102
107
|
get searchText() {
|
|
103
108
|
return this.inputSearchText ?? this.text;
|
|
104
109
|
}
|
|
@@ -135,12 +140,13 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
135
140
|
publicationDateFrom: getISODate(this.publicationDateFrom),
|
|
136
141
|
publicationDateTo: getISODate(this.publicationDateTo),
|
|
137
142
|
};
|
|
138
|
-
const results = await fetchDecisions(
|
|
139
|
-
words,
|
|
140
|
-
filter,
|
|
141
|
-
this.pageNumber,
|
|
142
|
-
this.pageSize
|
|
143
|
-
|
|
143
|
+
const results = await fetchDecisions({
|
|
144
|
+
words: words,
|
|
145
|
+
filter: filter,
|
|
146
|
+
pageNumber: this.pageNumber,
|
|
147
|
+
pageSize: this.pageSize,
|
|
148
|
+
config: this.args.config,
|
|
149
|
+
});
|
|
144
150
|
this.totalCount = results.totalCount;
|
|
145
151
|
return results.decisions;
|
|
146
152
|
} catch (e) {
|
|
@@ -7,25 +7,25 @@ import { localCopy } from 'tracked-toolbox';
|
|
|
7
7
|
import Intl from 'ember-intl/services/intl';
|
|
8
8
|
|
|
9
9
|
type Args = {
|
|
10
|
-
value
|
|
10
|
+
value?: Date;
|
|
11
11
|
onChange: (date: Date) => void;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default class RdfaDatePluginDateTimePicker extends Component<Args> {
|
|
15
15
|
@service declare intl: Intl;
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
17
|
-
@localCopy('args.value') declare date
|
|
17
|
+
@localCopy('args.value') declare date?: Date;
|
|
18
18
|
|
|
19
19
|
get hours() {
|
|
20
|
-
return this.date
|
|
20
|
+
return this.date?.getHours();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
get minutes() {
|
|
24
|
-
return this.date
|
|
24
|
+
return this.date?.getMinutes();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
get seconds() {
|
|
28
|
-
return this.date
|
|
28
|
+
return this.date?.getSeconds();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
get datePickerLocalization() {
|
|
@@ -132,6 +132,10 @@ export type CitationPluginConfig =
|
|
|
132
132
|
| CitationPluginNodeConfig
|
|
133
133
|
| CitationPluginRangeConfig;
|
|
134
134
|
|
|
135
|
+
export type CitationPluginEmberComponentConfig = CitationPluginConfig & {
|
|
136
|
+
endpoint: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
135
139
|
export function citationPlugin(config: CitationPluginConfig): CitationPlugin {
|
|
136
140
|
const citation: CitationPlugin = new ProsePlugin({
|
|
137
141
|
state: {
|
|
@@ -8,10 +8,6 @@ import {
|
|
|
8
8
|
import Ember from 'ember';
|
|
9
9
|
import SafeString = Ember.Handlebars.SafeString;
|
|
10
10
|
|
|
11
|
-
const SPARQL_ENDPOINT = '/codex/sparql/';
|
|
12
|
-
|
|
13
|
-
//const SPARQL_ENDPOINT = 'https://codex.opendata.api.vlaanderen.be:8888/sparql';
|
|
14
|
-
|
|
15
11
|
interface DecisionArgs {
|
|
16
12
|
uri: string;
|
|
17
13
|
legislationTypeUri: Option<string>;
|
|
@@ -106,13 +102,20 @@ export interface QueryFilter {
|
|
|
106
102
|
publicationDateTo?: Option<string>;
|
|
107
103
|
}
|
|
108
104
|
|
|
109
|
-
async function fetchDecisions(
|
|
110
|
-
words
|
|
111
|
-
filter
|
|
105
|
+
async function fetchDecisions({
|
|
106
|
+
words,
|
|
107
|
+
filter,
|
|
112
108
|
pageNumber = 0,
|
|
113
|
-
pageSize = 5
|
|
109
|
+
pageSize = 5,
|
|
110
|
+
config,
|
|
111
|
+
}: {
|
|
112
|
+
words: string[];
|
|
113
|
+
filter: QueryFilter;
|
|
114
|
+
pageNumber: number;
|
|
115
|
+
pageSize: number;
|
|
116
|
+
config: CodexQueryConfig;
|
|
117
|
+
}) {
|
|
114
118
|
/*abortSignal*/
|
|
115
|
-
) {
|
|
116
119
|
//This is silly, but null != undefined, so we have to be careful and include the correct value here
|
|
117
120
|
//Also, reconstruct the whole filter object to always have the same ordering, hopefully.
|
|
118
121
|
filter = {
|
|
@@ -132,12 +135,13 @@ async function fetchDecisions(
|
|
|
132
135
|
if (results) {
|
|
133
136
|
return results;
|
|
134
137
|
} else {
|
|
135
|
-
const newResults = await fetchDecisionsMemo(
|
|
138
|
+
const newResults = await fetchDecisionsMemo({
|
|
136
139
|
words,
|
|
137
140
|
filter,
|
|
138
141
|
pageNumber,
|
|
139
|
-
pageSize
|
|
140
|
-
|
|
142
|
+
pageSize,
|
|
143
|
+
config,
|
|
144
|
+
});
|
|
141
145
|
fetchDecisionsMemory.set(stringArguments, newResults);
|
|
142
146
|
return newResults;
|
|
143
147
|
}
|
|
@@ -148,13 +152,19 @@ interface DecisionCollection {
|
|
|
148
152
|
decisions: Decision[];
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
async function fetchDecisionsMemo(
|
|
152
|
-
words
|
|
153
|
-
filter
|
|
155
|
+
async function fetchDecisionsMemo({
|
|
156
|
+
words,
|
|
157
|
+
filter,
|
|
154
158
|
pageNumber = 0,
|
|
155
159
|
pageSize = 5,
|
|
156
|
-
|
|
157
|
-
|
|
160
|
+
config,
|
|
161
|
+
}: {
|
|
162
|
+
words: string[];
|
|
163
|
+
filter: QueryFilter;
|
|
164
|
+
config: CodexQueryConfig;
|
|
165
|
+
pageNumber?: number;
|
|
166
|
+
pageSize?: number;
|
|
167
|
+
}): Promise<DecisionCollection> {
|
|
158
168
|
// TBD/NOTE: in the context of a <http://data.europa.eu/eli/ontology#LegalResource>
|
|
159
169
|
// the eli:cites can have either a <http://xmlns.com/foaf/0.1/Document> or <http://data.europa.eu/eli/ontology#LegalResource>
|
|
160
170
|
// as range (see AP https://data.vlaanderen.be/doc/applicatieprofiel/besluit-publicatie/#Rechtsgrond),
|
|
@@ -199,8 +209,8 @@ async function fetchDecisionsMemo(
|
|
|
199
209
|
'FILTER(! STRSTARTS(LCASE(?title),"tot wijziging"))'
|
|
200
210
|
);
|
|
201
211
|
}
|
|
202
|
-
const totalCount = await executeCountQuery(
|
|
203
|
-
`PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
212
|
+
const totalCount = await executeCountQuery({
|
|
213
|
+
query: `PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
204
214
|
|
|
205
215
|
SELECT COUNT(DISTINCT(?expressionUri)) as ?count
|
|
206
216
|
WHERE {
|
|
@@ -220,12 +230,12 @@ async function fetchDecisionsMemo(
|
|
|
220
230
|
${documentDateFilter}
|
|
221
231
|
${publicationDateFilter}
|
|
222
232
|
}`,
|
|
223
|
-
|
|
224
|
-
);
|
|
233
|
+
config,
|
|
234
|
+
});
|
|
225
235
|
|
|
226
236
|
if (totalCount > 0) {
|
|
227
|
-
const response = await executeQuery<DecisionBinding>(
|
|
228
|
-
`PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
237
|
+
const response = await executeQuery<DecisionBinding>({
|
|
238
|
+
query: `PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
229
239
|
|
|
230
240
|
SELECT DISTINCT ?expressionUri as ?uri ?title ?publicationDate ?documentDate
|
|
231
241
|
WHERE {
|
|
@@ -246,8 +256,8 @@ async function fetchDecisionsMemo(
|
|
|
246
256
|
${documentDateFilter}
|
|
247
257
|
${publicationDateFilter}
|
|
248
258
|
} ORDER BY ?title LIMIT ${pageSize} OFFSET ${pageNumber * pageSize}`,
|
|
249
|
-
|
|
250
|
-
);
|
|
259
|
+
config,
|
|
260
|
+
});
|
|
251
261
|
|
|
252
262
|
const decisions = response.results.bindings.map((binding) => {
|
|
253
263
|
const escapedTitle = escapeValue(binding.title.value);
|
|
@@ -291,13 +301,19 @@ interface DecisionBinding {
|
|
|
291
301
|
|
|
292
302
|
const fetchArticlesMemory = new Map<string, ArticleCollection>();
|
|
293
303
|
|
|
294
|
-
async function fetchArticles(
|
|
295
|
-
legalExpression
|
|
296
|
-
pageNumber
|
|
297
|
-
pageSize
|
|
298
|
-
articleFilter
|
|
299
|
-
|
|
300
|
-
|
|
304
|
+
async function fetchArticles({
|
|
305
|
+
legalExpression,
|
|
306
|
+
pageNumber,
|
|
307
|
+
pageSize,
|
|
308
|
+
articleFilter,
|
|
309
|
+
config,
|
|
310
|
+
}: {
|
|
311
|
+
legalExpression: string;
|
|
312
|
+
pageNumber: number;
|
|
313
|
+
pageSize: number;
|
|
314
|
+
articleFilter: string;
|
|
315
|
+
config: CodexQueryConfig;
|
|
316
|
+
}): Promise<ArticleCollection> {
|
|
301
317
|
//Simpler here, only one way arguments are set up
|
|
302
318
|
const stringArguments = JSON.stringify({
|
|
303
319
|
legalExpression,
|
|
@@ -309,12 +325,13 @@ async function fetchArticles(
|
|
|
309
325
|
if (results) {
|
|
310
326
|
return results;
|
|
311
327
|
} else {
|
|
312
|
-
const newResults = await fetchArticlesMemo(
|
|
328
|
+
const newResults = await fetchArticlesMemo({
|
|
313
329
|
legalExpression,
|
|
314
330
|
pageNumber,
|
|
315
331
|
pageSize,
|
|
316
|
-
articleFilter
|
|
317
|
-
|
|
332
|
+
articleFilter,
|
|
333
|
+
config,
|
|
334
|
+
});
|
|
318
335
|
fetchArticlesMemory.set(stringArguments, newResults);
|
|
319
336
|
return newResults;
|
|
320
337
|
}
|
|
@@ -352,18 +369,24 @@ interface ArticleCollection {
|
|
|
352
369
|
articles: Article[];
|
|
353
370
|
}
|
|
354
371
|
|
|
355
|
-
async function fetchArticlesMemo(
|
|
356
|
-
legalExpression
|
|
372
|
+
async function fetchArticlesMemo({
|
|
373
|
+
legalExpression,
|
|
357
374
|
pageNumber = 0,
|
|
358
375
|
pageSize = 10,
|
|
359
|
-
articleFilter
|
|
360
|
-
|
|
361
|
-
|
|
376
|
+
articleFilter,
|
|
377
|
+
config,
|
|
378
|
+
}: {
|
|
379
|
+
legalExpression: string;
|
|
380
|
+
pageNumber: number;
|
|
381
|
+
pageSize: number;
|
|
382
|
+
articleFilter: string;
|
|
383
|
+
config: CodexQueryConfig;
|
|
384
|
+
}): Promise<ArticleCollection> {
|
|
362
385
|
const numberFilter = articleFilter
|
|
363
386
|
? `FILTER( !BOUND(?number) || CONTAINS(?number, "${articleFilter}"))`
|
|
364
387
|
: '';
|
|
365
|
-
const totalCount = await executeCountQuery(
|
|
366
|
-
`PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
388
|
+
const totalCount = await executeCountQuery({
|
|
389
|
+
query: `PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
367
390
|
PREFIX dct: <http://purl.org/dc/terms/>
|
|
368
391
|
|
|
369
392
|
SELECT COUNT(DISTINCT(?article)) as ?count
|
|
@@ -381,14 +404,14 @@ async function fetchArticlesMemo(
|
|
|
381
404
|
OPTIONAL { ?article eli:number ?number . }
|
|
382
405
|
${numberFilter}
|
|
383
406
|
}`,
|
|
384
|
-
|
|
385
|
-
);
|
|
407
|
+
config,
|
|
408
|
+
});
|
|
386
409
|
|
|
387
410
|
if (totalCount > 0) {
|
|
388
411
|
// ?number has format like "Artikel 12." We parse the number from the string for ordering
|
|
389
412
|
// Second degree ordering on ?numberStr to make sure "Artikel 3/1." comes after "Artikel 3."
|
|
390
|
-
const response = await executeQuery<ArticleBinding>(
|
|
391
|
-
`PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
413
|
+
const response = await executeQuery<ArticleBinding>({
|
|
414
|
+
query: `PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
392
415
|
PREFIX prov: <http://www.w3.org/ns/prov#>
|
|
393
416
|
PREFIX dct: <http://purl.org/dc/terms/>
|
|
394
417
|
|
|
@@ -411,8 +434,8 @@ async function fetchArticlesMemo(
|
|
|
411
434
|
} ORDER BY ?numberInt ?numberStr LIMIT ${pageSize} OFFSET ${
|
|
412
435
|
pageNumber * pageSize
|
|
413
436
|
}`,
|
|
414
|
-
|
|
415
|
-
);
|
|
437
|
+
config,
|
|
438
|
+
});
|
|
416
439
|
|
|
417
440
|
const articles = response.results.bindings.map((binding) => {
|
|
418
441
|
const escapedContent = escapeValue(
|
|
@@ -483,28 +506,39 @@ function dateValue(value?: string): string | null {
|
|
|
483
506
|
}
|
|
484
507
|
}
|
|
485
508
|
|
|
486
|
-
async function executeCountQuery(
|
|
487
|
-
|
|
509
|
+
async function executeCountQuery({
|
|
510
|
+
query,
|
|
511
|
+
config,
|
|
512
|
+
}: {
|
|
513
|
+
query: string;
|
|
514
|
+
config: CodexQueryConfig;
|
|
515
|
+
}) {
|
|
516
|
+
const response = await executeQuery<{ count: { value: string } }>({
|
|
488
517
|
query,
|
|
489
|
-
|
|
490
|
-
);
|
|
518
|
+
config,
|
|
519
|
+
});
|
|
491
520
|
return optionMapOr(0, parseInt, response.results.bindings[0]?.count.value);
|
|
492
521
|
}
|
|
493
522
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
523
|
+
type CodexQueryConfig = { endpoint: string; abortSignal?: AbortSignal };
|
|
524
|
+
|
|
525
|
+
async function executeQuery<A>({
|
|
526
|
+
query,
|
|
527
|
+
config,
|
|
528
|
+
}: {
|
|
529
|
+
query: string;
|
|
530
|
+
config: CodexQueryConfig;
|
|
531
|
+
}): Promise<QueryResponse<A>> {
|
|
498
532
|
const encodedQuery = encodeURIComponent(query.trim());
|
|
499
|
-
|
|
500
|
-
const response = await fetch(endpoint, {
|
|
533
|
+
|
|
534
|
+
const response = await fetch(config.endpoint, {
|
|
501
535
|
method: 'POST',
|
|
502
536
|
headers: {
|
|
503
537
|
Accept: 'application/sparql-results+json',
|
|
504
538
|
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
505
539
|
},
|
|
506
540
|
body: `query=${encodedQuery}`,
|
|
507
|
-
signal: abortSignal,
|
|
541
|
+
signal: config.abortSignal,
|
|
508
542
|
});
|
|
509
543
|
|
|
510
544
|
if (response.ok) {
|
|
@@ -16,11 +16,9 @@ const date: (options: DateOptions) => NodeSpec = (options) => {
|
|
|
16
16
|
mappingResource: {
|
|
17
17
|
default: null,
|
|
18
18
|
},
|
|
19
|
-
value: {
|
|
20
|
-
default: new Date().toISOString(),
|
|
21
|
-
},
|
|
19
|
+
value: {},
|
|
22
20
|
format: {
|
|
23
|
-
default:
|
|
21
|
+
default: options.formats[0].dateFormat,
|
|
24
22
|
},
|
|
25
23
|
onlyDate: {
|
|
26
24
|
default: true,
|
|
@@ -86,7 +84,7 @@ const date: (options: DateOptions) => NodeSpec = (options) => {
|
|
|
86
84
|
) {
|
|
87
85
|
const onlyDate = hasRDFaAttribute(node, 'datatype', XSD('date'));
|
|
88
86
|
return {
|
|
89
|
-
value: node.getAttribute('content'),
|
|
87
|
+
value: node.getAttribute('content') ?? new Date().toISOString(),
|
|
90
88
|
onlyDate,
|
|
91
89
|
format: node.dataset.format,
|
|
92
90
|
custom: node.dataset.custom === 'true',
|
|
@@ -115,13 +113,14 @@ const date: (options: DateOptions) => NodeSpec = (options) => {
|
|
|
115
113
|
);
|
|
116
114
|
const dateNode = [...node.children].find((el) =>
|
|
117
115
|
hasRDFaAttribute(el, 'property', EXT('content'))
|
|
118
|
-
);
|
|
116
|
+
) as HTMLElement | undefined;
|
|
119
117
|
return {
|
|
120
118
|
mappingResource,
|
|
121
119
|
onlyDate,
|
|
122
|
-
value:
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
value:
|
|
121
|
+
dateNode?.getAttribute('content') ?? new Date().toISOString(),
|
|
122
|
+
format: dateNode?.dataset.format,
|
|
123
|
+
custom: dateNode?.dataset.custom === 'true',
|
|
125
124
|
};
|
|
126
125
|
}
|
|
127
126
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
EmberNodeConfig,
|
|
5
5
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
6
6
|
import { TableOfContentsConfig } from '..';
|
|
7
|
+
import { createTableOfContents } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils';
|
|
7
8
|
|
|
8
9
|
export const emberNodeConfig: (
|
|
9
10
|
config: TableOfContentsConfig
|
|
@@ -18,6 +19,30 @@ export const emberNodeConfig: (
|
|
|
18
19
|
config: {
|
|
19
20
|
default: config,
|
|
20
21
|
},
|
|
22
|
+
entries: {
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
toDOM(node) {
|
|
27
|
+
const { entries } = node.attrs;
|
|
28
|
+
|
|
29
|
+
if (!entries) {
|
|
30
|
+
return [
|
|
31
|
+
'div',
|
|
32
|
+
{
|
|
33
|
+
'data-ember-node': 'table-of-contents',
|
|
34
|
+
class: 'table-of-contents',
|
|
35
|
+
},
|
|
36
|
+
['h3', {}, 'Table Of Contents'],
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return [
|
|
41
|
+
'div',
|
|
42
|
+
{ 'data-ember-node': 'table-of-contents', class: 'table-of-contents' },
|
|
43
|
+
['h3', {}, 'Table Of Contents'],
|
|
44
|
+
createTableOfContents(entries),
|
|
45
|
+
];
|
|
21
46
|
},
|
|
22
47
|
parseDOM: [
|
|
23
48
|
{
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { DOMOutputSpec, PNode } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
3
|
+
|
|
4
|
+
type OutlineEntry = {
|
|
5
|
+
content: string;
|
|
6
|
+
pos: number;
|
|
7
|
+
children?: OutlineEntry[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Mutable<T> = {
|
|
11
|
+
-readonly [P in keyof T]: T[P];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function createTableOfContents(entries: OutlineEntry[]) {
|
|
15
|
+
const tableOfContents: Mutable<DOMOutputSpec> = [
|
|
16
|
+
'ul',
|
|
17
|
+
{
|
|
18
|
+
class: 'au-u-background-gray-100 au-u-padding-tiny table-of-contents',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < entries.length; i++) {
|
|
23
|
+
const item: OutlineEntry = entries[i];
|
|
24
|
+
const li: Mutable<DOMOutputSpec> = [
|
|
25
|
+
'li',
|
|
26
|
+
{ class: 'au-c-list__item' },
|
|
27
|
+
[
|
|
28
|
+
'button',
|
|
29
|
+
{
|
|
30
|
+
class: 'au-c-button au-c-button--link-secondary au-c-button--wrap',
|
|
31
|
+
type: 'button',
|
|
32
|
+
},
|
|
33
|
+
item.content,
|
|
34
|
+
],
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
if (item.children?.length) {
|
|
38
|
+
const children = createTableOfContents(item.children);
|
|
39
|
+
li.push(children);
|
|
40
|
+
}
|
|
41
|
+
tableOfContents.push(li);
|
|
42
|
+
}
|
|
43
|
+
return tableOfContents;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type Config = { nodeHierarchy: string[] }[];
|
|
47
|
+
|
|
48
|
+
export function extractOutline({
|
|
49
|
+
node,
|
|
50
|
+
pos,
|
|
51
|
+
config,
|
|
52
|
+
}: {
|
|
53
|
+
node: PNode;
|
|
54
|
+
pos: number;
|
|
55
|
+
config: Config;
|
|
56
|
+
}): OutlineEntry[] {
|
|
57
|
+
let result: OutlineEntry[] = [];
|
|
58
|
+
let parent: OutlineEntry | undefined;
|
|
59
|
+
for (const option of config) {
|
|
60
|
+
const { nodeHierarchy } = option;
|
|
61
|
+
if (RegExp(`^${nodeHierarchy[0]}$`).exec(node.type.name)) {
|
|
62
|
+
let i = 1;
|
|
63
|
+
let currentNode: NodeWithPos | undefined = { node, pos };
|
|
64
|
+
while (currentNode && i < nodeHierarchy.length) {
|
|
65
|
+
let newCurrentNode: NodeWithPos | undefined;
|
|
66
|
+
currentNode.node.forEach((child, offset) => {
|
|
67
|
+
if (RegExp(`^${nodeHierarchy[i]}$`).exec(child.type.name)) {
|
|
68
|
+
newCurrentNode = { pos: pos + offset, node: child };
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
currentNode = newCurrentNode;
|
|
73
|
+
i++;
|
|
74
|
+
}
|
|
75
|
+
if (currentNode) {
|
|
76
|
+
const outlineText = currentNode.node.type.spec.outlineText as
|
|
77
|
+
| ((node: PNode) => string)
|
|
78
|
+
| undefined;
|
|
79
|
+
const content =
|
|
80
|
+
outlineText?.(currentNode.node) ?? currentNode.node.textContent;
|
|
81
|
+
parent = {
|
|
82
|
+
pos: currentNode.pos,
|
|
83
|
+
content,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const subResults: OutlineEntry[] = [];
|
|
89
|
+
node.forEach((child, offset) => {
|
|
90
|
+
subResults.push(
|
|
91
|
+
...extractOutline({ node: child, pos: pos + 1 + offset, config })
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
if (parent) {
|
|
95
|
+
parent.children = subResults;
|
|
96
|
+
result = [parent];
|
|
97
|
+
} else {
|
|
98
|
+
result = subResults;
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
margin-left: 0.3rem;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
.mark-highlight-manual + .ProseMirror-firefox-fake-cursor {
|
|
6
|
+
margin-left: -0.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
[typeof='ext:Mapping'] {
|
|
6
10
|
border-bottom: 0 !important;
|
|
7
11
|
|
|
@@ -63,4 +67,4 @@
|
|
|
63
67
|
background-color: var(--au-blue-300);
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
|
-
}
|
|
70
|
+
}
|
|
@@ -6,6 +6,9 @@ import { SayController } from '@lblod/ember-rdfa-editor';
|
|
|
6
6
|
interface Args {
|
|
7
7
|
controller: SayController;
|
|
8
8
|
plugin: CitationPlugin;
|
|
9
|
+
config: {
|
|
10
|
+
endpoint: string;
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
export default class CitationCardComponent extends Component<Args> {
|
|
11
14
|
pageNumber: number;
|
|
@@ -24,6 +27,9 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
24
27
|
get controller(): SayController;
|
|
25
28
|
get showCard(): false | Option<CitationDecoration>;
|
|
26
29
|
get plugin(): CitationPlugin;
|
|
30
|
+
get config(): {
|
|
31
|
+
endpoint: string;
|
|
32
|
+
};
|
|
27
33
|
get decorations(): import("prosemirror-view").DecorationSet | undefined;
|
|
28
34
|
get activeDecoration(): Option<CitationDecoration>;
|
|
29
35
|
get searchText(): string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import { Article, Decision } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/vlaamse-codex';
|
|
4
|
-
import {
|
|
4
|
+
import { CitationPluginEmberComponentConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
|
|
5
5
|
interface Args {
|
|
6
6
|
controller: SayController;
|
|
7
|
-
config:
|
|
7
|
+
config: CitationPluginEmberComponentConfig;
|
|
8
8
|
}
|
|
9
9
|
export default class EditorPluginsCitationInsertComponent extends Component<Args> {
|
|
10
10
|
showModal: boolean;
|
|
11
11
|
legislationTypeUri: string;
|
|
12
12
|
text: string;
|
|
13
13
|
legislationType: string | null;
|
|
14
|
-
get config():
|
|
14
|
+
get config(): CitationPluginEmberComponentConfig;
|
|
15
15
|
get selectedLegislationTypeUri(): string;
|
|
16
16
|
get selectedLegislationType(): {
|
|
17
17
|
label: string;
|
|
@@ -3,6 +3,9 @@ import { Decision } from '../../../plugins/citation-plugin/utils/vlaamse-codex';
|
|
|
3
3
|
interface Args {
|
|
4
4
|
decision: Decision;
|
|
5
5
|
close: () => void;
|
|
6
|
+
config: {
|
|
7
|
+
endpoint: string;
|
|
8
|
+
};
|
|
6
9
|
}
|
|
7
10
|
export default class EditorPluginsCitationsDecisionDetailComponent extends Component<Args> {
|
|
8
11
|
error: unknown;
|
|
@@ -8,6 +8,9 @@ interface Args {
|
|
|
8
8
|
insertDecisionCitation: (decision: Decision) => void;
|
|
9
9
|
insertArticleCitation: (decision: Decision, article: Article) => void;
|
|
10
10
|
closeModal: (legislationTypeUri?: string, text?: string) => void;
|
|
11
|
+
config: {
|
|
12
|
+
endpoint: string;
|
|
13
|
+
};
|
|
11
14
|
}
|
|
12
15
|
export default class EditorPluginsCitationsSearchModalComponent extends Component<Args> {
|
|
13
16
|
intl: IntlService;
|
|
@@ -42,6 +45,9 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
42
45
|
get legislationTypes(): string[];
|
|
43
46
|
get legislationSelected(): string;
|
|
44
47
|
get text(): string;
|
|
48
|
+
get config(): {
|
|
49
|
+
endpoint: string;
|
|
50
|
+
};
|
|
45
51
|
get searchText(): string;
|
|
46
52
|
get rangeStart(): number;
|
|
47
53
|
get rangeEnd(): number;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import Intl from 'ember-intl/services/intl';
|
|
3
3
|
type Args = {
|
|
4
|
-
value
|
|
4
|
+
value?: Date;
|
|
5
5
|
onChange: (date: Date) => void;
|
|
6
6
|
};
|
|
7
7
|
export default class RdfaDatePluginDateTimePicker extends Component<Args> {
|
|
8
8
|
intl: Intl;
|
|
9
|
-
date
|
|
10
|
-
get hours(): number;
|
|
11
|
-
get minutes(): number;
|
|
12
|
-
get seconds(): number;
|
|
9
|
+
date?: Date;
|
|
10
|
+
get hours(): number | undefined;
|
|
11
|
+
get minutes(): number | undefined;
|
|
12
|
+
get seconds(): number | undefined;
|
|
13
13
|
get datePickerLocalization(): {
|
|
14
14
|
buttonLabel: string;
|
|
15
15
|
selectedDateMessage: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@embroider/test-setup": "^1.8.3",
|
|
64
64
|
"@glimmer/component": "^1.1.2",
|
|
65
65
|
"@glimmer/tracking": "^1.1.2",
|
|
66
|
-
"@lblod/ember-rdfa-editor": "^3.
|
|
66
|
+
"@lblod/ember-rdfa-editor": "^3.7.0",
|
|
67
67
|
"@rdfjs/types": "^1.1.0",
|
|
68
68
|
"@release-it/keep-a-changelog": "^3.1.0",
|
|
69
69
|
"@tsconfig/ember": "^1.0.1",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
145
|
"@appuniversum/ember-appuniversum": "^2.4.2",
|
|
146
|
-
"@lblod/ember-rdfa-editor": "^3.
|
|
146
|
+
"@lblod/ember-rdfa-editor": "^3.7.0",
|
|
147
147
|
"ember-concurrency": "^2.3.7"
|
|
148
148
|
},
|
|
149
149
|
"engines": {
|
|
@@ -31,5 +31,8 @@ export interface CitationPluginRangeConfig {
|
|
|
31
31
|
activeInRanges(state: EditorState): [number, number][];
|
|
32
32
|
}
|
|
33
33
|
export type CitationPluginConfig = CitationPluginNodeConfig | CitationPluginRangeConfig;
|
|
34
|
+
export type CitationPluginEmberComponentConfig = CitationPluginConfig & {
|
|
35
|
+
endpoint: string;
|
|
36
|
+
};
|
|
34
37
|
export declare function citationPlugin(config: CitationPluginConfig): CitationPlugin;
|
|
35
38
|
export {};
|
|
@@ -42,15 +42,31 @@ export interface QueryFilter {
|
|
|
42
42
|
publicationDateFrom?: Option<string>;
|
|
43
43
|
publicationDateTo?: Option<string>;
|
|
44
44
|
}
|
|
45
|
-
declare function fetchDecisions(words
|
|
45
|
+
declare function fetchDecisions({ words, filter, pageNumber, pageSize, config, }: {
|
|
46
|
+
words: string[];
|
|
47
|
+
filter: QueryFilter;
|
|
48
|
+
pageNumber: number;
|
|
49
|
+
pageSize: number;
|
|
50
|
+
config: CodexQueryConfig;
|
|
51
|
+
}): Promise<DecisionCollection>;
|
|
46
52
|
interface DecisionCollection {
|
|
47
53
|
totalCount: number;
|
|
48
54
|
decisions: Decision[];
|
|
49
55
|
}
|
|
50
|
-
declare function fetchArticles(legalExpression
|
|
56
|
+
declare function fetchArticles({ legalExpression, pageNumber, pageSize, articleFilter, config, }: {
|
|
57
|
+
legalExpression: string;
|
|
58
|
+
pageNumber: number;
|
|
59
|
+
pageSize: number;
|
|
60
|
+
articleFilter: string;
|
|
61
|
+
config: CodexQueryConfig;
|
|
62
|
+
}): Promise<ArticleCollection>;
|
|
51
63
|
interface ArticleCollection {
|
|
52
64
|
totalCount: number;
|
|
53
65
|
articles: Article[];
|
|
54
66
|
}
|
|
55
67
|
declare function cleanCaches(): void;
|
|
68
|
+
type CodexQueryConfig = {
|
|
69
|
+
endpoint: string;
|
|
70
|
+
abortSignal?: AbortSignal;
|
|
71
|
+
};
|
|
56
72
|
export { fetchDecisions, fetchArticles, cleanCaches };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PNode } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
type OutlineEntry = {
|
|
3
|
+
content: string;
|
|
4
|
+
pos: number;
|
|
5
|
+
children?: OutlineEntry[];
|
|
6
|
+
};
|
|
7
|
+
export declare function createTableOfContents(entries: OutlineEntry[]): [string, ...any[]];
|
|
8
|
+
type Config = {
|
|
9
|
+
nodeHierarchy: string[];
|
|
10
|
+
}[];
|
|
11
|
+
export declare function extractOutline({ node, pos, config, }: {
|
|
12
|
+
node: PNode;
|
|
13
|
+
pos: number;
|
|
14
|
+
config: Config;
|
|
15
|
+
}): OutlineEntry[];
|
|
16
|
+
export {};
|