@lblod/ember-rdfa-editor-lblod-plugins 11.2.0 → 11.3.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.
Files changed (38) hide show
  1. package/.woodpecker/.changelog.yml +9 -0
  2. package/.woodpecker/.test.yml +0 -8
  3. package/CHANGELOG.md +9 -1
  4. package/README.md +14 -12
  5. package/addon/components/citation-plugin/citation-card.ts +22 -18
  6. package/addon/components/citation-plugin/citation-insert.hbs +0 -1
  7. package/addon/components/citation-plugin/citation-insert.ts +5 -7
  8. package/addon/components/citation-plugin/citations/decision-detail.ts +4 -5
  9. package/addon/components/citation-plugin/citations/decision-preview.hbs +61 -15
  10. package/addon/components/citation-plugin/citations/decision-preview.ts +19 -0
  11. package/addon/components/citation-plugin/citations/search-modal.hbs +49 -47
  12. package/addon/components/citation-plugin/citations/search-modal.ts +28 -17
  13. package/addon/plugins/citation-plugin/index.ts +8 -2
  14. package/addon/plugins/citation-plugin/utils/article.ts +193 -0
  15. package/addon/plugins/citation-plugin/utils/cache.ts +7 -0
  16. package/addon/plugins/citation-plugin/utils/legal-documents.ts +133 -0
  17. package/addon/plugins/citation-plugin/utils/process-match.ts +60 -44
  18. package/addon/plugins/citation-plugin/utils/public-decisions.ts +228 -0
  19. package/addon/plugins/citation-plugin/utils/{legislation-types.ts → types.ts} +24 -18
  20. package/addon/plugins/citation-plugin/utils/utils.ts +14 -0
  21. package/addon/plugins/citation-plugin/utils/vlaamse-codex.ts +29 -390
  22. package/components/citation-plugin/citation-card.d.ts +11 -14
  23. package/components/citation-plugin/citation-insert.d.ts +4 -3
  24. package/components/citation-plugin/citations/decision-detail.d.ts +3 -3
  25. package/components/citation-plugin/citations/decision-preview.d.ts +10 -0
  26. package/components/citation-plugin/citations/search-modal.d.ts +15 -16
  27. package/package.json +2 -2
  28. package/plugins/citation-plugin/index.d.ts +2 -1
  29. package/plugins/citation-plugin/utils/article.d.ts +29 -0
  30. package/plugins/citation-plugin/utils/cache.d.ts +1 -0
  31. package/plugins/citation-plugin/utils/legal-documents.d.ts +48 -0
  32. package/plugins/citation-plugin/utils/public-decisions.d.ts +8 -0
  33. package/plugins/citation-plugin/utils/types.d.ts +28 -0
  34. package/plugins/citation-plugin/utils/utils.d.ts +1 -0
  35. package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +7 -69
  36. package/translations/en-US.yaml +4 -1
  37. package/translations/nl-BE.yaml +4 -0
  38. package/plugins/citation-plugin/utils/legislation-types.d.ts +0 -24
@@ -1,16 +1,16 @@
1
1
  import Component from '@glimmer/component';
