@lblod/ember-rdfa-editor-lblod-plugins 1.0.0-alpha.3 → 1.0.0-beta.2

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 (124) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/addon/components/article-structure-plugin/article-structure-card.hbs +3 -1
  3. package/addon/components/au-dropdown-pill.hbs +32 -0
  4. package/addon/components/au-dropdown-pill.ts +65 -0
  5. package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +19 -12
  6. package/addon/components/citation-plugin/citation-card.hbs +2 -2
  7. package/addon/components/citation-plugin/citation-card.ts +1 -1
  8. package/addon/components/citation-plugin/citation-insert.hbs +3 -1
  9. package/addon/components/citation-plugin/citation-insert.ts +28 -2
  10. package/addon/components/citation-plugin/citations/search-modal.hbs +1 -1
  11. package/addon/components/citation-plugin/citations/search-modal.ts +3 -18
  12. package/addon/components/import-snippet-plugin/card.ts +8 -12
  13. package/addon/components/rdfa-date-plugin/card.hbs +28 -0
  14. package/addon/components/rdfa-date-plugin/card.ts +72 -38
  15. package/addon/components/rdfa-date-plugin/date-time-picker.ts +1 -0
  16. package/addon/components/rdfa-date-plugin/insert.hbs +2 -2
  17. package/addon/components/rdfa-date-plugin/insert.ts +14 -23
  18. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +24 -25
  19. package/addon/components/roadsign-regulation-plugin/roadsigns-modal.ts +37 -18
  20. package/addon/components/standard-template-plugin/template-provider.ts +54 -11
  21. package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +27 -30
  22. package/addon/components/table-of-contents-plugin/toolbar-button.hbs +8 -0
  23. package/addon/components/table-of-contents-plugin/{card.ts → toolbar-button.ts} +1 -18
  24. package/addon/components/{insert-variable-plugin → variable-plugin}/insert-variable-card.hbs +4 -4
  25. package/addon/components/{insert-variable-plugin → variable-plugin}/insert-variable-card.ts +26 -35
  26. package/addon/components/{template-variable-plugin → variable-plugin}/template-variable-card.hbs +6 -6
  27. package/addon/components/variable-plugin/template-variable-card.ts +174 -0
  28. package/addon/components/variable-plugin/variable.hbs +4 -0
  29. package/addon/components/variable-plugin/variable.ts +250 -0
  30. package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +58 -31
  31. package/addon/plugins/article-structure-plugin/index.ts +1 -1
  32. package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +42 -6
  33. package/addon/plugins/article-structure-plugin/structures/article.ts +14 -4
  34. package/addon/plugins/article-structure-plugin/structures/chapter.ts +2 -3
  35. package/addon/plugins/article-structure-plugin/structures/section.ts +2 -2
  36. package/addon/plugins/article-structure-plugin/structures/structure-header.ts +11 -4
  37. package/addon/plugins/article-structure-plugin/structures/subsection.ts +2 -2
  38. package/addon/plugins/article-structure-plugin/structures/title.ts +2 -3
  39. package/addon/plugins/article-structure-plugin/utils/structure.ts +29 -9
  40. package/addon/plugins/citation-plugin/index.ts +184 -113
  41. package/addon/plugins/rdfa-date-plugin/index.ts +42 -3
  42. package/addon/plugins/rdfa-date-plugin/nodes/date.ts +127 -0
  43. package/addon/plugins/rdfa-date-plugin/nodes/index.ts +1 -0
  44. package/addon/plugins/rdfa-date-plugin/utils.ts +10 -0
  45. package/addon/plugins/roadsign-regulation-plugin/nodes.ts +107 -0
  46. package/addon/plugins/standard-template-plugin/index.ts +26 -0
  47. package/addon/plugins/standard-template-plugin/utils/nodes.ts +366 -0
  48. package/addon/plugins/table-of-contents-plugin/index.ts +8 -12
  49. package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +35 -42
  50. package/addon/plugins/{insert-variable-plugin → variable-plugin}/index.ts +6 -1
  51. package/addon/plugins/variable-plugin/nodes.ts +137 -0
  52. package/addon/plugins/variable-plugin/utils/constants.ts +107 -0
  53. package/addon/plugins/{template-variable-plugin → variable-plugin}/utils/fetch-data.ts +41 -0
  54. package/addon/services/standard-template-plugin.ts +16 -12
  55. package/addon/utils/changed-descendants.ts +29 -0
  56. package/addon/utils/constants.ts +22 -0
  57. package/addon/utils/namespace.ts +60 -0
  58. package/app/components/{table-of-contents-plugin/card.js → au-dropdown-pill.js} +1 -1
  59. package/app/components/table-of-contents-plugin/toolbar-button.js +1 -0
  60. package/app/components/{insert-variable-plugin → variable-plugin}/insert-variable-card.js +1 -1
  61. package/app/components/{template-variable-plugin → variable-plugin}/template-variable-card.js +1 -1
  62. package/app/components/variable-plugin/variable-edit-modal.js +1 -0
  63. package/app/components/variable-plugin/variable.js +1 -0
  64. package/app/styles/date-plugin.scss +17 -0
  65. package/app/styles/variable-plugin.scss +65 -0
  66. package/components/au-dropdown-pill.d.ts +19 -0
  67. package/components/au-native-input.d.ts +1 -1
  68. package/components/citation-plugin/citation-card.d.ts +1 -1
  69. package/components/citation-plugin/citation-insert.d.ts +7 -0
  70. package/components/citation-plugin/citations/search-modal.d.ts +1 -3
  71. package/components/rdfa-date-plugin/card.d.ts +14 -5
  72. package/components/rdfa-date-plugin/insert.d.ts +1 -2
  73. package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +1 -0
  74. package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +3 -0
  75. package/components/standard-template-plugin/template-provider.d.ts +6 -1
  76. package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +1 -1
  77. package/components/table-of-contents-plugin/{card.d.ts → toolbar-button.d.ts} +0 -5
  78. package/components/{insert-variable-plugin → variable-plugin}/insert-variable-card.d.ts +3 -4
  79. package/components/{template-variable-plugin → variable-plugin}/template-variable-card.d.ts +8 -5
  80. package/components/variable-plugin/variable.d.ts +42 -0
  81. package/package.json +6 -6
  82. package/plugins/article-structure-plugin/commands/insert-structure.d.ts +2 -2
  83. package/plugins/article-structure-plugin/index.d.ts +1 -1
  84. package/plugins/article-structure-plugin/utils/structure.d.ts +4 -3
  85. package/plugins/citation-plugin/index.d.ts +11 -4
  86. package/plugins/rdfa-date-plugin/index.d.ts +13 -1
  87. package/plugins/rdfa-date-plugin/nodes/date.d.ts +9 -0
  88. package/plugins/rdfa-date-plugin/nodes/index.d.ts +1 -0
  89. package/plugins/rdfa-date-plugin/utils.d.ts +1 -0
  90. package/plugins/roadsign-regulation-plugin/nodes.d.ts +2 -0
  91. package/plugins/standard-template-plugin/index.d.ts +12 -0
  92. package/plugins/standard-template-plugin/utils/nodes.d.ts +12 -0
  93. package/plugins/table-of-contents-plugin/index.d.ts +4 -2
  94. package/plugins/table-of-contents-plugin/nodes/table-of-contents.d.ts +4 -3
  95. package/plugins/{insert-variable-plugin → variable-plugin}/index.d.ts +1 -0
  96. package/plugins/variable-plugin/nodes.d.ts +2 -0
  97. package/plugins/variable-plugin/utils/constants.d.ts +9 -0
  98. package/plugins/{template-variable-plugin → variable-plugin}/utils/fetch-data.d.ts +5 -0
  99. package/services/standard-template-plugin.d.ts +9 -10
  100. package/translations/en-US.yaml +4 -3
  101. package/translations/nl-BE.yaml +8 -7
  102. package/utils/changed-descendants.d.ts +2 -0
  103. package/utils/constants.d.ts +10 -0
  104. package/utils/namespace.d.ts +11 -0
  105. package/addon/components/table-of-contents-plugin/card.hbs +0 -16
  106. package/addon/components/template-variable-plugin/template-variable-card.ts +0 -227
  107. package/addon/plugins/article-structure-plugin/constants.ts +0 -11
  108. package/addon/plugins/article-structure-plugin/utils/namespace.ts +0 -25
  109. package/addon/plugins/insert-variable-plugin/utils/constants.ts +0 -67
  110. package/addon/plugins/insert-variable-plugin/utils/fetch-data.ts +0 -41
  111. package/addon/plugins/rdfa-date-plugin/commands/index.ts +0 -1
  112. package/addon/plugins/rdfa-date-plugin/commands/modify-date.ts +0 -48
  113. package/addon/plugins/table-of-contents-plugin/utils/constants.ts +0 -17
  114. package/addon/plugins/template-variable-plugin/index.ts +0 -6
  115. package/addon/plugins/template-variable-plugin/utils/constants.ts +0 -2
  116. package/plugins/article-structure-plugin/constants.d.ts +0 -5
  117. package/plugins/article-structure-plugin/utils/namespace.d.ts +0 -6
  118. package/plugins/insert-variable-plugin/utils/constants.d.ts +0 -7
  119. package/plugins/insert-variable-plugin/utils/fetch-data.d.ts +0 -5
  120. package/plugins/rdfa-date-plugin/commands/index.d.ts +0 -1
  121. package/plugins/rdfa-date-plugin/commands/modify-date.d.ts +0 -2
  122. package/plugins/table-of-contents-plugin/utils/constants.d.ts +0 -7
  123. package/plugins/template-variable-plugin/index.d.ts +0 -2
  124. package/plugins/template-variable-plugin/utils/constants.d.ts +0 -1
