@arcgis/coding-components 4.31.0-next.3 → 4.31.0-next.30
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/README.md +22 -3
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +447 -7
- package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-42c8b545.js → p-1cec2132.js} +3 -3
- package/dist/arcgis-coding-components/{p-3ca5ba95.entry.js → p-2186676a.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-86106a9a.js → p-26f5a06d.js} +1 -1
- package/dist/arcgis-coding-components/p-3645c71d.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-8b4298d5.js → p-4ce2a213.js} +2 -2
- package/dist/arcgis-coding-components/{p-111ba641.js → p-57bde3ee.js} +2 -2
- package/dist/arcgis-coding-components/p-57dbf777.js +7 -0
- package/dist/arcgis-coding-components/{p-9132bc9c.entry.js → p-639adfca.entry.js} +2 -2
- package/dist/arcgis-coding-components/p-71d639a6.js +6 -0
- package/dist/arcgis-coding-components/{p-6554a853.js → p-72266079.js} +1 -1
- package/dist/arcgis-coding-components/p-7e2ae261.js +6 -0
- package/dist/arcgis-coding-components/{p-5eb82abf.js → p-8897f806.js} +2 -2
- package/dist/arcgis-coding-components/p-91bb956b.js +6 -0
- package/dist/arcgis-coding-components/p-9b2002c3.js +6 -0
- package/dist/arcgis-coding-components/{p-7c6b3d40.js → p-9c411f13.js} +2 -2
- package/dist/arcgis-coding-components/{p-c4a5150e.js → p-bd309794.js} +3 -3
- package/dist/arcgis-coding-components/{p-4986aaf2.js → p-cc0edd81.js} +3 -3
- package/dist/arcgis-coding-components/{p-93d0e0cc.js → p-e295aee1.js} +12 -12
- package/dist/arcgis-coding-components/p-fe4ee070.js +6 -0
- package/dist/cjs/{app-globals-92c5b499.js → app-globals-e98febdb.js} +1 -1
- package/dist/cjs/arcade-defaults-c6ecbcbe.js +349 -0
- package/dist/cjs/arcade-language-features-eeb1f261.js +274 -0
- package/dist/cjs/{arcade-mode-dfd66b4b.js → arcade-mode-a2d05415.js} +6 -266
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +20 -26
- package/dist/cjs/arcgis-coding-components.cjs.js +5 -5
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
- package/dist/cjs/{css-9b0053c3.js → css-1b37a5a3.js} +1 -1
- package/dist/cjs/{cssMode-62e53008.js → cssMode-e08a9e80.js} +2 -3
- package/dist/cjs/{html-3036e89e.js → html-b55754c8.js} +2 -3
- package/dist/cjs/{htmlMode-c37eee42.js → htmlMode-e335e2e0.js} +2 -3
- package/dist/cjs/{index-be6b2520.js → index-1e6c6daf.js} +43 -15
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-7276c023.js → javascript-5d6e0e2f.js} +3 -4
- package/dist/cjs/{jsonMode-baa295f0.js → jsonMode-5aeae11c.js} +2 -3
- package/dist/cjs/{language-defaults-base-5817af52.js → language-defaults-base-b33c98c5.js} +842 -1062
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{sql-expr-defaults-746bbc5f.js → sql-expr-defaults-2fcbfae4.js} +101 -39
- package/dist/cjs/sql-expr-mode-72880fff.js +1171 -0
- package/dist/cjs/{tsMode-36398912.js → tsMode-5559948f.js} +2 -3
- package/dist/cjs/{typescript-608a420b.js → typescript-6dfdd308.js} +2 -3
- package/dist/components/arcade-defaults.js +238 -4
- package/dist/components/arcade-language-features.js +271 -0
- package/dist/components/arcade-mode.js +4 -264
- package/dist/components/arcade-results.js +3 -3
- package/dist/components/arcade-suggestions.js +2 -2
- package/dist/components/arcade-variables.js +2 -2
- package/dist/components/arcgis-arcade-editor.js +7 -6
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.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-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.js +2 -2
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/{chunk-6TARY3NN.js → chunk-EOMOY2EF.js} +12 -17
- package/dist/components/code-editor.js +16 -23
- package/dist/components/fields.js +22 -4
- package/dist/components/index.d.ts +18 -3
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/language-api-panel.js +2 -2
- package/dist/components/language-defaults-base.js +81 -323
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +89 -24
- package/dist/components/sql-expr-mode.js +1009 -24971
- package/dist/components/sql-expression-fields.js +2 -2
- package/dist/components/useT9n.js +2 -2
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-5e178541.js → app-globals-906d2920.js} +1 -1
- package/dist/esm/arcade-defaults-01c1778e.js +344 -0
- package/dist/esm/arcade-language-features-5d86df55.js +269 -0
- package/dist/esm/{arcade-mode-02336ce9.js → arcade-mode-ffa50b73.js} +3 -263
- package/dist/esm/arcgis-arcade-editor_6.entry.js +21 -27
- package/dist/esm/arcgis-coding-components.js +6 -6
- package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
- package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
- package/dist/esm/{css-e79f1ed1.js → css-e6d12b19.js} +1 -1
- package/dist/esm/{cssMode-cd007d02.js → cssMode-eda5bf61.js} +2 -3
- package/dist/esm/{html-d079d00d.js → html-b5f697d7.js} +2 -3
- package/dist/esm/{htmlMode-ff14e035.js → htmlMode-1b54015e.js} +2 -3
- package/dist/esm/{index-88fc341d.js → index-0ec9c3f1.js} +43 -15
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-69f7c282.js → javascript-f1c7843a.js} +3 -4
- package/dist/esm/{jsonMode-18ddadde.js → jsonMode-2277640b.js} +2 -3
- package/dist/esm/{language-defaults-base-6687d11a.js → language-defaults-base-b508c08f.js} +837 -1062
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{sql-expr-defaults-2cdfe08a.js → sql-expr-defaults-715f6bad.js} +100 -40
- package/dist/esm/sql-expr-mode-3cd5df90.js +1167 -0
- package/dist/esm/{tsMode-c2e5d33a.js → tsMode-075abf4a.js} +2 -3
- package/dist/esm/{typescript-a0fbebf0.js → typescript-22cfacaa.js} +2 -3
- package/dist/loader/cdn.js +2 -3
- package/dist/loader/index.cjs.js +2 -3
- package/dist/loader/index.es2017.js +2 -3
- package/dist/loader/index.js +2 -3
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +13 -3
- package/dist/types/components/arcade-results/arcade-results.d.ts +1 -1
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +1 -1
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +1 -1
- package/dist/types/components/code-editor/code-editor.d.ts +14 -4
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -1
- package/dist/types/components.d.ts +13 -13
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +8 -1
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -8
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
- package/dist/types/utils/fields.d.ts +2 -2
- package/dist/types/utils/profile/editor-profile.d.ts +7 -6
- package/dist/types/utils/profile/types.d.ts +53 -65
- package/dist/types/utils/profile/utils.d.ts +9 -8
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +3 -2
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -11
- package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +0 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +19 -520
- package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +34 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -7
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +75 -77
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +5 -6
- package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +2 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +9 -6
- package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
- package/dist/types/utils/sql-expr-monaco/types.d.ts +6 -12
- package/package.json +19 -19
- package/dist/arcgis-coding-components/p-0105cc95.js +0 -6
- package/dist/arcgis-coding-components/p-5e26a360.js +0 -6
- package/dist/arcgis-coding-components/p-9c7e0089.js +0 -7
- package/dist/arcgis-coding-components/p-b82e98f0.js +0 -6
- package/dist/arcgis-coding-components/p-d353f1ba.entry.js +0 -6
- package/dist/arcgis-coding-components/p-fe6ccfe0.js +0 -6
- package/dist/cjs/arcade-defaults-34e82ff5.js +0 -116
- package/dist/cjs/sql-expr-mode-a9f1b697.js +0 -25135
- package/dist/esm/arcade-defaults-6dac6b30.js +0 -111
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/sql-expr-mode-f10e5a43.js +0 -25132
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -4
- package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +0 -41
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +0 -16
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +0 -26
- package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +0 -37
- package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +0 -11
- package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +0 -122
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +0 -5
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +0 -18
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +0 -6
- package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +0 -156
- package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +0 -150
- package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +0 -1397
- package/dist/types/utils/sql-expr-monaco/libraries/date/properties/index.d.ts +0 -59
- package/dist/types/utils/sql-expr-monaco/libraries/numeric/properties/index.d.ts +0 -295
- package/dist/types/utils/sql-expr-monaco/libraries/string/properties/index.d.ts +0 -135
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-adapter.d.ts +0 -3
- package/dist/types/utils/sql-expr-profile/predefined-profile.d.ts +0 -2
|
@@ -1,14 +1,64 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.30
|
|
5
5
|
*/
|
|
6
|
-
import { i as isPredefinedProfile,
|
|
6
|
+
import { f as fieldsToProfileValues, i as isPredefinedProfile, b as isFeatureSetDefinition, L as LanguageDefaultsBase, E as EditorProfile } from './language-defaults-base.js';
|
|
7
|
+
import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
|
|
7
8
|
import { f as fetchT9nStringsBundle } from './index2.js';
|
|
8
9
|
import { Uri } from 'monaco-editor';
|
|
9
|
-
import { InsertTextMode, InsertTextFormat, CompletionItemKind, MarkupKind } from 'vscode-languageserver-types';
|
|
10
10
|
import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
|
|
11
11
|
|
|
12
|
+
// #region convert editor profile to apiProfile
|
|
13
|
+
/**
|
|
14
|
+
* Converts an editor profile to an api profile.
|
|
15
|
+
* The api profile is an optimized version of the editor profile designed for minimal data transfer between the main thread and the worker.
|
|
16
|
+
*/
|
|
17
|
+
const sqlExprEditorToApiProfile = (editorProfile) => {
|
|
18
|
+
const { apiVersion, bundles, hiddenApiItems } = editorProfile.toEditorProfileDefinition();
|
|
19
|
+
const variable = editorProfile.variables[0];
|
|
20
|
+
if (!variable || !(variable.type === "featureSet")) {
|
|
21
|
+
throw Error("No variable found in the editor profile");
|
|
22
|
+
}
|
|
23
|
+
const hydratedVariable = variableToApiProfile(variable);
|
|
24
|
+
return {
|
|
25
|
+
apiVersion,
|
|
26
|
+
bundles,
|
|
27
|
+
variables: [hydratedVariable],
|
|
28
|
+
hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()),
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
function variableToApiProfile(variable) {
|
|
32
|
+
const { name } = variable;
|
|
33
|
+
const description = variable.getDescription();
|
|
34
|
+
const { definition } = variable.toProfileVariableDefinition();
|
|
35
|
+
const resultCompletion = {
|
|
36
|
+
label: name,
|
|
37
|
+
detail: name,
|
|
38
|
+
insertText: name,
|
|
39
|
+
insertTextMode: InsertTextMode.asIs,
|
|
40
|
+
insertTextFormat: InsertTextFormat.PlainText,
|
|
41
|
+
kind: CompletionItemKind.Field,
|
|
42
|
+
};
|
|
43
|
+
const result = {
|
|
44
|
+
name,
|
|
45
|
+
description,
|
|
46
|
+
type: "dictionary",
|
|
47
|
+
properties: [],
|
|
48
|
+
completion: resultCompletion,
|
|
49
|
+
};
|
|
50
|
+
// No fields or definition, then it will be a feature without any known fields
|
|
51
|
+
if (!definition || !("fields" in definition)) {
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
// Create properties for the fields
|
|
55
|
+
// Also improve the feature completion documentation
|
|
56
|
+
// TODO: should we add aliases to completion? what about domains?
|
|
57
|
+
const [properties, featureCompletionDescription] = fieldsToProfileValues(definition.fields, description);
|
|
58
|
+
result.properties = properties;
|
|
59
|
+
resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
12
62
|
const tempHardcodedProfile = {
|
|
13
63
|
en: {
|
|
14
64
|
id: "field-calculation",
|
|
@@ -57,16 +107,40 @@ async function convertToEditorProfileDefinition(predefinedProfile, locale = "en"
|
|
|
57
107
|
});
|
|
58
108
|
return editorProfile;
|
|
59
109
|
}
|
|
110
|
+
// #endregion
|
|
111
|
+
// #region profile utils
|
|
112
|
+
/**
|
|
113
|
+
* util to retrieve fields from the $layer variable in the api context.
|
|
114
|
+
*/
|
|
115
|
+
const getFieldsFromLayerVariable = (profile) => {
|
|
116
|
+
if (profile.variables) {
|
|
117
|
+
const layerVar = profile.variables.find((variable) => variable.name === "$layer" && variable.type === "dictionary");
|
|
118
|
+
return layerVar.properties ?? [];
|
|
119
|
+
}
|
|
120
|
+
return [];
|
|
121
|
+
};
|
|
122
|
+
// #endregion
|
|
60
123
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Returns the sql-expression worker for the model.
|
|
126
|
+
* Example:
|
|
127
|
+
* ```ts
|
|
128
|
+
* const sqlExpressionWorker = await getSqlExpressionWorker(model.uri);
|
|
129
|
+
* ```
|
|
130
|
+
* @returns sql-expression worker
|
|
131
|
+
*/
|
|
132
|
+
async function getSqlExprWorker(uri) {
|
|
133
|
+
const mode = await getMode();
|
|
134
|
+
return await mode.getSqlExprWorker(uri);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Request the sql-expression mode
|
|
138
|
+
* @returns sql-expression mode module
|
|
139
|
+
*/
|
|
140
|
+
async function getMode() {
|
|
141
|
+
return await import('./sql-expr-mode.js');
|
|
142
|
+
}
|
|
64
143
|
|
|
65
|
-
// const defaultContext: ApiContext = {
|
|
66
|
-
// locale: "en",
|
|
67
|
-
// };
|
|
68
|
-
// eslint-disable-next-line no-template-curly-in-string
|
|
69
|
-
const apiPathTemplate = "${assetsPath}/api/sql-expression-api.t9n.${locale}.json";
|
|
70
144
|
const languageId = "arcgis-sql-expression";
|
|
71
145
|
class SqlExprDefaults extends LanguageDefaultsBase {
|
|
72
146
|
constructor() {
|
|
@@ -79,7 +153,6 @@ class SqlExprDefaults extends LanguageDefaultsBase {
|
|
|
79
153
|
updateFeatureLayerForModel(modelId, layer) {
|
|
80
154
|
const key = this._getApiKey(modelId);
|
|
81
155
|
this._layerMap.set(key, layer);
|
|
82
|
-
this._onDidChange.fire(this);
|
|
83
156
|
}
|
|
84
157
|
setLanguageOptions(languageOptions) {
|
|
85
158
|
this._languageOptions = languageOptions;
|
|
@@ -102,7 +175,7 @@ class SqlExprDefaults extends LanguageDefaultsBase {
|
|
|
102
175
|
const key = this._getApiKey(modelId);
|
|
103
176
|
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
104
177
|
this._profileMap.set(key, editorProfile);
|
|
105
|
-
const apiProfile =
|
|
178
|
+
const apiProfile = sqlExprEditorToApiProfile(editorProfile);
|
|
106
179
|
this.updateApiContextForModel(modelId, {
|
|
107
180
|
locale: apiContext.locale,
|
|
108
181
|
profile: apiProfile,
|
|
@@ -114,18 +187,10 @@ class SqlExprDefaults extends LanguageDefaultsBase {
|
|
|
114
187
|
}
|
|
115
188
|
async getApiLibrary(modelId) {
|
|
116
189
|
const uri = Uri.parse(modelId);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
service = new g({
|
|
120
|
-
assetsPath: getAssetPath("./assets/sql-expression-editor"),
|
|
121
|
-
languageId,
|
|
122
|
-
apiPathTemplate,
|
|
123
|
-
});
|
|
124
|
-
this._apiService = service;
|
|
125
|
-
}
|
|
126
|
-
return await service.getApiLibrary(this.getApiContextForModel(uri));
|
|
190
|
+
const worker = await getSqlExprWorker(uri);
|
|
191
|
+
return await worker.getApiLibrary(this.getApiContextForModel(uri));
|
|
127
192
|
}
|
|
128
193
|
}
|
|
129
194
|
const sqlExprDefaults = new SqlExprDefaults();
|
|
130
195
|
|
|
131
|
-
export { sqlExprDefaults as s };
|
|
196
|
+
export { getFieldsFromLayerVariable as a, getMode as g, sqlExprDefaults as s };
|