@gravitee/ui-particles-angular 12.0.2 → 12.1.0-apim-3970-schematics-3dc6ff4
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/esm2022/lib/gio-monaco-editor/gio-monaco-editor.component.mjs +14 -7
- package/esm2022/lib/gio-monaco-editor/models/JSONSchemaAutoComplete.mjs +115 -0
- package/esm2022/lib/gio-monaco-editor/services/gio-language-el.service.mjs +226 -0
- package/fesm2022/gravitee-ui-particles-angular.mjs +344 -3
- package/fesm2022/gravitee-ui-particles-angular.mjs.map +1 -1
- package/lib/gio-monaco-editor/gio-monaco-editor.component.d.ts +8 -2
- package/lib/gio-monaco-editor/models/JSONSchemaAutoComplete.d.ts +39 -0
- package/lib/gio-monaco-editor/services/gio-language-el.service.d.ts +18 -0
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@ import { ReplaySubject } from 'rxjs';
|
|
|
5
5
|
import { GioMonacoEditorConfig } from './models/GioMonacoEditorConfig';
|
|
6
6
|
import { GioLanguageJsonService } from './services/gio-language-json.service';
|
|
7
7
|
import { GioMonacoEditorService } from './services/gio-monaco-editor.service';
|
|
8
|
+
import { GioLanguageElService } from './services/gio-language-el.service';
|
|
9
|
+
import { JSONSchema } from './models/JSONSchemaAutoComplete';
|
|
8
10
|
import * as i0 from "@angular/core";
|
|
9
11
|
export type MonacoEditorLanguageConfig = {
|
|
10
12
|
language: 'json';
|
|
@@ -16,12 +18,16 @@ export type MonacoEditorLanguageConfig = {
|
|
|
16
18
|
language: 'markdown';
|
|
17
19
|
} | {
|
|
18
20
|
language: 'html';
|
|
21
|
+
} | {
|
|
22
|
+
language: 'spel';
|
|
23
|
+
schema?: JSONSchema;
|
|
19
24
|
};
|
|
20
25
|
export declare class GioMonacoEditorComponent implements ControlValueAccessor, AfterViewInit, OnDestroy {
|
|
21
26
|
readonly hostElement: ElementRef;
|
|
22
27
|
private readonly config;
|
|
23
28
|
private readonly monacoEditorService;
|
|
24
29
|
private readonly languageJsonService;
|
|
30
|
+
private readonly languageSpelService;
|
|
25
31
|
private readonly changeDetectorRef;
|
|
26
32
|
private readonly ngZone;
|
|
27
33
|
readonly ngControl: NgControl;
|
|
@@ -38,7 +44,7 @@ export declare class GioMonacoEditorComponent implements ControlValueAccessor, A
|
|
|
38
44
|
protected _onChange: (_value: string | null) => void;
|
|
39
45
|
protected _onTouched: () => void;
|
|
40
46
|
private unsubscribe$;
|
|
41
|
-
constructor(hostElement: ElementRef, config: GioMonacoEditorConfig, monacoEditorService: GioMonacoEditorService, languageJsonService: GioLanguageJsonService, changeDetectorRef: ChangeDetectorRef, ngZone: NgZone, ngControl: NgControl);
|
|
47
|
+
constructor(hostElement: ElementRef, config: GioMonacoEditorConfig, monacoEditorService: GioMonacoEditorService, languageJsonService: GioLanguageJsonService, languageSpelService: GioLanguageElService, changeDetectorRef: ChangeDetectorRef, ngZone: NgZone, ngControl: NgControl);
|
|
42
48
|
ngAfterViewInit(): void;
|
|
43
49
|
ngOnDestroy(): void;
|
|
44
50
|
writeValue(_value: string): void;
|
|
@@ -47,6 +53,6 @@ export declare class GioMonacoEditorComponent implements ControlValueAccessor, A
|
|
|
47
53
|
setDisabledState(isDisabled: boolean): void;
|
|
48
54
|
private setupEditor;
|
|
49
55
|
private setupLanguage;
|
|
50
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<GioMonacoEditorComponent, [null, null, null, null, null, null, { optional: true; self: true; }]>;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GioMonacoEditorComponent, [null, null, null, null, null, null, null, { optional: true; self: true; }]>;
|
|
51
57
|
static ɵcmp: i0.ɵɵComponentDeclaration<GioMonacoEditorComponent, "gio-monaco-editor", never, { "languageConfig": { "alias": "languageConfig"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disableMiniMap": { "alias": "disableMiniMap"; "required": false; }; }, {}, never, never, false, never>;
|
|
52
58
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface PropertySuggestion {
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
enum?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface IndexableSuggestion {
|
|
7
|
+
type?: string;
|
|
8
|
+
enum?: string[];
|
|
9
|
+
additionalProperties?: IndexableSuggestion;
|
|
10
|
+
items?: IndexableSuggestion;
|
|
11
|
+
}
|
|
12
|
+
export interface Suggestions {
|
|
13
|
+
properties: PropertySuggestion[];
|
|
14
|
+
additionalProperties: IndexableSuggestion;
|
|
15
|
+
items: IndexableSuggestion;
|
|
16
|
+
}
|
|
17
|
+
export interface JSONSchema {
|
|
18
|
+
properties?: JSONSchemaProperties;
|
|
19
|
+
$defs?: JSONSchemaProperties;
|
|
20
|
+
}
|
|
21
|
+
export interface JSONSchemaProperty {
|
|
22
|
+
type?: string;
|
|
23
|
+
$ref?: string;
|
|
24
|
+
additionalProperties?: JSONSchemaProperty;
|
|
25
|
+
items?: JSONSchemaProperty;
|
|
26
|
+
properties?: JSONSchemaProperties;
|
|
27
|
+
}
|
|
28
|
+
export type JSONSchemaPropertyWithDefs = JSONSchema & JSONSchemaProperty;
|
|
29
|
+
export interface JSONSchemaProperties {
|
|
30
|
+
[key: string]: JSONSchemaProperty;
|
|
31
|
+
}
|
|
32
|
+
export declare function getKeywords(schema: JSONSchemaPropertyWithDefs, keywords?: Set<string>): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Build suggestions for autocompletion based on a JSON schema definition and a property path
|
|
35
|
+
*
|
|
36
|
+
* @param schema an object model defined as a JSON schema following the 2020-12 specification
|
|
37
|
+
* @param path the property path to inspect. If the property path contains '.', then root properties will be returned
|
|
38
|
+
*/
|
|
39
|
+
export declare function getSuggestions(schema: JSONSchema, path: string[]): Suggestions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import type Monaco from 'monaco-editor';
|
|
3
|
+
import { JSONSchema } from '../models/JSONSchemaAutoComplete';
|
|
4
|
+
import { GioMonacoEditorService } from './gio-monaco-editor.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare const SPEL_LANG_ID = "spel";
|
|
7
|
+
export declare class GioLanguageElService implements OnDestroy {
|
|
8
|
+
private unsubscribe$;
|
|
9
|
+
private context;
|
|
10
|
+
private schema;
|
|
11
|
+
private keywords;
|
|
12
|
+
ngOnDestroy(): void;
|
|
13
|
+
constructor(codeEditorService: GioMonacoEditorService);
|
|
14
|
+
setup(monaco: typeof Monaco): void;
|
|
15
|
+
setSchema(schema: JSONSchema): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GioLanguageElService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GioLanguageElService>;
|
|
18
|
+
}
|