@lblod/ember-rdfa-editor-lblod-plugins 7.1.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +12 -11
  3. package/addon/components/generic-rdfa-variable/insert-menu.hbs +30 -0
  4. package/addon/components/generic-rdfa-variable/insert-menu.ts +97 -0
  5. package/addon/components/rdfa-date-plugin/date.hbs +9 -0
  6. package/addon/components/rdfa-date-plugin/date.ts +55 -0
  7. package/addon/components/variable-plugin/insert-variable-card.hbs +19 -0
  8. package/addon/components/variable-plugin/insert-variable-card.ts +26 -5
  9. package/addon/components/variable-plugin/number-settings.hbs +31 -0
  10. package/addon/components/variable-plugin/template-variable-card.hbs +3 -0
  11. package/addon/components/variable-plugin/template-variable-card.ts +3 -0
  12. package/addon/components/variable-plugin/variable.hbs +7 -1
  13. package/addon/components/variable-plugin/variable.ts +39 -0
  14. package/addon/plugins/rdfa-date-plugin/nodes/date.ts +150 -114
  15. package/addon/plugins/validation/README.md +1 -1
  16. package/addon/plugins/variable-plugin/nodes.ts +68 -3
  17. package/addon/plugins/variable-plugin/utils/constants.ts +29 -15
  18. package/addon/plugins/variable-plugin/utils/fetch-data.ts +9 -5
  19. package/app/components/generic-rdfa-variable/insert-menu.js +1 -0
  20. package/app/components/rdfa-date-plugin/date.js +1 -0
  21. package/app/components/variable-plugin/number-settings.js +1 -0
  22. package/app/styles/generic-rdfa-variable.scss +20 -0
  23. package/app/styles/variable-plugin.scss +31 -0
  24. package/components/generic-rdfa-variable/insert-menu.d.ts +17 -0
  25. package/components/rdfa-date-plugin/date.d.ts +16 -0
  26. package/components/variable-plugin/insert-variable-card.d.ts +4 -0
  27. package/components/variable-plugin/template-variable-card.d.ts +1 -0
  28. package/components/variable-plugin/variable.d.ts +11 -0
  29. package/package.json +8 -4
  30. package/plugins/rdfa-date-plugin/nodes/date.d.ts +2 -3
  31. package/plugins/variable-plugin/nodes.d.ts +22 -1
  32. package/plugins/variable-plugin/utils/constants.d.ts +11 -2
  33. package/translations/en-US.yaml +15 -0
  34. package/translations/nl-BE.yaml +15 -0
@@ -0,0 +1,16 @@
1
+ import Component from '@glimmer/component';
2
+ import { DecorationSource, PNode, SayController, SayView } from '@lblod/ember-rdfa-editor';
3
+ type Args = {
4
+ getPos: () => number | undefined;
5
+ node: PNode;
6
+ updateAttribute: (attr: string, value: unknown) => void;
7
+ controller: SayController;
8
+ view: SayView;
9
+ selected: boolean;
10
+ contentDecorations?: DecorationSource;
11
+ };
12
+ export default class VariableComponent extends Component<Args> {
13
+ onClick(): void;
14
+ get humanReadableDate(): string;
15
+ }
16
+ export {};
@@ -16,14 +16,18 @@ export default class EditorPluginsInsertCodelistCardComponent extends Component<
16
16
  hasSubtype: boolean;
17
17
  selectedSubtype?: CodeList;
18
18
  subtypes?: CodeList[];
19
+ variableLabel?: string;
20
+ extraAttributes: Record<string, unknown>;
19
21
  publisher: string;
20
22
  endpoint: string;
21
23
  constructor(parent: unknown, args: Args);
22
24
  get controller(): SayController;
25
+ updateVariableLabel(event: InputEvent): void;
23
26
  insert(): void;
24
27
  updateSelectedVariable(variable: VariableType): void;
25
28
  fetchSubtypes: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (fetchFunction: (endpoint: string, publisher: string) => Promise<CodeList[]>) => Promise<void>>;
26
29
  updateSubtype(subtype: CodeList): void;
30
+ get type(): string | undefined;
27
31
  get showCard(): boolean;
28
32
  }
29
33
  export {};