@@ -1,20 +1,29 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
3
+ import { DateFormat } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/rdfa-date-plugin';
3
4
  type Args = {
4
5
  controller: ProseController;
6
+ widgetArgs: {
7
+ options: {
8
+ formats: [DateFormat];
9
+ allowCustomFormat: boolean;
10
+ };
11
+ };
5
12
  };
6
13
  export default class RdfaDatePluginCardComponent extends Component<Args> {
7
14
  dateValue?: Date;
8
- dateRange?: {
9
- from: number;
10
- to: number;
11
- };
15
+ datePos?: number;
12
16
  dateInDocument: boolean;
13
17
  onlyDate: boolean;
14
- showCard: boolean;
18
+ dateFormat: string;
19
+ customDateFormat: string;
20
+ constructor(owner: unknown, args: Args);
15
21
  get controller(): ProseController;
16
22
  modifyDate(): void;
17
23
  changeDate(date: Date): void;
24
+ setDateFormat(dateFormat: string): void;
25
+ setCustomDateFormat(event: InputEvent): void;
26
+ get showCard(): boolean;
18
27
  onSelectionChanged(): void;
19
28
  }
20
29
  export {};
@@ -6,7 +6,6 @@ type Args = {
6
6
  export default class RdfaDatePluginInsertComponent extends Component<Args> {
7
7
  get controller(): ProseController;
8
8
  get schema(): import("prosemirror-model").Schema<any, any>;
9
- insertDate(): void;
10
- insertDateTime(): void;
9
+ insertDate(onlyDate: boolean): void;
11
10
  }
12
11
  export {};
@@ -7,6 +7,7 @@ export default class RoadsignRegulationCard extends Component<Args> {
7
7
  modalOpen: boolean;
8
8
  toggleModal(): void;
9
9
  get controller(): ProseController;
10
+ get schema(): import("prosemirror-model").Schema<any, any>;
10
11
  get showCard(): boolean;
11
12
  }
12
13
  export {};
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
2
2
  import RoadsignRegistryService from '@lblod/ember-rdfa-editor-lblod-plugins/services/roadsign-registry';
3
3
  import Measure from '@lblod/ember-rdfa-editor-lblod-plugins/models/measure';
4
4
  import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
5
+ import IntlService from 'ember-intl/services/intl';
5
6
  type Option = {
6
7
  label: string;
7
8
  value: string;
@@ -18,6 +19,7 @@ export default class RoadsignRegulationCard extends Component<Args> {
18
19
  endpoint: string;
19
20
  pageSize: number;
20
21
  roadsignRegistry: RoadsignRegistryService;
22
+ intl: IntlService;
21
23
  typeSelected?: TypeOption;
22
24
  categorySelected?: Category;
23
25
  zonalityOptions: Zonality[];
@@ -31,6 +33,7 @@ export default class RoadsignRegulationCard extends Component<Args> {
31
33
  pageStart: number;
32
34
  get isNotTypeSign(): boolean;
33
35
  constructor(parent: unknown, args: Args);
36
+ get schema(): import("prosemirror-model").Schema<any, any>;
34
37
  selectTypeOrCategory(option: Option): void;
35
38
  changeCode(value: Code): void;
36
39
  changeCodeCombination(value: Code[]): void;
@@ -2,16 +2,21 @@ import Component from '@glimmer/component';
2
2
  import StandardTemplatePluginService from '@lblod/ember-rdfa-editor-lblod-plugins/services/standard-template-plugin';
3
3
  import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
4
4
  import TemplateModel from '@lblod/ember-rdfa-editor-lblod-plugins/models/template';
5
+ import { PNode, ResolvedPos } from '@lblod/ember-rdfa-editor';
5
6
  type Args = {
6
7
  controller: ProseController;
7
8
  };
9
+ export declare function findAncestors(pos: ResolvedPos, predicate?: (node: PNode) => boolean): {
10
+ node: PNode;
11
+ pos: number;
12
+ }[];
8
13
  export default class TemplateProviderComponent extends Component<Args> {
9
14
  standardTemplatePlugin: StandardTemplatePluginService;
10
15
  get busy(): boolean;
11
16
  get controller(): ProseController;
12
17
  get hasApplicableTemplates(): boolean;
13
18
  get applicableTemplates(): TemplateModel[];
14
- templateIsApplicable(template: TemplateModel): boolean;
19
+ templateIsApplicable(template: TemplateModel): boolean | 0;
15
20
  insert(template: TemplateModel): Promise<void>;
16
21
  }
17
22
  export {};
@@ -1,7 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { PNode } from '@lblod/ember-rdfa-editor';
3
3
  import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
4
- import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils/constants';
4
+ import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin';
5
5
  type OutlineEntry = {
6
6
  content: string;
7
7
  pos: number;
@@ -1,11 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
- import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils/constants';
3
2
  import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
4
3
  type Args = {
5
4
  controller: ProseController;
6
- widgetArgs: {
7
- config: TableOfContentsConfig;
8
- };
9
5
  };
10
6
  export default class TableOfContentsCardComponent extends Component<Args> {
11
7
  get toggled(): boolean;
@@ -14,7 +10,6 @@ export default class TableOfContentsCardComponent extends Component<Args> {
14
10
  from: number;
15
11
  to: number;
16
12
  } | undefined;
17
- get config(): TableOfContentsConfig;
18
13
  toggle(): void;
19
14
  }
20
15
  export {};
@@ -1,7 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
3
- import { VariableType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/insert-variable-plugin/utils/constants';
4
- import { CodeList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/insert-variable-plugin/utils/fetch-data';
3
+ import { VariableType } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/constants';
4
+ import { CodeList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/fetch-data';
5
5
  type Args = {
6
6
  controller: ProseController;
7
7
  widgetArgs: {
@@ -15,7 +15,6 @@ type Args = {
15
15
  export default class EditorPluginsInsertCodelistCardComponent extends Component<Args> {
16
16
  variablesArray: VariableType[];
17
17
  selectedVariable?: VariableType;
18
- showCard: boolean;
19
18
  hasSubtype: boolean;
20
19
  selectedSubtype?: CodeList;
21
20
  subtypes?: CodeList[];
@@ -26,6 +25,6 @@ export default class EditorPluginsInsertCodelistCardComponent extends Component<
26
25
  updateSelectedVariable(variable: VariableType): void;
27
26
  fetchSubtypes: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (fetchFunction: (endpoint: string, publisher: string) => Promise<CodeList[]>) => Promise<void>>;
28
27
  updateSubtype(subtype: CodeList): void;
29
- selectionChanged(): void;
28
+ get showCard(): boolean;
30
29
  }
31
30
  export {};
@@ -1,13 +1,17 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
3
- import { ProseStore } from '@lblod/ember-rdfa-editor/utils/datastore/prose-store';
4
- import { CodeListOption } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/template-variable-plugin/utils/fetch-data';
3
+ import { CodeListOption } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/fetch-data';
4
+ import { PNode } from '@lblod/ember-rdfa-editor';
5
5
  type Args = {
6
6
  controller: ProseController;
7
7
  };
8
8
  export default class EditorPluginsTemplateVariableCardComponent extends Component<Args> {
9
9
  variableOptions: CodeListOption[];
10
- selectedVariable?: CodeListOption | CodeListOption[];
10
+ selectedVariableOption?: CodeListOption | CodeListOption[];
11
+ selectedVariable: {
12
+ pos: number;
13
+ node: PNode;
14
+ } | undefined;
11
15
  showCard: boolean;
12
16
  multiSelect: boolean;
13
17
  mappingUri?: string;
@@ -19,8 +23,7 @@ export default class EditorPluginsTemplateVariableCardComponent extends Componen
19
23
  insert(): void;
20
24
  wrapVariableInHighlight(text: string): string;
21
25
  selectionChanged(): void;
22
- getCodelistSource(fullDatastore: ProseStore, mappingUri: string): string;
23
- updateVariable(variable: CodeListOption | CodeListOption[]): void;
26
+ updateVariableOption(variableOption: CodeListOption | CodeListOption[]): void;
24
27
  fetchCodeListOptions: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (endpoint: string, codelistUri: string, isLocation?: boolean) => Promise<void>>;
25
28
  wrapInLocation(value: string): string;
26
29
  }
@@ -0,0 +1,42 @@
1
+ /**
2
+ *
3
+ * Based on the footnotes example from https://github.com/ProseMirror/website
4
+ *
5
+ * Copyright (C) 2015-2017 by Marijn Haverbeke <marijnh@gmail.com> and others
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ */
24
+ import Component from '@glimmer/component';
25
+ import { RdfaEditorView, Schema, Transaction } from '@lblod/ember-rdfa-editor';
26
+ import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
27
+ import IntlService from 'ember-intl/services/intl';
28
+ export default class Variable extends Component<EmberNodeArgs> {
29
+ intl: IntlService;
30
+ innerView: RdfaEditorView | null;
31
+ contentWrapper: Element | null;
32
+ get outerView(): import("prosemirror-view").EditorView;
33
+ get node(): import("prosemirror-model").Node;
34
+ get pos(): number;
35
+ get htmlContent(): import("@ember/template/-private/handlebars").SafeString;
36
+ get schema(): Schema<"text" | "hard_break" | "date" | "invisible_rdfa" | "placeholder" | "paragraph" | "doc" | "block_rdfa" | "repaired_block", "em" | "link" | "strong" | "underline" | "inline_rdfa" | "strikethrough">;
37
+ onFocus(): void;
38
+ didInsertContentWrapper(target: Element): void;
39
+ onNodeUpdate(): void;
40
+ dispatchInner: (tr: Transaction) => void;
41
+ willDestroy(): void;
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -38,6 +38,7 @@
38
38
  "@types/rdf-validate-shacl": "^0.4.0",
39
39
  "@types/rdfjs__parser-n3": "^1.1.5",
40
40
  "buffer": "^6.0.3",
41
+ "date-fns": "^2.29.3",
41
42
  "ember-auto-import": "^2.4.1",
42
43
  "ember-cli-babel": "^7.26.11",
43
44
  "ember-cli-htmlbars": "^6.0.1",
@@ -48,7 +49,6 @@
48
49
  "ember-resources": "^5.6.0",
49
50
  "fetch-sparql-endpoint": "^3.0.0",
50
51
  "process": "0.11.10",
51
- "prosemirror-state": "^1.4.2",
52
52
  "rdf-ext": "^2.1.0",
53
53
  "rdf-validate-shacl": "^0.4.5",
54
54
  "stream-browserify": "^3.0.0",
@@ -56,13 +56,13 @@
56
56
  "uuid": "^9.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@appuniversum/ember-appuniversum": "^1.5.0",
59
+ "@appuniversum/ember-appuniversum": "^2.2.0",
60
60
  "@ember/optional-features": "^2.0.0",
61
61
  "@ember/test-helpers": "^2.7.0",
62
62
  "@embroider/test-setup": "^1.6.0",
63
63
  "@glimmer/component": "^1.1.2",
64
64
  "@glimmer/tracking": "^1.1.2",
65
- "@lblod/ember-rdfa-editor": "^1.0.0-alpha.13",
65
+ "@lblod/ember-rdfa-editor": "^1.0.0-beta.5",
66
66
  "@rdfjs/types": "^1.1.0",
67
67
  "@release-it-plugins/lerna-changelog": "^5.0.0",
68
68
  "@tsconfig/ember": "^1.0.1",
@@ -143,8 +143,8 @@
143
143
  "webpack": "^5.72.1"
144
144
  },
145
145
  "peerDependencies": {
146
- "@appuniversum/ember-appuniversum": "^1.5.0",
147
- "@lblod/ember-rdfa-editor": "^1.0.0-alpha.13",
146
+ "@appuniversum/ember-appuniversum": "^2.2.0",
147
+ "@lblod/ember-rdfa-editor": "^1.0.0-beta.5",
148
148
  "ember-concurrency": "^2.3.7"
149
149
  },
150
150
  "engines": {
@@ -1,5 +1,5 @@
1
- import { Command } from '@lblod/ember-rdfa-editor';
1
+ import { Command, Fragment } from '@lblod/ember-rdfa-editor';
2
2
  import { StructureSpec } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin';
3
3
  import IntlService from 'ember-intl/services/intl';
4
- declare const insertStructure: (structureSpec: StructureSpec, intl: IntlService) => Command;
4
+ declare const insertStructure: (structureSpec: StructureSpec, intl: IntlService, content?: Fragment) => Command;
5
5
  export default insertStructure;
@@ -1,6 +1,6 @@
1
1
  import { Fragment, PNode, Schema, WidgetSpec, EditorState } from '@lblod/ember-rdfa-editor';
2
2
  import IntlService from 'ember-intl/services/intl';
3
- import { Transaction } from 'prosemirror-state';
3
+ import { Transaction } from '@lblod/ember-rdfa-editor';
4
4
  export type SpecName = string;
5
5
  export type StructureSpec = {
6
6
  name: SpecName;
@@ -1,5 +1,5 @@
1
- import { NodeSpec, NodeType, Selection } from '@lblod/ember-rdfa-editor';
2
- import { Resource } from './namespace';
1
+ import { NodeSpec, NodeType, PNode, Schema, Selection } from '@lblod/ember-rdfa-editor';
2
+ import { Resource } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
3
3
  export declare function constructStructureNodeSpec(config: {
4
4
  type: Resource;
5
5
  content: string;
@@ -12,9 +12,10 @@ export declare function findAncestorOfType(selection: Selection, ...types: NodeT
12
12
  pos: number;
13
13
  start: number;
14
14
  depth: number;
15
- node: import("prosemirror-model").Node;
15
+ node: PNode;
16
16
  } | undefined;
17
17
  export declare function getStructureHeaderAttrs(element: HTMLElement): false | {
18
18
  number: string | null;
19
19
  };
20
20
  export declare function romanize(num: number): string;
21
+ export declare function containsOnlyPlaceholder(schema: Schema, node: PNode): boolean;
@@ -1,5 +1,4 @@
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';
1
+ import { Decoration, DecorationSet, EditorState, InlineDecorationSpec, MarkSpec, NodeType, ProsePlugin, Schema, WidgetSpec } from '@lblod/ember-rdfa-editor';
3
2
  export declare const CITATION_REGEX: RegExp;
4
3
  export type CitationSchema = Schema<string, 'citation'>;
5
4
  export interface CitationDecorationSpec extends InlineDecorationSpec {
@@ -24,8 +23,16 @@ export interface CitationPluginBundle {
24
23
  citation: MarkSpec;
25
24
  };
26
25
  }
27
- export interface CitationPluginConfig {
28
- activeIn?(state: EditorState, datastore: ProseStore): [number, number][];
26
+ export interface CitationPluginNodeConfig {
27
+ type: 'nodes';
28
+ regex?: RegExp;
29
+ activeInNodeTypes(schema: Schema, state: EditorState): Set<NodeType>;
29
30
  }
31
+ export interface CitationPluginRangeConfig {
32
+ type: 'ranges';
33
+ regex?: RegExp;
34
+ activeInRanges(state: EditorState): [number, number][];
35
+ }
36
+ export type CitationPluginConfig = CitationPluginNodeConfig | CitationPluginRangeConfig;
30
37
  export declare function setupCitationPlugin(config?: CitationPluginConfig): CitationPluginBundle;
31
38
  export {};
@@ -1,3 +1,15 @@
1
1
  import { WidgetSpec } from '@lblod/ember-rdfa-editor';
2
- export declare const rdfaDateCardWidget: WidgetSpec;
2
+ export declare const defaultDateFormats: DateFormat[];
3
+ export declare const rdfaDateCardWidget: (options?: DatePluginOptions) => WidgetSpec;
3
4
  export declare const rdfaDateInsertWidget: WidgetSpec;
5
+ export type DateFormat = {
6
+ label: string;
7
+ key: string;
8
+ dateFormat: string;
9
+ dateTimeFormat: string;
10
+ };
11
+ type DatePluginOptions = {
12
+ formats: DateFormat[];
13
+ allowCustomFormat: boolean;
14
+ };
15
+ export {};
@@ -0,0 +1,9 @@
1
+ import { NodeSpec } from '@lblod/ember-rdfa-editor';
2
+ export type DateOptions = {
3
+ placeholder: {
4
+ insertDate: string;
5
+ insertDateTime: string;
6
+ };
7
+ };
8
+ declare const date: (options: DateOptions) => NodeSpec;
9
+ export default date;
@@ -0,0 +1 @@
1
+ export { default as date, DateOptions } from './date';
@@ -0,0 +1 @@
1
+ export declare function formatDate(date: Date, format: string): string;
@@ -0,0 +1,2 @@
1
+ import { NodeSpec } from '@lblod/ember-rdfa-editor';
2
+ export declare const roadsign_regulation: NodeSpec;
@@ -1,2 +1,14 @@
1
1
  import { WidgetSpec } from '@lblod/ember-rdfa-editor';
2
2
  export declare const standardTemplateWidget: WidgetSpec;
3
+ export declare const besluitNodes: {
4
+ besluit: import("prosemirror-model").NodeSpec;
5
+ title: import("prosemirror-model").NodeSpec;
6
+ description: import("prosemirror-model").NodeSpec;
7
+ motivering: import("prosemirror-model").NodeSpec;
8
+ article_container: import("prosemirror-model").NodeSpec;
9
+ besluit_article: import("prosemirror-model").NodeSpec;
10
+ besluit_article_content: import("prosemirror-model").NodeSpec;
11
+ besluit_article_header: import("prosemirror-model").NodeSpec;
12
+ language_node: import("prosemirror-model").NodeSpec;
13
+ };
14
+ export declare const structureSpecs: import("../article-structure-plugin").StructureSpec[];
@@ -0,0 +1,12 @@
1
+ import { NodeSpec } from '@lblod/ember-rdfa-editor';
2
+ import { StructureSpec } from '../../article-structure-plugin';
3
+ export declare const title: NodeSpec;
4
+ export declare const description: NodeSpec;
5
+ export declare const motivering: NodeSpec;
6
+ export declare const article_container: NodeSpec;
7
+ export declare const besluit_article: NodeSpec;
8
+ export declare const besluitArticleStructure: StructureSpec;
9
+ export declare const besluit_article_header: NodeSpec;
10
+ export declare const besluit_article_content: NodeSpec;
11
+ export declare const besluit: NodeSpec;
12
+ export declare const language_node: NodeSpec;
@@ -1,3 +1,5 @@
1
1
  import { WidgetSpec } from '@lblod/ember-rdfa-editor';
2
- import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils/constants';
3
- export declare function tableOfContentsWidget(config?: TableOfContentsConfig): WidgetSpec;
2
+ export type TableOfContentsConfig = {
3
+ nodeHierarchy: string[];
4
+ }[];
5
+ export declare const tableOfContentsWidget: WidgetSpec;
@@ -1,4 +1,5 @@
1
1
  import { EmberNodeConfig } from '@lblod/ember-rdfa-editor/utils/ember-node';
2
- export declare const emberNodeConfig: EmberNodeConfig;
3
- export declare const table_of_contents: import("prosemirror-model").NodeSpec;
4
- export declare const tableOfContentsView: (controller: import("@lblod/ember-rdfa-editor/addon").ProseController) => import("prosemirror-view").NodeViewConstructor;
2
+ import { TableOfContentsConfig } from '..';
3
+ export declare const emberNodeConfig: (config: TableOfContentsConfig) => EmberNodeConfig;
4
+ export declare const table_of_contents: (config: TableOfContentsConfig) => import("prosemirror-model").NodeSpec;
5
+ export declare const tableOfContentsView: (config: TableOfContentsConfig) => (controller: import("@lblod/ember-rdfa-editor/addon").ProseController) => import("prosemirror-view").NodeViewConstructor;
@@ -1,2 +1,3 @@
1
1
  import { WidgetSpec } from '@lblod/ember-rdfa-editor';
2
2
  export declare function insertVariableWidget(options?: unknown): WidgetSpec;
3
+ export declare const templateVariableWidget: WidgetSpec;
@@ -0,0 +1,2 @@
1
+ export declare const variable: import("prosemirror-model").NodeSpec;
2
+ export declare const variableView: (controller: import("@lblod/ember-rdfa-editor/addon").ProseController) => import("prosemirror-view").NodeViewConstructor;
@@ -0,0 +1,9 @@
1
+ import { PNode, Schema } from '@lblod/ember-rdfa-editor';
2
+ import { CodeList } from './fetch-data';
3
+ export declare const MULTI_SELECT_CODELIST_TYPE = "http://lblod.data.gift/concepts/57C93E12-A02C-4D4B-8B95-666B6701286C";
4
+ export type VariableType = {
5
+ label: string;
6
+ fetchSubtypes?: (endpoint: string, publisher: string) => Promise<CodeList[]>;
7
+ constructor: (schema: Schema, endpoint?: string, selectedCodelist?: CodeList) => PNode;
8
+ };
9
+ export declare const DEFAULT_VARIABLE_TYPES: Record<string, VariableType>;
@@ -7,3 +7,8 @@ export type CodeListOption = {
7
7
  label?: string;
8
8
  };
9
9
  export declare function fetchCodeListOptions(endpoint: string, codelistUri: string): Promise<CodeListOptions>;
10
+ export type CodeList = {
11
+ uri?: string;
12
+ label?: string;
13
+ };
14
+ export declare function fetchCodeListsByPublisher(endpoint: string, publisher: string): Promise<CodeList[]>;
@@ -1,21 +1,20 @@
1
1
  import Store from '@ember-data/store';
2
- import { DS } from 'ember-data';
3
2
  import Service from '@ember/service';
4
3
  import { Task } from 'ember-concurrency';
5
4
  import TemplateModel from '../models/template';
6
5
  export default class StandardTemplatePluginService extends Service {
7
6
  store: Store;
8
- templates: DS.RecordArray<TemplateModel>;
7
+ templates: TemplateModel[];
9
8
  constructor();
10
- fetchTemplates: Task<DS.RecordArray<TemplateModel>, []>;
9
+ fetchTemplates: Task<TemplateModel[], []>;
11
10
  loadTemplates(): Promise<void>;
12
11
  /**
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
- */
12
+ Filter the valid templates for a context.
13
+ @method templatesForContext
14
+ @param {Array} Array of templates
15
+ @param {Array} The path of rdfaContext objects from the root till the current context
16
+ @return {Array} Array of templates (filtered)
17
+ @private
18
+ */
20
19
  templatesForContext(templates: TemplateModel[], rdfaTypes: string[]): TemplateModel[];
21
20
  }
@@ -78,9 +78,10 @@ date-plugin:
78
78
  hours: "Hours"
79
79
  minutes: "Minutes"
80
80
  now: "Now"
81
- insert-variable-plugin:
82
- variable: Insert variable
81
+ variable-plugin:
82
+ insertVariable: Insert variable
83
83
  button: Insert
84
+ enterVariableValue: Select value
84
85
  article-structure-plugin:
85
86
  insert:
86
87
  paragraph: Insert paragraph
@@ -126,7 +127,7 @@ article-structure-plugin:
126
127
  section:
127
128
  heading: Insert section heading
128
129
  body: Insert section content
129
- subsection:
130
+ subsection:
130
131
  heading: Insert subsection heading
131
132
  body: Insert subsection content
132
133
  article:
@@ -1,10 +1,10 @@
1
1
  citaten-plugin:
2
2
  card:
3
- title: Voeg verwijzing toe
3
+ title: Voeg citeeropschrift toe
4
4
  suggestions: Suggesties
5
5
 
6
6
  insert:
7
- title: Verwijzing invoegen
7
+ title: Citeeropschrift invoegen
8
8
 
9
9
  search:
10
10
  term: Zoekterm
@@ -30,7 +30,7 @@ citaten-plugin:
30
30
  of: van
31
31
 
32
32
  references:
33
- insert: Verwijzing invoegen
33
+ insert: Citeeropschrift invoegen
34
34
  details: Details
35
35
  refer-whole: Verwijs naar volledig document
36
36
  refer-article: Verwijs naar artikel
@@ -79,9 +79,10 @@ date-plugin:
79
79
  hours: "Uur"
80
80
  minutes: "Minuten"
81
81
  now: "Nu"
82
- insert-variable-plugin:
83
- variable: Voeg variabele in
82
+ variable-plugin:
83
+ insertVariable: Voeg variabele in
84
84
  button: Voeg in
85
+ enterVariableValue: Selecteer waarde
85
86
  article-structure-plugin:
86
87
  insert:
87
88
  paragraph: Paragraaf invoegen
@@ -127,11 +128,11 @@ article-structure-plugin:
127
128
  section:
128
129
  heading: Voeg afdeling in
129
130
  body: Voeg inhoud afdeling in
130
- subsection:
131
+ subsection:
131
132
  heading: Voeg onderafdeling in
132
133
  body: Voeg inhoud onderafdeling in
133
134
  article:
134
135
  heading: Voeg artikel in
135
136
  body: Voeg inhoud artikel in
136
137
  paragraph:
137
- body: Voeg inhoud paragraaf in
138
+ body: Voeg inhoud paragraaf in
@@ -0,0 +1,2 @@
1
+ import { PNode } from '@lblod/ember-rdfa-editor';
2
+ export declare function changedDescendants(old: PNode, cur: PNode, offset: number, f: (node: PNode, pos: number) => void): void;
@@ -0,0 +1,10 @@
1
+ export declare const SAY: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
2
+ export declare const RDF: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
3
+ export declare const ELI: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
4
+ export declare const XSD: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
5
+ export declare const EXT: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
6
+ export declare const BESLUIT: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
7
+ export declare const PROV: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
8
+ export declare const SKOS: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
9
+ export declare const DCT: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
10
+ export declare const MOBILITEIT: (s: string) => import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
@@ -0,0 +1,11 @@
1
+ import { PNode } from '@lblod/ember-rdfa-editor';
2
+ export declare class Resource {
3
+ full: string;
4
+ prefixed: string;
5
+ constructor(full: string, prefixed: string);
6
+ toString(): string;
7
+ }
8
+ export declare function namespace(uri: string, prefix: string): (s: string) => Resource;
9
+ export declare function hasRDFaAttribute(element: Element, attr: string, value: Resource): boolean;
10
+ export declare function pnodeHasRdfaAttribute(node: PNode, attr: string, value: Resource): boolean;
11
+ export declare function expandPrefixedString(base: string, prefix: string, stringToExpand: string): string;
@@ -1,16 +0,0 @@
1
- <AuCard @flex={{true}} @divided={{true}} @expandable={{false}} @shadow={{true}} @size="flush" as |c|>
2
- <c.content class="au-c-content--small">
3
- <label
4
- class="au-c-toggle-switch"
5
- >
6
- <input
7
- type="checkbox"
8
- checked={{this.toggled}}
9
- class="au-c-toggle-switch__input au-u-hidden-visually"
10
- {{on "input" this.toggle}}
11
- />
12
- <span class="au-c-toggle-switch__toggle"></span>
13
- <span class="au-c-toggle-switch__label">{{t "table-of-contents-plugin.toggle" }}</span>
14
- </label>
15
- </c.content>
16
- </AuCard>