@lblod/ember-rdfa-editor-lblod-plugins 21.0.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/Dockerfile +1 -1
- package/README.md +0 -5
- package/addon/components/confidentiality-plugin/redact.gts +12 -4
- package/addon/components/decision-plugin/insert-article.gts +2 -1
- package/addon/components/hover-tooltip.gts +13 -16
- package/addon/components/lmb-plugin/insert.ts +43 -79
- package/addon/components/lmb-plugin/search-modal.ts +10 -8
- package/addon/components/snippet-plugin/nodes/placeholder.gts +0 -3
- package/addon/components/snippet-plugin/nodes/snippet.gts +6 -6
- package/addon/components/standard-template-plugin/template-provider.ts +1 -0
- package/addon/components/variable-plugin/date/edit.ts +12 -3
- package/addon/components/variable-plugin/number/insert.ts +7 -13
- package/addon/components/variable-plugin/person/edit.hbs +31 -0
- package/addon/components/variable-plugin/person/edit.ts +74 -0
- package/addon/components/variable-plugin/person/insert.hbs +10 -0
- package/addon/components/variable-plugin/person/insert.ts +82 -0
- package/addon/components/variable-plugin/person/nodeview.hbs +20 -0
- package/addon/components/variable-plugin/person/nodeview.ts +50 -0
- package/addon/models/mandatee.ts +3 -3
- package/addon/plugins/lmb-plugin/index.ts +19 -0
- package/addon/plugins/location-plugin/node.ts +2 -2
- package/addon/plugins/variable-plugin/variables/address.ts +2 -2
- package/addon/plugins/variable-plugin/variables/index.ts +1 -0
- package/addon/plugins/variable-plugin/variables/number.ts +2 -2
- package/addon/plugins/variable-plugin/variables/person.ts +93 -0
- package/addon/utils/translation.ts +9 -5
- package/app/components/{validation-plugin/validation-card.js → variable-plugin/person/edit.js} +1 -1
- package/app/components/{validation-plugin/validation-item.js → variable-plugin/person/insert.js} +1 -1
- package/app/components/variable-plugin/person/nodeview.js +1 -0
- package/declarations/addon/components/common/search/alert-load-error.d.ts +1 -1
- package/declarations/addon/components/common/search/alert-no-items.d.ts +1 -1
- package/declarations/addon/components/confidentiality-plugin/redact.d.ts +10 -3
- package/declarations/addon/components/lmb-plugin/insert.d.ts +2 -0
- package/declarations/addon/components/pagination/pagination-view.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/address/edit.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/number/insert.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/person/edit.d.ts +23 -0
- package/declarations/addon/components/variable-plugin/person/insert.d.ts +16 -0
- package/declarations/addon/components/variable-plugin/person/nodeview.d.ts +22 -0
- package/declarations/addon/models/mandatee.d.ts +2 -2
- package/declarations/addon/plugins/lmb-plugin/index.d.ts +3 -0
- package/declarations/addon/plugins/variable-plugin/variables/index.d.ts +1 -0
- package/declarations/addon/plugins/variable-plugin/variables/person.d.ts +2 -0
- package/declarations/addon/utils/translation.d.ts +2 -2
- package/package.json +102 -93
- package/pnpm-lock.yaml +12635 -10132
- package/translations/en-US.yaml +6 -2
- package/translations/nl-BE.yaml +6 -4
- package/addon/components/validation-plugin/validation-card.hbs +0 -16
- package/addon/components/validation-plugin/validation-card.ts +0 -19
- package/addon/components/validation-plugin/validation-item.hbs +0 -8
- package/addon/components/validation-plugin/validation-item.ts +0 -58
- package/addon/plugins/decision-plugin/utils/validation-rules.ts +0 -11
- package/addon/plugins/validation/README.md +0 -84
- package/addon/plugins/validation/index.ts +0 -412
- package/addon/plugins/validation/utils/transaction-complies-with-shapes.ts +0 -28
- package/declarations/addon/components/validation-plugin/validation-card.d.ts +0 -13
- package/declarations/addon/components/validation-plugin/validation-item.d.ts +0 -18
- package/declarations/addon/plugins/decision-plugin/utils/validation-rules.d.ts +0 -10
- package/declarations/addon/plugins/validation/index.d.ts +0 -62
- package/declarations/addon/plugins/validation/utils/transaction-complies-with-shapes.d.ts +0 -10
- package/types/ember-intl.d.ts +0 -15
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { ValidationReport } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/validation';
|
|
4
|
-
interface Args {
|
|
5
|
-
report: ValidationReport;
|
|
6
|
-
controller?: SayController;
|
|
7
|
-
title: string;
|
|
8
|
-
}
|
|
9
|
-
export default class ValidationCardComponent extends Component<Args> {
|
|
10
|
-
get shouldShow(): boolean;
|
|
11
|
-
get results(): import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/validation").ValidationResult[];
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { ValidationResult } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/validation';
|
|
4
|
-
import IntlService from 'ember-intl/services/intl';
|
|
5
|
-
interface Args {
|
|
6
|
-
icon?: string;
|
|
7
|
-
result: ValidationResult;
|
|
8
|
-
controller?: SayController;
|
|
9
|
-
}
|
|
10
|
-
export default class ValidationItem extends Component<Args> {
|
|
11
|
-
intl: IntlService;
|
|
12
|
-
get result(): ValidationResult;
|
|
13
|
-
get message(): string;
|
|
14
|
-
get skin(): "error" | "warning" | "info";
|
|
15
|
-
get icon(): any;
|
|
16
|
-
get controller(): SayController | undefined;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
export declare const atLeastOneArticleContainer: (schema: Schema) => {
|
|
3
|
-
name: string;
|
|
4
|
-
focusNodeType: import("prosemirror-model").NodeType;
|
|
5
|
-
path: string[];
|
|
6
|
-
message: string;
|
|
7
|
-
constraints: {
|
|
8
|
-
minCount: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { EditorState, NodeType, PluginKey, PNode, ProsePlugin, Schema, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
3
|
-
export declare function validateTransaction(state: EditorState, tr: Transaction): ValidationReport;
|
|
4
|
-
export declare const VALIDATION_KEY: PluginKey<ValidationState>;
|
|
5
|
-
export interface ValidationSpec {
|
|
6
|
-
[key: string]: ValidationShape[];
|
|
7
|
-
}
|
|
8
|
-
export type ValidationState = {
|
|
9
|
-
report: ValidationReport;
|
|
10
|
-
spec: ValidationSpec;
|
|
11
|
-
};
|
|
12
|
-
export type PropertyPath = string[];
|
|
13
|
-
export type Severity = 'info' | 'warning' | 'violation';
|
|
14
|
-
export interface ValidationReport {
|
|
15
|
-
conforms: boolean;
|
|
16
|
-
results?: ValidationResult[];
|
|
17
|
-
}
|
|
18
|
-
export type ValidationPlugin = ProsePlugin<ValidationState>;
|
|
19
|
-
export interface MinCountConstraint {
|
|
20
|
-
kind: 'minCount';
|
|
21
|
-
value: number;
|
|
22
|
-
}
|
|
23
|
-
export interface MaxCountConstraint {
|
|
24
|
-
kind: 'maxCount';
|
|
25
|
-
value: number;
|
|
26
|
-
}
|
|
27
|
-
export type ValidationConstraint = MinCountConstraint | MaxCountConstraint;
|
|
28
|
-
export type ConstraintMap = {
|
|
29
|
-
[C in ValidationConstraint as C['kind']]?: C['value'];
|
|
30
|
-
};
|
|
31
|
-
export type ConstraintValidator = (constraint: ValidationConstraint, shapeContext: ShapeContext) => Option<ValidationResult>;
|
|
32
|
-
export type ConstraintValidatorMap = {
|
|
33
|
-
[C in ValidationConstraint as C['kind']]: ConstraintValidator;
|
|
34
|
-
};
|
|
35
|
-
export interface ValidationShape {
|
|
36
|
-
name: string;
|
|
37
|
-
focusNodeType: NodeType;
|
|
38
|
-
path: string[] | number[];
|
|
39
|
-
message?: string;
|
|
40
|
-
constraints?: ConstraintMap;
|
|
41
|
-
severity?: Severity;
|
|
42
|
-
}
|
|
43
|
-
export interface ValidationResult {
|
|
44
|
-
focusNode: PNode;
|
|
45
|
-
resultPath: PNode[];
|
|
46
|
-
value?: unknown;
|
|
47
|
-
sourceShape: ValidationShape;
|
|
48
|
-
sourceConstraint: ValidationConstraint;
|
|
49
|
-
message: string;
|
|
50
|
-
severity: Severity;
|
|
51
|
-
}
|
|
52
|
-
export interface ValidationPluginConfig {
|
|
53
|
-
shapes: ValidationShape[];
|
|
54
|
-
}
|
|
55
|
-
export declare function validation(configurator: (schema: Schema) => ValidationPluginConfig): ValidationPlugin;
|
|
56
|
-
interface ShapeContext {
|
|
57
|
-
shape: ValidationShape;
|
|
58
|
-
focusNode: PNode;
|
|
59
|
-
count: number;
|
|
60
|
-
path: PNode[];
|
|
61
|
-
}
|
|
62
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EditorState, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
/**
|
|
3
|
-
* Validate a given transaction against a given set of shapes. Returns true when the
|
|
4
|
-
* state after applying the transaction is valid according to all given shapes,
|
|
5
|
-
* false otherwise.
|
|
6
|
-
* @param state the state the transaction was created from
|
|
7
|
-
* @param tr
|
|
8
|
-
* @param validateShapes
|
|
9
|
-
*/
|
|
10
|
-
export declare function transactionCompliesWithShapes(state: EditorState, tr: Transaction, validateShapes?: Set<string>): boolean;
|
package/types/ember-intl.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// The types of the ember-intl `t` helper, at least in v5.7.2 seem to expect 0 arguments instead of
|
|
2
|
-
// requiring 1 string. These types are taken from the latest ember-intl.
|
|
3
|
-
declare module 'ember-intl/helpers/t' {
|
|
4
|
-
import Helper from '@ember/component/helper';
|
|
5
|
-
|
|
6
|
-
interface TSignature {
|
|
7
|
-
Args: {
|
|
8
|
-
Named?: Options & { allowEmpty?: boolean };
|
|
9
|
-
Positional: [Value] | [Value, Options];
|
|
10
|
-
};
|
|
11
|
-
Return: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default class THelper extends Helper<TSignature> {}
|
|
15
|
-
}
|