@arcgis/coding-components 4.31.0-next.77 → 4.31.0-next.78
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/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +76 -76
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-9877b739.js → p-39f82bdf.js} +10 -10
- package/dist/arcgis-coding-components/{p-5692bbc7.js → p-3e9138d1.js} +2 -2
- package/dist/arcgis-coding-components/{p-8d832502.js → p-56b9a46b.js} +2 -2
- package/dist/arcgis-coding-components/{p-5cd53181.js → p-65fac2a2.js} +1 -1
- package/dist/arcgis-coding-components/p-6c02d087.js +6 -0
- package/dist/arcgis-coding-components/p-75194595.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-a8b3c7ff.js → p-768bbd21.js} +1 -1
- package/dist/arcgis-coding-components/{p-597365db.js → p-783b5f57.js} +1 -1
- package/dist/arcgis-coding-components/p-7a683b74.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-1ce37139.js → p-856489e5.js} +2 -2
- package/dist/arcgis-coding-components/{p-df6a6e92.js → p-8afa5752.js} +2 -2
- package/dist/arcgis-coding-components/{p-05cd1527.js → p-8d86a470.js} +2 -2
- package/dist/arcgis-coding-components/{p-f304a898.js → p-a0d7e57e.js} +2 -2
- package/dist/arcgis-coding-components/{p-f8f31aee.entry.js → p-c2881d0b.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-3e8e339e.js → p-cae88f7a.js} +2 -2
- package/dist/arcgis-coding-components/{p-6c970ef9.js → p-d4a2c779.js} +2 -2
- package/dist/arcgis-coding-components/{p-6447807e.js → p-df53ceb3.js} +3 -3
- package/dist/arcgis-coding-components/{p-2759ba9d.js → p-f191d5c4.js} +2 -2
- package/dist/cjs/{app-globals-e36ff7b6.js → app-globals-36508d17.js} +1 -1
- package/dist/cjs/{arcade-defaults-7eb50451.js → arcade-defaults-3ba38e64.js} +3 -3
- package/dist/cjs/{arcade-mode-ca4a9411.js → arcade-mode-153379ec.js} +3 -3
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +207 -157
- package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +26 -7
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
- package/dist/cjs/{css-bf7efcc6.js → css-6e35ab05.js} +1 -1
- package/dist/cjs/{cssMode-3e6f7824.js → cssMode-3dc2bccb.js} +3 -3
- package/dist/cjs/{html-d74edc5e.js → html-20965b18.js} +3 -3
- package/dist/cjs/{htmlMode-55fb85d1.js → htmlMode-9324d914.js} +3 -3
- package/dist/cjs/{index-16caf224.js → index-b6860332.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-0e468a0c.js → javascript-c62e64af.js} +4 -4
- package/dist/cjs/{jsonMode-b61f2f13.js → jsonMode-5d208206.js} +3 -3
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{sql-expr-defaults-abca6c0e.js → sql-expr-defaults-e8d6f68b.js} +13 -12
- package/dist/cjs/{sql-expr-mode-fd4c0094.js → sql-expr-mode-08b2ba7b.js} +7 -5
- package/dist/cjs/{tsMode-f517e713.js → tsMode-4edda21c.js} +3 -3
- package/dist/cjs/{typescript-7a310fd3.js → typescript-fef47aa2.js} +3 -3
- package/dist/cjs/{useT9n-4e9beec5.js → useT9n-5e3f59e6.js} +3 -3
- package/dist/components/arcade-defaults.js +2 -2
- package/dist/components/arcade-mode.js +1 -1
- package/dist/components/arcade-results.js +1 -1
- package/dist/components/arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +8 -8
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-assets.d.ts +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/{arcgis-arcade-variables.d.ts → arcgis-editor-variables.d.ts} +4 -4
- package/dist/components/arcgis-editor-variables.js +11 -0
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.js +29 -10
- package/dist/components/arcgis-sql-expression-fields.js +103 -2
- package/dist/components/chunk-A4MUWALE.js +1 -1
- package/dist/components/code-editor.js +2 -2
- package/dist/components/{arcade-variables.js → editor-variables.js} +65 -16
- package/dist/components/fields.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/language-api-panel.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +1347 -5
- package/dist/components/sql-expr-mode.js +6 -4
- package/dist/components/useT9n.js +1 -1
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-3fe7cb9f.js → app-globals-114942c8.js} +1 -1
- package/dist/esm/{arcade-defaults-dc90a65f.js → arcade-defaults-72d79638.js} +3 -3
- package/dist/esm/{arcade-mode-5580d9f3.js → arcade-mode-33501bbf.js} +3 -3
- package/dist/esm/arcgis-arcade-editor_6.entry.js +207 -157
- package/dist/esm/arcgis-coding-components.js +5 -5
- package/dist/esm/arcgis-sql-expression-editor.entry.js +26 -7
- package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
- package/dist/esm/{css-69a1774f.js → css-e669c8cc.js} +1 -1
- package/dist/esm/{cssMode-4fa18850.js → cssMode-a8b477e3.js} +3 -3
- package/dist/esm/{html-b7892d66.js → html-fa654ea8.js} +3 -3
- package/dist/esm/{htmlMode-ab689485.js → htmlMode-252b58ec.js} +3 -3
- package/dist/esm/{index-5df9a0d7.js → index-515ec576.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-a9a5f5d5.js → javascript-e43d9aad.js} +4 -4
- package/dist/esm/{jsonMode-d2251707.js → jsonMode-788ef636.js} +3 -3
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{sql-expr-defaults-3a01e6ef.js → sql-expr-defaults-eff5fcd0.js} +14 -13
- package/dist/esm/{sql-expr-mode-6964367f.js → sql-expr-mode-f4116ccc.js} +7 -5
- package/dist/esm/{tsMode-21f06c86.js → tsMode-b6afbaf3.js} +3 -3
- package/dist/esm/{typescript-4ce4badc.js → typescript-e6399cf1.js} +3 -3
- package/dist/esm/{useT9n-c7e8c91e.js → useT9n-1988d923.js} +3 -3
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/{arcade-variables/arcade-variables.d.ts → editor-variables/editor-variables.d.ts} +25 -2
- package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +6 -0
- package/dist/types/components.d.ts +63 -53
- package/dist/types/utils/profile/editor-profile.d.ts +2 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +1 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +1 -1
- package/package.json +11 -11
- package/dist/arcgis-coding-components/p-6b6106c2.entry.js +0 -6
- package/dist/arcgis-coding-components/p-ac0c2b9a.js +0 -6
- package/dist/arcgis-coding-components/p-f18177dd.entry.js +0 -6
- package/dist/components/arcgis-arcade-variables.js +0 -11
- package/dist/components/language-defaults-base.js +0 -1352
- package/dist/components/sql-expression-fields.js +0 -109
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.ar.json → editor-variables/t9n/editor-variables.t9n.ar.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.bg.json → editor-variables/t9n/editor-variables.t9n.bg.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.bs.json → editor-variables/t9n/editor-variables.t9n.bs.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.ca.json → editor-variables/t9n/editor-variables.t9n.ca.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.cs.json → editor-variables/t9n/editor-variables.t9n.cs.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.da.json → editor-variables/t9n/editor-variables.t9n.da.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.de.json → editor-variables/t9n/editor-variables.t9n.de.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.el.json → editor-variables/t9n/editor-variables.t9n.el.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.en.json → editor-variables/t9n/editor-variables.t9n.en.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.es.json → editor-variables/t9n/editor-variables.t9n.es.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.et.json → editor-variables/t9n/editor-variables.t9n.et.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.fi.json → editor-variables/t9n/editor-variables.t9n.fi.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.fr.json → editor-variables/t9n/editor-variables.t9n.fr.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.he.json → editor-variables/t9n/editor-variables.t9n.he.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.hr.json → editor-variables/t9n/editor-variables.t9n.hr.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.hu.json → editor-variables/t9n/editor-variables.t9n.hu.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.id.json → editor-variables/t9n/editor-variables.t9n.id.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.it.json → editor-variables/t9n/editor-variables.t9n.it.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.ja.json → editor-variables/t9n/editor-variables.t9n.ja.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.ko.json → editor-variables/t9n/editor-variables.t9n.ko.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.lt.json → editor-variables/t9n/editor-variables.t9n.lt.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.lv.json → editor-variables/t9n/editor-variables.t9n.lv.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.nb.json → editor-variables/t9n/editor-variables.t9n.nb.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.nl.json → editor-variables/t9n/editor-variables.t9n.nl.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.pl.json → editor-variables/t9n/editor-variables.t9n.pl.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.pt-BR.json → editor-variables/t9n/editor-variables.t9n.pt-BR.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.pt-PT.json → editor-variables/t9n/editor-variables.t9n.pt-PT.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.ro.json → editor-variables/t9n/editor-variables.t9n.ro.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.ru.json → editor-variables/t9n/editor-variables.t9n.ru.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.sk.json → editor-variables/t9n/editor-variables.t9n.sk.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.sl.json → editor-variables/t9n/editor-variables.t9n.sl.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.sr.json → editor-variables/t9n/editor-variables.t9n.sr.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.sv.json → editor-variables/t9n/editor-variables.t9n.sv.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.th.json → editor-variables/t9n/editor-variables.t9n.th.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.tr.json → editor-variables/t9n/editor-variables.t9n.tr.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.uk.json → editor-variables/t9n/editor-variables.t9n.uk.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.vi.json → editor-variables/t9n/editor-variables.t9n.vi.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.zh-CN.json → editor-variables/t9n/editor-variables.t9n.zh-CN.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.zh-HK.json → editor-variables/t9n/editor-variables.t9n.zh-HK.json} +0 -0
- /package/dist/arcgis-coding-components/assets/{arcade-variables/t9n/arcade-variables.t9n.zh-TW.json → editor-variables/t9n/editor-variables.t9n.zh-TW.json} +0 -0
|
@@ -13,6 +13,7 @@ import { SidePanelName } from "./components/arcade-editor/arcade-editor";
|
|
|
13
13
|
import { editor, Selection } from "monaco-editor";
|
|
14
14
|
import { IColorRules } from "./utils/arcade-monaco/arcade-theme";
|
|
15
15
|
import { ResultPanelName } from "./components/arcade-results/arcade-results";
|
|
16
|
+
import { EditorProfile, FeatureSetVariable } from "./utils/profile/editor-profile";
|
|
16
17
|
import { IPredefinedProfile as IPredefinedProfile1 } from "./components";
|
|
17
18
|
export { IEditorProfileDefinition, IPredefinedProfile } from "./utils/profile/types";
|
|
18
19
|
export { ArcadeResult, IEditorTestContext } from "./utils/arcade-executor";
|
|
@@ -22,6 +23,7 @@ export { SidePanelName } from "./components/arcade-editor/arcade-editor";
|
|
|
22
23
|
export { editor, Selection } from "monaco-editor";
|
|
23
24
|
export { IColorRules } from "./utils/arcade-monaco/arcade-theme";
|
|
24
25
|
export { ResultPanelName } from "./components/arcade-results/arcade-results";
|
|
26
|
+
export { EditorProfile, FeatureSetVariable } from "./utils/profile/editor-profile";
|
|
25
27
|
export { IPredefinedProfile as IPredefinedProfile1 } from "./components";
|
|
26
28
|
export namespace Components {
|
|
27
29
|
interface ArcgisArcadeEditor {
|
|
@@ -115,16 +117,6 @@ export namespace Components {
|
|
|
115
117
|
*/
|
|
116
118
|
"suggestions": IEditorCodeSuggestion[] | IEditorCodeSuggestionGroup[] | undefined;
|
|
117
119
|
}
|
|
118
|
-
interface ArcgisArcadeVariables {
|
|
119
|
-
/**
|
|
120
|
-
* Loading state
|
|
121
|
-
*/
|
|
122
|
-
"loading": boolean;
|
|
123
|
-
/**
|
|
124
|
-
* The model id
|
|
125
|
-
*/
|
|
126
|
-
"modelId": string | undefined;
|
|
127
|
-
}
|
|
128
120
|
interface ArcgisCodeEditor {
|
|
129
121
|
/**
|
|
130
122
|
* The instance of the Monaco Editor after the component has been rendered. To determine when a component is rendered, you can use componentOnReady() method. The method returns a Promise that resolves after the component rendered for the first time.
|
|
@@ -177,6 +169,20 @@ export namespace Components {
|
|
|
177
169
|
*/
|
|
178
170
|
"value": string;
|
|
179
171
|
}
|
|
172
|
+
interface ArcgisEditorVariables {
|
|
173
|
+
/**
|
|
174
|
+
* Loading state
|
|
175
|
+
*/
|
|
176
|
+
"loading": boolean;
|
|
177
|
+
/**
|
|
178
|
+
* The model id
|
|
179
|
+
*/
|
|
180
|
+
"modelId": string | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* The variable to display. Currently supports EditorProfile and FeatureSetVariable In the case of a FeatureSetVariable, the UX will show that variable exclusively, excluding the initial profile variables selection panel.
|
|
183
|
+
*/
|
|
184
|
+
"variable": EditorProfile | FeatureSetVariable | undefined;
|
|
185
|
+
}
|
|
180
186
|
interface ArcgisLanguageApiPanel {
|
|
181
187
|
/**
|
|
182
188
|
* The api library to display
|
|
@@ -221,14 +227,14 @@ export interface ArcgisArcadeSuggestionsCustomEvent<T> extends CustomEvent<T> {
|
|
|
221
227
|
detail: T;
|
|
222
228
|
target: HTMLArcgisArcadeSuggestionsElement;
|
|
223
229
|
}
|
|
224
|
-
export interface ArcgisArcadeVariablesCustomEvent<T> extends CustomEvent<T> {
|
|
225
|
-
detail: T;
|
|
226
|
-
target: HTMLArcgisArcadeVariablesElement;
|
|
227
|
-
}
|
|
228
230
|
export interface ArcgisCodeEditorCustomEvent<T> extends CustomEvent<T> {
|
|
229
231
|
detail: T;
|
|
230
232
|
target: HTMLArcgisCodeEditorElement;
|
|
231
233
|
}
|
|
234
|
+
export interface ArcgisEditorVariablesCustomEvent<T> extends CustomEvent<T> {
|
|
235
|
+
detail: T;
|
|
236
|
+
target: HTMLArcgisEditorVariablesElement;
|
|
237
|
+
}
|
|
232
238
|
export interface ArcgisLanguageApiPanelCustomEvent<T> extends CustomEvent<T> {
|
|
233
239
|
detail: T;
|
|
234
240
|
target: HTMLArcgisLanguageApiPanelElement;
|
|
@@ -296,24 +302,6 @@ declare global {
|
|
|
296
302
|
prototype: HTMLArcgisArcadeSuggestionsElement;
|
|
297
303
|
new (): HTMLArcgisArcadeSuggestionsElement;
|
|
298
304
|
};
|
|
299
|
-
interface HTMLArcgisArcadeVariablesElementEventMap {
|
|
300
|
-
"arcgisClose": void;
|
|
301
|
-
"arcgisItemSelected": string;
|
|
302
|
-
}
|
|
303
|
-
interface HTMLArcgisArcadeVariablesElement extends Components.ArcgisArcadeVariables, HTMLStencilElement {
|
|
304
|
-
addEventListener<K extends keyof HTMLArcgisArcadeVariablesElementEventMap>(type: K, listener: (this: HTMLArcgisArcadeVariablesElement, ev: ArcgisArcadeVariablesCustomEvent<HTMLArcgisArcadeVariablesElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
305
|
-
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
306
|
-
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
307
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
308
|
-
removeEventListener<K extends keyof HTMLArcgisArcadeVariablesElementEventMap>(type: K, listener: (this: HTMLArcgisArcadeVariablesElement, ev: ArcgisArcadeVariablesCustomEvent<HTMLArcgisArcadeVariablesElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
309
|
-
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
310
|
-
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
311
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
312
|
-
}
|
|
313
|
-
var HTMLArcgisArcadeVariablesElement: {
|
|
314
|
-
prototype: HTMLArcgisArcadeVariablesElement;
|
|
315
|
-
new (): HTMLArcgisArcadeVariablesElement;
|
|
316
|
-
};
|
|
317
305
|
interface HTMLArcgisCodeEditorElementEventMap {
|
|
318
306
|
"arcgisValueChange": string;
|
|
319
307
|
"arcgisSelectionChange": {
|
|
@@ -335,6 +323,24 @@ declare global {
|
|
|
335
323
|
prototype: HTMLArcgisCodeEditorElement;
|
|
336
324
|
new (): HTMLArcgisCodeEditorElement;
|
|
337
325
|
};
|
|
326
|
+
interface HTMLArcgisEditorVariablesElementEventMap {
|
|
327
|
+
"arcgisClose": void;
|
|
328
|
+
"arcgisItemSelected": string;
|
|
329
|
+
}
|
|
330
|
+
interface HTMLArcgisEditorVariablesElement extends Components.ArcgisEditorVariables, HTMLStencilElement {
|
|
331
|
+
addEventListener<K extends keyof HTMLArcgisEditorVariablesElementEventMap>(type: K, listener: (this: HTMLArcgisEditorVariablesElement, ev: ArcgisEditorVariablesCustomEvent<HTMLArcgisEditorVariablesElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
332
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
333
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
334
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
335
|
+
removeEventListener<K extends keyof HTMLArcgisEditorVariablesElementEventMap>(type: K, listener: (this: HTMLArcgisEditorVariablesElement, ev: ArcgisEditorVariablesCustomEvent<HTMLArcgisEditorVariablesElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
336
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
337
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
338
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
339
|
+
}
|
|
340
|
+
var HTMLArcgisEditorVariablesElement: {
|
|
341
|
+
prototype: HTMLArcgisEditorVariablesElement;
|
|
342
|
+
new (): HTMLArcgisEditorVariablesElement;
|
|
343
|
+
};
|
|
338
344
|
interface HTMLArcgisLanguageApiPanelElementEventMap {
|
|
339
345
|
"arcgisClose": void;
|
|
340
346
|
"arcgisItemSelected": string;
|
|
@@ -392,8 +398,8 @@ declare global {
|
|
|
392
398
|
"arcgis-arcade-editor": HTMLArcgisArcadeEditorElement;
|
|
393
399
|
"arcgis-arcade-results": HTMLArcgisArcadeResultsElement;
|
|
394
400
|
"arcgis-arcade-suggestions": HTMLArcgisArcadeSuggestionsElement;
|
|
395
|
-
"arcgis-arcade-variables": HTMLArcgisArcadeVariablesElement;
|
|
396
401
|
"arcgis-code-editor": HTMLArcgisCodeEditorElement;
|
|
402
|
+
"arcgis-editor-variables": HTMLArcgisEditorVariablesElement;
|
|
397
403
|
"arcgis-language-api-panel": HTMLArcgisLanguageApiPanelElement;
|
|
398
404
|
"arcgis-sql-expression-editor": HTMLArcgisSqlExpressionEditorElement;
|
|
399
405
|
"arcgis-sql-expression-fields": HTMLArcgisSqlExpressionFieldsElement;
|
|
@@ -490,24 +496,6 @@ declare namespace LocalJSX {
|
|
|
490
496
|
*/
|
|
491
497
|
"suggestions"?: IEditorCodeSuggestion[] | IEditorCodeSuggestionGroup[] | undefined;
|
|
492
498
|
}
|
|
493
|
-
interface ArcgisArcadeVariables {
|
|
494
|
-
/**
|
|
495
|
-
* Loading state
|
|
496
|
-
*/
|
|
497
|
-
"loading"?: boolean;
|
|
498
|
-
/**
|
|
499
|
-
* The model id
|
|
500
|
-
*/
|
|
501
|
-
"modelId"?: string | undefined;
|
|
502
|
-
/**
|
|
503
|
-
* Raised when close action has been activated
|
|
504
|
-
*/
|
|
505
|
-
"onArcgisClose"?: (event: ArcgisArcadeVariablesCustomEvent<void>) => void;
|
|
506
|
-
/**
|
|
507
|
-
* Raised when an item has been selected
|
|
508
|
-
*/
|
|
509
|
-
"onArcgisItemSelected"?: (event: ArcgisArcadeVariablesCustomEvent<string>) => void;
|
|
510
|
-
}
|
|
511
499
|
interface ArcgisCodeEditor {
|
|
512
500
|
/**
|
|
513
501
|
* The instance of the Monaco Editor after the component has been rendered. To determine when a component is rendered, you can use componentOnReady() method. The method returns a Promise that resolves after the component rendered for the first time.
|
|
@@ -542,6 +530,28 @@ declare namespace LocalJSX {
|
|
|
542
530
|
*/
|
|
543
531
|
"value"?: string;
|
|
544
532
|
}
|
|
533
|
+
interface ArcgisEditorVariables {
|
|
534
|
+
/**
|
|
535
|
+
* Loading state
|
|
536
|
+
*/
|
|
537
|
+
"loading"?: boolean;
|
|
538
|
+
/**
|
|
539
|
+
* The model id
|
|
540
|
+
*/
|
|
541
|
+
"modelId"?: string | undefined;
|
|
542
|
+
/**
|
|
543
|
+
* Raised when close action has been activated
|
|
544
|
+
*/
|
|
545
|
+
"onArcgisClose"?: (event: ArcgisEditorVariablesCustomEvent<void>) => void;
|
|
546
|
+
/**
|
|
547
|
+
* Raised when an item has been selected
|
|
548
|
+
*/
|
|
549
|
+
"onArcgisItemSelected"?: (event: ArcgisEditorVariablesCustomEvent<string>) => void;
|
|
550
|
+
/**
|
|
551
|
+
* The variable to display. Currently supports EditorProfile and FeatureSetVariable In the case of a FeatureSetVariable, the UX will show that variable exclusively, excluding the initial profile variables selection panel.
|
|
552
|
+
*/
|
|
553
|
+
"variable": EditorProfile | FeatureSetVariable | undefined;
|
|
554
|
+
}
|
|
545
555
|
interface ArcgisLanguageApiPanel {
|
|
546
556
|
/**
|
|
547
557
|
* The api library to display
|
|
@@ -597,8 +607,8 @@ declare namespace LocalJSX {
|
|
|
597
607
|
"arcgis-arcade-editor": ArcgisArcadeEditor;
|
|
598
608
|
"arcgis-arcade-results": ArcgisArcadeResults;
|
|
599
609
|
"arcgis-arcade-suggestions": ArcgisArcadeSuggestions;
|
|
600
|
-
"arcgis-arcade-variables": ArcgisArcadeVariables;
|
|
601
610
|
"arcgis-code-editor": ArcgisCodeEditor;
|
|
611
|
+
"arcgis-editor-variables": ArcgisEditorVariables;
|
|
602
612
|
"arcgis-language-api-panel": ArcgisLanguageApiPanel;
|
|
603
613
|
"arcgis-sql-expression-editor": ArcgisSqlExpressionEditor;
|
|
604
614
|
"arcgis-sql-expression-fields": ArcgisSqlExpressionFields;
|
|
@@ -611,8 +621,8 @@ declare module "@stencil/core" {
|
|
|
611
621
|
"arcgis-arcade-editor": LocalJSX.ArcgisArcadeEditor & JSXBase.HTMLAttributes<HTMLArcgisArcadeEditorElement>;
|
|
612
622
|
"arcgis-arcade-results": LocalJSX.ArcgisArcadeResults & JSXBase.HTMLAttributes<HTMLArcgisArcadeResultsElement>;
|
|
613
623
|
"arcgis-arcade-suggestions": LocalJSX.ArcgisArcadeSuggestions & JSXBase.HTMLAttributes<HTMLArcgisArcadeSuggestionsElement>;
|
|
614
|
-
"arcgis-arcade-variables": LocalJSX.ArcgisArcadeVariables & JSXBase.HTMLAttributes<HTMLArcgisArcadeVariablesElement>;
|
|
615
624
|
"arcgis-code-editor": LocalJSX.ArcgisCodeEditor & JSXBase.HTMLAttributes<HTMLArcgisCodeEditorElement>;
|
|
625
|
+
"arcgis-editor-variables": LocalJSX.ArcgisEditorVariables & JSXBase.HTMLAttributes<HTMLArcgisEditorVariablesElement>;
|
|
616
626
|
"arcgis-language-api-panel": LocalJSX.ArcgisLanguageApiPanel & JSXBase.HTMLAttributes<HTMLArcgisLanguageApiPanelElement>;
|
|
617
627
|
"arcgis-sql-expression-editor": LocalJSX.ArcgisSqlExpressionEditor & JSXBase.HTMLAttributes<HTMLArcgisSqlExpressionEditorElement>;
|
|
618
628
|
"arcgis-sql-expression-fields": LocalJSX.ArcgisSqlExpressionFields & JSXBase.HTMLAttributes<HTMLArcgisSqlExpressionFieldsElement>;
|
|
@@ -143,9 +143,10 @@ export declare abstract class CollectionBasedVariable extends VariableBase {
|
|
|
143
143
|
}
|
|
144
144
|
export declare class GroupOfVariables extends ProfileItemBase {
|
|
145
145
|
variables: (EditorVariable | GroupOfVariables)[];
|
|
146
|
+
isHeader: boolean;
|
|
146
147
|
type: "group";
|
|
147
148
|
isCollection: true;
|
|
148
|
-
constructor(profile: EditorProfile | null | undefined, label: types.IIntlString | string, variables?: (EditorVariable | GroupOfVariables)[]);
|
|
149
|
+
constructor(profile: EditorProfile | null | undefined, label: types.IIntlString | string, variables?: (EditorVariable | GroupOfVariables)[], isHeader?: boolean);
|
|
149
150
|
passFilter(): boolean;
|
|
150
151
|
}
|
|
151
152
|
export declare class DictionaryVariable extends CollectionBasedVariable {
|
|
@@ -57,5 +57,5 @@ export declare const dateLiterals: string[];
|
|
|
57
57
|
export declare const trimKeywords: string[];
|
|
58
58
|
export declare const sqlExprKeywords: string[];
|
|
59
59
|
export declare const sqlExprOperators: string[];
|
|
60
|
-
export declare const sqlExprFunctions: readonly ["CAST", "EXTRACT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "ABS", "ACOS", "ASIN", "ATAN", "CEILING", "COS", "FLOOR", "LOG", "LOG10", "POWER", "ROUND", "SIGN", "SIN", "TAN", "CHAR_LENGTH", "COALESCE", "CONCAT", "LOWER", "POSITION", "TRIM", "UPPER"];
|
|
60
|
+
export declare const sqlExprFunctions: readonly ["CAST", "EXTRACT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "ABS", "ACOS", "ASIN", "ATAN", "CEILING", "COS", "FLOOR", "LOG", "LOG10", "MOD", "NULLIF", "POWER", "ROUND", "SIGN", "SIN", "TAN", "TRUNCATE", "CHAR_LENGTH", "COALESCE", "CONCAT", "LOWER", "POSITION", "SUBSTRING", "TRIM", "UPPER"];
|
|
61
61
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/coding-components",
|
|
3
|
-
"version": "4.31.0-next.
|
|
3
|
+
"version": "4.31.0-next.78",
|
|
4
4
|
"description": "Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -49,22 +49,22 @@
|
|
|
49
49
|
"generate": "stencil generate"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@arcgis/arcade-languageservice": "4.31.0-next.
|
|
53
|
-
"@arcgis/components-controllers": "4.31.0-next.
|
|
54
|
-
"@arcgis/components-utils": "4.31.0-next.
|
|
55
|
-
"@arcgis/languages-api-utils": "4.31.0-next.
|
|
52
|
+
"@arcgis/arcade-languageservice": "4.31.0-next.78",
|
|
53
|
+
"@arcgis/components-controllers": "4.31.0-next.78",
|
|
54
|
+
"@arcgis/components-utils": "4.31.0-next.78",
|
|
55
|
+
"@arcgis/languages-api-utils": "4.31.0-next.78",
|
|
56
56
|
"@stencil/core": "4.19.2",
|
|
57
57
|
"monaco-editor": "0.45.0",
|
|
58
58
|
"vscode-languageserver-types": "^3.17.5"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@arcgis/components-build-utils": "4.31.0-next.
|
|
62
|
-
"@arcgis/components-plugins": "4.31.0-next.
|
|
61
|
+
"@arcgis/components-build-utils": "4.31.0-next.78",
|
|
62
|
+
"@arcgis/components-plugins": "4.31.0-next.78",
|
|
63
63
|
"@arcgis/core": ">=4.31.0-next <4.32",
|
|
64
|
-
"@arcgis/core-adapter": "4.31.0-next.
|
|
64
|
+
"@arcgis/core-adapter": "4.31.0-next.78",
|
|
65
65
|
"@arcgis/sql-expression-sdk": "^1.1.0-next.10",
|
|
66
|
-
"@arcgis/storybook-utils": "4.31.0-next.
|
|
67
|
-
"@arcgis/typescript-config": "4.31.0-next.
|
|
66
|
+
"@arcgis/storybook-utils": "4.31.0-next.78",
|
|
67
|
+
"@arcgis/typescript-config": "4.31.0-next.78",
|
|
68
68
|
"@esri/calcite-components": "^2.11.1",
|
|
69
69
|
"@stencil/react-output-target": "0.5.3",
|
|
70
70
|
"@stencil/sass": "^3.0.12",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"@arcgis/core": ">=4.31.0-next <4.32",
|
|
103
103
|
"@esri/calcite-components": "^2.11.1"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "f47e6937efd499c81e208afc973f63fd8d6917ca"
|
|
106
106
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.77
|
|
5
|
-
*/
|
|
6
|
-
import{r as e,c as i,h as s,H as a,a as t}from"./p-5cd53181.js";import{u as o,a as r}from"./p-1ce37139.js";import{n,z as c}from"./p-9877b739.js";const l=class{constructor(s){e(this,s),this.arcgisScriptChange=i(this,"arcgisScriptChange",3),this.manager=o(this),this._modelId=n(),this._insertAsSnippet=e=>{this._codeEditorElt?.insertSnippet(e.detail).catch(console.error)},this._updateApiLibrary=async()=>{this._apiLibrary=await c.getApiLibraryForModel(this._modelId)},this._onCodeEditorValueChange=e=>{e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)},this._preparing=!1,this._editorProfile=void 0,this._activeAction=void 0,this._apiLibrary=void 0,this.messages=r(),this.profile=void 0,this.script=""}async _messagesChanged(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _profileChanged(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await c.setProfileForModel(this._modelId,this.profile)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(e){this._activeAction=e}_handleActionClick(e){this._setActiveAction(e.target.dataset.panelName)}async componentWillLoad(){await this._updateEditorProfile().catch(console.error)}async componentDidLoad(){await this._updateApiLibrary()}render(){return s(a,{key:"12b766db77f8e34a545e90fedd0138cf1469b66b"},s("div",{key:"152606eaeac85b19c6c2ff0ced1aa1981d507ca1",class:"flex-row flex-adjustable"},s("div",{key:"7205f9adf6501968f05ba2395821ab7bc188bca1",class:"flex-column flex-adjustable"},s("arcgis-code-editor",{key:"1749a95f1126858e11fc2dc2ac35ae2b89e50ce3",language:"arcgis-sql-expression",modelId:this._modelId,ref:e=>this._codeEditorElt=e,value:this.script??"",onArcgisValueChange:this._onCodeEditorValueChange})),"fields"===this._activeAction&&s("arcgis-sql-expression-fields",{key:"66047896f2420bda201ef1cddea74a27d6a09461",class:"side-panel flex-panel border-inline-start",loading:this._preparing,modelId:this._modelId,"data-panel-name":"none",onArcgisFieldSelected:this._insertAsSnippet,onArcgisClose:()=>this._setActiveAction(void 0)}),"functions"===this._activeAction&&s("arcgis-language-api-panel",{key:"46aebbd9fb0c7e0968642c788a7b1c9445c67188",class:"side-panel flex-panel border-inline-start",onArcgisItemSelected:this._insertAsSnippet,onArcgisClose:()=>this._setActiveAction(void 0),loading:this._preparing,apiLibrary:this._apiLibrary,"data-panel-name":"none"}),s("calcite-action-bar",{key:"8451bf2729834205c85efa26d5c55369aba14ac2",class:"side-action-bar border-inline-start",expanded:!1,position:"end"},s("calcite-action",{key:"7134aa5fceb91ce0bfd162b8c6e9aab37b000246",id:"fields-action",text:this.messages.fields??"Fields",icon:"profile-variables",active:"fields"===this._activeAction,"data-panel-name":"fields",onClick:e=>this._handleActionClick(e)}),s("calcite-action",{key:"a910c11382e8ea292916ef3e025165d7e613c799",id:"functions-action",text:this.messages.functions??"Functions",icon:"function",active:"functions"===this._activeAction,"data-panel-name":"functions",onClick:e=>this._handleActionClick(e)}))))}static get assetsDirs(){return["assets"]}get el(){return t(this)}static get watchers(){return{messages:["_messagesChanged"],profile:["_profileChanged"]}}};l.style="arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid var(--calcite-color-border-3);box-sizing:border-box;background-color:var(--calcite-color-foreground-1);height:100%}arcgis-sql-expression-editor .flex-adjustable{flex:1 1 auto;overflow:hidden}arcgis-sql-expression-editor .flex-panel{flex:1 0 auto}arcgis-sql-expression-editor .position-relative{position:relative}arcgis-sql-expression-editor .flex-row{display:flex;flex-direction:row;overflow:hidden}arcgis-sql-expression-editor .flex-column{display:flex;flex-direction:column;overflow:hidden}arcgis-sql-expression-editor .border-inline-start{border-inline-start:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-sql-expression-editor .border-inline-end{border-inline-end:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-sql-expression-editor .side-action-bar{max-width:25%}arcgis-sql-expression-editor .side-panel{max-width:45%;width:600px}arcgis-sql-expression-editor .side-panel calcite-flow{height:100%}";export{l as arcgis_sql_expression_editor}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.77
|
|
5
|
-
*/
|
|
6
|
-
import{D as e,h as t,T as s,y as i,z as n,V as o}from"./p-9877b739.js";import"./p-5cd53181.js";let r=new e;class a{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange((()=>this.stopWorker()))}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,r=new e),this._client=null}static async waitForWorker(){return await r.promise}async _getClientProxy(){if(!this._client){const{languageId:e}=this._defaults;this._worker=t.createWebWorker({moduleId:"SqlExprWorker",label:e,createData:{languageId:e},host:this._defaults.workerHost}),r.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const t=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),t}}var c,l;!function(e){e.ARGS="args",e.CLAUSES="clauses",e.ELSE="else",e.END="end",e.EXPR="expr",e.LEFT="left",e.OPERAND="operand",e.QUALIFIER="qualifier",e.RIGHT="right",e.START="start",e.VALUE="value"}(c||(c={})),function(e){e.CASE_EXPRESSION="case-expression",e.EXPRESSION_LIST="expression-list",e.FUNCTION="function",e.INTERVAL="interval",e.INTERVAL_QUALIFIER="interval-qualifier",e.WHEN_CLAUSE="when-clause",e.UNARY_EXPRESSION="unary-expression",e.BINARY_EXPRESSION="binary-expression"}(l||(l={})),Object.values({date:"DATE",float:"FLOAT",integer:"INTEGER",real:"REAL",smallint:"SMALLINT",time:"TIME",timestamp:"TIMESTAMP",varchar:"VARCHAR"});const h={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},u={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["AND","AS","BETWEEN","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INTEGER","INTERVAL","IS","LEADING","LIKE","MINUTE","MONTH","NOT","NULL","OR","POSITION","REAL","SECOND","SMALLINT","SUBSTRING","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WHEN","WITH","YEAR","ZONE"],operators:["AND","BETWEEN","IN","LIKE","NOT","OR","IS","NULL"],builtinFunctions:["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","POWER","ROUND","SIGN","SIN","TAN","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","TRIM","UPPER"],builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}};class E{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{const s=await this._worker(e.uri),i=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},o=this._defaults.getApiContextForModel(e.uri);return await s.doComplete(e.uri.toString(),n,t,o)}catch(e){return console.error(e),{suggestions:[]}}}}class d{constructor(e,i,{defaults:n,diagnosticService:o}){this._languageId=e,this._worker=i,this._disposables=[],this._listener=new Map,this._diagnosticsService=o,this._defaults=n;const r=e=>{const t=e.getLanguageId();if(t!==this._languageId)return;const i=s((()=>{this._doValidate(e,t).catch((e=>{throw e}))}));this._listener.set(e.uri.toString(),e.onDidChangeContent(i)),this._doValidate(e,t).catch(console.error)},a=e=>{const s=e.uri.toString();t.setModelMarkers(e,this._languageId,[]);const i=this._listener.get(s);i&&(i.dispose(),this._listener.delete(s))};this._disposables.push(t.onDidCreateModel(r)),this._disposables.push(t.onWillDisposeModel((e=>a(e)))),this._disposables.push(t.onDidChangeModelLanguage((e=>{a(e.model),r(e.model)}))),this._disposables.push(n.onDidChange((()=>{t.getModels().forEach((e=>{e.getLanguageId()===this._languageId&&(a(e),r(e))}))}))),this._disposables.push(n.onModelContextDidChange((e=>{t.getModels().forEach((t=>{t.getLanguageId()===this._languageId&&t.uri.toString()===e&&this._doValidate(t,this._languageId).catch(console.error)}))}))),this._disposables.push({dispose:()=>{this._listener.forEach((e=>e.dispose())),this._listener.clear()}}),t.getModels().forEach(r)}async _doValidate(e,s){if(e.isAttachedToEditor())try{const i=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),o=await i.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,o),t.setModelMarkers(e,s,o)}catch(e){console.error(e)}}}let T;async function N(...e){return await a.waitForWorker(),await new Promise(((t,s)=>{T?t(T(...e)):s(new Error("sql expression worker not registered!"))}))}const p=new class{constructor(){this._onDiagnosticsChange=new o}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}};function m(){return p}function I(e){const t=new a(e),s=async(...e)=>await t.getLanguageServiceWorker(...e);T=s,i.setMonarchTokensProvider(n.languageId,u),i.setLanguageConfiguration(n.languageId,h);const o=new E(s,n);i.registerCompletionItemProvider(n.languageId,o),new d(e.languageId,s,{defaults:e,diagnosticService:p})}export{m as getSqlExprDiagnosticService,N as getSqlExprWorker,I as setupMode}
|