@@ -16,6 +16,7 @@ export default class EditorPluginsTemplateVariableCardComponent extends Componen
16
16
  } | undefined;
17
17
  showCard: boolean;
18
18
  multiSelect: boolean;
19
+ label?: string;
19
20
  mappingUri?: string;
20
21
  get controller(): SayController;
21
22
  insert(): void;
@@ -0,0 +1,11 @@
1
+ import Component from '@glimmer/component';
2
+ import { SayController, SayView } from '@lblod/ember-rdfa-editor';
3
+ type Args = {
4
+ controller: SayController;
5
+ };
6
+ export default class VariableComponent extends Component<Args> {
7
+ innerView?: SayView;
8
+ onClick(): void;
9
+ initEditor(view: SayView): void;
10
+ }
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "7.1.0",
3
+ "version": "8.0.0",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -30,6 +30,9 @@
30
30
  "postpack": "ember ts:clean"
31
31
  },
32
32
  "dependencies": {
33
+ "@codemirror/lang-html": "^6.4.3",
34
+ "@codemirror/state": "^6.2.1",
35
+ "@codemirror/view": "^6.12.0",
33
36
  "@curvenote/prosemirror-utils": "^1.0.5",
34
37
  "@lblod/marawa": "^0.8.0-beta.2",
35
38
  "@rdfjs/data-model": "^2.0.1",
@@ -38,6 +41,7 @@
38
41
  "@types/rdf-validate-shacl": "^0.4.0",
39
42
  "@types/rdfjs__parser-n3": "^1.1.5",
40
43
  "buffer": "^6.0.3",
44
+ "codemirror": "^6.0.1",
41
45
  "date-fns": "^2.29.3",
42
46
  "ember-auto-import": "^2.4.3",
43
47
  "ember-cli-babel": "^7.26.11",
@@ -54,6 +58,7 @@
54
58
  "rdf-validate-shacl": "^0.4.5",
55
59
  "stream-browserify": "^3.0.0",
56
60
  "tracked-built-ins": "^3.1.0",
61
+ "tracked-toolbox": "^1.2.3",
57
62
  "uuid": "^9.0.0"
58
63
  },
59
64
  "devDependencies": {
@@ -63,7 +68,7 @@
63
68
  "@embroider/test-setup": "^1.8.3",
64
69
  "@glimmer/component": "^1.1.2",
65
70
  "@glimmer/tracking": "^1.1.2",
66
- "@lblod/ember-rdfa-editor": "^3.7.0",
71
+ "@lblod/ember-rdfa-editor": "^3.8.0",
67
72
  "@rdfjs/types": "^1.1.0",
68
73
  "@release-it/keep-a-changelog": "^3.1.0",
69
74
  "@tsconfig/ember": "^1.0.1",
@@ -137,13 +142,12 @@
137
142
  "qunit-dom": "^2.0.0",
138
143
  "release-it": "^15.5.0",
139
144
  "sass": "^1.49.7",
140
- "tracked-toolbox": "^1.2.3",
141
145
  "typescript": "^4.9.3",
142
146
  "webpack": "^5.74.0"
143
147
  },
144
148
  "peerDependencies": {
145
149
  "@appuniversum/ember-appuniversum": "^2.4.2",
146
- "@lblod/ember-rdfa-editor": "^3.7.0",
150
+ "@lblod/ember-rdfa-editor": "^3.8.0",
147
151
  "ember-concurrency": "^2.3.7"
148
152
  },
