@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/addon/commands/article-structure-plugin/delete-structure.ts +85 -0
- package/addon/commands/article-structure-plugin/index.ts +4 -0
- package/addon/commands/article-structure-plugin/insert-article-structure.ts +137 -0
- package/addon/commands/article-structure-plugin/move-structure.ts +227 -0
- package/addon/commands/article-structure-plugin/recalculate-structure-numbers.ts +88 -0
- package/addon/commands/besluit-plugin/get-article-nodes-for-besluit.ts +30 -0
- package/addon/commands/besluit-plugin/index.ts +4 -0
- package/addon/commands/besluit-plugin/insert-article.ts +94 -0
- package/addon/commands/besluit-plugin/insert-title.ts +67 -0
- package/addon/commands/besluit-plugin/move-article.ts +69 -0
- package/addon/commands/besluit-plugin/recalculate-article-numbers.ts +44 -0
- package/addon/commands/modify-date-command.ts +48 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +14 -0
- package/addon/components/article-structure-plugin/article-structure-card.ts +83 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +42 -0
- package/addon/components/article-structure-plugin/structure-card.ts +140 -0
- package/addon/components/au-native-input.hbs +30 -0
- package/addon/components/au-native-input.ts +47 -0
- package/addon/components/besluit-plugin/besluit-context-card.hbs +44 -0
- package/addon/components/besluit-plugin/besluit-context-card.ts +144 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +42 -0
- package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +9 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +216 -0
- package/addon/components/citation-plugin/citation-card.hbs +118 -0
- package/addon/components/citation-plugin/citation-card.ts +230 -0
- package/addon/components/citation-plugin/citation-insert.hbs +20 -0
- package/addon/components/citation-plugin/citation-insert.ts +102 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-preview.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-detail.hbs +9 -6
- package/addon/components/{citaten-plugin/citations/decision-detail.js → citation-plugin/citations/decision-detail.ts} +30 -31
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-preview.hbs +0 -0
- package/addon/components/citation-plugin/citations/search-modal.hbs +254 -0
- package/addon/components/{citaten-plugin/citations/search-modal.js → citation-plugin/citations/search-modal.ts} +116 -89
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.hbs +0 -0
- package/addon/components/import-snippet-plugin/card.ts +119 -0
- package/addon/components/insert-variable-plugin/insert-variable-card.hbs +2 -1
- package/addon/components/insert-variable-plugin/insert-variable-card.ts +134 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-card.hbs → card.hbs} +3 -1
- package/addon/components/rdfa-date-plugin/card.ts +72 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.hbs → date-time-picker.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.js → date-time-picker.ts} +26 -12
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-insert.hbs → insert.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/insert.ts +44 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +58 -0
- package/addon/components/roadsign-regulation-plugin/measure-template.ts +35 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -2
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +60 -0
- package/addon/components/roadsign-regulation-plugin/{roadsigns-modal.js → roadsigns-modal.ts} +101 -64
- package/addon/components/roadsign-regulation-plugin/{roadsigns-pagination.js → roadsigns-pagination.ts} +7 -3
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +32 -0
- package/addon/components/standard-template-plugin/{template-card.hbs → card.hbs} +0 -0
- package/addon/components/standard-template-plugin/card.ts +11 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +3 -1
- package/addon/components/standard-template-plugin/template-provider.ts +75 -0
- package/addon/components/table-of-contents-plugin/card.hbs +12 -1
- package/addon/components/table-of-contents-plugin/card.ts +60 -0
- package/addon/components/table-of-contents-plugin/{inline-components → ember-nodes}/outline.hbs +2 -2
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +9 -0
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +95 -0
- package/addon/components/template-variable-plugin/template-variable-card.hbs +2 -1
- package/addon/components/template-variable-plugin/template-variable-card.ts +227 -0
- package/addon/{constants.js → constants.ts} +15 -3
- package/addon/ember-nodes/table-of-contents.ts +53 -0
- package/addon/helpers/{limit-text.js → limit-text.ts} +2 -2
- package/addon/initializers/plugin-initializer.js +0 -75
- package/addon/models/instruction.ts +18 -0
- package/addon/models/measure.ts +38 -0
- package/addon/models/sign.ts +36 -0
- package/addon/models/template.ts +14 -0
- package/addon/plugins/article-structure-plugin.ts +55 -0
- package/addon/plugins/besluit-plugin.ts +27 -0
- package/addon/plugins/besluit-type-plugin.ts +6 -0
- package/addon/plugins/citation-plugin/index.ts +216 -0
- package/addon/plugins/citation-plugin/marks/citation.ts +27 -0
- package/addon/plugins/citation-plugin/utils/cited-text.ts +17 -0
- package/addon/plugins/citation-plugin/utils/process-match.ts +135 -0
- package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +161 -42
- package/addon/plugins/import-snippet-plugin.ts +6 -0
- package/addon/plugins/insert-variable-plugin.ts +11 -0
- package/addon/plugins/rdfa-date-plugin.ts +11 -0
- package/addon/plugins/roadsign-regulation-plugin.ts +6 -0
- package/addon/plugins/standard-template-plugin.ts +6 -0
- package/addon/plugins/table-of-contents-plugin.ts +14 -0
- package/addon/plugins/template-variable-plugin.ts +6 -0
- package/addon/services/{import-rdfa-snippet.js → import-rdfa-snippet.ts} +48 -36
- package/addon/services/roadsign-registry.ts +288 -0
- package/addon/services/{standard-template-plugin.js → standard-template-plugin.ts} +17 -11
- package/addon/utils/article-structure-plugin/constants.ts +260 -0
- package/addon/utils/article-structure-plugin/defaults.ts +3 -0
- package/addon/utils/article-structure-plugin/options-with-defaults.ts +31 -0
- package/addon/utils/article-structure-plugin/validate-datastore.ts +23 -0
- package/addon/utils/besluit-plugin/get-title-for-decision.ts +35 -0
- package/addon/utils/{fetchBesluitTypes.js → fetchBesluitTypes.ts} +36 -16
- package/addon/utils/generate-template-plugin/{default-resources.js → default-resources.ts} +0 -0
- package/addon/utils/{instantiate-uuids.js → instantiate-uuids.ts} +9 -6
- package/addon/utils/{legislation-types.js → legislation-types.ts} +17 -3
- package/addon/utils/{memoize.js → memoize.ts} +4 -2
- package/addon/utils/option.ts +58 -0
- package/addon/utils/roadsign-regulation-plugin/{fetchData.js → fetchData.ts} +19 -2
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.ts +16 -0
- package/addon/utils/romanize.ts +47 -0
- package/addon/utils/variable-plugins/{default-variable-types.js → default-variable-types.ts} +18 -7
- package/addon/utils/variable-plugins/{fetch-data.js → fetch-data.ts} +43 -15
- package/app/components/article-structure-plugin/article-structure-card.js +1 -0
- package/app/components/article-structure-plugin/structure-card.js +1 -0
- package/app/components/{citaten-plugin/citaat-card.js → au-native-input.js} +1 -1
- package/app/components/{citaten-plugin/citations/article-list.js → besluit-plugin/besluit-context-card.js} +1 -1
- package/app/components/besluit-plugin/besluit-plugin-card.js +1 -0
- package/app/components/{citaten-plugin/citations/modal.js → citation-plugin/citation-card.js} +1 -1
- package/app/components/citation-plugin/citation-insert.js +1 -0
- package/app/components/{citaten-plugin/citations/decision-list.js → citation-plugin/citations/article-list.js} +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/article-preview.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-detail.js +1 -1
- package/app/components/citation-plugin/citations/decision-list.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-preview.js +1 -1
- package/app/components/citation-plugin/citations/modal.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/search-modal.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.js +1 -1
- package/app/components/{citaten-plugin/citaat-insert.js → rdfa-date-plugin/card.js} +1 -1
- package/app/components/rdfa-date-plugin/date-time-picker.js +1 -0
- package/app/components/rdfa-date-plugin/insert.js +1 -0
- package/app/components/standard-template-plugin/card.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/outline.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/table-of-contents.js +1 -0
- package/app/styles/citaten-plugin.scss +1 -1
- package/commands/article-structure-plugin/delete-structure.d.ts +4 -0
- package/commands/article-structure-plugin/index.d.ts +4 -0
- package/commands/article-structure-plugin/insert-article-structure.d.ts +6 -0
- package/commands/article-structure-plugin/move-structure.d.ts +5 -0
- package/commands/article-structure-plugin/recalculate-structure-numbers.d.ts +7 -0
- package/commands/besluit-plugin/get-article-nodes-for-besluit.d.ts +5 -0
- package/commands/besluit-plugin/index.d.ts +4 -0
- package/commands/besluit-plugin/insert-article.d.ts +3 -0
- package/commands/besluit-plugin/insert-title.d.ts +2 -0
- package/commands/besluit-plugin/move-article.d.ts +2 -0
- package/commands/besluit-plugin/recalculate-article-numbers.d.ts +2 -0
- package/commands/modify-date-command.d.ts +2 -0
- package/components/article-structure-plugin/article-structure-card.d.ts +36 -0
- package/components/article-structure-plugin/structure-card.d.ts +23 -0
- package/components/au-native-input.d.ts +20 -0
- package/components/besluit-plugin/besluit-context-card.d.ts +29 -0
- package/components/besluit-plugin/besluit-plugin-card.d.ts +14 -0
- package/components/besluit-type-plugin/besluit-type-select.d.ts +11 -0
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +46 -0
- package/components/citation-plugin/citation-card.d.ts +51 -0
- package/components/citation-plugin/citation-insert.d.ts +24 -0
- package/components/citation-plugin/citations/decision-detail.d.ts +26 -0
- package/components/citation-plugin/citations/search-modal.d.ts +67 -0
- package/components/import-snippet-plugin/card.d.ts +19 -0
- package/components/insert-variable-plugin/insert-variable-card.d.ts +31 -0
- package/components/rdfa-date-plugin/card.d.ts +20 -0
- package/components/rdfa-date-plugin/date-time-picker.d.ts +32 -0
- package/components/rdfa-date-plugin/insert.d.ts +12 -0
- package/components/roadsign-regulation-plugin/expanded-measure.d.ts +20 -0
- package/components/roadsign-regulation-plugin/measure-template.d.ts +14 -0
- package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +12 -0
- package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +57 -0
- package/components/roadsign-regulation-plugin/roadsigns-pagination.d.ts +19 -0
- package/components/roadsign-regulation-plugin/roadsigns-table.d.ts +9 -0
- package/components/standard-template-plugin/card.d.ts +9 -0
- package/components/standard-template-plugin/template-provider.d.ts +17 -0
- package/components/table-of-contents-plugin/card.d.ts +20 -0
- package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +22 -0
- package/components/template-variable-plugin/template-variable-card.d.ts +27 -0
- package/constants.d.ts +11 -0
- package/ember-nodes/table-of-contents.d.ts +4 -0
- package/helpers/limit-text.d.ts +8 -0
- package/index.js +5 -0
- package/models/instruction.d.ts +8 -0
- package/models/measure.d.ts +14 -0
- package/models/sign.d.ts +12 -0
- package/models/template.d.ts +13 -0
- package/package.json +27 -8
- package/plugins/article-structure-plugin.d.ts +29 -0
- package/plugins/besluit-plugin.d.ts +9 -0
- package/plugins/besluit-type-plugin.d.ts +2 -0
- package/plugins/citation-plugin/index.d.ts +31 -0
- package/plugins/citation-plugin/marks/citation.d.ts +2 -0
- package/plugins/citation-plugin/utils/cited-text.d.ts +3 -0
- package/plugins/citation-plugin/utils/process-match.d.ts +23 -0
- package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +56 -0
- package/plugins/import-snippet-plugin.d.ts +2 -0
- package/plugins/insert-variable-plugin.d.ts +2 -0
- package/plugins/rdfa-date-plugin.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin.d.ts +2 -0
- package/plugins/standard-template-plugin.d.ts +2 -0
- package/plugins/table-of-contents-plugin.d.ts +3 -0
- package/plugins/template-variable-plugin.d.ts +2 -0
- package/services/import-rdfa-snippet.d.ts +99 -0
- package/services/roadsign-registry.d.ts +42 -0
- package/services/standard-template-plugin.d.ts +21 -0
- package/translations/en-US.yaml +47 -1
- package/translations/nl-BE.yaml +49 -3
- package/tsconfig.json +34 -9
- package/types/config/environment.d.ts +22 -0
- package/types/ember-mu-transform-helpers/transforms/string-set.d.ts +14 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/account.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid-classificatie-code.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid.d.ts +12 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/gebruiker-model.d.ts +18 -0
- package/types/lblod/frontend-gelinkt-notuleren/services/current-session.d.ts +30 -0
- package/types/lblod/marawa/dom-helpers.d.ts +4 -0
- package/types/lblod/marawa/ember-object-mock.d.ts +3 -0
- package/types/lblod/marawa/node-walker.d.ts +18 -0
- package/types/lblod/marawa/range-helpers.d.ts +10 -0
- package/types/lblod/marawa/rdfa-attributes.d.ts +25 -0
- package/types/lblod/marawa/rdfa-block.d.ts +22 -0
- package/types/lblod/marawa/rdfa-context-scanner.d.ts +13 -0
- package/types/lblod/marawa/rdfa-helpers.d.ts +22 -0
- package/types/lblod/marawa/rich-node.d.ts +50 -0
- package/types/lblod/marawa/triple.d.ts +16 -0
- package/utils/article-structure-plugin/constants.d.ts +2 -0
- package/utils/article-structure-plugin/defaults.d.ts +4 -0
- package/utils/article-structure-plugin/options-with-defaults.d.ts +2 -0
- package/utils/article-structure-plugin/validate-datastore.d.ts +3 -0
- package/utils/besluit-plugin/get-title-for-decision.d.ts +10 -0
- package/utils/fetchBesluitTypes.d.ts +12 -0
- package/utils/generate-template-plugin/default-resources.d.ts +2 -0
- package/utils/instantiate-uuids.d.ts +1 -0
- package/utils/legislation-types.d.ts +24 -0
- package/utils/memoize.d.ts +1 -0
- package/utils/option.d.ts +14 -0
- package/utils/roadsign-regulation-plugin/fetchData.d.ts +8 -0
- package/utils/roadsign-regulation-plugin/includeInstructions.d.ts +2 -0
- package/utils/romanize.d.ts +2 -0
- package/utils/variable-plugins/default-variable-types.d.ts +7 -0
- package/utils/variable-plugins/fetch-data.d.ts +14 -0
- package/addon/commands/generate-template-command.js +0 -35
- package/addon/commands/insert-and-collapse.js +0 -32
- package/addon/commands/modify-date-command.js +0 -42
- package/addon/components/besluit-type-plugin/toolbar-dropdown.js +0 -188
- package/addon/components/citaten-plugin/citaat-card.hbs +0 -76
- package/addon/components/citaten-plugin/citaat-card.js +0 -286
- package/addon/components/citaten-plugin/citaat-insert.hbs +0 -20
- package/addon/components/citaten-plugin/citaat-insert.js +0 -68
- package/addon/components/citaten-plugin/citations/search-modal.hbs +0 -175
- package/addon/components/import-snippet-plugin/card.js +0 -95
- package/addon/components/insert-variable-plugin/insert-variable-card.js +0 -125
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -71
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -24
- package/addon/components/roadsign-regulation-plugin/expanded-measure.js +0 -38
- package/addon/components/roadsign-regulation-plugin/measure-template.js +0 -30
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -101
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +0 -24
- package/addon/components/standard-template-plugin/template-card.js +0 -7
- package/addon/components/standard-template-plugin/template-provider.js +0 -75
- package/addon/components/table-of-contents-plugin/card.js +0 -53
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +0 -9
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -100
- package/addon/components/template-variable-plugin/template-variable-card.js +0 -230
- package/addon/inline-components/table-of-contents.js +0 -43
- package/addon/models/instruction.js +0 -19
- package/addon/models/measure.js +0 -46
- package/addon/models/sign.js +0 -37
- package/addon/models/template.js +0 -9
- package/addon/plugins/besluit-type-plugin.js +0 -16
- package/addon/plugins/citaten-plugin.js +0 -22
- package/addon/plugins/import-snippet-plugin.js +0 -16
- package/addon/plugins/insert-variable-plugin.js +0 -19
- package/addon/plugins/rdfa-date-plugin.js +0 -26
- package/addon/plugins/roadsign-regulation-plugin.js +0 -24
- package/addon/plugins/standard-template-plugin.js +0 -33
- package/addon/plugins/table-of-contents-plugin.js +0 -27
- package/addon/plugins/template-variable-plugin.js +0 -21
- package/addon/services/roadsign-registry.js +0 -240
- package/addon/utils/processMatch.js +0 -80
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
- package/app/components/standard-template-plugin/template-card.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/outline.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
- package/app/initializers/plugin-initializer.js +0 -4
- package/types/dummy/index.d.ts +0 -1
- package/types/ember-data/types/registries/model.d.ts +0 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import StandardTemplatePluginService from '@lblod/ember-rdfa-editor-lblod-plugins/services/standard-template-plugin';
|
|
3
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
4
|
+
import TemplateModel from '@lblod/ember-rdfa-editor-lblod-plugins/models/template';
|
|
5
|
+
type Args = {
|
|
6
|
+
controller: ProseController;
|
|
7
|
+
};
|
|
8
|
+
export default class TemplateProviderComponent extends Component<Args> {
|
|
9
|
+
standardTemplatePlugin: StandardTemplatePluginService;
|
|
10
|
+
get busy(): boolean;
|
|
11
|
+
get controller(): ProseController;
|
|
12
|
+
get hasApplicableTemplates(): boolean;
|
|
13
|
+
get applicableTemplates(): TemplateModel[];
|
|
14
|
+
templateIsApplicable(template: TemplateModel): boolean;
|
|
15
|
+
insert(template: TemplateModel): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/constants';
|
|
3
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
4
|
+
type Args = {
|
|
5
|
+
controller: ProseController;
|
|
6
|
+
widgetArgs: {
|
|
7
|
+
config: TableOfContentsConfig;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default class TableOfContentsCardComponent extends Component<Args> {
|
|
11
|
+
get toggled(): boolean;
|
|
12
|
+
get controller(): ProseController;
|
|
13
|
+
get tableOfContentsRange(): {
|
|
14
|
+
from: number;
|
|
15
|
+
to: number;
|
|
16
|
+
} | undefined;
|
|
17
|
+
get config(): TableOfContentsConfig;
|
|
18
|
+
toggle(): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { TableOfContentsConfig } from '../../../constants';
|
|
3
|
+
import { PNode } from '@lblod/ember-rdfa-editor';
|
|
4
|
+
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
5
|
+
type OutlineEntry = {
|
|
6
|
+
content: string;
|
|
7
|
+
pos: number;
|
|
8
|
+
children?: OutlineEntry[];
|
|
9
|
+
};
|
|
10
|
+
export default class TableOfContentsComponent extends Component<EmberNodeArgs> {
|
|
11
|
+
get config(): TableOfContentsConfig;
|
|
12
|
+
get controller(): import("@lblod/ember-rdfa-editor").ProseController;
|
|
13
|
+
get outline(): {
|
|
14
|
+
entries: OutlineEntry[];
|
|
15
|
+
};
|
|
16
|
+
extractOutline({ node, pos }: {
|
|
17
|
+
node: PNode;
|
|
18
|
+
pos: number;
|
|
19
|
+
}): OutlineEntry[];
|
|
20
|
+
moveToPosition(pos: number): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { CodeListOption } from '../../utils/variable-plugins/fetch-data';
|
|
3
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
4
|
+
import { ProseStore } from '@lblod/ember-rdfa-editor/utils/datastore/prose-store';
|
|
5
|
+
type Args = {
|
|
6
|
+
controller: ProseController;
|
|
7
|
+
};
|
|
8
|
+
export default class EditorPluginsTemplateVariableCardComponent extends Component<Args> {
|
|
9
|
+
variableOptions: CodeListOption[];
|
|
10
|
+
selectedVariable?: CodeListOption | CodeListOption[];
|
|
11
|
+
showCard: boolean;
|
|
12
|
+
multiSelect: boolean;
|
|
13
|
+
mappingUri?: string;
|
|
14
|
+
zonalLocationCodelistUri: string;
|
|
15
|
+
endpoint: string;
|
|
16
|
+
nonZonalLocationCodelistUri: string;
|
|
17
|
+
constructor(parent: unknown, args: Args);
|
|
18
|
+
get controller(): ProseController;
|
|
19
|
+
insert(): void;
|
|
20
|
+
wrapVariableInHighlight(text: string): string;
|
|
21
|
+
selectionChanged(): void;
|
|
22
|
+
getCodelistSource(fullDatastore: ProseStore, mappingUri: string): string;
|
|
23
|
+
updateVariable(variable: CodeListOption | CodeListOption[]): void;
|
|
24
|
+
fetchCodeListOptions: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (endpoint: string, codelistUri: string, isLocation?: boolean) => Promise<void>>;
|
|
25
|
+
wrapInLocation(value: string): string;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
package/constants.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TableOfContentsConfig = {
|
|
2
|
+
sectionPredicate: string[];
|
|
3
|
+
value: string | {
|
|
4
|
+
predicate: string;
|
|
5
|
+
};
|
|
6
|
+
}[];
|
|
7
|
+
export declare const TABLE_OF_CONTENTS_DEFAULT_CONFIG: TableOfContentsConfig;
|
|
8
|
+
export declare const ZONAL_URI = "http://lblod.data.gift/concepts/c81c6b96-736a-48cf-b003-6f5cc3dbc55d";
|
|
9
|
+
export declare const POTENTIALLY_ZONAL_URI = "http://lblod.data.gift/concepts/8f9367b2-c717-4be7-8833-4c75bbb4ae1f";
|
|
10
|
+
export declare const NON_ZONAL_URI = "http://lblod.data.gift/concepts/b651931b-923c-477c-8da9-fc7dd841fdcc";
|
|
11
|
+
export declare const MULTI_SELECT_CODELIST_TYPE = "http://lblod.data.gift/concepts/57C93E12-A02C-4D4B-8B95-666B6701286C";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EmberNodeConfig } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
2
|
+
export declare const emberNodeConfig: EmberNodeConfig;
|
|
3
|
+
export declare const tableOfContents: import("prosemirror-model").NodeSpec;
|
|
4
|
+
export declare const tableOfContentsView: (controller: import("@lblod/ember-rdfa-editor/addon").ProseController) => import("prosemirror-view").NodeViewConstructor;
|
package/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
2
|
+
export default class Instruction {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly template: string;
|
|
5
|
+
readonly annotatedTemplate: string;
|
|
6
|
+
constructor(name: string, template: string, annotatedTemplate: string);
|
|
7
|
+
static fromBinding(binding: IBindings): Instruction;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
2
|
+
import Sign from './sign';
|
|
3
|
+
export default class Measure {
|
|
4
|
+
readonly uri: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly template: string;
|
|
7
|
+
readonly annotatedTemplate: string;
|
|
8
|
+
readonly zonality: string;
|
|
9
|
+
readonly temporal: string | false;
|
|
10
|
+
signs: Sign[];
|
|
11
|
+
classifications: Set<unknown>;
|
|
12
|
+
constructor(uri: string, label: string, template: string, annotatedTemplate: string, zonality: string, temporal: string | false, signs?: Sign[]);
|
|
13
|
+
static fromBinding(binding: IBindings): Measure;
|
|
14
|
+
}
|
package/models/sign.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
2
|
+
export default class Sign {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly image: string;
|
|
5
|
+
readonly classifications: string[];
|
|
6
|
+
readonly uri: string;
|
|
7
|
+
readonly order: string;
|
|
8
|
+
readonly zonality: string;
|
|
9
|
+
constructor(code: string, image: string, classifications: string[], uri: string, order: string, zonality: string);
|
|
10
|
+
static fromBinding(binding: IBindings): Sign;
|
|
11
|
+
static processImage(url: string, imageBaseUrl: string): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Model from '@ember-data/model';
|
|
2
|
+
declare module 'ember-data/types/registries/model' {
|
|
3
|
+
export default interface ModelRegistry {
|
|
4
|
+
template: TemplateModel;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export default class TemplateModel extends Model {
|
|
8
|
+
title: string;
|
|
9
|
+
matches: string[];
|
|
10
|
+
body: string;
|
|
11
|
+
contexts: string[];
|
|
12
|
+
disabledInContexts: string[];
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -30,17 +30,29 @@
|
|
|
30
30
|
"postpack": "ember ts:clean"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@lblod/marawa": "^0.8.0-beta.2",
|
|
34
|
+
"@rdfjs/data-model": "^2.0.1",
|
|
35
|
+
"@rdfjs/dataset": "^2.0.1",
|
|
36
|
+
"@rdfjs/parser-n3": "^2.0.1",
|
|
37
|
+
"@types/rdf-validate-shacl": "^0.4.0",
|
|
38
|
+
"@types/rdfjs__parser-n3": "^1.1.5",
|
|
33
39
|
"buffer": "^6.0.3",
|
|
34
40
|
"ember-auto-import": "^2.4.1",
|
|
35
41
|
"ember-cli-babel": "^7.26.11",
|
|
36
42
|
"ember-cli-htmlbars": "^6.0.1",
|
|
37
43
|
"ember-cli-typescript": "^5.2.1",
|
|
44
|
+
"ember-concurrency": "^2.3.7",
|
|
38
45
|
"ember-mu-transform-helpers": "^2.0.0",
|
|
39
46
|
"ember-power-select": "^5.0.4",
|
|
40
47
|
"ember-resources": "^5.6.0",
|
|
41
48
|
"fetch-sparql-endpoint": "^3.0.0",
|
|
42
49
|
"process": "0.11.10",
|
|
43
|
-
"
|
|
50
|
+
"prosemirror-state": "^1.4.2",
|
|
51
|
+
"rdf-ext": "^2.1.0",
|
|
52
|
+
"rdf-validate-shacl": "^0.4.5",
|
|
53
|
+
"stream-browserify": "^3.0.0",
|
|
54
|
+
"tracked-built-ins": "^3.1.0",
|
|
55
|
+
"uuid": "^9.0.0"
|
|
44
56
|
},
|
|
45
57
|
"devDependencies": {
|
|
46
58
|
"@appuniversum/ember-appuniversum": "^1.5.0",
|
|
@@ -49,8 +61,8 @@
|
|
|
49
61
|
"@embroider/test-setup": "^1.6.0",
|
|
50
62
|
"@glimmer/component": "^1.1.2",
|
|
51
63
|
"@glimmer/tracking": "^1.1.2",
|
|
52
|
-
"@lblod/ember-rdfa-editor": "^0.
|
|
53
|
-
"@
|
|
64
|
+
"@lblod/ember-rdfa-editor": "^1.0.0-alpha.12",
|
|
65
|
+
"@rdfjs/types": "^1.1.0",
|
|
54
66
|
"@release-it-plugins/lerna-changelog": "^5.0.0",
|
|
55
67
|
"@tsconfig/ember": "^1.0.1",
|
|
56
68
|
"@types/ember": "^4.0.2",
|
|
@@ -72,6 +84,7 @@
|
|
|
72
84
|
"@types/ember__test": "^4.0.1",
|
|
73
85
|
"@types/ember__test-helpers": "^2.8.2",
|
|
74
86
|
"@types/ember__utils": "^4.0.2",
|
|
87
|
+
"@types/prosemirror-dev-tools": "^3.0.3",
|
|
75
88
|
"@types/ember-data": "^4.4.6",
|
|
76
89
|
"@types/ember-data__adapter": "^4.0.1",
|
|
77
90
|
"@types/ember-data__model": "^4.0.0",
|
|
@@ -80,7 +93,13 @@
|
|
|
80
93
|
"@types/ember-qunit": "^5.0.2",
|
|
81
94
|
"@types/ember-resolver": "^5.0.13",
|
|
82
95
|
"@types/qunit": "^2.19.3",
|
|
96
|
+
"@types/rdf-ext": "^1.3.11",
|
|
97
|
+
"@types/rdfjs__data-model": "^2.0.1",
|
|
98
|
+
"@types/rdfjs__dataset": "^2.0.0",
|
|
83
99
|
"@types/rsvp": "^4.0.4",
|
|
100
|
+
"@types/uuid": "^9.0.0",
|
|
101
|
+
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
102
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
84
103
|
"babel-eslint": "^10.1.0",
|
|
85
104
|
"broccoli-asset-rev": "^3.0.0",
|
|
86
105
|
"ember-cli": "~4.4.1",
|
|
@@ -90,7 +109,6 @@
|
|
|
90
109
|
"ember-cli-sri": "^2.1.1",
|
|
91
110
|
"ember-cli-string-helpers": "^6.1.0",
|
|
92
111
|
"ember-cli-terser": "^4.0.2",
|
|
93
|
-
"ember-concurrency": "^2.2.1",
|
|
94
112
|
"ember-data": "^3.28.12",
|
|
95
113
|
"ember-disable-prototype-extensions": "^1.1.3",
|
|
96
114
|
"ember-export-application-global": "^2.0.1",
|
|
@@ -99,6 +117,7 @@
|
|
|
99
117
|
"ember-page-title": "^7.0.0",
|
|
100
118
|
"ember-qunit": "^5.1.5",
|
|
101
119
|
"ember-resolver": "^8.0.3",
|
|
120
|
+
"ember-simple-auth": "4.2.2",
|
|
102
121
|
"ember-source": "~4.4.0",
|
|
103
122
|
"ember-source-channel-url": "^3.0.0",
|
|
104
123
|
"ember-template-lint": "^4.8.0",
|
|
@@ -112,6 +131,7 @@
|
|
|
112
131
|
"loader.js": "^4.7.0",
|
|
113
132
|
"npm-run-all": "^4.1.5",
|
|
114
133
|
"prettier": "^2.6.2",
|
|
134
|
+
"prosemirror-dev-tools": "^3.1.0",
|
|
115
135
|
"qunit": "^2.19.1",
|
|
116
136
|
"qunit-dom": "^2.0.0",
|
|
117
137
|
"release-it": "^15.5.0",
|
|
@@ -122,9 +142,8 @@
|
|
|
122
142
|
},
|
|
123
143
|
"peerDependencies": {
|
|
124
144
|
"@appuniversum/ember-appuniversum": "^1.5.0",
|
|
125
|
-
"@lblod/ember-rdfa-editor": "
|
|
126
|
-
"
|
|
127
|
-
"ember-concurrency": "^2.0.0"
|
|
145
|
+
"@lblod/ember-rdfa-editor": "^1.0.0-alpha.12",
|
|
146
|
+
"ember-concurrency": "^2.3.7"
|
|
128
147
|
},
|
|
129
148
|
"engines": {
|
|
130
149
|
"node": "12.* || 14.* || >= 16"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import IntlService from 'ember-intl/services/intl';
|
|
3
|
+
export type StructureSpec = {
|
|
4
|
+
uriBase: string;
|
|
5
|
+
title: string;
|
|
6
|
+
type: string;
|
|
7
|
+
numberPredicate: string;
|
|
8
|
+
numbering?: string;
|
|
9
|
+
numberingFunction?: (num: number) => string;
|
|
10
|
+
heading?: string;
|
|
11
|
+
translation: string;
|
|
12
|
+
moveUp: string;
|
|
13
|
+
moveDown: string;
|
|
14
|
+
insertPredicate?: {
|
|
15
|
+
long: string;
|
|
16
|
+
short: string;
|
|
17
|
+
};
|
|
18
|
+
shaclConstraint: string;
|
|
19
|
+
template: (uri: string, intlService: IntlService) => string;
|
|
20
|
+
};
|
|
21
|
+
export type ArticleStructurePluginOptions = {
|
|
22
|
+
structures: StructureSpec[];
|
|
23
|
+
};
|
|
24
|
+
export type ResolvedArticleStructurePluginOptions = {
|
|
25
|
+
structures: StructureSpec[];
|
|
26
|
+
structureTypes: string[];
|
|
27
|
+
};
|
|
28
|
+
export declare const articleStructureInsertWidget: (options?: ArticleStructurePluginOptions) => WidgetSpec;
|
|
29
|
+
export declare const articleStructureContextWidget: (options?: ArticleStructurePluginOptions) => WidgetSpec;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { VariableType } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/variable-plugins/default-variable-types';
|
|
3
|
+
export interface DecisionOptions {
|
|
4
|
+
publisher?: string;
|
|
5
|
+
variableTypes?: (VariableType | string)[];
|
|
6
|
+
defaultEndpoint?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function besluitPluginCardWidget(): WidgetSpec;
|
|
9
|
+
export declare function besluitContextCardWidget(options?: DecisionOptions): WidgetSpec;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Decoration, DecorationSet, EditorState, InlineDecorationSpec, MarkSpec, ProsePlugin, Schema, WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { ProseStore } from '@lblod/ember-rdfa-editor/plugins/datastore';
|
|
3
|
+
export declare const CITATION_REGEX: RegExp;
|
|
4
|
+
export type CitationSchema = Schema<string, 'citation'>;
|
|
5
|
+
export interface CitationDecorationSpec extends InlineDecorationSpec {
|
|
6
|
+
legislationTypeUri: string;
|
|
7
|
+
searchText: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CitationDecoration extends Decoration {
|
|
10
|
+
spec: CitationDecorationSpec;
|
|
11
|
+
}
|
|
12
|
+
interface CitationPluginState {
|
|
13
|
+
highlights: DecorationSet;
|
|
14
|
+
activeRanges: [number, number][];
|
|
15
|
+
}
|
|
16
|
+
export type CitationPlugin = ProsePlugin<CitationPluginState>;
|
|
17
|
+
export interface CitationPluginBundle {
|
|
18
|
+
plugin: ProsePlugin<CitationPluginState>;
|
|
19
|
+
widgets: {
|
|
20
|
+
citationCard: WidgetSpec;
|
|
21
|
+
citationInsert: WidgetSpec;
|
|
22
|
+
};
|
|
23
|
+
marks: {
|
|
24
|
+
citation: MarkSpec;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface CitationPluginConfig {
|
|
28
|
+
activeIn?(state: EditorState, datastore: ProseStore): [number, number][];
|
|
29
|
+
}
|
|
30
|
+
export declare function setupCitationPlugin(config?: CitationPluginConfig): CitationPluginBundle;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type RegexpMatchArrayWithIndices = RegExpMatchArray & {
|
|
2
|
+
indices: Array<[number, number]> & {
|
|
3
|
+
groups: {
|
|
4
|
+
[key: string]: [number, number];
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
interface ProcessedMatch {
|
|
9
|
+
text: string;
|
|
10
|
+
legislationTypeUri: string;
|
|
11
|
+
typeMatch: {
|
|
12
|
+
text: string;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
} | null;
|
|
16
|
+
searchTextMatch: {
|
|
17
|
+
text: string;
|
|
18
|
+
start: number;
|
|
19
|
+
end: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export default function processMatch(match: RegexpMatchArrayWithIndices): ProcessedMatch | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
2
|
+
import Ember from 'ember';
|
|
3
|
+
import SafeString = Ember.Handlebars.SafeString;
|
|
4
|
+
interface DecisionArgs {
|
|
5
|
+
uri: string;
|
|
6
|
+
legislationTypeUri: Option<string>;
|
|
7
|
+
title: string | null;
|
|
8
|
+
publicationDate: string | null;
|
|
9
|
+
documentDate: string | null;
|
|
10
|
+
}
|
|
11
|
+
export declare class Decision {
|
|
12
|
+
uri: string;
|
|
13
|
+
legislationType: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
title: string | null;
|
|
18
|
+
publicationDate: string | null;
|
|
19
|
+
documentDate: string | null;
|
|
20
|
+
constructor({ uri, legislationTypeUri, title, publicationDate, documentDate, }: DecisionArgs);
|
|
21
|
+
get fullTitle(): string;
|
|
22
|
+
}
|
|
23
|
+
interface ArticleArgs {
|
|
24
|
+
uri: string;
|
|
25
|
+
number?: number;
|
|
26
|
+
content: string | null;
|
|
27
|
+
dateInForce: string | null;
|
|
28
|
+
dateNoLongerInForce: string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare class Article {
|
|
31
|
+
uri: string;
|
|
32
|
+
number?: number;
|
|
33
|
+
content: SafeString | null;
|
|
34
|
+
dateInForce: string | null;
|
|
35
|
+
dateNoLongerInForce: string | null;
|
|
36
|
+
constructor({ uri, number, content, dateInForce, dateNoLongerInForce, }: ArticleArgs);
|
|
37
|
+
}
|
|
38
|
+
export interface QueryFilter {
|
|
39
|
+
type: string;
|
|
40
|
+
documentDateFrom?: Option<string>;
|
|
41
|
+
documentDateTo?: Option<string>;
|
|
42
|
+
publicationDateFrom?: Option<string>;
|
|
43
|
+
publicationDateTo?: Option<string>;
|
|
44
|
+
}
|
|
45
|
+
declare function fetchDecisions(words: string[], filter: QueryFilter, pageNumber?: number, pageSize?: number): Promise<DecisionCollection>;
|
|
46
|
+
interface DecisionCollection {
|
|
47
|
+
totalCount: number;
|
|
48
|
+
decisions: Decision[];
|
|
49
|
+
}
|
|
50
|
+
declare function fetchArticles(legalExpression: string, pageNumber: number, pageSize: number, articleFilter: string): Promise<ArticleCollection>;
|
|
51
|
+
interface ArticleCollection {
|
|
52
|
+
totalCount: number;
|
|
53
|
+
articles: Article[];
|
|
54
|
+
}
|
|
55
|
+
declare function cleanCaches(): void;
|
|
56
|
+
export { fetchDecisions, fetchArticles, cleanCaches };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import Service from '@ember/service';
|
|
2
|
+
import ContextScanner from '@lblod/marawa/rdfa-context-scanner';
|
|
3
|
+
import RdfaBlock from '@lblod/marawa/rdfa-block';
|
|
4
|
+
type RequestParams = {
|
|
5
|
+
source: string;
|
|
6
|
+
uri?: string;
|
|
7
|
+
omitCredentials: boolean | string;
|
|
8
|
+
mock: boolean | string;
|
|
9
|
+
};
|
|
10
|
+
export declare class RdfaSnippet {
|
|
11
|
+
readonly source: string;
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly content: string;
|
|
14
|
+
readonly blocks: RdfaBlock[];
|
|
15
|
+
constructor(source: string, type: string, content: string, blocks: RdfaBlock[]);
|
|
16
|
+
}
|
|
17
|
+
type Error = {
|
|
18
|
+
source: string;
|
|
19
|
+
details: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Service responsible for fetching and storing a snippet
|
|
23
|
+
*
|
|
24
|
+
* Assumptions
|
|
25
|
+
* -----------
|
|
26
|
+
* - one toplevel rdfa block per snippet
|
|
27
|
+
*
|
|
28
|
+
* @module editor-import-snippet-plugin
|
|
29
|
+
* @class ImportRdfaSnippet
|
|
30
|
+
* @constructor
|
|
31
|
+
* @extends EmberService
|
|
32
|
+
*/
|
|
33
|
+
export default class ImportRdfaSnippet extends Service {
|
|
34
|
+
errors: Error[];
|
|
35
|
+
snippets: RdfaSnippet[];
|
|
36
|
+
contextScanner: ContextScanner;
|
|
37
|
+
constructor();
|
|
38
|
+
/**
|
|
39
|
+
* Download, processes and stores snippet
|
|
40
|
+
* @method downloadSnippet
|
|
41
|
+
* @param {Object}: {source}
|
|
42
|
+
* @return {String}
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
downloadSnippet(params: RequestParams): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Remove a snippet from the store, typically after using it
|
|
48
|
+
* @method removeSnippet
|
|
49
|
+
* @return void
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
removeSnippet(snippet: RdfaSnippet): void;
|
|
53
|
+
/**
|
|
54
|
+
* Return snippets for a given type, current supported types are 'roadsign' and 'generic'
|
|
55
|
+
* @method snippetsForType
|
|
56
|
+
* @params {String} type
|
|
57
|
+
* @return {Array} array of RdfaSnippets
|
|
58
|
+
*/
|
|
59
|
+
snippetsForType(type: string): RdfaSnippet[];
|
|
60
|
+
/**
|
|
61
|
+
* Fetches snippet from remote
|
|
62
|
+
* @method processSnippet
|
|
63
|
+
* @param params.omitCredentials {String} if truthy, the fetch call will omit credentials (this is important for endpoints that only provide simple CORS headers). When not set or falsy we fetch with "include" credentials. This means the endpoint needs to provide the Access-Control-Allow-Credentials and Access-Controlled-Allow-Origin needs to be set to the requesting domain ('*' is not allowed)
|
|
64
|
+
* @param params.source {String} the URL of the document to fetch
|
|
65
|
+
* @result {Response} result from ember fetch call
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
getSnippet(params: RequestParams): Promise<Response | null>;
|
|
69
|
+
/**
|
|
70
|
+
* heuristic to determine the type of snippet
|
|
71
|
+
* currently just a very basic check if a type exists in the snippet.
|
|
72
|
+
* @method determineType
|
|
73
|
+
*/
|
|
74
|
+
determineType(rdfaBlocks: RdfaBlock[]): string;
|
|
75
|
+
/**
|
|
76
|
+
* Processes and stores snippet
|
|
77
|
+
* @method processSnippet
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
processSnippet(params: RequestParams, data: Response): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Make HTML Content Template from string
|
|
83
|
+
* @method htmlToElement
|
|
84
|
+
* @param {String}
|
|
85
|
+
* @return {Object}
|
|
86
|
+
* @private
|
|
87
|
+
*/
|
|
88
|
+
htmlToElements(html: string): Element[];
|
|
89
|
+
/**
|
|
90
|
+
* Stores snippet
|
|
91
|
+
* @method storeSnippet
|
|
92
|
+
* @param {String} source the source url of the snippet
|
|
93
|
+
* @param {String} content the unparsed text content of the snippet
|
|
94
|
+
* @param {Array} block array of richnodes representing the content of the snippet
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
storeSnippet(source: string, type: string, content: string, blocks: RdfaBlock[]): void;
|
|
98
|
+
}
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Service from '@ember/service';
|
|
2
|
+
import Instruction from '../models/instruction';
|
|
3
|
+
import Measure from '../models/measure';
|
|
4
|
+
import Sign from '../models/sign';
|
|
5
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
6
|
+
export default class RoadsignRegistryService extends Service {
|
|
7
|
+
classifications: {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
instructions: Map<string, Instruction[]>;
|
|
12
|
+
endpoint: string;
|
|
13
|
+
imageBaseUrl: string;
|
|
14
|
+
constructor();
|
|
15
|
+
loadClassifications: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<void>>;
|
|
16
|
+
getInstructionsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string) => Promise<Instruction[]>>;
|
|
17
|
+
searchCode: import("ember-concurrency").TaskForAsyncTaskFunction<{
|
|
18
|
+
restartable: boolean;
|
|
19
|
+
}, (codeString?: string, category?: string, type?: string, combinedSigns?: string[]) => Promise<{
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[]>>;
|
|
23
|
+
executeQuery: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (query: string) => Promise<{
|
|
24
|
+
results: {
|
|
25
|
+
bindings: IBindings[];
|
|
26
|
+
};
|
|
27
|
+
}>>;
|
|
28
|
+
fetchInstructionsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string) => Promise<Instruction[]>>;
|
|
29
|
+
fetchMeasures: import("ember-concurrency").TaskForAsyncTaskFunction<{
|
|
30
|
+
restartable: boolean;
|
|
31
|
+
}, ({ zonality, type, codes, category, pageStart, }?: {
|
|
32
|
+
zonality?: string | undefined;
|
|
33
|
+
type?: string | undefined;
|
|
34
|
+
codes?: string[] | undefined;
|
|
35
|
+
category?: string | undefined;
|
|
36
|
+
pageStart?: number | undefined;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
measures: Measure[];
|
|
39
|
+
count: number;
|
|
40
|
+
}>>;
|
|
41
|
+
fetchSignsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string) => Promise<Sign[]>>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Store from '@ember-data/store';
|
|
2
|
+
import { DS } from 'ember-data';
|
|
3
|
+
import Service from '@ember/service';
|
|
4
|
+
import { Task } from 'ember-concurrency';
|
|
5
|
+
import TemplateModel from '../models/template';
|
|
6
|
+
export default class StandardTemplatePluginService extends Service {
|
|
7
|
+
store: Store;
|
|
8
|
+
templates: DS.RecordArray<TemplateModel>;
|
|
9
|
+
constructor();
|
|
10
|
+
fetchTemplates: Task<DS.RecordArray<TemplateModel>, []>;
|
|
11
|
+
loadTemplates(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
Filter the valid templates for a context.
|
|
14
|
+
@method templatesForContext
|
|
15
|
+
@param {Array} Array of templates
|
|
16
|
+
@param {Array} The path of rdfaContext objects from the root till the current context
|
|
17
|
+
@return {Array} Array of templates (filtered)
|
|
18
|
+
@private
|
|
19
|
+
*/
|
|
20
|
+
templatesForContext(templates: TemplateModel[], rdfaTypes: string[]): TemplateModel[];
|
|
21
|
+
}
|