2
- import { Article, Decision } from '../../../plugins/citation-plugin/utils/vlaamse-codex';
2
+ import { CitationPluginEmberComponentConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
3
3
  import IntlService from 'ember-intl/services/intl';
4
+ import { Article } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/article';
5
+ import { LegalDocument } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/legal-documents';
4
6
  interface Args {
5
- selectedDecision: Decision;
7
+ selectedDecision: LegalDocument;
6
8
  legislationTypeUri: string;
7
9
  text: string;
8
- insertDecisionCitation: (decision: Decision) => void;
9
- insertArticleCitation: (decision: Decision, article: Article) => void;
10
+ insertDecisionCitation: (decision: LegalDocument) => void;
11
+ insertArticleCitation: (decision: LegalDocument, article: Article) => void;
10
12
  closeModal: (legislationTypeUri?: string, text?: string) => void;
11
- config: {
12
- endpoint: string;
13
- };
13
+ config: CitationPluginEmberComponentConfig;
14
14
  }
15
15
  export default class EditorPluginsCitationsSearchModalComponent extends Component<Args> {
16
16
  intl: IntlService;
@@ -19,7 +19,7 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
19
19
  totalCount: number;
20
20
  decisions: never[];
21
21
  error: unknown;
22
- selectedDecision: Decision | null;
22
+ selectedDecision: LegalDocument | null;
23
23
  documentDateFrom: Date | null;
24
24
  documentDateTo: Date | null;
25
25
  publicationDateFrom: Date | null;
@@ -42,24 +42,23 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
42
42
  monthNames: string[];
43
43
  monthNamesShort: string[];
44
44
  };
45
- get legislationTypes(): string[];
45
+ get legislationTypes(): ("Besluit" | "Decreet" | "Koninklijk besluit" | "Wet" | "Ministerieel besluit" | "Besluit van de vlaamse regering" | "Omzendbrief" | "Verdrag" | "Grondwet" | "Grondwetswijziging" | "Samenwerkingsakkoord" | "Wetboek" | "Gecoördineerde wetten" | "Bijzondere wet" | "Genummerd koninklijk besluit" | "Protocol")[];
46
46
  get legislationSelected(): string;
47
47
  get text(): string;
48
- get config(): {
49
- endpoint: string;
50
- };
48
+ get config(): CitationPluginEmberComponentConfig;
51
49
  get searchText(): string;
52
- resourceSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<Decision[]>>;
50
+ resourceSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<LegalDocument[]>>;
53
51
  decisionResource: import("ember-resources/util/ember-concurrency").TaskInstance<unknown>;
52
+ get isBesluitType(): boolean;
54
53
  setInputSearchText(event: InputEvent): void;
55
54
  updateDocumentDateFrom(_isoDate: unknown, date: Date): void;
56
55
  updateDocumentDateTo(_isoDate: unknown, date: Date): void;
57
56
  updatePublicationDateFrom(_isoDate: unknown, date: Date): void;
58
57
  updatePublicationDateTo(_isoDate: unknown, date: Date): void;
59
- insertDecisionCitation(decision: Decision): Promise<void>;
60
- insertArticleCitation(decision: Decision, article: Article): Promise<void>;
58
+ insertDecisionCitation(decision: LegalDocument): Promise<void>;
59
+ insertArticleCitation(decision: LegalDocument, article: Article): Promise<void>;
61
60
  closeModal(legislationTypeUri?: string, text?: string): Promise<void>;
62
- openDecisionDetail(decision: Decision): void;
61
+ openDecisionDetail(decision: LegalDocument): void;
63
62
  closeDecisionDetail(): void;
64
63
  previousPage(): void;
65
64
  nextPage(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -43,7 +43,7 @@
43
43
  "buffer": "^6.0.3",
44
44
  "codemirror": "^6.0.1",
45
45
  "date-fns": "^2.30.0",
46
- "ember-auto-import": "~2.5.0",
46
+ "ember-auto-import": "~2.6.3",
47
47
  "ember-cli-babel": "^7.26.11",
48
48
  "ember-cli-htmlbars": "^6.1.1",
49
49
  "ember-cli-typescript": "^5.2.1",
@@ -1,6 +1,6 @@
1
1
  import { Decoration, DecorationSet, EditorState, InlineDecorationSpec, NodeType, ProsePlugin, Schema } from '@lblod/ember-rdfa-editor';
2
2
  /**
3
- * The monster regex that makes the citation plugin trigger.
3
+ * The monster regex that makes the citation plugin trigger to show `CitationCard`.
4
4
  * In restructuring, I've made sure that I didn't abstract away any of the capturing groups,
5
5
  * only their content, so you can still see what's going on
6
6
  *
@@ -33,6 +33,7 @@ export interface CitationPluginRangeConfig {
33
33
  export type CitationPluginConfig = CitationPluginNodeConfig | CitationPluginRangeConfig;
34
34
  export type CitationPluginEmberComponentConfig = CitationPluginConfig & {
35
35
  endpoint: string;
36
+ decisionsEndpoint?: string;
36
37
  };
37
38
  export declare function citationPlugin(config: CitationPluginConfig): CitationPlugin;
38
39
  export {};
@@ -0,0 +1,29 @@
1
+ import { LegalDocumentsQueryConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/legal-documents';
2
+ interface ArticleArgs {
3
+ uri: string;
4
+ number?: number;
5
+ content: string | null;
6
+ dateInForce: string | null;
7
+ dateNoLongerInForce: string | null;
8
+ }
9
+ export declare class Article {
10
+ uri: string;
11
+ number?: number;
12
+ content: string | null;
13
+ dateInForce: string | null;
14
+ dateNoLongerInForce: string | null;
15
+ constructor({ uri, number, content, dateInForce, dateNoLongerInForce, }: ArticleArgs);
16
+ }
17
+ export declare const fetchArticlesCache: Map<string, ArticleCollection>;
18
+ declare function fetchArticles({ legalExpression, pageNumber, pageSize, articleFilter, config, }: {
19
+ legalExpression: string;
20
+ pageNumber: number;
21
+ pageSize: number;
22
+ articleFilter: string;
23
+ config: LegalDocumentsQueryConfig;
24
+ }): Promise<ArticleCollection>;
25
+ interface ArticleCollection {
26
+ totalCount: number;
27
+ articles: Article[];
28
+ }
29
+ export { fetchArticles };
@@ -0,0 +1 @@
1
+ export declare function cleanCaches(): void;
@@ -0,0 +1,48 @@
1
+ import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
2
+ interface LegalDocumentArgs {
3
+ uri: string;
4
+ legislationTypeUri: Option<string>;
5
+ title: string | null;
6
+ publicationDate: string | null;
7
+ documentDate: string | null;
8
+ meta?: Record<string, unknown> | null;
9
+ }
10
+ export declare class LegalDocument {
11
+ uri: string;
12
+ legislationType: {
13
+ label: string;
14
+ value: string;
15
+ } | undefined;
16
+ title: string | null;
17
+ publicationDate: string | null;
18
+ documentDate: string | null;
19
+ meta: Record<string, unknown> | null;
20
+ constructor({ uri, legislationTypeUri, title, publicationDate, documentDate, meta, }: LegalDocumentArgs);
21
+ get fullTitle(): string;
22
+ }
23
+ export declare const isBesluitLegalDocument: (legalDocument: LegalDocument) => boolean;
24
+ export declare const fetchLegalDocumentsCache: Map<string, LegalDocumentsCollection>;
25
+ export interface LegalDocumentsCollection {
26
+ totalCount: number;
27
+ legalDocuments: LegalDocument[];
28
+ }
29
+ export interface LegalDocumentsQueryFilter {
30
+ type: string;
31
+ documentDateFrom?: Option<string>;
32
+ documentDateTo?: Option<string>;
33
+ publicationDateFrom?: Option<string>;
34
+ publicationDateTo?: Option<string>;
35
+ }
36
+ export type LegalDocumentsQueryConfig = {
37
+ endpoint: string;
38
+ decisionsEndpoint?: string;
39
+ abortSignal?: AbortSignal;
40
+ };
41
+ export declare function fetchLegalDocuments({ words, filter, pageNumber, pageSize, config, }: {
42
+ words: string[];
43
+ filter: LegalDocumentsQueryFilter;
44
+ pageNumber: number;
45
+ pageSize: number;
46
+ config: LegalDocumentsQueryConfig;
47
+ }): Promise<LegalDocumentsCollection>;
48
+ export {};
@@ -0,0 +1,8 @@
1
+ import { LegalDocumentsQueryConfig, LegalDocumentsQueryFilter, LegalDocumentsCollection } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/legal-documents';
2
+ export declare function fetchPublicDecisions({ words, filter, pageNumber, pageSize, config, }: {
3
+ words: string[];
4
+ config: LegalDocumentsQueryConfig;
5
+ filter: LegalDocumentsQueryFilter;
6
+ pageNumber?: number;
7
+ pageSize?: number;
8
+ }): Promise<LegalDocumentsCollection>;
@@ -0,0 +1,28 @@
1
+ export declare const LEGISLATION_TYPES: {
2
+ decreet: string;
3
+ 'koninklijk besluit': string;
4
+ wet: string;
5
+ 'ministerieel besluit': string;
6
+ 'besluit van de vlaamse regering': string;
7
+ omzendbrief: string;
8
+ verdrag: string;
9
+ grondwet: string;
10
+ grondwetswijziging: string;
11
+ samenwerkingsakkoord: string;
12
+ wetboek: string;
13
+ 'geco\u00F6rdineerde wetten': string;
14
+ 'bijzondere wet': string;
15
+ 'genummerd koninklijk besluit': string;
16
+ protocol: string;
17
+ besluit: string;
18
+ };
19
+ export declare const legislationKeysCapitalized: ["Besluit" | "Decreet" | "Koninklijk besluit" | "Wet" | "Ministerieel besluit" | "Besluit van de vlaamse regering" | "Omzendbrief" | "Verdrag" | "Grondwet" | "Grondwetswijziging" | "Samenwerkingsakkoord" | "Wetboek" | "Gecoördineerde wetten" | "Bijzondere wet" | "Genummerd koninklijk besluit" | "Protocol"];
20
+ export declare const isLegislationType: (type: string) => type is "besluit" | "decreet" | "koninklijk besluit" | "wet" | "ministerieel besluit" | "besluit van de vlaamse regering" | "omzendbrief" | "verdrag" | "grondwet" | "grondwetswijziging" | "samenwerkingsakkoord" | "wetboek" | "gecoördineerde wetten" | "bijzondere wet" | "genummerd koninklijk besluit" | "protocol";
21
+ export declare const isBesluitType: (type: string) => boolean;
22
+ export declare const LEGISLATION_TYPE_CONCEPTS: {
23
+ label: string;
24
+ value: string;
25
+ }[];
26
+ export interface Binding<A> {
27
+ value: A;
28
+ }
@@ -0,0 +1 @@
1
+ export declare function replaceDiacriticsInWord(word: string): string;
@@ -1,70 +1,8 @@
1
- import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
2
- interface DecisionArgs {
3
- uri: string;
4
- legislationTypeUri: Option<string>;
5
- title: string | null;
6
- publicationDate: string | null;
7
- documentDate: string | null;
8
- }
9
- export declare class Decision {
10
- uri: string;
11
- legislationType: {
12
- label: string;
13
- value: string;
14
- } | undefined;
15
- title: string | null;
16
- publicationDate: string | null;
17
- documentDate: string | null;
18
- constructor({ uri, legislationTypeUri, title, publicationDate, documentDate, }: DecisionArgs);
19
- get fullTitle(): string;
20
- }
21
- interface ArticleArgs {
22
- uri: string;
23
- number?: number;
24
- content: string | null;
25
- dateInForce: string | null;
26
- dateNoLongerInForce: string | null;
27
- }
28
- export declare class Article {
29
- uri: string;
30
- number?: number;
31
- content: string | null;
32
- dateInForce: string | null;
33
- dateNoLongerInForce: string | null;
34
- constructor({ uri, number, content, dateInForce, dateNoLongerInForce, }: ArticleArgs);
35
- }
36
- export interface QueryFilter {
37
- type: string;
38
- documentDateFrom?: Option<string>;
39
- documentDateTo?: Option<string>;
40
- publicationDateFrom?: Option<string>;
41
- publicationDateTo?: Option<string>;
42
- }
43
- declare function fetchDecisions({ words, filter, pageNumber, pageSize, config, }: {
1
+ import { LegalDocumentsCollection, LegalDocumentsQueryConfig, LegalDocumentsQueryFilter } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/legal-documents';
2
+ export declare function fetchVlaamseCodexLegalDocuments({ words, filter, pageNumber, pageSize, config, }: {
44
3
  words: string[];
45
- filter: QueryFilter;
46
- pageNumber: number;
47
- pageSize: number;
48
- config: CodexQueryConfig;
49
- }): Promise<DecisionCollection>;
50
- interface DecisionCollection {
51
- totalCount: number;
52
- decisions: Decision[];
53
- }
54
- declare function fetchArticles({ legalExpression, pageNumber, pageSize, articleFilter, config, }: {
55
- legalExpression: string;
56
- pageNumber: number;
57
- pageSize: number;
58
- articleFilter: string;
59
- config: CodexQueryConfig;
60
- }): Promise<ArticleCollection>;
61
- interface ArticleCollection {
62
- totalCount: number;
63
- articles: Article[];
64
- }
65
- declare function cleanCaches(): void;
66
- type CodexQueryConfig = {
67
- endpoint: string;
68
- abortSignal?: AbortSignal;
69
- };
70
- export { fetchDecisions, fetchArticles, cleanCaches };
4
+ filter: LegalDocumentsQueryFilter;
5
+ config: LegalDocumentsQueryConfig;
6
+ pageNumber?: number;
7
+ pageSize?: number;
8
+ }): Promise<LegalDocumentsCollection>;
@@ -94,6 +94,10 @@ citaten-plugin:
94
94
  refer-whole: Refer to whole document
95
95
  refer-article: Refer to this article
96
96
  lookup-codex: Lookup in Flemish Codex
97
+ lookup-publicatie: Lookup in Publicatie
98
+ lookup-publicatie-short: Publicatie
99
+ publicatie-non-available: Full content not public
100
+ publicatie-non-available-short: Not public
97
101
  alert:
98
102
  loading: Loading…
99
103
  no-results: No results found
@@ -359,4 +363,3 @@ editor-plugins:
359
363
  contact: In case of persisting issues, contact <a href="mailto:{email}">{email}</a>.
360
364
  nodeview:
361
365
  placeholder: Insert address
362
-
@@ -95,6 +95,10 @@ citaten-plugin:
95
95
  refer-whole: Verwijs naar volledig document
96
96
  refer-article: Verwijs naar artikel
97
97
  lookup-codex: Bekijk in Vlaamse Codex
98
+ lookup-publicatie: Bekijk in Publicatie
99
+ lookup-publicatie-short: Publicatie
100
+ publicatie-non-available: Volledige inhoud niet publiek
101
+ publicatie-non-available-short: Niet publiek
98
102
  alert:
99
103
  loading: Laden…
100
104
  no-results: Geen resultaten gevonden
@@ -1,24 +0,0 @@
1
- declare const LEGISLATION_TYPES: {
2
- decreet: string;
3
- 'koninklijk besluit': string;
4
- wet: string;
5
- 'ministerieel besluit': string;
6
- 'besluit van de vlaamse regering': string;
7
- omzendbrief: string;
8
- verdrag: string;
9
- grondwet: string;
10
- grondwetswijziging: string;
11
- samenwerkingsakkoord: string;
12
- wetboek: string;
13
- 'geco\u00F6rdineerde wetten': string;
14
- 'bijzondere wet': string;
15
- 'genummerd koninklijk besluit': string;
16
- protocol: string;
17
- };
18
- export type Legislations = typeof LEGISLATION_TYPES;
19
- export type LegislationKey = keyof Legislations;
20
- declare const LEGISLATION_TYPE_CONCEPTS: {
21
- label: string;
22
- value: string;
23
- }[];
24
- export { LEGISLATION_TYPES, LEGISLATION_TYPE_CONCEPTS };