149
153
  "engines": {
@@ -1,4 +1,3 @@
1
- import { NodeSpec } from '@lblod/ember-rdfa-editor';
2
1
  import { DateOptions } from '..';
3
- declare const date: (options: DateOptions) => NodeSpec;
4
- export default date;
2
+ export declare const date: (options: DateOptions) => import("prosemirror-model").NodeSpec;
3
+ export declare const dateView: (options: DateOptions) => (controller: import("@lblod/ember-rdfa-editor").SayController) => import("prosemirror-view").NodeViewConstructor;
@@ -1,2 +1,23 @@
1
+ import { PNode } from '@lblod/ember-rdfa-editor';
2
+ export declare const getHTMLNodeExtraAttributes: ({ node, type, }: {
3
+ node: HTMLElement;
4
+ type: string;
5
+ }) => {
6
+ minimumValue: string | null;
7
+ maximumValue: string | null;
8
+ } | {
9
+ minimumValue?: undefined;
10
+ maximumValue?: undefined;
11
+ };
12
+ export declare const getPNodeExtraAttributes: ({ node, type, }: {
13
+ node: PNode;
14
+ type: string;
15
+ }) => {
16
+ "data-minimum-value": string;
17
+ "data-maximum-value": string;
18
+ } | {
19
+ "data-minimum-value"?: undefined;
20
+ "data-maximum-value"?: undefined;
21
+ };
1
22
  export declare const variable: import("prosemirror-model").NodeSpec;
2
- export declare const variableView: (controller: import("@lblod/ember-rdfa-editor/addon").SayController) => import("prosemirror-view").NodeViewConstructor;
23
+ export declare const variableView: (controller: import("@lblod/ember-rdfa-editor").SayController) => import("prosemirror-view").NodeViewConstructor;
@@ -1,9 +1,18 @@
1
- import { PNode, Schema } from '@lblod/ember-rdfa-editor';
1
+ import { Attrs, PNode, Schema } from '@lblod/ember-rdfa-editor';
2
2
  import { CodeList } from './fetch-data';
3
3
  export declare const MULTI_SELECT_CODELIST_TYPE = "http://lblod.data.gift/concepts/57C93E12-A02C-4D4B-8B95-666B6701286C";
4
4
  export type VariableType = {
5
5
  label: string;
6
6
  fetchSubtypes?: (endpoint: string, publisher: string) => Promise<CodeList[]>;
7
- constructor: (schema: Schema, endpoint?: string, selectedCodelist?: CodeList) => PNode;
7
+ constructor: (props: {
8
+ schema: Schema;
9
+ label?: string;
10
+ attributes?: Attrs;
11
+ codelist?: CodeList;
12
+ }) => PNode;
8
13
  };
9
14
  export declare const DEFAULT_VARIABLE_TYPES: Record<string, VariableType>;
15
+ export declare const MINIMUM_VALUE_PNODE_KEY = "minimumValue";
16
+ export declare const MAXIMUM_VALUE_PNODE_KEY = "maximumValue";
17
+ export declare const MINIMUM_VALUE_HTML_ATTRIBUTE_KEY = "data-minimum-value";
18
+ export declare const MAXIMUM_VALUE_HTML_ATTRIBUTE_KEY = "data-maximum-value";
@@ -183,6 +183,14 @@ variable-plugin:
183
183
  insert-variable: Insert variable
184
184
  button: Insert
185
185
  enter-variable-value: Select value
186
+ label: Label
187
+ labelPlaceholder: Type something...
188
+ number:
189
+ minimum: Minimum
190
+ minimum-placeholder: minimum value
191
+ maximum: Maximum
192
+ maximum-placeholder: maximum value
193
+ to: to
186
194
  validation-plugin:
187
195
  default-fix-message: Resolve
188
196
 
@@ -203,3 +211,10 @@ address-plugin:
203
211
  dummy:
204
212
  validation-card:
205
213
  title: Document Validation
214
+
215
+ generic-rdfa-variable:
216
+ menu:
217
+ insert: Insert RDFA
218
+ modal:
219
+ insert: Insert
220
+ cancel: Cancel
@@ -196,6 +196,14 @@ variable-plugin:
196
196
  insert-variable: Voeg variabele in
197
197
  button: Voeg in
198
198
  enter-variable-value: Selecteer waarde
199
+ label: Label
200
+ labelPlaceholder: Type iets...
201
+ number:
202
+ minimum: Minimum
203
+ minimum-placeholder: minimumwaarde
204
+ maximum: Maximum
205
+ maximum-placeholder: maximumwaarde
206
+ to: tot
199
207
 
200
208
  address-plugin:
201
209
  insert:
@@ -209,3 +217,10 @@ address-plugin:
209
217
  dummy:
210
218
  validation-card:
211
219
  title: Documentvalidatie
220
+
221
+ generic-rdfa-variable:
222
+ menu:
223
+ insert: RDFA invoegen
224
+ modal:
225
+ insert: Invoegen
226
+ cancel: Terug